60 lines
5.6 MiB
Plaintext
60 lines
5.6 MiB
Plaintext
function _array_like_to_array(arr1,len){if(len==null||len>arr1.length)len=arr1.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr1[i];return arr2}function _array_with_holes(arr1){if(Array.isArray(arr1))return arr1}function _array_without_holes(arr1){if(Array.isArray(arr1))return _array_like_to_array(arr1)}function _assert_this_initialized(self1){if(self1===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self1}function _async_generator(gen){var front,back;function send(key,arg){return new Promise(function(resolve,reject){var request={key:key,arg:arg,resolve:resolve,reject:reject,next:null};if(back)back=back.next=request;else{front=back=request;resume(key,arg)}})}function resume(key,arg){try{var result=gen[key](arg);var value=result.value;var overloaded=value instanceof _overload_yield;Promise.resolve(overloaded?value.v:value).then(function(arg){if(overloaded){var nextKey=key==="return"?"return":"next";if(!value.k||arg.done)return resume(nextKey,arg);else arg=gen[nextKey](arg).value}settle(result.done?"return":"normal",arg)},function(err){resume("throw",err)})}catch(err){settle("throw",err)}}function settle(type,value){switch(type){case"return":front.resolve({value:value,done:true});break;case"throw":front.reject(value);break;default:front.resolve({value:value,done:false});break}front=front.next;if(front)resume(front.key,front.arg);else back=null}this._invoke=send;if(typeof gen.return!=="function")this.return=undefined}_async_generator.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};_async_generator.prototype.next=function(arg){return this._invoke("next",arg)};_async_generator.prototype.throw=function(arg){return this._invoke("throw",arg)};_async_generator.prototype.return=function(arg){return this._invoke("return",arg)};function _async_iterator(iterable){var method,async,sync,retry=2;for("undefined"!=typeof Symbol&&(async=Symbol.asyncIterator,sync=Symbol.iterator);retry--;){if(async&&null!=(method=iterable[async]))return method.call(iterable);if(sync&&null!=(method=iterable[sync]))return new AsyncFromSyncIterator(method.call(iterable));async="@@asyncIterator",sync="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(s){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var done=r.done;return Promise.resolve(r.value).then(function(value){return{value:value,done:done}})}return AsyncFromSyncIterator=function(s){this.s=s,this.n=s.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(value){var ret1=this.s.return;return void 0===ret1?Promise.resolve({value:value,done:!0}):AsyncFromSyncIteratorContinuation(ret1.apply(this.s,arguments))},throw:function(value){var thr=this.s.return;return void 0===thr?Promise.reject(value):AsyncFromSyncIteratorContinuation(thr.apply(this.s,arguments))}},new AsyncFromSyncIterator(s)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done){resolve(value)}else{Promise.resolve(value).then(_next,_throw)}}function _async_to_generator(fn1){return function(){var self1=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn1.apply(self1,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(undefined)})}}function _await_async_generator(value){return new _overload_yield(value,0)}function _call_super(_this,derived,args){derived=_get_prototype_of(derived);return _possible_constructor_return(_this,_is_native_reflect_construct()?Reflect.construct(derived,args||[],_get_prototype_of(_this).constructor):derived.apply(_this,args))}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _construct(Parent,args,Class){if(_is_native_reflect_construct()){_construct=Reflect.construct}else{_construct=function construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor;if(Class)_set_prototype_of(instance,Class.prototype);return instance}}return _construct.apply(null,arguments)}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _define_enumerable_properties(obj,descs){for(var key in descs){var desc=descs[key];desc.configurable=desc.enumerable=true;if("value"in desc)desc.writable=true;Object.defineProperty(obj,key,desc)}if(Object.getOwnPropertySymbols){var objectSymbols=Object.getOwnPropertySymbols(descs);for(var i=0;i<objectSymbols.length;i++){var sym=objectSymbols[i];var desc=descs[sym];desc.configurable=desc.enumerable=true;if("value"in desc)desc.writable=true;Object.defineProperty(obj,sym,desc)}}return obj}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _get(target,property,receiver){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get}else{_get=function get1(target,property,receiver){var base=_super_prop_base(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(receiver||target)}return desc.value}}return _get(target,property,receiver||target)}function _get_prototype_of(o){_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _get_prototype_of(o)}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_set_prototype_of(subClass,superClass)}function _instanceof(left,right){if(right!=null&&typeof Symbol!=="undefined"&&right[Symbol.hasInstance]){return!!right[Symbol.hasInstance](left)}else{return left instanceof right}}function _is_native_function(fn1){return Function.toString.call(fn1).indexOf("[native code]")!==-1}function _iterable_to_array(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _iterable_to_array_limit(arr1,i){var _i1=arr1==null?null:typeof Symbol!=="undefined"&&arr1[Symbol.iterator]||arr1["@@iterator"];if(_i1==null)return;var _arr=[];var _n=true;var _d1=false;var _s1,_e1;try{for(_i1=_i1.call(arr1);!(_n=(_s1=_i1.next()).done);_n=true){_arr.push(_s1.value);if(i&&_arr.length===i)break}}catch(err){_d1=true;_e1=err}finally{try{if(!_n&&_i1["return"]!=null)_i1["return"]()}finally{if(_d1)throw _e1}}return _arr}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _object_without_properties(source,excluded){if(source==null)return{};var target={},sourceKeys,key,i;if(typeof Reflect!=="undefined"&&Reflect.ownKeys){sourceKeys=Reflect.ownKeys(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){sourceKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _object_without_properties_loose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.getOwnPropertyNames(source),key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}return target}function _overload_yield(value,kind){this.v=value;this.k=kind}function _possible_constructor_return(self1,call){if(call&&(_type_of(call)==="object"||typeof call==="function")){return call}return _assert_this_initialized(self1)}function _set_prototype_of(o,p){_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){o.__proto__=p;return o};return _set_prototype_of(o,p)}function _sliced_to_array(arr1,i){return _array_with_holes(arr1)||_iterable_to_array_limit(arr1,i)||_unsupported_iterable_to_array(arr1,i)||_non_iterable_rest()}function _super_prop_base(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_get_prototype_of(object);if(object===null)break}return object}function _tagged_template_literal(strings,raw){if(!raw){raw=strings.slice(0)}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}function _to_array(arr1){return _array_with_holes(arr1)||_iterable_to_array(arr1)||_unsupported_iterable_to_array(arr1)||_non_iterable_rest()}function _to_consumable_array(arr1){return _array_without_holes(arr1)||_iterable_to_array(arr1)||_unsupported_iterable_to_array(arr1)||_non_iterable_spread()}function _to_primitive(input,hint){if(_type_of(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_type_of(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}function _to_property_key(arg){var key=_to_primitive(arg,"string");return _type_of(key)==="symbol"?key:String(key)}function _type_of(obj){"@swc/helpers - typeof";return obj&&typeof Symbol!=="undefined"&&obj.constructor===Symbol?"symbol":typeof obj}function _unsupported_iterable_to_array(o,minLen){if(!o)return;if(typeof o==="string")return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}function _wrap_async_generator(fn1){return function(){return new _async_generator(fn1.apply(this,arguments))}}function _wrap_native_super(Class){var _cache=typeof Map==="function"?new Map:undefined;_wrap_native_super=function wrapNativeSuper(Class){if(Class===null||!_is_native_function(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_get_prototype_of(this).constructor)}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _set_prototype_of(Wrapper,Class)};return _wrap_native_super(Class)}function _is_native_reflect_construct(){try{var result=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(_){}return(_is_native_reflect_construct=function(){return!!result})()}function _ts_generator(thisArg,body){var f10,y,t,_={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},g=Object.create((typeof Iterator==="function"?Iterator:Object).prototype),d=Object.defineProperty;return d(g,"next",{value:verb(0)}),d(g,"throw",{value:verb(1)}),d(g,"return",{value:verb(2)}),typeof Symbol==="function"&&d(g,Symbol.iterator,{value:function(){return this}}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f10)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f10=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f10=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}function _ts_values(o){var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")}function _templateObject(){var data=_tagged_template_literal(["","",""]);_templateObject=function _templateObject1(){return data};return data}function _templateObject1(){var data=_tagged_template_literal(["[","]"]);_templateObject1=function _templateObject1(){return data};return data}function _templateObject2(){var data=_tagged_template_literal([".","[","]"]);_templateObject2=function _templateObject1(){return data};return data}function _templateObject3(){var data=_tagged_template_literal(["\n"],["\\n"]);_templateObject3=function _templateObject1(){return data};return data}function _templateObject4(){var data=_tagged_template_literal(["","",""]);_templateObject4=function _templateObject1(){return data};return data}function _templateObject5(){var data=_tagged_template_literal(["",""," "," = ",";",""]);_templateObject5=function _templateObject1(){return data};return data}function _templateObject6(){var data=_tagged_template_literal(["","","",""]);_templateObject6=function _templateObject1(){return data};return data}function _templateObject7(){var data=_tagged_template_literal(["!",""]);_templateObject7=function _templateObject1(){return data};return data}function _templateObject8(){var data=_tagged_template_literal([""," "," ",""]);_templateObject8=function _templateObject1(){return data};return data}function _templateObject9(){var data=_tagged_template_literal(["(",")"]);_templateObject9=function _templateObject1(){return data};return data}function _templateObject10(){var data=_tagged_template_literal(["",".length"]);_templateObject10=function _templateObject1(){return data};return data}function _templateObject11(){var data=_tagged_template_literal(["","[","]"]);_templateObject11=function _templateObject1(){return data};return data}function _templateObject12(){var data=_tagged_template_literal(["Object.keys(",")"]);_templateObject12=function _templateObject1(){return data};return data}function _templateObject13(){var data=_tagged_template_literal(["",""]);_templateObject13=function _templateObject1(){return data};return data}function _templateObject14(){var data=_tagged_template_literal(["","","",""]);_templateObject14=function _templateObject1(){return data};return data}function _templateObject15(){var data=_tagged_template_literal(["{}"]);_templateObject15=function _templateObject1(){return data};return data}function _templateObject16(){var data=_tagged_template_literal(["","",""]);_templateObject16=function _templateObject1(){return data};return data}function _templateObject17(){var data=_tagged_template_literal(['"[" + ',' + "]"']);_templateObject17=function _templateObject1(){return data};return data}function _templateObject18(){var data=_tagged_template_literal(['"[\'" + ',' + "\']"']);_templateObject18=function _templateObject1(){return data};return data}function _templateObject19(){var data=_tagged_template_literal(['"/" + ',""]);_templateObject19=function _templateObject1(){return data};return data}function _templateObject20(){var data=_tagged_template_literal(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")']);_templateObject20=function _templateObject1(){return data};return data}function _templateObject21(){var data=_tagged_template_literal([""," !== true && "," !== undefined"]);_templateObject21=function _templateObject1(){return data};return data}function _templateObject22(){var data=_tagged_template_literal([""," === true"]);_templateObject22=function _templateObject1(){return data};return data}function _templateObject23(){var data=_tagged_template_literal([""," || {}"]);_templateObject23=function _templateObject1(){return data};return data}function _templateObject24(){var data=_tagged_template_literal(["Object.assign(",", ",")"]);_templateObject24=function _templateObject1(){return data};return data}function _templateObject25(){var data=_tagged_template_literal([""," !== true"]);_templateObject25=function _templateObject1(){return data};return data}function _templateObject26(){var data=_tagged_template_literal([""," || {}"]);_templateObject26=function _templateObject1(){return data};return data}function _templateObject27(){var data=_tagged_template_literal([""," !== true && "," !== undefined"]);_templateObject27=function _templateObject1(){return data};return data}function _templateObject28(){var data=_tagged_template_literal([""," === true ? true : "," > "," ? "," : ",""]);_templateObject28=function _templateObject1(){return data};return data}function _templateObject29(){var data=_tagged_template_literal([""," !== true"]);_templateObject29=function _templateObject1(){return data};return data}function _templateObject30(){var data=_tagged_template_literal([""," > "," ? "," : ",""]);_templateObject30=function _templateObject1(){return data};return data}function _templateObject31(){var data=_tagged_template_literal(["[","]"]);_templateObject31=function _templateObject1(){return data};return data}function _templateObject32(){var data=_tagged_template_literal([""," !== null"]);_templateObject32=function _templateObject1(){return data};return data}function _templateObject33(){var data=_tagged_template_literal(["",".length"]);_templateObject33=function _templateObject1(){return data};return data}function _templateObject34(){var data=_tagged_template_literal(["","[","]"]);_templateObject34=function _templateObject1(){return data};return data}function _templateObject35(){var data=_tagged_template_literal(["",".instancePath === undefined"]);_templateObject35=function _templateObject1(){return data};return data}function _templateObject36(){var data=_tagged_template_literal(["",".instancePath"]);_templateObject36=function _templateObject1(){return data};return data}function _templateObject37(){var data=_tagged_template_literal(["",".schemaPath"]);_templateObject37=function _templateObject1(){return data};return data}function _templateObject38(){var data=_tagged_template_literal(["","/",""]);_templateObject38=function _templateObject1(){return data};return data}function _templateObject39(){var data=_tagged_template_literal(["",".schema"]);_templateObject39=function _templateObject1(){return data};return data}function _templateObject40(){var data=_tagged_template_literal(["",".data"]);_templateObject40=function _templateObject1(){return data};return data}function _templateObject41(){var data=_tagged_template_literal([""," === null"]);_templateObject41=function _templateObject1(){return data};return data}function _templateObject42(){var data=_tagged_template_literal(["[","]"]);_templateObject42=function _templateObject1(){return data};return data}function _templateObject43(){var data=_tagged_template_literal(["",".push(",")"]);_templateObject43=function _templateObject1(){return data};return data}function _templateObject44(){var data=_tagged_template_literal(["","++"]);_templateObject44=function _templateObject1(){return data};return data}function _templateObject45(){var data=_tagged_template_literal(["new ","(",")"]);_templateObject45=function _templateObject1(){return data};return data}function _templateObject46(){var data=_tagged_template_literal(["",".errors"]);_templateObject46=function _templateObject1(){return data};return data}function _templateObject47(){var data=_tagged_template_literal(["{}"]);_templateObject47=function _templateObject1(){return data};return data}function _templateObject48(){var data=_tagged_template_literal(["","",""]);_templateObject48=function _templateObject1(){return data};return data}function _templateObject49(){var data=_tagged_template_literal(["","/",""]);_templateObject49=function _templateObject1(){return data};return data}function _templateObject50(){var data=_tagged_template_literal(["","",""]);_templateObject50=function _templateObject1(){return data};return data}function _templateObject51(){var data=_tagged_template_literal(["{}"]);_templateObject51=function _templateObject1(){return data};return data}function _templateObject52(){var data=_tagged_template_literal(["","",""]);_templateObject52=function _templateObject1(){return data};return data}function _templateObject53(){var data=_tagged_template_literal(['must pass "','" keyword validation']);_templateObject53=function _templateObject1(){return data};return data}function _templateObject54(){var data=_tagged_template_literal(['"','" keyword must be '," ($data)"]);_templateObject54=function _templateObject1(){return data};return data}function _templateObject55(){var data=_tagged_template_literal(['"','" keyword is invalid ($data)']);_templateObject55=function _templateObject1(){return data};return data}function _templateObject56(){var data=_tagged_template_literal(["",".errors"]);_templateObject56=function _templateObject1(){return data};return data}function _templateObject57(){var data=_tagged_template_literal(["typeof ",""]);_templateObject57=function _templateObject1(){return data};return data}function _templateObject58(){var data=_tagged_template_literal(["undefined"]);_templateObject58=function _templateObject1(){return data};return data}function _templateObject59(){var data=_tagged_template_literal([""," == 'object' && Array.isArray(",") && ",".length == 1"]);_templateObject59=function _templateObject1(){return data};return data}function _templateObject60(){var data=_tagged_template_literal(["","[0]"]);_templateObject60=function _templateObject1(){return data};return data}function _templateObject61(){var data=_tagged_template_literal(["typeof ",""]);_templateObject61=function _templateObject1(){return data};return data}function _templateObject62(){var data=_tagged_template_literal([""," !== undefined"]);_templateObject62=function _templateObject1(){return data};return data}function _templateObject63(){var data=_tagged_template_literal([""," !== undefined"]);_templateObject63=function _templateObject1(){return data};return data}function _templateObject64(){var data=_tagged_template_literal(["",' == "number" || ',' == "boolean"']);_templateObject64=function _templateObject1(){return data};return data}function _templateObject65(){var data=_tagged_template_literal(['"" + ',""]);_templateObject65=function _templateObject1(){return data};return data}function _templateObject66(){var data=_tagged_template_literal([""," === null"]);_templateObject66=function _templateObject1(){return data};return data}function _templateObject67(){var data=_tagged_template_literal(['""']);_templateObject67=function _templateObject1(){return data};return data}function _templateObject68(){var data=_tagged_template_literal(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"]);_templateObject68=function _templateObject1(){return data};return data}function _templateObject69(){var data=_tagged_template_literal(["+",""]);_templateObject69=function _templateObject1(){return data};return data}function _templateObject70(){var data=_tagged_template_literal(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"]);_templateObject70=function _templateObject1(){return data};return data}function _templateObject71(){var data=_tagged_template_literal(["+",""]);_templateObject71=function _templateObject1(){return data};return data}function _templateObject72(){var data=_tagged_template_literal(["",' === "false" || '," === 0 || "," === null"]);_templateObject72=function _templateObject1(){return data};return data}function _templateObject73(){var data=_tagged_template_literal(["",' === "true" || '," === 1"]);_templateObject73=function _templateObject1(){return data};return data}function _templateObject74(){var data=_tagged_template_literal(["",' === "" || '," === 0 || "," === false"]);_templateObject74=function _templateObject1(){return data};return data}function _templateObject75(){var data=_tagged_template_literal(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"]);_templateObject75=function _templateObject1(){return data};return data}function _templateObject76(){var data=_tagged_template_literal(["[","]"]);_templateObject76=function _templateObject1(){return data};return data}function _templateObject77(){var data=_tagged_template_literal([""," !== undefined"]);_templateObject77=function _templateObject1(){return data};return data}function _templateObject78(){var data=_tagged_template_literal(["","[","]"]);_templateObject78=function _templateObject1(){return data};return data}function _templateObject79(){var data=_tagged_template_literal([""," "," null"]);_templateObject79=function _templateObject1(){return data};return data}function _templateObject80(){var data=_tagged_template_literal(["Array.isArray(",")"]);_templateObject80=function _templateObject1(){return data};return data}function _templateObject81(){var data=_tagged_template_literal([""," && typeof ",' == "object" && !Array.isArray(',")"]);_templateObject81=function _templateObject1(){return data};return data}function _templateObject82(){var data=_tagged_template_literal(["!("," % 1) && !isNaN(",")"]);_templateObject82=function _templateObject1(){return data};return data}function _templateObject83(){var data=_tagged_template_literal(["typeof "," "," ",""]);_templateObject83=function _templateObject1(){return data};return data}function _templateObject84(){var data=_tagged_template_literal(["typeof ",' == "number"']);_templateObject84=function _templateObject1(){return data};return data}function _templateObject85(){var data=_tagged_template_literal(["isFinite(",")"]);_templateObject85=function _templateObject1(){return data};return data}function _templateObject86(){var data=_tagged_template_literal(["typeof ",' != "object"']);_templateObject86=function _templateObject1(){return data};return data}function _templateObject87(){var data=_tagged_template_literal(["!"," || ",""]);_templateObject87=function _templateObject1(){return data};return data}function _templateObject88(){var data=_tagged_template_literal(["{type: ","}"]);_templateObject88=function _templateObject1(){return data};return data}function _templateObject89(){var data=_tagged_template_literal(["{type: ","}"]);_templateObject89=function _templateObject1(){return data};return data}function _templateObject90(){var data=_tagged_template_literal(["","",""]);_templateObject90=function _templateObject1(){return data};return data}function _templateObject91(){var data=_tagged_template_literal([""," === undefined"]);_templateObject91=function _templateObject1(){return data};return data}function _templateObject92(){var data=_tagged_template_literal([""," || "," === null || ",' === ""']);_templateObject92=function _templateObject1(){return data};return data}function _templateObject93(){var data=_tagged_template_literal([""," = ",""]);_templateObject93=function _templateObject1(){return data};return data}function _templateObject94(){var data=_tagged_template_literal(["",""]);_templateObject94=function _templateObject1(){return data};return data}function _templateObject95(){var data=_tagged_template_literal([""," = ",""]);_templateObject95=function _templateObject1(){return data};return data}function _templateObject96(){var data=_tagged_template_literal(["Object.prototype.hasOwnProperty"]);_templateObject96=function _templateObject1(){return data};return data}function _templateObject97(){var data=_tagged_template_literal(["",".call(",", ",")"]);_templateObject97=function _templateObject1(){return data};return data}function _templateObject98(){var data=_tagged_template_literal(["",""," !== undefined"]);_templateObject98=function _templateObject1(){return data};return data}function _templateObject99(){var data=_tagged_template_literal([""," && ",""]);_templateObject99=function _templateObject1(){return data};return data}function _templateObject100(){var data=_tagged_template_literal(["",""," === undefined"]);_templateObject100=function _templateObject1(){return data};return data}function _templateObject101(){var data=_tagged_template_literal(["",", ",", ","",""]);_templateObject101=function _templateObject1(){return data};return data}function _templateObject102(){var data=_tagged_template_literal(["",", ",""]);_templateObject102=function _templateObject1(){return data};return data}function _templateObject103(){var data=_tagged_template_literal(["",".call(",", ",")"]);_templateObject103=function _templateObject1(){return data};return data}function _templateObject104(){var data=_tagged_template_literal(["","(",")"]);_templateObject104=function _templateObject1(){return data};return data}function _templateObject105(){var data=_tagged_template_literal(["","(",", ",")"]);_templateObject105=function _templateObject1(){return data};return data}function _templateObject106(){var data=_tagged_template_literal(["",".length"]);_templateObject106=function _templateObject1(){return data};return data}function _templateObject107(){var data=_tagged_template_literal([""," || ",""]);_templateObject107=function _templateObject1(){return data};return data}function _templateObject108(){var data=_tagged_template_literal(["new RegExp"]);_templateObject108=function _templateObject1(){return data};return data}function _templateObject109(){var data=_tagged_template_literal(["await "]);_templateObject109=function _templateObject1(){return data};return data}function _templateObject110(){var data=_tagged_template_literal([""," instanceof ",""]);_templateObject110=function _templateObject1(){return data};return data}function _templateObject111(){var data=_tagged_template_literal(["",".errors"]);_templateObject111=function _templateObject1(){return data};return data}function _templateObject112(){var data=_tagged_template_literal(["",".errors"]);_templateObject112=function _templateObject1(){return data};return data}function _templateObject113(){var data=_tagged_template_literal(["await "]);_templateObject113=function _templateObject1(){return data};return data}function _templateObject114(){var data=_tagged_template_literal(["","",""]);_templateObject114=function _templateObject1(){return data};return data}function _templateObject115(){var data=_tagged_template_literal(["","[","]"]);_templateObject115=function _templateObject1(){return data};return data}function _templateObject116(){var data=_tagged_template_literal(["Array.isArray(",")"]);_templateObject116=function _templateObject1(){return data};return data}function _templateObject117(){var data=_tagged_template_literal([""," === null ? "," : ",".concat(",")"]);_templateObject117=function _templateObject1(){return data};return data}function _templateObject118(){var data=_tagged_template_literal(["",".length"]);_templateObject118=function _templateObject1(){return data};return data}function _templateObject119(){var data=_tagged_template_literal(["","",""]);_templateObject119=function _templateObject1(){return data};return data}function _templateObject120(){var data=_tagged_template_literal(["","","",""]);_templateObject120=function _templateObject1(){return data};return data}function _templateObject121(){var data=_tagged_template_literal(["","",""]);_templateObject121=function _templateObject1(){return data};return data}function _templateObject122(){var data=_tagged_template_literal(["","",""]);_templateObject122=function _templateObject1(){return data};return data}function _templateObject123(){var data=_tagged_template_literal(["",""]);_templateObject123=function _templateObject1(){return data};return data}function _templateObject124(){var data=_tagged_template_literal(["",", ",""]);_templateObject124=function _templateObject1(){return data};return data}function _templateObject125(){var data=_tagged_template_literal(['"use strict"; ',""]);_templateObject125=function _templateObject1(){return data};return data}function _templateObject126(){var data=_tagged_template_literal(["",", ",""]);_templateObject126=function _templateObject1(){return data};return data}function _templateObject127(){var data=_tagged_template_literal([", ","={}"]);_templateObject127=function _templateObject1(){return data};return data}function _templateObject128(){var data=_tagged_template_literal(["{",'="", ',", ",", ","=","","}={}"]);_templateObject128=function _templateObject1(){return data};return data}function _templateObject129(){var data=_tagged_template_literal(["",".",""]);_templateObject129=function _templateObject1(){return data};return data}function _templateObject130(){var data=_tagged_template_literal(["",".",""]);_templateObject130=function _templateObject1(){return data};return data}function _templateObject131(){var data=_tagged_template_literal(["",".",""]);_templateObject131=function _templateObject1(){return data};return data}function _templateObject132(){var data=_tagged_template_literal(["",".",""]);_templateObject132=function _templateObject1(){return data};return data}function _templateObject133(){var data=_tagged_template_literal(["",".",""]);_templateObject133=function _templateObject1(){return data};return data}function _templateObject134(){var data=_tagged_template_literal(['""']);_templateObject134=function _templateObject1(){return data};return data}function _templateObject135(){var data=_tagged_template_literal(["undefined"]);_templateObject135=function _templateObject1(){return data};return data}function _templateObject136(){var data=_tagged_template_literal(["undefined"]);_templateObject136=function _templateObject1(){return data};return data}function _templateObject137(){var data=_tagged_template_literal(["{}"]);_templateObject137=function _templateObject1(){return data};return data}function _templateObject138(){var data=_tagged_template_literal(["",".evaluated"]);_templateObject138=function _templateObject1(){return data};return data}function _templateObject139(){var data=_tagged_template_literal(["",".dynamicProps"]);_templateObject139=function _templateObject1(){return data};return data}function _templateObject140(){var data=_tagged_template_literal(["",".props"]);_templateObject140=function _templateObject1(){return data};return data}function _templateObject141(){var data=_tagged_template_literal(["undefined"]);_templateObject141=function _templateObject1(){return data};return data}function _templateObject142(){var data=_tagged_template_literal(["",".dynamicItems"]);_templateObject142=function _templateObject1(){return data};return data}function _templateObject143(){var data=_tagged_template_literal(["",".items"]);_templateObject143=function _templateObject1(){return data};return data}function _templateObject144(){var data=_tagged_template_literal(["undefined"]);_templateObject144=function _templateObject1(){return data};return data}function _templateObject145(){var data=_tagged_template_literal(["/*# sourceURL="," */"]);_templateObject145=function _templateObject1(){return data};return data}function _templateObject146(){var data=_tagged_template_literal([""," === ",""]);_templateObject146=function _templateObject1(){return data};return data}function _templateObject147(){var data=_tagged_template_literal(["",".logger.log(",")"]);_templateObject147=function _templateObject1(){return data};return data}function _templateObject148(){var data=_tagged_template_literal(["","/$comment"]);_templateObject148=function _templateObject1(){return data};return data}function _templateObject149(){var data=_tagged_template_literal(["",".opts.$comment(",", ",", ",".schema)"]);_templateObject149=function _templateObject1(){return data};return data}function _templateObject150(){var data=_tagged_template_literal([""," === 0"]);_templateObject150=function _templateObject1(){return data};return data}function _templateObject151(){var data=_tagged_template_literal(["new ","(",")"]);_templateObject151=function _templateObject1(){return data};return data}function _templateObject152(){var data=_tagged_template_literal(["",".errors"]);_templateObject152=function _templateObject1(){return data};return data}function _templateObject153(){var data=_tagged_template_literal([""," === 0"]);_templateObject153=function _templateObject1(){return data};return data}function _templateObject154(){var data=_tagged_template_literal(["",".props"]);_templateObject154=function _templateObject1(){return data};return data}function _templateObject155(){var data=_tagged_template_literal(["",".items"]);_templateObject155=function _templateObject1(){return data};return data}function _templateObject156(){var data=_tagged_template_literal([""," === ",""]);_templateObject156=function _templateObject1(){return data};return data}function _templateObject157(){var data=_tagged_template_literal(["","",""]);_templateObject157=function _templateObject1(){return data};return data}function _templateObject158(){var data=_tagged_template_literal([""," && ",""]);_templateObject158=function _templateObject1(){return data};return data}function _templateObject159(){var data=_tagged_template_literal([""," !== undefined && (",")"]);_templateObject159=function _templateObject1(){return data};return data}function _templateObject160(){var data=_tagged_template_literal([""," === undefined"]);_templateObject160=function _templateObject1(){return data};return data}function _templateObject161(){var data=_tagged_template_literal(["",""]);_templateObject161=function _templateObject1(){return data};return data}function _templateObject162(){var data=_tagged_template_literal(["!","(",")"]);_templateObject162=function _templateObject1(){return data};return data}function _templateObject163(){var data=_tagged_template_literal(['require("ajv/dist/runtime/validation_error").default']);_templateObject163=function _templateObject1(){return data};return data}function _templateObject164(){var data=_tagged_template_literal(['""']);_templateObject164=function _templateObject1(){return data};return data}function _templateObject165(){var data=_tagged_template_literal(["",".validate"]);_templateObject165=function _templateObject1(){return data};return data}function _templateObject166(){var data=_tagged_template_literal(["await ",""]);_templateObject166=function _templateObject1(){return data};return data}function _templateObject167(){var data=_tagged_template_literal(["!("," instanceof ",")"]);_templateObject167=function _templateObject1(){return data};return data}function _templateObject168(){var data=_tagged_template_literal(["",".errors"]);_templateObject168=function _templateObject1(){return data};return data}function _templateObject169(){var data=_tagged_template_literal([""," === null ? "," : ",".concat(",")"]);_templateObject169=function _templateObject1(){return data};return data}function _templateObject170(){var data=_tagged_template_literal(["",".length"]);_templateObject170=function _templateObject1(){return data};return data}function _templateObject171(){var data=_tagged_template_literal(["",".evaluated.props"]);_templateObject171=function _templateObject1(){return data};return data}function _templateObject172(){var data=_tagged_template_literal(["",".evaluated.items"]);_templateObject172=function _templateObject1(){return data};return data}function _templateObject173(){var data=_tagged_template_literal(["",".validate"]);_templateObject173=function _templateObject1(){return data};return data}function _templateObject174(){var data=_tagged_template_literal(["must be "," ",""]);_templateObject174=function _templateObject1(){return data};return data}function _templateObject175(){var data=_tagged_template_literal(["{comparison: ",", limit: ","}"]);_templateObject175=function _templateObject1(){return data};return data}function _templateObject176(){var data=_tagged_template_literal([""," "," "," || isNaN(",")"]);_templateObject176=function _templateObject1(){return data};return data}function _templateObject177(){var data=_tagged_template_literal(["must be multiple of ",""]);_templateObject177=function _templateObject1(){return data};return data}function _templateObject178(){var data=_tagged_template_literal(["{multipleOf: ","}"]);_templateObject178=function _templateObject1(){return data};return data}function _templateObject179(){var data=_tagged_template_literal(["Math.abs(Math.round(",") - ",") > 1e-",""]);_templateObject179=function _templateObject1(){return data};return data}function _templateObject180(){var data=_tagged_template_literal([""," !== parseInt(",")"]);_templateObject180=function _templateObject1(){return data};return data}function _templateObject181(){var data=_tagged_template_literal(["("," === 0 || ("," = ","/",", ","))"]);_templateObject181=function _templateObject1(){return data};return data}function _templateObject182(){var data=_tagged_template_literal(["must NOT have "," than "," characters"]);_templateObject182=function _templateObject1(){return data};return data}function _templateObject183(){var data=_tagged_template_literal(["{limit: ","}"]);_templateObject183=function _templateObject1(){return data};return data}function _templateObject184(){var data=_tagged_template_literal(["",".length"]);_templateObject184=function _templateObject1(){return data};return data}function _templateObject185(){var data=_tagged_template_literal(["","(",")"]);_templateObject185=function _templateObject1(){return data};return data}function _templateObject186(){var data=_tagged_template_literal([""," "," ",""]);_templateObject186=function _templateObject1(){return data};return data}function _templateObject187(){var data=_tagged_template_literal(['must match pattern "','"']);_templateObject187=function _templateObject1(){return data};return data}function _templateObject188(){var data=_tagged_template_literal(["{pattern: ","}"]);_templateObject188=function _templateObject1(){return data};return data}function _templateObject189(){var data=_tagged_template_literal(["new RegExp"]);_templateObject189=function _templateObject1(){return data};return data}function _templateObject190(){var data=_tagged_template_literal(["","(",", ",").test(",")"]);_templateObject190=function _templateObject1(){return data};return data}function _templateObject191(){var data=_tagged_template_literal(["!",""]);_templateObject191=function _templateObject1(){return data};return data}function _templateObject192(){var data=_tagged_template_literal(["!",".test(",")"]);_templateObject192=function _templateObject1(){return data};return data}function _templateObject193(){var data=_tagged_template_literal(["must NOT have "," than "," properties"]);_templateObject193=function _templateObject1(){return data};return data}function _templateObject194(){var data=_tagged_template_literal(["{limit: ","}"]);_templateObject194=function _templateObject1(){return data};return data}function _templateObject195(){var data=_tagged_template_literal(["Object.keys(",").length "," ",""]);_templateObject195=function _templateObject1(){return data};return data}function _templateObject196(){var data=_tagged_template_literal(["must have required property '","'"]);_templateObject196=function _templateObject1(){return data};return data}function _templateObject197(){var data=_tagged_template_literal(["{missingProperty: ","}"]);_templateObject197=function _templateObject1(){return data};return data}function _templateObject198(){var data=_tagged_template_literal(["must NOT have "," than "," items"]);_templateObject198=function _templateObject1(){return data};return data}function _templateObject199(){var data=_tagged_template_literal(["{limit: ","}"]);_templateObject199=function _templateObject1(){return data};return data}function _templateObject200(){var data=_tagged_template_literal(["",".length "," ",""]);_templateObject200=function _templateObject1(){return data};return data}function _templateObject201(){var data=_tagged_template_literal(["must NOT have duplicate items (items ## "," and "," are identical)"]);_templateObject201=function _templateObject1(){return data};return data}function _templateObject202(){var data=_tagged_template_literal(["{i: ",", j: ","}"]);_templateObject202=function _templateObject1(){return data};return data}function _templateObject203(){var data=_tagged_template_literal([""," === false"]);_templateObject203=function _templateObject1(){return data};return data}function _templateObject204(){var data=_tagged_template_literal(["",".length"]);_templateObject204=function _templateObject1(){return data};return data}function _templateObject205(){var data=_tagged_template_literal([""," > 1"]);_templateObject205=function _templateObject1(){return data};return data}function _templateObject206(){var data=_tagged_template_literal(["{}"]);_templateObject206=function _templateObject1(){return data};return data}function _templateObject207(){var data=_tagged_template_literal([";","--;"]);_templateObject207=function _templateObject1(){return data};return data}function _templateObject208(){var data=_tagged_template_literal(["","[","]"]);_templateObject208=function _templateObject1(){return data};return data}function _templateObject209(){var data=_tagged_template_literal(["continue"]);_templateObject209=function _templateObject1(){return data};return data}function _templateObject210(){var data=_tagged_template_literal(["typeof ",' == "string"']);_templateObject210=function _templateObject1(){return data};return data}function _templateObject211(){var data=_tagged_template_literal(["",' += "_"']);_templateObject211=function _templateObject1(){return data};return data}function _templateObject212(){var data=_tagged_template_literal(["typeof ","[",'] == "number"']);_templateObject212=function _templateObject1(){return data};return data}function _templateObject213(){var data=_tagged_template_literal(["","[","]"]);_templateObject213=function _templateObject1(){return data};return data}function _templateObject214(){var data=_tagged_template_literal(["","[","] = ",""]);_templateObject214=function _templateObject1(){return data};return data}function _templateObject215(){var data=_tagged_template_literal([";","--;"]);_templateObject215=function _templateObject1(){return data};return data}function _templateObject216(){var data=_tagged_template_literal([""," = ","; ","--;"]);_templateObject216=function _templateObject1(){return data};return data}function _templateObject217(){var data=_tagged_template_literal(["","(","[","], ","[","])"]);_templateObject217=function _templateObject1(){return data};return data}function _templateObject218(){var data=_tagged_template_literal(["{allowedValue: ","}"]);_templateObject218=function _templateObject1(){return data};return data}function _templateObject219(){var data=_tagged_template_literal(["!","(",", ",")"]);_templateObject219=function _templateObject1(){return data};return data}function _templateObject220(){var data=_tagged_template_literal([""," !== ",""]);_templateObject220=function _templateObject1(){return data};return data}function _templateObject221(){var data=_tagged_template_literal(["{allowedValues: ","}"]);_templateObject221=function _templateObject1(){return data};return data}function _templateObject222(){var data=_tagged_template_literal(["","(",", ",")"]);_templateObject222=function _templateObject1(){return data};return data}function _templateObject223(){var data=_tagged_template_literal(["","(",", ","[","])"]);_templateObject223=function _templateObject1(){return data};return data}function _templateObject224(){var data=_tagged_template_literal([""," === ",""]);_templateObject224=function _templateObject1(){return data};return data}function _templateObject225(){var data=_tagged_template_literal(["",".length"]);_templateObject225=function _templateObject1(){return data};return data}function _templateObject226(){var data=_tagged_template_literal([""," <= ",""]);_templateObject226=function _templateObject1(){return data};return data}function _templateObject227(){var data=_tagged_template_literal([""," <= ",""]);_templateObject227=function _templateObject1(){return data};return data}function _templateObject228(){var data=_tagged_template_literal(["must NOT have more than "," items"]);_templateObject228=function _templateObject1(){return data};return data}function _templateObject229(){var data=_tagged_template_literal(["{limit: ","}"]);_templateObject229=function _templateObject1(){return data};return data}function _templateObject230(){var data=_tagged_template_literal(["",".length"]);_templateObject230=function _templateObject1(){return data};return data}function _templateObject231(){var data=_tagged_template_literal([""," > ",""]);_templateObject231=function _templateObject1(){return data};return data}function _templateObject232(){var data=_tagged_template_literal(["must NOT have more than "," items"]);_templateObject232=function _templateObject1(){return data};return data}function _templateObject233(){var data=_tagged_template_literal(["{limit: ","}"]);_templateObject233=function _templateObject1(){return data};return data}function _templateObject234(){var data=_tagged_template_literal(["must contain at least "," valid item(s)"]);_templateObject234=function _templateObject1(){return data};return data}function _templateObject235(){var data=_tagged_template_literal(["must contain at least "," and no more than "," valid item(s)"]);_templateObject235=function _templateObject1(){return data};return data}function _templateObject236(){var data=_tagged_template_literal(["{minContains: ","}"]);_templateObject236=function _templateObject1(){return data};return data}function _templateObject237(){var data=_tagged_template_literal(["{minContains: ",", maxContains: ","}"]);_templateObject237=function _templateObject1(){return data};return data}function _templateObject238(){var data=_tagged_template_literal(["",".length"]);_templateObject238=function _templateObject1(){return data};return data}function _templateObject239(){var data=_tagged_template_literal([""," >= ",""]);_templateObject239=function _templateObject1(){return data};return data}function _templateObject240(){var data=_tagged_template_literal([""," && "," <= ",""]);_templateObject240=function _templateObject1(){return data};return data}function _templateObject241(){var data=_tagged_template_literal(["",".length > 0"]);_templateObject241=function _templateObject1(){return data};return data}function _templateObject242(){var data=_tagged_template_literal(["","++"]);_templateObject242=function _templateObject1(){return data};return data}function _templateObject243(){var data=_tagged_template_literal([""," >= ",""]);_templateObject243=function _templateObject1(){return data};return data}function _templateObject244(){var data=_tagged_template_literal([""," > ",""]);_templateObject244=function _templateObject1(){return data};return data}function _templateObject245(){var data=_tagged_template_literal([""," >= ",""]);_templateObject245=function _templateObject1(){return data};return data}function _templateObject246(){var data=_tagged_template_literal([""," && (",")"]);_templateObject246=function _templateObject1(){return data};return data}function _templateObject247(){var data=_tagged_template_literal(["must have "," "," when property "," is present"]);_templateObject247=function _templateObject1(){return data};return data}function _templateObject248(){var data=_tagged_template_literal(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"]);_templateObject248=function _templateObject1(){return data};return data}function _templateObject249(){var data=_tagged_template_literal(["{propertyName: ","}"]);_templateObject249=function _templateObject1(){return data};return data}function _templateObject250(){var data=_tagged_template_literal(["{additionalProperty: ","}"]);_templateObject250=function _templateObject1(){return data};return data}function _templateObject251(){var data=_tagged_template_literal([""," === ",""]);_templateObject251=function _templateObject1(){return data};return data}function _templateObject252(){var data=_tagged_template_literal([""," === ",""]);_templateObject252=function _templateObject1(){return data};return data}function _templateObject253(){var data=_tagged_template_literal(["",".test(",")"]);_templateObject253=function _templateObject1(){return data};return data}function _templateObject254(){var data=_tagged_template_literal(["delete ","[","]"]);_templateObject254=function _templateObject1(){return data};return data}function _templateObject255(){var data=_tagged_template_literal(["",".test(",")"]);_templateObject255=function _templateObject1(){return data};return data}function _templateObject256(){var data=_tagged_template_literal(["","[","]"]);_templateObject256=function _templateObject1(){return data};return data}function _templateObject257(){var data=_tagged_template_literal(["{passingSchemas: ","}"]);_templateObject257=function _templateObject1(){return data};return data}function _templateObject258(){var data=_tagged_template_literal([""," && ",""]);_templateObject258=function _templateObject1(){return data};return data}function _templateObject259(){var data=_tagged_template_literal(["[",", ","]"]);_templateObject259=function _templateObject1(){return data};return data}function _templateObject260(){var data=_tagged_template_literal(['must match "','" schema']);_templateObject260=function _templateObject1(){return data};return data}function _templateObject261(){var data=_tagged_template_literal(["{failingKeyword: ","}"]);_templateObject261=function _templateObject1(){return data};return data}function _templateObject262(){var data=_tagged_template_literal(["",""]);_templateObject262=function _templateObject1(){return data};return data}function _templateObject263(){var data=_tagged_template_literal(['must match format "','"']);_templateObject263=function _templateObject1(){return data};return data}function _templateObject264(){var data=_tagged_template_literal(["{format: ","}"]);_templateObject264=function _templateObject1(){return data};return data}function _templateObject265(){var data=_tagged_template_literal(["","[","]"]);_templateObject265=function _templateObject1(){return data};return data}function _templateObject266(){var data=_tagged_template_literal(["typeof ",' == "object" && !('," instanceof RegExp)"]);_templateObject266=function _templateObject1(){return data};return data}function _templateObject267(){var data=_tagged_template_literal(["",'.type || "string"']);_templateObject267=function _templateObject1(){return data};return data}function _templateObject268(){var data=_tagged_template_literal(["",".validate"]);_templateObject268=function _templateObject1(){return data};return data}function _templateObject269(){var data=_tagged_template_literal(['"string"']);_templateObject269=function _templateObject1(){return data};return data}function _templateObject270(){var data=_tagged_template_literal([""," && !",""]);_templateObject270=function _templateObject1(){return data};return data}function _templateObject271(){var data=_tagged_template_literal(["(",".async ? await ","(",") : ","(","))"]);_templateObject271=function _templateObject1(){return data};return data}function _templateObject272(){var data=_tagged_template_literal(["","(",")"]);_templateObject272=function _templateObject1(){return data};return data}function _templateObject273(){var data=_tagged_template_literal(["(typeof ",' == "function" ? '," : ",".test(","))"]);_templateObject273=function _templateObject1(){return data};return data}function _templateObject274(){var data=_tagged_template_literal([""," && "," !== true && "," === "," && !",""]);_templateObject274=function _templateObject1(){return data};return data}function _templateObject275(){var data=_tagged_template_literal(["","",""]);_templateObject275=function _templateObject1(){return data};return data}function _templateObject276(){var data=_tagged_template_literal(["",".validate"]);_templateObject276=function _templateObject1(){return data};return data}function _templateObject277(){var data=_tagged_template_literal(["await ","(",")"]);_templateObject277=function _templateObject1(){return data};return data}function _templateObject278(){var data=_tagged_template_literal(["","(",")"]);_templateObject278=function _templateObject1(){return data};return data}function _templateObject279(){var data=_tagged_template_literal(["",".test(",")"]);_templateObject279=function _templateObject1(){return data};return data}function _templateObject280(){var data=_tagged_template_literal(["{error: ",", tag: ",", tagValue: ","}"]);_templateObject280=function _templateObject1(){return data};return data}function _templateObject281(){var data=_tagged_template_literal(["","",""]);_templateObject281=function _templateObject1(){return data};return data}function _templateObject282(){var data=_tagged_template_literal(["typeof ",' == "string"']);_templateObject282=function _templateObject1(){return data};return data}function _templateObject283(){var data=_tagged_template_literal([""," === ",""]);_templateObject283=function _templateObject1(){return data};return data}function _templateObject284(){var data=_tagged_template_literal(["should be "," ",""]);_templateObject284=function _templateObject1(){return data};return data}function _templateObject285(){var data=_tagged_template_literal(["{comparison: ",", limit: ","}"]);_templateObject285=function _templateObject1(){return data};return data}function _templateObject286(){var data=_tagged_template_literal(["","[","]"]);_templateObject286=function _templateObject1(){return data};return data}function _templateObject287(){var data=_tagged_template_literal(["typeof ",' != "object"']);_templateObject287=function _templateObject1(){return data};return data}function _templateObject288(){var data=_tagged_template_literal([""," instanceof RegExp"]);_templateObject288=function _templateObject1(){return data};return data}function _templateObject289(){var data=_tagged_template_literal(["typeof ",'.compare != "function"']);_templateObject289=function _templateObject1(){return data};return data}function _templateObject290(){var data=_tagged_template_literal(["","",""]);_templateObject290=function _templateObject1(){return data};return data}function _templateObject291(){var data=_tagged_template_literal(["",".compare(",", ",") "," 0"]);_templateObject291=function _templateObject1(){return data};return data}function _templateObject292(){var data=_tagged_template_literal(['require("ajv-formats/dist/formats").',""]);_templateObject292=function _templateObject1(){return data};return data}(function(){var $T1=Object.create;var Bv1=Object.defineProperty;var HT1=Object.getOwnPropertyDescriptor;var GT1=Object.getOwnPropertyNames;var WT1=Object.getPrototypeOf,VT1=Object.prototype.hasOwnProperty;var o=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var zT1=function(r,e,t,a){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"||typeof e=="function")try{var _loop=function(){var i=_step.value;!VT1.call(r,i)&&i!==t&&Bv1(r,i,{get:function(){return e[i]},enumerable:!(a=HT1(e,i))||a.enumerable})};for(var _iterator=GT1(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r};var p=function(r,e,t){return t=r!=null?$T1(WT1(r)):{},zT1(e||!r||!r.__esModule?Bv1(t,"default",{value:r,enumerable:!0}):t,r)};var R=o(function(Y81,Mv1){"use strict";Mv1.exports=function(r){try{return!!r()}catch(e){return!0}}});var w=o(function(J81,kv1){"use strict";var KT1=R();kv1.exports=!KT1(function(){return Object.defineProperty({},1,{get:function get1(){return 7}})[1]!==7})});var tt=o(function(X81,jv1){"use strict";var YT1=R();jv1.exports=!YT1(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var S=o(function(Q81,Gv1){"use strict";var $v1=tt(),Hv1=Function.prototype,_$Yi=Hv1.call,JT1=$v1&&Hv1.bind.bind(_$Yi,_$Yi);Gv1.exports=$v1?JT1:function(r){return function(){return _$Yi.apply(r,arguments)}}});var b=o(function(Z81,Wv1){"use strict";var Ji1=(typeof document==="undefined"?"undefined":_type_of(document))=="object"&&document.all;Wv1.exports=typeof Ji1=="undefined"&&Ji1!==void 0?function(r){return typeof r=="function"||r===Ji1}:function(r){return typeof r=="function"}});var we=o(function(rH1,Vv1){"use strict";Vv1.exports=function(r){return r==null}});var ir1=o(function(eH1,zv1){"use strict";var XT1=we(),QT1=TypeError;zv1.exports=function(r){if(XT1(r))throw new QT1("Can't call method on "+r);return r}});var B=o(function(tH1,Kv1){"use strict";var ZT1=ir1(),_$rO=Object;Kv1.exports=function(r){return _$rO(ZT1(r))}});var C=o(function(aH1,Yv1){"use strict";var eO1=S(),tO1=B(),aO1=eO1({}.hasOwnProperty);Yv1.exports=Object.hasOwn||function(e,t){return aO1(tO1(e),t)}});var at=o(function(iH1,Xv1){"use strict";var Xi1=w(),iO1=C(),Jv1=Function.prototype,_$nO=Xi1&&Object.getOwnPropertyDescriptor,Qi1=iO1(Jv1,"name"),uO1=Qi1&&(function(){}).name==="something",oO1=Qi1&&(!Xi1||Xi1&&_$nO(Jv1,"name").configurable);Xv1.exports={EXISTS:Qi1,PROPER:uO1,CONFIGURABLE:oO1}});var D=o(function(nH1,Qv){"use strict";Qv.exports=!1});var I=o(function(Zi1,Zv1){"use strict";var it=function it(r){return r&&r.Math===Math&&r};Zv1.exports=it((typeof globalThis==="undefined"?"undefined":_type_of(globalThis))=="object"&&globalThis)||it((typeof window==="undefined"?"undefined":_type_of(window))=="object"&&window)||it((typeof self==="undefined"?"undefined":_type_of(self))=="object"&&self)||it((typeof global==="undefined"?"undefined":_type_of(global))=="object"&&global)||it((typeof Zi1==="undefined"?"undefined":_type_of(Zi1))=="object"&&Zi1)||function(){return this}()||Function("return this")()});var ea1=o(function(uH1,ec1){"use strict";var rc1=I(),sO1=Object.defineProperty;ec1.exports=function(r,e){try{sO1(rc1,r,{value:e,configurable:!0,writable:!0})}catch(t){rc1[r]=e}return e}});var ta1=o(function(oH1,ic1){"use strict";var vO1=D(),cO1=I(),fO1=ea1(),tc1="__core-js_shared__",ac1=ic1.exports=cO1[tc1]||fO1(tc1,{});(ac1.versions||(ac1.versions=[])).push({version:"3.47.0",mode:vO1?"pure":"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var aa1=o(function(sH1,nc1){"use strict";var lO1=S(),hO1=b(),rn1=ta1(),pO1=lO1(Function.toString);hO1(rn1.inspectSource)||(rn1.inspectSource=function(r){return pO1(r)});nc1.exports=rn1.inspectSource});var sc1=o(function(vH1,oc1){"use strict";var gO1=I(),yO1=b(),uc1=gO1.WeakMap;oc1.exports=yO1(uc1)&&/native code/.test(String(uc1))});var P1=o(function(cH1,vc1){"use strict";var _$dO=b();vc1.exports=function(r){return(typeof r==="undefined"?"undefined":_type_of(r))=="object"?r!==null:_$dO(r)}});var ia1=o(function(fH1,fc){"use strict";var qO1=I(),cc=P1(),en1=qO1.document,EO1=cc(en1)&&cc(en1.createElement);fc.exports=function(r){return EO1?en1.createElement(r):{}}});var tn1=o(function(lH1,lc1){"use strict";var SO1=w(),IO1=R(),RO1=ia1();lc1.exports=!SO1&&!IO1(function(){return Object.defineProperty(RO1("div"),"a",{get:function get1(){return 7}}).a!==7})});var an1=o(function(hH1,hc){"use strict";var TO1=w(),OO1=R();hc.exports=TO1&&OO1(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var A1=o(function(pH1,pc){"use strict";var mO1=P1(),AO1=String,wO1=TypeError;pc.exports=function(r){if(mO1(r))return r;throw new wO1(AO1(r)+" is not an object")}});var m=o(function(gH1,gc1){"use strict";var bO1=tt(),na1=Function.prototype.call;gc1.exports=bO1?na1.bind(na1):function(){return na1.apply(na1,arguments)}});var W10=o(function(yH1,yc1){"use strict";var nn1=I(),xO1=b(),CO1=function CO1(r){return xO1(r)?r:void 0};yc1.exports=function(r,e){return arguments.length<2?CO1(nn1[r]):nn1[r]&&nn1[r][e]}});var Cr=o(function(dH1,dc1){"use strict";var PO1=S();dc1.exports=PO1({}.isPrototypeOf)});var be=o(function(qH,Sc1){"use strict";var _$_O=I(),qc1=_$_O.navigator,Ec1=qc1&&qc1.userAgent;Sc1.exports=Ec1?String(Ec1):""});var se1=o(function(EH1,Ac1){"use strict";var mc=I(),_$un=be(),Ic1=mc.process,Rc1=mc.Deno,Tc1=Ic1&&Ic1.versions||Rc1&&Rc1.version,Oc1=Tc1&&Tc1.v8,lr1,ua1;Oc1&&(lr1=Oc1.split("."),ua1=lr1[0]>0&&lr1[0]<4?1:+(lr1[0]+lr1[1]));!ua1&&_$un&&(lr1=_$un.match(/Edge\/(\d+)/),(!lr1||lr1[1]>=74)&&(lr1=_$un.match(/Chrome\/(\d+)/),lr1&&(ua1=+lr1[1])));Ac1.exports=ua1});var oa1=o(function(SH1,bc1){"use strict";var wc1=se1(),NO1=R(),LO1=I(),DO1=LO1.String;bc1.exports=!!Object.getOwnPropertySymbols&&!NO1(function(){var r=Symbol("symbol detection");return!DO1(r)||!_instanceof(Object(r),Symbol)||!Symbol.sham&&wc1&&wc1<41})});var on1=o(function(IH1,xc1){"use strict";var FO1=oa1();xc1.exports=FO1&&!Symbol.sham&&_type_of(Symbol.iterator)=="symbol"});var xe=o(function(RH1,Cc1){"use strict";var UO1=W10(),BO1=b(),MO1=Cr(),kO1=on1(),jO1=Object;Cc1.exports=kO1?function(r){return(typeof r==="undefined"?"undefined":_type_of(r))=="symbol"}:function(r){var e=UO1("Symbol");return BO1(e)&&MO1(e.prototype,jO1(r))}});var ve=o(function(TH1,Pc1){"use strict";var $O1=String;Pc1.exports=function(r){try{return $O1(r)}catch(e){return"Object"}}});var _=o(function(OH1,_c1){"use strict";var HO1=b(),GO1=ve(),WO1=TypeError;_c1.exports=function(r){if(HO1(r))return r;throw new WO1(GO1(r)+" is not a function")}});var $r1=o(function(mH1,Nc1){"use strict";var VO1=_(),zO1=we();Nc1.exports=function(r,e){var t=r[e];return zO1(t)?void 0:VO1(t)}});var Dc1=o(function(AH1,Lc1){"use strict";var sn=m(),vn1=b(),cn1=P1(),KO1=TypeError;Lc1.exports=function(r,e){var t,a;if(e==="string"&&vn1(t=r.toString)&&!cn1(a=sn(t,r))||vn1(t=r.valueOf)&&!cn1(a=sn(t,r))||e!=="string"&&vn1(t=r.toString)&&!cn1(a=sn(t,r)))return a;throw new KO1("Can't convert object to primitive value")}});var sa1=o(function(wH1,Uc1){"use strict";var Fc1=ta1();Uc1.exports=function(r,e){return Fc1[r]||(Fc1[r]=e||{})}});var Ce1=o(function(bH1,Bc1){"use strict";var YO1=S(),JO1=0,XO1=Math.random(),QO1=YO1(1.1.toString);Bc1.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+QO1(++JO1+XO1,36)}});var x=o(function(xH1,kc1){"use strict";var ZO1=I(),rm1=sa1(),Mc1=C(),em=Ce1(),tm=oa1(),am1=on1(),Pe=ZO1.Symbol,fn1=rm1("wks"),im1=am1?Pe.for||Pe:Pe&&Pe.withoutSetter||em;kc1.exports=function(r){return Mc1(fn1,r)||(fn1[r]=tm&&Mc1(Pe,r)?Pe[r]:im1("Symbol."+r)),fn1[r]}});var ln1=o(function(CH1,Hc1){"use strict";var nm1=m(),jc1=P1(),$c1=xe(),um1=$r1(),om1=Dc1(),sm1=x(),vm1=TypeError,cm1=sm1("toPrimitive");Hc1.exports=function(r,e){if(!jc1(r)||$c1(r))return r;var t=um1(r,cm1),a;if(t){if(e===void 0&&(e="default"),a=nm1(t,r,e),!jc1(a)||$c1(a))return a;throw new vm1("Can't convert object to primitive value")}return e===void 0&&(e="number"),om1(r,e)}});var va1=o(function(PH1,Gc1){"use strict";var fm1=ln1(),lm1=xe();Gc1.exports=function(r){var e=fm1(r,"string");return lm1(e)?e:e+""}});var V=o(function(Vc1){"use strict";var hm1=w(),pm1=tn1(),gm1=an1(),ca=A1(),Wc1=va1(),ym1=TypeError,hn1=Object.defineProperty,dm1=Object.getOwnPropertyDescriptor,pn1="enumerable",gn1="configurable",yn="writable";Vc1.f=hm1?gm1?function(e,t,a){if(ca(e),t=Wc1(t),ca(a),typeof e=="function"&&t==="prototype"&&"value"in a&&yn in a&&!a[yn]){var i=dm1(e,t);i&&i[yn]&&(e[t]=a.value,a={configurable:gn1 in a?a[gn1]:i[gn1],enumerable:pn1 in a?a[pn1]:i[pn1],writable:!1})}return hn1(e,t,a)}:hn1:function(e,t,a){if(ca(e),t=Wc1(t),ca(a),pm1)try{return hn1(e,t,a)}catch(i){}if("get"in a||"set"in a)throw new ym1("Accessors not supported");return"value"in a&&(e[t]=a.value),e}});var Pr1=o(function(NH1,zc1){"use strict";zc1.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var z=o(function(LH1,Kc1){"use strict";var qm1=w(),Em1=V(),Sm1=Pr1();Kc1.exports=qm1?function(r,e,t){return Em1.f(r,e,Sm1(1,t))}:function(r,e,t){return r[e]=t,r}});var fa1=o(function(DH1,Jc1){"use strict";var Im1=sa1(),Rm1=Ce1(),Yc1=Im1("keys");Jc1.exports=function(r){return Yc1[r]||(Yc1[r]=Rm1(r))}});var la1=o(function(FH1,Xc1){"use strict";Xc1.exports={}});var _$X=o(function(UH1,rf1){"use strict";var Tm1=sc1(),Zc1=I(),Om1=P1(),mm1=z(),dn1=C(),qn1=ta1(),Am1=fa1(),wm1=la1(),Qc1="Object already initialized",En1=Zc1.TypeError,bm=Zc1.WeakMap,ha1,nt,pa1,xm1=function xm1(r){return pa1(r)?nt(r):ha1(r,{})},Cm1=function Cm1(r){return function(e){var t;if(!Om1(e)||(t=nt(e)).type!==r)throw new En1("Incompatible receiver, "+r+" required");return t}};Tm1||qn1.state?(hr1=qn1.state||(qn1.state=new bm),hr1.get=hr1.get,hr1.has=hr1.has,hr1.set=hr1.set,ha1=function ha1(r,e){if(hr1.has(r))throw new En1(Qc1);return e.facade=r,hr1.set(r,e),e},nt=function nt(r){return hr1.get(r)||{}},pa1=function pa1(r){return hr1.has(r)}):(_$ce=Am1("state"),wm1[_$ce]=!0,ha1=function ha1(r,e){if(dn1(r,_$ce))throw new En1(Qc1);return e.facade=r,mm1(r,_$ce,e),e},nt=function nt(r){return dn1(r,_$ce)?r[_$ce]:{}},pa1=function pa1(r){return dn1(r,_$ce)});var hr1,_$ce;rf1.exports={set:ha1,get:nt,has:pa1,enforce:xm1,getterFor:Cm1}});var Rn=o(function(BH1,af1){"use strict";var In1=S(),Pm1=R(),_m1=b(),ga1=C(),Sn1=w(),Nm1=at().CONFIGURABLE,Lm1=aa1(),tf1=_$X(),Dm1=tf1.enforce,Fm1=tf1.get,ef1=String,_$ya=Object.defineProperty,Um1=In1("".slice),Bm1=In1("".replace),Mm1=In1([].join),km1=Sn1&&!Pm1(function(){return _$ya(function(){},"length",{value:8}).length!==8}),jm1=String(String).split("String"),$m1=af1.exports=function $m1(r,e,t){Um1(ef1(e),0,7)==="Symbol("&&(e="["+Bm1(ef1(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!ga1(r,"name")||Nm1&&r.name!==e)&&(Sn1?_$ya(r,"name",{value:e,configurable:!0}):r.name=e),km1&&t&&ga1(t,"arity")&&r.length!==t.arity&&_$ya(r,"length",{value:t.arity});try{t&&ga1(t,"constructor")&&t.constructor?Sn1&&_$ya(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch(i){}var a=Dm1(r);return ga1(a,"source")||(a.source=Mm1(jm1,typeof e=="string"?e:"")),r};Function.prototype.toString=$m1(function(){return _m1(this)&&Fm1(this).source||Lm1(this)},"toString")});var Q=o(function(MH1,uf1){"use strict";var nf1=Rn(),Hm1=V();uf1.exports=function(r,e,t){return t.get&&nf1(t.get,e,{getter:!0}),t.set&&nf1(t.set,e,{setter:!0}),Hm1.f(r,e,t)}});var da=o(function(kH1,of1){"use strict";of1.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var _$ut=o(function(jH1,sf1){"use strict";var Gm1=S(),Wm1=_();sf1.exports=function(r,e,t){try{return Gm1(Wm1(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(a){}}});var pr1=o(function($H1,cf1){"use strict";var vf1=S(),Vm1=vf1({}.toString),zm1=vf1("".slice);cf1.exports=function(r){return zm1(Vm1(r),8,-1)}});var Tn1=o(function(HH1,hf1){"use strict";var lf1=I(),Km1=_$ut(),Ym1=pr1(),ff1=lf1.ArrayBuffer,Jm1=lf1.TypeError;hf1.exports=ff1&&Km1(ff1.prototype,"byteLength","get")||function(r){if(Ym1(r)!=="ArrayBuffer")throw new Jm1("ArrayBuffer expected");return r.byteLength}});var On=o(function(GH,pf1){"use strict";var Xm1=I(),Qm1=da(),Zm1=Tn1(),rA1=Xm1.DataView;pf1.exports=function(r){if(!Qm1||Zm1(r)!==0)return!1;try{return new rA1(r),!1}catch(e){return!0}}});var yf1=o(function(){"use strict";var eA1=w(),tA1=Q(),aA1=On(),_$gf=ArrayBuffer.prototype;eA1&&!("detached"in _$gf)&&tA1(_$gf,"detached",{configurable:!0,get:function get1(){return aA1(this)}})});var mn1=o(function(Ef1){"use strict";var df1={}.propertyIsEnumerable,qf=Object.getOwnPropertyDescriptor,iA1=qf&&!df1.call({1:2},1);Ef1.f=iA1?function(e){var t=qf(this,e);return!!t&&t.enumerable}:df1});var _e1=o(function(KH,Sf1){"use strict";var nA1=S(),uA1=R(),oA1=pr1(),An1=Object,sA1=nA1("".split);Sf1.exports=uA1(function(){return!An1("z").propertyIsEnumerable(0)})?function(r){return oA1(r)==="String"?sA1(r,""):An1(r)}:An1});var fe1=o(function(YH,If1){"use strict";var vA1=_e1(),cA1=ir1();If1.exports=function(r){return vA1(cA1(r))}});var qa=o(function(Tf1){"use strict";var fA1=w(),lA1=m(),hA=mn1(),pA1=Pr1(),gA=fe1(),yA1=va1(),dA1=C(),qA1=tn1(),Rf1=Object.getOwnPropertyDescriptor;Tf1.f=fA1?Rf1:function(e,t){if(e=gA(e),t=yA1(t),qA1)try{return Rf1(e,t)}catch(a){}if(dA1(e,t))return pA1(!lA1(hA.f,e,t),e[t])}});var Z=o(function(XH,Of1){"use strict";var EA1=b(),SA=V(),IA1=Rn(),RA1=ea1();Of1.exports=function(r,e,t,a){a||(a={});var i=a.enumerable,n=a.name!==void 0?a.name:e;if(EA1(t)&&IA1(t,n,a),a.global)i?r[e]=t:RA1(e,t);else{try{a.unsafe?r[e]&&(i=!0):delete r[e]}catch(u){}i?r[e]=t:SA.f(r,e,{value:t,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return r}});var Af1=o(function(QH,mf1){"use strict";var _$TA=Math.ceil,OA1=Math.floor;mf1.exports=Math.trunc||function(e){var t=+e;return(t>0?OA1:_$TA)(t)}});var k=o(function(ZH,wf1){"use strict";var mA1=Af1();wf1.exports=function(r){var e=+r;return e!==e||e===0?0:mA1(e)}});var ot1=o(function(rG1,bf1){"use strict";var AA1=k(),wA=Math.max,bA=Math.min;bf1.exports=function(r,e){var t=AA1(r);return t<0?wA(t+e,0):bA(t,e)}});var _r1=o(function(eG1,xf1){"use strict";var xA=k(),CA1=Math.min;xf1.exports=function(r){var e=xA(r);return e>0?CA1(e,0x1fffffffffffff):0}});var L=o(function(tG1,Cf1){"use strict";var PA1=_r1();Cf1.exports=function(r){return PA1(r.length)}});var Nf1=o(function(aG1,_f1){"use strict";var _A1=fe1(),NA1=ot1(),_$LA=L(),Pf1=function Pf1(r){return function(e,t,a){var i=_A1(e),n=_$LA(i);if(n===0)return!r&&-1;var u=NA1(a,n),s;if(r&&t!==t){for(;n>u;)if(s=i[u++],s!==s)return!0}else for(;n>u;u++)if((r||u in i)&&i[u]===t)return r||u||0;return!r&&-1}};_f1.exports={includes:Pf1(!0),indexOf:Pf1(!1)}});var bn=o(function(iG1,Df1){"use strict";var DA1=S(),wn1=C(),FA1=fe1(),UA1=Nf1().indexOf,BA1=la1(),Lf1=DA1([].push);Df1.exports=function(r,e){var t=FA1(r),a=0,i=[],n;for(n in t)!wn1(BA1,n)&&wn1(t,n)&&Lf1(i,n);for(;e.length>a;)wn1(t,n=e[a++])&&(~UA1(i,n)||Lf1(i,n));return i}});var Ea=o(function(nG1,Ff1){"use strict";Ff1.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var xn=o(function(Uf1){"use strict";var MA1=bn(),kA1=Ea(),jA1=kA1.concat("length","prototype");Uf1.f=Object.getOwnPropertyNames||function(e){return MA1(e,jA1)}});var Cn=o(function(Bf){"use strict";Bf.f=Object.getOwnPropertySymbols});var kf1=o(function(sG1,Mf1){"use strict";var $A1=W10(),HA1=S(),GA1=xn(),_$WA=Cn(),VA1=A1(),zA1=HA1([].concat);Mf1.exports=$A1("Reflect","ownKeys")||function(e){var t=GA1.f(VA1(e)),a=_$WA.f;return a?zA1(t,a(e)):t}});var st1=o(function(vG1,$f1){"use strict";var jf1=C(),KA1=kf1(),YA1=qa(),JA1=V();$f1.exports=function(r,e,t){for(var a=KA1(e),i=JA1.f,n=YA1.f,u=0;u<a.length;u++){var s=a[u];!jf1(r,s)&&!(t&&jf1(t,s))&&i(r,s,n(e,s))}}});var Pn1=o(function(cG1,Hf1){"use strict";var XA1=R(),QA1=b(),ZA1=/#|\.prototype\./,vt1=function vt1(r,e){var t=ew1[rw1(r)];return t===aw1?!0:t===tw1?!1:QA1(e)?XA1(e):!!e},rw1=vt1.normalize=function rw1(r){return String(r).replace(ZA1,".").toLowerCase()},ew1=vt1.data={},tw1=vt1.NATIVE="N",aw1=vt1.POLYFILL="P";Hf1.exports=vt1});var q=o(function(fG1,Gf){"use strict";var Sa1=I(),iw1=qa().f,nw1=z(),uw1=Z(),ow1=ea1(),sw1=st1(),vw1=Pn1();Gf.exports=function(r,e){var t=r.target,a=r.global,i=r.stat,n,u,s,v,f10,l;if(a?u=Sa1:i?u=Sa1[t]||ow1(t,{}):u=Sa1[t]&&Sa1[t].prototype,u)for(s in e){if(f10=e[s],r.dontCallGetSet?(l=iw1(u,s),v=l&&l.value):v=u[s],n=vw1(a?s:t+(i?".":"#")+s,r.forced),!n&&v!==void 0){if((typeof f10==="undefined"?"undefined":_type_of(f10))==(typeof v==="undefined"?"undefined":_type_of(v)))continue;sw1(f10,v)}(r.sham||v&&v.sham)&&nw1(f10,"sham",!0),uw1(u,s,f10,r)}}});var ct1=o(function(lG1,Wf){"use strict";var cw1=pr1(),fw1=S();Wf.exports=function(r){if(cw1(r)==="Function")return fw1(r)}});var Ia1=o(function(hG1,Vf1){"use strict";var lw1=Z();Vf1.exports=function(r,e,t){for(var a in e)lw1(r,a,e[a],t);return r}});var le1=o(function(pG1,zf1){"use strict";var hw1=Cr(),pw1=TypeError;zf1.exports=function(r,e){if(hw1(e,r))return r;throw new pw1("Incorrect invocation")}});var _$Ra=o(function(gG1,Kf){"use strict";var gw1=k(),yw1=_r1(),dw1=RangeError;Kf.exports=function(r){if(r===void 0)return 0;var e=gw1(r),t=yw1(e);if(e!==t)throw new dw1("Wrong length or index");return t}});var Jf=o(function(yG1,Yf){"use strict";Yf.exports=Math.sign||function(e){var t=+e;return t===0||t!==t?t:t<0?-1:1}});var Zf1=o(function(dG1,Qf){"use strict";var qw1=2220446049250313e-31,Xf=1/qw1;Qf.exports=function(r){return r+Xf-Xf}});var el1=o(function(qG1,rl1){"use strict";var Ew1=Jf(),Sw1=Zf1(),Iw1=Math.abs,_$Rw=2220446049250313e-31;rl1.exports=function(r,e,t,a){var i=+r,n=Iw1(i),u=Ew1(i);if(n<a)return u*Sw1(n/a/e)*a*e;var s=(1+e/_$Rw)*n,v=s-(s-n);return v>t||v!==v?u*(1/0):u*v}});var al1=o(function(EG1,tl1){"use strict";var Tw1=el1(),Ow1=11920928955078125e-23,mw1=34028234663852886e22,Aw1=11754943508222875e-54;tl1.exports=Math.fround||function(e){return Tw1(e,Ow1,mw1,Aw1)}});var nl1=o(function(SG1,il1){"use strict";var ww1=Array,bw1=Math.abs,Nr1=Math.pow,xw1=Math.floor,Cw1=Math.log,_$Pw=Math.LN2,_w1=function _w1(r,e,t){var a=ww1(t),i=t*8-e-1,n=(1<<i)-1,u=n>>1,s=e===23?Nr1(2,-24)-Nr1(2,-77):0,v=r<0||r===0&&1/r<0?1:0,f10=0,l,c,h;for(r=bw1(r),r!==r||r===1/0?(c=r!==r?1:0,l=n):(l=xw1(Cw1(r)/_$Pw),h=Nr1(2,-l),r*h<1&&(l--,h*=2),l+u>=1?r+=s/h:r+=s*Nr1(2,1-u),r*h>=2&&(l++,h/=2),l+u>=n?(c=0,l=n):l+u>=1?(c=(r*h-1)*Nr1(2,e),l+=u):(c=r*Nr1(2,u-1)*Nr1(2,e),l=0));e>=8;)a[f10++]=c&255,c/=256,e-=8;for(l=l<<e|c,i+=e;i>0;)a[f10++]=l&255,l/=256,i-=8;return a[f10-1]|=v*128,a},Nw1=function Nw1(r,e){var t=r.length,a=t*8-e-1,i=(1<<a)-1,n=i>>1,u=a-7,s=t-1,v=r[s--],f10=v&127,l;for(v>>=7;u>0;)f10=f10*256+r[s--],u-=8;for(l=f10&(1<<-u)-1,f10>>=-u,u+=e;u>0;)l=l*256+r[s--],u-=8;if(f10===0)f10=1-n;else{if(f10===i)return l?NaN:v?-1/0:1/0;l+=Nr1(2,e),f10-=n}return(v?-1:1)*l*Nr1(2,f10-e)};il1.exports={pack:_w1,unpack:Nw1}});var ol1=o(function(IG1,ul1){"use strict";var Lw1=R();ul1.exports=!Lw1(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Ne1=o(function(RG1,vl1){"use strict";var Dw1=C(),Fw1=b(),Uw1=B(),Bw1=fa1(),Mw1=ol1(),sl1=Bw1("IE_PROTO"),_n=Object,kw1=_n.prototype;vl1.exports=Mw1?_n.getPrototypeOf:function(r){var e=Uw1(r);if(Dw1(e,sl1))return e[sl1];var t=e.constructor;return Fw1(t)&&_instanceof(e,t)?t.prototype:_instanceof(e,_n)?kw1:null}});var fl1=o(function(TG1,cl1){"use strict";var jw1=P1();cl1.exports=function(r){return jw1(r)||r===null}});var hl1=o(function(OG1,ll1){"use strict";var $w1=fl1(),Hw1=String,Gw1=TypeError;ll1.exports=function(r){if($w1(r))return r;throw new Gw1("Can't set "+Hw1(r)+" as a prototype")}});var he1=o(function(mG1,pl1){"use strict";var Ww1=_$ut(),Vw1=P1(),zw1=ir1(),Kw1=hl1();pl1.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Ww1(Object.prototype,"__proto__","set"),t(e,[]),r=_instanceof(e,Array)}catch(a){}return function(i,n){return zw1(i),Kw1(n),Vw1(i)&&(r?t(i,n):i.__proto__=n),i}}():void 0)});var Nn=o(function(AG1,yl1){"use strict";var Yw1=B(),gl1=ot1(),Jw1=L();yl1.exports=function(e){for(var t=Yw1(this),a=Jw1(t),i=arguments.length,n=gl1(i>1?arguments[1]:void 0,a),u=i>2?arguments[2]:void 0,s=u===void 0?a:gl1(u,a);s>n;)t[n++]=e;return t}});var ft1=o(function(wG1,dl1){"use strict";var Xw1=S();dl1.exports=Xw1([].slice)});var _$lt=o(function(bG1,El1){"use strict";var Qw1=b(),Zw1=P1(),ql1=he1();El1.exports=function(r,e,t){var a,i;return ql1&&Qw1(a=e.constructor)&&a!==t&&Zw1(i=a.prototype)&&i!==t.prototype&&ql1(r,i),r}});var Hr=o(function(xG1,Il){"use strict";var rb1=V().f,eb1=C(),tb1=x(),Sl1=tb1("toStringTag");Il.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!eb1(r,Sl1)&&rb1(r,Sl1,{configurable:!0,value:e})}});var kn=o(function(CG1,Bl1){"use strict";var wa1=I(),Bn1=S(),Ln1=w(),ab1=da(),Nl1=at(),ib1=z(),nb1=Q(),Rl=Ia1(),Dn1=R(),Ta=le1(),ub1=k(),ob1=_r1(),ma1=_$Ra(),sb1=al1(),Ll1=nl1(),vb1=Ne1(),Tl1=he1(),cb1=Nn(),fb1=ft1(),lb1=_$lt(),hb1=st1(),Dl1=Hr(),Mn=_$X(),pb1=Nl1.PROPER,Ol=Nl1.CONFIGURABLE,De="ArrayBuffer",ba1="DataView",Fe="prototype",gb1="Wrong length",Fl1="Wrong index",ml1=Mn.getterFor(De),pt=Mn.getterFor(ba1),Al=Mn.set,gr1=wa1[De],rr=gr1,_$Le=rr&&rr[Fe],Sr1=wa1[ba1],pe=Sr1&&Sr1[Fe],wl1=Object.prototype,yb1=wa1.Array,Aa1=wa1.RangeError,db1=Bn1(cb1),qb1=Bn1([].reverse),Ul1=Ll1.pack,bl1=Ll1.unpack,xl1=function xl1(r){return[r&255]},Cl1=function Cl1(r){return[r&255,r>>8&255]},Pl=function Pl(r){return[r&255,r>>8&255,r>>16&255,r>>24&255]},_l1=function _l1(r){return r[3]<<24|r[2]<<16|r[1]<<8|r[0]},Eb1=function Eb1(r){return Ul1(sb1(r),23,4)},Sb1=function Sb1(r){return Ul1(r,52,8)},Oa1=function Oa1(r,e,t){nb1(r[Fe],e,{configurable:!0,get:function get1(){return t(this)[e]}})},Gr=function Gr(r,e,t,a){var i=pt(r),n=ma1(t),u=!!a;if(n+e>i.byteLength)throw new Aa1(Fl1);var s=i.bytes,v=n+i.byteOffset,f10=fb1(s,v,v+e);return u?f10:qb1(f10)},Wr1=function Wr1(r,e,t,a,i,n){var u=pt(r),s=ma1(t),v=a(+i),f10=!!n;if(s+e>u.byteLength)throw new Aa1(Fl1);for(var l=u.bytes,c=s+u.byteOffset,h=0;h<e;h++)l[c+h]=v[f10?h:e-h-1]};ab1?(Fn1=pb1&&gr1.name!==De,!Dn1(function(){gr1(1)})||!Dn1(function(){new gr1(-1)})||Dn1(function(){return new gr1,new gr1(1.5),new gr1(NaN),gr1.length!==1||Fn1&&!Ol})?(rr=function(e){return Ta(this,_$Le),lb1(new gr1(ma1(e)),this,rr)},rr[Fe]=_$Le,_$Le.constructor=rr,hb1(rr,gr1)):Fn1&&Ol&&ib1(gr1,"name",De),Tl1&&vb1(pe)!==wl1&&Tl1(pe,wl1),ht1=new Sr1(new rr(2)),Un1=Bn1(pe.setInt8),ht1.setInt8(0,0x80000000),ht1.setInt8(1,0x80000001),(ht1.getInt8(0)||!ht1.getInt8(1))&&Rl(pe,{setInt8:function setInt8(e,t){Un1(this,e,t<<24>>24)},setUint8:function setUint8(e,t){Un1(this,e,t<<24>>24)}},{unsafe:!0})):(rr=function rr(e){Ta(this,_$Le);var t=ma1(e);Al(this,{type:De,bytes:db1(yb1(t),0),byteLength:t}),Ln1||(this.byteLength=t,this.detached=!1)},_$Le=rr[Fe],Sr1=function Sr1(e,t,a){Ta(this,pe),Ta(e,_$Le);var i=ml1(e),n=i.byteLength,u=ub1(t);if(u<0||u>n)throw new Aa1("Wrong offset");if(a=a===void 0?n-u:ob1(a),u+a>n)throw new Aa1(gb1);Al(this,{type:ba1,buffer:e,byteLength:a,byteOffset:u,bytes:i.bytes}),Ln1||(this.buffer=e,this.byteLength=a,this.byteOffset=u)},pe=Sr1[Fe],Ln1&&(Oa1(rr,"byteLength",ml1),Oa1(Sr1,"buffer",pt),Oa1(Sr1,"byteLength",pt),Oa1(Sr1,"byteOffset",pt)),Rl(pe,{getInt8:function getInt8(e){return Gr(this,1,e)[0]<<24>>24},getUint8:function getUint8(e){return Gr(this,1,e)[0]},getInt16:function getInt16(e){var t=Gr(this,2,e,arguments.length>1?arguments[1]:!1);return(t[1]<<8|t[0])<<16>>16},getUint16:function getUint16(e){var t=Gr(this,2,e,arguments.length>1?arguments[1]:!1);return t[1]<<8|t[0]},getInt32:function getInt32(e){return _l1(Gr(this,4,e,arguments.length>1?arguments[1]:!1))},getUint32:function getUint32(e){return _l1(Gr(this,4,e,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function getFloat32(e){return bl1(Gr(this,4,e,arguments.length>1?arguments[1]:!1),23)},getFloat64:function getFloat64(e){return bl1(Gr(this,8,e,arguments.length>1?arguments[1]:!1),52)},setInt8:function setInt8(e,t){Wr1(this,1,e,xl1,t)},setUint8:function setUint8(e,t){Wr1(this,1,e,xl1,t)},setInt16:function setInt16(e,t){Wr1(this,2,e,Cl1,t,arguments.length>2?arguments[2]:!1)},setUint16:function setUint16(e,t){Wr1(this,2,e,Cl1,t,arguments.length>2?arguments[2]:!1)},setInt32:function setInt32(e,t){Wr1(this,4,e,Pl,t,arguments.length>2?arguments[2]:!1)},setUint32:function setUint32(e,t){Wr1(this,4,e,Pl,t,arguments.length>2?arguments[2]:!1)},setFloat32:function setFloat32(e,t){Wr1(this,4,e,Eb1,t,arguments.length>2?arguments[2]:!1)},setFloat64:function setFloat64(e,t){Wr1(this,8,e,Sb1,t,arguments.length>2?arguments[2]:!1)}}));var Fn1,ht1,Un1;Dl1(rr,De);Dl1(Sr1,ba1);Bl1.exports={ArrayBuffer:rr,DataView:Sr1}});var Gl1=o(function(){"use strict";var Ib1=q(),$n1=ct1(),Rb1=R(),$l1=kn(),Ml=A1(),kl1=ot1(),Tb1=_r1(),Hn1=$l1.ArrayBuffer,_$jn=$l1.DataView,Hl1=_$jn.prototype,jl1=$n1(Hn1.prototype.slice),Ob1=$n1(Hl1.getUint8),mb1=$n1(Hl1.setUint8),Ab1=Rb1(function(){return!new Hn1(2).slice(1,void 0).byteLength});Ib1({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Ab1},{slice:function slice(e,t){if(jl1&&t===void 0)return jl1(Ml(this),e);for(var a=Ml(this).byteLength,i=kl1(e,a),n=kl1(t===void 0?a:t,a),u=new Hn1(Tb1(n-i)),s=new _$jn(this),v=new _$jn(u),f10=0;i<n;)mb1(v,f10++,Ob1(s,i++));return u}})});var Vl1=o(function(NG1,Wl1){"use strict";var wb1=On(),bb1=TypeError;Wl1.exports=function(r){if(wb1(r))throw new bb1("ArrayBuffer is detached");return r}});var Ca1=o(function(LG1,zl1){"use strict";var gt=I(),xb1=be(),Cb1=pr1(),xa1=function xa1(r){return xb1.slice(0,r.length)===r};zl1.exports=function(){return xa1("Bun/")?"BUN":xa1("Cloudflare-Workers")?"CLOUDFLARE":xa1("Deno/")?"DENO":xa1("Node.js/")?"NODE":gt.Bun&&typeof Bun.version=="string"?"BUN":gt.Deno&&_type_of(Deno.version)=="object"?"DENO":Cb1(gt.process)==="process"?"NODE":gt.window&>.document?"BROWSER":"REST"}()});var Gn1=o(function(DG1,Kl1){"use strict";var Pb1=Ca1();Kl1.exports=Pb1==="NODE"});var Jl1=o(function(FG1,Yl1){"use strict";var _b1=I(),_$Nb=Gn1();Yl1.exports=function(r){if(_$Nb){try{return _b1.process.getBuiltinModule(r)}catch(e){}try{return Function('return require("'+r+'")')()}catch(e){}}}});var Pa1=o(function(UG1,Ql1){"use strict";var Lb1=I(),Db1=R(),_$Wn=se1(),Vn1=Ca1(),Xl1=Lb1.structuredClone;Ql1.exports=!!Xl1&&!Db1(function(){if(Vn1==="DENO"&&_$Wn>92||Vn1==="NODE"&&_$Wn>94||Vn1==="BROWSER"&&_$Wn>97)return!1;var r=new ArrayBuffer(8),e=Xl1(r,{transfer:[r]});return r.byteLength!==0||e.byteLength!==8})});var _$Xn=o(function(BG1,eh1){"use strict";var Jn1=I(),Fb1=Jl1(),Ub=Pa1(),Bb1=Jn1.structuredClone,Zl1=Jn1.ArrayBuffer,_a1=Jn1.MessageChannel,_$Yn=!1,zn1,rh1,Na1,Kn1;if(Ub)_$Yn=function Yn1(r){Bb1(r,{transfer:[r]})};else if(Zl1)try{_a1||(zn1=Fb1("worker_threads"),zn1&&(_a1=zn1.MessageChannel)),_a1&&(rh1=new _a1,Na1=new Zl1(2),Kn1=function Kn1(r){rh1.port1.postMessage(null,[r])},Na1.byteLength===2&&(Kn1(Na1),Na1.byteLength===0&&(_$Yn=Kn1)))}catch(r){}eh1.exports=_$Yn});var au1=o(function(MG1,sh1){"use strict";var ru1=I(),eu1=S(),nh1=_$ut(),Mb1=_$Ra(),kb1=Vl1(),jb=Tn1(),th1=_$Xn(),Qn1=Pa1(),$b1=ru1.structuredClone,uh1=ru1.ArrayBuffer,Zn=ru1.DataView,Hb1=Math.min,tu=uh1.prototype,oh1=Zn.prototype,Gb1=eu1(tu.slice),ah1=nh1(tu,"resizable","get"),ih1=nh1(tu,"maxByteLength","get"),Wb1=eu1(oh1.getInt8),Vb1=eu1(oh1.setInt8);sh1.exports=(Qn1||th1)&&function(r,e,t){var a=jb(r),i=e===void 0?a:Mb1(e),n=!ah1||!ah1(r),u;if(kb1(r),Qn1&&(r=$b1(r,{transfer:[r]}),a===i&&(t||n)))return r;if(a>=i&&(!t||n))u=Gb1(r,0,i);else{var s=t&&!n&&ih1?{maxByteLength:ih1(r)}:void 0;u=new uh1(i,s);for(var v=new Zn(r),f10=new Zn(u),l=Hb1(i,a),c=0;c<l;c++)Vb1(f10,c,Wb1(v,c))}return Qn1||th1(r),u}});var ch1=o(function(){"use strict";var zb=q(),vh1=au1();vh1&&zb({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function transferToFixedLength(){return vh1(this,arguments.length?arguments[0]:void 0,!1)}})});var lh1=o(function(){"use strict";var Kb1=q(),fh1=au1();fh1&&Kb1({target:"ArrayBuffer",proto:!0},{transfer:function transfer(){return fh1(this,arguments.length?arguments[0]:void 0,!0)}})});var iu1=o(function(GG1,hh1){"use strict";var Yb1=bn(),Jb1=Ea();hh1.exports=Object.keys||function(e){return Yb1(e,Jb1)}});var gh1=o(function(ph1){"use strict";var Xb1=w(),Qb1=an1(),Zb1=V(),rx1=A1(),ex1=fe1(),tx1=iu1();ph1.f=Xb1&&!Qb1?Object.defineProperties:function(e,t){rx1(e);for(var a=ex1(t),i=tx1(t),n=i.length,u=0,s;n>u;)Zb1.f(e,s=i[u++],a[s]);return e}});var dh1=o(function(VG1,yh1){"use strict";var ax1=W10();yh1.exports=ax1("document","documentElement")});var Vr1=o(function(zG1,Oh1){"use strict";var ix1=A1(),nx1=gh1(),qh1=Ea(),ux1=la1(),ox1=dh1(),sx1=ia1(),vx1=fa1(),Eh1=">",Sh1="<",uu1="prototype",ou1="script",Rh1=vx1("IE_PROTO"),nu1=function nu1(){},Th=function Th(r){return Sh1+ou1+Eh1+r+Sh1+"/"+ou1+Eh1},Ih1=function Ih1(r){r.write(Th("")),r.close();var e=r.parentWindow.Object;return r=null,e},cx1=function cx1(){var r=sx1("iframe"),e="java"+ou1+":",t;return r.style.display="none",ox1.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Th("document.F=Object")),t.close(),t.F},La1,Da1=function Da2(){try{La1=new ActiveXObject("htmlfile")}catch(e){}Da1=typeof document!="undefined"?document.domain&&La1?Ih1(La1):cx1():Ih1(La1);for(var r=qh1.length;r--;)delete Da1[uu1][qh1[r]];return Da1()};ux1[Rh1]=!0;Oh1.exports=Object.create||function(e,t){var a;return e!==null?(nu1[uu1]=ix1(e),a=new nu1,nu1[uu1]=null,a[Rh1]=e):a=Da1(),t===void 0?a:nx1.f(a,t)}});var yt1=o(function(KG1,mh1){"use strict";var fx1=x(),lx1=Vr1(),hx1=V().f,su1=fx1("unscopables"),vu=Array.prototype;vu[su1]===void 0&&hx1(vu,su1,{configurable:!0,value:lx1(null)});mh1.exports=function(r){vu[su1][r]=!0}});var Ah1=o(function(){"use strict";var px1=q(),gx1=B(),yx1=L(),dx1=k(),qx1=yt1();px1({target:"Array",proto:!0},{at:function at(e){var t=gx1(this),a=yx1(t),i=dx1(e),n=i>=0?i:a+i;return n<0||n>=a?void 0:t[n]}});qx1("at")});var dt1=o(function(XG1,wh1){"use strict";var _$Ex=pr1();wh1.exports=Array.isArray||function(e){return _$Ex(e)==="Array"}});var cu1=o(function(QG1,bh1){"use strict";var _$Sx=w(),Ix1=dt1(),Rx=TypeError,Tx1=Object.getOwnPropertyDescriptor,Ox=_$Sx&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return _instanceof(r,TypeError)}}();bh1.exports=Ox?function(r,e){if(Ix1(r)&&!Tx1(r,"length").writable)throw new Rx("Cannot set read only .length");return r.length=e}:function(r,e){return r.length=e}});var fu1=o(function(ZG1,xh1){"use strict";var mx1=TypeError,Ax1=0x1fffffffffffff;xh1.exports=function(r){if(r>Ax1)throw mx1("Maximum allowed index exceeded");return r}});var Ch1=o(function(){"use strict";var wx1=q(),bx1=B(),xx1=L(),_$Cx=cu1(),Px1=fu1(),_x1=R(),Nx1=_x1(function(){return[].push.call({length:0x100000000},1)!==0x100000001}),Lx1=function Lx1(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return _instanceof(r,TypeError)}},Dx1=Nx1||!Lx1();wx1({target:"Array",proto:!0,arity:1,forced:Dx1},{push:function push(e){var t=bx1(this),a=xx1(t),i=arguments.length;Px1(a+i);for(var n=0;n<i;n++)t[a]=arguments[n],a++;return _$Cx(t,a),a}})});var Dh=o(function(t41,Lh1){"use strict";var Fx1=_(),Ux1=B(),Bx1=_e1(),_$Mx=L(),Ph1=TypeError,_h1="Reduce of empty array with no initial value",Nh1=function Nh1(r){return function(e,t,a,i){var n=Ux1(e),u=Bx1(n),s=_$Mx(n);if(Fx1(t),s===0&&a<2)throw new Ph1(_h1);var v=r?s-1:0,f10=r?-1:1;if(a<2)for(;;){if(v in u){i=u[v],v+=f10;break}if(v+=f10,r?v<0:s<=v)throw new Ph1(_h1)}for(;r?v>=0:s>v;v+=f10)v in u&&(i=t(i,u[v],v,n));return i}};Lh1.exports={left:Nh1(!1),right:Nh1(!0)}});var lu1=o(function(a41,Fh1){"use strict";var _$kx=R();Fh1.exports=function(r,e){var t=[][r];return!!t&&_$kx(function(){t.call(null,e||function(){return 1},1)})}});var Bh1=o(function(){"use strict";var jx=q(),$x1=Dh().left,Hx1=lu1(),Uh1=se1(),Gx1=Gn1(),Wx=!Gx1&&Uh1>79&&Uh1<83,Vx1=Wx||!Hx1("reduce");jx({target:"Array",proto:!0,forced:Vx1},{reduce:function reduce(e){var t=arguments.length;return $x1(this,e,t,t>1?arguments[1]:void 0)}})});var kh1=o(function(){"use strict";var zx1=q(),Kx1=S(),Yx1=dt1(),Jx1=Kx1([].reverse),Mh1=[1,2];zx1({target:"Array",proto:!0,forced:String(Mh1)===String(Mh1.reverse())},{reverse:function reverse(){return Yx1(this)&&(this.length=this.length),Jx1(this)}})});var hu=o(function(s41,$h1){"use strict";var jh1=ve(),Xx1=TypeError;$h1.exports=function(r,e){if(!delete r[e])throw new Xx1("Cannot delete property "+jh1(e)+" of "+jh1(r))}});var Wh1=o(function(v41,Gh1){"use strict";var Qx1=x(),Zx1=Qx1("toStringTag"),Hh1={};Hh1[Zx1]="z";Gh1.exports=String(Hh1)==="[object z]"});var Ir1=o(function(c41,Vh1){"use strict";var r01=Wh1(),e01=b(),Fa1=pr1(),t01=x(),a01=t01("toStringTag"),i01=Object,n01=Fa1(function(){return arguments}())==="Arguments",u01=function u01(r,e){try{return r[e]}catch(t){}};Vh1.exports=r01?Fa1:function(r){var e,t,a;return r===void 0?"Undefined":r===null?"Null":typeof(t=u01(e=i01(r),a01))=="string"?t:n01?Fa1(e):(a=Fa1(e))==="Object"&&e01(e.callee)?"Arguments":a}});var N=o(function(f41,zh1){"use strict";var o01=Ir1(),s01=String;zh1.exports=function(r){if(o01(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return s01(r)}});var Ua=o(function(l41,Yh1){"use strict";var Kh1=ft1(),v01=Math.floor,pu1=function pu2(r,e){var t=r.length;if(t<8)for(var a=1,i,n;a<t;){for(n=a,i=r[a];n&&e(r[n-1],i)>0;)r[n]=r[--n];n!==a++&&(r[n]=i)}else for(var u=v01(t/2),s=pu1(Kh1(r,0,u),e),v=pu1(Kh1(r,u),e),f10=s.length,l=v.length,c=0,h=0;c<f10||h<l;)r[c+h]=c<f10&&h<l?e(s[c],v[h])<=0?s[c++]:v[h++]:c<f10?s[c++]:v[h++];return r};Yh1.exports=pu1});var gu=o(function(h41,Xh){"use strict";var c01=be(),Jh1=c01.match(/firefox\/(\d+)/i);Xh.exports=!!Jh1&&+Jh1[1]});var yu=o(function(p41,Qh1){"use strict";var f01=be();Qh1.exports=/MSIE|Trident/.test(f01)});var du1=o(function(g41,rp1){"use strict";var l01=be(),Zh1=l01.match(/AppleWebKit\/(\d+)\./);rp1.exports=!!Zh1&&+Zh1[1]});var vp1=o(function(){"use strict";var h01=q(),op=S(),p01=_(),g01=B(),ep1=L(),y01=hu(),tp1=N(),qu1=R(),d01=Ua(),q01=lu1(),_$ap=gu(),E01=yu(),ip=se1(),np1=du1(),zr1=[],up1=op(zr1.sort),S01=op(zr1.push),I01=qu1(function(){zr1.sort(void 0)}),R01=qu1(function(){zr1.sort(null)}),T01=q01("sort"),sp1=!qu1(function(){if(ip)return ip<70;if(!(_$ap&&_$ap>3)){if(E01)return!0;if(np1)return np1<603;var r="",e,t,a,i;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(i=0;i<47;i++)zr1.push({k:t+i,v:a})}for(zr1.sort(function(n,u){return u.v-n.v}),i=0;i<zr1.length;i++)t=zr1[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return r!=="DGBEFHACIJK"}}),O01=I01||!R01||!T01||!sp1,m01=function m01(r){return function(e,t){return t===void 0?-1:e===void 0?1:r!==void 0?+r(e,t)||0:tp1(e)>tp1(t)?1:-1}};h01({target:"Array",proto:!0,forced:O01},{sort:function sort(e){e!==void 0&&p01(e);var t=g01(this);if(sp1)return e===void 0?up1(t):up1(t,e);var a=[],i=ep1(t),n,u;for(u=0;u<i;u++)u in t&&S01(a,t[u]);for(d01(a,m01(e)),n=ep1(a),u=0;u<n;)t[u]=a[u++];for(;u<i;)y01(t,u++);return t}})});var cp1=o(function(){"use strict";var A01=yt1();A01("flatMap")});var fp=o(function(){"use strict";var w01=yt1();w01("flat")});var lp1=o(function(){"use strict";var b01=q(),x01=B(),C01=L(),P01=cu1(),_01=hu(),N01=fu1(),L01=[].unshift(0)!==1,D01=function D01(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(r){return _instanceof(r,TypeError)}},F01=L01||!D01();b01({target:"Array",proto:!0,arity:1,forced:F01},{unshift:function unshift(e){var t=x01(this),a=C01(t),i=arguments.length;if(i){N01(a+i);for(var n=a;n--;){var u=n+i;n in t?t[u]=t[n]:_01(t,u)}for(var s=0;s<i;s++)t[s]=arguments[s]}return P01(t,a+i)}})});var Eu1=o(function(O41,hp1){"use strict";var U01=L(),B01=k(),M01=RangeError;hp1.exports=function(r,e,t,a){var i=U01(r),n=B01(t),u=n<0?i+n:n;if(u>=i||u<0)throw new M01("Incorrect index");for(var s=new e(i),v=0;v<i;v++)s[v]=v===u?a:r[v];return s}});var pp1=o(function(){"use strict";var k01=q(),j01=Eu1(),$01=fe1(),H01=Array,G01=function(){try{[].with({valueOf:function valueOf(){throw 4}},null)}catch(r){return r!==4}}();k01({target:"Array",proto:!0,forced:G01},{with:function _with(r,e){return j01($01(this),H01,r,e)}})});var qt1=o(function(w41,qp1){"use strict";var W0=tt(),dp1=Function.prototype,gp1=dp1.apply,yp1=dp1.call;qp1.exports=(typeof Reflect==="undefined"?"undefined":_type_of(Reflect))=="object"&&Reflect.apply||(W0?yp1.bind(gp1):function(){return yp1.apply(gp1,arguments)})});var Sp1=o(function(b41,Ep){"use strict";var V01=V().f;Ep.exports=function(r,e,t){t in r||V01(r,t,{configurable:!0,get:function get1(){return e[t]},set:function set1(a){e[t]=a}})}});var Su1=o(function(x41,Ip){"use strict";var z01=N();Ip.exports=function(r,e){return r===void 0?arguments.length<2?"":e:z01(r)}});var Tp=o(function(C41,Rp){"use strict";var K01=P1(),Y01=z();Rp.exports=function(r,e){K01(e)&&"cause"in e&&Y01(r,"cause",e.cause)}});var Iu1=o(function(P41,Ap){"use strict";var J01=S(),Op1=Error,X01=J01("".replace),Q01=function(r){return String(new Op1(r).stack)}("zxcasd"),mp1=/\n\s*at [^:]*:[^\n]*/,Z01=mp1.test(Q01);Ap.exports=function(r,e){if(Z01&&typeof r=="string"&&!Op1.prepareStackTrace)for(;e--;)r=X01(r,mp1,"");return r}});var Ru1=o(function(_41,wp1){"use strict";var rC1=R(),eC1=Pr1();wp1.exports=!rC1(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",eC1(1,7)),r.stack!==7):!0})});var Cp=o(function(N41,xp1){"use strict";var tC1=z(),aC1=Iu1(),iC1=Ru1(),bp1=Error.captureStackTrace;xp1.exports=function(r,e,t,a){iC1&&(bp1?bp1(r,e):tC1(r,"stack",aC1(t,a)))}});var Bp1=o(function(L41,Up1){"use strict";var Pp=W10(),nC1=C(),_p1=z(),uC1=Cr(),Np1=he1(),Lp1=st1(),Dp1=Sp1(),oC1=_$lt(),sC1=Su1(),vC1=Tp(),cC1=Cp(),fC=w(),Fp1=D();Up1.exports=function(r,e,t,a){var i="stackTraceLimit",n=a?2:1,u=r.split("."),s=u[u.length-1],v=Pp.apply(null,u);if(v){var f10=v.prototype;if(!Fp1&&nC1(f10,"cause")&&delete f10.cause,!t)return v;var l=Pp("Error"),c=e(function(h,y){var g=sC1(a?y:h,void 0),d=a?new v(h):new v;return g!==void 0&&_p1(d,"message",g),cC1(d,c,d.stack,2),this&&uC1(f10,this)&&oC1(d,this,c),arguments.length>n&&vC1(d,arguments[n]),d});if(c.prototype=f10,s!=="Error"?Np1?Np1(c,l):Lp1(c,l,{name:!0}):fC&&i in v&&(Dp1(c,v,i),Dp1(c,v,"prepareStackTrace")),Lp1(c,v),!Fp1)try{f10.name!==s&&_p1(f10,"name",s),f10.constructor=c}catch(h){}return c}}});var $p1=o(function(){"use strict";var kp1=q(),lC1=I(),Rr1=qt1(),jp1=Bp1(),Tu="WebAssembly",Mp1=lC1[Tu],Ba=new Error("e",{cause:7}).cause!==7,ge=function ge(r,e){var t={};t[r]=jp1(r,e,Ba),kp1({global:!0,constructor:!0,arity:1,forced:Ba},t)},Ou1=function Ou1(r,e){if(Mp1&&Mp1[r]){var t={};t[r]=jp1(Tu+"."+r,e,Ba),kp1({target:Tu,stat:!0,constructor:!0,arity:1,forced:Ba},t)}};ge("Error",function(r){return function(t){return Rr1(r,this,arguments)}});ge("EvalError",function(r){return function(t){return Rr1(r,this,arguments)}});ge("RangeError",function(r){return function(t){return Rr1(r,this,arguments)}});ge("ReferenceError",function(r){return function(t){return Rr1(r,this,arguments)}});ge("SyntaxError",function(r){return function(t){return Rr1(r,this,arguments)}});ge("TypeError",function(r){return function(t){return Rr1(r,this,arguments)}});ge("URIError",function(r){return function(t){return Rr1(r,this,arguments)}});Ou1("CompileError",function(r){return function(t){return Rr1(r,this,arguments)}});Ou1("LinkError",function(r){return function(t){return Rr1(r,this,arguments)}});Ou1("RuntimeError",function(r){return function(t){return Rr1(r,this,arguments)}})});var Hp1=o(function(){"use strict";var hC1=q(),mu=I();hC1({global:!0,forced:mu.globalThis!==mu},{globalThis:mu})});var Et1=o(function(M41,Gp1){"use strict";var pC1=w(),gC1=V(),yC1=Pr1();Gp1.exports=function(r,e,t){pC1?gC1.f(r,e,yC1(0,t)):r[e]=t}});var St1=o(function(k41,zp1){"use strict";var dC1=R(),qC1=b(),EC1=P1(),SC1=Vr1(),Wp1=Ne1(),IC1=Z(),RC1=x(),TC1=D(),bu1=RC1("iterator"),Vp1=!1,Lr,Au1,_$wu;[].keys&&(_$wu=[].keys(),"next"in _$wu?(Au1=Wp1(Wp1(_$wu)),Au1!==Object.prototype&&(Lr=Au1)):Vp1=!0);var OC1=!EC1(Lr)||dC1(function(){var r={};return Lr[bu1].call(r)!==r});OC1?Lr={}:TC1&&(Lr=SC1(Lr));qC1(Lr[bu1])||IC1(Lr,bu1,function(){return this});zp1.exports={IteratorPrototype:Lr,BUGGY_SAFARI_ITERATORS:Vp1}});var Zp1=o(function(){"use strict";var mC1=q(),AC1=I(),wC1=le1(),bC1=A1(),xC1=b(),CC1=Ne1(),PC1=Q(),_C1=Et1(),NC1=R(),Pu1=C(),LC1=x(),Tr=St1().IteratorPrototype,DC1=w(),FC1=D(),xu="constructor",Yp1="Iterator",Kp1=LC1("toStringTag"),Jp1=TypeError,Cu1=AC1[Yp1],Xp1=FC1||!xC1(Cu1)||Cu1.prototype!==Tr||!NC1(function(){Cu1({})}),_u=function _u(){if(wC1(this,Tr),CC1(this)===Tr)throw new Jp1("Abstract class Iterator not directly constructable")},Qp1=function Qp1(r,e){DC1?PC1(Tr,r,{configurable:!0,get:function get1(){return e},set:function set1(t){if(bC1(this),this===Tr)throw new Jp1("You can't redefine this property");Pu1(this,r)?this[r]=t:_C1(this,r,t)}}):Tr[r]=e};Pu1(Tr,Kp1)||Qp1(Kp1,Yp1);(Xp1||!Pu1(Tr,xu)||Tr[xu]===Object)&&Qp1(xu,_u);_u.prototype=Tr;mC1({global:!0,constructor:!0,forced:Xp1},{Iterator:_u})});var er1=o(function(H41,rg){"use strict";rg.exports=function(r){return{iterator:r,next:r.next,done:!1}}});var tg=o(function(G41,eg){"use strict";var UC1=RangeError;eg.exports=function(r){if(r===r)return r;throw new UC1("NaN is not allowed")}});var Nu1=o(function(W41,ag){"use strict";var BC1=k(),MC1=RangeError;ag.exports=function(r){var e=BC1(r);if(e<0)throw new MC1("The argument can't be less than 0");return e}});var M=o(function(V41,ng){"use strict";var kC1=m(),ig=A1(),jC1=$r1();ng.exports=function(r,e,t){var a,i;ig(r);try{if(a=jC1(r,"return"),!a){if(e==="throw")throw t;return t}a=kC1(a,r)}catch(n){i=!0,a=n}if(e==="throw")throw t;if(i)throw a;return ig(a),t}});var Ue=o(function(z41,ug){"use strict";ug.exports=function(r,e){return{value:r,done:e}}});var sg1=o(function(K41,og){"use strict";var $C1=M();og.exports=function(r,e,t){for(var a=r.length-1;a>=0;a--)if(r[a]!==void 0)try{t=$C1(r[a].iterator,e,t)}catch(i){e="throw",t=i}if(e==="throw")throw t;return t}});var It1=o(function(Y41,gg1){"use strict";var HC1=m(),GC1=Vr1(),WC1=z(),VC1=Ia1(),zC1=x(),cg=_$X(),KC1=$r1(),YC1=St1().IteratorPrototype,Ma1=Ue(),ka1=M(),JC1=sg1(),XC1=zC1("toStringTag"),fg1="IteratorHelper",lg="WrapForValidIterator",Lu1="normal",vg1="throw",QC1=cg.set,hg1=function hg1(r){var e=cg.getterFor(r?lg:fg1);return VC1(GC1(YC1),{next:function next(){var a=e(this);if(r)return a.nextHandler();if(a.done)return Ma1(void 0,!0);try{var i=a.nextHandler();return a.returnHandlerResult?i:Ma1(i,a.done)}catch(n){throw a.done=!0,n}},return:function _return(){var t=e(this),a=t.iterator;if(t.done=!0,r){var i=KC1(a,"return");return i?HC1(i,a):Ma1(void 0,!0)}if(t.inner)try{ka1(t.inner.iterator,Lu1)}catch(n){return ka1(a,vg1,n)}if(t.openIters)try{JC1(t.openIters,Lu1)}catch(n){return ka1(a,vg1,n)}return a&&ka1(a,Lu1),Ma1(void 0,!0)}})},ZC1=hg1(!0),pg1=hg1(!1);WC1(pg1,XC1,"Iterator Helper");gg1.exports=function(r,e,t){var a=function a(n,u){u?(u.iterator=n.iterator,u.next=n.next):u=n,u.type=e?lg:fg1,u.returnHandlerResult=!!t,u.nextHandler=r,u.counter=0,u.done=!1,QC1(this,u)};return a.prototype=e?ZC1:pg1,a}});var Rt=o(function(J41,yg1){"use strict";yg1.exports=function(r,e){var t=typeof Iterator=="function"&&Iterator.prototype[r];if(t)try{t.call({next:null},e).next()}catch(a){return!0}}});var Or1=o(function(X41,dg1){"use strict";var rP1=I();dg1.exports=function(r,e){var t=rP1.Iterator,a=t&&t.prototype,i=a&&a[r],n=!1;if(i)try{i.call({next:function next(){return{done:!0}},return:function _return(){n=!0}},-1)}catch(u){_instanceof(u,e)||(n=!1)}if(!n)return i}});var Eg1=o(function(){"use strict";var eP1=q(),Du1=m(),Fu1=A1(),tP1=er1(),aP1=tg(),iP1=Nu1(),nP1=M(),uP1=It1(),oP1=Rt(),sP1=Or1(),Bu1=D(),qg1=!Bu1&&!oP1("drop",0),Uu1=!Bu1&&!qg1&&sP1("drop",RangeError),vP1=Bu1||qg1||Uu1,cP1=uP1(function(){for(var r=this.iterator,e=this.next,t,a;this.remaining;)if(this.remaining--,t=Fu1(Du1(e,r)),a=this.done=!!t.done,a)return;if(t=Fu1(Du1(e,r)),a=this.done=!!t.done,!a)return t.value});eP1({target:"Iterator",proto:!0,real:!0,forced:vP1},{drop:function drop(e){Fu1(this);var t;try{t=iP1(aP1(+e))}catch(a){nP1(this,"throw",a)}return Uu1?Du1(Uu1,this,t):new cP1(tP1(this),{remaining:t})}})});var _$Kr=o(function(rW1,Ig1){"use strict";var Sg1=ct1(),fP1=_(),lP1=tt(),hP1=Sg1(Sg1.bind);Ig1.exports=function(r,e){return fP1(r),e===void 0?r:lP1?hP1(r,e):function(){return r.apply(e,arguments)}}});var Be1=o(function(eW1,Rg1){"use strict";Rg1.exports={}});var ja1=o(function(tW1,Tg1){"use strict";var pP1=x(),gP1=Be1(),yP1=pP1("iterator"),dP1=Array.prototype;Tg1.exports=function(r){return r!==void 0&&(gP1.Array===r||dP1[yP1]===r)}});var ye=o(function(aW1,mg1){"use strict";var qP1=Ir1(),Og1=$r1(),EP1=we(),SP1=Be1(),IP1=x(),RP1=IP1("iterator");mg1.exports=function(r){if(!EP1(r))return Og1(r,RP1)||Og1(r,"@@iterator")||SP1[qP1(r)]}});var Tt=o(function(iW,Ag1){"use strict";var TP1=m(),OP1=_(),mP1=A1(),AP1=ve(),wP1=ye(),bP1=TypeError;Ag1.exports=function(r,e){var t=arguments.length<2?wP1(r):e;if(OP1(t))return mP1(TP1(t,r));throw new bP1(AP1(r)+" is not iterable")}});var mr1=o(function(nW1,Cg1){"use strict";var xP1=_$Kr(),CP1=m(),PP1=A1(),_P1=ve(),NP1=ja1(),LP1=L(),wg1=Cr(),DP1=Tt(),FP1=ye(),bg1=M(),UP1=TypeError,$a1=function $a1(r,e){this.stopped=r,this.result=e},xg1=$a1.prototype;Cg1.exports=function(r,e,t){var a=t&&t.that,i=!!(t&&t.AS_ENTRIES),n=!!(t&&t.IS_RECORD),u=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=xP1(e,a),f10,l,c,h,y,g,d,E=function E(O){return f10&&bg1(f10,"normal"),new $a1(!0,O)},T=function T(O){return i?(PP1(O),s?v(O[0],O[1],E):v(O[0],O[1])):s?v(O,E):v(O)};if(n)f10=r.iterator;else if(u)f10=r;else{if(l=FP1(r),!l)throw new UP1(_P1(r)+" is not iterable");if(NP1(l)){for(c=0,h=LP1(r);h>c;c++)if(y=T(r[c]),y&&wg1(xg1,y))return y;return new $a1(!1)}f10=DP1(r,l)}for(g=n?r.next:f10.next;!(d=CP1(g,f10)).done;){try{y=T(d.value)}catch(O){bg1(f10,"throw",O)}if((typeof y==="undefined"?"undefined":_type_of(y))=="object"&&y&&wg1(xg1,y))return y}return new $a1(!1)}});var Pg1=o(function(){"use strict";var BP1=q(),MP1=m(),_$kP=mr1(),jP1=_(),$P1=A1(),HP1=er1(),GP1=M(),WP1=Or1(),Mu1=WP1("every",TypeError);BP1({target:"Iterator",proto:!0,real:!0,forced:Mu1},{every:function every(e){$P1(this);try{jP1(e)}catch(i){GP1(this,"throw",i)}if(Mu1)return MP1(Mu1,this,e);var t=HP1(this),a=0;return!_$kP(t,function(i,n){if(!e(i,a++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})});var Ha1=o(function(sW1,_g1){"use strict";var VP1=A1(),zP1=M();_g1.exports=function(r,e,t,a){try{return a?e(VP1(t)[0],t[1]):e(t)}catch(i){zP1(r,"throw",i)}}});var Fg1=o(function(){"use strict";var KP1=q(),Ng1=m(),YP1=_(),Lg1=A1(),JP1=er1(),XP1=It1(),QP1=Ha1(),ju1=D(),ZP1=M(),r_1=Rt(),e_1=Or1(),Dg1=!ju1&&!r_1("filter",function(){}),ku1=!ju1&&!Dg1&&e_1("filter",TypeError),t_1=ju1||Dg1||ku1,a_1=XP1(function(){for(var r=this.iterator,e=this.predicate,t=this.next,a,i,n;;){if(a=Lg1(Ng1(t,r)),i=this.done=!!a.done,i)return;if(n=a.value,QP1(r,e,[n,this.counter++],!0))return n}});KP1({target:"Iterator",proto:!0,real:!0,forced:t_1},{filter:function filter(e){Lg1(this);try{YP1(e)}catch(t){ZP1(this,"throw",t)}return ku1?Ng1(ku1,this,e):new a_1(JP1(this),{predicate:e})}})});var Ug1=o(function(){"use strict";var i_1=q(),n_1=m(),u_1=mr1(),o_1=_(),s_1=A1(),v_1=er1(),c_1=M(),f_1=Or1(),$u1=f_1("find",TypeError);i_1({target:"Iterator",proto:!0,real:!0,forced:$u1},{find:function find(e){s_1(this);try{o_1(e)}catch(i){c_1(this,"throw",i)}if($u1)return n_1($u1,this,e);var t=v_1(this),a=0;return u_1(t,function(i,n){if(e(i,a++))return n(i)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})});var kg1=o(function(hW1,Mg1){"use strict";var l_1=m(),Bg1=A1(),h_1=er1(),p_1=ye();Mg1.exports=function(r,e){(!e||typeof r!="string")&&Bg1(r);var t=p_1(r);return h_1(Bg1(t!==void 0?l_1(t,r):r))}});var $g1=o(function(){"use strict";var g_1=q(),Hu1=m(),y_1=_(),Gu1=A1(),d_1=er1(),q_=kg1(),E_1=It1(),Wu1=M(),zu1=D(),S_1=Rt(),I_1=Or1(),jg1=!zu1&&!S_1("flatMap",function(){}),Vu1=!zu1&&!jg1&&I_1("flatMap",TypeError),R_=zu1||jg1||Vu1,T_1=E_1(function(){for(var r=this.iterator,e=this.mapper,t,a;;){if(a=this.inner)try{if(t=Gu1(Hu1(a.next,a.iterator)),!t.done)return t.value;this.inner=null}catch(i){Wu1(r,"throw",i)}if(t=Gu1(Hu1(this.next,r)),this.done=!!t.done)return;try{this.inner=q_(e(t.value,this.counter++),!1)}catch(i){Wu1(r,"throw",i)}}});g_1({target:"Iterator",proto:!0,real:!0,forced:R_},{flatMap:function flatMap(e){Gu1(this);try{y_1(e)}catch(t){Wu1(this,"throw",t)}return Vu1?Hu1(Vu1,this,e):new T_1(d_1(this),{mapper:e,inner:null})}})});var Hg1=o(function(){"use strict";var O_=q(),m_1=m(),A_1=mr1(),w_1=_(),b_1=A1(),x_1=er1(),C_1=M(),P_1=Or1(),Ku1=P_1("forEach",TypeError);O_({target:"Iterator",proto:!0,real:!0,forced:Ku1},{forEach:function forEach(e){b_1(this);try{w_1(e)}catch(i){C_1(this,"throw",i)}if(Ku1)return m_1(Ku1,this,e);var t=x_1(this),a=0;A_1(t,function(i){e(i,a++)},{IS_RECORD:!0})}})});var zg1=o(function(){"use strict";var __1=q(),Gg1=m(),N_=_(),Wg1=A1(),L_=er1(),D_=It1(),F_=Ha1(),U_=M(),B_=Rt(),M_=Or1(),Ju1=D(),Vg1=!Ju1&&!B_("map",function(){}),Yu1=!Ju1&&!Vg1&&M_("map",TypeError),k_1=Ju1||Vg1||Yu1,j_=D_(function(){var r=this.iterator,e=Wg1(Gg1(this.next,r)),t=this.done=!!e.done;if(!t)return F_(r,this.mapper,[e.value,this.counter++],!0)});__1({target:"Iterator",proto:!0,real:!0,forced:k_1},{map:function map(e){Wg1(this);try{N_(e)}catch(t){U_(this,"throw",t)}return Yu1?Gg1(Yu1,this,e):new j_(L_(this),{mapper:e})}})});var Jg1=o(function(){"use strict";var $_=q(),H_=mr1(),G_=_(),W_=A1(),V_=er1(),z_=M(),K_=Or1(),Y_=qt1(),J_1=R(),Kg1=TypeError,Yg1=J_1(function(){[].keys().reduce(function(){},void 0)}),Xu1=!Yg1&&K_("reduce",Kg1);$_({target:"Iterator",proto:!0,real:!0,forced:Yg1||Xu1},{reduce:function reduce(e){W_(this);try{G_(e)}catch(u){z_(this,"throw",u)}var t=arguments.length<2,a=t?void 0:arguments[1];if(Xu1)return Y_(Xu1,this,t?[e]:[e,a]);var i=V_(this),n=0;if(H_(i,function(u){t?(t=!1,a=u):a=e(a,u,n),n++},{IS_RECORD:!0}),t)throw new Kg1("Reduce of empty iterator with no initial value");return a}})});var Xg1=o(function(){"use strict";var X_1=q(),Q_=m(),Z_=mr1(),r11=_(),e11=A1(),t11=er1(),a11=M(),i11=Or1(),Qu1=i11("some",TypeError);X_1({target:"Iterator",proto:!0,real:!0,forced:Qu1},{some:function some(e){e11(this);try{r11(e)}catch(i){a11(this,"throw",i)}if(Qu1)return Q_(Qu1,this,e);var t=t11(this),a=0;return Z_(t,function(i,n){if(e(i,a++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})});var Qg1=o(function(){"use strict";var n11=q(),u11=A1(),o11=mr1(),s11=er1(),v11=[].push;n11({target:"Iterator",proto:!0,real:!0},{toArray:function toArray(){var e=[];return o11(s11(u11(this)),v11,{that:e,IS_RECORD:!0}),e}})});var ry1=o(function(AW1,Zg1){"use strict";var c11=P1(),f11=_$X().get;Zg1.exports=function(e){if(!c11(e))return!1;var t=f11(e);return!!t&&t.type==="RawJSON"}});var ny1=o(function(wW1,iy1){"use strict";var Zu1=S(),l11=C(),Ga=SyntaxError,h11=parseInt,p11=String.fromCharCode,g11=Zu1("".charAt),ey1=Zu1("".slice),ty1=Zu1(/./.exec),ay1={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":" "},y11=/^[\da-f]{4}$/i,d11=/^[\u0000-\u001F]$/;iy1.exports=function(r,e){for(var t=!0,a="";e<r.length;){var i=g11(r,e);if(i==="\\"){var n=ey1(r,e,e+2);if(l11(ay1,n))a+=ay1[n],e+=2;else if(n==="\\u"){e+=2;var u=ey1(r,e,e+4);if(!ty1(y11,u))throw new Ga("Bad Unicode escape at: "+e);a+=p11(h11(u,16)),e+=4}else throw new Ga('Unknown escape sequence: "'+n+'"')}else if(i==='"'){t=!1,e++;break}else{if(ty1(d11,i))throw new Ga("Bad control character in string literal at: "+e);a+=i,e++}}if(t)throw new Ga("Unterminated string at: "+e);return{value:a,end:e}}});var oy1=o(function(bW1,uy1){"use strict";var q1=R();uy1.exports=!q1(function(){var r="9007199254740993",e=JSON.rawJSON(r);return!JSON.isRawJSON(e)||JSON.stringify(e)!==r})});var _$Iy=o(function(){"use strict";var E1=q(),gy1=W10(),S11=qt1(),yy1=m(),de=S(),dy1=R(),sy1=dt1(),Va1=b(),I1=ry1(),vy1=xe(),cy1=pr1(),R1=N(),T1=ft1(),O1=ny1(),m11=Ce1(),A1=oa1(),ro1=oy1(),qy1=String,Yr=gy1("JSON","stringify"),Wa1=de(/./.exec),to1=de("".charAt),w11=de("".charCodeAt),b11=de("".replace),eo1=de("".slice),ao1=de([].push),x11=de(1.1.toString),C1=/[\uD800-\uDFFF]/g,fy1=/^[\uD800-\uDBFF]$/,ly1=/^[\uDC00-\uDFFF]$/,io=m11(),hy1=io.length,Ey1=!A1||dy1(function(){var r=gy1("Symbol")("stringify detection");return Yr([r])!=="[null]"||Yr({a:r})!=="{}"||Yr(Object(r))!=="{}"}),py1=dy1(function(){return Yr("\uDF06\uD834")!=='"\\udf06\\ud834"'||Yr("\uDEAD")!=='"\\udead"'}),P1=Ey1?function P1(r,e){var t=T1(arguments),a=Sy1(e);if(!(!Va1(a)&&(r===void 0||vy1(r))))return t[1]=function(i,n){if(Va1(a)&&(n=yy1(a,this,qy1(i),n)),!vy1(n))return n},S11(Yr,null,t)}:Yr,_11=function _11(r,e,t){var a=to1(t,e-1),i=to1(t,e+1);return Wa1(fy1,r)&&!Wa1(ly1,i)||Wa1(ly1,r)&&!Wa1(fy1,a)?"\\u"+x11(w11(r,0),16):r},Sy1=function Sy1(r){if(Va1(r))return r;if(sy1(r)){for(var e=r.length,t=[],a=0;a<e;a++){var i=r[a];typeof i=="string"?ao1(t,i):(typeof i=="number"||cy1(i)==="Number"||cy1(i)==="String")&&ao1(t,R1(i))}var n=t.length,u=!0;return function(s,v){if(u)return u=!1,v;if(sy1(this))return v;for(var f10=0;f10<n;f10++)if(t[f10]===s)return v}}};Yr&&E1({target:"JSON",stat:!0,arity:3,forced:Ey1||py1||!ro1},{stringify:function stringify(e,t,a){var i=Sy1(t),n=[],u=P1(e,function(y,g){var d=Va1(i)?yy1(i,this,qy1(y),g):g;return!ro1&&I1(d)?io+(ao1(n,d.rawJSON)-1):d},a);if(typeof u!="string"||(py1&&(u=b11(u,C1,_11)),ro1))return u;for(var s="",v=u.length,f10=0;f10<v;f10++){var l=to1(u,f10);if(l==='"'){var c=O1(u,++f10).end-1,h=eo1(u,f10,c);s+=eo1(h,0,hy1)===io?n[eo1(h,hy1)]:'"'+h+'"',f10=c}else s+=l}return s}})});var Ty1=o(function(){"use strict";var N11=q(),Ry1=Math.hypot,L11=Math.abs,D11=Math.sqrt,F11=!!Ry1&&Ry1(1/0,NaN)!==1/0;N11({target:"Math",stat:!0,arity:2,forced:F11},{hypot:function hypot(e,t){for(var a=0,i=0,n=arguments.length,u=0,s,v;i<n;)s=L11(arguments[i++]),u<s?(v=u/s,a=a*v*v+1,u=s):s>0?(v=s/u,a+=v*v):a+=s;return u===1/0?1/0:u*D11(a)}})});var Oy1=o(function(){"use strict";var U1=q(),B11=mr1(),M1=Et1();U1({target:"Object",stat:!0},{fromEntries:function fromEntries(e){var t={};return B11(e,function(a,i){M1(t,a,i)},{AS_ENTRIES:!0}),t}})});var my1=o(function(){"use strict";var k11=q(),j1=C();k11({target:"Object",stat:!0},{hasOwn:j1})});var no1=o(function(UW1,wy1){"use strict";var Ay1=_(),$1=TypeError,H11=function H11(r){var e,t;this.promise=new r(function(a,i){if(e!==void 0||t!==void 0)throw new $1("Bad Promise constructor");e=a,t=i}),this.resolve=Ay1(e),this.reject=Ay1(t)};wy1.exports.f=function(r){return new H11(r)}});var xy1=o(function(BW1,by1){"use strict";by1.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var za1=o(function(MW1,Cy1){"use strict";var G11=I();Cy1.exports=G11.Promise});var oo1=o(function(kW1,Ly1){"use strict";var W11=x(),_y1=W11("iterator"),Ny1=!1;try{Py1=0,uo1={next:function next(){return{done:!!Py1++}},return:function _return(){Ny1=!0}},uo1[_y1]=function(){return this},Array.from(uo1,function(){throw 2})}catch(r){}var Py1,uo1;Ly1.exports=function(r,e){try{if(!e&&!Ny1)return!1}catch(i){return!1}var t=!1;try{var a={};a[_y1]=function(){return{next:function next(){return{done:t=!0}}}},r(a)}catch(i){}return t}});var My1=o(function(jW1,By1){"use strict";var V11=I(),Ot1=za1(),z11=b(),K11=Pn1(),Y11=aa1(),J11=x(),Dy1=Ca1(),X11=D(),so1=se1(),Fy1=Ot1&&Ot1.prototype,Q11=J11("species"),vo1=!1,Uy1=z11(V11.PromiseRejectionEvent),Z11=K11("Promise",function(){var r=Y11(Ot1),e=r!==String(Ot1);if(!e&&so1===66||X11&&!(Fy1.catch&&Fy1.finally))return!0;if(!so1||so1<51||!/native code/.test(r)){var t=new Ot1(function(n){n(1)}),a=function a(n){n(function(){},function(){})},i=t.constructor={};if(i[Q11]=a,vo1=_instanceof(t.then(function(){}),a),!vo1)return!0}return!e&&(Dy1==="BROWSER"||Dy1==="DENO")&&!Uy1});By1.exports={CONSTRUCTOR:Z11,REJECTION_EVENT:Uy1,SUBCLASSING:vo1}});var jy1=o(function($W1,ky1){"use strict";var rN1=za1(),eN1=oo1(),tN1=My1().CONSTRUCTOR;ky1.exports=tN1||!eN1(function(r){rN1.all(r).then(void 0,function(){})})});var $y1=o(function(){"use strict";var aN1=q(),iN1=m(),nN1=_(),uN1=no1(),oN1=xy1(),sN1=mr1(),vN1=jy1();aN1({target:"Promise",stat:!0,forced:vN1},{allSettled:function allSettled(e){var t=this,a=uN1.f(t),i=a.resolve,n=a.reject,u=oN1(function(){var s=nN1(t.resolve),v=[],f10=0,l=1;sN1(e,function(c){var h=f10++,y=!1;l++,iN1(s,t,c).then(function(g){y||(y=!0,v[h]={status:"fulfilled",value:g},--l||i(v))},function(g){y||(y=!0,v[h]={status:"rejected",reason:g},--l||i(v))})}),--l||i(v)});return u.error&&n(u.value),a.promise}})});var At1=o(function(WW1,zy1){"use strict";var cN=S(),fN1=R(),Hy1=b(),lN1=Ir1(),hN1=W10(),pN1=aa1(),Gy1=function Gy1(){},Wy1=hN1("Reflect","construct"),co1=/^\s*(?:class|function)\b/,gN1=cN(co1.exec),yN1=!co1.test(Gy1),_$mt=function mt1(e){if(!Hy1(e))return!1;try{return Wy1(Gy1,[],e),!0}catch(t){return!1}},Vy1=function Vy1(e){if(!Hy1(e))return!1;switch(lN1(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return yN1||!!gN1(co1,pN1(e))}catch(t){return!0}};Vy1.sham=!0;zy1.exports=!Wy1||fN1(function(){var r;return _$mt(_$mt.call)||!_$mt(Object)||!_$mt(function(){r=!0})||r})?Vy1:_$mt});var _$fo=o(function(VW1,Ky1){"use strict";var dN1=At1(),qN1=ve(),EN1=TypeError;Ky1.exports=function(r){if(dN1(r))return r;throw new EN1(qN1(r)+" is not a constructor")}});var lo1=o(function(zW1,Jy1){"use strict";var Yy1=A1(),SN1=_$fo(),IN1=we(),RN1=x(),TN1=RN1("species");Jy1.exports=function(r,e){var t=Yy1(r).constructor,a;return t===void 0||IN1(a=Yy1(t)[TN1])?e:SN1(a)}});var Qy1=o(function(KW1,Xy1){"use strict";var ON1=A1(),mN1=P1(),AN1=no1();Xy1.exports=function(r,e){if(ON1(r),mN1(e)&&e.constructor===r)return e;var t=AN1.f(r),a=t.resolve;return a(e),t.promise}});var td1=o(function(){"use strict";var wN1=q(),bN=D(),Ka1=za1(),xN1=R(),rd1=W10(),ed1=b(),CN1=lo1(),Zy1=Qy1(),PN1=Z(),po1=Ka1&&Ka1.prototype,_N1=!!Ka1&&xN1(function(){po1.finally.call({then:function then(){}},function(){})});wN1({target:"Promise",proto:!0,real:!0,forced:_N1},{finally:function _finally(r){var e=CN1(this,rd1("Promise")),t=ed1(r);return this.then(t?function(a){return Zy1(e,r()).then(function(){return a})}:r,t?function(a){return Zy1(e,r()).then(function(){throw a})}:r)}});!bN&&ed1(Ka1)&&(ho1=rd1("Promise").prototype.finally,po1.finally!==ho1&&PN1(po1,"finally",ho1,{unsafe:!0}));var ho1});var ad=o(function(){"use strict";var NN1=q(),LN=I(),DN1=Hr();NN1({global:!0},{Reflect:{}});DN1(LN.Reflect,"Reflect",!0)});var nd1=o(function(ZW1,id1){"use strict";var FN1=TypeError;id1.exports=function(r){if(typeof r=="string")return r;throw new FN1("Argument is not a string")}});var od1=o(function(r31,ud){"use strict";var UN1=k(),BN1=N(),MN1=ir1(),kN1=RangeError;ud.exports=function(e){var t=BN1(MN1(this)),a="",i=UN1(e);if(i<0||i===1/0)throw new kN1("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))i&1&&(a+=t);return a}});var ld=o(function(e31,fd){"use strict";var cd=S(),jN1=_r1(),sd=N(),$N=od1(),HN1=ir1(),GN1=cd($N),WN1=cd("".slice),VN1=Math.ceil,vd1=function vd1(r){return function(e,t,a){var i=sd(HN1(e)),n=jN1(t),u=i.length,s=a===void 0?" ":sd(a),v,f10;return n<=u||s===""?i:(v=n-u,f10=GN1(s,VN1(v/s.length)),f10.length>v&&(f10=WN1(f10,0,v)),r?i+f10:f10+i)}};fd.exports={start:vd1(!1),end:vd1(!0)}});var Ya1=o(function(t31,hd){"use strict";hd.exports=" \n\v\f\r \xa0 \u2028\u2029\uFEFF"});var Ed1=o(function(){"use strict";var zN1=q(),wt1=S(),KN1=nd1(),YN1=C(),pd=ld().start,JN1=Ya1(),XN1=Array,gd=RegExp.escape,yd1=wt1("".charAt),qo=wt1("".charCodeAt),QN1=wt1(1.1.toString),ZN1=wt1([].join),_$qd=/^[0-9a-z]/i,rL1=/^[$()*+./?[\\\]^{|}]/,eL1=RegExp("^[!\"#%&',\\-:;<=>@`~"+JN1+"]"),go1=wt1(_$qd.exec),dd={" ":"t","\n":"n","\v":"v","\f":"f","\r":"r"},yo1=function yo1(r){var e=QN1(qo(r,0),16);return e.length<3?"\\x"+pd(e,2,"0"):"\\u"+pd(e,4,"0")},tL1=!gd||gd("ab")!=="\\x61b";zN1({target:"RegExp",stat:!0,forced:tL1},{escape:function escape1(e){KN1(e);for(var t=e.length,a=XN1(t),i=0;i<t;i++){var n=yd1(e,i);if(i===0&&go1(_$qd,n))a[i]=yo1(n);else if(YN1(dd,n))a[i]="\\"+dd[n];else if(go1(rL1,n))a[i]="\\"+n;else if(go1(eL1,n))a[i]=yo1(n);else{var u=qo(n,0);(u&63488)!==55296?a[i]=n:u>=56320||i+1>=t||(qo(e,i+1)&64512)!==56320?a[i]=yo1(n):(a[i]=n,a[++i]=yd1(e,i))}}return ZN1(a,"")}})});var Eo=o(function(n31,Id1){"use strict";var aL1=I(),iL1=R(),Sd1=aL1.RegExp,nL1=!iL1(function(){var r=!0;try{Sd1(".","d")}catch(v){r=!1}var e={},t="",a=r?"dgimsy":"gimsy",i=function i(v,f10){Object.defineProperty(e,v,{get:function get1(){return t+=f10,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};r&&(n.hasIndices="d");for(var u in n)i(u,n[u]);var s=Object.getOwnPropertyDescriptor(Sd1.prototype,"flags").get.call(e);return s!==a||t!==a});Id1.exports={correct:nL1}});var Ja1=o(function(u31,Rd1){"use strict";var uL1=A1();Rd1.exports=function(){var r=uL1(this),e="";return r.hasIndices&&(e+="d"),r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.dotAll&&(e+="s"),r.unicode&&(e+="u"),r.unicodeSets&&(e+="v"),r.sticky&&(e+="y"),e}});var Od1=o(function(){"use strict";var oL1=w(),sL1=Q(),Td=Eo(),vL1=Ja1();oL1&&!Td.correct&&(sL1(RegExp.prototype,"flags",{configurable:!0,get:vL1}),Td.correct=!0)});var nr1=o(function(v31,md){"use strict";var So1=S(),Xa1=Set.prototype;md.exports={Set:Set,add:So1(Xa1.add),has:So1(Xa1.has),remove:So1(Xa1.delete),proto:Xa1}});var Jr=o(function(c31,Ad1){"use strict";var cL1=nr1().has;Ad1.exports=function(r){return cL1(r),r}});var Xr=o(function(f31,wd1){"use strict";var fL1=m();wd1.exports=function(r,e,t){for(var a=t?r:r.iterator,i=r.next,n,u;!(n=fL1(i,a)).done;)if(u=e(n.value),u!==void 0)return u}});var _$qe=o(function(l31,_d1){"use strict";var bd1=S(),lL1=Xr(),xd1=nr1(),hL1=xd1.Set,Cd1=xd1.proto,pL1=bd1(Cd1.forEach),Pd1=bd1(Cd1.keys),gL1=Pd1(new hL1).next;_d1.exports=function(r,e,t){return t?lL1({iterator:Pd1(r),next:gL1},e):pL1(r,e)}});var Qa1=o(function(h31,Ld1){"use strict";var Nd1=nr1(),yL1=_$qe(),dL1=Nd1.Set,qL1=Nd1.add;Ld1.exports=function(r){var e=new dL1;return yL1(r,function(t){qL1(e,t)}),e}});var Me1=o(function(p31,Dd1){"use strict";var EL1=_$ut(),SL1=nr1();Dd1.exports=EL1(SL1.proto,"size","get")||function(r){return r.size}});var Qr1=o(function(g31,jd1){"use strict";var Fd1=_(),Md1=A1(),Ud1=m(),IL1=k(),RL1=er1(),Bd1="Invalid size",TL1=RangeError,OL1=TypeError,mL1=Math.max,kd1=function kd1(r,e){this.set=r,this.size=mL1(e,0),this.has=Fd1(r.has),this.keys=Fd1(r.keys)};kd1.prototype={getIterator:function getIterator(){return RL1(Md1(Ud1(this.keys,this.set)))},includes:function includes(r){return Ud1(this.has,this.set,r)}};jd1.exports=function(r){Md1(r);var e=+r.size;if(e!==e)throw new OL1(Bd1);var t=IL1(e);if(t<0)throw new TL1(Bd1);return new kd1(r,t)}});var Wd1=o(function(y31,Gd1){"use strict";var AL1=Jr(),Hd1=nr1(),wL1=Qa1(),bL1=Me1(),xL1=Qr1(),CL1=_$qe(),PL1=Xr(),_L1=Hd1.has,$d1=Hd1.remove;Gd1.exports=function(e){var t=AL1(this),a=xL1(e),i=wL1(t);return bL1(t)<=a.size?CL1(t,function(n){a.includes(n)&&$d1(i,n)}):PL1(a.getIterator(),function(n){_L1(i,n)&&$d1(i,n)}),i}});var Zr1=o(function(d31,Kd1){"use strict";var NL1=W10(),Vd1=function Vd1(r){return{size:r,has:function has(){return!1},keys:function keys(){return{next:function next(){return{done:!0}}}}}},zd1=function zd1(r){return{size:r,has:function has(){return!0},keys:function keys(){throw new Error("e")}}};Kd1.exports=function(r,e){var t=NL1("Set");try{new t()[r](Vd1(0));try{return new t()[r](Vd1(-1)),!1}catch(i){if(!e)return!0;try{return new t()[r](zd1(-1/0)),!1}catch(n){var a=new t([1,2]);return e(a[r](zd1(1/0)))}}}catch(i){return!1}}});var Yd1=o(function(){"use strict";var LL1=q(),DL1=Wd1(),FL1=R(),UL1=Zr1(),BL1=!UL1("difference",function(r){return r.size===0}),ML1=BL1||FL1(function(){var r={size:1,has:function has(){return!0},keys:function keys(){var t=0;return{next:function next(){var a=t++>1;return e.has(1)&&e.clear(),{done:a,value:2}}}}},e=new Set([1,2,3,4]);return e.difference(r).size!==3});LL1({target:"Set",proto:!0,real:!0,forced:ML1},{difference:DL1})});var Qd1=o(function(S31,Xd1){"use strict";var kL1=Jr(),Io1=nr1(),jL1=Me1(),$L1=Qr1(),HL1=_$qe(),GL1=Xr(),WL1=Io1.Set,Jd1=Io1.add,VL1=Io1.has;Xd1.exports=function(e){var t=kL1(this),a=$L1(e),i=new WL1;return jL1(t)>a.size?GL1(a.getIterator(),function(n){VL1(t,n)&&Jd1(i,n)}):HL1(t,function(n){a.includes(n)&&Jd1(i,n)}),i}});var _$Zd=o(function(){"use strict";var zL1=q(),KL1=R(),YL1=Qd1(),JL1=Zr1(),XL1=!JL1("intersection",function(r){return r.size===2&&r.has(1)&&r.has(2)})||KL1(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});zL1({target:"Set",proto:!0,real:!0,forced:XL1},{intersection:YL1})});var eq1=o(function(T31,rq1){"use strict";var QL1=Jr(),ZL1=nr1().has,rD1=Me1(),eD1=Qr1(),tD1=_$qe(),aD1=Xr(),iD1=M();rq1.exports=function(e){var t=QL1(this),a=eD1(e);if(rD1(t)<=a.size)return tD1(t,function(n){if(a.includes(n))return!1},!0)!==!1;var i=a.getIterator();return aD1(i,function(n){if(ZL1(t,n))return iD1(i,"normal",!1)})!==!1}});var tq1=o(function(){"use strict";var nD1=q(),uD1=eq1(),oD1=Zr1(),sD1=!oD1("isDisjointFrom",function(r){return!r});nD1({target:"Set",proto:!0,real:!0,forced:sD1},{isDisjointFrom:uD1})});var iq1=o(function(A31,aq1){"use strict";var vD1=Jr(),cD1=Me1(),fD1=_$qe(),lD1=Qr1();aq1.exports=function(e){var t=vD1(this),a=lD1(e);return cD1(t)>a.size?!1:fD1(t,function(i){if(!a.includes(i))return!1},!0)!==!1}});var nq1=o(function(){"use strict";var hD1=q(),pD1=iq1(),gD1=Zr1(),yD1=!gD1("isSubsetOf",function(r){return r});hD1({target:"Set",proto:!0,real:!0,forced:yD1},{isSubsetOf:pD1})});var oq1=o(function(x31,uq1){"use strict";var dD1=Jr(),qD1=nr1().has,ED1=Me1(),SD1=Qr1(),ID1=Xr(),RD1=M();uq1.exports=function(e){var t=dD1(this),a=SD1(e);if(ED1(t)<a.size)return!1;var i=a.getIterator();return ID1(i,function(n){if(!qD1(t,n))return RD1(i,"normal",!1)})!==!1}});var sq1=o(function(){"use strict";var TD1=q(),OD1=oq1(),mD1=Zr1(),AD1=!mD1("isSupersetOf",function(r){return!r});TD1({target:"Set",proto:!0,real:!0,forced:AD1},{isSupersetOf:OD1})});var cq1=o(function(_31,vq1){"use strict";var wD1=Jr(),Ro1=nr1(),bD1=Qa1(),xD1=Qr1(),CD1=Xr(),PD1=Ro1.add,_D1=Ro1.has,ND1=Ro1.remove;vq1.exports=function(e){var t=wD1(this),a=xD1(e).getIterator(),i=bD1(t);return CD1(a,function(n){_D1(t,n)?ND1(i,n):PD1(i,n)}),i}});var To1=o(function(N31,fq1){"use strict";fq1.exports=function(r){try{var e=new Set,t={size:0,has:function has(){return!0},keys:function keys(){return Object.defineProperty({},"next",{get:function get1(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},a=e[r](t);return a.size===1&&a.values().next().value===4}catch(i){return!1}}});var lq1=o(function(){"use strict";var LD1=q(),DD1=cq1(),FD1=To1(),UD1=Zr1(),BD1=!UD1("symmetricDifference")||!FD1("symmetricDifference");LD1({target:"Set",proto:!0,real:!0,forced:BD1},{symmetricDifference:DD1})});var pq1=o(function(F31,hq1){"use strict";var MD1=Jr(),kD1=nr1().add,jD1=Qa1(),$D1=Qr1(),HD1=Xr();hq1.exports=function(e){var t=MD1(this),a=$D1(e).getIterator(),i=jD1(t);return HD1(a,function(n){kD1(i,n)}),i}});var gq1=o(function(){"use strict";var GD1=q(),WD1=pq1(),VD1=To1(),zD1=Zr1(),KD1=!zD1("union")||!VD1("union");GD1({target:"Set",proto:!0,real:!0,forced:KD1},{union:WD1})});var yq1=o(function(){"use strict";var YD1=q(),JD1=S(),XD1=ir1(),QD1=k(),ZD1=N(),rF1=R(),eF1=JD1("".charAt),tF1=rF1(function(){return"\uD842\uDFB7".at(-2)!=="\uD842"});YD1({target:"String",proto:!0,forced:tF1},{at:function at(e){var t=ZD1(XD1(this)),a=t.length,i=QD1(e),n=i>=0?i:a+i;return n<0||n>=a?void 0:eF1(t,n)}})});var Za1=o(function(j31,dq1){"use strict";var aF1=St1().IteratorPrototype,iF1=Vr1(),nF1=Pr1(),uF1=Hr(),oF1=Be1(),sF1=function sF1(){return this};dq1.exports=function(r,e,t,a){var i=e+" Iterator";return r.prototype=iF1(aF1,{next:nF1(+!a,t)}),uF1(r,i,!1,!0),oF1[i]=sF1,r}});var Oo1=o(function($31,qq1){"use strict";var vF1=P1(),cF1=pr1(),fF1=x(),lF1=fF1("match");qq1.exports=function(r){var e;return vF1(r)&&((e=r[lF1])!==void 0?!!e:cF1(r)==="RegExp")}});var bt1=o(function(H31,Sq1){"use strict";var hF1=m(),pF1=C(),gF1=Cr(),Eq1=Eo(),yF1=Ja1(),dF1=RegExp.prototype;Sq1.exports=Eq1.correct?function(r){return r.flags}:function(r){return!Eq1.correct&&gF1(dF1,r)&&!pF1(r,"flags")?hF1(yF1,r):r.flags}});var ri=o(function(G31,Tq1){"use strict";var mo1=S(),qF1=k(),EF1=N(),SF1=ir1(),IF1=mo1("".charAt),Iq1=mo1("".charCodeAt),RF1=mo1("".slice),Rq1=function Rq1(r){return function(e,t){var a=EF1(SF1(e)),i=qF1(t),n=a.length,u,s;return i<0||i>=n?r?"":void 0:(u=Iq1(a,i),u<55296||u>56319||i+1===n||(s=Iq1(a,i+1))<56320||s>57343?r?IF1(a,i):u:r?RF1(a,i,i+2):(u-55296<<10)+(s-56320)+65536)}};Tq1.exports={codeAt:Rq1(!1),charAt:Rq1(!0)}});var Ao1=o(function(W31,Oq1){"use strict";var TF1=ri().charAt;Oq1.exports=function(r,e,t){return e+(t?TF1(r,e).length:1)}});var Aq1=o(function(V31,mq1){"use strict";var wo=R(),OF1=I(),bo1=OF1.RegExp,xo1=wo(function(){var r=bo1("a","y");return r.lastIndex=2,r.exec("abcd")!==null}),mF1=xo1||wo(function(){return!bo1("a","y").sticky}),AF1=xo1||wo(function(){var r=bo1("^r","gy");return r.lastIndex=2,r.exec("str")!==null});mq1.exports={BROKEN_CARET:AF1,MISSED_STICKY:mF1,UNSUPPORTED_Y:xo1}});var bq1=o(function(z31,wq1){"use strict";var wF1=R(),bF1=I(),xF1=bF1.RegExp;wq1.exports=wF1(function(){var r=xF1(".","s");return!(r.dotAll&&r.test("\n")&&r.flags==="s")})});var Cq1=o(function(K31,xq1){"use strict";var CF1=R(),PF1=I(),_F1=PF1.RegExp;xq1.exports=CF1(function(){var r=_F1("(?<a>b)","g");return r.exec("b").groups.a!=="b"||"b".replace(r,"$<a>c")!=="bc"})});var ai1=o(function(Y31,_q1){"use strict";var ke1=m(),ti1=S(),NF1=N(),LF1=Ja1(),DF1=Aq1(),FF1=sa1(),UF1=Vr1(),BF1=_$X().get,MF1=bq1(),kF1=Cq1(),jF1=FF1("native-string-replace",String.prototype.replace),ei1=RegExp.prototype.exec,Po1=ei1,$F1=ti1("".charAt),HF1=ti1("".indexOf),GF1=ti1("".replace),Co=ti1("".slice),_o1=function(){var r=/a/,e=/b*/g;return ke1(ei1,r,"a"),ke1(ei1,e,"a"),r.lastIndex!==0||e.lastIndex!==0}(),Pq1=DF1.BROKEN_CARET,No=/()??/.exec("")[1]!==void 0,WF=_o1||No||Pq1||MF1||kF1;WF&&(Po1=function(e){var t=this,a=BF1(t),i=NF1(e),n=a.raw,u,s,v,f10,l,c,h;if(n)return n.lastIndex=t.lastIndex,u=ke1(Po1,n,i),t.lastIndex=n.lastIndex,u;var y=a.groups,g=Pq1&&t.sticky,d=ke1(LF1,t),E=t.source,T=0,O=i;if(g&&(d=GF1(d,"y",""),HF1(d,"g")===-1&&(d+="g"),O=Co(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&$F1(i,t.lastIndex-1)!=="\n")&&(E="(?: "+E+")",O=" "+O,T++),s=new RegExp("^(?:"+E+")",d)),No&&(s=new RegExp("^"+E+"$(?!\\s)",d)),_o1&&(v=t.lastIndex),f10=ke1(ei1,g?s:t,O),g?f10?(f10.input=Co(f10.input,T),f10[0]=Co(f10[0],T),f10.index=t.lastIndex,t.lastIndex+=f10[0].length):t.lastIndex=0:_o1&&f10&&(t.lastIndex=t.global?f10.index+f10[0].length:v),No&&f10&&f10.length>1&&ke1(jF1,f10[0],s,function(){for(l=1;l<arguments.length-2;l++)arguments[l]===void 0&&(f10[l]=void 0)}),f10&&y)for(f10.groups=c=UF1(null),l=0;l<y.length;l++)h=y[l],c[h[0]]=f10[h[1]];return f10});_q1.exports=Po1});var Lo1=o(function(J31,Lq1){"use strict";var Nq1=m(),VF1=A1(),zF1=b(),KF1=pr1(),YF1=ai1(),JF1=TypeError;Lq1.exports=function(r,e){var t=r.exec;if(zF1(t)){var a=Nq1(t,r,e);return a!==null&&VF1(a),a}if(KF1(r)==="RegExp")return Nq1(YF1,r,e);throw new JF1("RegExp#exec called on incompatible receiver")}});var Gq1=o(function(){"use strict";var XF1=q(),Dq1=m(),Bq1=ct1(),QF1=Za1(),ii=Ue(),Fq1=ir1(),Mq1=_r1(),xt=N(),ZF1=A1(),rU1=P1(),eU1=pr1(),tU1=Oo1(),kq1=bt1(),aU1=$r1(),iU1=Z(),nU1=R(),uU1=x(),oU1=lo1(),sU1=Ao1(),vU=Lo1(),jq1=_$X(),Fo1=D(),ni1=uU1("matchAll"),$q1="RegExp String",Hq1=$q1+" Iterator",cU1=jq1.set,fU1=jq1.getterFor(Hq1),Uq1=RegExp.prototype,lU1=TypeError,Uo=Bq1("".indexOf),ui1=Bq1("".matchAll),Do1=!!ui1&&!nU1(function(){ui1("a",/./)}),hU1=QF1(function(e,t,a,i){cU1(this,{type:Hq1,regexp:e,string:t,global:a,unicode:i,done:!1})},$q1,function(){var e=fU1(this);if(e.done)return ii(void 0,!0);var t=e.regexp,a=e.string,i=vU(t,a);return i===null?(e.done=!0,ii(void 0,!0)):e.global?(xt(i[0])===""&&(t.lastIndex=sU1(a,Mq1(t.lastIndex),e.unicode)),ii(i,!1)):(e.done=!0,ii(i,!1))}),Bo=function Bo(r){var e=ZF1(this),t=xt(r),a=oU1(e,RegExp),i=xt(kq1(e)),n,u,s;return n=new a(a===RegExp?e.source:e,i),u=!!~Uo(i,"g"),s=!!~Uo(i,"u"),n.lastIndex=Mq1(e.lastIndex),new hU1(n,t,u,s)};XF1({target:"String",proto:!0,forced:Do1},{matchAll:function matchAll(e){var t=Fq1(this),a,i,n,u;if(rU1(e)){if(tU1(e)&&(a=xt(Fq1(kq1(e))),!~Uo(a,"g")))throw new lU1("`.matchAll` does not allow non-global regexes");if(Do1)return ui1(t,e);if(n=aU1(e,ni1),n===void 0&&Fo1&&eU1(e)==="RegExp"&&(n=Bo),n)return Dq1(n,e,t)}else if(Do1)return ui1(t,e);return i=xt(t),u=new RegExp(e,"g"),Fo1?Dq1(Bo,u,i):u[ni1](i)}});Fo1||ni1 in Uq1||iU1(Uq1,ni1,Bo)});var $o1=o(function(Z31,Wq1){"use strict";var jo1=S(),pU1=B(),gU1=Math.floor,_$Mo=jo1("".charAt),yU1=jo1("".replace),ko=jo1("".slice),dU1=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,qU1=/\$([$&'`]|\d{1,2})/g;Wq1.exports=function(r,e,t,a,i,n){var u=t+r.length,s=a.length,v=qU1;return i!==void 0&&(i=pU1(i),v=dU1),yU1(n,v,function(f10,l){var c;switch(_$Mo(l,0)){case"$":return"$";case"&":return r;case"`":return ko(e,0,t);case"'":return ko(e,u);case"<":c=i[ko(l,1,-1)];break;default:var h=+l;if(h===0)return f10;if(h>s){var y=gU1(h/10);return y===0?f10:y<=s?a[y-1]===void 0?_$Mo(l,1):a[y-1]+_$Mo(l,1):f10}c=a[h-1]}return c===void 0?"":c})}});var Kq1=o(function(){"use strict";var EU=q(),SU1=m(),Go1=S(),Vq1=ir1(),IU1=b(),RU1=P1(),TU=Oo1(),_$je=N(),OU1=$r1(),_$mU=bt1(),AU=$o1(),wU=x(),bU=D(),xU=wU("replace"),CU=TypeError,Ho1=Go1("".indexOf),PU1=Go1("".replace),zq1=Go1("".slice),_U=Math.max;EU({target:"String",proto:!0},{replaceAll:function replaceAll(e,t){var a=Vq1(this),i,n,u,s,v,f10,l,c,h,y,g=0,d="";if(RU1(e)){if(i=TU(e),i&&(n=_$je(Vq1(_$mU(e))),!~Ho1(n,"g")))throw new CU("`.replaceAll` does not allow non-global regexes");if(u=OU1(e,xU),u)return SU1(u,e,a,t);if(bU&&i)return PU1(_$je(a),e,t)}for(s=_$je(a),v=_$je(e),f10=IU1(t),f10||(t=_$je(t)),l=v.length,c=_U(1,l),h=Ho1(s,v);h!==-1;)y=f10?_$je(t(v,h,s)):AU(v,s,h,[],void 0,t),d+=zq1(s,g,h)+y,g=h+l,h=h+c>s.length?-1:Ho1(s,v,h+c);return g<s.length&&(d+=zq1(s,g)),d}})});var Jq1=o(function(){"use strict";var _$NU=q(),Yq1=ai1();_$NU({target:"RegExp",proto:!0,forced:/./.exec!==Yq1},{exec:Yq1})});var tE1=o(function(i61,eE1){"use strict";Jq1();var Xq1=m(),Qq1=Z(),LU1=ai1(),Zq1=R(),rE1=x(),DU1=z(),FU1=rE1("species"),Wo=RegExp.prototype;eE1.exports=function(r,e,t,a){var i=rE1(r),n=!Zq1(function(){var f10={};return f10[i]=function(){return 7},""[r](f10)!==7}),u=n&&!Zq1(function(){var f10=!1,l=/a/;if(r==="split"){var c={};c[FU1]=function(){return l},l={constructor:c,flags:""},l[i]=/./[i]}return l.exec=function(){return f10=!0,null},l[i](""),!f10});if(!n||!u||t){var s=/./[i],v=e(i,""[r],function(f10,l,c,h,y){var g=l.exec;return g===LU1||g===Wo.exec?n&&!y?{done:!0,value:Xq1(s,l,c,h)}:{done:!0,value:Xq1(f10,c,l,h)}:{done:!1}});Qq1(String.prototype,r,v[0]),Qq1(Wo,i,v[1])}a&&DU1(Wo[i],"sham",!0)}});var uE1=o(function(){"use strict";var UU1=qt1(),aE1=m(),si1=S(),BU1=tE1(),MU1=R(),kU=A1(),jU1=b(),$U1=P1(),HU1=k(),GU1=_r1(),Ee=N(),WU1=ir1(),VU1=Ao1(),zU1=$r1(),KU1=$o1(),YU1=bt1(),JU1=Lo1(),XU1=x(),zo1=XU1("replace"),QU1=Math.max,ZU1=Math.min,r21=si1([].concat),Vo1=si1([].push),_$oi=si1("".indexOf),iE1=si1("".slice),e21=function e21(r){return r===void 0?r:String(r)},t21=function(){return"a".replace(/./,"$0")==="$0"}(),nE1=function(){return/./[zo1]?/./[zo1]("a","$0")==="":!1}(),a21=!MU1(function(){var r=/./;return r.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(r,"$<a>")!=="7"});BU1("replace",function(r,e,t){var a=nE1?"$":"$0";return[function(n,u){var s=WU1(this),v=$U1(n)?zU1(n,zo1):void 0;return v?aE1(v,n,s,u):aE1(e,Ee(s),n,u)},function(i,n){var u=kU(this),s=Ee(i);if(typeof n=="string"&&_$oi(n,a)===-1&&_$oi(n,"$<")===-1){var v=t(e,u,s,n);if(v.done)return v.value}var f10=jU1(n);f10||(n=Ee(n));var l=Ee(YU1(u)),c=_$oi(l,"g")!==-1,h;c&&(h=_$oi(l,"u")!==-1,u.lastIndex=0);for(var y=[],g;g=JU1(u,s),!(g===null||(Vo1(y,g),!c));){var d=Ee(g[0]);d===""&&(u.lastIndex=VU1(s,GU1(u.lastIndex),h))}for(var E="",T=0,O=0;O<y.length;O++){g=y[O];for(var _$tr=Ee(g[0]),G=QU1(ZU1(HU1(g.index),s.length),0),jr1=[],ar,xr=1;xr<g.length;xr++)Vo1(jr1,e21(g[xr]));var oe=g.groups;if(f10){var Uv1=r21([_$tr],jr1,G,s);oe!==void 0&&Vo1(Uv1,oe),ar=Ee(UU1(n,void 0,Uv1))}else ar=KU1(_$tr,s,G,jr1,oe,n);G>=T&&(E+=iE1(s,T,G)+ar,T=G+_$tr.length)}return E+iE1(s,T)}]},!a21||!t21||nE1)});var Jo1=o(function(o61,sE1){"use strict";var i21=S(),n21=ir1(),u21=N(),Yo1=Ya1(),oE1=i21("".replace),o21=RegExp("^["+Yo1+"]+"),s21=RegExp("(^|[^"+Yo1+"])["+Yo1+"]+$"),Ko1=function Ko1(r){return function(e){var t=u21(n21(e));return r&1&&(t=oE1(t,o21,"")),r&2&&(t=oE1(t,s21,"$1")),t}};sE1.exports={start:Ko1(1),end:Ko1(2),trim:Ko1(3)}});var Xo1=o(function(s61,fE1){"use strict";var v21=at().PROPER,c21=R(),vE1=Ya1(),cE1="\x85";fE1.exports=function(r){return c21(function(){return!!vE1[r]()||cE1[r]()!==cE1||v21&&vE1[r].name!==r})}});var Qo1=o(function(v61,lE1){"use strict";var f21=Jo1().end,l21=Xo1();lE1.exports=l21("trimEnd")?function(){return f21(this)}:"".trimEnd});var pE1=o(function(){"use strict";var h21=q(),hE1=Qo1();h21({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==hE1},{trimRight:hE1})});var yE1=o(function(){"use strict";pE1();var p21=q(),gE1=Qo1();p21({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==gE1},{trimEnd:gE1})});var dE1=o(function(){"use strict";var g21=q(),y21=Jo1().trim,d21=Xo1();g21({target:"String",proto:!0,forced:d21("trim")},{trim:function trim(){return y21(this)}})});var OE1=o(function(){"use strict";var q21=q(),E21=w(),S21=I(),vi1=S(),I21=C(),R21=b(),T21=Cr(),O21=N(),m21=Q(),A21=st1(),Dr=S21.Symbol,Se1=Dr&&Dr.prototype;E21&&R21(Dr)&&(!("description"in Se1)||Dr().description!==void 0)&&(Zo1={},Ct1=function Ct1(){var e=arguments.length<1||arguments[0]===void 0?void 0:O21(arguments[0]),t=T21(Se1,this)?new Dr(e):e===void 0?Dr():Dr(e);return e===""&&(Zo1[t]=!0),t},A21(Ct1,Dr),Ct1.prototype=Se1,Se1.constructor=Ct1,qE1=String(Dr("description detection"))==="Symbol(description detection)",EE1=vi1(Se1.valueOf),SE1=vi1(Se1.toString),_$IE=/^Symbol\((.*)\)[^)]+$/,RE1=vi1("".replace),TE1=vi1("".slice),m21(Se1,"description",{configurable:!0,get:function get1(){var e=EE1(this);if(I21(Zo1,e))return"";var t=SE1(e),a=qE1?TE1(t,7,-1):RE1(t,_$IE,"$1");return a===""?void 0:a}}),q21({global:!0,constructor:!0,forced:!0},{Symbol:Ct1}));var Zo1,Ct1,qE1,EE1,SE1,_$IE,RE1,TE1});var AE1=o(function(q61,mE1){"use strict";var _$w2=I();mE1.exports=_$w2});var bE1=o(function(wE1){"use strict";var b21=x();wE1.f=b21});var PE1=o(function(S61,CE1){"use strict";var xE1=AE1(),x21=C(),C21=bE1(),P21=V().f;CE1.exports=function(r){var e=xE1.Symbol||(xE1.Symbol={});x21(e,r)||P21(e,r,{value:C21.f(r)})}});var _E1=o(function(){"use strict";var _21=PE1();_21("matchAll")});var Y=o(function(T61,$E1){"use strict";var N21=da(),as1=w(),j=I(),FE1=b(),li1=P1(),ee=C(),is1=Ir1(),L21=ve(),D21=z(),rs1=Z(),F21=Q(),U21=Cr(),hi1=Ne1(),He1=he1(),B21=x(),M21=Ce1(),UE1=_$X(),BE1=UE1.enforce,k21=UE1.get,ci1=j.Int8Array,es1=ci1&&ci1.prototype,NE1=j.Uint8ClampedArray,LE1=NE1&&NE1.prototype,Ar=ci1&&hi1(ci1),yr=es1&&hi1(es1),j21=Object.prototype,ns1=j.TypeError,DE1=B21("toStringTag"),ts1=M21("TYPED_ARRAY_TAG"),fi="TypedArrayConstructor",Fr1=N21&&!!He1&&is1(j.opera)!=="Opera",ME1=!1,K,re,_$$e,Ur1={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},us1={BigInt64Array:8,BigUint64Array:8},$21=function $21(e){if(!li1(e))return!1;var t=is1(e);return t==="DataView"||ee(Ur1,t)||ee(us1,t)},kE1=function kE2(r){var e=hi1(r);if(li1(e)){var t=k21(e);return t&&ee(t,fi)?t[fi]:kE1(e)}},jE1=function jE1(r){if(!li1(r))return!1;var e=is1(r);return ee(Ur1,e)||ee(us1,e)},H21=function H21(r){if(jE1(r))return r;throw new ns1("Target is not a typed array")},G21=function G21(r){if(FE1(r)&&(!He1||U21(Ar,r)))return r;throw new ns1(L21(r)+" is not a typed array constructor")},W21=function W21(r,e,t,a){if(as1){if(t)for(var i in Ur1){var n=j[i];if(n&&ee(n.prototype,r))try{delete n.prototype[r]}catch(u){try{n.prototype[r]=e}catch(s){}}}(!yr[r]||t)&&rs1(yr,r,t?e:Fr1&&es1[r]||e,a)}},_$V2=function V21(r,e,t){var a,i;if(as1){if(He1){if(t){for(a in Ur1)if(i=j[a],i&&ee(i,r))try{delete i[r]}catch(n){}}if(!Ar[r]||t)try{return rs1(Ar,r,t?e:Fr1&&Ar[r]||e)}catch(n){}else return}for(a in Ur1)i=j[a],i&&(!i[r]||t)&&rs1(i,r,e)}};for(K in Ur1)re=j[K],_$$e=re&&re.prototype,_$$e?BE1(_$$e)[fi]=re:Fr1=!1;for(K in us1)re=j[K],_$$e=re&&re.prototype,_$$e&&(BE1(_$$e)[fi]=re);if((!Fr1||!FE1(Ar)||Ar===Function.prototype)&&(Ar=function Ar(){throw new ns1("Incorrect invocation")},Fr1))for(K in Ur1)j[K]&&He1(j[K],Ar);if((!Fr1||!yr||yr===j21)&&(yr=Ar.prototype,Fr1))for(K in Ur1)j[K]&&He1(j[K].prototype,yr);Fr1&&hi1(LE1)!==yr&&He1(LE1,yr);if(as1&&!ee(yr,DE1)){ME1=!0,F21(yr,DE1,{configurable:!0,get:function get1(){return li1(this)?this[ts1]:void 0}});for(K in Ur1)j[K]&&D21(j[K],ts1,K)}$E1.exports={NATIVE_ARRAY_BUFFER_VIEWS:Fr1,TYPED_ARRAY_TAG:ME1&&ts1,aTypedArray:H21,aTypedArrayConstructor:G21,exportTypedArrayMethod:W21,exportTypedArrayStaticMethod:_$V2,getTypedArrayConstructor:kE1,isView:$21,isTypedArray:jE1,TypedArray:Ar,TypedArrayPrototype:yr}});var _$GE=o(function(){"use strict";var HE1=Y(),z21=L(),K21=k(),Y21=HE1.aTypedArray,J21=HE1.exportTypedArrayMethod;J21("at",function(e){var t=Y21(this),a=z21(t),i=K21(e),n=i>=0?i:a+i;return n<0||n>=a?void 0:t[n]})});var pi=o(function(A61,WE1){"use strict";var X21=ln1(),Q21=TypeError;WE1.exports=function(r){var e=X21(r,"number");if(typeof e=="number")throw new Q21("Can't convert number to bigint");return BigInt(e)}});var zE1=o(function(){"use strict";var VE1=Y(),Z21=Nn(),rB1=pi(),eB1=Ir1(),tB1=m(),aB1=S(),iB1=R(),nB1=VE1.aTypedArray,uB1=VE1.exportTypedArrayMethod,oB1=aB1("".slice),sB1=iB1(function(){var r=0;return new Int8Array(2).fill({valueOf:function valueOf(){return r++}}),r!==1});uB1("fill",function(e){var t=arguments.length;nB1(this);var a=oB1(eB1(this),0,3)==="Big"?rB1(e):+e;return tB1(Z21,this,a,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},sB1)});var os1=o(function(x61,YE1){"use strict";var vB1=_$Kr(),cB1=_e1(),fB1=B(),lB1=L(),KE1=function KE1(r){var e=r===1;return function(t,a,i){for(var n=fB1(t),u=cB1(n),s=lB1(u),v=vB1(a,i),f10,l;s-- >0;)if(f10=u[s],l=v(f10,s,n),l)switch(r){case 0:return f10;case 1:return s}return e?-1:void 0}};YE1.exports={findLast:KE1(0),findLastIndex:KE1(1)}});var _$XE=o(function(){"use strict";var JE1=Y(),hB1=os1().findLastIndex,pB1=JE1.aTypedArray,gB1=JE1.exportTypedArrayMethod;gB1("findLastIndex",function(e){return hB1(pB1(this),e,arguments.length>1?arguments[1]:void 0)})});var ZE1=o(function(){"use strict";var QE1=Y(),yB1=os1().findLast,dB1=QE1.aTypedArray,qB1=QE1.exportTypedArrayMethod;qB1("findLast",function(e){return yB1(dB1(this),e,arguments.length>1?arguments[1]:void 0)})});var vs1=o(function(L61,eS1){"use strict";var rS1=I(),ss1=R(),EB1=oo1(),SB1=Y().NATIVE_ARRAY_BUFFER_VIEWS,IB1=rS1.ArrayBuffer,Ie=rS1.Int8Array;eS1.exports=!SB1||!ss1(function(){Ie(1)})||!ss1(function(){new Ie(-1)})||!EB1(function(r){new Ie,new Ie(null),new Ie(1.5),new Ie(r)},!0)||ss1(function(){return new Ie(new IB1(2),1,void 0).length!==1})});var aS1=o(function(D61,tS1){"use strict";var RB1=P1(),TB1=Math.floor;tS1.exports=Number.isInteger||function(e){return!RB1(e)&&isFinite(e)&&TB1(e)===e}});var cs1=o(function(F61,iS1){"use strict";var OB1=Nu1(),mB1=RangeError;iS1.exports=function(r,e){var t=OB1(r);if(t%e)throw new mB1("Wrong offset");return t}});var uS1=o(function(U61,nS1){"use strict";var AB1=Math.round;nS1.exports=function(r){var e=AB1(r);return e<0?0:e>255?255:e&255}});var fs=o(function(B61,oS1){"use strict";var wB1=Ir1();oS1.exports=function(r){var e=wB1(r);return e==="BigInt64Array"||e==="BigUint64Array"}});var ls1=o(function(M61,sS1){"use strict";var bB1=_$Kr(),xB1=m(),CB1=_$fo(),PB1=B(),_B1=L(),NB1=Tt(),LB1=ye(),DB1=ja1(),FB1=fs(),UB1=Y().aTypedArrayConstructor,BB1=pi();sS1.exports=function(e){var t=CB1(this),a=PB1(e),i=arguments.length,n=i>1?arguments[1]:void 0,u=n!==void 0,s=LB1(a),v,f10,l,c,h,y,g,d;if(s&&!DB1(s))for(g=NB1(a,s),d=g.next,a=[];!(y=xB1(d,g)).done;)a.push(y.value);for(u&&i>2&&(n=bB1(n,arguments[2])),f10=_B1(a),l=new(UB1(t))(f10),c=FB1(l),v=0;f10>v;v++)h=u?n(a[v],v):a[v],l[v]=c?BB1(h):+h;return l}});var lS1=o(function(k61,fS1){"use strict";var vS1=dt1(),MB1=At1(),kB1=P1(),jB1=x(),$B1=jB1("species"),cS1=Array;fS1.exports=function(r){var e;return vS1(r)&&(e=r.constructor,MB1(e)&&(e===cS1||vS1(e.prototype))?e=void 0:kB1(e)&&(e=e[$B1],e===null&&(e=void 0))),e===void 0?cS1:e}});var pS1=o(function(j61,hS1){"use strict";var HB1=lS1();hS1.exports=function(r,e){return new(HB1(r))(e===0?0:e)}});var dS1=o(function($61,yS1){"use strict";var GB1=_$Kr(),WB1=S(),VB1=_e1(),zB1=B(),KB1=L(),YB1=pS1(),gS1=WB1([].push),te1=function te1(r){var e=r===1,t=r===2,a=r===3,i=r===4,n=r===6,u=r===7,s=r===5||n;return function(v,f10,l,c){for(var h=zB1(v),y=VB1(h),g=KB1(y),d=GB1(f10,l),E=0,T=c||YB1,O=e?T(v,g):t||u?T(v,0):void 0,_$tr,G;g>E;E++)if((s||E in y)&&(_$tr=y[E],G=d(_$tr,E,h),r))if(e)O[E]=G;else if(G)switch(r){case 3:return!0;case 5:return _$tr;case 6:return E;case 2:gS1(O,_$tr)}else switch(r){case 4:return!1;case 7:gS1(O,_$tr)}return n?-1:a||i?i:O}};yS1.exports={forEach:te1(0),map:te1(1),filter:te1(2),some:te1(3),every:te1(4),find:te1(5),findIndex:te1(6),filterReject:te1(7)}});var SS1=o(function(H61,ES1){"use strict";var JB1=W10(),XB1=Q(),QB1=x(),ZB1=w(),qS1=QB1("species");ES1.exports=function(r){var e=JB1(r);ZB1&&e&&!e[qS1]&&XB1(e,qS1,{configurable:!0,get:function get1(){return this}})}});var hs1=o(function(G61,IS1){"use strict";var rM=L();IS1.exports=function(r,e,t){for(var a=0,i=arguments.length>2?t:rM(e),n=new r(i);i>a;)n[a]=e[a++];return n}});var wr1=o(function(W61,Ss1){"use strict";var RS1=q(),NS1=I(),TS1=m(),eM=w(),tM=vs1(),_$Lt=Y(),LS1=kn(),OS1=le1(),aM1=Pr1(),Pt1=z(),iM1=aS1(),nM1=_r1(),mS1=_$Ra(),ps=cs1(),uM1=uS1(),DS1=va1(),_t1=C(),oM1=Ir1(),ds=P1(),sM1=xe(),vM1=Vr1(),cM1=Cr(),gi=he1(),fM1=xn().f,AS1=ls1(),lM1=dS1().forEach,hM1=SS1(),pM1=Q(),FS1=V(),US1=qa(),wS1=hs1(),Is1=_$X(),gM=_$lt(),qs1=Is1.get,yM1=Is1.set,dM1=Is1.enforce,BS1=FS1.f,qM1=US1.f,gs1=NS1.RangeError,MS1=LS1.ArrayBuffer,EM1=MS1.prototype,SM1=LS1.DataView,yi1=_$Lt.NATIVE_ARRAY_BUFFER_VIEWS,bS1=_$Lt.TYPED_ARRAY_TAG,xS1=_$Lt.TypedArray,Nt1=_$Lt.TypedArrayPrototype,Es1=_$Lt.isTypedArray,di1="BYTES_PER_ELEMENT",ys1="Wrong length",qi=function qi(r,e){pM1(r,e,{configurable:!0,get:function get1(){return qs1(this)[e]}})},CS1=function CS1(r){var e;return cM1(EM1,r)||(e=oM1(r))==="ArrayBuffer"||e==="SharedArrayBuffer"},kS1=function kS1(r,e){return Es1(r)&&!sM1(e)&&e in r&&iM1(+e)&&e>=0},_$PS=function PS1(e,t){return t=DS1(t),kS1(e,t)?aM1(2,e[t]):qM1(e,t)},_S1=function _S1(e,t,a){return t=DS1(t),kS1(e,t)&&ds(a)&&_t1(a,"value")&&!_t1(a,"get")&&!_t1(a,"set")&&!a.configurable&&(!_t1(a,"writable")||a.writable)&&(!_t1(a,"enumerable")||a.enumerable)?(e[t]=a.value,e):BS1(e,t,a)};eM?(yi1||(US1.f=_$PS,FS1.f=_S1,qi(Nt1,"buffer"),qi(Nt1,"byteOffset"),qi(Nt1,"byteLength"),qi(Nt1,"length")),RS1({target:"Object",stat:!0,forced:!yi1},{getOwnPropertyDescriptor:_$PS,defineProperty:_S1}),Ss1.exports=function(r,e,t){var a=r.match(/\d+/)[0]/8,i=r+(t?"Clamped":"")+"Array",n="get"+r,u="set"+r,s=NS1[i],v=s,f10=v&&v.prototype,l={},c=function c(d,E){var T=qs1(d);return T.view[n](E*a+T.byteOffset,!0)},h=function h(d,E,T){var O=qs1(d);O.view[u](E*a+O.byteOffset,t?uM1(T):T,!0)},y=function y(d,E){BS1(d,E,{get:function get1(){return c(this,E)},set:function set1(T){return h(this,E,T)},enumerable:!0})};yi1?tM&&(v=e(function(d,E,T,O){return OS1(d,f10),gM(function(){return ds(E)?CS1(E)?O!==void 0?new s(E,ps(T,a),O):T!==void 0?new s(E,ps(T,a)):new s(E):Es1(E)?wS1(v,E):TS1(AS1,v,E):new s(mS1(E))}(),d,v)}),gi&&gi(v,xS1),lM1(fM1(s),function(d){d in v||Pt1(v,d,s[d])}),v.prototype=f10):(v=e(function(d,E,T,O){OS1(d,f10);var _$tr=0,G=0,jr1,ar,xr;if(!ds(E))xr=mS1(E),ar=xr*a,jr1=new MS1(ar);else if(CS1(E)){jr1=E,G=ps(T,a);var oe=E.byteLength;if(O===void 0){if(oe%a)throw new gs1(ys1);if(ar=oe-G,ar<0)throw new gs1(ys1)}else if(ar=nM1(O)*a,ar+G>oe)throw new gs1(ys1);xr=ar/a}else return Es1(E)?wS1(v,E):TS1(AS1,v,E);for(yM1(d,{buffer:jr1,byteOffset:G,byteLength:ar,length:xr,view:new SM1(jr1)});_$tr<xr;)y(d,_$tr++)}),gi&&gi(v,xS1),f10=v.prototype=vM1(Nt1)),f10.constructor!==v&&Pt1(f10,"constructor",v),dM1(f10).TypedArrayConstructor=v,bS1&&Pt1(f10,bS1,i);var g=v!==s;l[i]=v,RS1({global:!0,constructor:!0,forced:g,sham:!yi1},l),di1 in v||Pt1(v,di1,a),di1 in f10||Pt1(f10,di1,a),hM1(i)}):Ss1.exports=function(){}});var jS1=o(function(){"use strict";var IM1=wr1();IM1("Float32",function(r){return function(t,a,i){return r(this,t,a,i)}})});var $S1=o(function(){"use strict";var RM1=wr1();RM1("Float64",function(r){return function(t,a,i){return r(this,t,a,i)}})});var HS1=o(function(){"use strict";var TM1=vs1(),OM1=Y().exportTypedArrayStaticMethod,mM1=ls1();OM1("from",mM1,TM1)});var GS1=o(function(){"use strict";var AM1=wr1();AM1("Int16",function(r){return function(t,a,i){return r(this,t,a,i)}})});var WS1=o(function(){"use strict";var wM1=wr1();wM1("Int32",function(r){return function(t,a,i){return r(this,t,a,i)}})});var VS1=o(function(){"use strict";var bM1=wr1();bM1("Int8",function(r){return function(t,a,i){return r(this,t,a,i)}})});var QS1=o(function(){"use strict";var KS1=I(),YS1=m(),Os1=Y(),xM=L(),CM1=cs1(),PM1=B(),JS1=R(),_M1=KS1.RangeError,Rs1=KS1.Int8Array,zS1=Rs1&&Rs1.prototype,XS1=zS1&&zS1.set,NM1=Os1.aTypedArray,LM1=Os1.exportTypedArrayMethod,Ts1=!JS1(function(){var r=new Uint8ClampedArray(2);return YS1(XS1,r,{length:1,0:3},1),r[1]!==3}),DM1=Ts1&&Os1.NATIVE_ARRAY_BUFFER_VIEWS&&JS1(function(){var r=new Rs1(2);return r.set(1),r.set("2",1),r[0]!==0||r[1]!==2});LM1("set",function(e){NM1(this);var t=CM1(arguments.length>1?arguments[1]:void 0,1),a=PM1(e);if(Ts1)return YS1(XS1,this,a,t);var i=this.length,n=xM(a),u=0;if(n+t>i)throw new _M1("Wrong length");for(;u<n;)this[t+u]=a[u++]},!Ts1||DM1)});var iI1=o(function(){"use strict";var FM1=I(),UM1=ct1(),ms1=R(),BM1=_(),MM1=Ua(),aI1=Y(),ZS1=gu(),kM1=yu(),rI1=se1(),eI1=du1(),jM1=aI1.aTypedArray,$M1=aI1.exportTypedArrayMethod,Dt1=FM1.Uint16Array,Ge=Dt1&&UM1(Dt1.prototype.sort),HM1=!!Ge&&!(ms1(function(){Ge(new Dt1(2),null)})&&ms1(function(){Ge(new Dt1(2),{})})),tI1=!!Ge&&!ms1(function(){if(rI1)return rI1<74;if(ZS1)return ZS1<67;if(kM1)return!0;if(eI1)return eI1<602;var r=new Dt1(516),e=Array(516),t,a;for(t=0;t<516;t++)a=t%4,r[t]=515-t,e[t]=t-2*a+3;for(Ge(r,function(i,n){return(i/4|0)-(n/4|0)}),t=0;t<516;t++)if(r[t]!==e[t])return!0}),GM1=function GM1(r){return function(e,t){return r!==void 0?+r(e,t)||0:t!==t?-1:e!==e?1:e===0&&t===0?1/e>0&&1/t<0?1:-1:e>t}};$M1("sort",function(e){return e!==void 0&&BM1(e),tI1?Ge(this,e):MM1(jM1(this),GM1(e))},!tI1||HM1)});var uI1=o(function(sV1,nI1){"use strict";var WM1=L();nI1.exports=function(r,e){for(var t=WM1(r),a=new e(t),i=0;i<t;i++)a[i]=r[t-i-1];return a}});var oI1=o(function(){"use strict";var VM1=uI1(),As1=Y(),zM1=As1.aTypedArray,_$KM=As1.exportTypedArrayMethod,YM1=As1.getTypedArrayConstructor;_$KM("toReversed",function(){return VM1(zM1(this),YM1(this))})});var sI1=o(function(){"use strict";var Ei1=Y(),JM1=S(),XM1=_(),_$QM=hs1(),ZM1=Ei1.aTypedArray,rk1=Ei1.getTypedArrayConstructor,ek=Ei1.exportTypedArrayMethod,tk1=JM1(Ei1.TypedArrayPrototype.sort);ek("toSorted",function(e){e!==void 0&&XM1(e);var t=ZM1(this),a=_$QM(rk1(t),t);return tk1(a,e)})});var vI1=o(function(){"use strict";var ak1=wr1();ak1("Uint16",function(r){return function(t,a,i){return r(this,t,a,i)}})});var cI1=o(function(){"use strict";var ik=wr1();ik("Uint32",function(r){return function(t,a,i){return r(this,t,a,i)}})});var fI1=o(function(){"use strict";var nk1=wr1();nk1("Uint8",function(r){return function(t,a,i){return r(this,t,a,i)}})});var lI1=o(function(){"use strict";var uk=wr1();uk("Uint8",function(r){return function(t,a,i){return r(this,t,a,i)}},!0)});var pI1=o(function(){"use strict";var ok=Eu1(),ws1=Y(),sk1=fs(),vk=k(),ck=pi(),fk=ws1.aTypedArray,lk=ws1.getTypedArrayConstructor,hk=ws1.exportTypedArrayMethod,hI1=function(){try{new Int8Array(1).with(2,{valueOf:function valueOf(){throw 8}})}catch(r){return r===8}}(),pk=hI1&&function(){try{new Int8Array(1).with(-.5,1)}catch(r){return!0}}();hk("with",function(r,e){var t=fk(this),a=vk(r),i=sk1(t)?ck(e):+e;return ok(t,lk(t),a,i)},!hI1||pk)});var yI1=o(function(TV1,gI){"use strict";gI.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var EI1=o(function(OV1,qI1){"use strict";var gk=ia1(),bs1=gk("span").classList,dI1=bs1&&bs1.constructor&&bs1.constructor.prototype;qI1.exports=dI1===Object.prototype?void 0:dI1});var Cs1=o(function(mV1,xI1){"use strict";var yk=q(),dk=m(),Si1=D(),wI1=at(),qk1=b(),Ek1=Za1(),SI1=Ne1(),II1=he1(),Sk1=Hr(),Ik1=z(),xs1=Z(),Rk1=x(),RI1=Be1(),bI1=St1(),Tk1=wI1.PROPER,Ok1=wI1.CONFIGURABLE,TI1=bI1.IteratorPrototype,Ii=bI1.BUGGY_SAFARI_ITERATORS,Ft1=Rk1("iterator"),OI1="keys",Ut="values",mI1="entries",AI1=function AI1(){return this};xI1.exports=function(r,e,t,a,i,n,u){Ek1(t,e,a);var s=function s(T){if(T===i&&h)return h;if(!Ii&&T&&T in l)return l[T];switch(T){case OI1:return function(){return new t(this,T)};case Ut:return function(){return new t(this,T)};case mI1:return function(){return new t(this,T)}}return function(){return new t(this)}},v=e+" Iterator",f10=!1,l=r.prototype,c=l[Ft1]||l["@@iterator"]||i&&l[i],h=!Ii&&c||s(i),y=e==="Array"&&l.entries||c,g,d,E;if(y&&(g=SI1(y.call(new r)),g!==Object.prototype&&g.next&&(!Si1&&SI1(g)!==TI1&&(II1?II1(g,TI1):qk1(g[Ft1])||xs1(g,Ft1,AI1)),Sk1(g,v,!0,!0),Si1&&(RI1[v]=AI1))),Tk1&&i===Ut&&c&&c.name!==Ut&&(!Si1&&Ok1?Ik1(l,"name",Ut):(f10=!0,h=function h(){return dk(c,this)})),i)if(d={values:s(Ut),keys:n?h:s(OI1),entries:s(mI1)},u)for(E in d)(Ii||f10||!(E in l))&&xs1(l,E,d[E]);else yk({target:e,proto:!0,forced:Ii||f10},d);return(!Si1||u)&&l[Ft1]!==h&&xs1(l,Ft1,h,{name:i}),RI1[e]=h,d}});var _s1=o(function(AV1,LI1){"use strict";var mk=fe1(),Ps1=yt1(),CI1=Be1(),_I1=_$X(),Ak1=V().f,wk1=Cs1(),_$Ri=Ue(),bk=D(),xk=w(),NI1="Array Iterator",Ck1=_I1.set,Pk1=_I1.getterFor(NI1);LI1.exports=wk1(Array,"Array",function(r,e){Ck1(this,{type:NI1,target:mk(r),index:0,kind:e})},function(){var r=Pk1(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=null,_$Ri(void 0,!0);switch(r.kind){case"keys":return _$Ri(t,!1);case"values":return _$Ri(e[t],!1)}return _$Ri([t,e[t]],!1)},"values");var PI=CI1.Arguments=CI1.Array;Ps1("keys");Ps1("values");Ps1("entries");if(!bk&&xk&&PI.name!=="values")try{Ak1(PI,"name",{value:"values"})}catch(r){}});var MI1=o(function(){"use strict";var DI1=I(),UI1=yI1(),_k=EI1(),Bt=_s1(),FI1=z(),Nk1=Hr(),Lk1=x(),Ns1=Lk1("iterator"),Ls=Bt.values,BI1=function BI1(r,e){if(r){if(r[Ns1]!==Ls)try{FI1(r,Ns1,Ls)}catch(a){r[Ns1]=Ls}if(Nk1(r,e,!0),UI1[e]){for(var t in Bt)if(r[t]!==Bt[t])try{FI1(r,t,Bt[t])}catch(a){r[t]=Bt[t]}}}};for(Ti in UI1)BI1(DI1[Ti]&&DI1[Ti].prototype,Ti);var Ti;BI1(_k,"DOMTokenList")});var jI1=o(function(xV1,kI1){"use strict";kI1.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}});var KI1=o(function(){"use strict";var Dk1=q(),Fk1=I(),$s1=W10(),ks1=Pr1(),js=V().f,$I1=C(),Uk1=le1(),Bk1=_$lt(),HI1=Su1(),Ds1=jI1(),Mk1=Iu1(),kk1=w(),VI1=D(),kt="DOMException",zI1=$s1("Error"),jt1=$s1(kt),Hs1=function Hs2(){Uk1(this,jk1);var e=arguments.length,t=HI1(e<1?void 0:arguments[0]),a=HI1(e<2?void 0:arguments[1],"Error"),i=new jt1(t,a),n=new zI1(t);return n.name=kt,js(i,"stack",ks1(1,Mk1(n.stack,1))),Bk1(i,this,Hs1),i},jk1=Hs1.prototype=jt1.prototype,$k1="stack"in new zI1(kt),Hk="stack"in new jt1(1,2),Fs=jt1&&kk1&&Object.getOwnPropertyDescriptor(Fk1,kt),Gk1=!!Fs&&!(Fs.writable&&Fs.configurable),GI1=$k1&&!Gk1&&!Hk;Dk1({global:!0,constructor:!0,forced:VI1||GI1},{DOMException:GI1?Hs1:jt1});var Mt=$s1(kt),WI1=Mt.prototype;if(WI1.constructor!==Mt){VI1||js(WI1,"constructor",ks1(1,Mt));for(Us in Ds1)$I1(Ds1,Us)&&(Bs=Ds1[Us],Ms1=Bs.s,$I1(Mt,Ms1)||js(Mt,Ms1,ks1(6,Bs.c)))}var Bs,Ms1,Us});var JI1=o(function(){"use strict";var Wk1=q(),ae=I(),Vk1=Q(),zk1=w(),Kk1=TypeError,Yk1=Object.defineProperty,YI1=ae.self!==ae;try{zk1?(Oi1=Object.getOwnPropertyDescriptor(ae,"self"),(YI1||!Oi1||!Oi1.get||!Oi1.enumerable)&&Vk1(ae,"self",{get:function get1(){return ae},set:function set1(e){if(this!==ae)throw new Kk1("Illegal invocation");Yk1(ae,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})):Wk1({global:!0,simple:!0,forced:YI1},{self:ae})}catch(r){}var Oi1});var Re=o(function(LV1,XI1){"use strict";var Jk1=TypeError;XI1.exports=function(r,e){if(r<e)throw new Jk1("Not enough arguments");return r}});var ZI1=o(function(DV1,QI1){"use strict";var mi1=S(),$t1=Map.prototype;QI1.exports={Map:Map,set:mi1($t1.set),get:mi1($t1.get),has:mi1($t1.has),remove:mi1($t1.delete),proto:$t1}});var cR1=o(function(){"use strict";var Xk1=D(),Qk1=q(),U=I(),Gt=W10(),Vt1=S(),Ys1=R(),Zk1=Ce1(),Ve=b(),rj1=At1(),ej1=we(),Ci1=P1(),tj1=xe(),aj1=mr1(),tR1=A1(),bi=Ir1(),ij1=C(),nj1=Et1(),Gs1=z(),Ai=L(),uj1=Re(),oj1=bt1(),Pi=ZI1(),Js1=nr1(),sj1=_$qe(),rR1=_$Xn(),vj1=Ru1(),Xs1=Pa1(),Ht1=U.Object,cj1=U.Array,aR1=U.Date,iR1=U.Error,fj1=U.TypeError,lj1=U.PerformanceMark,Te1=Gt("DOMException"),zs=Pi.Map,Qs1=Pi.has,nR1=Pi.get,xi1=Pi.set,uR1=Js1.Set,oR1=Js1.add,hj1=Js1.has,pj1=Gt("Object","keys"),gj1=Vt1([].push),yj1=Vt1((!0).valueOf),dj1=Vt1(1.1.valueOf),qj1=Vt1("".valueOf),Ej1=Vt1(aR1.prototype.getTime),Ks1=Zk1("structuredClone"),Wt1="DataCloneError",_$wi="Transferring",sR1=function sR1(r){return!Ys1(function(){var e=new U.Set([7]),t=r(e),a=r(Ht1(7));return t===e||!t.has(7)||!Ci1(a)||+a!=7})&&r},eR1=function eR1(r,e){return!Ys1(function(){var t=new e,a=r({a:t,b:t});return!(a&&a.a===a.b&&_instanceof(a.a,e)&&a.a.stack===t.stack)})},Sj1=function Sj1(r){return!Ys1(function(){var e=r(new U.AggregateError([1],Ks1,{cause:3}));return e.name!=="AggregateError"||e.errors[0]!==1||e.message!==Ks1||e.cause!==3})},We=U.structuredClone,Ij1=Xk1||!eR1(We,iR1)||!eR1(We,Te1)||!Sj1(We),Rj1=!We&&sR1(function(r){return new lj1(Ks1,{detail:r}).detail}),Br=sR1(We)||Rj1,Ws1=function Ws1(r){throw new Te1("Uncloneable type: "+r,Wt1)},J=function J(r,e){throw new Te1((e||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",Wt1)},Vs1=function Vs1(r,e){return Br||J(e),Br(r)},Tj1=function Tj1(){var r;try{r=new U.DataTransfer}catch(e){try{r=new U.ClipboardEvent("").clipboardData}catch(t){}}return r&&r.items&&r.files?r:null},vR1=function vR1(r,e,t){if(Qs1(e,r))return nR1(e,r);var a=t||bi(r),i,n,u,s,v,f10;if(a==="SharedArrayBuffer")Br?i=Br(r):i=r;else{var l=U.DataView;!l&&!Ve(r.slice)&&J("ArrayBuffer");try{if(Ve(r.slice)&&!r.resizable)i=r.slice(0);else for(n=r.byteLength,u=("maxByteLength"in r)?{maxByteLength:r.maxByteLength}:void 0,i=new ArrayBuffer(n,u),s=new l(r),v=new l(i),f10=0;f10<n;f10++)v.setUint8(f10,s.getUint8(f10))}catch(c){throw new Te1("ArrayBuffer is detached",Wt1)}}return xi1(e,r,i),i},Oj1=function Oj1(r,e,t,a,i){var n=U[e];return Ci1(n)||J(e),new n(vR1(r.buffer,i),t,a)},F10=function F11(r,e){if(tj1(r)&&Ws1("Symbol"),!Ci1(r))return r;if(e){if(Qs1(e,r))return nR1(e,r)}else e=new zs;var t=bi(r),a,i,n,u,s,v,f10,l;switch(t){case"Array":n=cj1(Ai(r));break;case"Object":n={};break;case"Map":n=new zs;break;case"Set":n=new uR1;break;case"RegExp":n=new RegExp(r.source,oj1(r));break;case"Error":switch(i=r.name,i){case"AggregateError":n=new(Gt(i))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":n=new(Gt(i));break;case"CompileError":case"LinkError":case"RuntimeError":n=new(Gt("WebAssembly",i));break;default:n=new iR1}break;case"DOMException":n=new Te1(r.message,r.name);break;case"ArrayBuffer":case"SharedArrayBuffer":n=vR1(r,e,t);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":v=t==="DataView"?r.byteLength:r.length,n=Oj1(r,t,r.byteOffset,v,e);break;case"DOMQuad":try{n=new DOMQuad(F10(r.p1,e),F10(r.p2,e),F10(r.p3,e),F10(r.p4,e))}catch(c){n=Vs1(r,t)}break;case"File":if(Br)try{n=Br(r),bi(n)!==t&&(n=void 0)}catch(c){}if(!n)try{n=new File([r],r.name,r)}catch(c){}n||J(t);break;case"FileList":if(u=Tj1(),u){for(s=0,v=Ai(r);s<v;s++)u.items.add(F10(r[s],e));n=u.files}else n=Vs1(r,t);break;case"ImageData":try{n=new ImageData(F10(r.data,e),r.width,r.height,{colorSpace:r.colorSpace})}catch(c){n=Vs1(r,t)}break;default:if(Br)n=Br(r);else switch(t){case"BigInt":n=Ht1(r.valueOf());break;case"Boolean":n=Ht1(yj1(r));break;case"Number":n=Ht1(dj1(r));break;case"String":n=Ht1(qj1(r));break;case"Date":n=new aR1(Ej1(r));break;case"Blob":try{n=r.slice(0,r.size,r.type)}catch(c){J(t)}break;case"DOMPoint":case"DOMPointReadOnly":a=U[t];try{n=a.fromPoint?a.fromPoint(r):new a(r.x,r.y,r.z,r.w)}catch(c){J(t)}break;case"DOMRect":case"DOMRectReadOnly":a=U[t];try{n=a.fromRect?a.fromRect(r):new a(r.x,r.y,r.width,r.height)}catch(c){J(t)}break;case"DOMMatrix":case"DOMMatrixReadOnly":a=U[t];try{n=a.fromMatrix?a.fromMatrix(r):new a(r)}catch(c){J(t)}break;case"AudioData":case"VideoFrame":Ve(r.clone)||J(t);try{n=r.clone()}catch(c){Ws1(t)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":J(t);default:Ws1(t)}}switch(xi1(e,r,n),t){case"Array":case"Object":for(f10=pj1(r),s=0,v=Ai(f10);s<v;s++)l=f10[s],nj1(n,l,F10(r[l],e));break;case"Map":r.forEach(function(c,h){xi1(n,F10(h,e),F10(c,e))});break;case"Set":r.forEach(function(c){oR1(n,F10(c,e))});break;case"Error":Gs1(n,"message",F10(r.message,e)),ij1(r,"cause")&&Gs1(n,"cause",F10(r.cause,e)),i==="AggregateError"?n.errors=F10(r.errors,e):i==="SuppressedError"&&(n.error=F10(r.error,e),n.suppressed=F10(r.suppressed,e));case"DOMException":vj1&&Gs1(n,"stack",F10(r.stack,e))}return n},mj1=function mj1(r,e){if(!Ci1(r))throw new fj1("Transfer option cannot be converted to a sequence");var t=[];aj1(r,function(h){gj1(t,tR1(h))});for(var a=0,i=Ai(t),n=new uR1,u,s,v,f10,l,c;a<i;){if(u=t[a++],s=bi(u),s==="ArrayBuffer"?hj1(n,u):Qs1(e,u))throw new Te1("Duplicate transferable",Wt1);if(s==="ArrayBuffer"){oR1(n,u);continue}if(Xs1)f10=We(u,{transfer:[u]});else switch(s){case"ImageBitmap":v=U.OffscreenCanvas,rj1(v)||J(s,_$wi);try{l=new v(u.width,u.height),c=l.getContext("bitmaprenderer"),c.transferFromImageBitmap(u),f10=l.transferToImageBitmap()}catch(h){}break;case"AudioData":case"VideoFrame":(!Ve(u.clone)||!Ve(u.close))&&J(s,_$wi);try{f10=u.clone(),u.close()}catch(h){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":J(s,_$wi)}if(f10===void 0)throw new Te1("This object cannot be transferred: "+s,Wt1);xi1(e,u,f10)}return n},Aj1=function Aj1(r){sj1(r,function(e){Xs1?Br(e,{transfer:[e]}):Ve(e.transfer)?e.transfer():rR1?rR1(e):J("ArrayBuffer",_$wi)})};Qk1({global:!0,enumerable:!0,sham:!Xs1,forced:Ij1},{structuredClone:function structuredClone1(e){var t=uj1(arguments.length,1)>1&&!ej1(arguments[1])?tR1(arguments[1]):void 0,a=t?t.transfer:void 0,i,n;a!==void 0&&(i=new zs,n=mj1(a,i));var u=F10(e,i);return n&&Aj1(n),u}})});var pR1=o(function(){"use strict";var wj1=Z(),_i1=S(),fR1=N(),bj1=Re(),hR1=URLSearchParams,Ni1=hR1.prototype,xj1=_i1(Ni1.append),lR1=_i1(Ni1.delete),Cj1=_i1(Ni1.forEach),Pj1=_i1([].push),Zs1=new hR1("a=1&a=2&b=3");Zs1.delete("a",1);Zs1.delete("b",void 0);Zs1+""!="a=2"&&wj1(Ni1,"delete",function(r){var e=arguments.length,t=e<2?void 0:arguments[1];if(e&&t===void 0)return lR1(this,r);var a=[];Cj1(this,function(c,h){Pj1(a,{key:h,value:c})}),bj1(e,1);for(var i=fR1(r),n=fR1(t),u=0,s=0,v=!1,f10=a.length,l;u<f10;)l=a[u++],v||l.key===i?(v=!0,lR1(this,l.key)):s++;for(;s<f10;)l=a[s++],l.key===i&&l.value===n||xj1(this,l.key,l.value)},{enumerable:!0,unsafe:!0})});var qR=o(function(){"use strict";var _j1=Z(),yR1=S(),Nj1=N(),Lj1=Re(),dR1=URLSearchParams,rv1=dR1.prototype,Dj1=yR1(rv1.getAll),Fj1=yR1(rv1.has),gR1=new dR1("a=1");(gR1.has("a",2)||!gR1.has("a",void 0))&&_j1(rv1,"has",function(e){var t=arguments.length,a=t<2?void 0:arguments[1];if(t&&a===void 0)return Fj1(this,e);var i=Dj1(this,e);Lj1(t,1);for(var n=Nj1(a),u=0;u<i.length;)if(i[u++]===n)return!0;return!1},{enumerable:!0,unsafe:!0})});var IR=o(function(){"use strict";var Uj1=q(),Bj1=S(),Mj1=ot1(),kj1=RangeError,ER=String.fromCharCode,SR=String.fromCodePoint,jj1=Bj1([].join),$j1=!!SR&&SR.length!==1;Uj1({target:"String",stat:!0,arity:1,forced:$j1},{fromCodePoint:function fromCodePoint(e){for(var t=[],a=arguments.length,i=0,n;a>i;){if(n=+arguments[i++],Mj1(n,1114111)!==n)throw new kj1(n+" is not a valid code point");t[i]=n<65536?ER(n):ER(((n-=65536)>>10)+55296,n%1024+56320)}return jj1(t,"")}})});var OR=o(function(GV1,TR){"use strict";var RR=I(),Hj1=w(),Gj1=Object.getOwnPropertyDescriptor;TR.exports=function(r){if(!Hj1)return RR[r];var e=Gj1(RR,r);return e&&e.value}});var Li=o(function(WV1,AR){"use strict";var Wj1=R(),Vj1=x(),zj1=w(),mR1=D(),Kj1=Vj1("iterator");AR.exports=!Wj1(function(){var r=new URL("b?a=1&b=2&c=3","https://a"),e=r.searchParams,t=new URLSearchParams("a=1&a=2&b=3"),a="";return r.pathname="c%20d",e.forEach(function(i,n){e.delete("b"),a+=n+i}),t.delete("a",2),t.delete("b",void 0),mR1&&(!r.toJSON||!t.has("a",1)||t.has("a",2)||!t.has("a",void 0)||t.has("b"))||!e.size&&(mR1||!zj1)||!e.sort||r.href!=="https://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[Kj1]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||a!=="a1c3"||new URL("https://x",void 0).host!=="x"})});var vv1=o(function(VV1,YR){"use strict";_s1();IR();var uv1=q(),MR=I(),ov1=OR(),Yj1=W10(),Di=m(),dr1=S(),zt1=w(),kR=Li(),jR=Z(),Jj1=Q(),Xj1=Ia1(),Qj1=Hr(),Zj1=Za1(),sv1=_$X(),$R=le1(),ev1=b(),r$1=C(),e$=_$Kr(),t$1=Ir1(),a$1=A1(),HR=P1(),$=N(),i$=Vr1(),wR1=Pr1(),bR1=Tt(),n$1=ye(),Fi=Ue(),ze=Re(),u$1=x(),o$=Ua(),s$1=u$1("iterator"),Ye1="URLSearchParams",GR1=Ye1+"Iterator",WR=sv1.set,ur1=sv1.getterFor(Ye1),v$1=sv1.getterFor(GR1),xR1=ov1("fetch"),Mi1=ov1("Request"),Kt1=ov1("Headers"),tv1=Mi1&&Mi1.prototype,CR=Kt1&&Kt1.prototype,c$1=MR.TypeError,f$1=MR.encodeURIComponent,l$1=String.fromCharCode,h$1=Yj1("String","fromCodePoint"),p$1=parseInt,Bi1=dr1("".charAt),PR=dr1([].join),ie=dr1([].push),VR=dr1("".replace),g$=dr1([].shift),_R1=dr1([].splice),NR1=dr1("".split),zR=dr1("".slice),y$1=dr1(/./.exec),d$1=/\+/g,av1="�",q$1=/^[0-9a-f]+$/i,LR1=function LR1(r,e){var t=zR(r,e,e+2);return y$1(q$1,t)?p$1(t,16):NaN},E$1=function E$1(r){for(var e=0,t=128;t>0&&r&t;t>>=1)e++;return e},S$1=function S$1(r){var e=null;switch(r.length){case 1:e=r[0];break;case 2:e=(r[0]&31)<<6|r[1]&63;break;case 3:e=(r[0]&15)<<12|(r[1]&63)<<6|r[2]&63;break;case 4:e=(r[0]&7)<<18|(r[1]&63)<<12|(r[2]&63)<<6|r[3]&63;break}return e>1114111?null:e},DR=function DR(r){r=VR(r,d$1," ");for(var e=r.length,t="",a=0;a<e;){var i=Bi1(r,a);if(i==="%"){if(Bi1(r,a+1)==="%"||a+3>e){t+="%",a++;continue}var n=LR1(r,a+1);if(n!==n){t+=i,a++;continue}a+=2;var u=E$1(n);if(u===0)i=l$1(n);else{if(u===1||u>4){t+=av1,a++;continue}for(var s=[n],v=1;v<u&&(a++,!(a+3>e||Bi1(r,a)!=="%"));){var f10=LR1(r,a+1);if(f10!==f10){a+=3;break}if(f10>191||f10<128)break;ie(s,f10),a+=2,v++}if(s.length!==u){t+=av1;continue}var l=S$1(s);l===null?t+=av1:i=h$1(l)}}t+=i,a++}return t},I$1=/[!'()~]|%20/g,R$={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},T$=function T$(r){return R$[r]},FR=function FR(r){return VR(f$1(r),I$1,T$)},iv1=Zj1(function(e,t){WR(this,{type:GR1,target:ur1(e).entries,index:0,kind:t})},Ye1,function(){var e=v$1(this),t=e.target,a=e.index++;if(!t||a>=t.length)return e.target=null,Fi(void 0,!0);var i=t[a];switch(e.kind){case"keys":return Fi(i.key,!1);case"values":return Fi(i.value,!1)}return Fi([i.key,i.value],!1)},!0),KR=function KR(r){this.entries=[],this.url=null,r!==void 0&&(HR(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?Bi1(r,0)==="?"?zR(r,1):r:$(r)))};KR.prototype={type:Ye1,bindURL:function bindURL(r){this.url=r,this.update()},parseObject:function parseObject(r){var e=this.entries,t=n$1(r),a,i,n,u,s,v,f10;if(t)for(a=bR1(r,t),i=a.next;!(n=Di(i,a)).done;){if(u=bR1(a$1(n.value)),s=u.next,(v=Di(s,u)).done||(f10=Di(s,u)).done||!Di(s,u).done)throw new c$1("Expected sequence with length 2");ie(e,{key:$(v.value),value:$(f10.value)})}else for(var l in r)r$1(r,l)&&ie(e,{key:l,value:$(r[l])})},parseQuery:function parseQuery(r){if(r)for(var e=this.entries,t=NR1(r,"&"),a=0,i,n;a<t.length;)i=t[a++],i.length&&(n=NR1(i,"="),ie(e,{key:DR(g$(n)),value:DR(PR(n,"="))}))},serialize:function serialize(){for(var r=this.entries,e=[],t=0,a;t<r.length;)a=r[t++],ie(e,FR(a.key)+"="+FR(a.value));return PR(e,"&")},update:function update(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function updateURL(){this.url&&this.url.update()}};var ki1=function ki1(){$R(this,Ke1);var e=arguments.length>0?arguments[0]:void 0,t=WR(this,new KR(e));zt1||(this.size=t.entries.length)},Ke1=ki1.prototype;Xj1(Ke1,{append:function append(e,t){var a=ur1(this);ze(arguments.length,2),ie(a.entries,{key:$(e),value:$(t)}),zt1||this.size++,a.updateURL()},delete:function _delete(r){for(var e=ur1(this),t=ze(arguments.length,1),a=e.entries,i=$(r),n=t<2?void 0:arguments[1],u=n===void 0?n:$(n),s=0;s<a.length;){var v=a[s];if(v.key===i&&(u===void 0||v.value===u)){if(_R1(a,s,1),u!==void 0)break}else s++}zt1||(this.size=a.length),e.updateURL()},get:function get1(e){var t=ur1(this).entries;ze(arguments.length,1);for(var a=$(e),i=0;i<t.length;i++)if(t[i].key===a)return t[i].value;return null},getAll:function getAll(e){var t=ur1(this).entries;ze(arguments.length,1);for(var a=$(e),i=[],n=0;n<t.length;n++)t[n].key===a&&ie(i,t[n].value);return i},has:function has(e){for(var t=ur1(this).entries,a=ze(arguments.length,1),i=$(e),n=a<2?void 0:arguments[1],u=n===void 0?n:$(n),s=0;s<t.length;){var v=t[s++];if(v.key===i&&(u===void 0||v.value===u))return!0}return!1},set:function set1(e,t){var a=ur1(this);ze(arguments.length,1);for(var i=a.entries,n=!1,u=$(e),s=$(t),v=0,f10;v<i.length;v++)f10=i[v],f10.key===u&&(n?_R1(i,v--,1):(n=!0,f10.value=s));n||ie(i,{key:u,value:s}),zt1||(this.size=i.length),a.updateURL()},sort:function sort(){var e=ur1(this);o$(e.entries,function(t,a){return t.key>a.key?1:-1}),e.updateURL()},forEach:function forEach(e){for(var t=ur1(this).entries,a=e$(e,arguments.length>1?arguments[1]:void 0),i=0,n;i<t.length;)n=t[i++],a(n.value,n.key,this)},keys:function keys(){return new iv1(this,"keys")},values:function values(){return new iv1(this,"values")},entries:function entries(){return new iv1(this,"entries")}},{enumerable:!0});jR(Ke1,s$1,Ke1.entries,{name:"entries"});jR(Ke1,"toString",function(){return ur1(this).serialize()},{enumerable:!0});zt1&&Jj1(Ke1,"size",{get:function get1(){return ur1(this).entries.length},configurable:!0,enumerable:!0});Qj1(ki1,Ye1);uv1({global:!0,constructor:!0,forced:!kR},{URLSearchParams:ki1});!kR&&ev1(Kt1)&&(UR=dr1(CR.has),BR=dr1(CR.set),nv1=function nv1(r){if(HR(r)){var e=r.body,t;if(t$1(e)===Ye1)return t=r.headers?new Kt1(r.headers):new Kt1,UR(t,"content-type")||BR(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),i$(r,{body:wR1(0,$(e)),headers:wR1(0,t)})}return r},ev1(xR1)&&uv1({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function fetch1(e){return xR1(e,arguments.length>1?nv1(arguments[1]):{})}}),ev1(Mi1)&&(Ui1=function Ui1(e){return $R(this,tv1),new Mi1(e,arguments.length>1?nv1(arguments[1]):{})},tv1.constructor=Ui1,Ui1.prototype=tv1,uv1({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ui1})));var UR,BR,nv1,Ui1;YR.exports={URLSearchParams:ki1,getState:ur1}});var JR=o(function(){"use strict";vv1()});var XR=o(function(){"use strict";var O$=w(),m$=S(),A$1=Q(),cv1=URLSearchParams.prototype,w$1=m$(cv1.forEach);O$&&!("size"in cv1)&&A$1(cv1,"size",{get:function get1(){var e=0;return w$1(this,function(){e++}),e},configurable:!0,enumerable:!0})});var rT1=o(function(){"use strict";var b$=q(),x$1=W10(),ZR=R(),C$1=Re(),QR=N(),P$=Li(),fv1=x$1("URL"),_$1=P$&&ZR(function(){fv1.canParse()}),N$1=ZR(function(){return fv1.canParse.length!==1});b$({target:"URL",stat:!0,forced:!_$1||N$1},{canParse:function canParse(e){var t=C$1(arguments.length,1),a=QR(e),i=t<2||arguments[1]===void 0?void 0:QR(arguments[1]);try{return!!new fv1(a,i)}catch(n){return!1}}})});var iT1=o(function(){"use strict";var L$1=ri().charAt,D$1=N(),tT1=_$X(),F$1=Cs1(),eT1=Ue(),aT1="String Iterator",U$1=tT1.set,B$1=tT1.getterFor(aT1);F$1(String,"String",function(r){U$1(this,{type:aT1,string:D$1(r),index:0})},function(){var e=B$1(this),t=e.string,a=e.index,i;return a>=t.length?eT1(void 0,!0):(i=L$1(t,a),e.index+=i.length,eT1(i,!1))})});var sT1=o(function(e71,oT1){"use strict";var nT1=w(),M$1=S(),k$1=m(),j$1=R(),lv1=iu1(),$$1=Cn(),H$1=mn1(),G$1=B(),W$1=_e1(),Je1=Object.assign,uT1=Object.defineProperty,V$1=M$1([].concat);oT1.exports=!Je1||j$1(function(){if(nT1&&Je1({b:1},Je1(uT1({},"a",{enumerable:!0,get:function get1(){uT1(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol("assign detection"),a="abcdefghijklmnopqrst";return r[t]=7,a.split("").forEach(function(i){e[i]=i}),Je1({},r)[t]!==7||lv1(Je1({},e)).join("")!==a})?function(e,t){for(var a=G$1(e),i=arguments.length,n=1,u=$$1.f,s=H$1.f;i>n;)for(var v=W$1(arguments[n++]),f10=u?V$1(lv1(v),u(v)):lv1(v),l=f10.length,c=0,h;l>c;)h=f10[c++],(!nT1||k$1(s,v,h))&&(a[h]=v[h]);return a}:Je1});var lT1=o(function(t71,fT1){"use strict";var z$1=_$Kr(),K$1=m(),Y$1=B(),J$1=Ha1(),X$1=ja1(),Q$1=At1(),Z$1=L(),vT1=Et1(),r81=Tt(),e81=ye(),cT1=Array;fT1.exports=function(e){var t=Y$1(e),a=Q$1(this),i=arguments.length,n=i>1?arguments[1]:void 0,u=n!==void 0;u&&(n=z$1(n,i>2?arguments[2]:void 0));var s=e81(t),v=0,f10,l,c,h,y,g;if(s&&!(this===cT1&&X$1(s)))for(l=a?new this:[],h=r81(t,s),y=h.next;!(c=K$1(y,h)).done;v++)g=u?J$1(h,n,[c.value,v],!0):c.value,vT1(l,v,g);else for(f10=Z$1(t),l=a?new this(f10):cT1(f10);f10>v;v++)g=u?n(t[v],v):t[v],vT1(l,v,g);return l.length=v,l}});var IT1=o(function(a71,ST1){"use strict";var Oe=S(),hv1=0x7fffffff,_$Yt=36,dT1=1,yv1=26,t81=38,a81=700,i81=72,n81=128,u81="-",o81=/[^\0-\u007E]/,qT1=/[.\u3002\uFF0E\uFF61]/g,hT1="Overflow: input needs wider integers to process",pv1=_$Yt-dT1,pT1=RangeError,s81=Oe(qT1.exec),_$Xe=Math.floor,gv1=String.fromCharCode,gT1=Oe("".charCodeAt),ET1=Oe([].join),_$ne=Oe([].push),v81=Oe("".replace),c81=Oe("".split),f81=Oe("".toLowerCase),l81=function l81(r){for(var e=[],t=0,a=r.length;t<a;){var i=gT1(r,t++);if(i>=55296&&i<=56319&&t<a){var n=gT1(r,t++);(n&64512)===56320?_$ne(e,((i&1023)<<10)+(n&1023)+65536):(_$ne(e,i),t--)}else _$ne(e,i)}return e},yT1=function yT1(r){return r+22+75*(r<26)},h81=function h81(r,e,t){var a=0;for(r=t?_$Xe(r/a81):r>>1,r+=_$Xe(r/e);r>pv1*yv1>>1;)r=_$Xe(r/pv1),a+=_$Yt;return _$Xe(a+(pv1+1)*r/(r+t81))},p81=function p81(r){var e=[];r=l81(r);var t=r.length,a=n81,i=0,n=i81,u,s;for(u=0;u<r.length;u++)s=r[u],s<128&&_$ne(e,gv1(s));var v=e.length,f10=v;for(v&&_$ne(e,u81);f10<t;){var l=hv1;for(u=0;u<r.length;u++)s=r[u],s>=a&&s<l&&(l=s);var c=f10+1;if(l-a>_$Xe((hv1-i)/c))throw new pT1(hT1);for(i+=(l-a)*c,a=l,u=0;u<r.length;u++){if(s=r[u],s<a&&++i>hv1)throw new pT1(hT1);if(s===a){for(var h=i,y=_$Yt;;){var g=y<=n?dT1:y>=n+yv1?yv1:y-n;if(h<g)break;var d=h-g,E=_$Yt-g;_$ne(e,gv1(yT1(g+d%E))),h=_$Xe(d/E),y+=_$Yt}_$ne(e,gv1(yT1(h))),n=h81(i,c,f10===v),i=0,f10++}}i++,a++}return ET1(e,"")};ST1.exports=function(r){var e=[],t=c81(v81(f81(r),qT1,"."),"."),a,i;for(a=0;a<t.length;a++)i=t[a],_$ne(e,s81(o81,i)?"xn--"+p81(i):i);return ET1(e,".")}});var MT1=o(function(){"use strict";iT1();var g81=q(),Nv1=w(),y81=Li(),Lv1=I(),RT1=_$Kr(),fr1=S(),Wi1=Z(),or1=Q(),d81=le1(),Cv1=C(),Dv1=sT1(),Qe1=lT1(),qr1=ft1(),q81=ri().codeAt,E81=IT1(),kr1=N(),_$S8=Hr(),I81=Re(),NT1=vv1(),LT1=_$X(),R81=LT1.set,Vi1=LT1.getterFor("URL"),T81=NT1.URLSearchParams,O81=NT1.getState,Jt=Lv1.URL,Pv1=Lv1.TypeError,zi1=Lv1.parseInt,m81=Math.floor,TT1=Math.pow,cr=fr1("".charAt),Er1=fr1(/./.exec),Qt1=fr1([].join),A81=fr1(1.1.toString),_$w8=fr1([].pop),rt1=fr1([].push),dv1=fr1("".replace),b81=fr1([].shift),x81=fr1("".split),ra1=fr1("".slice),Ki1=fr1("".toLowerCase),C81=fr1([].unshift),P81="Invalid authority",qv1="Invalid scheme",me="Invalid host",OT1="Invalid port",DT1=/[a-z]/i,_81=/[\d+-.a-z]/i,_v1=/\d/,N81=/^0x/i,L81=/^[0-7]+$/,D81=/^\d+$/,FT1=/^[\da-f]+$/i,F81=/[\0\t\n\r #%/:<>?@[\\\]^|]/,U81=/[\0\t\n\r #/:<>?@[\\\]^|]/,B8=/^[\u0000-\u0020]+/,M81=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,k81=/[\t\n\r]/g,sr1,j81=function j81(r){var e=x81(r,"."),t,a,i,n,u,s,v;if(e.length&&e[e.length-1]===""&&e.length--,t=e.length,t>4)return r;for(a=[],i=0;i<t;i++){if(n=e[i],n==="")return r;if(u=10,n.length>1&&cr(n,0)==="0"&&(u=Er1(N81,n)?16:8,n=ra1(n,u===8?1:2)),n==="")s=0;else{if(!Er1(u===10?D81:u===8?L81:FT1,n))return r;s=zi1(n,u)}rt1(a,s)}for(i=0;i<t;i++)if(s=a[i],i===t-1){if(s>=TT1(256,5-t))return null}else if(s>255)return null;for(v=_$w8(a),i=0;i<a.length;i++)v+=a[i]*TT1(256,3-i);return v},$81=function $81(r){var e=[0,0,0,0,0,0,0,0],t=0,a=null,i=0,n,u,s,v,f10,l,c,h=function h(){return cr(r,i)};if(h()===":"){if(cr(r,1)!==":")return;i+=2,t++,a=t}for(;h();){if(t===8)return;if(h()===":"){if(a!==null)return;i++,t++,a=t;continue}for(n=u=0;u<4&&Er1(FT1,h());)n=n*16+zi1(h(),16),i++,u++;if(h()==="."){if(u===0||(i-=u,t>6))return;for(s=0;h();){if(v=null,s>0)if(h()==="."&&s<4)i++;else return;if(!Er1(_v1,h()))return;for(;Er1(_v1,h());){if(f10=zi1(h(),10),v===null)v=f10;else{if(v===0)return;v=v*10+f10}if(v>255)return;i++}e[t]=e[t]*256+v,s++,(s===2||s===4)&&t++}if(s!==4)return;break}else if(h()===":"){if(i++,!h())return}else if(h())return;e[t++]=n}if(a!==null)for(l=t-a,t=7;t!==0&&l>0;)c=e[t],e[t--]=e[a+l-1],e[a+--l]=c;else if(t!==8)return;return e},H81=function H81(r){for(var e=null,t=1,a=null,i=0,n=0;n<8;n++)r[n]!==0?(i>t&&(e=a,t=i),a=null,i=0):(a===null&&(a=n),++i);return i>t?a:e},Xt1=function Xt1(r){var e,t,a,i;if(typeof r=="number"){for(e=[],t=0;t<4;t++)C81(e,r%256),r=m81(r/256);return Qt1(e,".")}if((typeof r==="undefined"?"undefined":_type_of(r))=="object"){for(e="",a=H81(r),t=0;t<8;t++)i&&r[t]===0||(i&&(i=!1),a===t?(e+=t?":":"::",i=!0):(e+=A81(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},Gi1={},UT1=Dv1({},Gi1,{" ":1,'"':1,"<":1,">":1,"`":1}),BT1=Dv1({},UT1,{"#":1,"?":1,"{":1,"}":1}),Ev1=Dv1({},BT1,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ue=function ue(r,e){var t=q81(r,0);return t>32&&t<127&&!Cv1(e,r)?r:encodeURIComponent(r)},ji1={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Zt1=function Zt1(r,e){var t;return r.length===2&&Er1(DT1,cr(r,0))&&((t=cr(r,1))===":"||!e&&t==="|")},mT1=function mT1(r){var e;return r.length>1&&Zt1(ra1(r,0,2))&&(r.length===2||(e=cr(r,2))==="/"||e==="\\"||e==="?"||e==="#")},G81=function G81(r){return r==="."||Ki1(r)==="%2e"},W81=function W81(r){return r=Ki1(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Sv1={},AT1={},Iv1={},wT1={},bT1={},Rv1={},xT1={},_$CT={},$i1={},Hi1={},Tv1={},Ov1={},mv1={},Av1={},PT1={},wv1={},Ze1={},br1={},_T1={},Ae1={},Mr1={},Fv1=function Fv2(r,e,t){var a=kr1(r),i,n,u;if(e){if(n=this.parse(a),n)throw new Pv1(n);this.searchParams=null}else{if(t!==void 0&&(i=new Fv1(t,!0)),n=this.parse(a,null,i),n)throw new Pv1(n);u=O81(new T81),u.bindURL(this),this.searchParams=u}};Fv1.prototype={type:"URL",parse:function parse(r,e,t){var a=this,i=e||Sv1,n=0,u="",s=!1,v=!1,f10=!1,l,c,h,y;for(r=kr1(r),e||(a.scheme="",a.username="",a.password="",a.host=null,a.port=null,a.path=[],a.query=null,a.fragment=null,a.cannotBeABaseURL=!1,r=dv1(r,B8,""),r=dv1(r,M81,"$1")),r=dv1(r,k81,""),l=Qe1(r);n<=l.length;){switch(c=l[n],i){case Sv1:if(c&&Er1(DT1,c))u+=Ki1(c),i=AT1;else{if(e)return qv1;i=Iv1;continue}break;case AT1:if(c&&(Er1(_81,c)||c==="+"||c==="-"||c==="."))u+=Ki1(c);else if(c===":"){if(e&&(a.isSpecial()!==Cv1(ji1,u)||u==="file"&&(a.includesCredentials()||a.port!==null)||a.scheme==="file"&&!a.host))return;if(a.scheme=u,e){a.isSpecial()&&ji1[a.scheme]===a.port&&(a.port=null);return}u="",a.scheme==="file"?i=Av1:a.isSpecial()&&t&&t.scheme===a.scheme?i=wT1:a.isSpecial()?i=_$CT:l[n+1]==="/"?(i=bT1,n++):(a.cannotBeABaseURL=!0,rt1(a.path,""),i=_T1)}else{if(e)return qv1;u="",i=Iv1,n=0;continue}break;case Iv1:if(!t||t.cannotBeABaseURL&&c!=="#")return qv1;if(t.cannotBeABaseURL&&c==="#"){a.scheme=t.scheme,a.path=qr1(t.path),a.query=t.query,a.fragment="",a.cannotBeABaseURL=!0,i=Mr1;break}i=t.scheme==="file"?Av1:Rv1;continue;case wT1:if(c==="/"&&l[n+1]==="/")i=$i1,n++;else{i=Rv1;continue}break;case bT1:if(c==="/"){i=Hi1;break}else{i=br1;continue}case Rv1:if(a.scheme=t.scheme,c===sr1)a.username=t.username,a.password=t.password,a.host=t.host,a.port=t.port,a.path=qr1(t.path),a.query=t.query;else if(c==="/"||c==="\\"&&a.isSpecial())i=xT1;else if(c==="?")a.username=t.username,a.password=t.password,a.host=t.host,a.port=t.port,a.path=qr1(t.path),a.query="",i=Ae1;else if(c==="#")a.username=t.username,a.password=t.password,a.host=t.host,a.port=t.port,a.path=qr1(t.path),a.query=t.query,a.fragment="",i=Mr1;else{a.username=t.username,a.password=t.password,a.host=t.host,a.port=t.port,a.path=qr1(t.path),a.path.length--,i=br1;continue}break;case xT1:if(a.isSpecial()&&(c==="/"||c==="\\"))i=$i1;else if(c==="/")i=Hi1;else{a.username=t.username,a.password=t.password,a.host=t.host,a.port=t.port,i=br1;continue}break;case _$CT:if(i=$i1,c!=="/"||cr(u,n+1)!=="/")continue;n++;break;case $i1:if(c!=="/"&&c!=="\\"){i=Hi1;continue}break;case Hi1:if(c==="@"){s&&(u="%40"+u),s=!0,h=Qe1(u);for(var g=0;g<h.length;g++){var d=h[g];if(d===":"&&!f10){f10=!0;continue}var E=ue(d,Ev1);f10?a.password+=E:a.username+=E}u=""}else if(c===sr1||c==="/"||c==="?"||c==="#"||c==="\\"&&a.isSpecial()){if(s&&u==="")return P81;n-=Qe1(u).length+1,u="",i=Tv1}else u+=c;break;case Tv1:case Ov1:if(e&&a.scheme==="file"){i=wv1;continue}else if(c===":"&&!v){if(u==="")return me;if(y=a.parseHost(u),y)return y;if(u="",i=mv1,e===Ov1)return}else if(c===sr1||c==="/"||c==="?"||c==="#"||c==="\\"&&a.isSpecial()){if(a.isSpecial()&&u==="")return me;if(e&&u===""&&(a.includesCredentials()||a.port!==null))return;if(y=a.parseHost(u),y)return y;if(u="",i=Ze1,e)return;continue}else c==="["?v=!0:c==="]"&&(v=!1),u+=c;break;case mv1:if(Er1(_v1,c))u+=c;else if(c===sr1||c==="/"||c==="?"||c==="#"||c==="\\"&&a.isSpecial()||e){if(u!==""){var T=zi1(u,10);if(T>65535)return OT1;a.port=a.isSpecial()&&T===ji1[a.scheme]?null:T,u=""}if(e)return;i=Ze1;continue}else return OT1;break;case Av1:if(a.scheme="file",c==="/"||c==="\\")i=PT1;else if(t&&t.scheme==="file")switch(c){case sr1:a.host=t.host,a.path=qr1(t.path),a.query=t.query;break;case"?":a.host=t.host,a.path=qr1(t.path),a.query="",i=Ae1;break;case"#":a.host=t.host,a.path=qr1(t.path),a.query=t.query,a.fragment="",i=Mr1;break;default:mT1(Qt1(qr1(l,n),""))||(a.host=t.host,a.path=qr1(t.path),a.shortenPath()),i=br1;continue}else{i=br1;continue}break;case PT1:if(c==="/"||c==="\\"){i=wv1;break}t&&t.scheme==="file"&&!mT1(Qt1(qr1(l,n),""))&&(Zt1(t.path[0],!0)?rt1(a.path,t.path[0]):a.host=t.host),i=br1;continue;case wv1:if(c===sr1||c==="/"||c==="\\"||c==="?"||c==="#"){if(!e&&Zt1(u))i=br1;else if(u===""){if(a.host="",e)return;i=Ze1}else{if(y=a.parseHost(u),y)return y;if(a.host==="localhost"&&(a.host=""),e)return;u="",i=Ze1}continue}else u+=c;break;case Ze1:if(a.isSpecial()){if(i=br1,c!=="/"&&c!=="\\")continue}else if(!e&&c==="?")a.query="",i=Ae1;else if(!e&&c==="#")a.fragment="",i=Mr1;else if(c!==sr1&&(i=br1,c!=="/"))continue;break;case br1:if(c===sr1||c==="/"||c==="\\"&&a.isSpecial()||!e&&(c==="?"||c==="#")){if(W81(u)?(a.shortenPath(),c!=="/"&&!(c==="\\"&&a.isSpecial())&&rt1(a.path,"")):G81(u)?c!=="/"&&!(c==="\\"&&a.isSpecial())&&rt1(a.path,""):(a.scheme==="file"&&!a.path.length&&Zt1(u)&&(a.host&&(a.host=""),u=cr(u,0)+":"),rt1(a.path,u)),u="",a.scheme==="file"&&(c===sr1||c==="?"||c==="#"))for(;a.path.length>1&&a.path[0]==="";)b81(a.path);c==="?"?(a.query="",i=Ae1):c==="#"&&(a.fragment="",i=Mr1)}else u+=ue(c,BT1);break;case _T1:c==="?"?(a.query="",i=Ae1):c==="#"?(a.fragment="",i=Mr1):c!==sr1&&(a.path[0]+=ue(c,Gi1));break;case Ae1:!e&&c==="#"?(a.fragment="",i=Mr1):c!==sr1&&(c==="'"&&a.isSpecial()?a.query+="%27":c==="#"?a.query+="%23":a.query+=ue(c,Gi1));break;case Mr1:c!==sr1&&(a.fragment+=ue(c,UT1));break}n++}},parseHost:function parseHost(r){var e,t,a;if(cr(r,0)==="["){if(cr(r,r.length-1)!=="]"||(e=$81(ra1(r,1,-1)),!e))return me;this.host=e}else if(this.isSpecial()){if(r=E81(r),Er1(F81,r)||(e=j81(r),e===null))return me;this.host=e}else{if(Er1(U81,r))return me;for(e="",t=Qe1(r),a=0;a<t.length;a++)e+=ue(t[a],Gi1);this.host=e}},cannotHaveUsernamePasswordPort:function cannotHaveUsernamePasswordPort(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function includesCredentials(){return this.username!==""||this.password!==""},isSpecial:function isSpecial(){return Cv1(ji1,this.scheme)},shortenPath:function shortenPath(){var r=this.path,e=r.length;e&&(this.scheme!=="file"||e!==1||!Zt1(r[0],!0))&&r.length--},serialize:function serialize(){var r=this,e=r.scheme,t=r.username,a=r.password,i=r.host,n=r.port,u=r.path,s=r.query,v=r.fragment,f10=e+":";return i!==null?(f10+="//",r.includesCredentials()&&(f10+=t+(a?":"+a:"")+"@"),f10+=Xt1(i),n!==null&&(f10+=":"+n)):e==="file"&&(f10+="//"),f10+=r.cannotBeABaseURL?u[0]:u.length?"/"+Qt1(u,"/"):"",s!==null&&(f10+="?"+s),v!==null&&(f10+="#"+v),f10},setHref:function setHref(r){var e=this.parse(r);if(e)throw new Pv1(e);this.searchParams.update()},getOrigin:function getOrigin(){var r=this.scheme,e=this.port;if(r==="blob")try{return new et(r.path[0]).origin}catch(t){return"null"}return r==="file"||!this.isSpecial()?"null":r+"://"+Xt1(this.host)+(e!==null?":"+e:"")},getProtocol:function getProtocol(){return this.scheme+":"},setProtocol:function setProtocol(r){this.parse(kr1(r)+":",Sv1)},getUsername:function getUsername(){return this.username},setUsername:function setUsername(r){var e=Qe1(kr1(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=ue(e[t],Ev1)}},getPassword:function getPassword(){return this.password},setPassword:function setPassword(r){var e=Qe1(kr1(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=ue(e[t],Ev1)}},getHost:function getHost(){var r=this.host,e=this.port;return r===null?"":e===null?Xt1(r):Xt1(r)+":"+e},setHost:function setHost(r){this.cannotBeABaseURL||this.parse(r,Tv1)},getHostname:function getHostname(){var r=this.host;return r===null?"":Xt1(r)},setHostname:function setHostname(r){this.cannotBeABaseURL||this.parse(r,Ov1)},getPort:function getPort(){var r=this.port;return r===null?"":kr1(r)},setPort:function setPort(r){this.cannotHaveUsernamePasswordPort()||(r=kr1(r),r===""?this.port=null:this.parse(r,mv1))},getPathname:function getPathname(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+Qt1(r,"/"):""},setPathname:function setPathname(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Ze1))},getSearch:function getSearch(){var r=this.query;return r?"?"+r:""},setSearch:function setSearch(r){r=kr1(r),r===""?this.query=null:(cr(r,0)==="?"&&(r=ra1(r,1)),this.query="",this.parse(r,Ae1)),this.searchParams.update()},getSearchParams:function getSearchParams(){return this.searchParams.facade},getHash:function getHash(){var r=this.fragment;return r?"#"+r:""},setHash:function setHash(r){if(r=kr1(r),r===""){this.fragment=null;return}cr(r,0)==="#"&&(r=ra1(r,1)),this.fragment="",this.parse(r,Mr1)},update:function update(){this.query=this.searchParams.serialize()||null}};var et=function et(e){var t=d81(this,H),a=I81(arguments.length,1)>1?arguments[1]:void 0,i=R81(t,new Fv1(e,!1,a));Nv1||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},H=et.prototype,vr1=function vr1(r,e){return{get:function get1(){return Vi1(this)[r]()},set:e&&function(t){return Vi1(this)[e](t)},configurable:!0,enumerable:!0}};Nv1&&(or1(H,"href",vr1("serialize","setHref")),or1(H,"origin",vr1("getOrigin")),or1(H,"protocol",vr1("getProtocol","setProtocol")),or1(H,"username",vr1("getUsername","setUsername")),or1(H,"password",vr1("getPassword","setPassword")),or1(H,"host",vr1("getHost","setHost")),or1(H,"hostname",vr1("getHostname","setHostname")),or1(H,"port",vr1("getPort","setPort")),or1(H,"pathname",vr1("getPathname","setPathname")),or1(H,"search",vr1("getSearch","setSearch")),or1(H,"searchParams",vr1("getSearchParams")),or1(H,"hash",vr1("getHash","setHash")));Wi1(H,"toJSON",function(){return Vi1(this).serialize()},{enumerable:!0});Wi1(H,"toString",function(){return Vi1(this).serialize()},{enumerable:!0});Jt&&(bv1=Jt.createObjectURL,xv1=Jt.revokeObjectURL,bv1&&Wi1(et,"createObjectURL",RT1(bv1,Jt)),xv1&&Wi1(et,"revokeObjectURL",RT1(xv1,Jt)));var bv1,xv1;_$S8(et,"URL");g81({global:!0,constructor:!0,forced:!y81,sham:!Nv1},{URL:et})});var _$kT=o(function(){"use strict";MT1()});var jT1=o(function(){"use strict";var V81=q(),z81=m();V81({target:"URL",proto:!0,enumerable:!0},{toJSON:function toJSON(){return z81(URL.prototype.toString,this)}})});var c71=p(yf1()),f71=p(Gl1()),l71=p(ch1()),h71=p(lh1()),p71=p(Ah1()),g71=p(Ch1()),y71=p(Bh1()),d71=p(kh1()),q71=p(vp1()),E71=p(cp1()),S71=p(fp()),I71=p(lp1()),R71=p(pp1()),T71=p($p1()),O71=p(Hp1()),m71=p(Zp1()),A71=p(Eg1()),w71=p(Pg1()),_$b7=p(Fg1()),x71=p(Ug1()),C71=p($g1()),P71=p(Hg1()),_71=p(zg1()),N71=p(Jg1()),L71=p(Xg1()),D71=p(Qg1()),F71=p(_$Iy()),U71=p(Ty1()),B71=p(Oy1()),M71=p(my1()),k71=p($y1()),j71=p(td1()),$71=p(ad()),H71=p(Ed1()),G71=p(Od1()),W71=p(Yd1()),V71=p(_$Zd()),z71=p(tq1()),K71=p(nq1()),_$Y7=p(sq1()),J71=p(lq1()),_$X7=p(gq1()),_$Q7=p(yq1()),Z71=p(Gq1()),rz1=p(Kq1()),ez1=p(uE1()),tz1=p(yE1()),az=p(dE1()),iz1=p(OE1()),nz1=p(_E1()),uz=p(_$GE()),oz=p(zE1()),sz=p(_$XE()),vz1=p(ZE1()),cz1=p(jS1()),fz1=p($S1()),lz=p(HS1()),hz1=p(GS1()),pz1=p(WS1()),gz1=p(VS1()),yz1=p(QS1()),dz1=p(iI1()),qz1=p(oI1()),Ez1=p(sI1()),Sz1=p(vI1()),Iz1=p(cI1()),Rz1=p(fI1()),Tz1=p(lI1()),Oz1=p(pI1()),mz1=p(MI1()),Az1=p(KI1()),wz1=p(JI1()),bz1=p(cR1()),xz1=p(pR1()),Cz1=p(qR()),Pz1=p(JR()),_z1=p(XR()),Nz1=p(rT1()),Lz1=p(_$kT()),Dz1=p(jT1())})();"use strict";var IPe=Object.create;var J_=Object.defineProperty;var PPe=Object.getOwnPropertyDescriptor;var RPe=Object.getOwnPropertyNames;var MPe=Object.getPrototypeOf,OPe=Object.prototype.hasOwnProperty;var $Pe=function(e,t,r){return t in e?J_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var Be=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},$l=function(e,t){for(var r in t)J_(e,r,{get:t[r],enumerable:!0})},YK=function(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"||typeof t=="function")try{var _loop=function(){var i=_step.value;!OPe.call(e,i)&&i!==r&&J_(e,i,{get:function(){return t[i]},enumerable:!(n=PPe(t,i))||n.enumerable})};for(var _iterator=RPe(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e};var nr=function(e,t,r){return r=e!=null?IPe(MPe(e)):{},YK(t||!e||!e.__esModule?J_(r,"default",{value:e,enumerable:!0}):r,e)},NPe=function(e){return YK(J_({},"__esModule",{value:!0}),e)};var A=function(e,t,r){return $Pe(e,(typeof t==="undefined"?"undefined":_type_of(t))!="symbol"?t+"":t,r),r},yM=function(e,t,r){if(!t.has(e))throw TypeError("Cannot "+r)};var fe=function(e,t,r){return yM(e,t,"read from private field"),r?r.call(e):t.get(e)},Ht=function(e,t,r){if(t.has(e))throw TypeError("Cannot add the same private member more than once");_instanceof(t,WeakSet)?t.add(e):t.set(e,r)},Zt=function(e,t,r,n){return yM(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r};var Nt=function(e,t,r){return yM(e,t,"access private method"),r};var eQ=Be(function(Y_){var XK=function XK(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[],n=0;n<e.length;n+=3){var i=e[n],o=n+1<e.length,a=o?e[n+1]:0,s=n+2<e.length,l=s?e[n+2]:0,c=i>>2,d=(i&3)<<4|a>>4,u=(a&15)<<2|l>>6,p=l&63;s||(p=64,o||(u=64)),r.push(t[c],t[d],t[u],t[p])}return r.join("")};(function(e){(function(t){typeof define=="function"&&define.amd?define(["exports"],t):(typeof Y_==="undefined"?"undefined":_type_of(Y_))=="object"&&typeof Y_.nodeName!="string"?t(Y_):t(e)})(function(t){"use strict";var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,n=e.URL||e.webkitURL||function(C,T){return T=document.createElement("a"),T.href=C,T},i=e.Blob,o=n.createObjectURL,a=n.revokeObjectURL,s=e.Symbol&&e.Symbol.toStringTag,l=!1,c=!1,d=r&&r.prototype.append&&r.prototype.getBlob;try{l=new Blob(["\xe4"]).size===2,c=new Blob([new Uint8Array([1,2])]).size===2}catch(C){}function u(C){return C.map(function(T){if(_instanceof(T.buffer,ArrayBuffer)){var I=T.buffer;if(T.byteLength!==I.byteLength){var O=new Uint8Array(T.byteLength);O.set(new Uint8Array(I,T.byteOffset,T.byteLength)),I=O.buffer}return I}return T})}function p(C,T){T=T||{};var I=new r;return u(C).forEach(function(O){I.append(O)}),T.type?I.getBlob(T.type):I.getBlob()}function m(C,T){return new i(u(C),T||{})}e.Blob&&(p.prototype=e.Blob.prototype,m.prototype=e.Blob.prototype);function h(C){for(var T=0,I=C.length,O=e.Uint8Array||Array,M=0,R=Math.max(32,I+(I>>1)+7),$=new O(R>>3<<3);T<I;){var z=C.charCodeAt(T++);if(z>=55296&&z<=56319){if(T<I){var D=C.charCodeAt(T);(D&64512)===56320&&(++T,z=((z&1023)<<10)+(D&1023)+65536)}if(z>=55296&&z<=56319)continue}if(M+4>$.length){R+=8,R*=1+T/C.length*2,R=R>>3<<3;var L=new Uint8Array(R);L.set($),$=L}if(z&0xffffff80)if(!(z&0xfffff800))$[M++]=z>>6&31|192;else if(!(z&0xffff0000))$[M++]=z>>12&15|224,$[M++]=z>>6&63|128;else if(!(z&0xffe00000))$[M++]=z>>18&7|240,$[M++]=z>>12&63|128,$[M++]=z>>6&63|128;else continue;else{$[M++]=z;continue}$[M++]=z&63|128}return $.slice(0,M)}function g(C){for(var T=C.length,I=[],O=0;O<T;){var M=C[O],R=null,$=M>239?4:M>223?3:M>191?2:1;if(O+$<=T){var z,D,L,ee;switch($){case 1:M<128&&(R=M);break;case 2:z=C[O+1],(z&192)===128&&(ee=(M&31)<<6|z&63,ee>127&&(R=ee));break;case 3:z=C[O+1],D=C[O+2],(z&192)===128&&(D&192)===128&&(ee=(M&15)<<12|(z&63)<<6|D&63,ee>2047&&(ee<55296||ee>57343)&&(R=ee));break;case 4:z=C[O+1],D=C[O+2],L=C[O+3],(z&192)===128&&(D&192)===128&&(L&192)===128&&(ee=(M&15)<<18|(z&63)<<12|(D&63)<<6|L&63,ee>65535&&ee<1114112&&(R=ee))}}R===null?(R=65533,$=1):R>65535&&(R-=65536,I.push(R>>>10&1023|55296),R=56320|R&1023),I.push(R),O+=$}for(var pe=I.length,N="",U=0;U<pe;)N+=String.fromCharCode.apply(String,I.slice(U,U+=4096));return N}var x=typeof TextEncoder=="function"?TextEncoder.prototype.encode.bind(new TextEncoder):h,v=typeof TextDecoder=="function"?TextDecoder.prototype.decode.bind(new TextDecoder):g;function y(){function C(N){for(var U=new Array(N.byteLength),G=new Uint8Array(N),K=U.length;K--;)U[K]=G[K];return U}var T=Object.create||function(N){function U(){}return U.prototype=N,new U};function I(N){return Object.prototype.toString.call(N).slice(8,-1)}function O(N,U){return(typeof N==="undefined"?"undefined":_type_of(N))=="object"&&Object.prototype.isPrototypeOf.call(N.prototype,U)}function M(N){return I(N)==="DataView"||O(e.DataView,N)}var R=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","ArrayBuffer"];function $(N,U){return N.indexOf(U)!==-1}function z(N){return $(R,I(N))||O(e.ArrayBuffer,N)}function D(N){for(var U=0,G=N.length;G--;)U+=N[G].length;for(var K=new Uint8Array(U),me=0,V=0;V<N.length;V++){var ie=N[V];K.set(ie,me),me+=ie.byteLength||ie.length}return K}function L(N,U){N=N?N.slice():[],U=U==null?{}:U;for(var G=0,K=N.length;G<K;G++){var me=N[G];_instanceof(me,L)?N[G]=me._buffer:typeof me=="string"?N[G]=x(me):M(me)?N[G]=C(me.buffer):z(me)?N[G]=C(me):N[G]=x(String(me))}this._buffer=e.Uint8Array?D(N):[].concat.apply([],N),this.size=this._buffer.length,this.type=U.type||"",/[^\u0020-\u007E]/.test(this.type)?this.type="":this.type=this.type.toLowerCase()}L.isPolyfill=!0,L.prototype.arrayBuffer=function(){return Promise.resolve(this._buffer.buffer||this._buffer)},L.prototype.text=function(){return Promise.resolve(v(this._buffer))},L.prototype.slice=function(N,U,G){var K=this._buffer.slice(N||0,U||this._buffer.length);return new L([K],{type:G})},L.prototype.toString=function(){return"[object Blob]"};function ee(N,U,G){G=G||{};var K=L.call(this,N,G)||this;return K.name=U.replace(/\//g,":"),K.lastModifiedDate=G.lastModified?new Date(G.lastModified):new Date,K.lastModified=+K.lastModifiedDate,K}if(ee.isPolyfill=!0,ee.prototype=T(L.prototype),ee.prototype.constructor=ee,Object.setPrototypeOf)Object.setPrototypeOf(ee,L);else try{ee.__proto__=L}catch(N){}ee.prototype.toString=function(){return"[object File]"},n.createObjectURL=function(N){return _instanceof(N,L)?"data:"+N.type+";base64,"+XK(N._buffer):o.call(n,N)},n.createObjectURL.isPolyfill=!0,n.revokeObjectURL=function(N){a&&a.call(n,N)},n.revokeObjectURL.isPolyfill=!0;var pe=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;pe&&(XMLHttpRequest.prototype.send=function(N){_instanceof(N,L)?(this.setRequestHeader("Content-Type",N.type),pe.call(this,v(N._buffer))):pe.call(this,N)}),t.Blob=L,t.File=ee}function _(){var C=!!e.ActiveXObject||typeof document!="undefined"&&"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,T=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;C&&T&&(XMLHttpRequest.prototype.send=function(I){_instanceof(I,Blob)?(this.setRequestHeader("Content-Type",I.type),T.call(this,I)):T.call(this,I)});try{new File([],""),t.File=e.File}catch(I){try{t.File=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name.replace(/\\//g, ":");this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date();this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')()}catch(O){t.File=function(R,$,z){var D=new Blob(R,z),L=z&&z.lastModified!==void 0?new Date(z.lastModified):new Date;return D.name=$.replace(/\//g,":"),D.lastModifiedDate=L,D.lastModified=+L,D.toString=function(){return"[object File]"},s&&(D[s]="File"),D}}t.File.isPolyfill=!0}}l?(_(),t.Blob=c?e.Blob:m):d?(_(),t.Blob=p):y();function b(){if(!_instanceof(this,b))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var C=document.createDocumentFragment();this.addEventListener=C.addEventListener,this.dispatchEvent=function(T){var I=this["on"+T.type];typeof I=="function"&&I(T),C.dispatchEvent(T)},this.removeEventListener=C.removeEventListener}function w(C,T,I){if(!_instanceof(T,t.Blob))throw new TypeError("Failed to execute '"+I+"' on 'FileReader': parameter 1 is not of type 'Blob'.");C.result="",setTimeout(function(){this.readyState=b.LOADING,C.dispatchEvent(new Event("load")),C.dispatchEvent(new Event("loadend"))})}b.EMPTY=0,b.LOADING=1,b.DONE=2,b.prototype.error=null,b.prototype.onabort=null,b.prototype.onerror=null,b.prototype.onload=null,b.prototype.onloadend=null,b.prototype.onloadstart=null,b.prototype.onprogress=null,b.prototype.readAsDataURL=function(C){w(this,C,"readAsDataURL"),this.result="data:"+C.type+";base64,"+XK(C._buffer)},b.prototype.readAsText=function(C){w(this,C,"readAsText"),this.result=v(C._buffer)},b.prototype.readAsArrayBuffer=function(C){w(this,C,"readAsText"),this.result=(C._buffer.buffer||C._buffer).slice()},b.prototype.abort=function(){},t.FileReader=e.FileReader||b,t.URL=e.URL||n,s&&(t.File.prototype[s]||(t.File.prototype[s]="File"),t.Blob.prototype[s]||(t.Blob.prototype[s]="Blob"),t.FileReader.prototype[s]||(t.FileReader.prototype[s]="FileReader"));var S=t.Blob.prototype,k;try{new ReadableStream({type:"bytes"}),k=function k(){var T=0,I=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:524288,pull:function pull(O){var M=O.byobRequest.view,R=I.slice(T,T+M.byteLength);return R.arrayBuffer().then(function($){var z=new Uint8Array($),D=z.byteLength;T+=D,M.set(z),O.byobRequest.respond(D),T>=I.size&&O.close()})}})}}catch(C){try{new ReadableStream({}),k=function k(I){var O=0;return new ReadableStream({pull:function pull(M){var R=I.slice(O,O+524288);return R.arrayBuffer().then(function($){O+=$.byteLength;var z=new Uint8Array($);M.enqueue(z),O==I.size&&M.close()})}})}}catch(T){try{new Response("").body.getReader().read(),k=function k(){return new Response(this).body}}catch(I){k=function k(){throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill")}}}}function E(C){return new Promise(function(T,I){C.onload=C.onerror=function(O){C.onload=C.onerror=null,O.type==="load"?T(C.result||C):I(new Error("Failed to read the blob/file"))}})}S.arrayBuffer||(S.arrayBuffer=function(){var T=new t.FileReader;return T.readAsArrayBuffer(this),E(T)}),S.text||(S.text=function(){var T=new t.FileReader;return T.readAsText(this),E(T)}),S.stream||(S.stream=k)})})(typeof self!="undefined"&&self||typeof window!="undefined"&&window||typeof global!="undefined"&&global||Y_)});var rQ=Be(function(q1){"use strict";Object.defineProperty(q1,"__esModule",{value:!0});q1.reasonPhraseToStatusCode=q1.statusCodeToReasonPhrase=void 0;q1.statusCodeToReasonPhrase={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",103:"Early Hints",426:"Upgrade Required",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"};q1.reasonPhraseToStatusCode={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Early Hints":103,"Upgrade Required":426,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421}});var oQ=Be(function(tm){"use strict";var iQ=function iQ(e){var t=nQ.statusCodeToReasonPhrase[e.toString()];if(!t)throw new Error("Status code does not exist: "+e);return t};var DPe=function DPe(e){var t=nQ.reasonPhraseToStatusCode[e];if(!t)throw new Error("Reason phrase does not exist: "+e);return t};Object.defineProperty(tm,"__esModule",{value:!0});tm.getStatusText=tm.getStatusCode=tm.getReasonPhrase=void 0;var nQ=rQ();tm.getReasonPhrase=iQ;tm.getStatusCode=DPe;tm.getStatusText=iQ});var ln=Be(function(DHt,Ste){"use strict";var Td=function Td(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))};var wte=function wte(e,t){for(var r="",n=0,i=-1,o=0,a,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,o=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,o=0}else a===46&&o!==-1?++o:o=-1}return r};var dUe=function dUe(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n};var Rx={resolve:function resolve(){for(var t="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var o;i>=0?o=arguments[i]:(n===void 0&&(n=process.cwd()),o=n),Td(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=wte(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function normalize(t){if(Td(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=wte(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function isAbsolute(t){return Td(t),t.length>0&&t.charCodeAt(0)===47},join:function join(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];Td(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":Rx.normalize(t)},relative:function relative(t,r){if(Td(t),Td(r),t===r||(t=Rx.resolve(t),r=Rx.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var i=t.length,o=i-n,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var s=r.length,l=s-a,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(r.charCodeAt(a+u)===47)return r.slice(a+u+1);if(u===0)return r.slice(a+u)}else o>c&&(t.charCodeAt(n+u)===47?d=u:u===0&&(d=0));break}var p=t.charCodeAt(n+u),m=r.charCodeAt(a+u);if(p!==m)break;p===47&&(d=u)}var h="";for(u=n+d+1;u<=i;++u)(u===i||t.charCodeAt(u)===47)&&(h.length===0?h+="..":h+="/..");return h.length>0?h+r.slice(a+d):(a+=d,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function _makeLong(t){return t},dirname:function dirname(t){if(Td(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,i=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){i=a;break}}else o=!1;return i===-1?n?"/":".":n&&i===1?"//":t.slice(0,i)},basename:function basename(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Td(t);var n=0,i=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,l=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!o){n=a+1;break}}else l===-1&&(o=!1,l=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(i=a):(s=-1,i=l))}return n===i?i=l:i===-1&&(i=t.length),t.slice(n,i)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){n=a+1;break}}else i===-1&&(o=!1,i=a+1);return i===-1?"":t.slice(n,i)}},extname:function extname(t){Td(t);for(var r=-1,n=0,i=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!o){n=s+1;break}continue}i===-1&&(o=!1,i=s+1),l===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||i===-1||a===0||a===1&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function format(t){if(t===null||(typeof t==="undefined"?"undefined":_type_of(t))!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+(typeof t==="undefined"?"undefined":_type_of(t)));return dUe("/",t)},parse:function parse(t){Td(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),i=n===47,o;i?(r.root="/",o=1):o=0;for(var a=-1,s=0,l=-1,c=!0,d=t.length-1,u=0;d>=o;--d){if(n=t.charCodeAt(d),n===47){if(!c){s=d+1;break}continue}l===-1&&(c=!1,l=d+1),n===46?a===-1?a=d:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||l===-1||u===0||u===1&&a===l-1&&a===s+1?l!==-1&&(s===0&&i?r.base=r.name=t.slice(1,l):r.base=r.name=t.slice(s,l)):(s===0&&i?(r.name=t.slice(1,a),r.base=t.slice(1,l)):(r.name=t.slice(s,a),r.base=t.slice(s,l)),r.ext=t.slice(a,l)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Rx.posix=Rx;Ste.exports=Rx});var Tte=Be(function(Ete,e$){(function(e){if((typeof Ete==="undefined"?"undefined":_type_of(Ete))=="object"&&typeof e$!="undefined")e$.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return(function n(i,o,a){function s(d,u){if(!o[d]){if(!i[d]){var p=typeof require=="function"&&require;if(!u&&p)return p(d,!0);if(l)return l(d,!0);var m=new Error("Cannot find module '"+d+"'");throw m.code="MODULE_NOT_FOUND",m}var h=o[d]={exports:{}};i[d][0].call(h.exports,function(g){var x=i[d][1][g];return s(x||g)},h,h.exports,n,i,o,a)}return o[d].exports}for(var l=typeof require=="function"&&require,c=0;c<a.length;c++)s(a[c]);return s})({1:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&_type_of(Symbol.iterator)=="symbol"?function a(B){return typeof B==="undefined"?"undefined":_type_of(B)}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B==="undefined"?"undefined":_type_of(B)};function s(B,ae){if(!_instanceof(B,ae))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(B){return}}var c=l();function d(){try{if(!c||!c.open)return!1;var B=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),ae=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!B||ae)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(Z){return!1}}function u(B,ae){B=B||[],ae=ae||{};try{return new Blob(B,ae)}catch(ge){if(ge.name!=="TypeError")throw ge;for(var Z=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,ve=new Z,be=0;be<B.length;be+=1)ve.append(B[be]);return ve.getBlob(ae.type)}}typeof Promise=="undefined"&&n("lie/polyfill");var p=Promise;function m(B,ae){ae&&B.then(function(Z){ae(null,Z)},function(Z){ae(Z)})}function h(B,ae,Z){typeof ae=="function"&&B.then(ae),typeof Z=="function"&&B.catch(Z)}function g(B){return typeof B!="string"&&(console.warn(B+" used as a key, but it is not a string."),B=String(B)),B}function x(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var v="local-forage-detect-blob-support",y=void 0,_={},b=Object.prototype.toString,w="readonly",S="readwrite";function k(B){for(var ae=B.length,Z=new ArrayBuffer(ae),ve=new Uint8Array(Z),be=0;be<ae;be++)ve[be]=B.charCodeAt(be);return Z}function E(B){return new p(function(ae){var Z=B.transaction(v,S),ve=u([""]);Z.objectStore(v).put(ve,"key"),Z.onabort=function(be){be.preventDefault(),be.stopPropagation(),ae(!1)},Z.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),ge=navigator.userAgent.match(/Edge\//);ae(ge||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function C(B){return typeof y=="boolean"?p.resolve(y):E(B).then(function(ae){return y=ae,y})}function T(B){var ae=_[B.name],Z={};Z.promise=new p(function(ve,be){Z.resolve=ve,Z.reject=be}),ae.deferredOperations.push(Z),ae.dbReady?ae.dbReady=ae.dbReady.then(function(){return Z.promise}):ae.dbReady=Z.promise}function I(B){var ae=_[B.name],Z=ae.deferredOperations.pop();if(Z)return Z.resolve(),Z.promise}function O(B,ae){var Z=_[B.name],ve=Z.deferredOperations.pop();if(ve)return ve.reject(ae),ve.promise}function M(B,ae){return new p(function(Z,ve){if(_[B.name]=_[B.name]||G(),B.db)if(ae)T(B),B.db.close();else return Z(B.db);var be=[B.name];ae&&be.push(B.version);var ge=c.open.apply(c,be);ae&&(ge.onupgradeneeded=function(ye){var Re=ge.result;try{Re.createObjectStore(B.storeName),ye.oldVersion<=1&&Re.createObjectStore(v)}catch(ze){if(ze.name==="ConstraintError")console.warn('The database "'+B.name+'" has been upgraded from version '+ye.oldVersion+" to version "+ye.newVersion+', but the storage "'+B.storeName+'" already exists.');else throw ze}}),ge.onerror=function(ye){ye.preventDefault(),ve(ge.error)},ge.onsuccess=function(){var ye=ge.result;ye.onversionchange=function(Re){Re.target.close()},Z(ye),I(B)}})}function R(B){return M(B,!1)}function $(B){return M(B,!0)}function z(B,ae){if(!B.db)return!0;var Z=!B.db.objectStoreNames.contains(B.storeName),ve=B.version<B.db.version,be=B.version>B.db.version;if(ve&&(B.version!==ae&&console.warn('The database "'+B.name+"\" can't be downgraded from version "+B.db.version+" to version "+B.version+"."),B.version=B.db.version),be||Z){if(Z){var ge=B.db.version+1;ge>B.version&&(B.version=ge)}return!0}return!1}function D(B){return new p(function(ae,Z){var ve=new FileReader;ve.onerror=Z,ve.onloadend=function(be){var ge=btoa(be.target.result||"");ae({__local_forage_encoded_blob:!0,data:ge,type:B.type})},ve.readAsBinaryString(B)})}function L(B){var ae=k(atob(B.data));return u([ae],{type:B.type})}function ee(B){return B&&B.__local_forage_encoded_blob}function pe(B){var ae=this,Z=ae._initReady().then(function(){var ve=_[ae._dbInfo.name];if(ve&&ve.dbReady)return ve.dbReady});return h(Z,B,B),Z}function N(B){T(B);for(var ae=_[B.name],Z=ae.forages,ve=0;ve<Z.length;ve++){var be=Z[ve];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return B.db=null,R(B).then(function(ge){return B.db=ge,z(B)?$(B):ge}).then(function(ge){B.db=ae.db=ge;for(var ye=0;ye<Z.length;ye++)Z[ye]._dbInfo.db=ge}).catch(function(ge){throw O(B,ge),ge})}function U(B,ae,Z,ve){ve===void 0&&(ve=1);try{var be=B.db.transaction(B.storeName,ae);Z(null,be)}catch(ge){if(ve>0&&(!B.db||ge.name==="InvalidStateError"||ge.name==="NotFoundError"))return p.resolve().then(function(){if(!B.db||ge.name==="NotFoundError"&&!B.db.objectStoreNames.contains(B.storeName)&&B.version<=B.db.version)return B.db&&(B.version=B.db.version+1),$(B)}).then(function(){return N(B).then(function(){U(B,ae,Z,ve-1)})}).catch(Z);Z(ge)}}function G(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function K(B){var ae=this,Z={db:null};if(B)for(var ve in B)Z[ve]=B[ve];var be=_[Z.name];be||(be=G(),_[Z.name]=be),be.forages.push(ae),ae._initReady||(ae._initReady=ae.ready,ae.ready=pe);var ge=[];function ye(){return p.resolve()}for(var Re=0;Re<be.forages.length;Re++){var ze=be.forages[Re];ze!==ae&&ge.push(ze._initReady().catch(ye))}var Ue=be.forages.slice(0);return p.all(ge).then(function(){return Z.db=be.db,R(Z)}).then(function(Ge){return Z.db=Ge,z(Z,ae._defaultConfig.version)?$(Z):Ge}).then(function(Ge){Z.db=be.db=Ge,ae._dbInfo=Z;for(var Tt=0;Tt<Ue.length;Tt++){var kt=Ue[Tt];kt!==ae&&(kt._dbInfo.db=Z.db,kt._dbInfo.version=Z.version)}})}function me(B,ae){var Z=this;B=g(B);var ve=new p(function(be,ge){Z.ready().then(function(){U(Z._dbInfo,w,function(ye,Re){if(ye)return ge(ye);try{var ze=Re.objectStore(Z._dbInfo.storeName),Ue=ze.get(B);Ue.onsuccess=function(){var _$Ge=Ue.result;_$Ge===void 0&&(_$Ge=null),ee(_$Ge)&&(_$Ge=L(_$Ge)),be(_$Ge)},Ue.onerror=function(){ge(Ue.error)}}catch(Ge){ge(Ge)}})}).catch(ge)});return m(ve,ae),ve}function V(B,ae){var Z=this,ve=new p(function(be,ge){Z.ready().then(function(){U(Z._dbInfo,w,function(ye,Re){if(ye)return ge(ye);try{var ze=Re.objectStore(Z._dbInfo.storeName),Ue=ze.openCursor(),Ge=1;Ue.onsuccess=function(){var _$Tt=Ue.result;if(_$Tt){var kt=_$Tt.value;ee(kt)&&(kt=L(kt));var Hr=B(kt,_$Tt.key,Ge++);Hr!==void 0?be(Hr):_$Tt.continue()}else be()},Ue.onerror=function(){ge(Ue.error)}}catch(Tt){ge(Tt)}})}).catch(ge)});return m(ve,ae),ve}function ie(B,ae,Z){var ve=this;B=g(B);var be=new p(function(ge,ye){var Re;ve.ready().then(function(){return Re=ve._dbInfo,b.call(ae)==="[object Blob]"?C(Re.db).then(function(ze){return ze?ae:D(ae)}):ae}).then(function(ze){U(ve._dbInfo,S,function(Ue,Ge){if(Ue)return ye(Ue);try{var Tt=Ge.objectStore(ve._dbInfo.storeName);ze===null&&(ze=void 0);var kt=Tt.put(ze,B);Ge.oncomplete=function(){ze===void 0&&(ze=null),ge(ze)},Ge.onabort=Ge.onerror=function(){var _$Hr=kt.error?kt.error:kt.transaction.error;ye(_$Hr)}}catch(Hr){ye(Hr)}})}).catch(ye)});return m(be,Z),be}function re(B,ae){var Z=this;B=g(B);var ve=new p(function(be,ge){Z.ready().then(function(){U(Z._dbInfo,S,function(ye,Re){if(ye)return ge(ye);try{var ze=Re.objectStore(Z._dbInfo.storeName),Ue=ze.delete(B);Re.oncomplete=function(){be()},Re.onerror=function(){ge(Ue.error)},Re.onabort=function(){var _$Ge=Ue.error?Ue.error:Ue.transaction.error;ge(_$Ge)}}catch(Ge){ge(Ge)}})}).catch(ge)});return m(ve,ae),ve}function de(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){U(ae._dbInfo,S,function(ge,ye){if(ge)return be(ge);try{var Re=ye.objectStore(ae._dbInfo.storeName),ze=Re.clear();ye.oncomplete=function(){ve()},ye.onabort=ye.onerror=function(){var _$Ue=ze.error?ze.error:ze.transaction.error;be(_$Ue)}}catch(Ue){be(Ue)}})}).catch(be)});return m(Z,B),Z}function xe(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){U(ae._dbInfo,w,function(ge,ye){if(ge)return be(ge);try{var Re=ye.objectStore(ae._dbInfo.storeName),ze=Re.count();ze.onsuccess=function(){ve(ze.result)},ze.onerror=function(){be(ze.error)}}catch(Ue){be(Ue)}})}).catch(be)});return m(Z,B),Z}function Y(B,ae){var Z=this,ve=new p(function(be,ge){if(B<0){be(null);return}Z.ready().then(function(){U(Z._dbInfo,w,function(ye,Re){if(ye)return ge(ye);try{var ze=Re.objectStore(Z._dbInfo.storeName),Ue=!1,Ge=ze.openKeyCursor();Ge.onsuccess=function(){var _$Tt=Ge.result;if(!_$Tt){be(null);return}B===0||Ue?be(_$Tt.key):(Ue=!0,_$Tt.advance(B))},Ge.onerror=function(){ge(Ge.error)}}catch(Tt){ge(Tt)}})}).catch(ge)});return m(ve,ae),ve}function oe(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){U(ae._dbInfo,w,function(ge,ye){if(ge)return be(ge);try{var Re=ye.objectStore(ae._dbInfo.storeName),ze=Re.openKeyCursor(),Ue=[];ze.onsuccess=function(){var _$Ge=ze.result;if(!_$Ge){ve(Ue);return}Ue.push(_$Ge.key),_$Ge.continue()},ze.onerror=function(){be(ze.error)}}catch(Ge){be(Ge)}})}).catch(be)});return m(Z,B),Z}function H(B,ae){ae=x.apply(this,arguments);var Z=this.config();B=typeof B!="function"&&B||{},B.name||(B.name=B.name||Z.name,B.storeName=B.storeName||Z.storeName);var ve=this,be;if(!B.name)be=p.reject("Invalid arguments");else{var ge=B.name===Z.name&&ve._dbInfo.db,ye=ge?p.resolve(ve._dbInfo.db):R(B).then(function(Re){var ze=_[B.name],Ue=ze.forages;ze.db=Re;for(var Ge=0;Ge<Ue.length;Ge++)Ue[Ge]._dbInfo.db=Re;return Re});B.storeName?be=ye.then(function(Re){if(Re.objectStoreNames.contains(B.storeName)){var ze=Re.version+1;T(B);var Ue=_[B.name],Ge=Ue.forages;Re.close();for(var Tt=0;Tt<Ge.length;Tt++){var kt=Ge[Tt];kt._dbInfo.db=null,kt._dbInfo.version=ze}var Hr=new p(function(ar,Cn){var On=c.open(B.name,ze);On.onerror=function(Fi){var Us=On.result;Us.close(),Cn(Fi)},On.onupgradeneeded=function(){var Fi=On.result;Fi.deleteObjectStore(B.storeName)},On.onsuccess=function(){var Fi=On.result;Fi.close(),ar(Fi)}});return Hr.then(function(ar){Ue.db=ar;for(var Cn=0;Cn<Ge.length;Cn++){var On=Ge[Cn];On._dbInfo.db=ar,I(On._dbInfo)}}).catch(function(ar){throw(O(B,ar)||p.resolve()).catch(function(){}),ar})}}):be=ye.then(function(Re){T(B);var ze=_[B.name],Ue=ze.forages;Re.close();for(var Ge=0;Ge<Ue.length;Ge++){var Tt=Ue[Ge];Tt._dbInfo.db=null}var kt=new p(function(Hr,ar){var Cn=c.deleteDatabase(B.name);Cn.onerror=function(){var On=Cn.result;On&&On.close(),ar(Cn.error)},Cn.onblocked=function(){console.warn('dropInstance blocked for database "'+B.name+'" until all open connections are closed')},Cn.onsuccess=function(){var On=Cn.result;On&&On.close(),Hr(On)}});return kt.then(function(Hr){ze.db=Hr;for(var ar=0;ar<Ue.length;ar++){var Cn=Ue[ar];I(Cn._dbInfo)}}).catch(function(Hr){throw(O(B,Hr)||p.resolve()).catch(function(){}),Hr})})}return m(be,ae),be}var J={_driver:"asyncStorage",_initStorage:K,_support:d(),iterate:V,getItem:me,setItem:ie,removeItem:re,clear:de,length:xe,key:Y,keys:oe,dropInstance:H};function j(){return typeof openDatabase=="function"}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe="~~local_forage_type~",it=/^~~local_forage_type~([^~]+)~/,pt="__lfsc__:",nt=pt.length,gt="arbf",Ie="blob",we="si08",Oe="ui08",Pe="uic8",tt="si16",We="si32",Ut="ur16",Rt="ui32",Ve="fl32",Tr="fl64",yn=nt+gt.length,Di=Object.prototype.toString;function Rn(B){var ae=B.length*.75,Z=B.length,ve,be=0,ge,ye,Re,ze;B[B.length-1]==="="&&(ae--,B[B.length-2]==="="&&ae--);var Ue=new ArrayBuffer(ae),Ge=new Uint8Array(Ue);for(ve=0;ve<Z;ve+=4)ge=Q.indexOf(B[ve]),ye=Q.indexOf(B[ve+1]),Re=Q.indexOf(B[ve+2]),ze=Q.indexOf(B[ve+3]),Ge[be++]=ge<<2|ye>>4,Ge[be++]=(ye&15)<<4|Re>>2,Ge[be++]=(Re&3)<<6|ze&63;return Ue}function Uo(B){var ae=new Uint8Array(B),Z="",ve;for(ve=0;ve<ae.length;ve+=3)Z+=Q[ae[ve]>>2],Z+=Q[(ae[ve]&3)<<4|ae[ve+1]>>4],Z+=Q[(ae[ve+1]&15)<<2|ae[ve+2]>>6],Z+=Q[ae[ve+2]&63];return ae.length%3===2?Z=Z.substring(0,Z.length-1)+"=":ae.length%3===1&&(Z=Z.substring(0,Z.length-2)+"=="),Z}function Ea(B,ae){var Z="";if(B&&(Z=Di.call(B)),B&&(Z==="[object ArrayBuffer]"||B.buffer&&Di.call(B.buffer)==="[object ArrayBuffer]")){var ve,be=pt;_instanceof(B,ArrayBuffer)?(ve=B,be+=gt):(ve=B.buffer,Z==="[object Int8Array]"?be+=we:Z==="[object Uint8Array]"?be+=Oe:Z==="[object Uint8ClampedArray]"?be+=Pe:Z==="[object Int16Array]"?be+=tt:Z==="[object Uint16Array]"?be+=Ut:Z==="[object Int32Array]"?be+=We:Z==="[object Uint32Array]"?be+=Rt:Z==="[object Float32Array]"?be+=Ve:Z==="[object Float64Array]"?be+=Tr:ae(new Error("Failed to get type for BinaryArray"))),ae(be+Uo(ve))}else if(Z==="[object Blob]"){var ge=new FileReader;ge.onload=function(){var _$ye=Fe+B.type+"~"+Uo(this.result);ae(pt+Ie+_$ye)},ge.readAsArrayBuffer(B)}else try{ae(JSON.stringify(B))}catch(ye){console.error("Couldn't convert value into a JSON string: ",B),ae(null,ye)}}function Nn(B){if(B.substring(0,nt)!==pt)return JSON.parse(B);var ae=B.substring(yn),Z=B.substring(nt,yn),ve;if(Z===Ie&&it.test(ae)){var be=ae.match(it);ve=be[1],ae=ae.substring(be[0].length)}var ge=Rn(ae);switch(Z){case gt:return ge;case Ie:return u([ge],{type:ve});case we:return new Int8Array(ge);case Oe:return new Uint8Array(ge);case Pe:return new Uint8ClampedArray(ge);case tt:return new Int16Array(ge);case Ut:return new Uint16Array(ge);case We:return new Int32Array(ge);case Rt:return new Uint32Array(ge);case Ve:return new Float32Array(ge);case Tr:return new Float64Array(ge);default:throw new Error("Unkown type: "+Z)}}var Ar={serialize:Ea,deserialize:Nn,stringToBuffer:Rn,bufferToString:Uo};function q(B,ae,Z,ve){B.executeSql("CREATE TABLE IF NOT EXISTS "+ae.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Z,ve)}function Ee(B){var ae=this,Z={db:null};if(B)for(var ve in B)Z[ve]=typeof B[ve]!="string"?B[ve].toString():B[ve];var be=new p(function(ge,ye){try{Z.db=openDatabase(Z.name,String(Z.version),Z.description,Z.size)}catch(Re){return ye(Re)}Z.db.transaction(function(Re){q(Re,Z,function(){ae._dbInfo=Z,ge()},function(ze,Ue){ye(Ue)})},ye)});return Z.serializer=Ar,be}function Mt(B,ae,Z,ve,be,ge){B.executeSql(Z,ve,be,function(ye,Re){Re.code===Re.SYNTAX_ERR?ye.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ae.storeName],function(ze,Ue){Ue.rows.length?ge(ze,Re):q(ze,ae,function(){ze.executeSql(Z,ve,be,ge)},ge)},ge):ge(ye,Re)},ge)}function xr(B,ae){var Z=this;B=g(B);var ve=new p(function(be,ge){Z.ready().then(function(){var ye=Z._dbInfo;ye.db.transaction(function(Re){Mt(Re,ye,"SELECT * FROM "+ye.storeName+" WHERE key = ? LIMIT 1",[B],function(ze,Ue){var Ge=Ue.rows.length?Ue.rows.item(0).value:null;Ge&&(Ge=ye.serializer.deserialize(Ge)),be(Ge)},function(ze,Ue){ge(Ue)})})}).catch(ge)});return m(ve,ae),ve}function Yr(B,ae){var Z=this,ve=new p(function(be,ge){Z.ready().then(function(){var ye=Z._dbInfo;ye.db.transaction(function(Re){Mt(Re,ye,"SELECT * FROM "+ye.storeName,[],function(ze,Ue){for(var Ge=Ue.rows,Tt=Ge.length,kt=0;kt<Tt;kt++){var Hr=Ge.item(kt),ar=Hr.value;if(ar&&(ar=ye.serializer.deserialize(ar)),ar=B(ar,Hr.key,kt+1),ar!==void 0){be(ar);return}}be()},function(ze,Ue){ge(Ue)})})}).catch(ge)});return m(ve,ae),ve}function Bo(B,ae,Z,ve){var be=this;B=g(B);var ge=new p(function(ye,Re){be.ready().then(function(){ae===void 0&&(ae=null);var ze=ae,Ue=be._dbInfo;Ue.serializer.serialize(ae,function(Ge,Tt){Tt?Re(Tt):Ue.db.transaction(function(kt){Mt(kt,Ue,"INSERT OR REPLACE INTO "+Ue.storeName+" (key, value) VALUES (?, ?)",[B,Ge],function(){ye(ze)},function(Hr,ar){Re(ar)})},function(kt){if(kt.code===kt.QUOTA_ERR){if(ve>0){ye(Bo.apply(be,[B,ze,Z,ve-1]));return}Re(kt)}})})}).catch(Re)});return m(ge,Z),ge}function mu(B,ae,Z){return Bo.apply(this,[B,ae,Z,1])}function xt(B,ae){var Z=this;B=g(B);var ve=new p(function(be,ge){Z.ready().then(function(){var ye=Z._dbInfo;ye.db.transaction(function(Re){Mt(Re,ye,"DELETE FROM "+ye.storeName+" WHERE key = ?",[B],function(){be()},function(ze,Ue){ge(Ue)})})}).catch(ge)});return m(ve,ae),ve}function Xr(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){var ge=ae._dbInfo;ge.db.transaction(function(ye){Mt(ye,ge,"DELETE FROM "+ge.storeName,[],function(){ve()},function(Re,ze){be(ze)})})}).catch(be)});return m(Z,B),Z}function zs(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){var ge=ae._dbInfo;ge.db.transaction(function(ye){Mt(ye,ge,"SELECT COUNT(key) as c FROM "+ge.storeName,[],function(Re,ze){var Ue=ze.rows.item(0).c;ve(Ue)},function(Re,ze){be(ze)})})}).catch(be)});return m(Z,B),Z}function pd(B,ae){var Z=this,ve=new p(function(be,ge){Z.ready().then(function(){var ye=Z._dbInfo;ye.db.transaction(function(Re){Mt(Re,ye,"SELECT key FROM "+ye.storeName+" WHERE id = ? LIMIT 1",[B+1],function(ze,Ue){var Ge=Ue.rows.length?Ue.rows.item(0).key:null;be(Ge)},function(ze,Ue){ge(Ue)})})}).catch(ge)});return m(ve,ae),ve}function mc(B){var ae=this,Z=new p(function(ve,be){ae.ready().then(function(){var ge=ae._dbInfo;ge.db.transaction(function(ye){Mt(ye,ge,"SELECT key FROM "+ge.storeName,[],function(Re,ze){for(var Ue=[],Ge=0;Ge<ze.rows.length;Ge++)Ue.push(ze.rows.item(Ge).key);ve(Ue)},function(Re,ze){be(ze)})})}).catch(be)});return m(Z,B),Z}function ca(B){return new p(function(ae,Z){B.transaction(function(ve){ve.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,ge){for(var ye=[],Re=0;Re<ge.rows.length;Re++)ye.push(ge.rows.item(Re).name);ae({db:B,storeNames:ye})},function(be,ge){Z(ge)})},function(ve){Z(ve)})})}function Mn(B,ae){ae=x.apply(this,arguments);var Z=this.config();B=typeof B!="function"&&B||{},B.name||(B.name=B.name||Z.name,B.storeName=B.storeName||Z.storeName);var ve=this,be;return B.name?be=new p(function(ge){var ye;B.name===Z.name?ye=ve._dbInfo.db:ye=openDatabase(B.name,"","",0),B.storeName?ge({db:ye,storeNames:[B.storeName]}):ge(ca(ye))}).then(function(ge){return new p(function(ye,Re){ge.db.transaction(function(ze){function Ue(Hr){return new p(function(ar,Cn){ze.executeSql("DROP TABLE IF EXISTS "+Hr,[],function(){ar()},function(On,Fi){Cn(Fi)})})}for(var Ge=[],Tt=0,kt=ge.storeNames.length;Tt<kt;Tt++)Ge.push(Ue(ge.storeNames[Tt]));p.all(Ge).then(function(){ye()}).catch(function(Hr){Re(Hr)})},function(ze){Re(ze)})})}):be=p.reject("Invalid arguments"),m(be,ae),be}var Ta={_driver:"webSQLStorage",_initStorage:Ee,_support:j(),iterate:Yr,getItem:xr,setItem:mu,removeItem:xt,clear:Xr,length:zs,key:pd,keys:mc,dropInstance:Mn};function Br(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(B){return!1}}function Ga(B,ae){var Z=B.name+"/";return B.storeName!==ae.storeName&&(Z+=B.storeName+"/"),Z}function qo(){var B="_localforage_support_test";try{return localStorage.setItem(B,!0),localStorage.removeItem(B),!1}catch(ae){return!0}}function bn(){return!qo()||localStorage.length>0}function Ii(B){var ae=this,Z={};if(B)for(var ve in B)Z[ve]=B[ve];return Z.keyPrefix=Ga(B,ae._defaultConfig),bn()?(ae._dbInfo=Z,Z.serializer=Ar,p.resolve()):p.reject()}function da(B){var ae=this,Z=ae.ready().then(function(){for(var ve=ae._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var ge=localStorage.key(be);ge.indexOf(ve)===0&&localStorage.removeItem(ge)}});return m(Z,B),Z}function Zn(B,ae){var Z=this;B=g(B);var ve=Z.ready().then(function(){var be=Z._dbInfo,ge=localStorage.getItem(be.keyPrefix+B);return ge&&(ge=be.serializer.deserialize(ge)),ge});return m(ve,ae),ve}function fi(B,ae){var Z=this,ve=Z.ready().then(function(){for(var be=Z._dbInfo,ge=be.keyPrefix,ye=ge.length,Re=localStorage.length,ze=1,Ue=0;Ue<Re;Ue++){var Ge=localStorage.key(Ue);if(Ge.indexOf(ge)===0){var Tt=localStorage.getItem(Ge);if(Tt&&(Tt=be.serializer.deserialize(Tt)),Tt=B(Tt,Ge.substring(ye),ze++),Tt!==void 0)return Tt}}});return m(ve,ae),ve}function fd(B,ae){var Z=this,ve=Z.ready().then(function(){var be=Z._dbInfo,ge;try{ge=localStorage.key(B)}catch(ye){ge=null}return ge&&(ge=ge.substring(be.keyPrefix.length)),ge});return m(ve,ae),ve}function Kf(B){var ae=this,Z=ae.ready().then(function(){for(var ve=ae._dbInfo,be=localStorage.length,ge=[],ye=0;ye<be;ye++){var Re=localStorage.key(ye);Re.indexOf(ve.keyPrefix)===0&&ge.push(Re.substring(ve.keyPrefix.length))}return ge});return m(Z,B),Z}function Qf(B){var ae=this,Z=ae.keys().then(function(ve){return ve.length});return m(Z,B),Z}function Jf(B,ae){var Z=this;B=g(B);var ve=Z.ready().then(function(){var be=Z._dbInfo;localStorage.removeItem(be.keyPrefix+B)});return m(ve,ae),ve}function ue(B,ae,Z){var ve=this;B=g(B);var be=ve.ready().then(function(){ae===void 0&&(ae=null);var ge=ae;return new p(function(ye,Re){var ze=ve._dbInfo;ze.serializer.serialize(ae,function(Ue,Ge){if(Ge)Re(Ge);else try{localStorage.setItem(ze.keyPrefix+B,Ue),ye(ge)}catch(Tt){(Tt.name==="QuotaExceededError"||Tt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Re(Tt),Re(Tt)}})})});return m(be,Z),be}function De(B,ae){if(ae=x.apply(this,arguments),B=typeof B!="function"&&B||{},!B.name){var Z=this.config();B.name=B.name||Z.name,B.storeName=B.storeName||Z.storeName}var ve=this,be;return B.name?be=new p(function(ge){B.storeName?ge(Ga(B,ve._defaultConfig)):ge(B.name+"/")}).then(function(ge){for(var ye=localStorage.length-1;ye>=0;ye--){var Re=localStorage.key(ye);Re.indexOf(ge)===0&&localStorage.removeItem(Re)}}):be=p.reject("Invalid arguments"),m(be,ae),be}var at={_driver:"localStorageWrapper",_initStorage:Ii,_support:Br(),iterate:fi,getItem:Zn,setItem:ue,removeItem:Jf,clear:da,length:Qf,key:fd,keys:Kf,dropInstance:De},Jt=function Jt(ae,Z){return ae===Z||typeof ae=="number"&&typeof Z=="number"&&isNaN(ae)&&isNaN(Z)},bi=function bi(ae,Z){for(var ve=ae.length,be=0;be<ve;){if(Jt(ae[be],Z))return!0;be++}return!1},ko=Array.isArray||function(B){return Object.prototype.toString.call(B)==="[object Array]"},js={},hu={},rr={INDEXEDDB:J,WEBSQL:Ta,LOCALSTORAGE:at},Li=[rr.INDEXEDDB._driver,rr.WEBSQL._driver,rr.LOCALSTORAGE._driver],sn=["dropInstance"],Co=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(sn),gu={description:"",driver:Li.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function xu(B,ae){B[ae]=function(){var Z=arguments;return B.ready().then(function(){return B[ae].apply(B,Z)})}}function Cr(){for(var B=1;B<arguments.length;B++){var ae=arguments[B];if(ae)for(var Z in ae)ae.hasOwnProperty(Z)&&(ko(ae[Z])?arguments[0][Z]=ae[Z].slice():arguments[0][Z]=ae[Z])}return arguments[0]}var Ml=function(){function B(ae){s(this,B);for(var Z in rr)if(rr.hasOwnProperty(Z)){var ve=rr[Z],be=ve._driver;this[Z]=be,js[be]||this.defineDriver(ve)}this._defaultConfig=Cr({},gu),this._config=Cr({},this._defaultConfig,ae),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return B.prototype.config=function(Z){if((typeof Z=="undefined"?"undefined":a(Z))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ve in Z){if(ve==="storeName"&&(Z[ve]=Z[ve].replace(/\W/g,"_")),ve==="version"&&typeof Z[ve]!="number")return new Error("Database version must be a number.");this._config[ve]=Z[ve]}return"driver"in Z&&Z.driver?this.setDriver(this._config.driver):!0}else return typeof Z=="string"?this._config[Z]:this._config},B.prototype.defineDriver=function(Z,ve,be){var ge=new p(function(ye,Re){try{var ze=Z._driver,Ue=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Z._driver){Re(Ue);return}for(var Ge=Co.concat("_initStorage"),Tt=0,kt=Ge.length;Tt<kt;Tt++){var Hr=Ge[Tt],ar=!bi(sn,Hr);if((ar||Z[Hr])&&typeof Z[Hr]!="function"){Re(Ue);return}}var Cn=function Cn(){for(var Us=function Us(ug){return function(){var Yf=new Error("Method "+ug+" is not implemented by the current driver"),Xf=p.reject(Yf);return m(Xf,arguments[arguments.length-1]),Xf}},Bs=0,yu=sn.length;Bs<yu;Bs++){var Eo=sn[Bs];Z[Eo]||(Z[Eo]=Us(Eo))}};Cn();var On=function On(Us){js[ze]&&console.info("Redefining LocalForage driver: "+ze),js[ze]=Z,hu[ze]=Us,ye()};"_support"in Z?Z._support&&typeof Z._support=="function"?Z._support().then(On,Re):On(!!Z._support):On(!0)}catch(Fi){Re(Fi)}});return h(ge,ve,be),ge},B.prototype.driver=function(){return this._driver||null},B.prototype.getDriver=function(Z,ve,be){var ge=js[Z]?p.resolve(js[Z]):p.reject(new Error("Driver not found."));return h(ge,ve,be),ge},B.prototype.getSerializer=function(Z){var ve=p.resolve(Ar);return h(ve,Z),ve},B.prototype.ready=function(Z){var ve=this,be=ve._driverSet.then(function(){return ve._ready===null&&(ve._ready=ve._initDriver()),ve._ready});return h(be,Z,Z),be},B.prototype.setDriver=function(Z,ve,be){var ge=this;ko(Z)||(Z=[Z]);var ye=this._getSupportedDrivers(Z);function Re(){ge._config.driver=ge.driver()}function ze(Tt){return ge._extend(Tt),Re(),ge._ready=ge._initStorage(ge._config),ge._ready}function Ue(Tt){return function(){var kt=0;function Hr(){for(;kt<Tt.length;){var ar=Tt[kt];return kt++,ge._dbInfo=null,ge._ready=null,ge.getDriver(ar).then(ze).catch(Hr)}Re();var Cn=new Error("No available storage method found.");return ge._driverSet=p.reject(Cn),ge._driverSet}return Hr()}}var Ge=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=Ge.then(function(){var Tt=ye[0];return ge._dbInfo=null,ge._ready=null,ge.getDriver(Tt).then(function(kt){ge._driver=kt._driver,Re(),ge._wrapLibraryMethodsWithReady(),ge._initDriver=Ue(ye)})}).catch(function(){Re();var Tt=new Error("No available storage method found.");return ge._driverSet=p.reject(Tt),ge._driverSet}),h(this._driverSet,ve,be),this._driverSet},B.prototype.supports=function(Z){return!!hu[Z]},B.prototype._extend=function(Z){Cr(this,Z)},B.prototype._getSupportedDrivers=function(Z){for(var ve=[],be=0,ge=Z.length;be<ge;be++){var ye=Z[be];this.supports(ye)&&ve.push(ye)}return ve},B.prototype._wrapLibraryMethodsWithReady=function(){for(var Z=0,ve=Co.length;Z<ve;Z++)xu(this,Co[Z])},B.prototype.createInstance=function(Z){return new B(Z)},B}(),Ol=new Ml;i.exports=Ol},{undefined:void 0}]},{},[1])(1)})});var Tg=Be(function(oZt,Ote){"use strict";var i$=function i$(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(Ox[n])}return t.sort(function(o,a){return a.val-o.val}),t};var o$=function o$(e){if(e=="compatibility"&&(e="jedec"),e=="decimal"&&(e="metric"),!/^(binary|metric|jedec)/.test(e))throw Error("bytes.js: invalid mode passed in: "+e);return e};var CUe=function CUe(e,t){return typeof e=="string"?Mte(e,t):typeof e=="number"?Rte(e,t):null};var Rte=function Rte(e,t){if(!Number.isFinite(e))return null;var r=Math.abs(e),n=t&&t.thousandsSeparator||"",i=t&&t.unitSeparator||"",o=t&&t.decimalPlaces!==void 0?t.decimalPlaces:2,a=Boolean(t&&t.fixedDecimals),s=t&&t.unit,l=t&&t.mode||"metric";l=o$(t.mode);var c=EUe(l),d;s!==void 0?d=TUe(Ox,s,l):d=AUe(c,r);var u=e/d.val,p=u.toFixed(o),m=d.name;return a||(p=p.replace(_Ue,"$1")),n&&(p=p.replace(vUe,n)),p+i+m};var EUe=function EUe(e){if(e=="metric")return bUe;if(e=="jedec")return SUe;if(e=="binary")return wUe};var TUe=function TUe(e,t,r){var n;if(t=t.toLowerCase(),(r=="compatibility"||r=="jedec")&&(n=Ox["_"+t]),n===void 0&&(n=Ox[t]),n===void 0)throw Error("byte.js: unit not found: "+t);return n};var AUe=function AUe(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t>=n.val||r>=e.length-1)return n}};var Mte=function Mte(e,t){if(typeof e=="number"&&!isNaN(e))return e;if(typeof e!="string")return null;var r=t&&t.mode||"metric";r=o$(r);var n=kUe.exec(e),i,o;if(!n)return null;i=parseFloat(n[1]),o=n[4],o===void 0&&(o="b"),o=o.toLowerCase();var a;return r=="jedec"&&(a=Ox["_"+o]),a===void 0&&(a=Ox[o]),Math.floor(a.val*i)};Ote.exports=Pte("metric");var vUe=/\B(?=(\d{3})+(?!\d))/g,_Ue=/(?:\.0*|(\.[^0]+)0+)$/,Ox={b:{val:1,longName:"byte",name:"B"},kb:{val:Math.pow(1e3,1),longName:"kilobyte",name:"kB"},mb:{val:Math.pow(1e3,2),longName:"megabyte",name:"MB"},gb:{val:Math.pow(1e3,3),longName:"gigabyte",name:"GB"},tb:{val:Math.pow(1e3,4),longName:"terabyte",name:"TB"},pb:{val:Math.pow(1e3,5),longName:"petabyte",name:"PB"},eb:{val:Math.pow(1e3,6),longName:"exabyte",name:"EB"},zb:{val:Math.pow(1e3,7),longName:"zettabyte",name:"ZB"},yb:{val:Math.pow(1e3,8),longName:"yottabyte",name:"YB"},kib:{val:Math.pow(1024,1),longName:"kibibyte",name:"KiB"},mib:{val:Math.pow(1024,2),longName:"mebibyte",name:"MiB"},gib:{val:Math.pow(1024,3),longName:"gibibyte",name:"GiB"},tib:{val:Math.pow(1024,4),longName:"tebibyte",name:"TiB"},pib:{val:Math.pow(1024,5),longName:"pebibyte",name:"PiB"},eib:{val:Math.pow(1024,6),longName:"exbibyte",name:"EiB"},zib:{val:Math.pow(1024,7),longName:"zebibyte",name:"ZiB"},yib:{val:Math.pow(1024,8),longName:"yobibyte",name:"YiB"},_kb:{val:Math.pow(1024,1),longName:"kilobyte",name:"kB"},_mb:{val:Math.pow(1024,2),longName:"megabyte",name:"MB"},_gb:{val:Math.pow(1024,3),longName:"gigabyte",name:"GB"},_tb:{val:Math.pow(1024,4),longName:"terabyte",name:"TB"}};var bUe=i$(["b","kb","mb","gb","tb","pb","eb","zb","yb"]),wUe=i$(["b","kib","mib","gib","tib","pib","eib","zib","yib"]),SUe=i$(["b","_kb","_mb","_gb","_tb"]),kUe=/^((-|\+)?(\d+(?:\.\d+)?)) *((k|m|g|t|p|e|z|y)?i?(b))?$/i;function Pte(e){e=o$(e);function t(n){return n=n!==void 0?n:{},n.mode===void 0&&(n.mode=e),n}function r(n,i){return CUe(n,t(i))}return r.format=function(i,o){return Rte(i,t(o))},r.parse=function(i,o){return Mte(i,t(o))},r.withDefaultMode=Pte,r}});var p$=Be(function(LZt,jx){var et=function et(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},ii=-1,gi=1,Dr=0;et.Diff=function(e,t){return[e,t]};et.prototype.diff_main=function(e,t,r,n){typeof n=="undefined"&&(this.Diff_Timeout<=0?n=Number.MAX_VALUE:n=new Date().getTime()+this.Diff_Timeout*1e3);var i=n;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new et.Diff(Dr,e)]:[];typeof r=="undefined"&&(r=!0);var o=r,a=this.diff_commonPrefix(e,t),s=e.substring(0,a);e=e.substring(a),t=t.substring(a),a=this.diff_commonSuffix(e,t);var l=e.substring(e.length-a);e=e.substring(0,e.length-a),t=t.substring(0,t.length-a);var c=this.diff_compute_(e,t,o,i);return s&&c.unshift(new et.Diff(Dr,s)),l&&c.push(new et.Diff(Dr,l)),this.diff_cleanupMerge(c),c};et.prototype.diff_compute_=function(e,t,r,n){var i;if(!e)return[new et.Diff(gi,t)];if(!t)return[new et.Diff(ii,e)];var o=e.length>t.length?e:t,a=e.length>t.length?t:e,s=o.indexOf(a);if(s!=-1)return i=[new et.Diff(gi,o.substring(0,s)),new et.Diff(Dr,a),new et.Diff(gi,o.substring(s+a.length))],e.length>t.length&&(i[0][0]=i[2][0]=ii),i;if(a.length==1)return[new et.Diff(ii,e),new et.Diff(gi,t)];var l=this.diff_halfMatch_(e,t);if(l){var c=l[0],d=l[1],u=l[2],p=l[3],m=l[4],h=this.diff_main(c,u,r,n),g=this.diff_main(d,p,r,n);return h.concat([new et.Diff(Dr,m)],g)}return r&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,n):this.diff_bisect_(e,t,n)};et.prototype.diff_lineMode_=function(e,t,r){var n=this.diff_linesToChars_(e,t);e=n.chars1,t=n.chars2;var i=n.lineArray,o=this.diff_main(e,t,!1,r);this.diff_charsToLines_(o,i),this.diff_cleanupSemantic(o),o.push(new et.Diff(Dr,""));for(var a=0,s=0,l=0,c="",d="";a<o.length;){switch(o[a][0]){case gi:l++,d+=o[a][1];break;case ii:s++,c+=o[a][1];break;case Dr:if(s>=1&&l>=1){o.splice(a-s-l,s+l),a=a-s-l;for(var u=this.diff_main(c,d,!1,r),p=u.length-1;p>=0;p--)o.splice(a,0,u[p]);a=a+u.length}l=0,s=0,c="",d="";break}a++}return o.pop(),o};et.prototype.diff_bisect_=function(e,t,r){for(var n=e.length,i=t.length,o=Math.ceil((n+i)/2),a=o,s=2*o,l=new Array(s),c=new Array(s),d=0;d<s;d++)l[d]=-1,c[d]=-1;l[a+1]=0,c[a+1]=0;for(var u=n-i,p=u%2!=0,m=0,h=0,g=0,x=0,v=0;v<o&&!(new Date().getTime()>r);v++){for(var y=-v+m;y<=v-h;y+=2){var _=a+y,b;y==-v||y!=v&&l[_-1]<l[_+1]?b=l[_+1]:b=l[_-1]+1;for(var w=b-y;b<n&&w<i&&e.charAt(b)==t.charAt(w);)b++,w++;if(l[_]=b,b>n)h+=2;else if(w>i)m+=2;else if(p){var S=a+u-y;if(S>=0&&S<s&&c[S]!=-1){var k=n-c[S];if(b>=k)return this.diff_bisectSplit_(e,t,b,w,r)}}}for(var E=-v+g;E<=v-x;E+=2){var S=a+E,k;E==-v||E!=v&&c[S-1]<c[S+1]?k=c[S+1]:k=c[S-1]+1;for(var C=k-E;k<n&&C<i&&e.charAt(n-k-1)==t.charAt(i-C-1);)k++,C++;if(c[S]=k,k>n)x+=2;else if(C>i)g+=2;else if(!p){var _=a+u-E;if(_>=0&&_<s&&l[_]!=-1){var b=l[_],w=a+b-_;if(k=n-k,b>=k)return this.diff_bisectSplit_(e,t,b,w,r)}}}}return[new et.Diff(ii,e),new et.Diff(gi,t)]};et.prototype.diff_bisectSplit_=function(e,t,r,n,i){var o=e.substring(0,r),a=t.substring(0,n),s=e.substring(r),l=t.substring(n),c=this.diff_main(o,a,!1,i),d=this.diff_main(s,l,!1,i);return c.concat(d)};et.prototype.diff_linesToChars_=function(e,t){var r=[],n={};r[0]="";function i(l){for(var c="",d=0,u=-1,p=r.length;u<l.length-1;){u=l.indexOf("\n",d),u==-1&&(u=l.length-1);var m=l.substring(d,u+1);(n.hasOwnProperty?n.hasOwnProperty(m):n[m]!==void 0)?c+=String.fromCharCode(n[m]):(p==o&&(m=l.substring(d),u=l.length),c+=String.fromCharCode(p),n[m]=p,r[p++]=m),d=u+1}return c}var o=4e4,a=i(e);o=65535;var s=i(t);return{chars1:a,chars2:s,lineArray:r}};et.prototype.diff_charsToLines_=function(e,t){for(var r=0;r<e.length;r++){for(var n=e[r][1],i=[],o=0;o<n.length;o++)i[o]=t[n.charCodeAt(o)];e[r][1]=i.join("")}};et.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var r=0,n=Math.min(e.length,t.length),i=n,o=0;r<i;)e.substring(o,i)==t.substring(o,i)?(r=i,o=r):n=i,i=Math.floor((n-r)/2+r);return i};et.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var r=0,n=Math.min(e.length,t.length),i=n,o=0;r<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?(r=i,o=r):n=i,i=Math.floor((n-r)/2+r);return i};et.prototype.diff_commonOverlap_=function(e,t){var r=e.length,n=t.length;if(r==0||n==0)return 0;r>n?e=e.substring(r-n):r<n&&(t=t.substring(0,r));var i=Math.min(r,n);if(e==t)return i;for(var o=0,a=1;;){var s=e.substring(i-a),l=t.indexOf(s);if(l==-1)return o;a+=l,(l==0||e.substring(i-a)==t.substring(0,a))&&(o=a,a++)}};et.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var r=e.length>t.length?e:t,n=e.length>t.length?t:e;if(r.length<4||n.length*2<r.length)return null;var i=this;function o(h,g,x){for(var v=h.substring(x,x+Math.floor(h.length/4)),y=-1,_="",b,w,S,k;(y=g.indexOf(v,y+1))!=-1;){var E=i.diff_commonPrefix(h.substring(x),g.substring(y)),C=i.diff_commonSuffix(h.substring(0,x),g.substring(0,y));_.length<C+E&&(_=g.substring(y-C,y)+g.substring(y,y+E),b=h.substring(0,x-C),w=h.substring(x+E),S=g.substring(0,y-C),k=g.substring(y+E))}return _.length*2>=h.length?[b,w,S,k,_]:null}var a=o(r,n,Math.ceil(r.length/4)),s=o(r,n,Math.ceil(r.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var c,d,u,p;e.length>t.length?(c=l[0],d=l[1],u=l[2],p=l[3]):(u=l[0],p=l[1],c=l[2],d=l[3]);var m=l[4];return[c,d,u,p,m]};et.prototype.diff_cleanupSemantic=function(e){for(var t=!1,r=[],n=0,i=null,o=0,a=0,s=0,l=0,c=0;o<e.length;)e[o][0]==Dr?(r[n++]=o,a=l,s=c,l=0,c=0,i=e[o][1]):(e[o][0]==gi?l+=e[o][1].length:c+=e[o][1].length,i&&i.length<=Math.max(a,s)&&i.length<=Math.max(l,c)&&(e.splice(r[n-1],0,new et.Diff(ii,i)),e[r[n-1]+1][0]=gi,n--,n--,o=n>0?r[n-1]:-1,a=0,s=0,l=0,c=0,i=null,t=!0)),o++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o<e.length;){if(e[o-1][0]==ii&&e[o][0]==gi){var d=e[o-1][1],u=e[o][1],p=this.diff_commonOverlap_(d,u),m=this.diff_commonOverlap_(u,d);p>=m?(p>=d.length/2||p>=u.length/2)&&(e.splice(o,0,new et.Diff(Dr,u.substring(0,p))),e[o-1][1]=d.substring(0,d.length-p),e[o+1][1]=u.substring(p),o++):(m>=d.length/2||m>=u.length/2)&&(e.splice(o,0,new et.Diff(Dr,d.substring(0,m))),e[o-1][0]=gi,e[o-1][1]=u.substring(0,u.length-m),e[o+1][0]=ii,e[o+1][1]=d.substring(m),o++),o++}o++}};et.prototype.diff_cleanupSemanticLossless=function(e){function t(m,h){if(!m||!h)return 6;var g=m.charAt(m.length-1),x=h.charAt(0),v=g.match(et.nonAlphaNumericRegex_),y=x.match(et.nonAlphaNumericRegex_),_=v&&g.match(et.whitespaceRegex_),b=y&&x.match(et.whitespaceRegex_),w=_&&g.match(et.linebreakRegex_),S=b&&x.match(et.linebreakRegex_),k=w&&m.match(et.blanklineEndRegex_),E=S&&h.match(et.blanklineStartRegex_);return k||E?5:w||S?4:v&&!_&&b?3:_||b?2:v||y?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==Dr&&e[r+1][0]==Dr){var n=e[r-1][1],i=e[r][1],o=e[r+1][1],a=this.diff_commonSuffix(n,i);if(a){var s=i.substring(i.length-a);n=n.substring(0,n.length-a),i=s+i.substring(0,i.length-a),o=s+o}for(var l=n,c=i,d=o,u=t(n,i)+t(i,o);i.charAt(0)===o.charAt(0);){n+=i.charAt(0),i=i.substring(1)+o.charAt(0),o=o.substring(1);var p=t(n,i)+t(i,o);p>=u&&(u=p,l=n,c=i,d=o)}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=c,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}};et.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;et.whitespaceRegex_=/\s/;et.linebreakRegex_=/[\r\n]/;et.blanklineEndRegex_=/\n\r?\n$/;et.blanklineStartRegex_=/^\r?\n\r?\n/;et.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,r=[],n=0,i=null,o=0,a=!1,s=!1,l=!1,c=!1;o<e.length;)e[o][0]==Dr?(e[o][1].length<this.Diff_EditCost&&(l||c)?(r[n++]=o,a=l,s=c,i=e[o][1]):(n=0,i=null),l=c=!1):(e[o][0]==ii?c=!0:l=!0,i&&(a&&s&&l&&c||i.length<this.Diff_EditCost/2&&a+s+l+c==3)&&(e.splice(r[n-1],0,new et.Diff(ii,i)),e[r[n-1]+1][0]=gi,n--,i=null,a&&s?(l=c=!0,n=0):(n--,o=n>0?r[n-1]:-1,l=c=!1),t=!0)),o++;t&&this.diff_cleanupMerge(e)};et.prototype.diff_cleanupMerge=function(e){e.push(new et.Diff(Dr,""));for(var t=0,r=0,n=0,i="",o="",a;t<e.length;)switch(e[t][0]){case gi:n++,o+=e[t][1],t++;break;case ii:r++,i+=e[t][1],t++;break;case Dr:r+n>1?(r!==0&&n!==0&&(a=this.diff_commonPrefix(o,i),a!==0&&(t-r-n>0&&e[t-r-n-1][0]==Dr?e[t-r-n-1][1]+=o.substring(0,a):(e.splice(0,0,new et.Diff(Dr,o.substring(0,a))),t++),o=o.substring(a),i=i.substring(a)),a=this.diff_commonSuffix(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a))),t-=r+n,e.splice(t,r+n),i.length&&(e.splice(t,0,new et.Diff(ii,i)),t++),o.length&&(e.splice(t,0,new et.Diff(gi,o)),t++),t++):t!==0&&e[t-1][0]==Dr?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,n=0,r=0,i="",o="";break}e[e.length-1][1]===""&&e.pop();var s=!1;for(t=1;t<e.length-1;)e[t-1][0]==Dr&&e[t+1][0]==Dr&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),s=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),s=!0)),t++;s&&this.diff_cleanupMerge(e)};et.prototype.diff_xIndex=function(e,t){var r=0,n=0,i=0,o=0,a;for(a=0;a<e.length&&(e[a][0]!==gi&&(r+=e[a][1].length),e[a][0]!==ii&&(n+=e[a][1].length),!(r>t));a++)i=r,o=n;return e.length!=a&&e[a][0]===ii?o:o+(t-i)};et.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,n=/</g,i=/>/g,o=/\n/g,a=0;a<e.length;a++){var s=e[a][0],l=e[a][1],c=l.replace(r,"&").replace(n,"<").replace(i,">").replace(o,"¶<br>");switch(s){case gi:t[a]='<ins style="background:#e6ffe6;">'+c+"</ins>";break;case ii:t[a]='<del style="background:#ffe6e6;">'+c+"</del>";break;case Dr:t[a]="<span>"+c+"</span>";break}}return t.join("")};et.prototype.diff_text1=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==gi&&(t[r]=e[r][1]);return t.join("")};et.prototype.diff_text2=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==ii&&(t[r]=e[r][1]);return t.join("")};et.prototype.diff_levenshtein=function(e){for(var t=0,r=0,n=0,i=0;i<e.length;i++){var o=e[i][0],a=e[i][1];switch(o){case gi:r+=a.length;break;case ii:n+=a.length;break;case Dr:t+=Math.max(r,n),r=0,n=0;break}}return t+=Math.max(r,n),t};et.prototype.diff_toDelta=function(e){for(var t=[],r=0;r<e.length;r++)switch(e[r][0]){case gi:t[r]="+"+encodeURI(e[r][1]);break;case ii:t[r]="-"+e[r][1].length;break;case Dr:t[r]="="+e[r][1].length;break}return t.join(" ").replace(/%20/g," ")};et.prototype.diff_fromDelta=function(e,t){for(var r=[],n=0,i=0,o=t.split(/\t/g),a=0;a<o.length;a++){var s=o[a].substring(1);switch(o[a].charAt(0)){case"+":try{r[n++]=new et.Diff(gi,decodeURI(s))}catch(d){throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var l=parseInt(s,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+s);var c=e.substring(i,i+=l);o[a].charAt(0)=="="?r[n++]=new et.Diff(Dr,c):r[n++]=new et.Diff(ii,c);break;default:if(o[a])throw new Error("Invalid diff operation in diff_fromDelta: "+o[a])}}if(i!=e.length)throw new Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r};et.prototype.match_main=function(e,t,r){if(e==null||t==null||r==null)throw new Error("Null input. (match_main)");return r=Math.max(0,Math.min(r,e.length)),e==t?0:e.length?e.substring(r,r+t.length)==t?r:this.match_bitap_(e,t,r):-1};et.prototype.match_bitap_=function(e,t,r){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var n=this.match_alphabet_(t),i=this;function o(b,w){var S=b/t.length,k=Math.abs(r-w);return i.Match_Distance?S+k/i.Match_Distance:k?1:S}var a=this.Match_Threshold,s=e.indexOf(t,r);s!=-1&&(a=Math.min(o(0,s),a),s=e.lastIndexOf(t,r+t.length),s!=-1&&(a=Math.min(o(0,s),a)));var l=1<<t.length-1;s=-1;for(var c,d,u=t.length+e.length,p,m=0;m<t.length;m++){for(c=0,d=u;c<d;)o(m,r+d)<=a?c=d:u=d,d=Math.floor((u-c)/2+c);u=d;var h=Math.max(1,r-d+1),g=Math.min(r+d,e.length)+t.length,x=Array(g+2);x[g+1]=(1<<m)-1;for(var v=g;v>=h;v--){var y=n[e.charAt(v-1)];if(m===0?x[v]=(x[v+1]<<1|1)&y:x[v]=(x[v+1]<<1|1)&y|((p[v+1]|p[v])<<1|1)|p[v+1],x[v]&l){var _=o(m,v-1);if(_<=a)if(a=_,s=v-1,s>r)h=Math.max(1,2*r-s);else break}}if(o(m+1,r)>a)break;p=x}return s};et.prototype.match_alphabet_=function(e){for(var t={},r=0;r<e.length;r++)t[e.charAt(r)]=0;for(var r=0;r<e.length;r++)t[e.charAt(r)]|=1<<e.length-r-1;return t};et.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error("patch not initialized");for(var r=t.substring(e.start2,e.start2+e.length1),n=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)n+=this.Patch_Margin,r=t.substring(e.start2-n,e.start2+e.length1+n);n+=this.Patch_Margin;var i=t.substring(e.start2-n,e.start2);i&&e.diffs.unshift(new et.Diff(Dr,i));var o=t.substring(e.start2+e.length1,e.start2+e.length1+n);o&&e.diffs.push(new et.Diff(Dr,o)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+o.length,e.length2+=i.length+o.length}};et.prototype.patch_make=function(e,t,r){var n,i;if(typeof e=="string"&&typeof t=="string"&&typeof r=="undefined")n=e,i=this.diff_main(n,t,!0),i.length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&typeof t=="undefined"&&typeof r=="undefined")i=e,n=this.diff_text1(i);else if(typeof e=="string"&&t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&typeof r=="undefined")n=e,i=t;else if(typeof e=="string"&&typeof t=="string"&&r&&(typeof r==="undefined"?"undefined":_type_of(r))=="object")n=e,i=r;else throw new Error("Unknown call format to patch_make.");if(i.length===0)return[];for(var o=[],a=new et.patch_obj,s=0,l=0,c=0,d=n,u=n,p=0;p<i.length;p++){var m=i[p][0],h=i[p][1];switch(!s&&m!==Dr&&(a.start1=l,a.start2=c),m){case gi:a.diffs[s++]=i[p],a.length2+=h.length,u=u.substring(0,c)+h+u.substring(c);break;case ii:a.length1+=h.length,a.diffs[s++]=i[p],u=u.substring(0,c)+u.substring(c+h.length);break;case Dr:h.length<=2*this.Patch_Margin&&s&&i.length!=p+1?(a.diffs[s++]=i[p],a.length1+=h.length,a.length2+=h.length):h.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(a,d),o.push(a),a=new et.patch_obj,s=0,d=u,l=c);break}m!==gi&&(l+=h.length),m!==ii&&(c+=h.length)}return s&&(this.patch_addContext_(a,d),o.push(a)),o};et.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],i=new et.patch_obj;i.diffs=[];for(var o=0;o<n.diffs.length;o++)i.diffs[o]=new et.Diff(n.diffs[o][0],n.diffs[o][1]);i.start1=n.start1,i.start2=n.start2,i.length1=n.length1,i.length2=n.length2,t[r]=i}return t};et.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var r=this.patch_addPadding(e);t=r+t+r,this.patch_splitMax(e);for(var n=0,i=[],o=0;o<e.length;o++){var a=e[o].start2+n,s=this.diff_text1(e[o].diffs),l,c=-1;if(s.length>this.Match_MaxBits?(l=this.match_main(t,s.substring(0,this.Match_MaxBits),a),l!=-1&&(c=this.match_main(t,s.substring(s.length-this.Match_MaxBits),a+s.length-this.Match_MaxBits),(c==-1||l>=c)&&(l=-1))):l=this.match_main(t,s,a),l==-1)i[o]=!1,n-=e[o].length2-e[o].length1;else{i[o]=!0,n=l-a;var d;if(c==-1?d=t.substring(l,l+s.length):d=t.substring(l,c+this.Match_MaxBits),s==d)t=t.substring(0,l)+this.diff_text2(e[o].diffs)+t.substring(l+s.length);else{var u=this.diff_main(s,d,!1);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(u)/s.length>this.Patch_DeleteThreshold)i[o]=!1;else{this.diff_cleanupSemanticLossless(u);for(var p=0,m,h=0;h<e[o].diffs.length;h++){var g=e[o].diffs[h];g[0]!==Dr&&(m=this.diff_xIndex(u,p)),g[0]===gi?t=t.substring(0,l+m)+g[1]+t.substring(l+m):g[0]===ii&&(t=t.substring(0,l+m)+t.substring(l+this.diff_xIndex(u,p+g[1].length))),g[0]!==ii&&(p+=g[1].length)}}}}}return t=t.substring(r.length,t.length-r.length),[t,i]};et.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r="",n=1;n<=t;n++)r+=String.fromCharCode(n);for(var n=0;n<e.length;n++)e[n].start1+=t,e[n].start2+=t;var i=e[0],o=i.diffs;if(o.length==0||o[0][0]!=Dr)o.unshift(new et.Diff(Dr,r)),i.start1-=t,i.start2-=t,i.length1+=t,i.length2+=t;else if(t>o[0][1].length){var a=t-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],i.start1-=a,i.start2-=a,i.length1+=a,i.length2+=a}if(i=e[e.length-1],o=i.diffs,o.length==0||o[o.length-1][0]!=Dr)o.push(new et.Diff(Dr,r)),i.length1+=t,i.length2+=t;else if(t>o[o.length-1][1].length){var a=t-o[o.length-1][1].length;o[o.length-1][1]+=r.substring(0,a),i.length1+=a,i.length2+=a}return r};et.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=t)){var n=e[r];e.splice(r--,1);for(var i=n.start1,o=n.start2,a="";n.diffs.length!==0;){var s=new et.patch_obj,l=!0;for(s.start1=i-a.length,s.start2=o-a.length,a!==""&&(s.length1=s.length2=a.length,s.diffs.push(new et.Diff(Dr,a)));n.diffs.length!==0&&s.length1<t-this.Patch_Margin;){var c=n.diffs[0][0],d=n.diffs[0][1];c===gi?(s.length2+=d.length,o+=d.length,s.diffs.push(n.diffs.shift()),l=!1):c===ii&&s.diffs.length==1&&s.diffs[0][0]==Dr&&d.length>2*t?(s.length1+=d.length,i+=d.length,l=!1,s.diffs.push(new et.Diff(c,d)),n.diffs.shift()):(d=d.substring(0,t-s.length1-this.Patch_Margin),s.length1+=d.length,i+=d.length,c===Dr?(s.length2+=d.length,o+=d.length):l=!1,s.diffs.push(new et.Diff(c,d)),d==n.diffs[0][1]?n.diffs.shift():n.diffs[0][1]=n.diffs[0][1].substring(d.length))}a=this.diff_text2(s.diffs),a=a.substring(a.length-this.Patch_Margin);var u=this.diff_text1(n.diffs).substring(0,this.Patch_Margin);u!==""&&(s.length1+=u.length,s.length2+=u.length,s.diffs.length!==0&&s.diffs[s.diffs.length-1][0]===Dr?s.diffs[s.diffs.length-1][1]+=u:s.diffs.push(new et.Diff(Dr,u))),l||e.splice(++r,0,s)}}};et.prototype.patch_toText=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e[r];return t.join("")};et.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var r=e.split("\n"),n=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;n<r.length;){var o=r[n].match(i);if(!o)throw new Error("Invalid patch string: "+r[n]);var a=new et.patch_obj;for(t.push(a),a.start1=parseInt(o[1],10),o[2]===""?(a.start1--,a.length1=1):o[2]=="0"?a.length1=0:(a.start1--,a.length1=parseInt(o[2],10)),a.start2=parseInt(o[3],10),o[4]===""?(a.start2--,a.length2=1):o[4]=="0"?a.length2=0:(a.start2--,a.length2=parseInt(o[4],10)),n++;n<r.length;){var s=r[n].charAt(0);try{var l=decodeURI(r[n].substring(1))}catch(c){throw new Error("Illegal escape in patch_fromText: "+l)}if(s=="-")a.diffs.push(new et.Diff(ii,l));else if(s=="+")a.diffs.push(new et.Diff(gi,l));else if(s==" ")a.diffs.push(new et.Diff(Dr,l));else{if(s=="@")break;if(s!=="")throw new Error('Invalid patch mode "'+s+'" in: '+l)}n++}}return t};et.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0};et.patch_obj.prototype.toString=function(){var e,t;this.length1===0?e=this.start1+",0":this.length1==1?e=this.start1+1:e=this.start1+1+","+this.length1,this.length2===0?t=this.start2+",0":this.length2==1?t=this.start2+1:t=this.start2+1+","+this.length2;for(var r=["@@ -"+e+" +"+t+" @@\n"],n,i=0;i<this.diffs.length;i++){switch(this.diffs[i][0]){case gi:n="+";break;case ii:n="-";break;case Dr:n=" ";break}r[i+1]=n+encodeURI(this.diffs[i][1])+"\n"}return r.join("").replace(/%20/g," ")};jx.exports=et;jx.exports.diff_match_patch=et;jx.exports.DIFF_DELETE=ii;jx.exports.DIFF_INSERT=gi;jx.exports.DIFF_EQUAL=Dr});var cue=Be(function(nnr,uue){"use strict";var _Qe=function _Qe(){var t,r,n;return(n=(r=(t=globalThis[lue])==null?void 0:t.get)==null?void 0:r.call(t))!=null?n:{}};var oz=Object.defineProperty,mQe=Object.getOwnPropertyDescriptor,hQe=Object.getOwnPropertyNames,gQe=Object.prototype.hasOwnProperty,xQe=function(e,t){for(var r in t)oz(e,r,{get:t[r],enumerable:!0})},yQe=function(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"||typeof t=="function")try{var _loop=function(){var i=_step.value;!gQe.call(e,i)&&i!==r&&oz(e,i,{get:function(){return t[i]},enumerable:!(n=mQe(t,i))||n.enumerable})};for(var _iterator=hQe(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},vQe=function(e){return yQe(oz({},"__esModule",{value:!0}),e)},sue={};xQe(sue,{SYMBOL_FOR_REQ_CONTEXT:function(){return lue},getContext:function(){return _Qe}});uue.exports=vQe(sue);var lue=Symbol.for("@vercel/request-context")});var fue=Be(function(inr,pue){"use strict";var lz=Object.defineProperty,bQe=Object.getOwnPropertyDescriptor,wQe=Object.getOwnPropertyNames,SQe=Object.prototype.hasOwnProperty,kQe=function(e,t){for(var r in t)lz(e,r,{get:t[r],enumerable:!0})},CQe=function(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"||typeof t=="function")try{var _loop=function(){var i=_step.value;!SQe.call(e,i)&&i!==r&&lz(e,i,{get:function(){return t[i]},enumerable:!(n=bQe(t,i))||n.enumerable})};for(var _iterator=wQe(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},EQe=function(e){return CQe(lz({},"__esModule",{value:!0}),e)},due={};kQe(due,{AccessTokenMissingError:function(){return az},RefreshAccessTokenFailedError:function(){return sz}});pue.exports=EQe(due);var az=/*#__PURE__*/function(Error1){_inherits(az,Error1);function az(){_class_call_check(this,az);var _this;_this=_call_super(this,az,["No authentication found. Please log in with the Vercel CLI (vercel login)."]),_this.name="AccessTokenMissingError";return _this}return az}(_wrap_native_super(Error)),sz=/*#__PURE__*/function(Error1){_inherits(sz,Error1);function sz(t){_class_call_check(this,sz);var _this;_this=_call_super(this,sz,["Failed to refresh authentication token.",{cause:t}]),_this.name="RefreshAccessTokenFailedError";return _this}return sz}(_wrap_native_super(Error))});var cz=Be(function(onr,gue){"use strict";var $Qe=function $Qe(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,""]})})()};var NQe=function NQe(){return""};var DQe=function DQe(){return _async_to_generator(function(){return _ts_generator(this,function(_state){throw new Error("getVercelToken is not supported in browser environments")})})()};var uz=Object.defineProperty,TQe=Object.getOwnPropertyDescriptor,AQe=Object.getOwnPropertyNames,IQe=Object.prototype.hasOwnProperty,PQe=function(e,t){for(var r in t)uz(e,r,{get:t[r],enumerable:!0})},RQe=function(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"||typeof t=="function")try{var _loop=function(){var i=_step.value;!IQe.call(e,i)&&i!==r&&uz(e,i,{get:function(){return t[i]},enumerable:!(n=TQe(t,i))||n.enumerable})};for(var _iterator=AQe(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},MQe=function(e){return RQe(uz({},"__esModule",{value:!0}),e)},hue={};PQe(hue,{AccessTokenMissingError:function(){return mue.AccessTokenMissingError},RefreshAccessTokenFailedError:function(){return mue.RefreshAccessTokenFailedError},getContext:function(){return OQe.getContext},getVercelOidcToken:function(){return $Qe},getVercelOidcTokenSync:function(){return NQe},getVercelToken:function(){return DQe}});gue.exports=MQe(hue);var OQe=cue(),mue=fue()});var _f=Be(function(xU){"use strict";xU.load=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n,i,o;for(n in t)o=t[n],r[n]=(i=e[n])!=null?i:o;return r};xU.overwrite=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n,i;for(n in e)i=e[n],t[n]!==void 0&&(r[n]=i);return r}});var yU=Be(function(pmr,dge){"use strict";var cge;cge=/*#__PURE__*/function(){function cge(t,r){_class_call_check(this,cge);this.incr=t,this.decr=r,this._first=null,this._last=null,this.length=0}_create_class(cge,[{key:"push",value:function push(t){var r;this.length++,typeof this.incr=="function"&&this.incr(),r={value:t,prev:this._last,next:null},this._last!=null?(this._last.next=r,this._last=r):this._first=this._last=r}},{key:"shift",value:function shift(){var t;if(this._first!=null)return this.length--,typeof this.decr=="function"&&this.decr(),t=this._first.value,(this._first=this._first.next)!=null?this._first.prev=null:this._last=null,t}},{key:"first",value:function first(){if(this._first!=null)return this._first.value}},{key:"getArray",value:function getArray(){var t,r,n;for(t=this._first,n=[];t!=null;)n.push((r=t,t=t.next,r.value));return n}},{key:"forEachShift",value:function forEachShift(t){var r;for(r=this.shift();r!=null;)t(r),r=this.shift()}},{key:"debug",value:function debug(){var t,r,n,i,o;for(t=this._first,o=[];t!=null;)o.push((r=t,t=t.next,{value:r.value,prev:(n=r.prev)!=null?n.value:void 0,next:(i=r.next)!=null?i.value:void 0}));return o}}]);return cge}();dge.exports=cge});var A0=Be(function(mmr,hge){"use strict";var pge=function pge(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var fge=function fge(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){pge(o,n,i,a,s,"next",l)}function s(l){pge(o,n,i,a,s,"throw",l)}a(void 0)})}};var mge;mge=/*#__PURE__*/function(){function mge(t){var _this=this;var _this1=this;_class_call_check(this,mge);if(this.instance=t,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw new Error("An Emitter already exists for this object");this.instance.on=function(r,n){return _this._addListener(r,"many",n)},this.instance.once=function(r,n){return _this._addListener(r,"once",n)},this.instance.removeAllListeners=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r!=null?delete _this1._events[r]:_this1._events={}}}_create_class(mge,[{key:"_addListener",value:function _addListener(t,r,n){var i;return(i=this._events)[t]==null&&(i[t]=[]),this._events[t].push({cb:n,status:r}),this.instance}},{key:"listenerCount",value:function listenerCount(t){return this._events[t]!=null?this._events[t].length:0}},{key:"trigger",value:function trigger(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var n=this;return fge(function(){var i,o,_tmp,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);t!=="debug"&&n.trigger("debug","Event triggered: ".concat(t),r);if(!(n._events[t]==null))return[3,1];_tmp=void 0;return[3,3];case 1:n._events[t]=n._events[t].filter(function(a){return a.status!=="none"}),o=n._events[t].map(function(){var _$a=fge(function(s){var l,c,_s1,_tmp,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(s.status!=="none"))return[3,6];s.status==="once"&&(s.status="none");_state.label=1;case 1:_state.trys.push([1,5,,6]);c=typeof s.cb=="function"?(_s1=s).cb.apply(_s1,_to_consumable_array(r)):void 0;if(!(typeof(c!=null?c.then:void 0)=="function"))return[3,3];return[4,c];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=c;_state.label=4;case 4:return[2,_tmp];case 5:d=_state.sent();return[2,(l=d,n.trigger("error",l),null)];case 6:return[2]}})});return function(s){return _$a.apply(this,arguments)}}());return[4,Promise.all(o)];case 2:_tmp=_state.sent().find(function(a){return a!=null});_state.label=3;case 3:return[2,_tmp];case 4:a=_state.sent();return[2,(i=a,n.trigger("error",i),null)];case 5:return[2]}})})()}}]);return mge}();hge.exports=mge});var _ge=Be(function(gmr,vge){"use strict";var gge,xge,yge;gge=yU();xge=A0();yge=/*#__PURE__*/function(){function yge(t){_class_call_check(this,yge);var r;this.Events=new xge(this),this._length=0,this._lists=(function(){var _this=this;var n,i,o;for(o=[],r=n=1,i=t;1<=i?n<=i:n>=i;r=1<=i?++n:--n)o.push(new gge(function(){return _this.incr()},function(){return _this.decr()}));return o}).call(this)}_create_class(yge,[{key:"incr",value:function incr(){if(this._length++===0)return this.Events.trigger("leftzero")}},{key:"decr",value:function decr(){if(--this._length===0)return this.Events.trigger("zero")}},{key:"push",value:function push(t){return this._lists[t.options.priority].push(t)}},{key:"queued",value:function queued(t){return t!=null?this._lists[t].length:this._length}},{key:"shiftAll",value:function shiftAll(t){return this._lists.forEach(function(r){return r.forEachShift(t)})}},{key:"getFirst",value:function getFirst(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._lists;var r,n,i;for(r=0,n=t.length;r<n;r++)if(i=t[r],i.length>0)return i;return[]}},{key:"shiftLastFrom",value:function shiftLastFrom(t){return this.getFirst(this._lists.slice(t).reverse()).shift()}}]);return yge}();vge.exports=yge});var hv=Be(function(ymr,wge){"use strict";var bge;bge=/*#__PURE__*/function(Error1){_inherits(bge,Error1);function bge(){_class_call_check(this,bge);return _call_super(this,bge,arguments)}return bge}(_wrap_native_super(Error));wge.exports=bge});var Ige=Be(function(_mr,Age){"use strict";var Sge=function Sge(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var kge=function kge(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){Sge(o,n,i,a,s,"next",l)}function s(l){Sge(o,n,i,a,s,"throw",l)}a(void 0)})}};var hA,Cge,Ege,vU,Tge;vU=10;Cge=5;Tge=_f();hA=hv();Ege=/*#__PURE__*/function(){function Ege(t,r,n,i,o,a,s,l){var _this=this;_class_call_check(this,Ege);this.task=t,this.args=r,this.rejectOnDrop=o,this.Events=a,this._states=s,this.Promise=l,this.options=Tge.load(n,i),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===i.id&&(this.options.id="".concat(this.options.id,"-").concat(this._randomIndex())),this.promise=new this.Promise(function(c,d){_this._resolve=c,_this._reject=d}),this.retryCount=0}_create_class(Ege,[{key:"_sanitizePriority",value:function _sanitizePriority(t){var r;return r=~~t!==t?Cge:t,r<0?0:r>vU-1?vU-1:r}},{key:"_randomIndex",value:function _randomIndex(){return Math.random().toString(36).slice(2)}},{key:"doDrop",value:function doDrop(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_ref.error,tmp=_ref.message,r=tmp===void 0?"This job has been dropped by Bottleneck":tmp;return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(t!=null?t:new hA(r)),this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}},{key:"_assertStatus",value:function _assertStatus(t){var r;if(r=this._states.jobStatus(this.options.id),!(r===t||t==="DONE"&&r===null))throw new hA("Invalid job status ".concat(r,", expected ").concat(t,". Please open an issue at https://github.com/SGrondin/bottleneck/issues"))}},{key:"doReceive",value:function doReceive(){return this._states.start(this.options.id),this.Events.trigger("received",{args:this.args,options:this.options})}},{key:"doQueue",value:function doQueue(t,r){return this._assertStatus("RECEIVED"),this._states.next(this.options.id),this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:t,blocked:r})}},{key:"doRun",value:function doRun(){return this.retryCount===0?(this._assertStatus("QUEUED"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),this.Events.trigger("scheduled",{args:this.args,options:this.options})}},{key:"doExecute",value:function doExecute(t,r,n,i){var o=this;return kge(function(){var a,s,l,_t1,_o1,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:o.retryCount===0?(o._assertStatus("RUNNING"),o._states.next(o.options.id)):o._assertStatus("EXECUTING"),s={args:o.args,options:o.options,retryCount:o.retryCount},o.Events.trigger("executing",s);_state.label=1;case 1:_state.trys.push([1,5,,6]);return[4,t!=null?(_t1=t).schedule.apply(_t1,[o.options,o.task].concat(_to_consumable_array(o.args))):(_o1=o).task.apply(_o1,_to_consumable_array(o.args))];case 2:if(!(l=_state.sent(),r()))return[3,4];o.doDone(s);return[4,i(o.options,s)];case 3:return[2,(_state.sent(),o._assertStatus("DONE"),o._resolve(l))];case 4:return[3,6];case 5:c=_state.sent();return[2,(a=c,o._onFailure(a,s,r,n,i))];case 6:return[2]}})})()}},{key:"doExpire",value:function doExpire(t,r,n){var i,o;return this._states.jobStatus(this.options.id==="RUNNING")&&this._states.next(this.options.id),this._assertStatus("EXECUTING"),o={args:this.args,options:this.options,retryCount:this.retryCount},i=new hA("This job timed out after ".concat(this.options.expiration," ms.")),this._onFailure(i,o,t,r,n)}},{key:"_onFailure",value:function _onFailure(t,r,n,i,o){var a=this;return kge(function(){var s,l,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!n())return[3,5];return[4,a.Events.trigger("failed",t,r)];case 1:s=_state.sent();if(!(s!=null))return[3,2];_tmp=(l=~~s,a.Events.trigger("retry","Retrying ".concat(a.options.id," after ").concat(l," ms"),r),a.retryCount++,i(l));return[3,4];case 2:a.doDone(r);return[4,o(a.options,r)];case 3:_tmp=(_state.sent(),a._assertStatus("DONE"),a._reject(t));_state.label=4;case 4:return[2,_tmp];case 5:return[2]}})})()}},{key:"doDone",value:function doDone(t){return this._assertStatus("EXECUTING"),this._states.next(this.options.id),this.Events.trigger("done",t)}}]);return Ege}();Age.exports=Ege});var $ge=Be(function(wmr,Oge){"use strict";var Pge=function Pge(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var tu=function tu(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){Pge(o,n,i,a,s,"next",l)}function s(l){Pge(o,n,i,a,s,"throw",l)}a(void 0)})}};var Rge,Mge,_U;_U=_f();Rge=hv();Mge=/*#__PURE__*/function(){function Mge(t,r,n){_class_call_check(this,Mge);this.instance=t,this.storeOptions=r,this.clientId=this.instance._randomIndex(),_U.load(n,n,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_create_class(Mge,[{key:"_startHeartbeat",value:function _startHeartbeat(){var _this=this;var t;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(t=this.heartbeat=setInterval(function(){var r,n,i,o,a;if(o=Date.now(),_this.storeOptions.reservoirRefreshInterval!=null&&o>=_this._lastReservoirRefresh+_this.storeOptions.reservoirRefreshInterval&&(_this._lastReservoirRefresh=o,_this.storeOptions.reservoir=_this.storeOptions.reservoirRefreshAmount,_this.instance._drainAll(_this.computeCapacity())),_this.storeOptions.reservoirIncreaseInterval!=null&&o>=_this._lastReservoirIncrease+_this.storeOptions.reservoirIncreaseInterval){var s=_this.storeOptions;if(r=s.reservoirIncreaseAmount,i=s.reservoirIncreaseMaximum,a=s.reservoir,_this._lastReservoirIncrease=o,n=i!=null?Math.min(r,i-a):r,n>0)return _this.storeOptions.reservoir+=n,_this.instance._drainAll(_this.computeCapacity())}},this.heartbeatInterval)).unref=="function"?t.unref():void 0:clearInterval(this.heartbeat)}},{key:"__publish__",value:function __publish__(t){var r=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),r.instance.Events.trigger("message",t.toString()))]}})})()}},{key:"__disconnect__",value:function __disconnect__(t){var r=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),clearInterval(r.heartbeat),r.Promise.resolve())]}})})()}},{key:"yieldLoop",value:function yieldLoop(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new this.Promise(function(r,n){return setTimeout(r,t)})}},{key:"computePenalty",value:function computePenalty(){var t;return(t=this.storeOptions.penalty)!=null?t:15*this.storeOptions.minTime||5e3}},{key:"__updateSettings__",value:function __updateSettings__(t){var r=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),_U.overwrite(t,t,r.storeOptions),r._startHeartbeat(),r.instance._drainAll(r.computeCapacity()),!0)]}})})()}},{key:"__running__",value:function __running__(){var t=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.yieldLoop()];case 1:return[2,(_state.sent(),t._running)]}})})()}},{key:"__queued__",value:function __queued__(){var t=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.yieldLoop()];case 1:return[2,(_state.sent(),t.instance.queued())]}})})()}},{key:"__done__",value:function __done__(){var t=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.yieldLoop()];case 1:return[2,(_state.sent(),t._done)]}})})()}},{key:"__groupCheck__",value:function __groupCheck__(t){var r=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),r._nextRequest+r.timeout<t)]}})})()}},{key:"computeCapacity",value:function computeCapacity(){var t,r,n=this.storeOptions;return t=n.maxConcurrent,r=n.reservoir,t!=null&&r!=null?Math.min(t-this._running,r):t!=null?t-this._running:r!=null?r:null}},{key:"conditionsCheck",value:function conditionsCheck(t){var r;return r=this.computeCapacity(),r==null||t<=r}},{key:"__incrementReservoir__",value:function __incrementReservoir__(t){var r=this;return tu(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),n=r.storeOptions.reservoir+=t,r.instance._drainAll(r.computeCapacity()),n)]}})})()}},{key:"__currentReservoir__",value:function __currentReservoir__(){var t=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.yieldLoop()];case 1:return[2,(_state.sent(),t.storeOptions.reservoir)]}})})()}},{key:"isBlocked",value:function isBlocked(t){return this._unblockTime>=t}},{key:"check",value:function check(t,r){return this.conditionsCheck(t)&&this._nextRequest-r<=0}},{key:"__check__",value:function __check__(t){var r=this;return tu(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.yieldLoop()];case 1:return[2,(_state.sent(),n=Date.now(),r.check(t,n))]}})})()}},{key:"__register__",value:function __register__(t,r,n){var i=this;return tu(function(){var o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,i.yieldLoop()];case 1:return[2,(_state.sent(),o=Date.now(),i.conditionsCheck(r)?(i._running+=r,i.storeOptions.reservoir!=null&&(i.storeOptions.reservoir-=r),a=Math.max(i._nextRequest-o,0),i._nextRequest=o+a+i.storeOptions.minTime,{success:!0,wait:a,reservoir:i.storeOptions.reservoir}):{success:!1})]}})})()}},{key:"strategyIsBlock",value:function strategyIsBlock(){return this.storeOptions.strategy===3}},{key:"__submit__",value:function __submit__(t,r){var n=this;return tu(function(){var i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.yieldLoop()];case 1:if(_state.sent(),n.storeOptions.maxConcurrent!=null&&r>n.storeOptions.maxConcurrent)throw new Rge("Impossible to add a job having a weight of ".concat(r," to a limiter having a maxConcurrent setting of ").concat(n.storeOptions.maxConcurrent));return[2,(o=Date.now(),a=n.storeOptions.highWater!=null&&t===n.storeOptions.highWater&&!n.check(r,o),i=n.strategyIsBlock()&&(a||n.isBlocked(o)),i&&(n._unblockTime=o+n.computePenalty(),n._nextRequest=n._unblockTime+n.storeOptions.minTime,n.instance._dropAllQueued()),{reachedHWM:a,blocked:i,strategy:n.storeOptions.strategy})]}})})()}},{key:"__free__",value:function __free__(t,r){var n=this;return tu(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.yieldLoop()];case 1:return[2,(_state.sent(),n._running-=r,n._done+=r,n.instance._drainAll(n.computeCapacity()),{running:n._running})]}})})()}}]);return Mge}();Oge.exports=Mge});var Nge=Be(function(Smr,Dst){Dst.exports={"blacklist_client.lua":"local blacklist = ARGV[num_static_argv + 1]\n\nif redis.call('zscore', client_last_seen_key, blacklist) then\n redis.call('zadd', client_last_seen_key, 0, blacklist)\nend\n\n\nreturn {}\n","check.lua":"local weight = tonumber(ARGV[num_static_argv + 1])\n\nlocal capacity = process_tick(now, false)['capacity']\nlocal nextRequest = tonumber(redis.call('hget', settings_key, 'nextRequest'))\n\nreturn conditions_check(capacity, weight) and nextRequest - now <= 0\n","conditions_check.lua":"local conditions_check = function (capacity, weight)\n return capacity == nil or weight <= capacity\nend\n","current_reservoir.lua":"return process_tick(now, false)['reservoir']\n","done.lua":"process_tick(now, false)\n\nreturn tonumber(redis.call('hget', settings_key, 'done'))\n","free.lua":"local index = ARGV[num_static_argv + 1]\n\nredis.call('zadd', job_expirations_key, 0, index)\n\nreturn process_tick(now, false)['running']\n","get_time.lua":"redis.replicate_commands()\n\nlocal get_time = function ()\n local time = redis.call('time')\n\n return tonumber(time[1]..string.sub(time[2], 1, 3))\nend\n","group_check.lua":"return not (redis.call('exists', settings_key) == 1)\n","heartbeat.lua":"process_tick(now, true)\n","increment_reservoir.lua":"local incr = tonumber(ARGV[num_static_argv + 1])\n\nredis.call('hincrby', settings_key, 'reservoir', incr)\n\nlocal reservoir = process_tick(now, true)['reservoir']\n\nlocal groupTimeout = tonumber(redis.call('hget', settings_key, 'groupTimeout'))\nrefresh_expiration(0, 0, groupTimeout)\n\nreturn reservoir\n","init.lua":"local clear = tonumber(ARGV[num_static_argv + 1])\nlocal limiter_version = ARGV[num_static_argv + 2]\nlocal num_local_argv = num_static_argv + 2\n\nif clear == 1 then\n redis.call('del', unpack(KEYS))\nend\n\nif redis.call('exists', settings_key) == 0 then\n -- Create\n local args = {'hmset', settings_key}\n\n for i = num_local_argv + 1, #ARGV do\n table.insert(args, ARGV[i])\n end\n\n redis.call(unpack(args))\n redis.call('hmset', settings_key,\n 'nextRequest', now,\n 'lastReservoirRefresh', now,\n 'lastReservoirIncrease', now,\n 'running', 0,\n 'done', 0,\n 'unblockTime', 0,\n 'capacityPriorityCounter', 0\n )\n\nelse\n -- Apply migrations\n local settings = redis.call('hmget', settings_key,\n 'id',\n 'version'\n )\n local id = settings[1]\n local current_version = settings[2]\n\n if current_version ~= limiter_version then\n local version_digits = {}\n for k, v in string.gmatch(current_version, \"([^.]+)\") do\n table.insert(version_digits, tonumber(k))\n end\n\n -- 2.10.0\n if version_digits[2] < 10 then\n redis.call('hsetnx', settings_key, 'reservoirRefreshInterval', '')\n redis.call('hsetnx', settings_key, 'reservoirRefreshAmount', '')\n redis.call('hsetnx', settings_key, 'lastReservoirRefresh', '')\n redis.call('hsetnx', settings_key, 'done', 0)\n redis.call('hset', settings_key, 'version', '2.10.0')\n end\n\n -- 2.11.1\n if version_digits[2] < 11 or (version_digits[2] == 11 and version_digits[3] < 1) then\n if redis.call('hstrlen', settings_key, 'lastReservoirRefresh') == 0 then\n redis.call('hmset', settings_key,\n 'lastReservoirRefresh', now,\n 'version', '2.11.1'\n )\n end\n end\n\n -- 2.14.0\n if version_digits[2] < 14 then\n local old_running_key = 'b_'..id..'_running'\n local old_executing_key = 'b_'..id..'_executing'\n\n if redis.call('exists', old_running_key) == 1 then\n redis.call('rename', old_running_key, job_weights_key)\n end\n if redis.call('exists', old_executing_key) == 1 then\n redis.call('rename', old_executing_key, job_expirations_key)\n end\n redis.call('hset', settings_key, 'version', '2.14.0')\n end\n\n -- 2.15.2\n if version_digits[2] < 15 or (version_digits[2] == 15 and version_digits[3] < 2) then\n redis.call('hsetnx', settings_key, 'capacityPriorityCounter', 0)\n redis.call('hset', settings_key, 'version', '2.15.2')\n end\n\n -- 2.17.0\n if version_digits[2] < 17 then\n redis.call('hsetnx', settings_key, 'clientTimeout', 10000)\n redis.call('hset', settings_key, 'version', '2.17.0')\n end\n\n -- 2.18.0\n if version_digits[2] < 18 then\n redis.call('hsetnx', settings_key, 'reservoirIncreaseInterval', '')\n redis.call('hsetnx', settings_key, 'reservoirIncreaseAmount', '')\n redis.call('hsetnx', settings_key, 'reservoirIncreaseMaximum', '')\n redis.call('hsetnx', settings_key, 'lastReservoirIncrease', now)\n redis.call('hset', settings_key, 'version', '2.18.0')\n end\n\n end\n\n process_tick(now, false)\nend\n\nlocal groupTimeout = tonumber(redis.call('hget', settings_key, 'groupTimeout'))\nrefresh_expiration(0, 0, groupTimeout)\n\nreturn {}\n","process_tick.lua":"local process_tick = function (now, always_publish)\n\n local compute_capacity = function (maxConcurrent, running, reservoir)\n if maxConcurrent ~= nil and reservoir ~= nil then\n return math.min((maxConcurrent - running), reservoir)\n elseif maxConcurrent ~= nil then\n return maxConcurrent - running\n elseif reservoir ~= nil then\n return reservoir\n else\n return nil\n end\n end\n\n local settings = redis.call('hmget', settings_key,\n 'id',\n 'maxConcurrent',\n 'running',\n 'reservoir',\n 'reservoirRefreshInterval',\n 'reservoirRefreshAmount',\n 'lastReservoirRefresh',\n 'reservoirIncreaseInterval',\n 'reservoirIncreaseAmount',\n 'reservoirIncreaseMaximum',\n 'lastReservoirIncrease',\n 'capacityPriorityCounter',\n 'clientTimeout'\n )\n local id = settings[1]\n local maxConcurrent = tonumber(settings[2])\n local running = tonumber(settings[3])\n local reservoir = tonumber(settings[4])\n local reservoirRefreshInterval = tonumber(settings[5])\n local reservoirRefreshAmount = tonumber(settings[6])\n local lastReservoirRefresh = tonumber(settings[7])\n local reservoirIncreaseInterval = tonumber(settings[8])\n local reservoirIncreaseAmount = tonumber(settings[9])\n local reservoirIncreaseMaximum = tonumber(settings[10])\n local lastReservoirIncrease = tonumber(settings[11])\n local capacityPriorityCounter = tonumber(settings[12])\n local clientTimeout = tonumber(settings[13])\n\n local initial_capacity = compute_capacity(maxConcurrent, running, reservoir)\n\n --\n -- Process 'running' changes\n --\n local expired = redis.call('zrangebyscore', job_expirations_key, '-inf', '('..now)\n\n if #expired > 0 then\n redis.call('zremrangebyscore', job_expirations_key, '-inf', '('..now)\n\n local flush_batch = function (batch, acc)\n local weights = redis.call('hmget', job_weights_key, unpack(batch))\n redis.call('hdel', job_weights_key, unpack(batch))\n local clients = redis.call('hmget', job_clients_key, unpack(batch))\n redis.call('hdel', job_clients_key, unpack(batch))\n\n -- Calculate sum of removed weights\n for i = 1, #weights do\n acc['total'] = acc['total'] + (tonumber(weights[i]) or 0)\n end\n\n -- Calculate sum of removed weights by client\n local client_weights = {}\n for i = 1, #clients do\n local removed = tonumber(weights[i]) or 0\n if removed > 0 then\n acc['client_weights'][clients[i]] = (acc['client_weights'][clients[i]] or 0) + removed\n end\n end\n end\n\n local acc = {\n ['total'] = 0,\n ['client_weights'] = {}\n }\n local batch_size = 1000\n\n -- Compute changes to Zsets and apply changes to Hashes\n for i = 1, #expired, batch_size do\n local batch = {}\n for j = i, math.min(i + batch_size - 1, #expired) do\n table.insert(batch, expired[j])\n end\n\n flush_batch(batch, acc)\n end\n\n -- Apply changes to Zsets\n if acc['total'] > 0 then\n redis.call('hincrby', settings_key, 'done', acc['total'])\n running = tonumber(redis.call('hincrby', settings_key, 'running', -acc['total']))\n end\n\n for client, weight in pairs(acc['client_weights']) do\n redis.call('zincrby', client_running_key, -weight, client)\n end\n end\n\n --\n -- Process 'reservoir' changes\n --\n local reservoirRefreshActive = reservoirRefreshInterval ~= nil and reservoirRefreshAmount ~= nil\n if reservoirRefreshActive and now >= lastReservoirRefresh + reservoirRefreshInterval then\n reservoir = reservoirRefreshAmount\n redis.call('hmset', settings_key,\n 'reservoir', reservoir,\n 'lastReservoirRefresh', now\n )\n end\n\n local reservoirIncreaseActive = reservoirIncreaseInterval ~= nil and reservoirIncreaseAmount ~= nil\n if reservoirIncreaseActive and now >= lastReservoirIncrease + reservoirIncreaseInterval then\n local num_intervals = math.floor((now - lastReservoirIncrease) / reservoirIncreaseInterval)\n local incr = reservoirIncreaseAmount * num_intervals\n if reservoirIncreaseMaximum ~= nil then\n incr = math.min(incr, reservoirIncreaseMaximum - (reservoir or 0))\n end\n if incr > 0 then\n reservoir = (reservoir or 0) + incr\n end\n redis.call('hmset', settings_key,\n 'reservoir', reservoir,\n 'lastReservoirIncrease', lastReservoirIncrease + (num_intervals * reservoirIncreaseInterval)\n )\n end\n\n --\n -- Clear unresponsive clients\n --\n local unresponsive = redis.call('zrangebyscore', client_last_seen_key, '-inf', (now - clientTimeout))\n local unresponsive_lookup = {}\n local terminated_clients = {}\n for i = 1, #unresponsive do\n unresponsive_lookup[unresponsive[i]] = true\n if tonumber(redis.call('zscore', client_running_key, unresponsive[i])) == 0 then\n table.insert(terminated_clients, unresponsive[i])\n end\n end\n if #terminated_clients > 0 then\n redis.call('zrem', client_running_key, unpack(terminated_clients))\n redis.call('hdel', client_num_queued_key, unpack(terminated_clients))\n redis.call('zrem', client_last_registered_key, unpack(terminated_clients))\n redis.call('zrem', client_last_seen_key, unpack(terminated_clients))\n end\n\n --\n -- Broadcast capacity changes\n --\n local final_capacity = compute_capacity(maxConcurrent, running, reservoir)\n\n if always_publish or (initial_capacity ~= nil and final_capacity == nil) then\n -- always_publish or was not unlimited, now unlimited\n redis.call('publish', 'b_'..id, 'capacity:'..(final_capacity or ''))\n\n elseif initial_capacity ~= nil and final_capacity ~= nil and final_capacity > initial_capacity then\n -- capacity was increased\n -- send the capacity message to the limiter having the lowest number of running jobs\n -- the tiebreaker is the limiter having not registered a job in the longest time\n\n local lowest_concurrency_value = nil\n local lowest_concurrency_clients = {}\n local lowest_concurrency_last_registered = {}\n local client_concurrencies = redis.call('zrange', client_running_key, 0, -1, 'withscores')\n\n for i = 1, #client_concurrencies, 2 do\n local client = client_concurrencies[i]\n local concurrency = tonumber(client_concurrencies[i+1])\n\n if (\n lowest_concurrency_value == nil or lowest_concurrency_value == concurrency\n ) and (\n not unresponsive_lookup[client]\n ) and (\n tonumber(redis.call('hget', client_num_queued_key, client)) > 0\n ) then\n lowest_concurrency_value = concurrency\n table.insert(lowest_concurrency_clients, client)\n local last_registered = tonumber(redis.call('zscore', client_last_registered_key, client))\n table.insert(lowest_concurrency_last_registered, last_registered)\n end\n end\n\n if #lowest_concurrency_clients > 0 then\n local position = 1\n local earliest = lowest_concurrency_last_registered[1]\n\n for i,v in ipairs(lowest_concurrency_last_registered) do\n if v < earliest then\n position = i\n earliest = v\n end\n end\n\n local next_client = lowest_concurrency_clients[position]\n redis.call('publish', 'b_'..id,\n 'capacity-priority:'..(final_capacity or '')..\n ':'..next_client..\n ':'..capacityPriorityCounter\n )\n redis.call('hincrby', settings_key, 'capacityPriorityCounter', '1')\n else\n redis.call('publish', 'b_'..id, 'capacity:'..(final_capacity or ''))\n end\n end\n\n return {\n ['capacity'] = final_capacity,\n ['running'] = running,\n ['reservoir'] = reservoir\n }\nend\n","queued.lua":"local clientTimeout = tonumber(redis.call('hget', settings_key, 'clientTimeout'))\nlocal valid_clients = redis.call('zrangebyscore', client_last_seen_key, (now - clientTimeout), 'inf')\nlocal client_queued = redis.call('hmget', client_num_queued_key, unpack(valid_clients))\n\nlocal sum = 0\nfor i = 1, #client_queued do\n sum = sum + tonumber(client_queued[i])\nend\n\nreturn sum\n","refresh_expiration.lua":"local refresh_expiration = function (now, nextRequest, groupTimeout)\n\n if groupTimeout ~= nil then\n local ttl = (nextRequest + groupTimeout) - now\n\n for i = 1, #KEYS do\n redis.call('pexpire', KEYS[i], ttl)\n end\n end\n\nend\n","refs.lua":"local settings_key = KEYS[1]\nlocal job_weights_key = KEYS[2]\nlocal job_expirations_key = KEYS[3]\nlocal job_clients_key = KEYS[4]\nlocal client_running_key = KEYS[5]\nlocal client_num_queued_key = KEYS[6]\nlocal client_last_registered_key = KEYS[7]\nlocal client_last_seen_key = KEYS[8]\n\nlocal now = tonumber(ARGV[1])\nlocal client = ARGV[2]\n\nlocal num_static_argv = 2\n","register.lua":"local index = ARGV[num_static_argv + 1]\nlocal weight = tonumber(ARGV[num_static_argv + 2])\nlocal expiration = tonumber(ARGV[num_static_argv + 3])\n\nlocal state = process_tick(now, false)\nlocal capacity = state['capacity']\nlocal reservoir = state['reservoir']\n\nlocal settings = redis.call('hmget', settings_key,\n 'nextRequest',\n 'minTime',\n 'groupTimeout'\n)\nlocal nextRequest = tonumber(settings[1])\nlocal minTime = tonumber(settings[2])\nlocal groupTimeout = tonumber(settings[3])\n\nif conditions_check(capacity, weight) then\n\n redis.call('hincrby', settings_key, 'running', weight)\n redis.call('hset', job_weights_key, index, weight)\n if expiration ~= nil then\n redis.call('zadd', job_expirations_key, now + expiration, index)\n end\n redis.call('hset', job_clients_key, index, client)\n redis.call('zincrby', client_running_key, weight, client)\n redis.call('hincrby', client_num_queued_key, client, -1)\n redis.call('zadd', client_last_registered_key, now, client)\n\n local wait = math.max(nextRequest - now, 0)\n local newNextRequest = now + wait + minTime\n\n if reservoir == nil then\n redis.call('hset', settings_key,\n 'nextRequest', newNextRequest\n )\n else\n reservoir = reservoir - weight\n redis.call('hmset', settings_key,\n 'reservoir', reservoir,\n 'nextRequest', newNextRequest\n )\n end\n\n refresh_expiration(now, newNextRequest, groupTimeout)\n\n return {true, wait, reservoir}\n\nelse\n return {false}\nend\n","register_client.lua":"local queued = tonumber(ARGV[num_static_argv + 1])\n\n-- Could have been re-registered concurrently\nif not redis.call('zscore', client_last_seen_key, client) then\n redis.call('zadd', client_running_key, 0, client)\n redis.call('hset', client_num_queued_key, client, queued)\n redis.call('zadd', client_last_registered_key, 0, client)\nend\n\nredis.call('zadd', client_last_seen_key, now, client)\n\nreturn {}\n","running.lua":"return process_tick(now, false)['running']\n","submit.lua":"local queueLength = tonumber(ARGV[num_static_argv + 1])\nlocal weight = tonumber(ARGV[num_static_argv + 2])\n\nlocal capacity = process_tick(now, false)['capacity']\n\nlocal settings = redis.call('hmget', settings_key,\n 'id',\n 'maxConcurrent',\n 'highWater',\n 'nextRequest',\n 'strategy',\n 'unblockTime',\n 'penalty',\n 'minTime',\n 'groupTimeout'\n)\nlocal id = settings[1]\nlocal maxConcurrent = tonumber(settings[2])\nlocal highWater = tonumber(settings[3])\nlocal nextRequest = tonumber(settings[4])\nlocal strategy = tonumber(settings[5])\nlocal unblockTime = tonumber(settings[6])\nlocal penalty = tonumber(settings[7])\nlocal minTime = tonumber(settings[8])\nlocal groupTimeout = tonumber(settings[9])\n\nif maxConcurrent ~= nil and weight > maxConcurrent then\n return redis.error_reply('OVERWEIGHT:'..weight..':'..maxConcurrent)\nend\n\nlocal reachedHWM = (highWater ~= nil and queueLength == highWater\n and not (\n conditions_check(capacity, weight)\n and nextRequest - now <= 0\n )\n)\n\nlocal blocked = strategy == 3 and (reachedHWM or unblockTime >= now)\n\nif blocked then\n local computedPenalty = penalty\n if computedPenalty == nil then\n if minTime == 0 then\n computedPenalty = 5000\n else\n computedPenalty = 15 * minTime\n end\n end\n\n local newNextRequest = now + computedPenalty + minTime\n\n redis.call('hmset', settings_key,\n 'unblockTime', now + computedPenalty,\n 'nextRequest', newNextRequest\n )\n\n local clients_queued_reset = redis.call('hkeys', client_num_queued_key)\n local queued_reset = {}\n for i = 1, #clients_queued_reset do\n table.insert(queued_reset, clients_queued_reset[i])\n table.insert(queued_reset, 0)\n end\n redis.call('hmset', client_num_queued_key, unpack(queued_reset))\n\n redis.call('publish', 'b_'..id, 'blocked:')\n\n refresh_expiration(now, newNextRequest, groupTimeout)\nend\n\nif not blocked and not reachedHWM then\n redis.call('hincrby', client_num_queued_key, client, 1)\nend\n\nreturn {reachedHWM, blocked, strategy}\n","update_settings.lua":"local args = {'hmset', settings_key}\n\nfor i = num_static_argv + 1, #ARGV do\n table.insert(args, ARGV[i])\nend\n\nredis.call(unpack(args))\n\nprocess_tick(now, true)\n\nlocal groupTimeout = tonumber(redis.call('hget', settings_key, 'groupTimeout'))\nrefresh_expiration(0, 0, groupTimeout)\n\nreturn {}\n","validate_client.lua":"if not redis.call('zscore', client_last_seen_key, client) then\n return redis.error_reply('UNKNOWN_CLIENT')\nend\n\nredis.call('zadd', client_last_seen_key, now, client)\n","validate_keys.lua":"if not (redis.call('exists', settings_key) == 1) then\n return redis.error_reply('SETTINGS_KEY_NOT_FOUND')\nend\n"}});var yA=Be(function(No){"use strict";var gA,qi,xA;qi=Nge();gA={refs:qi["refs.lua"],validate_keys:qi["validate_keys.lua"],validate_client:qi["validate_client.lua"],refresh_expiration:qi["refresh_expiration.lua"],process_tick:qi["process_tick.lua"],conditions_check:qi["conditions_check.lua"],get_time:qi["get_time.lua"]};No.allKeys=function(e){return["b_".concat(e,"_settings"),"b_".concat(e,"_job_weights"),"b_".concat(e,"_job_expirations"),"b_".concat(e,"_job_clients"),"b_".concat(e,"_client_running"),"b_".concat(e,"_client_num_queued"),"b_".concat(e,"_client_last_registered"),"b_".concat(e,"_client_last_seen")]};xA={init:{keys:No.allKeys,headers:["process_tick"],refresh_expiration:!0,code:qi["init.lua"]},group_check:{keys:No.allKeys,headers:[],refresh_expiration:!1,code:qi["group_check.lua"]},register_client:{keys:No.allKeys,headers:["validate_keys"],refresh_expiration:!1,code:qi["register_client.lua"]},blacklist_client:{keys:No.allKeys,headers:["validate_keys","validate_client"],refresh_expiration:!1,code:qi["blacklist_client.lua"]},heartbeat:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!1,code:qi["heartbeat.lua"]},update_settings:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!0,code:qi["update_settings.lua"]},running:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!1,code:qi["running.lua"]},queued:{keys:No.allKeys,headers:["validate_keys","validate_client"],refresh_expiration:!1,code:qi["queued.lua"]},done:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!1,code:qi["done.lua"]},check:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick","conditions_check"],refresh_expiration:!1,code:qi["check.lua"]},submit:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick","conditions_check"],refresh_expiration:!0,code:qi["submit.lua"]},register:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick","conditions_check"],refresh_expiration:!0,code:qi["register.lua"]},free:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!0,code:qi["free.lua"]},current_reservoir:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!1,code:qi["current_reservoir.lua"]},increment_reservoir:{keys:No.allKeys,headers:["validate_keys","validate_client","process_tick"],refresh_expiration:!0,code:qi["increment_reservoir.lua"]}};No.names=Object.keys(xA);No.keys=function(e,t){return xA[e].keys(t)};No.payload=function(e){var t;return t=xA[e],Array.prototype.concat(gA.refs,t.headers.map(function(r){return gA[r]}),t.refresh_expiration?gA.refresh_expiration:"",t.code).join("\n")}});var vA=Be(function(exports,module){"use strict";var asyncGeneratorStep=function asyncGeneratorStep(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var _asyncToGenerator=function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){asyncGeneratorStep(o,n,i,a,s,"next",l)}function s(l){asyncGeneratorStep(o,n,i,a,s,"throw",l)}a(void 0)})}};var Events,RedisConnection,Scripts,parser;parser=_f();Events=A0();Scripts=yA();RedisConnection=(function(){var RedisConnection=/*#__PURE__*/function(){function RedisConnection(){var _this=this;var options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,RedisConnection);parser.load(options,this.defaults,this),this.Redis==null&&(this.Redis=eval("require")("redis")),this.Events==null&&(this.Events=new Events(this)),this.terminated=!1,this.client==null&&(this.client=this.Redis.createClient(this.clientOptions)),this.subscriber=this.client.duplicate(),this.limiters={},this.shas={},this.ready=this.Promise.all([this._setup(this.client,!1),this._setup(this.subscriber,!0)]).then(function(){return _this._loadScripts()}).then(function(){return{client:_this.client,subscriber:_this.subscriber}})}_create_class(RedisConnection,[{key:"_setup",value:function _setup(e,t){var _this=this;return e.setMaxListeners(0),new this.Promise(function(r,n){return e.on("error",function(i){return _this.Events.trigger("error",i)}),t&&e.on("message",function(i,o){var a;return(a=_this.limiters[i])!=null?a._store.onMessage(i,o):void 0}),e.ready?r():e.once("ready",r)})}},{key:"_loadScript",value:function _loadScript(e){var _this=this;return new this.Promise(function(t,r){var n;return n=Scripts.payload(e),_this.client.multi([["script","load",n]]).exec(function(i,o){return i!=null?r(i):(_this.shas[e]=o[0],t(o[0]))})})}},{key:"_loadScripts",value:function _loadScripts(){var _this=this;return this.Promise.all(Scripts.names.map(function(e){return _this._loadScript(e)}))}},{key:"__runCommand__",value:function __runCommand__(e){var t=this;return _asyncToGenerator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.ready];case 1:return[2,(_state.sent(),new t.Promise(function(r,n){return t.client.multi([e]).exec_atomic(function(i,o){return i!=null?n(i):r(o[0])})}))]}})})()}},{key:"__addLimiter__",value:function __addLimiter__(e){var _this=this;return this.Promise.all([e.channel(),e.channel_client()].map(function(t){return new _this.Promise(function(r,n){var i;return i=function(o){if(o===t)return _this.subscriber.removeListener("subscribe",i),_this.limiters[t]=e,r()},_this.subscriber.on("subscribe",i),_this.subscriber.subscribe(t)})}))}},{key:"__removeLimiter__",value:function __removeLimiter__(e){var t=this;return this.Promise.all([e.channel(),e.channel_client()].map(function(){var r=_asyncToGenerator(function(n){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=t.terminated;if(_tmp)return[3,2];return[4,new t.Promise(function(i,o){return t.subscriber.unsubscribe(n,function(a,s){if(a!=null)return o(a);if(s===n)return i()})})];case 1:_tmp=_state.sent();_state.label=2;case 2:return[2,(_tmp,delete t.limiters[n])]}})});return function(n){return r.apply(this,arguments)}}()))}},{key:"__scriptArgs__",value:function __scriptArgs__(e,t,r,n){var i;return i=Scripts.keys(e,t),[this.shas[e],i.length].concat(i,r,n)}},{key:"__scriptFn__",value:function __scriptFn__(e){return this.client.evalsha.bind(this.client)}},{key:"disconnect",value:function disconnect(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var t,r,n,i;for(i=Object.keys(this.limiters),t=0,n=i.length;t<n;t++)r=i[t],clearInterval(this.limiters[r]._store.heartbeat);return this.limiters={},this.terminated=!0,this.client.end(e),this.subscriber.end(e),this.Promise.resolve()}}]);return RedisConnection}();return RedisConnection.prototype.datastore="redis",RedisConnection.prototype.defaults={Redis:null,clientOptions:{},client:null,Promise:Promise,Events:null},RedisConnection}).call(void 0);module.exports=RedisConnection});var _A=Be(function(exports,module){"use strict";var _slicedToArray=function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()};var _nonIterableRest=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var _iterableToArrayLimit=function _iterableToArrayLimit(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return r};var _arrayWithHoles=function _arrayWithHoles(e){if(Array.isArray(e))return e};var asyncGeneratorStep=function asyncGeneratorStep(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var _asyncToGenerator=function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){asyncGeneratorStep(o,n,i,a,s,"next",l)}function s(l){asyncGeneratorStep(o,n,i,a,s,"throw",l)}a(void 0)})}};var Events,IORedisConnection,Scripts,parser;parser=_f();Events=A0();Scripts=yA();IORedisConnection=(function(){var IORedisConnection=/*#__PURE__*/function(){function IORedisConnection(){var _this=this;var options=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,IORedisConnection);parser.load(options,this.defaults,this),this.Redis==null&&(this.Redis=eval("require")("ioredis")),this.Events==null&&(this.Events=new Events(this)),this.terminated=!1,this.clusterNodes!=null?(this.client=new this.Redis.Cluster(this.clusterNodes,this.clientOptions),this.subscriber=new this.Redis.Cluster(this.clusterNodes,this.clientOptions)):this.client!=null&&this.client.duplicate==null?this.subscriber=new this.Redis.Cluster(this.client.startupNodes,this.client.options):(this.client==null&&(this.client=new this.Redis(this.clientOptions)),this.subscriber=this.client.duplicate()),this.limiters={},this.ready=this.Promise.all([this._setup(this.client,!1),this._setup(this.subscriber,!0)]).then(function(){return _this._loadScripts(),{client:_this.client,subscriber:_this.subscriber}})}_create_class(IORedisConnection,[{key:"_setup",value:function _setup(e,t){var _this=this;return e.setMaxListeners(0),new this.Promise(function(r,n){return e.on("error",function(i){return _this.Events.trigger("error",i)}),t&&e.on("message",function(i,o){var a;return(a=_this.limiters[i])!=null?a._store.onMessage(i,o):void 0}),e.status==="ready"?r():e.once("ready",r)})}},{key:"_loadScripts",value:function _loadScripts(){var _this=this;return Scripts.names.forEach(function(e){return _this.client.defineCommand(e,{lua:Scripts.payload(e)})})}},{key:"__runCommand__",value:function __runCommand__(e){var t=this;return _asyncToGenerator(function(){var r,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.ready];case 1:_state.sent();return[4,t.client.pipeline([e]).exec()];case 2:i=_state.sent(),o=_slicedToArray(i,1),a=_slicedToArray(o[0],2);return[2,(r=a[0],n=a[1],n)]}})})()}},{key:"__addLimiter__",value:function __addLimiter__(e){var _this=this;return this.Promise.all([e.channel(),e.channel_client()].map(function(t){return new _this.Promise(function(r,n){return _this.subscriber.subscribe(t,function(){return _this.limiters[t]=e,r()})})}))}},{key:"__removeLimiter__",value:function __removeLimiter__(e){var t=this;return[e.channel(),e.channel_client()].forEach(function(){var r=_asyncToGenerator(function(n){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=t.terminated;if(_tmp)return[3,2];return[4,t.subscriber.unsubscribe(n)];case 1:_tmp=_state.sent();_state.label=2;case 2:return[2,(_tmp,delete t.limiters[n])]}})});return function(n){return r.apply(this,arguments)}}())}},{key:"__scriptArgs__",value:function __scriptArgs__(e,t,r,n){var i;return i=Scripts.keys(e,t),[i.length].concat(i,r,n)}},{key:"__scriptFn__",value:function __scriptFn__(e){return this.client[e].bind(this.client)}},{key:"disconnect",value:function disconnect(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var t,r,n,i;for(i=Object.keys(this.limiters),t=0,n=i.length;t<n;t++)r=i[t],clearInterval(this.limiters[r]._store.heartbeat);return this.limiters={},this.terminated=!0,e?this.Promise.all([this.client.quit(),this.subscriber.quit()]):(this.client.disconnect(),this.subscriber.disconnect(),this.Promise.resolve())}}]);return IORedisConnection}();return IORedisConnection.prototype.datastore="ioredis",IORedisConnection.prototype.defaults={Redis:null,clientOptions:{},clusterNodes:null,client:null,Promise:Promise,Events:null},IORedisConnection}).call(void 0);module.exports=IORedisConnection});var Bge=Be(function(Emr,Uge){"use strict";var bA=function bA(e,t){return zst(e)||Fst(e,t)||Lst()};var Lst=function Lst(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var Fst=function Fst(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return r};var zst=function zst(e){if(Array.isArray(e))return e};var Dge=function Dge(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var ip=function ip(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){Dge(o,n,i,a,s,"next",l)}function s(l){Dge(o,n,i,a,s,"throw",l)}a(void 0)})}};var Lge,Fge,zge,jge,bU;bU=_f();Lge=hv();zge=vA();Fge=_A();jge=/*#__PURE__*/function(){function jge(t,r,n){var _this=this;_class_call_check(this,jge);this.instance=t,this.storeOptions=r,this.originalId=this.instance.id,this.clientId=this.instance._randomIndex(),bU.load(n,n,this),this.clients={},this.capacityPriorityCounters={},this.sharedConnection=this.connection!=null,this.connection==null&&(this.connection=this.instance.datastore==="redis"?new zge({Redis:this.Redis,clientOptions:this.clientOptions,Promise:this.Promise,Events:this.instance.Events}):this.instance.datastore==="ioredis"?new Fge({Redis:this.Redis,clientOptions:this.clientOptions,clusterNodes:this.clusterNodes,Promise:this.Promise,Events:this.instance.Events}):void 0),this.instance.connection=this.connection,this.instance.datastore=this.connection.datastore,this.ready=this.connection.ready.then(function(i){return _this.clients=i,_this.runScript("init",_this.prepareInitSettings(_this.clearDatastore))}).then(function(){return _this.connection.__addLimiter__(_this.instance)}).then(function(){return _this.runScript("register_client",[_this.instance.queued()])}).then(function(){var i;return typeof(i=_this.heartbeat=setInterval(function(){return _this.runScript("heartbeat",[]).catch(function(o){return _this.instance.Events.trigger("error",o)})},_this.heartbeatInterval)).unref=="function"&&i.unref(),_this.clients})}_create_class(jge,[{key:"__publish__",value:function __publish__(t){var r=this;return ip(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.ready];case 1:i=_state.sent();return[2,(n=i.client,n.publish(r.instance.channel(),"message:".concat(t.toString())))]}})})()}},{key:"onMessage",value:function onMessage(t,r){var n=this;return ip(function(){var i,o,a,s,l,c,d,u,p,m,h,g,x,_tmp,v;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,10,,11]);d=r.indexOf(":");h=[r.slice(0,d),r.slice(d+1)];if(!(m=h[0],a=h[1],m==="capacity"))return[3,2];return[4,n.instance._drainAll(a.length>0?~~a:void 0)];case 1:return[2,_state.sent()];case 2:if(!(m==="capacity-priority"))return[3,7];g=a.split(":"),x=bA(g,3);p=x[0],u=x[1],o=x[2],i=p.length>0?~~p:void 0;if(!(u===n.clientId))return[3,5];return[4,n.instance._drainAll(i)];case 3:s=_state.sent(),c=i!=null?i-(s||0):"";return[4,n.clients.client.publish(n.instance.channel(),"capacity-priority:".concat(c,"::").concat(o))];case 4:_tmp=_state.sent();return[3,6];case 5:_tmp=u===""?(clearTimeout(n.capacityPriorityCounters[o]),delete n.capacityPriorityCounters[o],n.instance._drainAll(i)):n.capacityPriorityCounters[o]=setTimeout(ip(function(){var _$v,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);delete n.capacityPriorityCounters[o];return[4,n.runScript("blacklist_client",[u])];case 1:_state.sent();return[4,n.instance._drainAll(i)];case 2:return[2,_state.sent()];case 3:y=_state.sent();return[2,(_$v=y,n.instance.Events.trigger("error",_$v))];case 4:return[2]}})}),1e3);_state.label=6;case 6:return[2,_tmp];case 7:if(m==="message")return[2,n.instance.Events.trigger("message",a)];if(!(m==="blocked"))return[3,9];return[4,n.instance._dropAllQueued()];case 8:return[2,_state.sent()];case 9:return[3,11];case 10:v=_state.sent();return[2,(l=v,n.instance.Events.trigger("error",l))];case 11:return[2]}})})()}},{key:"__disconnect__",value:function __disconnect__(t){return clearInterval(this.heartbeat),this.sharedConnection?this.connection.__removeLimiter__(this.instance):this.connection.disconnect(t)}},{key:"runScript",value:function runScript(t,r){var n=this;return ip(function(){var _this,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_tmp=t==="init"||t==="register_client";if(_tmp)return[3,2];return[4,n.ready];case 1:_tmp=_state.sent();_state.label=2;case 2:return[2,(_tmp,new n.Promise(function(i,o){var a,s;return a=[Date.now(),n.clientId].concat(r),n.instance.Events.trigger("debug","Calling Redis script: ".concat(t,".lua"),a),s=n.connection.__scriptArgs__(t,n.originalId,a,function(l,c){return l!=null?o(l):i(c)}),n.connection.__scriptFn__(t).apply(_this,_to_consumable_array(s))}).catch(function(i){return i.message==="SETTINGS_KEY_NOT_FOUND"?t==="heartbeat"?n.Promise.resolve():n.runScript("init",n.prepareInitSettings(!1)).then(function(){return n.runScript(t,r)}):i.message==="UNKNOWN_CLIENT"?n.runScript("register_client",[n.instance.queued()]).then(function(){return n.runScript(t,r)}):n.Promise.reject(i)}))]}})})()}},{key:"prepareArray",value:function prepareArray(t){var r,n,i,o;for(i=[],r=0,n=t.length;r<n;r++)o=t[r],i.push(o!=null?o.toString():"");return i}},{key:"prepareObject",value:function prepareObject(t){var r,n,i;r=[];for(n in t)i=t[n],r.push(n,i!=null?i.toString():"");return r}},{key:"prepareInitSettings",value:function prepareInitSettings(t){var r;return r=this.prepareObject(Object.assign({},this.storeOptions,{id:this.originalId,version:this.instance.version,groupTimeout:this.timeout,clientTimeout:this.clientTimeout})),r.unshift(t?1:0,this.instance.version),r}},{key:"convertBool",value:function convertBool(t){return!!t}},{key:"__updateSettings__",value:function __updateSettings__(t){var r=this;return ip(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.runScript("update_settings",r.prepareObject(t))];case 1:return[2,(_state.sent(),bU.overwrite(t,t,r.storeOptions))]}})})()}},{key:"__running__",value:function __running__(){return this.runScript("running",[])}},{key:"__queued__",value:function __queued__(){return this.runScript("queued",[])}},{key:"__done__",value:function __done__(){return this.runScript("done",[])}},{key:"__groupCheck__",value:function __groupCheck__(){var t=this;return ip(function(){var _;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=t.convertBool;return[4,t.runScript("group_check",[])];case 1:return[2,_.apply(t,[_state.sent()])]}})})()}},{key:"__incrementReservoir__",value:function __incrementReservoir__(t){return this.runScript("increment_reservoir",[t])}},{key:"__currentReservoir__",value:function __currentReservoir__(){return this.runScript("current_reservoir",[])}},{key:"__check__",value:function __check__(t){var r=this;return ip(function(){var _;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=r.convertBool;return[4,r.runScript("check",r.prepareArray([t]))];case 1:return[2,_.apply(r,[_state.sent()])]}})})()}},{key:"__register__",value:function __register__(t,r,n){var i=this;return ip(function(){var o,a,s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,i.runScript("register",i.prepareArray([t,r,n]))];case 1:l=_state.sent(),c=bA(l,3);return[2,(a=c[0],s=c[1],o=c[2],{success:i.convertBool(a),wait:s,reservoir:o})]}})})()}},{key:"__submit__",value:function __submit__(t,r){var n=this;return ip(function(){var i,o,a,s,l,c,d,u,h,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,n.runScript("submit",n.prepareArray([t,r]))];case 1:d=_state.sent(),u=bA(d,3);return[2,(l=u[0],i=u[1],c=u[2],{reachedHWM:n.convertBool(l),blocked:n.convertBool(i),strategy:c})];case 2:h=_state.sent();if(o=h,o.message.indexOf("OVERWEIGHT")===0){p=o.message.split(":"),m=bA(p,3);throw s=m[0],r=m[1],a=m[2],new Lge("Impossible to add a job having a weight of ".concat(r," to a limiter having a maxConcurrent setting of ").concat(a))}else throw o;return[3,3];case 3:return[2]}})})()}},{key:"__free__",value:function __free__(t,r){var n=this;return ip(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.runScript("free",n.prepareArray([t]))];case 1:return[2,(i=_state.sent(),{running:i})]}})})()}}]);return jge}();Uge.exports=jge});var Gge=Be(function(Amr,Vge){"use strict";var qge,Wge;qge=hv();Wge=/*#__PURE__*/function(){function Wge(t){_class_call_check(this,Wge);this.status=t,this._jobs={},this.counts=this.status.map(function(){return 0})}_create_class(Wge,[{key:"next",value:function next(t){var r,n;if(r=this._jobs[t],n=r+1,r!=null&&n<this.status.length)return this.counts[r]--,this.counts[n]++,this._jobs[t]++;if(r!=null)return this.counts[r]--,delete this._jobs[t]}},{key:"start",value:function start(t){var r;return r=0,this._jobs[t]=r,this.counts[r]++}},{key:"remove",value:function remove(t){var r;return r=this._jobs[t],r!=null&&(this.counts[r]--,delete this._jobs[t]),r!=null}},{key:"jobStatus",value:function jobStatus(t){var r;return(r=this.status[this._jobs[t]])!=null?r:null}},{key:"statusJobs",value:function statusJobs(t){var r,n,i,o,a;if(t!=null){if(n=this.status.indexOf(t),n<0)throw new qge("status must be one of ".concat(this.status.join(", ")));i=this._jobs,o=[];for(r in i)a=i[r],a===n&&o.push(r);return o}else return Object.keys(this._jobs)}},{key:"statusCounts",value:function statusCounts(){var _this=this;return this.counts.reduce(function(t,r,n){return t[_this.status[n]]=r,t},{})}}]);return Wge}();Vge.exports=Wge});var Yge=Be(function(Pmr,Jge){"use strict";var Hge=function Hge(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var Zge=function Zge(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){Hge(o,n,i,a,s,"next",l)}function s(l){Hge(o,n,i,a,s,"throw",l)}a(void 0)})}};var Kge,Qge;Kge=yU();Qge=/*#__PURE__*/function(){function Qge(t,r){_class_call_check(this,Qge);this.schedule=this.schedule.bind(this),this.name=t,this.Promise=r,this._running=0,this._queue=new Kge}_create_class(Qge,[{key:"isEmpty",value:function isEmpty(){return this._queue.length===0}},{key:"_tryToRun",value:function _tryToRun(){var t=this;return Zge(function(){var r,n,i,o,a,s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(t._running<1&&t._queue.length>0))return[3,2];t._running++;c=t._queue.shift();l=c.task,r=c.args,a=c.resolve,o=c.reject;return[4,Zge(function(){var d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,l.apply(void 0,_to_consumable_array(r))];case 1:return[2,(s=_state.sent(),function(){return a(s)})];case 2:d=_state.sent();return[2,(i=d,function(){return o(i)})];case 3:return[2]}})})()];case 1:return[2,(n=_state.sent(),t._running--,t._tryToRun(),n())];case 2:return[2]}})})()}},{key:"schedule",value:function schedule(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var n,i,o;return o=i=null,n=new this.Promise(function(a,s){return o=a,i=s}),this._queue.push({task:t,args:r,resolve:o,reject:i}),this._tryToRun(),n}}]);return Qge}();Jge.exports=Qge});var Xge=Be(function(Rmr,jst){jst.exports={version:"2.19.5"}});var s0e=Be(function(Mmr,a0e){"use strict";var Ust=function Ust(e,t){return Wst(e)||qst(e,t)||Bst()};var Bst=function Bst(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var qst=function qst(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return r};var Wst=function Wst(e){if(Array.isArray(e))return e};var e0e=function e0e(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var wU=function wU(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){e0e(o,n,i,a,s,"next",l)}function s(l){e0e(o,n,i,a,s,"throw",l)}a(void 0)})}};var t0e,r0e,n0e,i0e,o0e,wA;wA=_f();t0e=A0();i0e=vA();n0e=_A();o0e=yA();r0e=(function(){var e=/*#__PURE__*/function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,e);this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=r,wA.load(this.limiterOptions,this.defaults,this),this.Events=new t0e(this),this.instances={},this.Bottleneck=SU(),this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection==null&&(this.limiterOptions.datastore==="redis"?this.connection=new i0e(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore==="ioredis"&&(this.connection=new n0e(Object.assign({},this.limiterOptions,{Events:this.Events}))))}_create_class(e,[{key:"key",value:function key(){var _this=this;var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var n;return(n=this.instances[r])!=null?n:function(){var i;return i=_this.instances[r]=new _this.Bottleneck(Object.assign(_this.limiterOptions,{id:"".concat(_this.id,"-").concat(r),timeout:_this.timeout,connection:_this.connection})),_this.Events.trigger("created",i,r),i}()}},{key:"deleteKey",value:function deleteKey(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var n=this;return wU(function(){var i,o,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=n.instances[r];_tmp=n.connection;if(!_tmp)return[3,2];return[4,n.connection.__runCommand__(["del"].concat(_to_consumable_array(o0e.allKeys("".concat(n.id,"-").concat(r)))))];case 1:_tmp=i=_state.sent();_state.label=2;case 2:_tmp;_tmp1=o!=null;if(!_tmp1)return[3,4];delete n.instances[r];return[4,o.disconnect()];case 3:_tmp1=_state.sent();_state.label=4;case 4:return[2,(_tmp1,o!=null||i>0)]}})})()}},{key:"limiters",value:function limiters(){var r,n,i,o;n=this.instances,i=[];for(r in n)o=n[r],i.push({key:r,limiter:o});return i}},{key:"keys",value:function keys(){return Object.keys(this.instances)}},{key:"clusterKeys",value:function clusterKeys(){var r=this;return wU(function(){var n,i,o,a,s,l,c,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r.connection==null)return[2,r.Promise.resolve(r.keys())];l=[],n=null,u="b_".concat(r.id,"-").length,i=9;_state.label=1;case 1:if(!(n!==0))return[3,4];return[4,r.connection.__runCommand__(["scan",n!=null?n:0,"match","b_".concat(r.id,"-*_settings"),"count",1e4])];case 2:p=_state.sent(),m=Ust(p,2);for(d=m[0],o=m[1],n=~~d,a=0,c=o.length;a<c;a++)s=o[a],l.push(s.slice(u,-i));_state.label=3;case 3:return[3,1];case 4:return[2,l]}})})()}},{key:"_startAutoCleanup",value:function _startAutoCleanup(){var r=this,n;return clearInterval(this.interval),typeof(n=this.interval=setInterval(wU(function(){var i,o,a,s,l,c,_tmp,_tmp1,_tmp2,_i1,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:l=Date.now(),a=r.instances,s=[];_tmp=a;_tmp1=[];for(_tmp2 in _tmp)_tmp1.push(_tmp2);_i1=0;_state.label=1;case 1:if(!(_i1<_tmp1.length))return[3,6];_tmp2=_tmp1[_i1];if(!(_tmp2 in _tmp))return[3,5];o=_tmp2;c=a[o];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,c._store.__groupCheck__(l)];case 3:_state.sent()?s.push(r.deleteKey(o)):s.push(void 0);return[3,5];case 4:d=_state.sent();i=d,s.push(c.Events.trigger("error",i));return[3,5];case 5:_i1++;return[3,1];case 6:return[2,s]}})}),this.timeout/2)).unref=="function"?n.unref():void 0}},{key:"updateSettings",value:function updateSettings(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wA.overwrite(r,this.defaults,this),wA.overwrite(r,r,this.limiterOptions),r.timeout!=null)return this._startAutoCleanup()}},{key:"disconnect",value:function disconnect(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;var n;if(!this.sharedConnection)return(n=this.connection)!=null?n.disconnect(r):void 0}}]);return e}();return e.prototype.defaults={timeout:1e3*60*5,connection:null,Promise:Promise,id:"group-key"},e}).call(void 0);a0e.exports=r0e});var p0e=Be(function(Omr,d0e){"use strict";var l0e,u0e,c0e;c0e=_f();u0e=A0();l0e=(function(){var e=/*#__PURE__*/function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,e);this.options=r,c0e.load(this.options,this.defaults,this),this.Events=new u0e(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_create_class(e,[{key:"_resetPromise",value:function _resetPromise(){var _this=this;return this._promise=new this.Promise(function(r,n){return _this._resolve=r})}},{key:"_flush",value:function _flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger("batch",this._arr),this._arr=[],this._resetPromise()}},{key:"add",value:function add(r){var _this=this;var n;return this._arr.push(r),n=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(function(){return _this._flush()},this.maxTime)),n}}]);return e}();return e.prototype.defaults={maxTime:null,maxSize:null,Promise:Promise},e}).call(void 0);d0e.exports=l0e});var SU=Be(function($mr,k0e){"use strict";var f0e=function f0e(e,t){return x0e(e)||Vst(e,t)||g0e()};var Vst=function Vst(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return r};var SA=function SA(e){return x0e(e)||Gst(e)||g0e()};var g0e=function g0e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var Gst=function Gst(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)};var x0e=function x0e(e){if(Array.isArray(e))return e};var m0e=function m0e(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(c){r(c);return}s.done?t(l):Promise.resolve(l).then(n,i)};var kU=function kU(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(l){m0e(o,n,i,a,s,"next",l)}function s(l){m0e(o,n,i,a,s,"throw",l)}a(void 0)})}};var y0e,v0e,CU,EU,_0e,TU,b0e,w0e,S0e,AU,op,h0e=[].splice;TU=10;v0e=5;op=_f();b0e=_ge();EU=Ige();_0e=$ge();w0e=Bge();CU=A0();S0e=Gge();AU=Yge();y0e=(function(){var e=/*#__PURE__*/function(){function e(){var _this=this;var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var _len=arguments.length,n=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){n[_key-1]=arguments[_key]}_class_call_check(this,e);var i,o;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(r,n),op.load(r,this.instanceDefaults,this),this._queues=new b0e(TU),this._scheduled={},this._states=new S0e(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[])),this._limiter=null,this.Events=new CU(this),this._submitLock=new AU("submit",this.Promise),this._registerLock=new AU("register",this.Promise),o=op.load(r,this.storeDefaults,{}),this._store=(function(){if(this.datastore==="redis"||this.datastore==="ioredis"||this.connection!=null)return i=op.load(r,this.redisStoreDefaults,{}),new w0e(this,o,i);if(this.datastore==="local")return i=op.load(r,this.localStoreDefaults,{}),new _0e(this,o,i);throw new e.prototype.BottleneckError("Invalid datastore type: ".concat(this.datastore))}).call(this),this._queues.on("leftzero",function(){var a;return(a=_this._store.heartbeat)!=null&&typeof a.ref=="function"?a.ref():void 0}),this._queues.on("zero",function(){var a;return(a=_this._store.heartbeat)!=null&&typeof a.unref=="function"?a.unref():void 0})}_create_class(e,[{key:"_validateOptions",value:function _validateOptions(r,n){if(!(r!=null&&(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&n.length===0))throw new e.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}},{key:"ready",value:function ready(){return this._store.ready}},{key:"clients",value:function clients(){return this._store.clients}},{key:"channel",value:function channel(){return"b_".concat(this.id)}},{key:"channel_client",value:function channel_client(){return"b_".concat(this.id,"_").concat(this._store.clientId)}},{key:"publish",value:function publish(r){return this._store.__publish__(r)}},{key:"disconnect",value:function disconnect(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._store.__disconnect__(r)}},{key:"chain",value:function chain(r){return this._limiter=r,this}},{key:"queued",value:function queued(r){return this._queues.queued(r)}},{key:"clusterQueued",value:function clusterQueued(){return this._store.__queued__()}},{key:"empty",value:function empty(){return this.queued()===0&&this._submitLock.isEmpty()}},{key:"running",value:function running(){return this._store.__running__()}},{key:"done",value:function done(){return this._store.__done__()}},{key:"jobStatus",value:function jobStatus(r){return this._states.jobStatus(r)}},{key:"jobs",value:function jobs(r){return this._states.statusJobs(r)}},{key:"counts",value:function counts(){return this._states.statusCounts()}},{key:"_randomIndex",value:function _randomIndex(){return Math.random().toString(36).slice(2)}},{key:"check",value:function check(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return this._store.__check__(r)}},{key:"_clearGlobalState",value:function _clearGlobalState(r){return this._scheduled[r]!=null?(clearTimeout(this._scheduled[r].expiration),delete this._scheduled[r],!0):!1}},{key:"_free",value:function _free(r,n,i,o){var a=this;return kU(function(){var s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,a._store.__free__(r,i.weight)];case 1:c=_state.sent();if(l=c.running,a.Events.trigger("debug","Freed ".concat(i.id),o),l===0&&a.empty())return[2,a.Events.trigger("idle")];return[3,3];case 2:d=_state.sent();return[2,(s=d,a.Events.trigger("error",s))];case 3:return[2]}})})()}},{key:"_run",value:function _run(r,n,i){var _this=this;var o,a,s;return n.doRun(),o=this._clearGlobalState.bind(this,r),s=this._run.bind(this,r,n),a=this._free.bind(this,r,n),this._scheduled[r]={timeout:setTimeout(function(){return n.doExecute(_this._limiter,o,s,a)},i),expiration:n.options.expiration!=null?setTimeout(function(){return n.doExpire(o,s,a)},i+n.options.expiration):void 0,job:n}}},{key:"_drainOne",value:function _drainOne(r){var _this=this;return this._registerLock.schedule(function(){var n,i,o,a,s;if(_this.queued()===0)return _this.Promise.resolve(null);s=_this._queues.getFirst();var l=o=s.first();return a=l.options,n=l.args,r!=null&&a.weight>r?_this.Promise.resolve(null):(_this.Events.trigger("debug","Draining ".concat(a.id),{args:n,options:a}),i=_this._randomIndex(),_this._store.__register__(i,a.weight,a.expiration).then(function(param){var c=param.success,d=param.wait,u=param.reservoir;var p;return _this.Events.trigger("debug","Drained ".concat(a.id),{success:c,args:n,options:a}),c?(s.shift(),p=_this.empty(),p&&_this.Events.trigger("empty"),u===0&&_this.Events.trigger("depleted",p),_this._run(i,o,d),_this.Promise.resolve(a.weight)):_this.Promise.resolve(null)}))})}},{key:"_drainAll",value:function _drainAll(r){var _this=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._drainOne(r).then(function(i){var o;return i!=null?(o=r!=null?r-i:r,_this._drainAll(o,n+i)):_this.Promise.resolve(n)}).catch(function(i){return _this.Events.trigger("error",i)})}},{key:"_dropAllQueued",value:function _dropAllQueued(r){return this._queues.shiftAll(function(n){return n.doDrop({message:r})})}},{key:"stop",value:function stop(){var _this=this;var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,i;return r=op.load(r,this.stopDefaults),i=function(o){var a;return a=function(){var s;return s=_this._states.counts,s[0]+s[1]+s[2]+s[3]===o},new _this.Promise(function(s,l){return a()?s():_this.on("done",function(){if(a())return _this.removeAllListeners("done"),s()})})},n=r.dropWaitingJobs?(this._run=function n(o,a){return a.doDrop({message:r.dropErrorMessage})},this._drainOne=function(){return _this.Promise.resolve(null)},this._registerLock.schedule(function(){return _this._submitLock.schedule(function(){var o,a,s;a=_this._scheduled;for(o in a)s=a[o],_this.jobStatus(s.job.options.id)==="RUNNING"&&(clearTimeout(s.timeout),clearTimeout(s.expiration),s.job.doDrop({message:r.dropErrorMessage}));return _this._dropAllQueued(r.dropErrorMessage),i(0)})})):this.schedule({priority:TU-1,weight:0},function(){return i(1)}),this._receive=function(o){return o._reject(new e.prototype.BottleneckError(r.enqueueErrorMessage))},this.stop=function(){return _this.Promise.reject(new e.prototype.BottleneckError("stop() has already been called"))},n}},{key:"_addToQueue",value:function _addToQueue(r){var n=this;return kU(function(){var i,o,a,s,l,c,d,u,p,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=r.args,s=r.options;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,n._store.__submit__(n.queued(),s.weight)];case 2:u=_state.sent();l=u.reachedHWM,o=u.blocked,d=u.strategy;return[3,4];case 3:p=_state.sent();return[2,(a=p,n.Events.trigger("debug","Could not queue ".concat(s.id),{args:i,options:s,error:a}),r.doDrop({error:a}),!1)];case 4:if(!o)return[3,5];_tmp=(r.doDrop(),!0);return[3,9];case 5:if(!(l&&(c=d===e.prototype.strategy.LEAK?n._queues.shiftLastFrom(s.priority):d===e.prototype.strategy.OVERFLOW_PRIORITY?n._queues.shiftLastFrom(s.priority+1):d===e.prototype.strategy.OVERFLOW?r:void 0,c!=null&&c.doDrop(),c==null||d===e.prototype.strategy.OVERFLOW)))return[3,6];_tmp1=(c==null&&r.doDrop(),l);return[3,8];case 6:r.doQueue(l,o),n._queues.push(r);return[4,n._drainAll()];case 7:_tmp1=(_state.sent(),l);_state.label=8;case 8:_tmp=_tmp1;_state.label=9;case 9:return[2,_tmp]}})})()}},{key:"_receive",value:function _receive(r){return this._states.jobStatus(r.options.id)!=null?(r._reject(new e.prototype.BottleneckError("A job with the same id already exists (id=".concat(r.options.id,")"))),!1):(r.doReceive(),this._submitLock.schedule(this._addToQueue,r))}},{key:"submit",value:function submit(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}var _this=this;var n,i,o,a,s,l,c;if(typeof r[0]=="function"){var d,u,p,m;s=r,d=s,u=SA(d),i=u[0],r=u.slice(1),p=h0e.call(r,-1),m=f0e(p,1),n=m[0],a=op.load({},this.jobDefaults)}else{var h,g,x,v;l=r,h=l,g=SA(h),a=g[0],i=g[1],r=g.slice(2),x=h0e.call(r,-1),v=f0e(x,1),n=v[0],a=op.load(a,this.jobDefaults)}return c=function(){for(var _len=arguments.length,y=new Array(_len),_key=0;_key<_len;_key++){y[_key]=arguments[_key]}return new _this.Promise(function(_,b){return i.apply(void 0,_to_consumable_array(y).concat([function(){for(var _len=arguments.length,w=new Array(_len),_key=0;_key<_len;_key++){w[_key]=arguments[_key]}return(w[0]!=null?b:_)(w)}]))})},o=new EU(c,r,a,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),o.promise.then(function(y){return typeof n=="function"?n.apply(void 0,_to_consumable_array(y)):void 0}).catch(function(y){return Array.isArray(y)?typeof n=="function"?n.apply(void 0,_to_consumable_array(y)):void 0:typeof n=="function"?n(y):void 0}),this._receive(o)}},{key:"schedule",value:function schedule(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}var n,i,o;if(typeof r[0]=="function"){var a=r,s=SA(a);o=s[0],r=s.slice(1),i={}}else{var l=r,c=SA(l);i=c[0],o=c[1],r=c.slice(2)}return n=new EU(o,r,i,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(n),n.promise}},{key:"wrap",value:function wrap(r){var n,i;return n=this.schedule.bind(this),i=function i(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return n.apply(void 0,[r.bind(this)].concat(_to_consumable_array(a)))},i.withOptions=function(o){for(var _len=arguments.length,a=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){a[_key-1]=arguments[_key]}return n.apply(void 0,[o,r].concat(_to_consumable_array(a)))},i}},{key:"updateSettings",value:function updateSettings(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n=this;return kU(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n._store.__updateSettings__(op.overwrite(r,n.storeDefaults))];case 1:return[2,(_state.sent(),op.overwrite(r,n.instanceDefaults,n),n)]}})})()}},{key:"currentReservoir",value:function currentReservoir(){return this._store.__currentReservoir__()}},{key:"incrementReservoir",value:function incrementReservoir(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this._store.__incrementReservoir__(r)}}]);return e}();return e.default=e,e.Events=CU,e.version=e.prototype.version=Xge().version,e.strategy=e.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},e.BottleneckError=e.prototype.BottleneckError=hv(),e.Group=e.prototype.Group=s0e(),e.RedisConnection=e.prototype.RedisConnection=vA(),e.IORedisConnection=e.prototype.IORedisConnection=_A(),e.Batcher=e.prototype.Batcher=p0e(),e.prototype.jobDefaults={priority:v0e,weight:1,expiration:null,id:"<no-id>"},e.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:e.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},e.prototype.localStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:250},e.prototype.redisStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},e.prototype.instanceDefaults={datastore:"local",connection:null,id:"<no-id>",rejectOnDrop:!0,trackDoneStatus:!1,Promise:Promise},e.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:!0,dropErrorMessage:"This limiter has been stopped."},e}).call(void 0);k0e.exports=y0e});var E0e=Be(function(Nmr,C0e){"use strict";C0e.exports=SU()});var wxe=Be(function(PI){(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(a){return n(o(a),arguments)}function r(a,s){return t.apply(null,[a].concat(s||[]))}function n(a,s){var l=1,c=a.length,d,u="",p,m,h,g,x,v,y,_;for(p=0;p<c;p++)if(typeof a[p]=="string")u+=a[p];else if(_type_of(a[p])=="object"){if(h=a[p],h.keys)for(d=s[l],m=0;m<h.keys.length;m++){if(d==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',h.keys[m],h.keys[m-1]));d=d[h.keys[m]]}else h.param_no?d=s[h.param_no]:d=s[l++];if(e.not_type.test(h.type)&&e.not_primitive.test(h.type)&&_instanceof(d,Function)&&(d=d()),e.numeric_arg.test(h.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(t("[sprintf] expecting number but found %T",d));switch(e.number.test(h.type)&&(y=d>=0),h.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,h.width?parseInt(h.width):0);break;case"e":d=h.precision?parseFloat(d).toExponential(h.precision):parseFloat(d).toExponential();break;case"f":d=h.precision?parseFloat(d).toFixed(h.precision):parseFloat(d);break;case"g":d=h.precision?String(Number(d.toPrecision(h.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=h.precision?d.substring(0,h.precision):d;break;case"t":d=String(!!d),d=h.precision?d.substring(0,h.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=h.precision?d.substring(0,h.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=h.precision?d.substring(0,h.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase();break}e.json.test(h.type)?u+=d:(e.number.test(h.type)&&(!y||h.sign)?(_=y?"+":"-",d=d.toString().replace(e.sign,"")):_="",x=h.pad_char?h.pad_char==="0"?"0":h.pad_char.charAt(1):" ",v=h.width-(_+d).length,g=h.width&&v>0?x.repeat(v):"",u+=h.align?_+d+g:x==="0"?_+g+d:g+_+d)}return u}var i=Object.create(null);function o(a){if(i[a])return i[a];for(var s=a,l,c=[],d=0;s;){if((l=e.text.exec(s))!==null)c.push(l[0]);else if((l=e.modulo.exec(s))!==null)c.push("%");else if((l=e.placeholder.exec(s))!==null){if(l[2]){d|=1;var u=[],p=l[2],m=[];if((m=e.key.exec(p))!==null)for(u.push(m[1]);(p=p.substring(m[0].length))!=="";)if((m=e.key_access.exec(p))!==null)u.push(m[1]);else if((m=e.index_access.exec(p))!==null)u.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=u}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");s=s.substring(l[0].length)}return i[a]=c}typeof PI!="undefined"&&(PI.sprintf=t,PI.vsprintf=r),typeof window!="undefined"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var K5=Be(function(kn){"use strict";var JTe=function JTe(e){for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key]}var r=[e[0]],n=0;for(;n<t.length;)WH(r,t[n]),r.push(e[++n]);return new cc(r)};var YTe=function YTe(e){for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key]}var r=[Z5(e[0])],n=0;for(;n<t.length;)r.push(qH),WH(r,t[n]),r.push(qH,Z5(e[++n]));return nAt(r),new cc(r)};var WH=function WH(e,t){var _e1;_instanceof(t,cc)?(_e1=e).push.apply(_e1,_to_consumable_array(t._items)):_instanceof(t,C1)?e.push(t):e.push(aAt(t))};var nAt=function nAt(e){var t=1;for(;t<e.length-1;){if(e[t]===qH){var r=iAt(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}};var iAt=function iAt(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return _instanceof(t,C1)||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!_instanceof(e,C1))return'"'.concat(e).concat(t.slice(1))};var oAt=function oAt(e,t){return t.emptyStr()?e:e.emptyStr()?t:YTe(_templateObject(),e,t)};var aAt=function aAt(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Z5(Array.isArray(e)?e.join(","):e)};var sAt=function sAt(e){return new cc(Z5(e))};var Z5=function Z5(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};var lAt=function lAt(e){return typeof e=="string"&&kn.IDENTIFIER.test(e)?new cc(".".concat(e)):JTe(_templateObject1(),e)};var uAt=function uAt(e){if(typeof e=="string"&&kn.IDENTIFIER.test(e))return new cc("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))};var cAt=function cAt(e){return new cc(e.toString())};Object.defineProperty(kn,"__esModule",{value:!0});kn.regexpCode=kn.getEsmExportName=kn.getProperty=kn.safeStringify=kn.stringify=kn.strConcat=kn.addCodeArg=kn.str=kn._=kn.nil=kn._Code=kn.Name=kn.IDENTIFIER=kn._CodeOrName=void 0;var H5=function H5(){_class_call_check(this,H5)};kn._CodeOrName=H5;kn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var C1=/*#__PURE__*/function(H5){_inherits(C1,H5);function C1(t){_class_call_check(this,C1);var _this;if(_this=_call_super(this,C1),!kn.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");_this.str=t;return _this}_create_class(C1,[{key:"toString",value:function toString(){return this.str}},{key:"emptyStr",value:function emptyStr(){return!1}},{key:"names",get:function get1(){return _define_property({},this.str,1)}}]);return C1}(H5);kn.Name=C1;var cc=/*#__PURE__*/function(H5){_inherits(cc,H5);function cc(t){_class_call_check(this,cc);var _this;_this=_call_super(this,cc),_this._items=typeof t=="string"?[t]:t;return _this}_create_class(cc,[{key:"toString",value:function toString(){return this.str}},{key:"emptyStr",value:function emptyStr(){if(this._items.length>1)return!1;var t=this._items[0];return t===""||t==='""'}},{key:"str",get:function get1(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce(function(r,n){return"".concat(r).concat(n)},"")}},{key:"names",get:function get1(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce(function(r,n){return _instanceof(n,C1)&&(r[n.str]=(r[n.str]||0)+1),r},{})}}]);return cc}(H5);kn._Code=cc;kn.nil=new cc("");kn._=JTe;var qH=new cc("+");kn.str=YTe;kn.addCodeArg=WH;kn.strConcat=oAt;kn.stringify=sAt;kn.safeStringify=Z5;kn.getProperty=lAt;kn.getEsmExportName=uAt;kn.regexpCode=cAt});var HH=Be(function(Il){"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.ValueScope=Il.ValueScopeName=Il.Scope=Il.varKinds=Il.UsedValueState=void 0;var Al=K5(),VH=/*#__PURE__*/function(Error1){_inherits(VH,Error1);function VH(t){_class_call_check(this,VH);var _this;_this=_call_super(this,VH,['CodeGen: "code" for '.concat(t," not defined")]),_this.value=t.value;return _this}return VH}(_wrap_native_super(Error)),SR;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(SR||(Il.UsedValueState=SR={}));Il.varKinds={const:new Al.Name("const"),let:new Al.Name("let"),var:new Al.Name("var")};var kR=/*#__PURE__*/function(){function kR(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_ref.prefixes,r=_ref.parent;_class_call_check(this,kR);this._names={},this._prefixes=t,this._parent=r}_create_class(kR,[{key:"toName",value:function toName(t){return _instanceof(t,Al.Name)?t:this.name(t)}},{key:"name",value:function name(t){return new Al.Name(this._newName(t))}},{key:"_newName",value:function _newName(t){var r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}},{key:"_nameGroup",value:function _nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}}]);return kR}();Il.Scope=kR;var CR=/*#__PURE__*/function(_Al_Name){_inherits(CR,_Al_Name);function CR(t,r){_class_call_check(this,CR);var _this;_this=_call_super(this,CR,[r]),_this.prefix=t;return _this}_create_class(CR,[{key:"setValue",value:function setValue(t,param){var r=param.property,n=param.itemIndex;this.value=t,this.scopePath=(0,Al._)(_templateObject2(),new Al.Name(r),n)}}]);return CR}(Al.Name);Il.ValueScopeName=CR;var dAt=(0,Al._)(_templateObject3()),GH=/*#__PURE__*/function(kR){_inherits(GH,kR);function GH(t){_class_call_check(this,GH);var _this;_this=_call_super(this,GH,[t]),_this._values={},_this._scope=t.scope,_this.opts=_object_spread_props(_object_spread({},t),{_n:t.lines?dAt:Al.nil});return _this}_create_class(GH,[{key:"get",value:function get1(){return this._scope}},{key:"name",value:function name(t){return new CR(t,this._newName(t))}},{key:"value",value:function value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");var i=this.toName(t),o=i.prefix,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[o];if(s){var d=s.get(a);if(d)return d}else s=this._values[o]=new Map;s.set(a,i);var l=this._scope[o]||(this._scope[o]=[]),c=l.length;return l[c]=r.ref,i.setValue(r,{property:o,itemIndex:c}),i}},{key:"getValue",value:function getValue(t,r){var n=this._values[t];if(n)return n.get(r)}},{key:"scopeRefs",value:function scopeRefs(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._values;return this._reduceValues(r,function(n){if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,Al._)(_templateObject4(),t,n.scopePath)})}},{key:"scopeCode",value:function scopeCode(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._values,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return this._reduceValues(t,function(i){if(i.value===void 0)throw new Error('CodeGen: name "'.concat(i,'" has no value'));return i.value.code},r,n)}},{key:"_reduceValues",value:function _reduceValues(t,r){var _loop=function(a){var s=t[a];if(!s)return"continue";var l=n[a]=n[a]||new Map;s.forEach(function(c){if(l.has(c))return;l.set(c,SR.Started);var d=r(c);if(d){var u=_this.opts.es5?Il.varKinds.var:Il.varKinds.const;o=(0,Al._)(_templateObject5(),o,u,c,d,_this.opts._n)}else if(d=i==null?void 0:i(c))o=(0,Al._)(_templateObject6(),o,d,_this.opts._n);else throw new VH(c);l.set(c,SR.Completed)})};var _this=this;var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;var o=Al.nil;for(var a in t)_loop(a);return o}}]);return GH}(kR);Il.ValueScope=GH});var Ur=Be(function(Gr){"use strict";var T1=function T1(e,t){for(var r in t)e[r]=(e[r]||0)+(t[r]||0);return e};var AR=function AR(e,t){return _instanceof(t,xn._CodeOrName)?T1(e,t.names):e};var M_=function M_(e,t,r){var _o1;if(_instanceof(e,xn.Name))return n(e);if(!i(e))return e;return new xn._Code(e._items.reduce(function(o,a){return _instanceof(a,xn.Name)&&(a=n(a)),_instanceof(a,xn._Code)?(_o1=o).push.apply(_o1,_to_consumable_array(a._items)):o.push(a),o},[]));function n(o){var a=r[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function i(o){return _instanceof(o,xn._Code)&&o._items.some(function(a){return _instanceof(a,xn.Name)&&t[a.str]===1&&r[a.str]!==void 0})}};var pAt=function pAt(e,t){for(var r in t)e[r]=(e[r]||0)-(t[r]||0)};var XTe=function XTe(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,xn._)(_templateObject7(),oZ(e))};var mAt=function mAt(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.reduce(fAt)};var gAt=function gAt(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.reduce(hAt)};var eAe=function eAe(e){return function(t,r){return t===xn.nil?r:r===xn.nil?t:(0,xn._)(_templateObject8(),oZ(t),e,oZ(r))}};var oZ=function oZ(e){return _instanceof(e,xn.Name)?e:(0,xn._)(_templateObject9(),e)};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.or=Gr.and=Gr.not=Gr.CodeGen=Gr.operators=Gr.varKinds=Gr.ValueScopeName=Gr.ValueScope=Gr.Scope=Gr.Name=Gr.regexpCode=Gr.stringify=Gr.getProperty=Gr.nil=Gr.strConcat=Gr.str=Gr._=void 0;var xn=K5(),ad=HH(),Xh=K5();Object.defineProperty(Gr,"_",{enumerable:!0,get:function get1(){return Xh._}});Object.defineProperty(Gr,"str",{enumerable:!0,get:function get1(){return Xh.str}});Object.defineProperty(Gr,"strConcat",{enumerable:!0,get:function get1(){return Xh.strConcat}});Object.defineProperty(Gr,"nil",{enumerable:!0,get:function get1(){return Xh.nil}});Object.defineProperty(Gr,"getProperty",{enumerable:!0,get:function get1(){return Xh.getProperty}});Object.defineProperty(Gr,"stringify",{enumerable:!0,get:function get1(){return Xh.stringify}});Object.defineProperty(Gr,"regexpCode",{enumerable:!0,get:function get1(){return Xh.regexpCode}});Object.defineProperty(Gr,"Name",{enumerable:!0,get:function get1(){return Xh.Name}});var IR=HH();Object.defineProperty(Gr,"Scope",{enumerable:!0,get:function get1(){return IR.Scope}});Object.defineProperty(Gr,"ValueScope",{enumerable:!0,get:function get1(){return IR.ValueScope}});Object.defineProperty(Gr,"ValueScopeName",{enumerable:!0,get:function get1(){return IR.ValueScopeName}});Object.defineProperty(Gr,"varKinds",{enumerable:!0,get:function get1(){return IR.varKinds}});Gr.operators={GT:new xn._Code(">"),GTE:new xn._Code(">="),LT:new xn._Code("<"),LTE:new xn._Code("<="),EQ:new xn._Code("==="),NEQ:new xn._Code("!=="),NOT:new xn._Code("!"),OR:new xn._Code("||"),AND:new xn._Code("&&"),ADD:new xn._Code("+")};var qf=/*#__PURE__*/function(){function qf(){_class_call_check(this,qf)}_create_class(qf,[{key:"optimizeNodes",value:function optimizeNodes(){return this}},{key:"optimizeNames",value:function optimizeNames(t,r){return this}}]);return qf}(),ZH=/*#__PURE__*/function(qf){_inherits(ZH,qf);function ZH(t,r,n){_class_call_check(this,ZH);var _this;_this=_call_super(this,ZH),_this.varKind=t,_this.name=r,_this.rhs=n;return _this}_create_class(ZH,[{key:"render",value:function render(param){var t=param.es5,r=param._n;var n=t?ad.varKinds.var:this.varKind,i=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(i,";")+r}},{key:"optimizeNames",value:function optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=M_(this.rhs,t,r)),this}},{key:"names",get:function get1(){return _instanceof(this.rhs,xn._CodeOrName)?this.rhs.names:{}}}]);return ZH}(qf),ER=/*#__PURE__*/function(qf){_inherits(ER,qf);function ER(t,r,n){_class_call_check(this,ER);var _this;_this=_call_super(this,ER),_this.lhs=t,_this.rhs=r,_this.sideEffects=n;return _this}_create_class(ER,[{key:"render",value:function render(param){var t=param._n;return"".concat(this.lhs," = ").concat(this.rhs,";")+t}},{key:"optimizeNames",value:function optimizeNames(t,r){if(!(_instanceof(this.lhs,xn.Name)&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=M_(this.rhs,t,r),this}},{key:"names",get:function get1(){var t=_instanceof(this.lhs,xn.Name)?{}:_object_spread({},this.lhs.names);return AR(t,this.rhs)}}]);return ER}(qf),KH=/*#__PURE__*/function(ER){_inherits(KH,ER);function KH(t,r,n,i){_class_call_check(this,KH);var _this;_this=_call_super(this,KH,[t,n,i]),_this.op=r;return _this}_create_class(KH,[{key:"render",value:function render(param){var t=param._n;return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}}]);return KH}(ER),QH=/*#__PURE__*/function(qf){_inherits(QH,qf);function QH(t){_class_call_check(this,QH);var _this;_this=_call_super(this,QH),_this.label=t,_this.names={};return _this}_create_class(QH,[{key:"render",value:function render(param){var t=param._n;return"".concat(this.label,":")+t}}]);return QH}(qf),JH=/*#__PURE__*/function(qf){_inherits(JH,qf);function JH(t){_class_call_check(this,JH);var _this;_this=_call_super(this,JH),_this.label=t,_this.names={};return _this}_create_class(JH,[{key:"render",value:function render(param){var t=param._n;return"break".concat(this.label?" ".concat(this.label):"",";")+t}}]);return JH}(qf),YH=/*#__PURE__*/function(qf){_inherits(YH,qf);function YH(t){_class_call_check(this,YH);var _this;_this=_call_super(this,YH),_this.error=t;return _this}_create_class(YH,[{key:"render",value:function render(param){var t=param._n;return"throw ".concat(this.error,";")+t}},{key:"names",get:function get1(){return this.error.names}}]);return YH}(qf),XH=/*#__PURE__*/function(qf){_inherits(XH,qf);function XH(t){_class_call_check(this,XH);var _this;_this=_call_super(this,XH),_this.code=t;return _this}_create_class(XH,[{key:"render",value:function render(param){var t=param._n;return"".concat(this.code,";")+t}},{key:"optimizeNodes",value:function optimizeNodes(){return"".concat(this.code)?this:void 0}},{key:"optimizeNames",value:function optimizeNames(t,r){return this.code=M_(this.code,t,r),this}},{key:"names",get:function get1(){return _instanceof(this.code,xn._CodeOrName)?this.code.names:{}}}]);return XH}(qf),Q5=/*#__PURE__*/function(qf){_inherits(Q5,qf);function Q5(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];_class_call_check(this,Q5);var _this;_this=_call_super(this,Q5),_this.nodes=t;return _this}_create_class(Q5,[{key:"render",value:function render(t){return this.nodes.reduce(function(r,n){return r+n.render(t)},"")}},{key:"optimizeNodes",value:function optimizeNodes(){var _this=this,t=_this.nodes,r=t.length;for(;r--;){var _t1;var n=t[r].optimizeNodes();Array.isArray(n)?(_t1=t).splice.apply(_t1,[r,1].concat(_to_consumable_array(n))):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}},{key:"optimizeNames",value:function optimizeNames(t,r){var _this=this,n=_this.nodes,i=n.length;for(;i--;){var o=n[i];o.optimizeNames(t,r)||(pAt(t,o.names),n.splice(i,1))}return n.length>0?this:void 0}},{key:"names",get:function get1(){return this.nodes.reduce(function(t,r){return T1(t,r.names)},{})}}]);return Q5}(qf),Wf=/*#__PURE__*/function(Q5){_inherits(Wf,Q5);function Wf(){_class_call_check(this,Wf);return _call_super(this,Wf,arguments)}_create_class(Wf,[{key:"render",value:function render(t){return"{"+t._n+_get(_get_prototype_of(Wf.prototype),"render",this).call(this,t)+"}"+t._n}}]);return Wf}(Q5),eZ=/*#__PURE__*/function(Q5){_inherits(eZ,Q5);function eZ(){_class_call_check(this,eZ);return _call_super(this,eZ,arguments)}return eZ}(Q5),R_=/*#__PURE__*/function(Wf){_inherits(R_,Wf);function R_(){_class_call_check(this,R_);return _call_super(this,R_,arguments)}return R_}(Wf);R_.kind="else";var sd=/*#__PURE__*/function(Wf){_inherits(sd1,Wf);function sd1(t,r){_class_call_check(this,sd1);var _this;_this=_call_super(this,sd1,[r]),_this.condition=t;return _this}_create_class(sd1,[{key:"render",value:function render(t){var r="if(".concat(this.condition,")")+_get(_get_prototype_of(sd1.prototype),"render",this).call(this,t);return this.else&&(r+="else "+this.else.render(t)),r}},{key:"optimizeNodes",value:function optimizeNodes(){_get(_get_prototype_of(sd1.prototype),"optimizeNodes",this).call(this);var t=this.condition;if(t===!0)return this.nodes;var r=this.else;if(r){var n=r.optimizeNodes();r=this.else=Array.isArray(n)?new R_(n):n}if(r)return t===!1?_instanceof(r,sd)?r:r.nodes:this.nodes.length?this:new sd(XTe(t),_instanceof(r,sd)?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}},{key:"optimizeNames",value:function optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(_get(_get_prototype_of(sd1.prototype),"optimizeNames",this).call(this,t,r)||this.else))return this.condition=M_(this.condition,t,r),this}},{key:"names",get:function get1(){var t=_get(_get_prototype_of(sd1.prototype),"names",this);return AR(t,this.condition),this.else&&T1(t,this.else.names),t}}]);return sd1}(Wf);sd.kind="if";var E1=/*#__PURE__*/function(Wf){_inherits(E1,Wf);function E1(){_class_call_check(this,E1);return _call_super(this,E1,arguments)}return E1}(Wf);E1.kind="for";var tZ=/*#__PURE__*/function(E1){_inherits(tZ,E1);function tZ(t){_class_call_check(this,tZ);var _this;_this=_call_super(this,tZ),_this.iteration=t;return _this}_create_class(tZ,[{key:"render",value:function render(t){return"for(".concat(this.iteration,")")+_get(_get_prototype_of(tZ.prototype),"render",this).call(this,t)}},{key:"optimizeNames",value:function optimizeNames(t,r){if(_get(_get_prototype_of(tZ.prototype),"optimizeNames",this).call(this,t,r))return this.iteration=M_(this.iteration,t,r),this}},{key:"names",get:function get1(){return T1(_get(_get_prototype_of(tZ.prototype),"names",this),this.iteration.names)}}]);return tZ}(E1),rZ=/*#__PURE__*/function(E1){_inherits(rZ,E1);function rZ(t,r,n,i){_class_call_check(this,rZ);var _this;_this=_call_super(this,rZ),_this.varKind=t,_this.name=r,_this.from=n,_this.to=i;return _this}_create_class(rZ,[{key:"render",value:function render(t){var r=t.es5?ad.varKinds.var:this.varKind,_this=this,n=_this.name,i=_this.from,o=_this.to;return"for(".concat(r," ").concat(n,"=").concat(i,"; ").concat(n,"<").concat(o,"; ").concat(n,"++)")+_get(_get_prototype_of(rZ.prototype),"render",this).call(this,t)}},{key:"names",get:function get1(){var t=AR(_get(_get_prototype_of(rZ.prototype),"names",this),this.from);return AR(t,this.to)}}]);return rZ}(E1),TR=/*#__PURE__*/function(E1){_inherits(TR,E1);function TR(t,r,n,i){_class_call_check(this,TR);var _this;_this=_call_super(this,TR),_this.loop=t,_this.varKind=r,_this.name=n,_this.iterable=i;return _this}_create_class(TR,[{key:"render",value:function render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+_get(_get_prototype_of(TR.prototype),"render",this).call(this,t)}},{key:"optimizeNames",value:function optimizeNames(t,r){if(_get(_get_prototype_of(TR.prototype),"optimizeNames",this).call(this,t,r))return this.iterable=M_(this.iterable,t,r),this}},{key:"names",get:function get1(){return T1(_get(_get_prototype_of(TR.prototype),"names",this),this.iterable.names)}}]);return TR}(E1),J5=/*#__PURE__*/function(Wf){_inherits(J5,Wf);function J5(t,r,n){_class_call_check(this,J5);var _this;_this=_call_super(this,J5),_this.name=t,_this.args=r,_this.async=n;return _this}_create_class(J5,[{key:"render",value:function render(t){return"".concat(this.async?"async ":"","function ").concat(this.name,"(").concat(this.args,")")+_get(_get_prototype_of(J5.prototype),"render",this).call(this,t)}}]);return J5}(Wf);J5.kind="func";var Y5=/*#__PURE__*/function(Q5){_inherits(Y5,Q5);function Y5(){_class_call_check(this,Y5);return _call_super(this,Y5,arguments)}_create_class(Y5,[{key:"render",value:function render(t){return"return "+_get(_get_prototype_of(Y5.prototype),"render",this).call(this,t)}}]);return Y5}(Q5);Y5.kind="return";var nZ=/*#__PURE__*/function(Wf){_inherits(nZ,Wf);function nZ(){_class_call_check(this,nZ);return _call_super(this,nZ,arguments)}_create_class(nZ,[{key:"render",value:function render(t){var r="try"+_get(_get_prototype_of(nZ.prototype),"render",this).call(this,t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}},{key:"optimizeNodes",value:function optimizeNodes(){var t,r;return _get(_get_prototype_of(nZ.prototype),"optimizeNodes",this).call(this),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}},{key:"optimizeNames",value:function optimizeNames(t,r){var n,i;return _get(_get_prototype_of(nZ.prototype),"optimizeNames",this).call(this,t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}},{key:"names",get:function get1(){var t=_get(_get_prototype_of(nZ.prototype),"names",this);return this.catch&&T1(t,this.catch.names),this.finally&&T1(t,this.finally.names),t}}]);return nZ}(Wf),X5=/*#__PURE__*/function(Wf){_inherits(X5,Wf);function X5(t){_class_call_check(this,X5);var _this;_this=_call_super(this,X5),_this.error=t;return _this}_create_class(X5,[{key:"render",value:function render(t){return"catch(".concat(this.error,")")+_get(_get_prototype_of(X5.prototype),"render",this).call(this,t)}}]);return X5}(Wf);X5.kind="catch";var ek=/*#__PURE__*/function(Wf){_inherits(ek,Wf);function ek(){_class_call_check(this,ek);return _call_super(this,ek,arguments)}_create_class(ek,[{key:"render",value:function render(t){return"finally"+_get(_get_prototype_of(ek.prototype),"render",this).call(this,t)}}]);return ek}(Wf);ek.kind="finally";var iZ=/*#__PURE__*/function(){function iZ(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_class_call_check(this,iZ);this._values={},this._blockStarts=[],this._constants={},this.opts=_object_spread_props(_object_spread({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new ad.Scope({parent:t}),this._nodes=[new eZ]}_create_class(iZ,[{key:"toString",value:function toString(){return this._root.render(this.opts)}},{key:"name",value:function name(t){return this._scope.name(t)}},{key:"scopeName",value:function scopeName(t){return this._extScope.name(t)}},{key:"scopeValue",value:function scopeValue(t,r){var n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}},{key:"getScopeValue",value:function getScopeValue(t,r){return this._extScope.getValue(t,r)}},{key:"scopeRefs",value:function scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}},{key:"scopeCode",value:function scopeCode(){return this._extScope.scopeCode(this._values)}},{key:"_def",value:function _def(t,r,n,i){var o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new ZH(t,o,n)),o}},{key:"const",value:function _const(t,r,n){return this._def(ad.varKinds.const,t,r,n)}},{key:"let",value:function _let(t,r,n){return this._def(ad.varKinds.let,t,r,n)}},{key:"var",value:function _var(t,r,n){return this._def(ad.varKinds.var,t,r,n)}},{key:"assign",value:function assign(t,r,n){return this._leafNode(new ER(t,r,n))}},{key:"add",value:function add(t,r){return this._leafNode(new KH(t,Gr.operators.ADD,r))}},{key:"code",value:function code(t){return typeof t=="function"?t():t!==xn.nil&&this._leafNode(new XH(t)),this}},{key:"object",value:function object(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}var r=["{"];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,xn.addCodeArg)(r,i))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r.push("}"),new xn._Code(r)}},{key:"if",value:function _if(t,r,n){if(this._blockNode(new sd(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}},{key:"elseIf",value:function elseIf(t){return this._elseNode(new sd(t))}},{key:"else",value:function _else(){return this._elseNode(new R_)}},{key:"endIf",value:function endIf(){return this._endBlockNode(sd,R_)}},{key:"_for",value:function _for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}},{key:"for",value:function _for(t,r){return this._for(new tZ(t),r)}},{key:"forRange",value:function forRange(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.opts.es5?ad.varKinds.var:ad.varKinds.let;var a=this._scope.toName(t);return this._for(new rZ(o,a,r,n),function(){return i(a)})}},{key:"forOf",value:function forOf(t,r,n){var _this=this;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ad.varKinds.const;var o=this._scope.toName(t);if(this.opts.es5){var a=_instanceof(r,xn.Name)?r:this.var("_arr",r);return this.forRange("_i",0,(0,xn._)(_templateObject10(),a),function(s){_this.var(o,(0,xn._)(_templateObject11(),a,s)),n(o)})}return this._for(new TR("of",i,o,r),function(){return n(o)})}},{key:"forIn",value:function forIn(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.opts.es5?ad.varKinds.var:ad.varKinds.const;if(this.opts.ownProperties)return this.forOf(t,(0,xn._)(_templateObject12(),r),n);var o=this._scope.toName(t);return this._for(new TR("in",i,o,r),function(){return n(o)})}},{key:"endFor",value:function endFor(){return this._endBlockNode(E1)}},{key:"label",value:function label(t){return this._leafNode(new QH(t))}},{key:"break",value:function _break(t){return this._leafNode(new JH(t))}},{key:"return",value:function _return(t){var r=new Y5;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Y5)}},{key:"try",value:function _try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');var i=new nZ;if(this._blockNode(i),this.code(t),r){var o=this.name("e");this._currNode=i.catch=new X5(o),r(o)}return n&&(this._currNode=i.finally=new ek,this.code(n)),this._endBlockNode(X5,ek)}},{key:"throw",value:function _throw(t){return this._leafNode(new YH(t))}},{key:"block",value:function block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}},{key:"endBlock",value:function endBlock(t){var r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");var n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}},{key:"func",value:function func(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xn.nil,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return this._blockNode(new J5(t,r,n)),i&&this.code(i).endFunc(),this}},{key:"endFunc",value:function endFunc(){return this._endBlockNode(J5)}},{key:"optimize",value:function optimize(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}},{key:"_leafNode",value:function _leafNode(t){return this._currNode.nodes.push(t),this}},{key:"_blockNode",value:function _blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}},{key:"_endBlockNode",value:function _endBlockNode(t,r){var n=this._currNode;if(_instanceof(n,t)||r&&_instanceof(n,r))return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}},{key:"_elseNode",value:function _elseNode(t){var r=this._currNode;if(!_instanceof(r,sd))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}},{key:"_root",get:function get1(){return this._nodes[0]}},{key:"_currNode",get:function get1(){var t=this._nodes;return t[t.length-1]},set:function set1(t){var r=this._nodes;r[r.length-1]=t}}]);return iZ}();Gr.CodeGen=iZ;Gr.not=XTe;var fAt=eAe(Gr.operators.AND);Gr.and=mAt;var hAt=eAe(Gr.operators.OR);Gr.or=gAt});var vn=Be(function(Jr){"use strict";var yAt=function yAt(e){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t[r]=!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t};var vAt=function vAt(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(nAe(e,t),!iAe(t,e.self.RULES.all))};var nAe=function nAe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.schema;var r=e.opts,n=e.self;if(!r.strictSchema||typeof t=="boolean")return;var i=n.RULES.keywords;for(var o in t)i[o]||sAe(e,'unknown keyword: "'.concat(o,'"'))};var iAe=function iAe(e,t){if(typeof e=="boolean")return!e;for(var r in e)if(t[r])return!0;return!1};var _At=function _At(e,t){if(typeof e=="boolean")return!e;for(var r in e)if(r!=="$ref"&&t.all[r])return!0;return!1};var bAt=function bAt(param,r,n,i){var e=param.topSchemaRef,t=param.schemaPath;if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pi._)(_templateObject13(),r)}return(0,pi._)(_templateObject14(),e,t,(0,pi.getProperty)(n))};var wAt=function wAt(e){return oAe(decodeURIComponent(e))};var SAt=function SAt(e){return encodeURIComponent(sZ(e))};var sZ=function sZ(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")};var oAe=function oAe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")};var kAt=function kAt(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(Array.isArray(e))try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else t(e)};var tAe=function tAe(param){var e=param.mergeNames,t=param.mergeToName,r=param.mergeValues,n=param.resultToName;return function(i,o,a,s){var l=a===void 0?o:_instanceof(a,pi.Name)?(_instanceof(o,pi.Name)?e(i,o,a):t(i,o,a),a):_instanceof(o,pi.Name)?(t(i,a,o),o):r(o,a);return s===pi.Name&&!_instanceof(l,pi.Name)?n(i,l):l}};var aAe=function aAe(e,t){if(t===!0)return e.var("props",!0);var r=e.var("props",(0,pi._)(_templateObject15()));return t!==void 0&&lZ(e,r,t),r};var lZ=function lZ(e,t,r){Object.keys(r).forEach(function(n){return e.assign((0,pi._)(_templateObject16(),t,(0,pi.getProperty)(n)),!0)})};var CAt=function CAt(e,t){return e.scopeValue("func",{ref:t,code:rAe[t.code]||(rAe[t.code]=new xAt._Code(t.code))})};var EAt=function EAt(e,t,r){if(_instanceof(e,pi.Name)){var n=t===aZ.Num;return r?n?(0,pi._)(_templateObject17(),e):(0,pi._)(_templateObject18(),e):n?(0,pi._)(_templateObject19(),e):(0,pi._)(_templateObject20(),e)}return r?(0,pi.getProperty)(e).toString():"/"+sZ(e)};var sAe=function sAe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.opts.strictSchema;if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.checkStrictMode=Jr.getErrorPath=Jr.Type=Jr.useFunc=Jr.setEvaluated=Jr.evaluatedPropsToName=Jr.mergeEvaluated=Jr.eachItem=Jr.unescapeJsonPointer=Jr.escapeJsonPointer=Jr.escapeFragment=Jr.unescapeFragment=Jr.schemaRefOrVal=Jr.schemaHasRulesButRef=Jr.schemaHasRules=Jr.checkUnknownRules=Jr.alwaysValidSchema=Jr.toHash=void 0;var pi=Ur(),xAt=K5();Jr.toHash=yAt;Jr.alwaysValidSchema=vAt;Jr.checkUnknownRules=nAe;Jr.schemaHasRules=iAe;Jr.schemaHasRulesButRef=_At;Jr.schemaRefOrVal=bAt;Jr.unescapeFragment=wAt;Jr.escapeFragment=SAt;Jr.escapeJsonPointer=sZ;Jr.unescapeJsonPointer=oAe;Jr.eachItem=kAt;Jr.mergeEvaluated={props:tAe({mergeNames:function(e,t,r){return e.if((0,pi._)(_templateObject21(),r,t),function(){e.if((0,pi._)(_templateObject22(),t),function(){return e.assign(r,!0)},function(){return e.assign(r,(0,pi._)(_templateObject23(),r)).code((0,pi._)(_templateObject24(),r,t))})})},mergeToName:function(e,t,r){return e.if((0,pi._)(_templateObject25(),r),function(){t===!0?e.assign(r,!0):(e.assign(r,(0,pi._)(_templateObject26(),r)),lZ(e,r,t))})},mergeValues:function(e,t){return e===!0?!0:_object_spread({},e,t)},resultToName:aAe}),items:tAe({mergeNames:function(e,t,r){return e.if((0,pi._)(_templateObject27(),r,t),function(){return e.assign(r,(0,pi._)(_templateObject28(),t,r,t,r,t))})},mergeToName:function(e,t,r){return e.if((0,pi._)(_templateObject29(),r),function(){return e.assign(r,t===!0?!0:(0,pi._)(_templateObject30(),r,t,r,t))})},mergeValues:function(e,t){return e===!0?!0:Math.max(e,t)},resultToName:function(e,t){return e.var("items",t)}})};Jr.evaluatedPropsToName=aAe;Jr.setEvaluated=lZ;var rAe={};Jr.useFunc=CAt;var aZ;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(aZ||(Jr.Type=aZ={}));Jr.getErrorPath=EAt;Jr.checkStrictMode=sAe});var Vf=Be(function(uZ){"use strict";Object.defineProperty(uZ,"__esModule",{value:!0});var ds=Ur(),TAt={data:new ds.Name("data"),valCxt:new ds.Name("valCxt"),instancePath:new ds.Name("instancePath"),parentData:new ds.Name("parentData"),parentDataProperty:new ds.Name("parentDataProperty"),rootData:new ds.Name("rootData"),dynamicAnchors:new ds.Name("dynamicAnchors"),vErrors:new ds.Name("vErrors"),errors:new ds.Name("errors"),this:new ds.Name("this"),self:new ds.Name("self"),scope:new ds.Name("scope"),json:new ds.Name("json"),jsonPos:new ds.Name("jsonPos"),jsonLen:new ds.Name("jsonLen"),jsonPart:new ds.Name("jsonPart")};uZ.default=TAt});var tk=Be(function(ps){"use strict";var AAt=function AAt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ps.keywordError,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var i=e.it,o=i.gen,a=i.compositeRule,s=i.allErrors,l=cAe(e,t,r);(n!=null?n:a||s)?lAe(o,l):uAe(i,(0,_n._)(_templateObject31(),l))};var IAt=function IAt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ps.keywordError,r=arguments.length>2?arguments[2]:void 0;var n=e.it,i=n.gen,o=n.compositeRule,a=n.allErrors,s=cAe(e,t,r);lAe(i,s),o||a||uAe(n,Ls.default.vErrors)};var PAt=function PAt(e,t){e.assign(Ls.default.errors,t),e.if((0,_n._)(_templateObject32(),Ls.default.vErrors),function(){return e.if(t,function(){return e.assign((0,_n._)(_templateObject33(),Ls.default.vErrors),t)},function(){return e.assign(Ls.default.vErrors,null)})})};var RAt=function RAt(param){var e=param.gen,t=param.keyword,r=param.schemaValue,n=param.data,i=param.errsCount,o=param.it;if(i===void 0)throw new Error("ajv implementation error");var a=e.name("err");e.forRange("i",i,Ls.default.errors,function(s){e.const(a,(0,_n._)(_templateObject34(),Ls.default.vErrors,s)),e.if((0,_n._)(_templateObject35(),a),function(){return e.assign((0,_n._)(_templateObject36(),a),(0,_n.strConcat)(Ls.default.instancePath,o.errorPath))}),e.assign((0,_n._)(_templateObject37(),a),(0,_n.str)(_templateObject38(),o.errSchemaPath,t)),o.opts.verbose&&(e.assign((0,_n._)(_templateObject39(),a),r),e.assign((0,_n._)(_templateObject40(),a),n))})};var lAe=function lAe(e,t){var r=e.const("err",t);e.if((0,_n._)(_templateObject41(),Ls.default.vErrors),function(){return e.assign(Ls.default.vErrors,(0,_n._)(_templateObject42(),r))},(0,_n._)(_templateObject43(),Ls.default.vErrors,r)),e.code((0,_n._)(_templateObject44(),Ls.default.errors))};var uAe=function uAe(e,t){var r=e.gen,n=e.validateName,i=e.schemaEnv;i.$async?r.throw((0,_n._)(_templateObject45(),e.ValidationError,t)):(r.assign((0,_n._)(_templateObject46(),n),t),r.return(!1))};var cAe=function cAe(e,t,r){var _e_it=e.it,n=_e_it.createErrors;return n===!1?(0,_n._)(_templateObject47()):MAt(e,t,r)};var MAt=function MAt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var _n;var n=e.gen,i=e.it,o=[OAt(i,r),$At(e,r)];return NAt(e,t,o),(_n=n).object.apply(_n,_to_consumable_array(o))};var OAt=function OAt(param,param1){var e=param.errorPath,t=param1.instancePath;var r=t?(0,_n.str)(_templateObject48(),e,(0,PR.getErrorPath)(t,PR.Type.Str)):e;return[Ls.default.instancePath,(0,_n.strConcat)(Ls.default.instancePath,r)]};var $At=function $At(param,param1){var e=param.keyword,_param_it=param.it,t=_param_it.errSchemaPath,r=param1.schemaPath,n=param1.parentSchema;var i=n?t:(0,_n.str)(_templateObject49(),t,e);return r&&(i=(0,_n.str)(_templateObject50(),i,(0,PR.getErrorPath)(r,PR.Type.Str))),[A1.schemaPath,i]};var NAt=function NAt(e,param,n){var t=param.params,r=param.message;var i=e.keyword,o=e.data,a=e.schemaValue,s=e.it,l=s.opts,c=s.propertyName,d=s.topSchemaRef,u=s.schemaPath;n.push([A1.keyword,i],[A1.params,typeof t=="function"?t(e):t||(0,_n._)(_templateObject51())]),l.messages&&n.push([A1.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([A1.schema,a],[A1.parentSchema,(0,_n._)(_templateObject52(),d,u)],[Ls.default.data,o]),c&&n.push([A1.propertyName,c])};Object.defineProperty(ps,"__esModule",{value:!0});ps.extendErrors=ps.resetErrorsCount=ps.reportExtraError=ps.reportError=ps.keyword$DataError=ps.keywordError=void 0;var _n=Ur(),PR=vn(),Ls=Vf();ps.keywordError={message:function(param){var e=param.keyword;return(0,_n.str)(_templateObject53(),e)}};ps.keyword$DataError={message:function(param){var e=param.keyword,t=param.schemaType;return t?(0,_n.str)(_templateObject54(),e,t):(0,_n.str)(_templateObject55(),e)}};ps.reportError=AAt;ps.reportExtraError=IAt;ps.resetErrorsCount=PAt;ps.extendErrors=RAt;var A1={keyword:new _n.Name("keyword"),schemaPath:new _n.Name("schemaPath"),params:new _n.Name("params"),propertyName:new _n.Name("propertyName"),message:new _n.Name("message"),schema:new _n.Name("schema"),parentSchema:new _n.Name("parentSchema")}});var pAe=Be(function(O_){"use strict";var jAt=function jAt(e){var t=e.gen,r=e.schema,n=e.validateName;r===!1?dAe(e,!1):(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&r.$async===!0?t.return(FAt.default.data):(t.assign((0,LAt._)(_templateObject56(),n),null),t.return(!0))};var UAt=function UAt(e,t){var r=e.gen,n=e.schema;n===!1?(r.var(t,!1),dAe(e)):r.var(t,!0)};var dAe=function dAe(e,t){var r=e.gen,n=e.data,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,DAt.reportError)(i,zAt,void 0,t)};Object.defineProperty(O_,"__esModule",{value:!0});O_.boolOrEmptySchema=O_.topBoolOrEmptySchema=void 0;var DAt=tk(),LAt=Ur(),FAt=Vf(),zAt={message:"boolean schema is false"};O_.topBoolOrEmptySchema=jAt;O_.boolOrEmptySchema=UAt});var cZ=Be(function($_){"use strict";var WAt=function WAt(e){return typeof e=="string"&&qAt.has(e)};var VAt=function VAt(){var e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:_object_spread_props(_object_spread({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}};Object.defineProperty($_,"__esModule",{value:!0});$_.getRules=$_.isJSONType=void 0;var BAt=["string","number","integer","boolean","null","object","array"],qAt=new Set(BAt);$_.isJSONType=WAt;$_.getRules=VAt});var dZ=Be(function(eg){"use strict";var GAt=function GAt(param,r){var e=param.schema,t=param.self;var n=t.RULES.types[r];return n&&n!==!0&&fAe(e,n)};var fAe=function fAe(e,t){return t.rules.some(function(r){return mAe(e,r)})};var mAe=function mAe(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(function(n){return e[n]!==void 0}))};Object.defineProperty(eg,"__esModule",{value:!0});eg.shouldUseRule=eg.shouldUseGroup=eg.schemaHasRulesForType=void 0;eg.schemaHasRulesForType=GAt;eg.shouldUseGroup=fAe;eg.shouldUseRule=mAe});var rk=Be(function(fs){"use strict";var QAt=function QAt(e){var t=gAe(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t};var gAe=function gAe(e){var t=Array.isArray(e)?e:e?[e]:[];if(t.every(HAt.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))};var JAt=function JAt(e,t){var r=e.gen,n=e.data,i=e.opts,o=YAt(t,i.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,ZAt.schemaHasRulesForType)(e,t[0]));if(a){var s=fZ(t,n,i.strictNumbers,N_.Wrong);r.if(s,function(){o.length?XAt(e,t,o):mZ(e)})}return a};var YAt=function YAt(e,t){return t?e.filter(function(r){return xAe.has(r)||t==="array"&&r==="array"}):[]};var XAt=function XAt(e,t,r){var n=e.gen,i=e.data,o=e.opts,a=n.let("dataType",(0,Lr._)(_templateObject57(),i)),s=n.let("coerced",(0,Lr._)(_templateObject58()));o.coerceTypes==="array"&&n.if((0,Lr._)(_templateObject59(),a,i,i),function(){return n.assign(i,(0,Lr._)(_templateObject60(),i)).assign(a,(0,Lr._)(_templateObject61(),i)).if(fZ(t,i,o.strictNumbers),function(){return n.assign(s,i)})}),n.if((0,Lr._)(_templateObject62(),s));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;(xAe.has(c)||c==="array"&&o.coerceTypes==="array")&&l(c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n.else(),mZ(e),n.endIf(),n.if((0,Lr._)(_templateObject63(),s),function(){n.assign(i,s),eIt(e,s)});function l(c){switch(c){case"string":n.elseIf((0,Lr._)(_templateObject64(),a,a)).assign(s,(0,Lr._)(_templateObject65(),i)).elseIf((0,Lr._)(_templateObject66(),i)).assign(s,(0,Lr._)(_templateObject67()));return;case"number":n.elseIf((0,Lr._)(_templateObject68(),a,i,a,i,i,i)).assign(s,(0,Lr._)(_templateObject69(),i));return;case"integer":n.elseIf((0,Lr._)(_templateObject70(),a,i,a,i,i,i,i)).assign(s,(0,Lr._)(_templateObject71(),i));return;case"boolean":n.elseIf((0,Lr._)(_templateObject72(),i,i,i)).assign(s,!1).elseIf((0,Lr._)(_templateObject73(),i,i)).assign(s,!0);return;case"null":n.elseIf((0,Lr._)(_templateObject74(),i,i,i)),n.assign(s,null);return;case"array":n.elseIf((0,Lr._)(_templateObject75(),a,a,a,i)).assign(s,(0,Lr._)(_templateObject76(),i))}}};var eIt=function eIt(param,n){var e=param.gen,t=param.parentData,r=param.parentDataProperty;e.if((0,Lr._)(_templateObject77(),t),function(){return e.assign((0,Lr._)(_templateObject78(),t,r),n)})};var pZ=function pZ(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:N_.Correct;var i=n===N_.Correct?Lr.operators.EQ:Lr.operators.NEQ,o;switch(e){case"null":return(0,Lr._)(_templateObject79(),t,i);case"array":o=(0,Lr._)(_templateObject80(),t);break;case"object":o=(0,Lr._)(_templateObject81(),t,t,t);break;case"integer":o=a((0,Lr._)(_templateObject82(),t,t));break;case"number":o=a();break;default:return(0,Lr._)(_templateObject83(),t,i,e)}return n===N_.Correct?o:(0,Lr.not)(o);function a(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lr.nil;return(0,Lr.and)((0,Lr._)(_templateObject84(),t),s,r?(0,Lr._)(_templateObject85(),t):Lr.nil)}};var fZ=function fZ(e,t,r,n){if(e.length===1)return pZ(e[0],t,r,n);var i,o=(0,hAe.toHash)(e);if(o.array&&o.object){var a=(0,Lr._)(_templateObject86(),t);i=o.null?a:(0,Lr._)(_templateObject87(),t,a),delete o.null,delete o.array,delete o.object}else i=Lr.nil;o.number&&delete o.integer;for(var a9 in o)i=(0,Lr.and)(i,pZ(a9,t,r,n));return i};var mZ=function mZ(e){var t=rIt(e);(0,KAt.reportError)(t,tIt)};var rIt=function rIt(e){var t=e.gen,r=e.data,n=e.schema,i=(0,hAe.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}};Object.defineProperty(fs,"__esModule",{value:!0});fs.reportTypeError=fs.checkDataTypes=fs.checkDataType=fs.coerceAndCheckDataType=fs.getJSONTypes=fs.getSchemaTypes=fs.DataType=void 0;var HAt=cZ(),ZAt=dZ(),KAt=tk(),Lr=Ur(),hAe=vn(),N_;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(N_||(fs.DataType=N_={}));fs.getSchemaTypes=QAt;fs.getJSONTypes=gAe;fs.coerceAndCheckDataType=JAt;var xAe=new Set(["string","number","integer","boolean","null"]);fs.checkDataType=pZ;fs.checkDataTypes=fZ;var tIt={message:function(param){var e=param.schema;return"must be ".concat(e)},params:function(param){var e=param.schema,t=param.schemaValue;return typeof e=="string"?(0,Lr._)(_templateObject88(),e):(0,Lr._)(_templateObject89(),t)}};fs.reportTypeError=mZ});var vAe=Be(function(RR){"use strict";var iIt=function iIt(e,t){var _e_schema=e.schema,r=_e_schema.properties,n=_e_schema.items;if(t==="object"&&r)for(var i in r)yAe(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach(function(i,o){return yAe(e,o,i.default)})};var yAe=function yAe(e,t,r){var n=e.gen,i=e.compositeRule,o=e.data,a=e.opts;if(r===void 0)return;var s=(0,D_._)(_templateObject90(),o,(0,D_.getProperty)(t));if(i){(0,nIt.checkStrictMode)(e,"default is ignored for: ".concat(s));return}var l=(0,D_._)(_templateObject91(),s);a.useDefaults==="empty"&&(l=(0,D_._)(_templateObject92(),l,s,s)),n.if(l,(0,D_._)(_templateObject93(),s,(0,D_.stringify)(r)))};Object.defineProperty(RR,"__esModule",{value:!0});RR.assignDefaults=void 0;var D_=Ur(),nIt=vn();RR.assignDefaults=iIt});var dc=Be(function(ri){"use strict";var aIt=function aIt(e,t){var r=e.gen,n=e.data,i=e.it;r.if(xZ(r,n,t,i.opts.ownProperties),function(){e.setParams({missingProperty:(0,Ti._)(_templateObject94(),t)},!0),e.error()})};var sIt=function sIt(param,n,i){var e=param.gen,t=param.data,_param_it=param.it,r=_param_it.opts;return(0,Ti.or).apply(this,_to_consumable_array(n.map(function(o){return(0,Ti.and)(xZ(e,t,o,r.ownProperties),(0,Ti._)(_templateObject95(),i,o))})))};var lIt=function lIt(e,t){e.setParams({missingProperty:t},!0),e.error()};var _Ae=function _Ae(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ti._)(_templateObject96())})};var gZ=function gZ(e,t,r){return(0,Ti._)(_templateObject97(),_Ae(e),t,r)};var uIt=function uIt(e,t,r,n){var i=(0,Ti._)(_templateObject98(),t,(0,Ti.getProperty)(r));return n?(0,Ti._)(_templateObject99(),i,gZ(e,t,r)):i};var xZ=function xZ(e,t,r,n){var i=(0,Ti._)(_templateObject100(),t,(0,Ti.getProperty)(r));return n?(0,Ti.or)(i,(0,Ti.not)(gZ(e,t,r))):i};var bAe=function bAe(e){return e?Object.keys(e).filter(function(t){return t!=="__proto__"}):[]};var cIt=function cIt(e,t){return bAe(t).filter(function(r){return!(0,hZ.alwaysValidSchema)(e,t[r])})};var dIt=function dIt(param,s,l,c){var e=param.schemaCode,t=param.data,_param_it=param.it,r=_param_it.gen,n=_param_it.topSchemaRef,i=_param_it.schemaPath,o=_param_it.errorPath,a=param.it;var _r1;var d=c?(0,Ti._)(_templateObject101(),e,t,n,i):t,u=[[tg.default.instancePath,(0,Ti.strConcat)(tg.default.instancePath,o)],[tg.default.parentData,a.parentData],[tg.default.parentDataProperty,a.parentDataProperty],[tg.default.rootData,tg.default.rootData]];a.opts.dynamicRef&&u.push([tg.default.dynamicAnchors,tg.default.dynamicAnchors]);var p=(0,Ti._)(_templateObject102(),d,(_r1=r).object.apply(_r1,_to_consumable_array(u)));return l!==Ti.nil?(0,Ti._)(_templateObject103(),s,l,p):(0,Ti._)(_templateObject104(),s,p)};var fIt=function fIt(param,r){var e=param.gen,_param_it=param.it,t=_param_it.opts;var n=t.unicodeRegExp?"u":"",_t_code=t.code,i=_t_code.regExp,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ti._)(_templateObject105(),i.code==="new RegExp"?pIt:(0,oIt.useFunc)(e,i),r,n)})};var mIt=function mIt(e){var t=e.gen,r=e.data,n=e.keyword,i=e.it,o=t.name("valid");if(i.allErrors){var s=t.let("valid",!0);return a(function(){return t.assign(s,!1)}),s}return t.var(o,!0),a(function(){return t.break()}),o;function a(s){var l=t.const("len",(0,Ti._)(_templateObject106(),r));t.forRange("i",0,l,function(c){e.subschema({keyword:n,dataProp:c,dataPropType:hZ.Type.Num},o),t.if((0,Ti.not)(o),s)})}};var hIt=function hIt(e){var t=e.gen,r=e.schema,n=e.keyword,i=e.it;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(function(l){return(0,hZ.alwaysValidSchema)(i,l)})&&!i.opts.unevaluated)return;var a=t.let("valid",!1),s=t.name("_valid");t.block(function(){return r.forEach(function(l,c){var d=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},s);t.assign(a,(0,Ti._)(_templateObject107(),a,s)),e.mergeValidEvaluated(d,s)||t.if((0,Ti.not)(a))})}),e.result(a,function(){return e.reset()},function(){return e.error(!0)})};Object.defineProperty(ri,"__esModule",{value:!0});ri.validateUnion=ri.validateArray=ri.usePattern=ri.callValidateCode=ri.schemaProperties=ri.allSchemaProperties=ri.noPropertyInData=ri.propertyInData=ri.isOwnProperty=ri.hasPropFunc=ri.reportMissingProp=ri.checkMissingProp=ri.checkReportMissingProp=void 0;var Ti=Ur(),hZ=vn(),tg=Vf(),oIt=vn();ri.checkReportMissingProp=aIt;ri.checkMissingProp=sIt;ri.reportMissingProp=lIt;ri.hasPropFunc=_Ae;ri.isOwnProperty=gZ;ri.propertyInData=uIt;ri.noPropertyInData=xZ;ri.allSchemaProperties=bAe;ri.schemaProperties=cIt;ri.callValidateCode=dIt;var pIt=(0,Ti._)(_templateObject108());ri.usePattern=fIt;ri.validateArray=mIt;ri.validateUnion=hIt});var kAe=Be(function(Cp){"use strict";var yIt=function yIt(e,t){var r=e.gen,n=e.keyword,i=e.schema,o=e.parentSchema,a=e.it,s=t.macro.call(a.self,i,o,a),l=SAe(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);var c=r.name("valid");e.subschema({schema:s,schemaPath:Fs.nil,errSchemaPath:"".concat(a.errSchemaPath,"/").concat(n),topSchemaRef:l,compositeRule:!0},c),e.pass(c,function(){return e.error(!0)})};var vIt=function vIt(e,t){var r;var n=e.gen,i=e.keyword,o=e.schema,a=e.parentSchema,s=e.$data,l=e.it;bIt(l,t);var c=!s&&t.compile?t.compile.call(l.self,o,a,l):t.validate,d=SAe(n,i,c),u=n.let("valid");e.block$data(u,p),e.ok((r=t.valid)!==null&&r!==void 0?r:u);function p(){if(t.errors===!1)g(),t.modifying&&wAe(e),x(function(){return e.error()});else{var v=t.async?m():h();t.modifying&&wAe(e),x(function(){return _It(e,v)})}}function m(){var v=n.let("ruleErrs",null);return n.try(function(){return g((0,Fs._)(_templateObject109()))},function(y){return n.assign(u,!1).if((0,Fs._)(_templateObject110(),y,l.ValidationError),function(){return n.assign(v,(0,Fs._)(_templateObject111(),y))},function(){return n.throw(y)})}),v}function h(){var v=(0,Fs._)(_templateObject112(),d);return n.assign(v,null),g(Fs.nil),v}function g(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t.async?(0,Fs._)(_templateObject113()):Fs.nil;var y=l.opts.passContext?I1.default.this:I1.default.self,_=!("compile"in t&&!s||t.schema===!1);n.assign(u,(0,Fs._)(_templateObject114(),v,(0,gIt.callValidateCode)(e,d,y,_)),t.modifying)}function x(v){var y;n.if((0,Fs.not)((y=t.valid)!==null&&y!==void 0?y:u),v)}};var wAe=function wAe(e){var t=e.gen,r=e.data,n=e.it;t.if(n.parentData,function(){return t.assign(r,(0,Fs._)(_templateObject115(),n.parentData,n.parentDataProperty))})};var _It=function _It(e,t){var r=e.gen;r.if((0,Fs._)(_templateObject116(),t),function(){r.assign(I1.default.vErrors,(0,Fs._)(_templateObject117(),I1.default.vErrors,t,I1.default.vErrors,t)).assign(I1.default.errors,(0,Fs._)(_templateObject118(),I1.default.vErrors)),(0,xIt.extendErrors)(e)},function(){return e.error()})};var bIt=function bIt(param,t){var e=param.schemaEnv;if(t.async&&!e.$async)throw new Error("async keyword in sync schema")};var SAe=function SAe(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Fs.stringify)(r)})};var wIt=function wIt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t.length||t.some(function(n){return n==="array"?Array.isArray(e):n==="object"?e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e):(typeof e==="undefined"?"undefined":_type_of(e))==n||r&&typeof e=="undefined"})};var SIt=function SIt(param,i,o){var e=param.schema,t=param.opts,r=param.self,n=param.errSchemaPath;if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");var a=i.dependencies;if(a!=null&&a.some(function(s){return!Object.prototype.hasOwnProperty.call(e,s)}))throw new Error("parent schema must have dependencies of ".concat(o,": ").concat(a.join(",")));if(i.validateSchema&&!i.validateSchema(e[o])){var l='keyword "'.concat(o,'" value is invalid at path "').concat(n,'": ')+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.validateKeywordUsage=Cp.validSchemaType=Cp.funcKeywordCode=Cp.macroKeywordCode=void 0;var Fs=Ur(),I1=Vf(),gIt=dc(),xIt=tk();Cp.macroKeywordCode=yIt;Cp.funcKeywordCode=vIt;Cp.validSchemaType=wIt;Cp.validateKeywordUsage=SIt});var EAe=Be(function(rg){"use strict";var kIt=function kIt(e,param){var t=param.keyword,r=param.schemaProp,n=param.schema,i=param.schemaPath,o=param.errSchemaPath,a=param.topSchemaRef;if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){var s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,Ep._)(_templateObject119(),e.schemaPath,(0,Ep.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:s[r],schemaPath:(0,Ep._)(_templateObject120(),e.schemaPath,(0,Ep.getProperty)(t),(0,Ep.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,CAe.escapeFragment)(r))}}if(n!==void 0){if(i===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')};var CIt=function CIt(e,t,param){var r=param.dataProp,n=param.dataPropType,i=param.data,o=param.dataTypes,a=param.propertyName;if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');var s=t.gen;if(r!==void 0){var c=t.errorPath,d=t.dataPathArr,u=t.opts,p=s.let("data",(0,Ep._)(_templateObject121(),t.data,(0,Ep.getProperty)(r)),!0);l(p),e.errorPath=(0,Ep.str)(_templateObject122(),c,(0,CAe.getErrorPath)(r,n,u.jsPropertySyntax)),e.parentDataProperty=(0,Ep._)(_templateObject123(),r),e.dataPathArr=_to_consumable_array(d).concat([e.parentDataProperty])}if(i!==void 0){var c10=_instanceof(i,Ep.Name)?i:s.let("data",i,!0);l(c10),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function l(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=_to_consumable_array(t.dataNames).concat([c])}};var EIt=function EIt(e,param){var t=param.jtdDiscriminator,r=param.jtdMetadata,n=param.compositeRule,i=param.createErrors,o=param.allErrors;n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};Object.defineProperty(rg,"__esModule",{value:!0});rg.extendSubschemaMode=rg.extendSubschemaData=rg.getSubschema=void 0;var Ep=Ur(),CAe=vn();rg.getSubschema=kIt;rg.extendSubschemaData=CIt;rg.extendSubschemaMode=EIt});var yZ=Be(function(DMr,TAe){"use strict";TAe.exports=function e(t,r){if(t===r)return!0;if(t&&r&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&(typeof r==="undefined"?"undefined":_type_of(r))=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var IAe=Be(function(LMr,AAe){"use strict";var TIt=function TIt(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")};var ng=AAe.exports=function ng(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};MR(t,n,i,e,"",e)};ng.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ng.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ng.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ng.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function MR(e,t,r,n,i,o,a,s,l,c){if(n&&(typeof n==="undefined"?"undefined":_type_of(n))=="object"&&!Array.isArray(n)){t(n,i,o,a,s,l,c);for(var d in n){var u=n[d];if(Array.isArray(u)){if(d in ng.arrayKeywords)for(var p=0;p<u.length;p++)MR(e,t,r,u[p],i+"/"+d+"/"+p,o,i,d,n,p)}else if(d in ng.propsKeywords){if(u&&(typeof u==="undefined"?"undefined":_type_of(u))=="object")for(var m in u)MR(e,t,r,u[m],i+"/"+d+"/"+TIt(m),o,i,d,n,m)}else(d in ng.keywords||e.allKeys&&!(d in ng.skipKeywords))&&MR(e,t,r,u,i+"/"+d,o,i,d,n)}r(n,i,o,a,s,l,c)}}});var nk=Be(function(Pl){"use strict";var MIt=function MIt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return typeof e=="boolean"?!0:t===!0?!vZ(e):t?PAe(e)<=t:!1};var RAe=function RAe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;r!==!1&&(t=L_(t));var n=e.parse(t);return MAe(e,n)};var MAe=function MAe(e,t){return e.serialize(t).split("#")[0]+"#"};var L_=function L_(e){return e?e.replace($It,""):""};var NIt=function NIt(e,t,r){return r=L_(r),e.resolve(t,r)};var LIt=function LIt(e,t){var _this=this;if(typeof e=="boolean")return{};var _this_opts=this.opts,r=_this_opts.schemaId,n=_this_opts.uriResolver,i=L_(e[r]||t),o={"":i},a=RAe(n,i,!1),s={},l=new Set;return PIt(e,{allKeys:!0},function(u,p,m,h){var v=function v(_){var b=this.opts.uriResolver.resolve;if(_=L_(x?b(x,_):_),l.has(_))throw d(_);l.add(_);var w=this.refs[_];return typeof w=="string"&&(w=this.refs[w]),(typeof w==="undefined"?"undefined":_type_of(w))=="object"?c(u,w.schema,_):_!==L_(g)&&(_[0]==="#"?(c(u,s[_],_),s[_]=u):this.refs[_]=g),_};var y=function y(_){if(typeof _=="string"){if(!DIt.test(_))throw new Error('invalid anchor "'.concat(_,'"'));v.call(this,"#".concat(_))}};if(h===void 0)return;var g=a+p,x=o[h];typeof u[r]=="string"&&(x=v.call(_this,u[r])),y.call(_this,u.$anchor),y.call(_this,u.$dynamicAnchor),o[p]=x}),s;function c(u,p,m){if(p!==void 0&&!IIt(u,p))throw d(m)}function d(u){return new Error('reference "'.concat(u,'" resolves to more than one schema'))}};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.getSchemaRefs=Pl.resolveUrl=Pl.normalizeId=Pl._getFullPath=Pl.getFullPath=Pl.inlineRef=void 0;var AIt=vn(),IIt=yZ(),PIt=IAe(),RIt=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);Pl.inlineRef=MIt;var OIt=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function vZ(e){for(var t in e){if(OIt.has(t))return!0;var r=e[t];if(Array.isArray(r)&&r.some(vZ)||(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&vZ(r))return!0}return!1}function PAe(e){var t=0;for(var r in e){if(r==="$ref")return 1/0;if(t++,!RIt.has(r)&&(_type_of(e[r])=="object"&&(0,AIt.eachItem)(e[r],function(n){return t+=PAe(n)}),t===1/0))return 1/0}return t}Pl.getFullPath=RAe;Pl._getFullPath=MAe;var $It=/#\/?$/;Pl.normalizeId=L_;Pl.resolveUrl=NIt;var DIt=/^[a-z_][-a-z0-9._]*$/i;Pl.getSchemaRefs=LIt});var ak=Be(function(ig){"use strict";var jIt=function jIt(e){if(jAe(e)&&(UAe(e),zAe(e))){qIt(e);return}FAe(e,function(){return(0,LAe.topBoolOrEmptySchema)(e)})};var FAe=function FAe(param,o){var e=param.gen,t=param.validateName,r=param.schema,n=param.schemaEnv,i=param.opts;i.code.es5?e.func(t,(0,Gt._)(_templateObject124(),yr.default.data,yr.default.valCxt),n.$async,function(){e.code((0,Gt._)(_templateObject125(),$Ae(r,i))),BIt(e,i),e.code(o)}):e.func(t,(0,Gt._)(_templateObject126(),yr.default.data,UIt(i)),n.$async,function(){return e.code($Ae(r,i)).code(o)})};var UIt=function UIt(e){return(0,Gt._)(_templateObject128(),yr.default.instancePath,yr.default.parentData,yr.default.parentDataProperty,yr.default.rootData,yr.default.data,e.dynamicRef?(0,Gt._)(_templateObject127(),yr.default.dynamicAnchors):Gt.nil)};var BIt=function BIt(e,t){e.if(yr.default.valCxt,function(){e.var(yr.default.instancePath,(0,Gt._)(_templateObject129(),yr.default.valCxt,yr.default.instancePath)),e.var(yr.default.parentData,(0,Gt._)(_templateObject130(),yr.default.valCxt,yr.default.parentData)),e.var(yr.default.parentDataProperty,(0,Gt._)(_templateObject131(),yr.default.valCxt,yr.default.parentDataProperty)),e.var(yr.default.rootData,(0,Gt._)(_templateObject132(),yr.default.valCxt,yr.default.rootData)),t.dynamicRef&&e.var(yr.default.dynamicAnchors,(0,Gt._)(_templateObject133(),yr.default.valCxt,yr.default.dynamicAnchors))},function(){e.var(yr.default.instancePath,(0,Gt._)(_templateObject134())),e.var(yr.default.parentData,(0,Gt._)(_templateObject135())),e.var(yr.default.parentDataProperty,(0,Gt._)(_templateObject136())),e.var(yr.default.rootData,yr.default.data),t.dynamicRef&&e.var(yr.default.dynamicAnchors,(0,Gt._)(_templateObject137()))})};var qIt=function qIt(e){var t=e.schema,r=e.opts,n=e.gen;FAe(e,function(){r.$comment&&t.$comment&&qAe(e),ZIt(e),n.let(yr.default.vErrors,null),n.let(yr.default.errors,0),r.unevaluated&&WIt(e),BAe(e),JIt(e)})};var WIt=function WIt(e){var t=e.gen,r=e.validateName;e.evaluated=t.const("evaluated",(0,Gt._)(_templateObject138(),r)),t.if((0,Gt._)(_templateObject139(),e.evaluated),function(){return t.assign((0,Gt._)(_templateObject140(),e.evaluated),(0,Gt._)(_templateObject141()))}),t.if((0,Gt._)(_templateObject142(),e.evaluated),function(){return t.assign((0,Gt._)(_templateObject143(),e.evaluated),(0,Gt._)(_templateObject144()))})};var $Ae=function $Ae(e,t){var r=(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Gt._)(_templateObject145(),r):Gt.nil};var VIt=function VIt(e,t){if(jAe(e)&&(UAe(e),zAe(e))){GIt(e,t);return}(0,LAe.boolOrEmptySchema)(e,t)};var zAe=function zAe(param){var e=param.schema,t=param.self;if(typeof e=="boolean")return!e;for(var r in e)if(t.RULES.all[r])return!0;return!1};var jAe=function jAe(e){return typeof e.schema!="boolean"};var GIt=function GIt(e,t){var r=e.schema,n=e.gen,i=e.opts;i.$comment&&r.$comment&&qAe(e),KIt(e),QIt(e);var o=n.const("_errs",yr.default.errors);BAe(e,o),n.var(t,(0,Gt._)(_templateObject146(),o,yr.default.errors))};var UAe=function UAe(e){(0,Gf.checkUnknownRules)(e),HIt(e)};var BAe=function BAe(e,t){if(e.opts.jtd)return NAe(e,[],!1,t);var r=(0,OAe.getSchemaTypes)(e.schema),n=(0,OAe.coerceAndCheckDataType)(e,r);NAe(e,r,!n,t)};var HIt=function HIt(e){var t=e.schema,r=e.errSchemaPath,n=e.opts,i=e.self;t.$ref&&n.ignoreKeywordsWithRef&&(0,Gf.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))};var ZIt=function ZIt(e){var t=e.schema,r=e.opts;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gf.checkStrictMode)(e,"default is ignored in the schema root")};var KIt=function KIt(e){var t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,zIt.resolveUrl)(e.opts.uriResolver,e.baseId,t))};var QIt=function QIt(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")};var qAe=function qAe(param){var e=param.gen,t=param.schemaEnv,r=param.schema,n=param.errSchemaPath,i=param.opts;var o=r.$comment;if(i.$comment===!0)e.code((0,Gt._)(_templateObject147(),yr.default.self,o));else if(typeof i.$comment=="function"){var a=(0,Gt.str)(_templateObject148(),n),s=e.scopeValue("root",{ref:t.root});e.code((0,Gt._)(_templateObject149(),yr.default.self,o,a,s))}};var JIt=function JIt(e){var t=e.gen,r=e.schemaEnv,n=e.validateName,i=e.ValidationError,o=e.opts;r.$async?t.if((0,Gt._)(_templateObject150(),yr.default.errors),function(){return t.return(yr.default.data)},function(){return t.throw((0,Gt._)(_templateObject151(),i,yr.default.vErrors))}):(t.assign((0,Gt._)(_templateObject152(),n),yr.default.vErrors),o.unevaluated&&YIt(e),t.return((0,Gt._)(_templateObject153(),yr.default.errors)))};var YIt=function YIt(param){var e=param.gen,t=param.evaluated,r=param.props,n=param.items;_instanceof(r,Gt.Name)&&e.assign((0,Gt._)(_templateObject154(),t),r),_instanceof(n,Gt.Name)&&e.assign((0,Gt._)(_templateObject155(),t),n)};var NAe=function NAe(e,t,r,n){var i=e.gen,o=e.schema,a=e.data,s=e.allErrors,l=e.opts,c=e.self,d=c.RULES;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,Gf.schemaHasRulesButRef)(o,d))){i.block(function(){return VAe(e,"$ref",d.all.$ref.definition)});return}l.jtd||XIt(e,t),i.block(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=d.rules[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;u(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}u(d.post)});function u(p){(0,bZ.shouldUseGroup)(o,p)&&(p.type?(i.if((0,OR.checkDataType)(p.type,a,l.strictNumbers)),DAe(e,p),t.length===1&&t[0]===p.type&&r&&(i.else(),(0,OR.reportTypeError)(e)),i.endIf()):DAe(e,p),s||i.if((0,Gt._)(_templateObject156(),yr.default.errors,n||0)))}};var DAe=function DAe(e,t){var r=e.gen,n=e.schema,_e_opts=e.opts,i=_e_opts.useDefaults;i&&(0,FIt.assignDefaults)(e,t.type),r.block(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.rules[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;(0,bZ.shouldUseRule)(n,o)&&VAe(e,o.keyword,o.definition,t.type)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}})};var XIt=function XIt(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(e9t(e,t),e.opts.allowUnionTypes||t9t(e,t),r9t(e,e.dataTypes))};var e9t=function e9t(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(function(r){WAe(e.dataTypes,r)||wZ(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),i9t(e,t)}};var t9t=function t9t(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&wZ(e,"use allowUnionTypes to allow union type keyword")};var r9t=function r9t(e,t){var r=e.self.RULES.all;for(var n in r){var i=r[n];if((typeof i==="undefined"?"undefined":_type_of(i))=="object"&&(0,bZ.shouldUseRule)(e.schema,i)){var _i_definition=i.definition,o=_i_definition.type;o.length&&!o.some(function(a){return n9t(t,a)})&&wZ(e,'missing type "'.concat(o.join(","),'" for keyword "').concat(n,'"'))}}};var n9t=function n9t(e,t){return e.includes(t)||t==="number"&&e.includes("integer")};var WAe=function WAe(e,t){return e.includes(t)||t==="integer"&&e.includes("number")};var i9t=function i9t(e,t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.dataTypes[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;WAe(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}e.dataTypes=r};var wZ=function wZ(e,t){var r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,Gf.checkStrictMode)(e,t,e.opts.strictTypes)};var VAe=function VAe(e,t,r,n){var i=new $R(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ok.funcKeywordCode)(i,r):"macro"in r?(0,ok.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ok.funcKeywordCode)(i,r)};var GAe=function GAe(e,param){var t=param.dataLevel,r=param.dataNames,n=param.dataPathArr;var i,o;if(e==="")return yr.default.rootData;if(e[0]==="/"){if(!o9t.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));i=e,o=yr.default.rootData}else{var c=a9t.exec(e);if(!c)throw new Error("Invalid JSON-pointer: ".concat(e));var d=+c[1];if(i=c[2],i==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));if(o=r[t-d],!i)return o}var a=o,s=i.split("/");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c10=_step.value;c10&&(o=(0,Gt._)(_templateObject157(),o,(0,Gt.getProperty)((0,Gf.unescapeJsonPointer)(c10))),a=(0,Gt._)(_templateObject158(),a,o))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a;function l(c,d){return"Cannot access ".concat(c," ").concat(d," levels up, current level is ").concat(t)}};Object.defineProperty(ig,"__esModule",{value:!0});ig.getData=ig.KeywordCxt=ig.validateFunctionCode=void 0;var LAe=pAe(),OAe=rk(),bZ=dZ(),OR=rk(),FIt=vAe(),ok=kAe(),_Z=EAe(),Gt=Ur(),yr=Vf(),zIt=nk(),Gf=vn(),ik=tk();ig.validateFunctionCode=jIt;var $R=/*#__PURE__*/function(){function $R(t,r,n){_class_call_check(this,$R);if((0,ok.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gf.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",GAe(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ok.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",yr.default.errors))}_create_class($R,[{key:"result",value:function result(t,r,n){this.failResult((0,Gt.not)(t),r,n)}},{key:"failResult",value:function failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}},{key:"pass",value:function pass(t,r){this.failResult((0,Gt.not)(t),void 0,r)}},{key:"fail",value:function fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}},{key:"fail$data",value:function fail$data(t){if(!this.$data)return this.fail(t);var _this=this,r=_this.schemaCode;this.fail((0,Gt._)(_templateObject159(),r,(0,Gt.or)(this.invalid$data(),t)))}},{key:"error",value:function error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}},{key:"_error",value:function _error(t,r){(t?ik.reportExtraError:ik.reportError)(this,this.def.error,r)}},{key:"$dataError",value:function $dataError(){(0,ik.reportError)(this,this.def.$dataError||ik.keyword$DataError)}},{key:"reset",value:function reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ik.resetErrorsCount)(this.gen,this.errsCount)}},{key:"ok",value:function ok(t){this.allErrors||this.gen.if(t)}},{key:"setParams",value:function setParams(t,r){r?Object.assign(this.params,t):this.params=t}},{key:"block$data",value:function block$data(t,r){var _this=this;var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gt.nil;this.gen.block(function(){_this.check$data(t,n),r()})}},{key:"check$data",value:function check$data(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gt.nil,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gt.nil;if(!this.$data)return;var _this=this,n=_this.gen,i=_this.schemaCode,o=_this.schemaType,a=_this.def;n.if((0,Gt.or)((0,Gt._)(_templateObject160(),i),r)),t!==Gt.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Gt.nil&&n.assign(t,!1)),n.else()}},{key:"invalid$data",value:function invalid$data(){var _this=this,t=_this.gen,r=_this.schemaCode,n=_this.schemaType,i=_this.def,o=_this.it;return(0,Gt.or)(a(),s());function a(){if(n.length){if(!_instanceof(r,Gt.Name))throw new Error("ajv implementation error");var l=Array.isArray(n)?n:[n];return(0,Gt._)(_templateObject161(),(0,OR.checkDataTypes)(l,r,o.opts.strictNumbers,OR.DataType.Wrong))}return Gt.nil}function s(){if(i.validateSchema){var l=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,Gt._)(_templateObject162(),l,r)}return Gt.nil}}},{key:"subschema",value:function subschema(t,r){var n=(0,_Z.getSubschema)(this.it,t);(0,_Z.extendSubschemaData)(n,this.it,t),(0,_Z.extendSubschemaMode)(n,t);var i=_object_spread_props(_object_spread({},this.it,n),{items:void 0,props:void 0});return VIt(i,r),i}},{key:"mergeEvaluated",value:function mergeEvaluated(t,r){var _this=this,n=_this.it,i=_this.gen;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Gf.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Gf.mergeEvaluated.items(i,t.items,n.items,r)))}},{key:"mergeValidEvaluated",value:function mergeValidEvaluated(t,r){var _this=this;var _this1=this,n=_this1.it,i=_this1.gen;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,function(){return _this.mergeEvaluated(t,Gt.Name)}),!0}}]);return $R}();ig.KeywordCxt=$R;var o9t=/^\/(?:[^~]|~0|~1)*$/,a9t=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;ig.getData=GAe});var NR=Be(function(kZ){"use strict";Object.defineProperty(kZ,"__esModule",{value:!0});var SZ=/*#__PURE__*/function(Error1){_inherits(SZ,Error1);function SZ(t){_class_call_check(this,SZ);var _this;_this=_call_super(this,SZ,["validation failed"]),_this.errors=t,_this.ajv=_this.validation=!0;return _this}return SZ}(_wrap_native_super(Error));kZ.default=SZ});var sk=Be(function(TZ){"use strict";Object.defineProperty(TZ,"__esModule",{value:!0});var CZ=nk(),EZ=/*#__PURE__*/function(Error1){_inherits(EZ,Error1);function EZ(t,r,n,i){_class_call_check(this,EZ);var _this;_this=_call_super(this,EZ,[i||"can't resolve reference ".concat(n," from id ").concat(r)]),_this.missingRef=(0,CZ.resolveUrl)(t,r,n),_this.missingSchema=(0,CZ.normalizeId)((0,CZ.getFullPath)(t,_this.missingRef));return _this}return EZ}(_wrap_native_super(Error));TZ.default=EZ});var LR=Be(function(pc){"use strict";var IZ=function IZ(e){var t=ZAe.call(this,e);if(t)return t;var r=(0,ud.getFullPath)(this.opts.uriResolver,e.root.baseId),_this_opts_code=this.opts.code,n=_this_opts_code.es5,i=_this_opts_code.lines,_this_opts=this.opts,o=_this_opts.ownProperties,a=new ld.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:s9t.default,code:(0,ld._)(_templateObject163())}));var l=a.scopeName("validate");e.validateName=l;var c={gen:a,allErrors:this.opts.allErrors,data:P1.default.data,parentData:P1.default.parentData,parentDataProperty:P1.default.parentDataProperty,dataNames:[P1.default.data],dataPathArr:[ld.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ld.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ld.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ld._)(_templateObject164()),opts:this.opts,self:this},d;try{this._compilations.add(e),(0,l9t.validateFunctionCode)(c),a.optimize(this.opts.code.optimize);var _$u=a.toString();d="".concat(a.scopeRefs(P1.default.scope),"return ").concat(_$u),this.opts.code.process&&(d=this.opts.code.process(d,e));var m=new Function("".concat(P1.default.self),"".concat(P1.default.scope),d)(this,this.scope.get());if(this.scope.value(l,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:l,validateCode:_$u,scopeValues:a._values}),this.opts.unevaluated){var h=c.props,g=c.items;m.evaluated={props:_instanceof(h,ld.Name)?void 0:h,items:_instanceof(g,ld.Name)?void 0:g,dynamicProps:_instanceof(h,ld.Name),dynamicItems:_instanceof(g,ld.Name)},m.source&&(m.source.evaluated=(0,ld.stringify)(m.evaluated))}return e.validate=m,e}catch(u){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),u}finally{this._compilations.delete(e)}};var u9t=function u9t(e,t,r){var n;r=(0,ud.resolveUrl)(this.opts.uriResolver,t,r);var i=e.refs[r];if(i)return i;var o=p9t.call(this,e,r);if(o===void 0){var a=(n=e.localRefs)===null||n===void 0?void 0:n[r],_this_opts=this.opts,s=_this_opts.schemaId;a&&(o=new F_({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=c9t.call(this,o)};var c9t=function c9t(e){return(0,ud.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:IZ.call(this,e)};var ZAe=function ZAe(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._compilations[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(d9t(t,e))return t}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};var d9t=function d9t(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId};var p9t=function p9t(e,t){var r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||DR.call(this,e,t)};var AZ=function AZ(e,param){var t=param.baseId,r=param.schema,n=param.root;var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.fragment.slice(1).split("/")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(typeof r=="boolean")return;var l=r[(0,HAe.unescapeFragment)(s)];if(l===void 0)return;r=l;var c=(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&r[this.opts.schemaId];!f9t.has(s)&&c&&(t=(0,ud.resolveUrl)(this.opts.uriResolver,t,c))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var o;if(typeof r!="boolean"&&r.$ref&&!(0,HAe.schemaHasRulesButRef)(r,this.RULES)){var s10=(0,ud.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=DR.call(this,n,s10)}var _this_opts=this.opts,a=_this_opts.schemaId;if(o=o||new F_({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o};Object.defineProperty(pc,"__esModule",{value:!0});pc.resolveSchema=pc.getCompilingSchema=pc.resolveRef=pc.compileSchema=pc.SchemaEnv=void 0;var ld=Ur(),s9t=NR(),P1=Vf(),ud=nk(),HAe=vn(),l9t=ak(),F_=function F_(t){_class_call_check(this,F_);var r;this.refs={},this.dynamicAnchors={};var n;_type_of(t.schema)=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ud.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}};pc.SchemaEnv=F_;pc.compileSchema=IZ;pc.resolveRef=u9t;pc.getCompilingSchema=ZAe;function DR(e,t){var r=this.opts.uriResolver.parse(t),n=(0,ud._getFullPath)(this.opts.uriResolver,r),i=(0,ud.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return AZ.call(this,r,e);var o=(0,ud.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){var s=DR.call(this,e,a);return _type_of(s==null?void 0:s.schema)!="object"?void 0:AZ.call(this,r,s)}if(_type_of(a==null?void 0:a.schema)=="object"){if(a.validate||IZ.call(this,a),o===(0,ud.normalizeId)(t)){var s10=a.schema,_this_opts=this.opts,l=_this_opts.schemaId,c=s10[l];return c&&(i=(0,ud.resolveUrl)(this.opts.uriResolver,i,c)),new F_({schema:s10,schemaId:l,root:e,baseId:i})}return AZ.call(this,r,a)}}pc.resolveSchema=DR;var f9t=new Set(["properties","patternProperties","enum","dependencies","definitions"])});var KAe=Be(function(qMr,m9t){m9t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var MZ=Be(function(WMr,tIe){"use strict";var RZ=function RZ(e){var t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t};var QAe=function QAe(e){return e.length=0,!0};var y9t=function y9t(e,t,r){if(e.length){var n=RZ(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0};var v9t=function v9t(e){var t=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,a=!1,s=y9t;for(var l=0;l<e.length;l++){var c=e[l];if(!(c==="["||c==="]"))if(c===":"){if(o===!0&&(a=!0),!s(i,n,r))break;if(++t>7){r.error=!0;break}l>0&&e[l-1]===":"&&(o=!0),n.push(":");continue}else if(c==="%"){if(!s(i,n,r))break;s=QAe}else{i.push(c);continue}}return i.length&&(s===QAe?r.zone=i.join(""):a?n.push(i.join("")):n.push(RZ(i))),r.address=n.join(""),r};var XAe=function XAe(e){if(_9t(e,":")<2)return{host:e,isIPV6:!1};var t=v9t(e);if(t.error)return{host:e,isIPV6:!1};{var r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}};var _9t=function _9t(e,t){var r=0;for(var n=0;n<e.length;n++)e[n]===t&&r++;return r};var b9t=function b9t(e){var t=e,r=[],n=-1,i=0;for(;i=t.length;){if(i===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(i===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(i===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")};var eIe=function eIe(e,t){var r=t?k9t:S9t;return r.lastIndex=0,e.replace(r,function(n){return w9t[n]})};var C9t=function C9t(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.indexOf("%")===-1)return e;var r="";for(var n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){var i=e.slice(n+1,n+3);if(PZ(i)){var o=i.toUpperCase(),a=String.fromCharCode(parseInt(o,16));t&&YAe(a)?r+=a:r+="%"+o,n+=2;continue}}r+=e[n]}return r};var E9t=function E9t(e){var t="";for(var r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){var n=e.slice(r+1,r+3);if(PZ(n)){var i=n.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&YAe(o)?t+=o:t+="%"+i,r+=2;continue}}g9t(e[r])?t+=e[r]:t+=escape(e[r])}return t};var T9t=function T9t(e){var t="";for(var r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){var n=e.slice(r+1,r+3);if(PZ(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t};var A9t=function A9t(e){var t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){var r=unescape(e.host);if(!JAe(r)){var n=XAe(r);n.isIPV6===!0?r="[".concat(n.escapedHost,"]"):r=eIe(r,!1)}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0};var h9t=RegExp.prototype.test.bind(RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu")),JAe=RegExp.prototype.test.bind(RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u")),PZ=RegExp.prototype.test.bind(RegExp("^[\\da-f]{2}$","iu")),YAe=RegExp.prototype.test.bind(RegExp("^[\\da-z\\-._~]$","iu")),g9t=RegExp.prototype.test.bind(RegExp("^[\\da-z\\-._~!$&'()*+,;=:@/]$","iu"));var x9t=RegExp.prototype.test.bind(RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u"));var w9t={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},S9t=/[@/?#:]/g,k9t=/[@/?#]/g;tIe.exports={nonSimpleDomain:x9t,recomposeAuthority:A9t,reescapeHostDelimiters:eIe,normalizePercentEncoding:C9t,normalizePathEncoding:E9t,escapePreservingEscapes:T9t,removeDotSegments:b9t,isIPv4:JAe,isUUID:h9t,normalizeIPv6:XAe,stringArrayToHexStripped:RZ}});var aIe=Be(function(VMr,oIe){"use strict";var M9t=function M9t(e){return R9t.indexOf(e)!==-1};var OZ=function OZ(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1};var rIe=function rIe(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e};var nIe=function nIe(e){var t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e};var O9t=function O9t(e){return e.secure=OZ(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e};var $9t=function $9t(e){if((e.port===(OZ(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var _e_resourceName_split=_sliced_to_array(e.resourceName.split("?"),2),t=_e_resourceName_split[0],r=_e_resourceName_split[1];e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e};var N9t=function N9t(e,t){if(!e.path)return e.error="URN can not be parsed",e;var r=e.path.match(P9t);if(r){var n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];var i="".concat(n,":").concat(t.nid||e.nid),o=$Z(i);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e};var D9t=function D9t(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");var r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i="".concat(r,":").concat(t.nid||n),o=$Z(i);o&&(e=o.serialize(e,t));var a=e,s=e.nss;return a.path="".concat(n||t.nid,":").concat(s),t.skipEscape=!0,a};var L9t=function L9t(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!I9t(r.uuid))&&(r.error=r.error||"UUID is not valid."),r};var F9t=function F9t(e){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t};var $Z=function $Z(e){return e&&(zR[e]||zR[e.toLowerCase()])||void 0};var _MZ=MZ(),I9t=_MZ.isUUID,P9t=RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu"),R9t=["http","https","ws","wss","urn","urn:uuid"];var iIe={scheme:"http",domainHost:!0,parse:rIe,serialize:nIe},z9t={scheme:"https",domainHost:iIe.domainHost,parse:rIe,serialize:nIe},FR={scheme:"ws",domainHost:!0,parse:O9t,serialize:$9t},j9t={scheme:"wss",domainHost:FR.domainHost,parse:FR.parse,serialize:FR.serialize},U9t={scheme:"urn",parse:N9t,serialize:D9t,skipNormalize:!0},B9t={scheme:"urn:uuid",parse:L9t,serialize:F9t,skipNormalize:!0},zR={http:iIe,https:z9t,ws:FR,wss:j9t,urn:U9t,"urn:uuid":B9t};Object.setPrototypeOf(zR,null);oIe.exports={wsIsSecure:OZ,SCHEMES:zR,isValidSchemeName:M9t,getSchemeHandler:$Z}});var pIe=Be(function(GMr,jR){"use strict";var Y9t=function Y9t(e,t){return typeof e=="string"?e=iPt(e,t):(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&(e=z_(R1(e,t),t)),e};var X9t=function X9t(e,t,r){var n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=uIe(z_(e,n),z_(t,n),n,!0);return n.skipEscape=!0,R1(i,n)};var uIe=function uIe(e,t,r,n){var i={};return n||(e=z_(R1(e,r),r),t=z_(R1(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=lk(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=lk(t.path||""),i.query=t.query):(t.path?(t.path[0]==="/"?i.path=lk(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=lk(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i};var ePt=function ePt(e,t,r){var n=sIe(e,r),i=sIe(t,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()};var R1=function R1(e,t){var r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],o=lIe(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=V9t(r.path):(r.path=H9t(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");var a=W9t(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){var s=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(s=lk(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),i.push(s)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")};var nPt=function nPt(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."};var cIe=function cIe(e,t){var r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);var a=e.match(rPt);a!==null&&a[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",i=!0);var s=e.match(tPt);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);var l=nPt(n,s);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(K9t(n.host)===!1){var u=q9t(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var c=lIe(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&Q9t(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!c||c&&!c.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=Z9t(unescape(n.host),o))),n.path&&(n.path=G9t(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch(d){n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}};var z_=function z_(e,t){return cIe(e,t).parsed};var iPt=function iPt(e,t){return dIe(e,t).normalized};var dIe=function dIe(e,t){var _cIe=cIe(e,t),r=_cIe.parsed,n=_cIe.malformedAuthorityOrPort;return{normalized:n?e:R1(r,t),malformedAuthorityOrPort:n}};var sIe=function sIe(e,t){if(typeof e=="string"){var _dIe=dIe(e,t),r=_dIe.normalized,n=_dIe.malformedAuthorityOrPort;return n?void 0:r}if((typeof e==="undefined"?"undefined":_type_of(e))=="object")return R1(e,t)};var _MZ=MZ(),q9t=_MZ.normalizeIPv6,lk=_MZ.removeDotSegments,W9t=_MZ.recomposeAuthority,V9t=_MZ.normalizePercentEncoding,G9t=_MZ.normalizePathEncoding,H9t=_MZ.escapePreservingEscapes,Z9t=_MZ.reescapeHostDelimiters,K9t=_MZ.isIPv4,Q9t=_MZ.nonSimpleDomain,_aIe=aIe(),J9t=_aIe.SCHEMES,lIe=_aIe.getSchemeHandler;var tPt=RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u"),rPt=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;var NZ={SCHEMES:J9t,normalize:Y9t,resolve:X9t,resolveComponent:uIe,equal:ePt,serialize:R1,parse:z_};jR.exports=NZ;jR.exports.default=NZ;jR.exports.fastUri=NZ});var mIe=Be(function(DZ){"use strict";Object.defineProperty(DZ,"__esModule",{value:!0});var fIe=pIe();fIe.code='require("ajv/dist/runtime/uri").default';DZ.default=fIe});var wIe=Be(function(Ba){"use strict";var mPt=function mPt(e){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C;var T=e.strict,I=(t=e.code)===null||t===void 0?void 0:t.optimize,O=I===!0||I===void 0?1:I||0,M=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:_Ie,R=(i=e.uriResolver)!==null&&i!==void 0?i:uPt.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:T)!==null&&a!==void 0?a:!0,strictNumbers:(l=(s=e.strictNumbers)!==null&&s!==void 0?s:T)!==null&&l!==void 0?l:!0,strictTypes:(d=(c=e.strictTypes)!==null&&c!==void 0?c:T)!==null&&d!==void 0?d:"log",strictTuples:(p=(u=e.strictTuples)!==null&&u!==void 0?u:T)!==null&&p!==void 0?p:"log",strictRequired:(h=(m=e.strictRequired)!==null&&m!==void 0?m:T)!==null&&h!==void 0?h:!1,code:e.code?_object_spread_props(_object_spread({},e.code),{optimize:O,regExp:M}):{optimize:O,regExp:M},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:gIe,loopEnum:(x=e.loopEnum)!==null&&x!==void 0?x:gIe,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(y=e.messages)!==null&&y!==void 0?y:!0,inlineRefs:(_=e.inlineRefs)!==null&&_!==void 0?_:!0,schemaId:(b=e.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(S=e.validateSchema)!==null&&S!==void 0?S:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(E=e.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(C=e.int32range)!==null&&C!==void 0?C:!0,uriResolver:R}};var xIe=function xIe(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"error";for(var i in e){var o=i;o in t&&this.logger[n]("".concat(r,": option ").concat(i,". ").concat(e[o]))}};var yIe=function yIe(e){return e=(0,ck.normalizeId)(e),this.schemas[e]||this.refs[e]};var hPt=function hPt(){var e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(var t in e)this.addSchema(e[t],t)};var gPt=function gPt(){for(var e in this.opts.formats){var t=this.opts.formats[e];t&&this.addFormat(e,t)}};var xPt=function xPt(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(var t in e){var r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}};var yPt=function yPt(){var e=_object_spread({},this.opts);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cPt[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;delete e[t]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e};var _Pt=function _Pt(e){if(e===!1)return vPt;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")};var wPt=function wPt(e,t){var _this=this,r=_this.RULES;if((0,FZ.eachItem)(e,function(n){if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!bPt.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')};var LZ=function LZ(e,t,r){var _this=this;var n;var i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');var _this1=this,o=_this1.RULES,a=i?o.post:o.rules.find(function(param){var l=param.type;return l===r});if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;var s={keyword:e,definition:_object_spread_props(_object_spread({},t),{type:(0,UR.getJSONTypes)(t.type),schemaType:(0,UR.getJSONTypes)(t.schemaType)})};t.before?SPt.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(function(l){return _this.addKeyword(l)})};var SPt=function SPt(e,t,r){var n=e.rules.findIndex(function(i){return i.keyword===r});n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))};var kPt=function kPt(e){var t=e.metaSchema;t!==void 0&&(e.$data&&this.opts.$data&&(t=bIe(t)),e.validateSchema=this.compile(t,!0))};var bIe=function bIe(e){return{anyOf:[e,CPt]}};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.CodeGen=Ba.Name=Ba.nil=Ba.stringify=Ba.str=Ba._=Ba.KeywordCxt=void 0;var oPt=ak();Object.defineProperty(Ba,"KeywordCxt",{enumerable:!0,get:function get1(){return oPt.KeywordCxt}});var j_=Ur();Object.defineProperty(Ba,"_",{enumerable:!0,get:function get1(){return j_._}});Object.defineProperty(Ba,"str",{enumerable:!0,get:function get1(){return j_.str}});Object.defineProperty(Ba,"stringify",{enumerable:!0,get:function get1(){return j_.stringify}});Object.defineProperty(Ba,"nil",{enumerable:!0,get:function get1(){return j_.nil}});Object.defineProperty(Ba,"Name",{enumerable:!0,get:function get1(){return j_.Name}});Object.defineProperty(Ba,"CodeGen",{enumerable:!0,get:function get1(){return j_.CodeGen}});var aPt=NR(),vIe=sk(),sPt=cZ(),uk=LR(),lPt=Ur(),ck=nk(),UR=rk(),FZ=vn(),hIe=KAe(),uPt=mIe(),_Ie=function(e,t){return new RegExp(e,t)};_Ie.code="new RegExp";var cPt=["removeAdditional","useDefaults","coerceTypes"],dPt=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),pPt={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},fPt={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gIe=200;var dk=/*#__PURE__*/function(){function dk(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,dk);this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=_object_spread({},t,mPt(t));var _this_opts_code=this.opts.code,r=_this_opts_code.es5,n=_this_opts_code.lines;this.scope=new lPt.ValueScope({scope:{},prefixes:dPt,es5:r,lines:n}),this.logger=_Pt(t.logger);var i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,sPt.getRules)(),xIe.call(this,pPt,t,"NOT SUPPORTED"),xIe.call(this,fPt,t,"DEPRECATED","warn"),this._metaOpts=yPt.call(this),t.formats&&gPt.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&xPt.call(this,t.keywords),_type_of(t.meta)=="object"&&this.addMetaSchema(t.meta),hPt.call(this),t.validateFormats=i}_create_class(dk,[{key:"_addVocabularies",value:function _addVocabularies(){this.addKeyword("$async")}},{key:"_addDefaultMetaSchema",value:function _addDefaultMetaSchema(){var _this_opts=this.opts,t=_this_opts.$data,r=_this_opts.meta,n=_this_opts.schemaId,i=hIe;n==="id"&&(i=_object_spread({},hIe),i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}},{key:"defaultMeta",value:function defaultMeta(){var _this_opts=this.opts,t=_this_opts.meta,r=_this_opts.schemaId;return this.opts.defaultMeta=(typeof t==="undefined"?"undefined":_type_of(t))=="object"?t[r]||t:void 0}},{key:"validate",value:function validate(t,r){var n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);var i=n(r);return"$async"in n||(this.errors=n.errors),i}},{key:"compile",value:function compile(t,r){var n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}},{key:"compileAsync",value:function compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");var _this_opts=this.opts,n=_this_opts.loadSchema;return i.call(this,t,r);function i(d,u){return _async_to_generator(function(){var p;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,o.call(this,d.$schema)];case 1:_state.sent();p=this._addSchema(d,u);return[2,p.validate||a.call(this,p)]}})}).call(this)}function o(d){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=d&&!this.getSchema(d);if(!_tmp)return[3,2];return[4,i.call(this,{$ref:d},!0)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}function a(d){return _async_to_generator(function(){var u;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,1,,3]);return[2,this._compileSchemaEnv(d)];case 1:u=_state.sent();if(!_instanceof(u,vIe.default))throw u;s.call(this,u);return[4,l.call(this,u.missingSchema)];case 2:return[2,(_state.sent(),a.call(this,d))];case 3:return[2]}})}).call(this)}function s(param){var d=param.missingSchema,u=param.missingRef;if(this.refs[d])throw new Error("AnySchema ".concat(d," is loaded but ").concat(u," cannot be resolved"))}function l(d){return _async_to_generator(function(){var u,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,c.call(this,d)];case 1:u=_state.sent();_tmp=this.refs[d];if(_tmp)return[3,3];return[4,o.call(this,u.$schema)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp,this.refs[d]||this.addSchema(u,d,r);return[2]}})}).call(this)}function c(d){return _async_to_generator(function(){var u;return _ts_generator(this,function(_state){switch(_state.label){case 0:u=this._loading[d];if(u)return[2,u];_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,this._loading[d]=n(d)];case 2:return[2,_state.sent()];case 3:delete this._loading[d];return[7];case 4:return[2]}})}).call(this)}}},{key:"addSchema",value:function addSchema(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.opts.validateSchema;if(Array.isArray(t)){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;this.addSchema(a,void 0,n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}var o;if((typeof t==="undefined"?"undefined":_type_of(t))=="object"){var _this_opts=this.opts,a9=_this_opts.schemaId;if(o=t[a9],o!==void 0&&typeof o!="string")throw new Error("schema ".concat(a9," must be string"))}return r=(0,ck.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}},{key:"addMetaSchema",value:function addMetaSchema(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.opts.validateSchema;return this.addSchema(t,r,!0,n),this}},{key:"validateSchema",value:function validateSchema(t,r){if(typeof t=="boolean")return!0;var n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var i=this.validate(n,t);if(!i&&r){var o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}},{key:"getSchema",value:function getSchema(t){var r;for(;typeof(r=yIe.call(this,t))=="string";)t=r;if(r===void 0){var _this_opts=this.opts,n=_this_opts.schemaId,i=new uk.SchemaEnv({schema:{},schemaId:n});if(r=uk.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}},{key:"removeSchema",value:function removeSchema(t){if(_instanceof(t,RegExp))return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t==="undefined"?"undefined":_type_of(t)){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{var r=yIe.call(this,t);return(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{var r10=t;this._cache.delete(r10);var n=t[this.opts.schemaId];return n&&(n=(0,ck.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}},{key:"addVocabulary",value:function addVocabulary(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;this.addKeyword(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}},{key:"addKeyword",value:function addKeyword(t,r){var _this=this;var n;if(typeof t=="string")n=t,(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if((typeof t==="undefined"?"undefined":_type_of(t))=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(wPt.call(this,n,r),!r)return(0,FZ.eachItem)(n,function(o){return LZ.call(_this,o)}),this;kPt.call(this,r);var i=_object_spread_props(_object_spread({},r),{type:(0,UR.getJSONTypes)(r.type),schemaType:(0,UR.getJSONTypes)(r.schemaType)});return(0,FZ.eachItem)(n,i.type.length===0?function(o){return LZ.call(_this,o,i)}:function(o){return i.type.forEach(function(a){return LZ.call(_this,o,i,a)})}),this}},{key:"getKeyword",value:function getKeyword(t){var r=this.RULES.all[t];return(typeof r==="undefined"?"undefined":_type_of(r))=="object"?r.definition:!!r}},{key:"removeKeyword",value:function removeKeyword(t){var _this=this,r=_this.RULES;delete r.keywords[t],delete r.all[t];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.rules[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.rules.findIndex(function(o){return o.keyword===t});i>=0&&n.rules.splice(i,1)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}},{key:"addFormat",value:function addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}},{key:"errorsText",value:function errorsText(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.errors,_ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.separator,r=tmp===void 0?", ":tmp,tmp1=_ref.dataVar,n=tmp1===void 0?"data":tmp1;return!t||t.length===0?"No errors":t.map(function(i){return"".concat(n).concat(i.instancePath," ").concat(i.message)}).reduce(function(i,o){return i+r+o})}},{key:"$dataMetaSchema",value:function $dataMetaSchema(t,r){var n=this.RULES.all;t=JSON.parse(JSON.stringify(t));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.split("/").slice(1),a=t;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s=_step1.value;a=a[s]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}for(var s10 in n){var l=n[s10];if((typeof l==="undefined"?"undefined":_type_of(l))!="object")continue;var _l_definition=l.definition,c=_l_definition.$data,d=a[s10];c&&d&&(a[s10]=bIe(d))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"_removeAllSchemas",value:function _removeAllSchemas(t,r){for(var n in t){var i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}},{key:"_addSchema",value:function _addSchema(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.opts.validateSchema,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.opts.addUsedSchema;var a,_this_opts=this.opts,s=_this_opts.schemaId;if((typeof t==="undefined"?"undefined":_type_of(t))=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}var l=this._cache.get(t);if(l!==void 0)return l;n=(0,ck.normalizeId)(a||n);var c=ck.getSchemaRefs.call(this,t,n);return l=new uk.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:c}),this._cache.set(l.schema,l),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),i&&this.validateSchema(t,!0),l}},{key:"_checkUnique",value:function _checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}},{key:"_compileSchemaEnv",value:function _compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):uk.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}},{key:"_compileMetaSchema",value:function _compileMetaSchema(t){var r=this.opts;this.opts=this._metaOpts;try{uk.compileSchema.call(this,t)}finally{this.opts=r}}}]);return dk}();dk.ValidationError=aPt.default;dk.MissingRefError=vIe.default;Ba.default=dk;var vPt={log:function log(){},warn:function warn(){},error:function error(){}};var bPt=/^[a-z_$][a-z0-9_$:-]*$/i;var CPt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}});var SIe=Be(function(zZ){"use strict";Object.defineProperty(zZ,"__esModule",{value:!0});var EPt={keyword:"id",code:function code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zZ.default=EPt});var TIe=Be(function(M1){"use strict";var EIe=function EIe(e,t){var r=e.gen;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Rl._)(_templateObject165(),r.scopeValue("wrapper",{ref:t}))};var qR=function qR(e,t,r,n){var i=e.gen,o=e.it,a=o.allErrors,s=o.schemaEnv,l=o.opts,c=l.passContext?U_.default.this:Rl.nil;n?d():u();function d(){if(!s.$async)throw new Error("async schema referenced by sync schema");var h=i.let("valid");i.try(function(){i.code((0,Rl._)(_templateObject166(),(0,kIe.callValidateCode)(e,t,c))),m(t),a||i.assign(h,!0)},function(g){i.if((0,Rl._)(_templateObject167(),g,o.ValidationError),function(){return i.throw(g)}),p(g),a||i.assign(h,!1)}),e.ok(h)}function u(){e.result((0,kIe.callValidateCode)(e,t,c),function(){return m(t)},function(){return p(t)})}function p(h){var g=(0,Rl._)(_templateObject168(),h);i.assign(U_.default.vErrors,(0,Rl._)(_templateObject169(),U_.default.vErrors,g,U_.default.vErrors,g)),i.assign(U_.default.errors,(0,Rl._)(_templateObject170(),U_.default.vErrors))}function m(h){var g;if(!o.opts.unevaluated)return;var x=(g=r==null?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(o.props=BR.mergeEvaluated.props(i,x.props,o.props));else{var v=i.var("props",(0,Rl._)(_templateObject171(),h));o.props=BR.mergeEvaluated.props(i,v,o.props,Rl.Name)}if(o.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(o.items=BR.mergeEvaluated.items(i,x.items,o.items));else{var v10=i.var("items",(0,Rl._)(_templateObject172(),h));o.items=BR.mergeEvaluated.items(i,v10,o.items,Rl.Name)}}};Object.defineProperty(M1,"__esModule",{value:!0});M1.callRef=M1.getValidate=void 0;var TPt=sk(),kIe=dc(),Rl=Ur(),U_=Vf(),CIe=LR(),BR=vn(),APt={keyword:"$ref",schemaType:"string",code:function code(e){var t=e.gen,r=e.schema,n=e.it,i=n.baseId,o=n.schemaEnv,a=n.validateName,s=n.opts,l=n.self,c=o.root;if((r==="#"||r==="#/")&&i===c.baseId)return u();var d=CIe.resolveRef.call(l,c,i,r);if(d===void 0)throw new TPt.default(n.opts.uriResolver,i,r);if(_instanceof(d,CIe.SchemaEnv))return p(d);return m(d);function u(){if(o===c)return qR(e,a,o,o.$async);var h=t.scopeValue("root",{ref:c});return qR(e,(0,Rl._)(_templateObject173(),h),c,c.$async)}function p(h){var g=EIe(e,h);qR(e,g,h,h.$async)}function m(h){var g=t.scopeValue("schema",s.code.source===!0?{ref:h,code:(0,Rl.stringify)(h)}:{ref:h}),x=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Rl.nil,topSchemaRef:g,errSchemaPath:r},x);e.mergeEvaluated(v),e.ok(x)}}};M1.getValidate=EIe;M1.callRef=qR;M1.default=APt});var AIe=Be(function(jZ){"use strict";Object.defineProperty(jZ,"__esModule",{value:!0});var IPt=SIe(),PPt=TIe(),RPt=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",IPt.default,PPt.default];jZ.default=RPt});var IIe=Be(function(UZ){"use strict";Object.defineProperty(UZ,"__esModule",{value:!0});var WR=Ur(),og=WR.operators,VR={maximum:{okStr:"<=",ok:og.LTE,fail:og.GT},minimum:{okStr:">=",ok:og.GTE,fail:og.LT},exclusiveMaximum:{okStr:"<",ok:og.LT,fail:og.GTE},exclusiveMinimum:{okStr:">",ok:og.GT,fail:og.LTE}},MPt={message:function(param){var e=param.keyword,t=param.schemaCode;return(0,WR.str)(_templateObject174(),VR[e].okStr,t)},params:function(param){var e=param.keyword,t=param.schemaCode;return(0,WR._)(_templateObject175(),VR[e].okStr,t)}},OPt={keyword:Object.keys(VR),type:"number",schemaType:"number",$data:!0,error:MPt,code:function code(e){var t=e.keyword,r=e.data,n=e.schemaCode;e.fail$data((0,WR._)(_templateObject176(),r,VR[t].fail,n,r))}};UZ.default=OPt});var PIe=Be(function(BZ){"use strict";Object.defineProperty(BZ,"__esModule",{value:!0});var pk=Ur(),$Pt={message:function(param){var e=param.schemaCode;return(0,pk.str)(_templateObject177(),e)},params:function(param){var e=param.schemaCode;return(0,pk._)(_templateObject178(),e)}},NPt={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:$Pt,code:function code(e){var t=e.gen,r=e.data,n=e.schemaCode,i=e.it,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,pk._)(_templateObject179(),a,a,o):(0,pk._)(_templateObject180(),a,a);e.fail$data((0,pk._)(_templateObject181(),n,a,r,n,s))}};BZ.default=NPt});var MIe=Be(function(qZ){"use strict";var RIe=function RIe(e){var t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r};Object.defineProperty(qZ,"__esModule",{value:!0});qZ.default=RIe;RIe.code='require("ajv/dist/runtime/ucs2length").default'});var OIe=Be(function(WZ){"use strict";Object.defineProperty(WZ,"__esModule",{value:!0});var O1=Ur(),DPt=vn(),LPt=MIe(),FPt={message:function message(param){var e=param.keyword,t=param.schemaCode;var r=e==="maxLength"?"more":"fewer";return(0,O1.str)(_templateObject182(),r,t)},params:function(param){var e=param.schemaCode;return(0,O1._)(_templateObject183(),e)}},zPt={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:FPt,code:function code(e){var t=e.keyword,r=e.data,n=e.schemaCode,i=e.it,o=t==="maxLength"?O1.operators.GT:O1.operators.LT,a=i.opts.unicode===!1?(0,O1._)(_templateObject184(),r):(0,O1._)(_templateObject185(),(0,DPt.useFunc)(e.gen,LPt.default),r);e.fail$data((0,O1._)(_templateObject186(),a,o,n))}};WZ.default=zPt});var $Ie=Be(function(VZ){"use strict";Object.defineProperty(VZ,"__esModule",{value:!0});var jPt=dc(),UPt=vn(),B_=Ur(),BPt={message:function(param){var e=param.schemaCode;return(0,B_.str)(_templateObject187(),e)},params:function(param){var e=param.schemaCode;return(0,B_._)(_templateObject188(),e)}},qPt={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:BPt,code:function code(e){var t=e.gen,r=e.data,n=e.$data,i=e.schema,o=e.schemaCode,a=e.it,s=a.opts.unicodeRegExp?"u":"";if(n){var _a_opts_code=a.opts.code,l=_a_opts_code.regExp,c=l.code==="new RegExp"?(0,B_._)(_templateObject189()):(0,UPt.useFunc)(t,l),d=t.let("valid");t.try(function(){return t.assign(d,(0,B_._)(_templateObject190(),c,o,s,r))},function(){return t.assign(d,!1)}),e.fail$data((0,B_._)(_templateObject191(),d))}else{var l10=(0,jPt.usePattern)(e,i);e.fail$data((0,B_._)(_templateObject192(),l10,r))}}};VZ.default=qPt});var NIe=Be(function(GZ){"use strict";Object.defineProperty(GZ,"__esModule",{value:!0});var fk=Ur(),WPt={message:function message(param){var e=param.keyword,t=param.schemaCode;var r=e==="maxProperties"?"more":"fewer";return(0,fk.str)(_templateObject193(),r,t)},params:function(param){var e=param.schemaCode;return(0,fk._)(_templateObject194(),e)}},VPt={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:WPt,code:function code(e){var t=e.keyword,r=e.data,n=e.schemaCode,i=t==="maxProperties"?fk.operators.GT:fk.operators.LT;e.fail$data((0,fk._)(_templateObject195(),r,i,n))}};GZ.default=VPt});var DIe=Be(function(HZ){"use strict";Object.defineProperty(HZ,"__esModule",{value:!0});var mk=dc(),hk=Ur(),GPt=vn(),HPt={message:function(param){var _param_params=param.params,e=_param_params.missingProperty;return(0,hk.str)(_templateObject196(),e)},params:function(param){var _param_params=param.params,e=_param_params.missingProperty;return(0,hk._)(_templateObject197(),e)}},ZPt={keyword:"required",type:"object",schemaType:"array",$data:!0,error:HPt,code:function code(e){var t=e.gen,r=e.schema,n=e.schemaCode,i=e.data,o=e.$data,a=e.it,s=a.opts;if(!o&&r.length===0)return;var l=r.length>=s.loopRequired;if(a.allErrors?c():d(),s.strictRequired){var m=e.parentSchema.properties,_e_it=e.it,h=_e_it.definedProperties;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;if((m==null?void 0:m[g])===void 0&&!h.has(g)){var x=a.schemaEnv.baseId+a.errSchemaPath,v='required property "'.concat(g,'" is not defined at "').concat(x,'" (strictRequired)');(0,GPt.checkStrictMode)(a,v,a.opts.strictRequired)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function c(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(l||o)e.block$data(hk.nil,u);else try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;(0,mk.checkReportMissingProp)(e,m)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function d(){var m=t.let("missing");if(l||o){var h=t.let("valid",!0);e.block$data(h,function(){return p(m,h)}),e.ok(h)}else t.if((0,mk.checkMissingProp)(e,r,m)),(0,mk.reportMissingProp)(e,m),t.else()}function u(){t.forOf("prop",n,function(m){e.setParams({missingProperty:m}),t.if((0,mk.noPropertyInData)(t,i,m,s.ownProperties),function(){return e.error()})})}function p(m,h){e.setParams({missingProperty:m}),t.forOf(m,n,function(){t.assign(h,(0,mk.propertyInData)(t,i,m,s.ownProperties)),t.if((0,hk.not)(h),function(){e.error(),t.break()})},hk.nil)}}};HZ.default=ZPt});var LIe=Be(function(ZZ){"use strict";Object.defineProperty(ZZ,"__esModule",{value:!0});var gk=Ur(),KPt={message:function message(param){var e=param.keyword,t=param.schemaCode;var r=e==="maxItems"?"more":"fewer";return(0,gk.str)(_templateObject198(),r,t)},params:function(param){var e=param.schemaCode;return(0,gk._)(_templateObject199(),e)}},QPt={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:KPt,code:function code(e){var t=e.keyword,r=e.data,n=e.schemaCode,i=t==="maxItems"?gk.operators.GT:gk.operators.LT;e.fail$data((0,gk._)(_templateObject200(),r,i,n))}};ZZ.default=QPt});var GR=Be(function(KZ){"use strict";Object.defineProperty(KZ,"__esModule",{value:!0});var FIe=yZ();FIe.code='require("ajv/dist/runtime/equal").default';KZ.default=FIe});var zIe=Be(function(JZ){"use strict";Object.defineProperty(JZ,"__esModule",{value:!0});var QZ=rk(),qa=Ur(),JPt=vn(),YPt=GR(),XPt={message:function(param){var _param_params=param.params,e=_param_params.i,t=_param_params.j;return(0,qa.str)(_templateObject201(),t,e)},params:function(param){var _param_params=param.params,e=_param_params.i,t=_param_params.j;return(0,qa._)(_templateObject202(),e,t)}},eRt={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:XPt,code:function code(e){var t=e.gen,r=e.data,n=e.$data,i=e.schema,o=e.parentSchema,a=e.schemaCode,s=e.it;if(!n&&!i)return;var l=t.let("valid"),c=o.items?(0,QZ.getSchemaTypes)(o.items):[];e.block$data(l,d,(0,qa._)(_templateObject203(),a)),e.ok(l);function d(){var h=t.let("i",(0,qa._)(_templateObject204(),r)),g=t.let("j");e.setParams({i:h,j:g}),t.assign(l,!0),t.if((0,qa._)(_templateObject205(),h),function(){return(u()?p:m)(h,g)})}function u(){return c.length>0&&!c.some(function(h){return h==="object"||h==="array"})}function p(h,g){var x=t.name("item"),v=(0,QZ.checkDataTypes)(c,x,s.opts.strictNumbers,QZ.DataType.Wrong),y=t.const("indices",(0,qa._)(_templateObject206()));t.for((0,qa._)(_templateObject207(),h),function(){t.let(x,(0,qa._)(_templateObject208(),r,h)),t.if(v,(0,qa._)(_templateObject209())),c.length>1&&t.if((0,qa._)(_templateObject210(),x),(0,qa._)(_templateObject211(),x)),t.if((0,qa._)(_templateObject212(),y,x),function(){t.assign(g,(0,qa._)(_templateObject213(),y,x)),e.error(),t.assign(l,!1).break()}).code((0,qa._)(_templateObject214(),y,x,h))})}function m(h,g){var x=(0,JPt.useFunc)(t,YPt.default),v=t.name("outer");t.label(v).for((0,qa._)(_templateObject215(),h),function(){return t.for((0,qa._)(_templateObject216(),g,h,g),function(){return t.if((0,qa._)(_templateObject217(),x,r,h,r,g),function(){e.error(),t.assign(l,!1).break(v)})})})}}};JZ.default=eRt});var jIe=Be(function(XZ){"use strict";Object.defineProperty(XZ,"__esModule",{value:!0});var YZ=Ur(),tRt=vn(),rRt=GR(),nRt={message:"must be equal to constant",params:function(param){var e=param.schemaCode;return(0,YZ._)(_templateObject218(),e)}},iRt={keyword:"const",$data:!0,error:nRt,code:function code(e){var t=e.gen,r=e.data,n=e.$data,i=e.schemaCode,o=e.schema;n||o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"?e.fail$data((0,YZ._)(_templateObject219(),(0,tRt.useFunc)(t,rRt.default),r,i)):e.fail((0,YZ._)(_templateObject220(),o,r))}};XZ.default=iRt});var UIe=Be(function(eK){"use strict";Object.defineProperty(eK,"__esModule",{value:!0});var xk=Ur(),oRt=vn(),aRt=GR(),sRt={message:"must be equal to one of the allowed values",params:function(param){var e=param.schemaCode;return(0,xk._)(_templateObject221(),e)}},lRt={keyword:"enum",schemaType:"array",$data:!0,error:sRt,code:function code(e){var t=e.gen,r=e.data,n=e.$data,i=e.schema,o=e.schemaCode,a=e.it;if(!n&&i.length===0)throw new Error("enum must have non-empty array");var s=i.length>=a.opts.loopEnum,l,c=function(){return l!=null?l:l=(0,oRt.useFunc)(t,aRt.default)},d;if(s||n)d=t.let("valid"),e.block$data(d,u);else{if(!Array.isArray(i))throw new Error("ajv implementation error");var m=t.const("vSchema",o);d=(0,xk.or).apply(this,_to_consumable_array(i.map(function(h,g){return p(m,g)})))}e.pass(d);function u(){t.assign(d,!1),t.forOf("v",o,function(m){return t.if((0,xk._)(_templateObject222(),c(),r,m),function(){return t.assign(d,!0).break()})})}function p(m,h){var g=i[h];return(typeof g==="undefined"?"undefined":_type_of(g))=="object"&&g!==null?(0,xk._)(_templateObject223(),c(),r,m,h):(0,xk._)(_templateObject224(),r,g)}}};eK.default=lRt});var BIe=Be(function(tK){"use strict";Object.defineProperty(tK,"__esModule",{value:!0});var uRt=IIe(),cRt=PIe(),dRt=OIe(),pRt=$Ie(),fRt=NIe(),mRt=DIe(),hRt=LIe(),gRt=zIe(),xRt=jIe(),yRt=UIe(),vRt=[uRt.default,cRt.default,dRt.default,pRt.default,fRt.default,mRt.default,hRt.default,gRt.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xRt.default,yRt.default];tK.default=vRt});var nK=Be(function(yk){"use strict";var qIe=function qIe(e,t){var r=e.gen,n=e.schema,i=e.data,o=e.keyword,a=e.it;a.items=!0;var s=r.const("len",(0,$1._)(_templateObject225(),i));if(n===!1)e.setParams({len:t.length}),e.pass((0,$1._)(_templateObject226(),s,t.length));else if((typeof n==="undefined"?"undefined":_type_of(n))=="object"&&!(0,rK.alwaysValidSchema)(a,n)){var c=r.var("valid",(0,$1._)(_templateObject227(),s,t.length));r.if((0,$1.not)(c),function(){return l(c)}),e.ok(c)}function l(c){r.forRange("i",t.length,s,function(d){e.subschema({keyword:o,dataProp:d,dataPropType:rK.Type.Num},c),a.allErrors||r.if((0,$1.not)(c),function(){return r.break()})})}};Object.defineProperty(yk,"__esModule",{value:!0});yk.validateAdditionalItems=void 0;var $1=Ur(),rK=vn(),_Rt={message:function(param){var _param_params=param.params,e=_param_params.len;return(0,$1.str)(_templateObject228(),e)},params:function(param){var _param_params=param.params,e=_param_params.len;return(0,$1._)(_templateObject229(),e)}},bRt={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_Rt,code:function code(e){var t=e.parentSchema,r=e.it,n=t.items;if(!Array.isArray(n)){(0,rK.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}qIe(e,n)}};yk.validateAdditionalItems=qIe;yk.default=bRt});var iK=Be(function(vk){"use strict";var VIe=function VIe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.schema;var n=e.gen,i=e.parentSchema,o=e.data,a=e.keyword,s=e.it;d(i),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=HR.mergeEvaluated.items(n,r.length,s.items));var l=n.name("valid"),c=n.const("len",(0,WIe._)(_templateObject230(),o));r.forEach(function(u,p){(0,HR.alwaysValidSchema)(s,u)||(n.if((0,WIe._)(_templateObject231(),c,p),function(){return e.subschema({keyword:a,schemaProp:p,dataProp:p},l)}),e.ok(l))});function d(u){var p=s.opts,m=s.errSchemaPath,h=r.length,g=h===u.minItems&&(h===u.maxItems||u[t]===!1);if(p.strictTuples&&!g){var x='"'.concat(a,'" is ').concat(h,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(m,'"');(0,HR.checkStrictMode)(s,x,p.strictTuples)}}};Object.defineProperty(vk,"__esModule",{value:!0});vk.validateTuple=void 0;var WIe=Ur(),HR=vn(),wRt=dc(),SRt={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code:function code(e){var t=e.schema,r=e.it;if(Array.isArray(t))return VIe(e,"additionalItems",t);r.items=!0,!(0,HR.alwaysValidSchema)(r,t)&&e.ok((0,wRt.validateArray)(e))}};vk.validateTuple=VIe;vk.default=SRt});var GIe=Be(function(oK){"use strict";Object.defineProperty(oK,"__esModule",{value:!0});var kRt=iK(),CRt={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:function(e){return(0,kRt.validateTuple)(e,"items")}};oK.default=CRt});var ZIe=Be(function(aK){"use strict";Object.defineProperty(aK,"__esModule",{value:!0});var HIe=Ur(),ERt=vn(),TRt=dc(),ARt=nK(),IRt={message:function(param){var _param_params=param.params,e=_param_params.len;return(0,HIe.str)(_templateObject232(),e)},params:function(param){var _param_params=param.params,e=_param_params.len;return(0,HIe._)(_templateObject233(),e)}},PRt={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:IRt,code:function code(e){var t=e.schema,r=e.parentSchema,n=e.it,i=r.prefixItems;n.items=!0,!(0,ERt.alwaysValidSchema)(n,t)&&(i?(0,ARt.validateAdditionalItems)(e,i):e.ok((0,TRt.validateArray)(e)))}};aK.default=PRt});var KIe=Be(function(sK){"use strict";Object.defineProperty(sK,"__esModule",{value:!0});var fc=Ur(),ZR=vn(),RRt={message:function(param){var _param_params=param.params,e=_param_params.min,t=_param_params.max;return t===void 0?(0,fc.str)(_templateObject234(),e):(0,fc.str)(_templateObject235(),e,t)},params:function(param){var _param_params=param.params,e=_param_params.min,t=_param_params.max;return t===void 0?(0,fc._)(_templateObject236(),e):(0,fc._)(_templateObject237(),e,t)}},MRt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:RRt,code:function code(e){var t=e.gen,r=e.schema,n=e.parentSchema,i=e.data,o=e.it,a,s,l=n.minContains,c=n.maxContains;o.opts.next?(a=l===void 0?1:l,s=c):a=1;var d=t.const("len",(0,fc._)(_templateObject238(),i));if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,ZR.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,ZR.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ZR.alwaysValidSchema)(o,r)){var g=(0,fc._)(_templateObject239(),d,a);s!==void 0&&(g=(0,fc._)(_templateObject240(),g,d,s)),e.pass(g);return}o.items=!0;var u=t.name("valid");s===void 0&&a===1?m(u,function(){return t.if(u,function(){return t.break()})}):a===0?(t.let(u,!0),s!==void 0&&t.if((0,fc._)(_templateObject241(),i),p)):(t.let(u,!1),p()),e.result(u,function(){return e.reset()});function p(){var g=t.name("_valid"),x=t.let("count",0);m(g,function(){return t.if(g,function(){return h(x)})})}function m(g,x){t.forRange("i",0,d,function(v){e.subschema({keyword:"contains",dataProp:v,dataPropType:ZR.Type.Num,compositeRule:!0},g),x()})}function h(g){t.code((0,fc._)(_templateObject242(),g)),s===void 0?t.if((0,fc._)(_templateObject243(),g,a),function(){return t.assign(u,!0).break()}):(t.if((0,fc._)(_templateObject244(),g,s),function(){return t.assign(u,!1).break()}),a===1?t.assign(u,!0):t.if((0,fc._)(_templateObject245(),g,a),function(){return t.assign(u,!0)}))}}};sK.default=MRt});var YIe=Be(function(Tp){"use strict";var NRt=function NRt(param){var e=param.schema;var t={},r={};for(var n in e){if(n==="__proto__")continue;var i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]};var QIe=function QIe(e){var _loop=function(a){var s=t[a];if(s.length===0)return"continue";var l=(0,_k.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),i.allErrors?r.if(l,function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;(0,_k.checkReportMissingProp)(e,c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}):(r.if((0,lK._)(_templateObject246(),l,(0,_k.checkMissingProp)(e,s,o))),(0,_k.reportMissingProp)(e,o),r.else())};var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.schema;var r=e.gen,n=e.data,i=e.it;if(Object.keys(t).length===0)return;var o=r.let("missing");for(var a in t)_loop(a)};var JIe=function JIe(e){var _loop=function(s){(0,ORt.alwaysValidSchema)(o,t[s])||(r.if((0,_k.propertyInData)(r,n,s,o.opts.ownProperties),function(){var l=e.subschema({keyword:i,schemaProp:s},a);e.mergeValidEvaluated(l,a)},function(){return r.var(a,!0)}),e.ok(a))};var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.schema;var r=e.gen,n=e.data,i=e.keyword,o=e.it,a=r.name("valid");for(var s in t)_loop(s)};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.validateSchemaDeps=Tp.validatePropertyDeps=Tp.error=void 0;var lK=Ur(),ORt=vn(),_k=dc();Tp.error={message:function(param){var _param_params=param.params,e=_param_params.property,t=_param_params.depsCount,r=_param_params.deps;var n=t===1?"property":"properties";return(0,lK.str)(_templateObject247(),n,r,e)},params:function(param){var _param_params=param.params,e=_param_params.property,t=_param_params.depsCount,r=_param_params.deps,n=_param_params.missingProperty;return(0,lK._)(_templateObject248(),e,n,t,r)}};var $Rt={keyword:"dependencies",type:"object",schemaType:"object",error:Tp.error,code:function code(e){var _NRt=_sliced_to_array(NRt(e),2),t=_NRt[0],r=_NRt[1];QIe(e,t),JIe(e,r)}};Tp.validatePropertyDeps=QIe;Tp.validateSchemaDeps=JIe;Tp.default=$Rt});var e9e=Be(function(uK){"use strict";Object.defineProperty(uK,"__esModule",{value:!0});var XIe=Ur(),DRt=vn(),LRt={message:"property name must be valid",params:function(param){var e=param.params;return(0,XIe._)(_templateObject249(),e.propertyName)}},FRt={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:LRt,code:function code(e){var t=e.gen,r=e.schema,n=e.data,i=e.it;if((0,DRt.alwaysValidSchema)(i,r))return;var o=t.name("valid");t.forIn("key",n,function(a){e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,XIe.not)(o),function(){e.error(!0),i.allErrors||t.break()})}),e.ok(o)}};uK.default=FRt});var dK=Be(function(cK){"use strict";Object.defineProperty(cK,"__esModule",{value:!0});var KR=dc(),cd=Ur(),zRt=Vf(),QR=vn(),jRt={message:"must NOT have additional properties",params:function(param){var e=param.params;return(0,cd._)(_templateObject250(),e.additionalProperty)}},URt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jRt,code:function code(e){var t=e.gen,r=e.schema,n=e.parentSchema,i=e.data,o=e.errsCount,a=e.it;if(!o)throw new Error("ajv implementation error");var s=a.allErrors,l=a.opts;if(a.props=!0,l.removeAdditional!=="all"&&(0,QR.alwaysValidSchema)(a,r))return;var c=(0,KR.allSchemaProperties)(n.properties),d=(0,KR.allSchemaProperties)(n.patternProperties);u(),e.ok((0,cd._)(_templateObject251(),o,zRt.default.errors));function u(){t.forIn("key",i,function(x){!c.length&&!d.length?h(x):t.if(p(x),function(){return h(x)})})}function p(x){var v;if(c.length>8){var y=(0,QR.schemaRefOrVal)(a,n.properties,"properties");v=(0,KR.isOwnProperty)(t,y,x)}else c.length?v=(0,cd.or).apply(this,_to_consumable_array(c.map(function(y){return(0,cd._)(_templateObject252(),x,y)}))):v=cd.nil;return d.length&&(v=(0,cd.or).apply(this,[v].concat(_to_consumable_array(d.map(function(y){return(0,cd._)(_templateObject253(),(0,KR.usePattern)(e,y),x)}))))),(0,cd.not)(v)}function m(x){t.code((0,cd._)(_templateObject254(),i,x))}function h(x){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){m(x);return}if(r===!1){e.setParams({additionalProperty:x}),e.error(),s||t.break();return}if((typeof r==="undefined"?"undefined":_type_of(r))=="object"&&!(0,QR.alwaysValidSchema)(a,r)){var v=t.name("valid");l.removeAdditional==="failing"?(g(x,v,!1),t.if((0,cd.not)(v),function(){e.reset(),m(x)})):(g(x,v),s||t.if((0,cd.not)(v),function(){return t.break()}))}}function g(x,v,y){var _={keyword:"additionalProperties",dataProp:x,dataPropType:QR.Type.Str};y===!1&&Object.assign(_,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(_,v)}}};cK.default=URt});var n9e=Be(function(fK){"use strict";Object.defineProperty(fK,"__esModule",{value:!0});var BRt=ak(),t9e=dc(),pK=vn(),r9e=dK(),qRt={keyword:"properties",type:"object",schemaType:"object",code:function code(e){var t=e.gen,r=e.schema,n=e.parentSchema,i=e.data,o=e.it;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&r9e.default.code(new BRt.KeywordCxt(o,r9e.default,"additionalProperties"));var a=(0,t9e.allSchemaProperties)(r);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;o.definedProperties.add(u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=pK.mergeEvaluated.props(t,(0,pK.toHash)(a),o.props));var s=a.filter(function(u){return!(0,pK.alwaysValidSchema)(o,r[u])});if(s.length===0)return;var l=t.name("valid");var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=s[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u10=_step1.value;c(u10)?d(u10):(t.if((0,t9e.propertyInData)(t,i,u10,o.opts.ownProperties)),d(u10),o.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(u10),e.ok(l)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}function c(u){return o.opts.useDefaults&&!o.compositeRule&&r[u].default!==void 0}function d(u){e.subschema({keyword:"properties",schemaProp:u,dataProp:u},l)}}};fK.default=qRt});var s9e=Be(function(mK){"use strict";Object.defineProperty(mK,"__esModule",{value:!0});var i9e=dc(),JR=Ur(),o9e=vn(),a9e=vn(),WRt={keyword:"patternProperties",type:"object",schemaType:"object",code:function code(e){var t=e.gen,r=e.schema,n=e.data,i=e.parentSchema,o=e.it,a=o.opts,s=(0,i9e.allSchemaProperties)(r),l=s.filter(function(g){return(0,o9e.alwaysValidSchema)(o,r[g])});if(s.length===0||l.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;var c=a.strictSchema&&!a.allowMatchingProperties&&i.properties,d=t.name("valid");o.props!==!0&&!_instanceof(o.props,JR.Name)&&(o.props=(0,a9e.evaluatedPropsToName)(t,o.props));var u=o.props;p();function p(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;c&&m(g),o.allErrors?h(g):(t.var(d,!0),h(g),t.if(d))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function m(g){for(var x in c)new RegExp(g).test(x)&&(0,o9e.checkStrictMode)(o,"property ".concat(x," matches pattern ").concat(g," (use allowMatchingProperties)"))}function h(g){t.forIn("key",n,function(x){t.if((0,JR._)(_templateObject255(),(0,i9e.usePattern)(e,g),x),function(){var v=l.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:x,dataPropType:a9e.Type.Str},d),o.opts.unevaluated&&u!==!0?t.assign((0,JR._)(_templateObject256(),u,x),!0):!v&&!o.allErrors&&t.if((0,JR.not)(d),function(){return t.break()})})})}}};mK.default=WRt});var l9e=Be(function(hK){"use strict";Object.defineProperty(hK,"__esModule",{value:!0});var VRt=vn(),GRt={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code:function code(e){var t=e.gen,r=e.schema,n=e.it;if((0,VRt.alwaysValidSchema)(n,r)){e.fail();return}var i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,function(){return e.reset()},function(){return e.error()})},error:{message:"must NOT be valid"}};hK.default=GRt});var u9e=Be(function(gK){"use strict";Object.defineProperty(gK,"__esModule",{value:!0});var HRt=dc(),ZRt={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:HRt.validateUnion,error:{message:"must match a schema in anyOf"}};gK.default=ZRt});var c9e=Be(function(xK){"use strict";Object.defineProperty(xK,"__esModule",{value:!0});var YR=Ur(),KRt=vn(),QRt={message:"must match exactly one schema in oneOf",params:function(param){var e=param.params;return(0,YR._)(_templateObject257(),e.passing)}},JRt={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:QRt,code:function code(e){var t=e.gen,r=e.schema,n=e.parentSchema,i=e.it;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;var o=r,a=t.let("valid",!1),s=t.let("passing",null),l=t.name("_valid");e.setParams({passing:s}),t.block(c),e.result(a,function(){return e.reset()},function(){return e.error(!0)});function c(){o.forEach(function(d,u){var p;(0,KRt.alwaysValidSchema)(i,d)?t.var(l,!0):p=e.subschema({keyword:"oneOf",schemaProp:u,compositeRule:!0},l),u>0&&t.if((0,YR._)(_templateObject258(),l,a)).assign(a,!1).assign(s,(0,YR._)(_templateObject259(),s,u)).else(),t.if(l,function(){t.assign(a,!0),t.assign(s,u),p&&e.mergeEvaluated(p,YR.Name)})})}}};xK.default=JRt});var d9e=Be(function(yK){"use strict";Object.defineProperty(yK,"__esModule",{value:!0});var YRt=vn(),XRt={keyword:"allOf",schemaType:"array",code:function code(e){var t=e.gen,r=e.schema,n=e.it;if(!Array.isArray(r))throw new Error("ajv implementation error");var i=t.name("valid");r.forEach(function(o,a){if((0,YRt.alwaysValidSchema)(n,o))return;var s=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(s)})}};yK.default=XRt});var m9e=Be(function(vK){"use strict";var p9e=function p9e(e,t){var r=e.schema[t];return r!==void 0&&!(0,f9e.alwaysValidSchema)(e,r)};Object.defineProperty(vK,"__esModule",{value:!0});var XR=Ur(),f9e=vn(),eMt={message:function(param){var e=param.params;return(0,XR.str)(_templateObject260(),e.ifClause)},params:function(param){var e=param.params;return(0,XR._)(_templateObject261(),e.ifClause)}},tMt={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eMt,code:function code(e){var t=e.gen,r=e.parentSchema,n=e.it;r.then===void 0&&r.else===void 0&&(0,f9e.checkStrictMode)(n,'"if" without "then" and "else" is ignored');var i=p9e(n,"then"),o=p9e(n,"else");if(!i&&!o)return;var a=t.let("valid",!0),s=t.name("_valid");if(l(),e.reset(),i&&o){var d=t.let("ifClause");e.setParams({ifClause:d}),t.if(s,c("then",d),c("else",d))}else i?t.if(s,c("then")):t.if((0,XR.not)(s),c("else"));e.pass(a,function(){return e.error(!0)});function l(){var d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(d)}function c(d,u){return function(){var p=e.subschema({keyword:d},s);t.assign(a,s),e.mergeValidEvaluated(p,a),u?t.assign(u,(0,XR._)(_templateObject262(),d)):e.setParams({ifClause:d})}}}};vK.default=tMt});var h9e=Be(function(_K){"use strict";Object.defineProperty(_K,"__esModule",{value:!0});var rMt=vn(),nMt={keyword:["then","else"],schemaType:["object","boolean"],code:function code(param){var e=param.keyword,t=param.parentSchema,r=param.it;t.if===void 0&&(0,rMt.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};_K.default=nMt});var g9e=Be(function(bK){"use strict";var _Mt=function _Mt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var t=[mMt.default,hMt.default,gMt.default,xMt.default,yMt.default,vMt.default,cMt.default,dMt.default,uMt.default,pMt.default,fMt.default];return e?t.push(oMt.default,sMt.default):t.push(iMt.default,aMt.default),t.push(lMt.default),t};Object.defineProperty(bK,"__esModule",{value:!0});var iMt=nK(),oMt=GIe(),aMt=iK(),sMt=ZIe(),lMt=KIe(),uMt=YIe(),cMt=e9e(),dMt=dK(),pMt=n9e(),fMt=s9e(),mMt=l9e(),hMt=u9e(),gMt=c9e(),xMt=d9e(),yMt=m9e(),vMt=h9e();bK.default=_Mt});var x9e=Be(function(wK){"use strict";Object.defineProperty(wK,"__esModule",{value:!0});var wo=Ur(),bMt={message:function(param){var e=param.schemaCode;return(0,wo.str)(_templateObject263(),e)},params:function(param){var e=param.schemaCode;return(0,wo._)(_templateObject264(),e)}},wMt={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bMt,code:function code(e,t){var r=e.gen,n=e.data,i=e.$data,o=e.schema,a=e.schemaCode,s=e.it,l=s.opts,c=s.errSchemaPath,d=s.schemaEnv,u=s.self;if(!l.validateFormats)return;i?p():m();function p(){var h=r.scopeValue("formats",{ref:u.formats,code:l.code.formats}),g=r.const("fDef",(0,wo._)(_templateObject265(),h,a)),x=r.let("fType"),v=r.let("format");r.if((0,wo._)(_templateObject266(),g,g),function(){return r.assign(x,(0,wo._)(_templateObject267(),g)).assign(v,(0,wo._)(_templateObject268(),g))},function(){return r.assign(x,(0,wo._)(_templateObject269())).assign(v,g)}),e.fail$data((0,wo.or)(y(),_()));function y(){return l.strictSchema===!1?wo.nil:(0,wo._)(_templateObject270(),a,v)}function _(){var b=d.$async?(0,wo._)(_templateObject271(),g,v,n,v,n):(0,wo._)(_templateObject272(),v,n),w=(0,wo._)(_templateObject273(),v,b,v,n);return(0,wo._)(_templateObject274(),v,v,x,t,w)}}function m(){var h=u.formats[o];if(!h){y();return}if(h===!0)return;var _$_=_sliced_to_array(_(h),3),g=_$_[0],x=_$_[1],v=_$_[2];g===t&&e.pass(b());function y(){if(l.strictSchema===!1){u.logger.warn(w());return}throw new Error(w());function w(){return'unknown format "'.concat(o,'" ignored in schema at path "').concat(c,'"')}}function _(w){var S=_instanceof(w,RegExp)?(0,wo.regexpCode)(w):l.code.formats?(0,wo._)(_templateObject275(),l.code.formats,(0,wo.getProperty)(o)):void 0,k=r.scopeValue("formats",{key:o,ref:w,code:S});return(typeof w==="undefined"?"undefined":_type_of(w))=="object"&&!_instanceof(w,RegExp)?[w.type||"string",w.validate,(0,wo._)(_templateObject276(),k)]:["string",w,k]}function b(){if((typeof h==="undefined"?"undefined":_type_of(h))=="object"&&!_instanceof(h,RegExp)&&h.async){if(!d.$async)throw new Error("async format in sync schema");return(0,wo._)(_templateObject277(),v,n)}return typeof x=="function"?(0,wo._)(_templateObject278(),v,n):(0,wo._)(_templateObject279(),v,n)}}}};wK.default=wMt});var y9e=Be(function(SK){"use strict";Object.defineProperty(SK,"__esModule",{value:!0});var SMt=x9e(),kMt=[SMt.default];SK.default=kMt});var v9e=Be(function(q_){"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.contentVocabulary=q_.metadataVocabulary=void 0;q_.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];q_.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var b9e=Be(function(kK){"use strict";Object.defineProperty(kK,"__esModule",{value:!0});var CMt=AIe(),EMt=BIe(),TMt=g9e(),AMt=y9e(),_9e=v9e(),IMt=[CMt.default,EMt.default,(0,TMt.default)(),AMt.default,_9e.metadataVocabulary,_9e.contentVocabulary];kK.default=IMt});var S9e=Be(function(eM){"use strict";Object.defineProperty(eM,"__esModule",{value:!0});eM.DiscrError=void 0;var w9e;(function(e){e.Tag="tag",e.Mapping="mapping"})(w9e||(eM.DiscrError=w9e={}))});var C9e=Be(function(EK){"use strict";Object.defineProperty(EK,"__esModule",{value:!0});var W_=Ur(),CK=S9e(),k9e=LR(),PMt=sk(),RMt=vn(),MMt={message:function(param){var _param_params=param.params,e=_param_params.discrError,t=_param_params.tagName;return e===CK.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf')},params:function(param){var _param_params=param.params,e=_param_params.discrError,t=_param_params.tag,r=_param_params.tagName;return(0,W_._)(_templateObject280(),e,r,t)}},OMt={keyword:"discriminator",type:"object",schemaType:"object",error:MMt,code:function code(e){var t=e.gen,r=e.data,n=e.schema,i=e.parentSchema,o=e.it,a=i.oneOf;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");var s=n.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");var l=t.let("valid",!1),c=t.const("tag",(0,W_._)(_templateObject281(),r,(0,W_.getProperty)(s)));t.if((0,W_._)(_templateObject282(),c),function(){return d()},function(){return e.error(!1,{discrError:CK.DiscrError.Tag,tag:c,tagName:s})}),e.ok(l);function d(){var m=p();t.if(!1);for(var h in m)t.elseIf((0,W_._)(_templateObject283(),c,h)),t.assign(l,u(m[h]));t.else(),e.error(!1,{discrError:CK.DiscrError.Mapping,tag:c,tagName:s}),t.endIf()}function u(m){var h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:m},h);return e.mergeEvaluated(g,W_.Name),h}function p(){var m;var h={},g=v(i),x=!0;for(var b=0;b<a.length;b++){var w=a[b];if(w!=null&&w.$ref&&!(0,RMt.schemaHasRulesButRef)(w,o.self.RULES)){var k=w.$ref;if(w=k9e.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,k),_instanceof(w,k9e.SchemaEnv)&&(w=w.schema),w===void 0)throw new PMt.default(o.opts.uriResolver,o.baseId,k)}var S=(m=w==null?void 0:w.properties)===null||m===void 0?void 0:m[s];if((typeof S==="undefined"?"undefined":_type_of(S))!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(s,'"'));x=x&&(g||v(w)),y(S,b)}if(!x)throw new Error('discriminator: "'.concat(s,'" must be required'));return h;function v(param){var b=param.required;return Array.isArray(b)&&b.includes(s)}function y(b,w){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(b.const)_(b.const,w);else if(b.enum)try{for(var _iterator=b.enum[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var S=_step.value;_(S,w)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else throw new Error('discriminator: "properties/'.concat(s,'" must have "const" or "enum"'))}function _(b,w){if(typeof b!="string"||b in h)throw new Error('discriminator: "'.concat(s,'" values must be unique strings'));h[b]=w}}}};EK.default=OMt});var E9e=Be(function($Or,$Mt){$Mt.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var AK=Be(function(Ai,TK){"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.MissingRefError=Ai.ValidationError=Ai.CodeGen=Ai.Name=Ai.nil=Ai.stringify=Ai.str=Ai._=Ai.KeywordCxt=Ai.Ajv=void 0;var NMt=wIe(),DMt=b9e(),LMt=C9e(),T9e=E9e(),FMt=["/properties"],tM="http://json-schema.org/draft-07/schema",V_=/*#__PURE__*/function(_NMt_default){_inherits(V_,_NMt_default);function V_(){_class_call_check(this,V_);return _call_super(this,V_,arguments)}_create_class(V_,[{key:"_addVocabularies",value:function _addVocabularies(){var _this=this;_get(_get_prototype_of(V_.prototype),"_addVocabularies",this).call(this),DMt.default.forEach(function(t){return _this.addVocabulary(t)}),this.opts.discriminator&&this.addKeyword(LMt.default)}},{key:"_addDefaultMetaSchema",value:function _addDefaultMetaSchema(){if(_get(_get_prototype_of(V_.prototype),"_addDefaultMetaSchema",this).call(this),!this.opts.meta)return;var t=this.opts.$data?this.$dataMetaSchema(T9e,FMt):T9e;this.addMetaSchema(t,tM,!1),this.refs["http://json-schema.org/schema"]=tM}},{key:"defaultMeta",value:function defaultMeta(){return this.opts.defaultMeta=_get(_get_prototype_of(V_.prototype),"defaultMeta",this).call(this)||(this.getSchema(tM)?tM:void 0)}}]);return V_}(NMt.default);Ai.Ajv=V_;TK.exports=Ai=V_;TK.exports.Ajv=V_;Object.defineProperty(Ai,"__esModule",{value:!0});Ai.default=V_;var zMt=ak();Object.defineProperty(Ai,"KeywordCxt",{enumerable:!0,get:function get1(){return zMt.KeywordCxt}});var G_=Ur();Object.defineProperty(Ai,"_",{enumerable:!0,get:function get1(){return G_._}});Object.defineProperty(Ai,"str",{enumerable:!0,get:function get1(){return G_.str}});Object.defineProperty(Ai,"stringify",{enumerable:!0,get:function get1(){return G_.stringify}});Object.defineProperty(Ai,"nil",{enumerable:!0,get:function get1(){return G_.nil}});Object.defineProperty(Ai,"Name",{enumerable:!0,get:function get1(){return G_.Name}});Object.defineProperty(Ai,"CodeGen",{enumerable:!0,get:function get1(){return G_.CodeGen}});var jMt=NR();Object.defineProperty(Ai,"ValidationError",{enumerable:!0,get:function get1(){return jMt.default}});var UMt=sk();Object.defineProperty(Ai,"MissingRefError",{enumerable:!0,get:function get1(){return UMt.default}})});var N9e=Be(function(Ip){"use strict";var Ap=function Ap(e,t){return{validate:e,compare:t}};var BMt=function BMt(e){return e%4===0&&(e%100!==0||e%400===0)};var R9e=function R9e(e){var t=qMt.exec(e);if(!t)return!1;var r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&BMt(r)?29:WMt[n])};var MK=function MK(e,t){if(e&&t)return e>t?1:e<t?-1:0};var PK=function PK(e){return function(r){var n=IK.exec(r);if(!n)return!1;var i=+n[1],o=+n[2],a=+n[3],s=n[4],l=n[5]==="-"?-1:1,c=+(n[6]||0),d=+(n[7]||0);if(c>23||d>59||e&&!s)return!1;if(i<=23&&o<=59&&a<60)return!0;var u=o-d*l,p=i-c*l-(u<0?1:0);return(p===23||p===-1)&&(u===59||u===-1)&&a<61}};var OK=function OK(e,t){if(!(e&&t))return;var r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n};var M9e=function M9e(e,t){if(!(e&&t))return;var r=IK.exec(e),n=IK.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0};var A9e=function A9e(e){var t=PK(e);return function(n){var i=n.split(RK);return i.length===2&&R9e(i[0])&&t(i[1])}};var O9e=function O9e(e,t){if(!(e&&t))return;var r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n};var $9e=function $9e(e,t){if(!(e&&t))return;var _e_split=_sliced_to_array(e.split(RK),2),r=_e_split[0],n=_e_split[1],_t_split=_sliced_to_array(t.split(RK),2),i=_t_split[0],o=_t_split[1],a=MK(r,i);if(a!==void 0)return a||OK(n,o)};var HMt=function HMt(e){return VMt.test(e)&&GMt.test(e)};var ZMt=function ZMt(e){return I9e.lastIndex=0,I9e.test(e)};var JMt=function JMt(e){return Number.isInteger(e)&&e<=QMt&&e>=KMt};var YMt=function YMt(e){return Number.isInteger(e)};var P9e=function P9e(){return!0};var eOt=function eOt(e){if(XMt.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.formatNames=Ip.fastFormats=Ip.fullFormats=void 0;Ip.fullFormats={date:Ap(R9e,MK),time:Ap(PK(!0),OK),"date-time":Ap(A9e(!0),O9e),"iso-time":Ap(PK(),M9e),"iso-date-time":Ap(A9e(),$9e),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:HMt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:eOt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:ZMt,int32:{type:"number",validate:JMt},int64:{type:"number",validate:YMt},float:{type:"number",validate:P9e},double:{type:"number",validate:P9e},password:!0,binary:!0};Ip.fastFormats=_object_spread_props(_object_spread({},Ip.fullFormats),{date:Ap(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,MK),time:Ap(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,OK),"date-time":Ap(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,O9e),"iso-time":Ap(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,M9e),"iso-date-time":Ap(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$9e),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Ip.formatNames=Object.keys(Ip.fullFormats);var qMt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WMt=[0,31,28,31,30,31,30,31,31,30,31,30,31];var IK=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;var RK=/t|\s/i;var VMt=/\/|:/,GMt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var I9e=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;var KMt=-Math.pow(2,31),QMt=Math.pow(2,31)-1;var XMt=/[^\\]\\Z/});var D9e=Be(function(H_){"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.formatLimitDefinition=void 0;var tOt=AK(),dd=Ur(),ag=dd.operators,rM={formatMaximum:{okStr:"<=",ok:ag.LTE,fail:ag.GT},formatMinimum:{okStr:">=",ok:ag.GTE,fail:ag.LT},formatExclusiveMaximum:{okStr:"<",ok:ag.LT,fail:ag.GTE},formatExclusiveMinimum:{okStr:">",ok:ag.GT,fail:ag.LTE}},rOt={message:function(param){var e=param.keyword,t=param.schemaCode;return(0,dd.str)(_templateObject284(),rM[e].okStr,t)},params:function(param){var e=param.keyword,t=param.schemaCode;return(0,dd._)(_templateObject285(),rM[e].okStr,t)}};H_.formatLimitDefinition={keyword:Object.keys(rM),type:"string",schemaType:"string",$data:!0,error:rOt,code:function code(e){var t=e.gen,r=e.data,n=e.schemaCode,i=e.keyword,o=e.it,a=o.opts,s=o.self;if(!a.validateFormats)return;var l=new tOt.KeywordCxt(o,s.RULES.all.format.definition,"format");l.$data?c():d();function c(){var p=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),m=t.const("fmt",(0,dd._)(_templateObject286(),p,l.schemaCode));e.fail$data((0,dd.or)((0,dd._)(_templateObject287(),m),(0,dd._)(_templateObject288(),m),(0,dd._)(_templateObject289(),m),u(m)))}function d(){var p=l.schema,m=s.formats[p];if(!m||m===!0)return;if((typeof m==="undefined"?"undefined":_type_of(m))!="object"||_instanceof(m,RegExp)||typeof m.compare!="function")throw new Error('"'.concat(i,'": format "').concat(p,'" does not define "compare" function'));var h=t.scopeValue("formats",{key:p,ref:m,code:a.code.formats?(0,dd._)(_templateObject290(),a.code.formats,(0,dd.getProperty)(p)):void 0});e.fail$data(u(h))}function u(p){return(0,dd._)(_templateObject291(),p,r,n,rM[i].fail)}},dependencies:["format"]};var nOt=function(e){return e.addKeyword(H_.formatLimitDefinition),e};H_.default=nOt});var j9e=Be(function(bk,z9e){"use strict";var F9e=function F9e(e,t,r,n){var i,o;(i=(o=e.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,$K._)(_templateObject292(),n));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;e.addFormat(a,r[a])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};Object.defineProperty(bk,"__esModule",{value:!0});var Z_=N9e(),iOt=D9e(),$K=Ur(),L9e=new $K.Name("fullFormats"),oOt=new $K.Name("fastFormats"),NK=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{keywords:!0};if(Array.isArray(t))return F9e(e,t,Z_.fullFormats,L9e),e;var _ref=_sliced_to_array(t.mode==="fast"?[Z_.fastFormats,oOt]:[Z_.fullFormats,L9e],2),r=_ref[0],n=_ref[1],i=t.formats||Z_.formatNames;return F9e(e,i,r,n),t.keywords&&(0,iOt.default)(e),e};NK.get=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"full";var n=(t==="fast"?Z_.fastFormats:Z_.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};z9e.exports=bk=NK;Object.defineProperty(bk,"__esModule",{value:!0});bk.default=NK});var Z9e=Be(function(DK){"use strict";var dOt=function dOt(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!H9e.test(r))throw new TypeError("invalid type");var n=r;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object")for(var i,o=Object.keys(t).sort(),a=0;a<o.length;a++){if(i=o[a],!G9e.test(i))throw new TypeError("invalid parameter name");n+="; "+i+"="+mOt(t[i])}return n};var pOt=function pOt(e){if(!e)throw new TypeError("argument string is required");var t=(typeof e==="undefined"?"undefined":_type_of(e))=="object"?fOt(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!H9e.test(n))throw new TypeError("invalid media type");var i=new hOt(n.toLowerCase());if(r!==-1){var o,a,s;for(V9e.lastIndex=r;a=V9e.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,o=a[1].toLowerCase(),s=a[2],s.charCodeAt(0)===34&&(s=s.slice(1,-1),s.indexOf("\\")!==-1&&(s=s.replace(uOt,"$1"))),i.parameters[o]=s}if(r!==t.length)throw new TypeError("invalid parameter format")}return i};var fOt=function fOt(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):_type_of(e.headers)=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t};var mOt=function mOt(e){var t=String(e);if(G9e.test(t))return t;if(t.length>0&&!lOt.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(cOt,"\\$1")+'"'};var hOt=function hOt(e){this.parameters=Object.create(null),this.type=e};var V9e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,lOt=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,G9e=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,uOt=/\\([\u000b\u0020-\u00ff])/g,cOt=/([\\"])/g,H9e=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;DK.format=dOt;DK.parse=pOt});var e$t={};$l(e$t,{default:function(){return mM}});module.exports=NPe(e$t);var ADr=nr(eQ(),1);var X_=typeof window=="undefined"?globalThis:window,tQ,B1=(tQ=X_.process)!=null?tQ:{cwd:function cwd(){return"/"},env:{}};typeof B1.cwd!="function"&&(B1.cwd=function(){return"/"});(!B1.env||_type_of(B1.env)!="object")&&(B1.env={});X_.process=B1;if(typeof X_.queueMicrotask!="function"){var e=Promise.resolve();X_.queueMicrotask=function(t){if(typeof t!="function")throw new TypeError("queueMicrotask callback must be a function");e.then(t).catch(function(r){var n=_instanceof(r,Error)?r:new Error(String(r));X_.setTimeout(function(){throw n},0)})}}var IJ=nr(oQ(),1),PJ=require("obsidian");var LPe={2:function(e){function t(i,o,a){_instanceof(i,RegExp)&&(i=r(i,a)),_instanceof(o,RegExp)&&(o=r(o,a));var s=n(i,o,a);return s&&{start:s[0],end:s[1],pre:a.slice(0,s[0]),body:a.slice(s[0]+i.length,s[1]),post:a.slice(s[1]+o.length)}}function r(i,o){var a=o.match(i);return a?a[0]:null}function n(i,o,a){var s,l,c,d,u,p=a.indexOf(i),m=a.indexOf(o,p+1),h=p;if(p>=0&&m>0){for(s=[],c=a.length;h>=0&&!u;)h==p?(s.push(h),p=a.indexOf(i,h+1)):s.length==1?u=[s.pop(),m]:((l=s.pop())<c&&(c=l,d=m),m=a.indexOf(o,h+1)),h=p<m&&p>=0?p:m;s.length&&(u=[c,d])}return u}e.exports=t,t.range=n},101:function(e,t,r){var n;e=r.nmd(e),function(){var i=(e&&e.exports,(typeof global==="undefined"?"undefined":_type_of(global))=="object"&&global);i.global!==i&&i.window;var o=function o(d){this.message=d};(o.prototype=new Error).name="InvalidCharacterError";var a=function a(d){throw new o(d)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=/[\t\n\f\r ]/g,c={encode:function encode(d){d=String(d),/[^\0-\xFF]/.test(d)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var u,p,m,h,g=d.length%3,x="",v=-1,y=d.length-g;++v<y;)u=d.charCodeAt(v)<<16,p=d.charCodeAt(++v)<<8,m=d.charCodeAt(++v),x+=s.charAt((h=u+p+m)>>18&63)+s.charAt(h>>12&63)+s.charAt(h>>6&63)+s.charAt(63&h);return g==2?(u=d.charCodeAt(v)<<8,p=d.charCodeAt(++v),x+=s.charAt((h=u+p)>>10)+s.charAt(h>>4&63)+s.charAt(h<<2&63)+"="):g==1&&(h=d.charCodeAt(v),x+=s.charAt(h>>2)+s.charAt(h<<4&63)+"=="),x},decode:function decode(d){var u=(d=String(d).replace(l,"")).length;u%4==0&&(u=(d=d.replace(/==?$/,"")).length),(u%4==1||/[^+a-zA-Z0-9/]/.test(d))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var p,m,h=0,g="",x=-1;++x<u;)m=s.indexOf(d.charAt(x)),p=h%4?64*p+m:m,h++%4&&(g+=String.fromCharCode(255&p>>(-2*h&6)));return g},version:"1.0.0"};(n=(function(){return c}).call(t,r,t,e))===void 0||(e.exports=n)}()},172:function(e,t){t.d=function(r){if(!r)return 0;for(var n=(r=r.toString()).length,i=r.length;i--;){var o=r.charCodeAt(i);56320<=o&&o<=57343&&i--,127<o&&o<=2047?n++:2047<o&&o<=65535&&(n+=2)}return n}},526:function(e){var t={utf8:{stringToBytes:function stringToBytes(r){return t.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function bytesToString(r){return decodeURIComponent(escape(t.bin.bytesToString(r)))}},bin:{stringToBytes:function stringToBytes(r){for(var n=[],i=0;i<r.length;i++)n.push(255&r.charCodeAt(i));return n},bytesToString:function bytesToString(r){for(var n=[],i=0;i<r.length;i++)n.push(String.fromCharCode(r[i]));return n.join("")}}};e.exports=t},298:function(e){var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function rotl(n,i){return n<<i|n>>>32-i},rotr:function rotr(n,i){return n<<32-i|n>>>i},endian:function endian(n){if(n.constructor==Number)return 0xff00ff&r.rotl(n,8)|0xff00ff00&r.rotl(n,24);for(var i=0;i<n.length;i++)n[i]=r.endian(n[i]);return n},randomBytes:function randomBytes(n){for(var i=[];n>0;n--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function bytesToWords(n){for(var i=[],o=0,a=0;o<n.length;o++,a+=8)i[a>>>5]|=n[o]<<24-a%32;return i},wordsToBytes:function wordsToBytes(n){for(var i=[],o=0;o<32*n.length;o+=8)i.push(n[o>>>5]>>>24-o%32&255);return i},bytesToHex:function bytesToHex(n){for(var i=[],o=0;o<n.length;o++)i.push((n[o]>>>4).toString(16)),i.push((15&n[o]).toString(16));return i.join("")},hexToBytes:function hexToBytes(n){for(var i=[],o=0;o<n.length;o+=2)i.push(parseInt(n.substr(o,2),16));return i},bytesToBase64:function bytesToBase64(n){for(var i=[],o=0;o<n.length;o+=3)for(var a=n[o]<<16|n[o+1]<<8|n[o+2],s=0;s<4;s++)8*o+6*s<=8*n.length?i.push(t.charAt(a>>>6*(3-s)&63)):i.push("=");return i.join("")},base64ToBytes:function base64ToBytes(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],o=0,a=0;o<n.length;a=++o%4)a!=0&&i.push((t.indexOf(n.charAt(o-1))&Math.pow(2,-2*a+8)-1)<<2*a|t.indexOf(n.charAt(o))>>>6-2*a);return i}},e.exports=r},135:function(e){function t(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}e.exports=function(r){return r!=null&&(t(r)||function(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}(r)||!!r._isBuffer)}},542:function(e,t,r){(function(){var n=r(298),i=r(526).utf8,o=r(135),a=r(526).bin,s=function s10(l,c){l.constructor==String?l=c&&c.encoding==="binary"?a.stringToBytes(l):i.stringToBytes(l):o(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||l.constructor===Uint8Array||(l=l.toString());for(var d=n.bytesToWords(l),u=8*l.length,p=0x67452301,m=-0x10325477,h=-0x67452302,g=0x10325476,x=0;x<d.length;x++)d[x]=0xff00ff&(d[x]<<8|d[x]>>>24)|0xff00ff00&(d[x]<<24|d[x]>>>8);d[u>>>5]|=128<<u%32,d[14+(u+64>>>9<<4)]=u;var v=s._ff,y=s._gg,_=s._hh,b=s._ii;for(x=0;x<d.length;x+=16){var w=p,S=m,k=h,E=g;p=v(p,m,h,g,d[x+0],7,-0x28955b88),g=v(g,p,m,h,d[x+1],12,-0x173848aa),h=v(h,g,p,m,d[x+2],17,0x242070db),m=v(m,h,g,p,d[x+3],22,-0x3e423112),p=v(p,m,h,g,d[x+4],7,-0xa83f051),g=v(g,p,m,h,d[x+5],12,0x4787c62a),h=v(h,g,p,m,d[x+6],17,-0x57cfb9ed),m=v(m,h,g,p,d[x+7],22,-0x2b96aff),p=v(p,m,h,g,d[x+8],7,0x698098d8),g=v(g,p,m,h,d[x+9],12,-0x74bb0851),h=v(h,g,p,m,d[x+10],17,-42063),m=v(m,h,g,p,d[x+11],22,-0x76a32842),p=v(p,m,h,g,d[x+12],7,0x6b901122),g=v(g,p,m,h,d[x+13],12,-0x2678e6d),h=v(h,g,p,m,d[x+14],17,-0x5986bc72),p=y(p,m=v(m,h,g,p,d[x+15],22,0x49b40821),h,g,d[x+1],5,-0x9e1da9e),g=y(g,p,m,h,d[x+6],9,-0x3fbf4cc0),h=y(h,g,p,m,d[x+11],14,0x265e5a51),m=y(m,h,g,p,d[x+0],20,-0x16493856),p=y(p,m,h,g,d[x+5],5,-0x29d0efa3),g=y(g,p,m,h,d[x+10],9,0x2441453),h=y(h,g,p,m,d[x+15],14,-0x275e197f),m=y(m,h,g,p,d[x+4],20,-0x182c0438),p=y(p,m,h,g,d[x+9],5,0x21e1cde6),g=y(g,p,m,h,d[x+14],9,-0x3cc8f82a),h=y(h,g,p,m,d[x+3],14,-0xb2af279),m=y(m,h,g,p,d[x+8],20,0x455a14ed),p=y(p,m,h,g,d[x+13],5,-0x561c16fb),g=y(g,p,m,h,d[x+2],9,-0x3105c08),h=y(h,g,p,m,d[x+7],14,0x676f02d9),p=_(p,m=y(m,h,g,p,d[x+12],20,-0x72d5b376),h,g,d[x+5],4,-378558),g=_(g,p,m,h,d[x+8],11,-0x788e097f),h=_(h,g,p,m,d[x+11],16,0x6d9d6122),m=_(m,h,g,p,d[x+14],23,-0x21ac7f4),p=_(p,m,h,g,d[x+1],4,-0x5b4115bc),g=_(g,p,m,h,d[x+4],11,0x4bdecfa9),h=_(h,g,p,m,d[x+7],16,-0x944b4a0),m=_(m,h,g,p,d[x+10],23,-0x41404390),p=_(p,m,h,g,d[x+13],4,0x289b7ec6),g=_(g,p,m,h,d[x+0],11,-0x155ed806),h=_(h,g,p,m,d[x+3],16,-0x2b10cf7b),m=_(m,h,g,p,d[x+6],23,0x4881d05),p=_(p,m,h,g,d[x+9],4,-0x262b2fc7),g=_(g,p,m,h,d[x+12],11,-0x1924661b),h=_(h,g,p,m,d[x+15],16,0x1fa27cf8),p=b(p,m=_(m,h,g,p,d[x+2],23,-0x3b53a99b),h,g,d[x+0],6,-0xbd6ddbc),g=b(g,p,m,h,d[x+7],10,0x432aff97),h=b(h,g,p,m,d[x+14],15,-0x546bdc59),m=b(m,h,g,p,d[x+5],21,-0x36c5fc7),p=b(p,m,h,g,d[x+12],6,0x655b59c3),g=b(g,p,m,h,d[x+3],10,-0x70f3336e),h=b(h,g,p,m,d[x+10],15,-1051523),m=b(m,h,g,p,d[x+1],21,-0x7a7ba22f),p=b(p,m,h,g,d[x+8],6,0x6fa87e4f),g=b(g,p,m,h,d[x+15],10,-0x1d31920),h=b(h,g,p,m,d[x+6],15,-0x5cfebcec),m=b(m,h,g,p,d[x+13],21,0x4e0811a1),p=b(p,m,h,g,d[x+4],6,-0x8ac817e),g=b(g,p,m,h,d[x+11],10,-0x42c50dcb),h=b(h,g,p,m,d[x+2],15,0x2ad7d2bb),m=b(m,h,g,p,d[x+9],21,-0x14792c6f),p=p+w>>>0,m=m+S>>>0,h=h+k>>>0,g=g+E>>>0}return n.endian([p,m,h,g])};s._ff=function(l,c,d,u,p,m,h){var g=l+(c&d|~c&u)+(p>>>0)+h;return(g<<m|g>>>32-m)+c},s._gg=function(l,c,d,u,p,m,h){var g=l+(c&u|d&~u)+(p>>>0)+h;return(g<<m|g>>>32-m)+c},s._hh=function(l,c,d,u,p,m,h){var g=l+(c^d^u)+(p>>>0)+h;return(g<<m|g>>>32-m)+c},s._ii=function(l,c,d,u,p,m,h){var g=l+(d^(c|~u))+(p>>>0)+h;return(g<<m|g>>>32-m)+c},s._blocksize=16,s._digestsize=16,e.exports=function(l,c){if(l==null)throw new Error("Illegal argument "+l);var d=n.wordsToBytes(s(l,c));return c&&c.asBytes?d:c&&c.asString?a.bytesToString(d):n.bytesToHex(d)}})()},285:function(e,t,r){var n=r(2);e.exports=function(v,y){if(!v)return[];var _=(y=y||{}).max==null?1/0:y.max;return v.substr(0,2)==="{}"&&(v="\\{\\}"+v.substr(2)),x(function(b){return b.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(a).split("\\,").join(s).split("\\.").join(l)}(v),_,!0).map(d)};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(v){return parseInt(v,10)==v?parseInt(v,10):v.charCodeAt(0)}function d(v){return v.split(i).join("\\").split(o).join("{").split(a).join("}").split(s).join(",").split(l).join(".")}function u(v){if(!v)return[""];var y=[],_=n("{","}",v);if(!_)return v.split(",");var b=_.pre,w=_.body,S=_.post,k=b.split(",");k[k.length-1]+="{"+w+"}";var E=u(S);return S.length&&(k[k.length-1]+=E.shift(),k.push.apply(k,E)),y.push.apply(y,k),y}function p(v){return"{"+v+"}"}function m(v){return/^-?0\d/.test(v)}function h(v,y){return v<=y}function g(v,y){return v>=y}function x(v,y,_){var b=[],w=n("{","}",v);if(!w)return[v];var S=w.pre,k=w.post.length?x(w.post,y,!1):[""];if(/\$$/.test(w.pre))for(var E=0;E<k.length&&E<y;E++){var C=S+"{"+w.body+"}"+k[E];b.push(C)}else{var T,I,O=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),M=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),R=O||M,$=w.body.indexOf(",")>=0;if(!R&&!$)return w.post.match(/,(?!,).*\}/)?x(v=w.pre+"{"+w.body+a+w.post,y,!0):[v];if(R)T=w.body.split(/\.\./);else if((T=u(w.body)).length===1&&(T=x(T[0],y,!1).map(p)).length===1)return k.map(function(ie){return w.pre+T[0]+ie});if(R){var z=c(T[0]),D=c(T[1]),L=Math.max(T[0].length,T[1].length),ee=T.length==3?Math.max(Math.abs(c(T[2])),1):1,pe=h;D<z&&(ee*=-1,pe=g);var N=T.some(m);I=[];for(var U=z;pe(U,D);U+=ee){var G;if(M)(G=String.fromCharCode(U))==="\\"&&(G="");else if(G=String(U),N){var K=L-G.length;if(K>0){var me=new Array(K+1).join("0");G=U<0?"-"+me+G.slice(1):me+G}}I.push(G)}}else{I=[];for(var V=0;V<T.length;V++)I.push.apply(I,x(T[V],y,!1))}for(V=0;V<I.length;V++)for(E=0;E<k.length&&b.length<y;E++)C=S+I[V]+k[E],(!_||R||C)&&b.push(C)}return b}},829:function(e){function t(c){return t=typeof Symbol=="function"&&_type_of(Symbol.iterator)=="symbol"?function t(d){return typeof d==="undefined"?"undefined":_type_of(d)}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d==="undefined"?"undefined":_type_of(d)},t(c)}function r(c){var d=typeof Map=="function"?new Map:void 0;return r=function r(u){if(u===null||(p=u,Function.toString.call(p).indexOf("[native code]")===-1))return u;var p;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(d!==void 0){if(d.has(u))return d.get(u);d.set(u,m)}function m(){return n(u,arguments,o(this).constructor)}return m.prototype=Object.create(u.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),i(m,u)},r(c)}function n(c,d,u){return n=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(p){return!1}}()?Reflect.construct:function n(p,m,h){var g=[null];g.push.apply(g,m);var x=new(Function.bind.apply(p,g));return h&&i(x,h.prototype),x},n.apply(null,arguments)}function i(c,d){return i=Object.setPrototypeOf||function(u,p){return u.__proto__=p,u},i(c,d)}function o(c){return o=Object.setPrototypeOf?Object.getPrototypeOf:function o(d){return d.__proto__||Object.getPrototypeOf(d)},o(c)}var a=function(c){function d(u){var p;return function(m,h){if(!_instanceof(m,h))throw new TypeError("Cannot call a class as a function")}(this,d),(p=function(m,h){return!h||t(h)!=="object"&&typeof h!="function"?function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(m):h}(this,o(d).call(this,u))).name="ObjectPrototypeMutationError",p}return function(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),p&&i(u,p)}(d,c),d}(r(Error));function s(c,d){for(var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function u(){},p=d.split("."),m=p.length,h=function h(v){var y=p[v];if(!c)return{v:void 0};if(y==="+"){if(Array.isArray(c))return{v:c.map(function(b,w){var S=p.slice(v+1);return S.length>0?s(b,S.join("."),u):u(c,w,p,v)})};var _=p.slice(0,v).join(".");throw new Error("Object at wildcard (".concat(_,") is not an array"))}c=u(c,y,p,v)},g=0;g<m;g++){var x=h(g);if(t(x)==="object")return x.v}return c}function l(c,d){return c.length===d+1}e.exports={set:function set1(c,d,u){if(t(c)!="object"||c===null||d===void 0)return c;if(typeof d=="number")return c[d]=u,c[d];try{return s(c,d,function(p,m,h,g){if(p===Reflect.getPrototypeOf({}))throw new a("Attempting to mutate Object.prototype");if(!p[m]){var x=Number.isInteger(Number(h[g+1])),v=h[g+1]==="+";p[m]=x||v?[]:{}}return l(h,g)&&(p[m]=u),p[m]})}catch(p){if(_instanceof(p,a))throw p;return c}},get:function get1(c,d){if(t(c)!="object"||c===null||d===void 0)return c;if(typeof d=="number")return c[d];try{return s(c,d,function(u,p){return u[p]})}catch(u){return c}},has:function has(c,d){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(c)!="object"||c===null||d===void 0)return!1;if(typeof d=="number")return d in c;try{var p=!1;return s(c,d,function(m,h,g,x){if(!l(g,x))return m&&m[h];p=u.own?m.hasOwnProperty(h):h in m}),p}catch(m){return!1}},hasOwn:function hasOwn(c,d,u){return this.has(c,d,u||{own:!0})},isIn:function isIn(c,d,u){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(c)!="object"||c===null||d===void 0)return!1;try{var m=!1,h=!1;return s(c,d,function(g,x,v,y){return m=m||g===u||!!g&&g[x]===u,h=l(v,y)&&t(g)==="object"&&x in g,g&&g[x]}),p.validPath?m&&h:m}catch(g){return!1}},ObjectPrototypeMutationError:a}},47:function(e,t,r){var n=r(410),i=function i(c){return typeof c=="string"};function o(c,d){for(var u=[],p=0;p<c.length;p++){var m=c[p];m&&m!=="."&&(m===".."?u.length&&u[u.length-1]!==".."?u.pop():d&&u.push(".."):u.push(m))}return u}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s={};function l(c){return a.exec(c).slice(1)}s.resolve=function(){for(var c="",d=!1,u=arguments.length-1;u>=-1&&!d;u--){var p=u>=0?arguments[u]:process.cwd();if(!i(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(c=p+"/"+c,d=p.charAt(0)==="/")}return(d?"/":"")+(c=o(c.split("/"),!d).join("/"))||"."},s.normalize=function(c){var d=s.isAbsolute(c),u=c.substr(-1)==="/";return(c=o(c.split("/"),!d).join("/"))||d||(c="."),c&&u&&(c+="/"),(d?"/":"")+c},s.isAbsolute=function(c){return c.charAt(0)==="/"},s.join=function(){for(var c="",d=0;d<arguments.length;d++){var u=arguments[d];if(!i(u))throw new TypeError("Arguments to path.join must be strings");u&&(c+=c?"/"+u:u)}return s.normalize(c)},s.relative=function(c,d){function u(y){for(var _=0;_<y.length&&y[_]==="";_++);for(var b=y.length-1;b>=0&&y[b]==="";b--);return _>b?[]:y.slice(_,b+1)}c=s.resolve(c).substr(1),d=s.resolve(d).substr(1);for(var p=u(c.split("/")),m=u(d.split("/")),h=Math.min(p.length,m.length),g=h,x=0;x<h;x++)if(p[x]!==m[x]){g=x;break}var v=[];for(x=g;x<p.length;x++)v.push("..");return(v=v.concat(m.slice(g))).join("/")},s._makeLong=function(c){return c},s.dirname=function(c){var d=l(c),u=d[0],p=d[1];return u||p?(p&&(p=p.substr(0,p.length-1)),u+p):"."},s.basename=function(c,d){var u=l(c)[2];return d&&u.substr(-1*d.length)===d&&(u=u.substr(0,u.length-d.length)),u},s.extname=function(c){return l(c)[3]},s.format=function(c){if(!n.isObject(c))throw new TypeError("Parameter 'pathObject' must be an object, not "+(typeof c==="undefined"?"undefined":_type_of(c)));var d=c.root||"";if(!i(d))throw new TypeError("'pathObject.root' must be a string or undefined, not "+_type_of(c.root));return(c.dir?c.dir+s.sep:"")+(c.base||"")},s.parse=function(c){if(!i(c))throw new TypeError("Parameter 'pathString' must be a string, not "+(typeof c==="undefined"?"undefined":_type_of(c)));var d=l(c);if(!d||d.length!==4)throw new TypeError("Invalid path '"+c+"'");return d[1]=d[1]||"",d[2]=d[2]||"",d[3]=d[3]||"",{root:d[0],dir:d[0]+d[1].slice(0,d[1].length-1),base:d[2],ext:d[3],name:d[2].slice(0,d[2].length-d[3].length)}},s.sep="/",s.delimiter=":",e.exports=s},647:function(e,t){var r=Object.prototype.hasOwnProperty;function n(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch(a){return null}}function i(o){try{return encodeURIComponent(o)}catch(a){return null}}t.stringify=function(o,a){a=a||"";var s,l,c=[];for(l in typeof a!="string"&&(a="?"),o)if(r.call(o,l)){if((s=o[l])||s!=null&&!isNaN(s)||(s=""),l=i(l),s=i(s),l===null||s===null)continue;c.push(l+"="+s)}return c.length?a+c.join("&"):""},t.parse=function(o){for(var a,s=/([^=?#&]+)=?([^&]*)/g,l={};a=s.exec(o);){var c=n(a[1]),d=n(a[2]);c===null||d===null||c in l||(l[c]=d)}return l}},670:function(e){e.exports=function(t,r){if(r=r.split(":")[0],!(t=+t))return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:function(e,t,r){var n=r(670),i=r(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,d=/^[a-zA-Z]:/;function u(y){return(y||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(y,_){return g(_.protocol)?y.replace(/\\/g,"/"):y},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],m={hash:1,query:1};function h(y){var _,b=(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{}).location||{},w={},S=_type_of(y=y||b);if(y.protocol==="blob:")w=new v(unescape(y.pathname),{});else if(S==="string")for(_ in w=new v(y,{}),m)delete w[_];else if(S==="object"){for(_ in y)_ in m||(w[_]=y[_]);w.slashes===void 0&&(w.slashes=s.test(y.href))}return w}function g(y){return y==="file:"||y==="ftp:"||y==="http:"||y==="https:"||y==="ws:"||y==="wss:"}function x(y,_){y=(y=u(y)).replace(a,""),_=_||{};var b,w=c.exec(y),S=w[1]?w[1].toLowerCase():"",k=!!w[2],E=!!w[3],C=0;return k?E?(b=w[2]+w[3]+w[4],C=w[2].length+w[3].length):(b=w[2]+w[4],C=w[2].length):E?(b=w[3]+w[4],C=w[3].length):b=w[4],S==="file:"?C>=2&&(b=b.slice(2)):g(S)?b=w[4]:S?k&&(b=b.slice(2)):C>=2&&g(_.protocol)&&(b=w[4]),{protocol:S,slashes:k||g(S),slashesCount:C,rest:b}}function v(y,_,b){if(y=(y=u(y)).replace(a,""),!_instanceof(this,v))return new v(y,_,b);var w,S,k,E,C,T,I=p.slice(),O=typeof _==="undefined"?"undefined":_type_of(_),M=this,R=0;for(O!=="object"&&O!=="string"&&(b=_,_=null),b&&typeof b!="function"&&(b=i.parse),w=!(S=x(y||"",_=h(_))).protocol&&!S.slashes,M.slashes=S.slashes||w&&_.slashes,M.protocol=S.protocol||_.protocol||"",y=S.rest,(S.protocol==="file:"&&(S.slashesCount!==2||d.test(y))||!S.slashes&&(S.protocol||S.slashesCount<2||!g(M.protocol)))&&(I[3]=[/(.*)/,"pathname"]);R<I.length;R++)typeof(E=I[R])!="function"?(k=E[0],T=E[1],k!=k?M[T]=y:typeof k=="string"?~(C=k==="@"?y.lastIndexOf(k):y.indexOf(k))&&(typeof E[2]=="number"?(M[T]=y.slice(0,C),y=y.slice(C+E[2])):(M[T]=y.slice(C),y=y.slice(0,C))):(C=k.exec(y))&&(M[T]=C[1],y=y.slice(0,C.index)),M[T]=M[T]||w&&E[3]&&_[T]||"",E[4]&&(M[T]=M[T].toLowerCase())):y=E(y,M);b&&(M.query=b(M.query)),w&&_.slashes&&M.pathname.charAt(0)!=="/"&&(M.pathname!==""||_.pathname!=="")&&(M.pathname=function($,z){if($==="")return z;for(var D=(z||"/").split("/").slice(0,-1).concat($.split("/")),L=D.length,ee=D[L-1],pe=!1,N=0;L--;)D[L]==="."?D.splice(L,1):D[L]===".."?(D.splice(L,1),N++):N&&(L===0&&(pe=!0),D.splice(L,1),N--);return pe&&D.unshift(""),ee!=="."&&ee!==".."||D.push(""),D.join("/")}(M.pathname,_.pathname)),M.pathname.charAt(0)!=="/"&&g(M.protocol)&&(M.pathname="/"+M.pathname),n(M.port,M.protocol)||(M.host=M.hostname,M.port=""),M.username=M.password="",M.auth&&(~(C=M.auth.indexOf(":"))?(M.username=M.auth.slice(0,C),M.username=encodeURIComponent(decodeURIComponent(M.username)),M.password=M.auth.slice(C+1),M.password=encodeURIComponent(decodeURIComponent(M.password))):M.username=encodeURIComponent(decodeURIComponent(M.auth)),M.auth=M.password?M.username+":"+M.password:M.username),M.origin=M.protocol!=="file:"&&g(M.protocol)&&M.host?M.protocol+"//"+M.host:"null",M.href=M.toString()}v.prototype={set:function set1(y,_,b){var w=this;switch(y){case"query":typeof _=="string"&&_.length&&(_=(b||i.parse)(_)),w[y]=_;break;case"port":w[y]=_,n(_,w.protocol)?_&&(w.host=w.hostname+":"+_):(w.host=w.hostname,w[y]="");break;case"hostname":w[y]=_,w.port&&(_+=":"+w.port),w.host=_;break;case"host":w[y]=_,l.test(_)?(_=_.split(":"),w.port=_.pop(),w.hostname=_.join(":")):(w.hostname=_,w.port="");break;case"protocol":w.protocol=_.toLowerCase(),w.slashes=!b;break;case"pathname":case"hash":if(_){var S=y==="pathname"?"/":"#";w[y]=_.charAt(0)!==S?S+_:_}else w[y]=_;break;case"username":case"password":w[y]=encodeURIComponent(_);break;case"auth":var k=_.indexOf(":");~k?(w.username=_.slice(0,k),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=_.slice(k+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(_))}for(var E=0;E<p.length;E++){var C=p[E];C[4]&&(w[C[1]]=w[C[1]].toLowerCase())}return w.auth=w.password?w.username+":"+w.password:w.username,w.origin=w.protocol!=="file:"&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString(),w},toString:function toString(y){y&&typeof y=="function"||(y=i.stringify);var _,b=this,w=b.host,S=b.protocol;S&&S.charAt(S.length-1)!==":"&&(S+=":");var k=S+(b.protocol&&b.slashes||g(b.protocol)?"//":"");return b.username?(k+=b.username,b.password&&(k+=":"+b.password),k+="@"):b.password?(k+=":"+b.password,k+="@"):b.protocol!=="file:"&&g(b.protocol)&&!w&&b.pathname!=="/"&&(k+="@"),(w[w.length-1]===":"||l.test(b.hostname)&&!b.port)&&(w+=":"),k+=w+b.pathname,(_=_type_of(b.query)=="object"?y(b.query):b.query)&&(k+=_.charAt(0)!=="?"?"?"+_:_),b.hash&&(k+=b.hash),k}},v.extractProtocol=x,v.location=h,v.trimLeft=u,v.qs=i,e.exports=v},410:function(){},388:function(){},805:function(){},345:function(){},800:function(){}},aQ={};function wi(e){var t=aQ[e];if(t!==void 0)return t.exports;var r=aQ[e]={id:e,loaded:!1,exports:{}};return LPe[e].call(r.exports,r,r.exports,wi),r.loaded=!0,r.exports}wi.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return wi.d(t,{a:t}),t},wi.d=function(e,t){for(var r in t)wi.o(t,r)&&!wi.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},wi.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},wi.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var FPe=wi(737),zPe=wi.n(FPe);function vM(e){if(!RM(e))throw new Error("Parameter was not an error")}function RM(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||_instanceof(e,Error);var t}var Aa=/*#__PURE__*/function(Error1){"use strict";_inherits(Aa1,Error1);function Aa1(t,r){_class_call_check(this,Aa1);var _this;var n=Array.prototype.slice.call(arguments),_ref=function(s){var l,c="";if(s.length===0)l={};else if(RM(s[0]))l={cause:s[0]},c=s.slice(1).join(" ")||"";else if(s[0]&&_type_of(s[0])=="object")l=Object.assign({},s[0]),c=s.slice(1).join(" ")||"";else{if(typeof s[0]!="string")throw new Error("Invalid arguments passed to Layerr");l={},c=c=s.join(" ")||""}return{options:l,shortMessage:c}}(n),i=_ref.options,o=_ref.shortMessage,a=o;if(i.cause&&(a="".concat(a,": ").concat(i.cause.message)),_this=_call_super(this,Aa1,[a]),_this.message=a,i.name&&typeof i.name=="string"?_this.name=i.name:_this.name="Layerr",i.cause&&Object.defineProperty(_this,"_cause",{value:i.cause}),Object.defineProperty(_this,"_info",{value:{}}),i.info&&_type_of(i.info)=="object"&&Object.assign(_this._info,i.info),Error.captureStackTrace){var s=i.constructorOpt||_this.constructor;Error.captureStackTrace(_this,s)}return _this}_create_class(Aa1,[{key:"toString",value:function toString(){var t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t="".concat(t,": ").concat(this.message)),t}}],[{key:"cause",value:function cause(t){return vM(t),t._cause&&RM(t._cause)?t._cause:null}},{key:"fullStack",value:function fullStack(t){var n;vM(t);var r=Aa.cause(t);return r?"".concat(t.stack,"\ncaused by: ").concat(Aa.fullStack(r)):(n=t.stack)!=null?n:""}},{key:"info",value:function info(t){vM(t);var r={},n=Aa.cause(t);return n&&Object.assign(r,Aa.info(n)),t._info&&Object.assign(r,t._info),r}}]);return Aa1}(_wrap_native_super(Error)),jPe=wi(47),Xk=wi.n(jPe),sQ="__PATH_SEPARATOR_POSIX__",lQ="__PATH_SEPARATOR_WINDOWS__";function zi(e){try{var _$t=e.replace(/\//g,sQ).replace(/\\\\/g,lQ);return encodeURIComponent(_$t).split(lQ).join("\\\\").split(sQ).join("/")}catch(t){throw new Aa(t,"Failed encoding path")}}function uQ(e){return e.startsWith("/")?e:"/"+e}function ab(e){var t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function UPe(e){var t=new(zPe())(e).pathname;return t.length<=0&&(t="/"),ab(t)}function ji(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){return function(n){var i=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var o=n.shift();n[0]=o+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var a=0;a<n.length;a++){var s=n[a];if(typeof s!="string")throw new TypeError("Url must be a string. Received "+s);s!==""&&(a>0&&(s=s.replace(/^[\/]+/,"")),s=a<n.length-1?s.replace(/[\/]+$/,""):s.replace(/[\/]+$/,"/"),i.push(s))}var l=i.join("/"),c=(l=l.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return c.shift()+(c.length>0?"?":"")+c.join("&")}(_type_of(arguments[0])=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce(function(n,i,o){return(o===0||i!=="/"||i==="/"&&n[n.length-1]!=="/")&&n.push(i),n},[]))}var BPe=wi(542),eb=wi.n(BPe);function cQ(e,t){var r=e.url.replace("//",""),n=r.indexOf("/")==-1?"/":r.slice(r.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",a="00000000".concat(t.nc).slice(-8),s=function(p,m,h,g,x,v,y){var _=y||eb()("".concat(m,":").concat(h,":").concat(g));return p&&p.toLowerCase()==="md5-sess"?eb()("".concat(_,":").concat(x,":").concat(v)):_}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=eb()("".concat(i,":").concat(n)),c=o?eb()("".concat(s,":").concat(t.nonce,":").concat(a,":").concat(t.cnonce,":").concat(o,":").concat(l)):eb()("".concat(s,":").concat(t.nonce,":").concat(l)),d={username:t.username,realm:t.realm,nonce:t.nonce,uri:n,qop:o,response:c,nc:a,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},u=[];for(var p in d)d[p]&&(p==="qop"||p==="nc"||p==="algorithm"?u.push("".concat(p,"=").concat(d[p])):u.push("".concat(p,'="').concat(d[p],'"')));return"Digest ".concat(u.join(", "))}function NQ(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var qPe=wi(101),DQ=wi.n(qPe);function dQ(e){return DQ().decode(e)}function pQ(e,t){var r;return"Basic ".concat((r="".concat(e,":").concat(t),DQ().encode(r)))}var sb=typeof WorkerGlobalScope!="undefined"&&_instanceof(self,WorkerGlobalScope)?self:typeof window!="undefined"?window:globalThis,WPe=sb.fetch.bind(sb),o$t=(sb.Headers,sb.Request),a$t=sb.Response,Vs=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),om=function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e}({});function LQ(e,t,r,n,i){switch(e.authType){case Vs.Auto:t&&r&&(e.headers.Authorization=pQ(t,r));break;case Vs.Digest:e.digest=function(a,s,l){return{username:a,password:s,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,r,i);break;case Vs.None:break;case Vs.Password:e.headers.Authorization=pQ(t,r);break;case Vs.Token:e.headers.Authorization="".concat((o=n).token_type," ").concat(o.access_token);break;default:throw new Aa({info:{code:om.InvalidAuthType}},"Invalid auth type: ".concat(e.authType))}var o}wi(345),wi(800);var fQ="@@HOTPATCHER",VPe=function(){};function _M(e){return{original:e,methods:[e],final:!1}}var MM=/*#__PURE__*/function(){"use strict";function MM1(){_class_call_check(this,MM1);this._configuration={registry:{},getEmptyAction:"null"},this.__type__=fQ}_create_class(MM1,[{key:"configuration",get:function get1(){return this._configuration}},{key:"getEmptyAction",get:function get1(){return this.configuration.getEmptyAction},set:function set1(t){this.configuration.getEmptyAction=t}},{key:"control",value:function control(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==fQ)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(function(n){_this.configuration.registry.hasOwnProperty(n)?r&&(_this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):_this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])}),t._configuration=this.configuration,this}},{key:"execute",value:function execute(t){var r=this.get(t)||VPe;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return r.apply(void 0,_to_consumable_array(i))}},{key:"get",value:function get1(t){var r=this.configuration.registry[t];if(!r)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error("Failed handling method request: No method provided for override: ".concat(t));default:throw new Error("Failed handling request which resulted in an empty method: Invalid empty-action specified: ".concat(this.getEmptyAction))}return(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];if(i.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=s,d=this;for(;i.length>0;)c=[i.shift().apply(d,c)];return c[0]}}).apply(this,_to_consumable_array(r.methods))}},{key:"isPatched",value:function isPatched(t){return!!this.configuration.registry[t]}},{key:"patch",value:function patch(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},tmp=n.chain,i=tmp===void 0?!1:tmp;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error("Failed patching '".concat(t,"': Method marked as being final"));if(typeof r!="function")throw new Error("Failed patching '".concat(t,"': Provided method is not a function"));if(i)this.configuration.registry[t]?this.configuration.registry[t].methods.push(r):this.configuration.registry[t]=_M(r);else if(this.isPatched(t)){var _this_configuration_registry_t=this.configuration.registry[t],o=_this_configuration_registry_t.original;this.configuration.registry[t]=Object.assign(_M(r),{original:o})}else this.configuration.registry[t]=_M(r);return this}},{key:"patchInline",value:function patchInline(t,r){this.isPatched(t)||this.patch(t,r);for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return this.execute.apply(this,[t].concat(_to_consumable_array(i)))}},{key:"plugin",value:function plugin(t){var _this=this;for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.forEach(function(o){_this.patch(t,o,{chain:!0})}),this}},{key:"restore",value:function restore(t){if(!this.isPatched(t))throw new Error("Failed restoring method: No method present for key: ".concat(t));if(typeof this.configuration.registry[t].original!="function")throw new Error("Failed restoring method: Original method not found or of invalid type for key: ".concat(t));return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}},{key:"setFinal",value:function setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error("Failed marking '".concat(t,"' as final: No method found for key"));return this.configuration.registry[t].final=!0,this}}]);return MM1}(),bM=null;function KM(){return bM||(bM=new MM),bM}function e7(e){return function(t){if((typeof t==="undefined"?"undefined":_type_of(t))!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;var r=t;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function mQ(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=null,i=_to_consumable_array(t);for(;i.length>0;){var o=i.shift();n=n?FQ(n,o):e7(o)}return n}function FQ(e,t){var r=e7(e);return Object.keys(t).forEach(function(n){r.hasOwnProperty(n)?Array.isArray(t[n])?r[n]=Array.isArray(r[n])?_to_consumable_array(r[n]).concat(_to_consumable_array(t[n])):_to_consumable_array(t[n]):_type_of(t[n])=="object"&&t[n]?r[n]=_type_of(r[n])=="object"&&r[n]?FQ(r[n],t[n]):e7(t[n]):r[n]=t[n]:r[n]=t[n]}),r}function GPe(e){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t[r]=e.get(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function OM(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length===0)return{};var n={};return t.reduce(function(i,o){return Object.keys(o).forEach(function(a){var s=a.toLowerCase();n.hasOwnProperty(s)?i[n[s]]=o[a]:(n[s]=a,i[a]=o[a])}),i},{})}wi(805);var HPe=typeof ArrayBuffer=="function",_Object_prototype=Object.prototype,ZPe=_Object_prototype.toString;function zQ(e){return HPe&&(_instanceof(e,ArrayBuffer)||ZPe.call(e)==="[object ArrayBuffer]")}function jQ(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function QM(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function $M(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var UQ=QM(function(e){var t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=mQ(e,{headers:{Authorization:cQ(e,t)}})),$M(t7(e),function(r){var n=!1;return i=function i(a){return n?a:r},(o=function(){if(r.status==401)return t.hasDigestAuth=function(a,s){if(!NQ(a))return!1;var l=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){var c=a.headers&&a.headers.get("www-authenticate")||"",d=l.exec(c);if(!d)break;s[d[1]]=d[2]||d[3]}return s.nc+=1,s.cnonce=function(){var c="";for(var d=0;d<32;++d)c="".concat(c).concat("abcdef0123456789"[Math.floor(16*Math.random())]);return c}(),!0}(r,t),function(){if(t.hasDigestAuth)return $M(t7(e=mQ(e,{headers:{Authorization:cQ(e,t)}})),function(a){return a.status==401?t.hasDigestAuth=!1:t.nc++,n=!0,a})}();t.nc++}())&&o.then?o.then(i):i(o);var i,o})}),KPe=QM(function(e,t){return $M(t7(e),function(r){return r.ok?(t.authType=Vs.Password,r):r.status==401&&NQ(r)?(t.authType=Vs.Digest,LQ(t,t.username,t.password,void 0,void 0),e._digest=t.digest,UQ(e)):r})}),Go=QM(function(e,t){return t.authType===Vs.Auto?KPe(e,t):e._digest?UQ(e):t7(e)});function Ho(e,t,r){var n=e7(e);return n.headers=OM(t.headers,n.headers||{},r.headers||{}),r.data!==void 0&&(n.data=r.data),r.signal&&(n.signal=r.signal),t.httpAgent&&(n.httpAgent=t.httpAgent),t.httpsAgent&&(n.httpsAgent=t.httpsAgent),t.digest&&(n._digest=t.digest),typeof t.withCredentials=="boolean"&&(n.withCredentials=t.withCredentials),n}function t7(e){var t=KM();return t.patchInline("request",function(r){return t.patchInline("fetch",WPe,r.url,function(n){var i={},o={method:n.method};if(n.headers&&(i=OM(i,n.headers)),n.data!==void 0){var _ref=_sliced_to_array(function(l){if(typeof l=="string")return[l,{}];if(jQ(l))return[l,{}];if(zQ(l))return[l,{}];if(l&&(typeof l==="undefined"?"undefined":_type_of(l))=="object")return[JSON.stringify(l),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+(typeof l==="undefined"?"undefined":_type_of(l)))}(n.data),2),a=_ref[0],s=_ref[1];o.body=a,i=OM(i,s)}return n.signal&&(o.signal=n.signal),n.withCredentials&&(o.credentials="include"),o.headers=i,o}(r))},e)}var QPe=wi(285),r7=function(e){if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},JPe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},tb=function(e){return e.replace(/[[\]\\-]/g,"\\$&")},hQ=function(e){return e.join("")},YPe=function(e,t){var r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");var n=[],i=[],o=r+1,a=!1,s=!1,l=!1,c=!1,d=r,u="";e:for(;o<e.length;){var g=e.charAt(o);if(g!=="!"&&g!=="^"||o!==r+1){if(g==="]"&&a&&!l){d=o+1;break}if(a=!0,g!=="\\"||l){if(g==="["&&!l){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(JPe)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),x=_step_value[0],_step_value_=_sliced_to_array(_step_value[1],3),v=_step_value_[0],y=_step_value_[1],_=_step_value_[2];if(e.startsWith(x,o)){if(u)return["$.",!1,e.length-r,!0];o+=x.length,_?i.push(v):n.push(v),s=s||y;continue e}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}l=!1,u?(g>u?n.push(tb(u)+"-"+tb(g)):g===u&&n.push(tb(g)),u="",o++):e.startsWith("-]",o+1)?(n.push(tb(g+"-")),o+=2):e.startsWith("-",o+1)?(u=g,o+=2):(n.push(tb(g)),o++)}else l=!0,o++}else c=!0,o++}if(d<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c)return[(p=n[0].length===2?n[0].slice(-1):n[0],p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,d-r,!1];var p;var m="["+(c?"^":"")+hQ(n)+"]",h="["+(c?"":"^")+hQ(i)+"]";return[n.length&&i.length?"("+m+"|"+h+")":n.length?m:h,s,d-r,!0]},ib=function ib1(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.windowsPathsNoEscape,t=tmp===void 0?!1:tmp;return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Ws,XPe=new Set(["!","?","+","*","@"]),NM=function(e){return XPe.has(e)},gQ=function(e){return NM(e.type)},eRe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),tRe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rRe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),xQ=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),wM="(?!\\.)",nRe=new Set(["[","."]),iRe=new Set(["..","."]),oRe=new Set("().*{}+?[]^$\\!"),JM="[^/]",yQ=JM+"*?",vQ=JM+"+?",Vo,pa,Op,Ir,Qi,rm,mg,nm,xd,yd,Z1,a7,BQ,K1,Qk,s7,qQ,ub,DM,Q1,Jk,l7,WQ,cb,LM,u7,VQ,c7,GQ,d7,HQ,J1,Yk,db,FM,p7,ZQ,fg=/*#__PURE__*/function(){"use strict";function fg1(t,r){_class_call_check(this,fg1);Ht(this,a7);Ht(this,s7);Ht(this,ub);Ht(this,Q1);Ht(this,l7);Ht(this,cb);Ht(this,u7);Ht(this,c7);Ht(this,d7);Ht(this,J1);Ht(this,db);A(this,"type");Ht(this,Vo,void 0);Ht(this,pa,void 0);Ht(this,Op,!1);Ht(this,Ir,[]);Ht(this,Qi,void 0);Ht(this,rm,void 0);Ht(this,mg,void 0);Ht(this,nm,!1);Ht(this,xd,void 0);Ht(this,yd,void 0);Ht(this,Z1,!1);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&Zt(this,pa,!0),Zt(this,Qi,r),Zt(this,Vo,fe(this,Qi)?fe(fe(this,Qi),Vo):this),Zt(this,xd,fe(this,Vo)===this?n:fe(fe(this,Vo),xd)),Zt(this,mg,fe(this,Vo)===this?[]:fe(fe(this,Vo),mg)),t!=="!"||fe(fe(this,Vo),nm)||fe(this,mg).push(this),Zt(this,rm,fe(this,Qi)?fe(fe(this,Qi),Ir).length:0)}_create_class(fg1,[{key:"hasMagic",get:function get1(){if(fe(this,pa)!==void 0)return fe(this,pa);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(typeof t!="string"&&(t.type||t.hasMagic))return Zt(this,pa,!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return fe(this,pa)}},{key:"toString",value:function toString(){return fe(this,yd)!==void 0?fe(this,yd):this.type?Zt(this,yd,this.type+"("+fe(this,Ir).map(function(t){return String(t)}).join("|")+")"):Zt(this,yd,fe(this,Ir).map(function(t){return String(t)}).join(""))}},{key:"push",value:function push(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i!==""){if(typeof i!="string"&&!(_instanceof(i,Ws)&&fe(i,Qi)===this))throw new Error("invalid part: "+i);fe(this,Ir).push(i)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"toJSON",value:function toJSON(){var r;var t=this.type===null?fe(this,Ir).slice().map(function(n){return typeof n=="string"?n:n.toJSON()}):[this.type].concat(_to_consumable_array(fe(this,Ir).map(function(n){return n.toJSON()})));return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===fe(this,Vo)||fe(fe(this,Vo),nm)&&((r=fe(this,Qi))==null?void 0:r.type)==="!")&&t.push({}),t}},{key:"isStart",value:function isStart(){var r;if(fe(this,Vo)===this)return!0;if(!((r=fe(this,Qi))!=null&&r.isStart()))return!1;if(fe(this,rm)===0)return!0;var t=fe(this,Qi);for(var n=0;n<fe(this,rm);n++){var i=fe(t,Ir)[n];if(!(_instanceof(i,Ws)&&i.type==="!"))return!1}return!0}},{key:"isEnd",value:function isEnd(){var r,n,i;if(fe(this,Vo)===this||((r=fe(this,Qi))==null?void 0:r.type)==="!")return!0;if(!((n=fe(this,Qi))!=null&&n.isEnd()))return!1;if(!this.type)return(i=fe(this,Qi))==null?void 0:i.isEnd();var t=fe(this,Qi)?fe(fe(this,Qi),Ir).length:0;return fe(this,rm)===t-1}},{key:"copyIn",value:function copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}},{key:"clone",value:function clone(t){var r=new Ws(this.type,t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;r.copyIn(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}},{key:"toMMPattern",value:function toMMPattern(){if(this!==fe(this,Vo))return fe(this,Vo).toMMPattern();var t=this.toString(),_this_toRegExpSource=_sliced_to_array(this.toRegExpSource(),4),r=_this_toRegExpSource[0],n=_this_toRegExpSource[1],i=_this_toRegExpSource[2],o=_this_toRegExpSource[3];if(!(i||fe(this,pa)||fe(this,xd).nocase&&!fe(this,xd).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;var a=(fe(this,xd).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp("^".concat(r,"$"),a),{_src:r,_glob:t})}},{key:"options",get:function get1(){return fe(this,xd)}},{key:"toRegExpSource",value:function toRegExpSource(t){var _this=this;var l;var r=t!=null?t:!!fe(this,xd).dot;if(fe(this,Vo)===this&&(Nt(this,J1,Yk).call(this),Nt(this,a7,BQ).call(this)),!gQ(this)){var c=this.isStart()&&this.isEnd(),d=fe(this,Ir).map(function(m){var y;var _ref=_sliced_to_array(typeof m=="string"?Nt(y=Ws,p7,ZQ).call(y,m,fe(_this,pa),c):m.toRegExpSource(t),4),h=_ref[0],g=_ref[1],x=_ref[2],v=_ref[3];return Zt(_this,pa,fe(_this,pa)||x),Zt(_this,Op,fe(_this,Op)||v),h}).join(""),u="";if(this.isStart()&&typeof fe(this,Ir)[0]=="string"&&(fe(this,Ir).length!==1||!iRe.has(fe(this,Ir)[0]))){var m=nRe,h=r&&m.has(d.charAt(0))||d.startsWith("\\.")&&m.has(d.charAt(2))||d.startsWith("\\.\\.")&&m.has(d.charAt(4)),g=!r&&!t&&m.has(d.charAt(0));u=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?wM:""}var p="";return this.isEnd()&&fe(fe(this,Vo),nm)&&((l=fe(this,Qi))==null?void 0:l.type)==="!"&&(p="(?:$|\\/)"),[u+d+p,ib(d),Zt(this,pa,!!fe(this,pa)),fe(this,Op)]}var n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=Nt(this,db,FM).call(this,r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){var c10=this.toString(),d10=this;return Zt(d10,Ir,[c10]),d10.type=null,Zt(d10,pa,void 0),[c10,ib(this.toString()),!1,!1]}var a=!n||t||r?"":Nt(this,db,FM).call(this,!0);a===o&&(a=""),a&&(o="(?:".concat(o,")(?:").concat(a,")*?"));var s="";return s=this.type==="!"&&fe(this,Z1)?(this.isStart()&&!r?wM:"")+vQ:i+o+(this.type==="!"?"))"+(!this.isStart()||r||t?"":wM)+yQ+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":")".concat(this.type)),[s,ib(o),Zt(this,pa,!!fe(this,pa)),fe(this,Op)]}}],[{key:"fromGlob",value:function fromGlob(t){var i;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new Ws(null,void 0,r);return Nt(i=Ws,K1,Qk).call(i,t,n,0,r,0),n}}]);return fg1}();Vo=new WeakMap,pa=new WeakMap,Op=new WeakMap,Ir=new WeakMap,Qi=new WeakMap,rm=new WeakMap,mg=new WeakMap,nm=new WeakMap,xd=new WeakMap,yd=new WeakMap,Z1=new WeakMap,a7=new WeakSet,BQ=function BQ1(){if(this!==fe(this,Vo))throw new Error("should only call on root");if(fe(this,nm))return this;var t;for(this.toString(),Zt(this,nm,!0);t=fe(this,mg).pop();){if(t.type!=="!")continue;var r=t,n=fe(r,Qi);for(;n;){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;for(var i=fe(r,rm)+1;!n.type&&i<fe(n,Ir).length;i++)try{for(var _iterator=fe(t,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(fe(n,Ir)[i])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r=n,n=fe(r,Qi)}}return this},K1=new WeakSet,Qk=function(t,r,n,i,o){var g,x,v,y,_;var a=(g=i.maxExtglobRecursion)!=null?g:2,s=!1,l=!1,c=-1,d=!1;if(r.type===null){var b=n,w="";for(;b<t.length;){var S=t.charAt(b++);if(s||S==="\\")s=!s,w+=S;else if(l)b===c+1?S!=="^"&&S!=="!"||(d=!0):S!=="]"||b===c+2&&d||(l=!1),w+=S;else if(S!=="[")if(!i.noext&&NM(S)&&t.charAt(b)==="("&&o<=a){r.push(w),w="";var k=new Ws(S,r);b=Nt(x=Ws,K1,Qk).call(x,t,k,b,i,o+1),r.push(k)}else w+=S;else l=!0,c=b,d=!1,w+=S}return r.push(w),b}var u=n+1,p=new Ws(null,r),m=[],h="";for(;u<t.length;){var b10=t.charAt(u++);if(s||b10==="\\")s=!s,h+=b10;else if(l)u===c+1?b10!=="^"&&b10!=="!"||(d=!0):b10!=="]"||u===c+2&&d||(l=!1),h+=b10;else if(b10!=="[")if(NM(b10)&&t.charAt(u)==="("&&(o<=a||r&&Nt(v=r,Q1,Jk).call(v,b10))){var w10=r&&Nt(y=r,Q1,Jk).call(y,b10)?0:1;p.push(h),h="";var S10=new Ws(b10,p);p.push(S10),u=Nt(_=Ws,K1,Qk).call(_,t,S10,u,i,o+w10)}else if(b10!=="|"){var _r1;if(b10===")")return h===""&&fe(r,Ir).length===0&&Zt(r,Z1,!0),p.push(h),h="",(_r1=r).push.apply(_r1,_to_consumable_array(m).concat([p])),u;h+=b10}else p.push(h),h="",m.push(p),p=new Ws(null,r);else l=!0,c=u,d=!1,h+=b10}return r.type=null,Zt(r,pa,void 0),Zt(r,Ir,[t.substring(n-1)]),u},s7=new WeakSet,qQ=function qQ1(t){return Nt(this,ub,DM).call(this,t,tRe)},ub=new WeakSet,DM=function DM1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eRe;if(!t||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||t.type!==null||fe(t,Ir).length!==1||this.type===null)return!1;var n=fe(t,Ir)[0];return!(!n||(typeof n==="undefined"?"undefined":_type_of(n))!="object"||n.type===null)&&Nt(this,Q1,Jk).call(this,n.type,r)},Q1=new WeakSet,Jk=function Jk1(t){var n;return!!((n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:rRe).get(this.type))!=null&&n.includes(t))},l7=new WeakSet,WQ=function WQ1(t,r){var n=fe(t,Ir)[0],i=new Ws(null,n,this.options);fe(i,Ir).push(""),n.push(i),Nt(this,cb,LM).call(this,t,r)},cb=new WeakSet,LM=function LM1(t,r){var _fe1;var n=fe(t,Ir)[0];(_fe1=fe(this,Ir)).splice.apply(_fe1,[r,1].concat(_to_consumable_array(fe(n,Ir))));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(n,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;(typeof i==="undefined"?"undefined":_type_of(i))=="object"&&Zt(i,Qi,this)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}Zt(this,yd,void 0)},u7=new WeakSet,VQ=function VQ1(t){var r=xQ.get(this.type);return!!(r!=null&&r.has(t))},c7=new WeakSet,GQ=function GQ1(t){if(!t||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||t.type!==null||fe(t,Ir).length!==1||this.type===null||fe(this,Ir).length!==1)return!1;var r=fe(t,Ir)[0];return!(!r||(typeof r==="undefined"?"undefined":_type_of(r))!="object"||r.type===null)&&Nt(this,u7,VQ).call(this,r.type)},d7=new WeakSet,HQ=function HQ1(t){var r=xQ.get(this.type),n=fe(t,Ir)[0],i=r==null?void 0:r.get(n.type);if(!i)return!1;Zt(this,Ir,fe(n,Ir));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&Zt(o,Qi,this)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.type=i,Zt(this,yd,void 0),Zt(this,Z1,!1)},J1=new WeakSet,Yk=function(){var t,r;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(gQ(this)){var n=0,i=!1;do{i=!0;for(var o=0;o<fe(this,Ir).length;o++){var a=fe(this,Ir)[o];(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&(Nt(t=a,J1,Yk).call(t),Nt(this,ub,DM).call(this,a)?(i=!1,Nt(this,cb,LM).call(this,a,o)):Nt(this,s7,qQ).call(this,a)?(i=!1,Nt(this,l7,WQ).call(this,a,o)):Nt(this,c7,GQ).call(this,a)&&(i=!1,Nt(this,d7,HQ).call(this,a)))}}while(!i&&++n<10)}else try{for(var _iterator=fe(this,Ir)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n10=_step.value;(typeof n10==="undefined"?"undefined":_type_of(n10))=="object"&&Nt(r=n10,J1,Yk).call(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}Zt(this,yd,void 0)},db=new WeakSet,FM=function FM1(t){var _this=this;return fe(this,Ir).map(function(r){if(typeof r=="string")throw new Error("string type in extglob ast??");var _r_toRegExpSource=_sliced_to_array(r.toRegExpSource(t),4),n=_r_toRegExpSource[0],i=_r_toRegExpSource[1],o=_r_toRegExpSource[2],a=_r_toRegExpSource[3];return Zt(_this,Op,fe(_this,Op)||a),n}).filter(function(r){return!(_this.isStart()&&_this.isEnd()&&!r)}).join("|")},p7=new WeakSet,ZQ=function ZQ1(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1,o="",a=!1,s=!1;for(var l=0;l<t.length;l++){var c=t.charAt(l);if(i)i=!1,o+=(oRe.has(c)?"\\":"")+c,s=!1;else if(c!=="\\"){if(c==="["){var _YPe=_sliced_to_array(YPe(t,l),4),d=_YPe[0],u=_YPe[1],p=_YPe[2],m=_YPe[3];if(p){o+=d,a=a||u,l+=p-1,r=r||m,s=!1;continue}}if(c!=="*")s=!1,c!=="?"?o+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=JM,r=!0);else{if(s)continue;s=!0,o+=n&&/^[*]+$/.test(t)?vQ:yQ,r=!0}}else l===t.length-1?o+="\\\\":i=!0}return[o,ib(t),!!r,a]},Ht(fg,K1),Ht(fg,p7);Ws=fg;var Za=function Za1(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return r7(t),!(!r.nocomment&&t.charAt(0)==="#")&&new Y1(t,r).match(e)},aRe=/^\*+([^+@!?\*\[\(]*)$/,sRe=function(e){return function(t){return!t.startsWith(".")&&t.endsWith(e)}},lRe=function(e){return function(t){return t.endsWith(e)}},uRe=function(e){return e=e.toLowerCase(),function(t){return!t.startsWith(".")&&t.toLowerCase().endsWith(e)}},cRe=function(e){return e=e.toLowerCase(),function(t){return t.toLowerCase().endsWith(e)}},dRe=/^\*+\.\*+$/,pRe=function(e){return!e.startsWith(".")&&e.includes(".")},fRe=function(e){return e!=="."&&e!==".."&&e.includes(".")},mRe=/^\.\*+$/,hRe=function(e){return e!=="."&&e!==".."&&e.startsWith(".")},gRe=/^\*+$/,xRe=function(e){return e.length!==0&&!e.startsWith(".")},yRe=function(e){return e.length!==0&&e!=="."&&e!==".."},vRe=/^\?+([^+@!?\*\[\(]*)?$/,_Re=function(e){var _e1=_sliced_to_array(e,2),t=_e1[0],tmp=_e1[1],r=tmp===void 0?"":tmp,n=KQ([t]);return r?(r=r.toLowerCase(),function(i){return n(i)&&i.toLowerCase().endsWith(r)}):n},bRe=function(e){var _e1=_sliced_to_array(e,2),t=_e1[0],tmp=_e1[1],r=tmp===void 0?"":tmp,n=QQ([t]);return r?(r=r.toLowerCase(),function(i){return n(i)&&i.toLowerCase().endsWith(r)}):n},wRe=function(e){var _e1=_sliced_to_array(e,2),t=_e1[0],tmp=_e1[1],r=tmp===void 0?"":tmp,n=QQ([t]);return r?function(i){return n(i)&&i.endsWith(r)}:n},SRe=function(e){var _e1=_sliced_to_array(e,2),t=_e1[0],tmp=_e1[1],r=tmp===void 0?"":tmp,n=KQ([t]);return r?function(i){return n(i)&&i.endsWith(r)}:n},KQ=function(e){var _e1=_sliced_to_array(e,1),t=_e1[0],r=t.length;return function(n){return n.length===r&&!n.startsWith(".")}},QQ=function(e){var _e1=_sliced_to_array(e,1),t=_e1[0],r=t.length;return function(n){return n.length===r&&n!=="."&&n!==".."}},JQ=(typeof process==="undefined"?"undefined":_type_of(process))=="object"&&process?_type_of(process.env)=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";Za.sep=JQ==="win32"?"\\":"/";var Ha=Symbol("globstar **");Za.GLOBSTAR=Ha,Za.filter=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(r){return Za(r,e,t)}};var bu=function bu1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};Za.defaults=function(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object"||!Object.keys(e).length)return Za;var t=Za;return Object.assign(function(r,n){return t(r,n,bu(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:/*#__PURE__*/function(_t_Minimatch){"use strict";_inherits(Minimatch,_t_Minimatch);function Minimatch(r){_class_call_check(this,Minimatch);return _call_super(this,Minimatch,[r,bu(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{})])}_create_class(Minimatch,null,[{key:"defaults",value:function defaults(r){return t.defaults(bu(e,r)).Minimatch}}]);return Minimatch}(t.Minimatch),AST:/*#__PURE__*/function(_t_AST){"use strict";_inherits(AST,_t_AST);function AST(r,n){_class_call_check(this,AST);return _call_super(this,AST,[r,n,bu(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})])}_create_class(AST,null,[{key:"fromGlob",value:function fromGlob(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(r,bu(e,n))}}]);return AST}(t.AST),unescape:function unescape1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(r,bu(e,n))},escape:function escape1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(r,bu(e,n))},filter:function filter(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(r,bu(e,n))},defaults:function(r){return t.defaults(bu(e,r))},makeRe:function makeRe(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(r,bu(e,n))},braceExpand:function braceExpand(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(r,bu(e,n))},match:function match(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(r,n,bu(e,i))},sep:t.sep,GLOBSTAR:Ha})};var YQ=function YQ1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r7(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:QPe(e)};Za.braceExpand=YQ,Za.makeRe=function(e){return new Y1(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},Za.match=function(e,t){var r=new Y1(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter(function(n){return r.match(n)}),r.options.nonull&&!e.length&&e.push(t),e};var _Q=/[?*]|[+@!]\(.*?\)|\[|\]/,f7,XQ,pb,zM,im,W1,Y1=/*#__PURE__*/function(){"use strict";function Y11(t){_class_call_check(this,Y11);Ht(this,f7);Ht(this,pb);Ht(this,im);A(this,"options");A(this,"set");A(this,"pattern");A(this,"windowsPathsNoEscape");A(this,"nonegate");A(this,"negate");A(this,"comment");A(this,"empty");A(this,"preserveMultipleSlashes");A(this,"partial");A(this,"globSet");A(this,"globParts");A(this,"nocase");A(this,"isWindows");A(this,"platform");A(this,"windowsNoMagicRoot");A(this,"maxGlobstarRecursion");A(this,"regexp");var n;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r7(t),r=r||{},this.options=r,this.maxGlobstarRecursion=(n=r.maxGlobstarRecursion)!=null?n:200,this.pattern=t,this.platform=r.platform||JQ,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}_create_class(Y11,[{key:"hasMagic",value:function hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=this.set[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var t=_step.value;try{for(var _iterator1=t[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var r=_step1.value;if(typeof r!="string")return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!1}},{key:"debug",value:function debug(){}},{key:"make",value:function make(){var _this=this;var t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=_to_consumable_array(new Set(this.braceExpand())),r.debug&&(this.debug=function(){var _console;return(_console=console).error.apply(_console,arguments)}),this.debug(this.pattern,this.globSet);var n=this.globSet.map(function(o){return _this.slashSplit(o)});this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);var i=this.globParts.map(function(o,a,s){if(_this.isWindows&&_this.windowsNoMagicRoot){var l=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&_Q.test(o[2])||_Q.test(o[3])),c=/^[a-z]:/i.test(o[0]);if(l)return _to_consumable_array(o.slice(0,4)).concat(_to_consumable_array(o.slice(4).map(function(d){return _this.parse(d)})));if(c)return[o[0]].concat(_to_consumable_array(o.slice(1).map(function(d){return _this.parse(d)})))}return o.map(function(l){return _this.parse(l)})});if(this.debug(this.pattern,i),this.set=i.filter(function(o){return o.indexOf(!1)===-1}),this.isWindows)for(var o=0;o<this.set.length;o++){var a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}},{key:"preprocess",value:function preprocess(t){if(this.options.noglobstar)for(var n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");var _this_options=this.options,tmp=_this_options.optimizationLevel,r=tmp===void 0?1:tmp;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=r>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}},{key:"adjascentGlobstarOptimize",value:function adjascentGlobstarOptimize(t){return t.map(function(r){var n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){var i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}},{key:"levelOneOptimize",value:function levelOneOptimize(t){return t.map(function(r){return(r=r.reduce(function(n,i){var o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)},[])).length===0?[""]:r})}},{key:"levelTwoFileOptimize",value:function levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));var r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(var i=1;i<t.length-1;i++){var o=t[i];i===1&&o===""&&t[0]===""||o!=="."&&o!==""||(r=!0,t.splice(i,1),i--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(r=!0,t.pop())}var n=0;for(;(n=t.indexOf("..",n+1))!==-1;){var i10=t[n-1];i10&&i10!=="."&&i10!==".."&&i10!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}},{key:"firstPhasePreProcess",value:function firstPhasePreProcess(t){var r=!1;do{r=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){var a=i;for(;n[a+1]==="**";)a++;a>i&&n.splice(i+1,a-i);var s=n[i+1],l=n[i+2],c=n[i+3];if(s!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;r=!0,n.splice(i,1);var d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(var a9=1;a9<n.length-1;a9++){var s10=n[a9];a9===1&&s10===""&&n[0]===""||s10!=="."&&s10!==""||(r=!0,n.splice(a9,1),a9--)}n[0]!=="."||n.length!==2||n[1]!=="."&&n[1]!==""||(r=!0,n.pop())}var o=0;for(;(o=n.indexOf("..",o+1))!==-1;){var a10=n[o-1];if(a10&&a10!=="."&&a10!==".."&&a10!=="**"){var _n;r=!0;var s11=o===1&&n[o+1]==="**"?["."]:[];(_n=n).splice.apply(_n,[o-1,2].concat(_to_consumable_array(s11))),n.length===0&&n.push(""),o-=2}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}while(r);return t}},{key:"secondPhasePreProcess",value:function secondPhasePreProcess(t){for(var r=0;r<t.length-1;r++)for(var n=r+1;n<t.length;n++){var i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(function(r){return r.length})}},{key:"partsMatch",value:function partsMatch(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0,a=[],s="";for(;i<t.length&&o<r.length;)if(t[i]===r[o])a.push(s==="b"?r[o]:t[i]),i++,o++;else if(n&&t[i]==="**"&&r[o]===t[i+1])a.push(t[i]),i++;else if(n&&r[o]==="**"&&t[i]===r[o+1])a.push(r[o]),o++;else if(t[i]!=="*"||!r[o]||!this.options.dot&&r[o].startsWith(".")||r[o]==="**"){if(r[o]!=="*"||!t[i]||!this.options.dot&&t[i].startsWith(".")||t[i]==="**"||s==="a")return!1;s="b",a.push(r[o]),i++,o++}else{if(s==="b")return!1;s="a",a.push(t[i]),i++,o++}return t.length===r.length&&a}},{key:"parseNegate",value:function parseNegate(){if(this.nonegate)return;var t=this.pattern,r=!1,n=0;for(var i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}},{key:"matchOne",value:function matchOne(t,r){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0;if(this.isWindows){var s=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!s&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=l?3:s?0:void 0,u=!c&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3])?3:c?0:void 0;if(typeof d=="number"&&typeof u=="number"){var _ref=[t[d],r[u]],p=_ref[0],m=_ref[1];p.toLowerCase()===m.toLowerCase()&&(r[u]=p,o=u,i=d)}}var _this_options=this.options,tmp=_this_options.optimizationLevel,a=tmp===void 0?1:tmp;return a>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(Ha)?Nt(this,f7,XQ).call(this,t,r,n,i,o):Nt(this,im,W1).call(this,t,r,n,i,o)}},{key:"braceExpand",value:function braceExpand(){return YQ(this.pattern,this.options)}},{key:"parse",value:function parse(t){r7(t);var r=this.options;if(t==="**")return Ha;if(t==="")return"";var n,i=null;(n=t.match(gRe))?i=r.dot?yRe:xRe:(n=t.match(aRe))?i=(r.nocase?r.dot?cRe:uRe:r.dot?lRe:sRe)(n[1]):(n=t.match(vRe))?i=(r.nocase?r.dot?bRe:_Re:r.dot?wRe:SRe)(n):(n=t.match(dRe))?i=r.dot?fRe:pRe:(n=t.match(mRe))&&(i=hRe);var o=fg.fromGlob(t,this.options).toMMPattern();return i&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}},{key:"makeRe",value:function makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?"[^/]*?":r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(r.nocase?["i"]:[]),o=t.map(function(l){var c=l.map(function(d){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(_instanceof(d,RegExp))try{for(var _iterator=d.flags.split("")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;i.add(u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return typeof d=="string"?d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):d===Ha?Ha:d._src});return c.forEach(function(d,u){var p=c[u+1],m=c[u-1];d===Ha&&m!==Ha&&(m===void 0?p!==void 0&&p!==Ha?c[u+1]="(?:\\/|"+n+"\\/)?"+p:c[u]=n:p===void 0?c[u-1]=m+"(?:\\/|"+n+")?":p!==Ha&&(c[u-1]=m+"(?:\\/|\\/"+n+"\\/)"+p,c[u+1]=Ha))}),c.filter(function(d){return d!==Ha}).join("/")}).join("|"),_ref=_sliced_to_array(t.length>1?["(?:",")"]:["",""],2),a=_ref[0],s=_ref[1];o="^"+a+o+s+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,_to_consumable_array(i).join(""))}catch(l){this.regexp=!1}return this.regexp}},{key:"slashSplit",value:function slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?[""].concat(_to_consumable_array(t.split(/\/+/))):t.split(/\/+/)}},{key:"match",value:function match(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;var n=this.options;this.isWindows&&(t=t.split("\\").join("/"));var i=this.slashSplit(t);this.debug(this.pattern,"split",i);var o=this.set;this.debug(this.pattern,"set",o);var a=i[i.length-1];if(!a)for(var s=i.length-2;!a&&s>=0;s--)a=i[s];for(var s10=0;s10<o.length;s10++){var l=o[s10],c=i;if(n.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}}],[{key:"defaults",value:function defaults(t){return Za.defaults(t).Minimatch}}]);return Y11}();f7=new WeakSet,XQ=function XQ1(t,r,n,i,o){var a=r.indexOf(Ha,o),s=r.lastIndexOf(Ha),_ref=_sliced_to_array(n?[r.slice(o,a),r.slice(a+1),[]]:[r.slice(o,a),r.slice(a+1,s),r.slice(s+1)],3),l=_ref[0],c=_ref[1],d=_ref[2];if(l.length){var y=t.slice(i,i+l.length);if(!Nt(this,im,W1).call(this,y,l,n,0,0))return!1;i+=l.length}var u=0;if(d.length){if(d.length+i>t.length)return!1;var y10=t.length-d.length;if(Nt(this,im,W1).call(this,t,d,n,y10,0))u=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(y10--,!Nt(this,im,W1).call(this,t,d,n,y10,0)))return!1;u=d.length+1}}if(!c.length){var y11=!!u;for(var _=i;_<t.length-u;_++){var b=String(t[_]);if(y11=!0,b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1}return n||y11}var p=[[[],0]],m=p[0],h=0,g=[0];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var y12=_step.value;y12===Ha?(g.push(h),m=[[],0],p.push(m)):(m[0].push(y12),h++)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var x=p.length-1,v=t.length-u;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=p[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var y13=_step1.value;y13[1]=v-(g[x--]+y13[0].length)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!!Nt(this,pb,zM).call(this,t,p,i,0,n,0,!!u)},pb=new WeakSet,zM=function(t,r,n,i,o,a,s){var l=r[i];if(!l){for(var u=n;u<t.length;u++){s=!0;var p=t[u];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s}var _l1=_sliced_to_array(l,2),c=_l1[0],d=_l1[1];for(;n<=d;){if(Nt(this,im,W1).call(this,t.slice(0,n+c.length),c,o,n,0)&&a<this.maxGlobstarRecursion){var p10=Nt(this,pb,zM).call(this,t,r,n+c.length,i+1,o,a+1,s);if(p10!==!1)return p10}var u10=t[n];if(u10==="."||u10===".."||!this.options.dot&&u10.startsWith("."))return!1;n++}return o||null},im=new WeakSet,W1=function W11(t,r,n,i,o){var a,s,l,c;for(a=i,s=o,c=t.length,l=r.length;a<c&&s<l;a++,s++){this.debug("matchOne loop");var d=void 0,u=r[s],p=t[a];if(this.debug(r,u,p),u===!1||u===Ha||(typeof u=="string"?(d=p===u,this.debug("string match",u,p,d)):(d=u.test(p),this.debug("pattern match",u,p,d)),!d))return!1}if(a===c&&s===l)return!0;if(a===c)return n;if(s===l)return a===c-1&&t[a]==="";throw new Error("wtf?")};function YM(e){var t=new Error("".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"","Invalid response: ").concat(e.status," ").concat(e.statusText));return t.status=e.status,t.response=e,t}function Zo(e,t){var r=t.status;if(r===401&&e.digest)return t;if(r>=400)throw YM(t);return t}function X1(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?GPe(e.headers):{},status:e.status,statusText:e.statusText}:t}Za.AST=fg,Za.Minimatch=Y1,Za.escape=function(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.windowsPathsNoEscape,t=tmp===void 0?!1:tmp;return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},Za.unescape=ib;var kRe=(bQ=function bQ1(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=Ho({url:ji(e.remoteURL,zi(t)),method:"COPY",headers:{Destination:ji(e.remoteURL,zi(r)),Overwrite:n.overwrite===!1?"F":"T",Depth:n.shallow?"0":"infinity"}},e,n);return a=function a(s){Zo(e,s)},(o=Go(i,e))&&o.then||(o=Promise.resolve(o)),a?o.then(a):o;var o,a},function kRe1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(bQ.apply(this,e))}catch(r){return Promise.reject(r)}}),bQ,wQ=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",CRe=new RegExp("^["+wQ+"]["+wQ+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function eJ(e,t){var r=[],n=t.exec(e);for(;n;){var i=[];i.startIndex=t.lastIndex-n[0].length;var o=n.length;for(var a=0;a<o;a++)i.push(n[a]);r.push(i),n=t.exec(e)}return r}var m7=function m71(e){return CRe.exec(e)!=null},XM=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],tJ=["__proto__","constructor","prototype"],rJ=function(e){return XM.includes(e)?"__"+e:e},ERe={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function tagValueProcessor(e,t){return t},attributeValueProcessor:function attributeValueProcessor(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function updateTag(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:rJ};function TRe(e,t){if(typeof e!="string")return;var r=e.toLowerCase();if(XM.some(function(n){return r===n.toLowerCase()}))throw new Error("[SECURITY] Invalid ".concat(t,': "').concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'));if(tJ.some(function(n){return r===n.toLowerCase()}))throw new Error("[SECURITY] Invalid ".concat(t,': "').concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'))}function nJ(e,t){var r,n,i,o,a,s,l,c;return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,(r=e.maxEntitySize)!=null?r:1e4),maxExpansionDepth:Math.max(1,(n=e.maxExpansionDepth)!=null?n:1e4),maxTotalExpansions:Math.max(1,(i=e.maxTotalExpansions)!=null?i:1/0),maxExpandedLength:Math.max(1,(o=e.maxExpandedLength)!=null?o:1e5),maxEntityCount:Math.max(1,(a=e.maxEntityCount)!=null?a:1e3),allowedTags:(s=e.allowedTags)!=null?s:null,tagFilter:(l=e.tagFilter)!=null?l:null,appliesTo:(c=e.appliesTo)!=null?c:"all"}:nJ(!0)}var ARe=function ARe1(e){var t=Object.assign({},ERe,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,n=_step_value.value,i=_step_value.name;n&&TRe(n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.onDangerousProperty===null&&(t.onDangerousProperty=rJ),t.processEntities=nJ(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(function(n){return typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n})),t},jM;jM=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");var vd=/*#__PURE__*/function(){"use strict";function vd1(t){_class_call_check(this,vd1);this.tagname=t,this.child=[],this[":@"]=Object.create(null)}_create_class(vd1,[{key:"add",value:function add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push(_define_property({},t,r))}},{key:"addChild",value:function addChild(t,r){var _obj;t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push((_obj={},_define_property(_obj,t.tagname,t.child),_define_property(_obj,":@",t[":@"]),_obj)):this.child.push(_define_property({},t.tagname,t.child)),r!==void 0&&(this.child[this.child.length-1][jM]={startIndex:r})}}],[{key:"getMetaDataSymbol",value:function getMetaDataSymbol(){return jM}}]);return vd1}(),UM=/*#__PURE__*/function(){"use strict";function UM1(t){_class_call_check(this,UM1);this.suppressValidationErr=!t,this.options=t}_create_class(UM1,[{key:"readDocType",value:function readDocType(t,r){var n=Object.create(null),i=0;if(t[r+3]!=="O"||t[r+4]!=="C"||t[r+5]!=="T"||t[r+6]!=="Y"||t[r+7]!=="P"||t[r+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{r+=9;var o=1,a=!1,s=!1,l="";for(;r<t.length;r++)if(t[r]!=="<"||s)if(t[r]===">"){if(s?t[r-1]==="-"&&t[r-2]==="-"&&(s=!1,o--):o--,o===0)break}else t[r]==="["?a=!0:l+=t[r];else{if(a&&dg(t,"!ENTITY",r)){var c=void 0,d=void 0;var ref;if(r+=7,ref=_sliced_to_array(this.readEntityExp(t,r+1,this.suppressValidationErr),3),c=ref[0],d=ref[1],r=ref[2],ref,d.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&i>=this.options.maxEntityCount)throw new Error("Entity count (".concat(i+1,") exceeds maximum allowed (").concat(this.options.maxEntityCount,")"));n[c]=d,i++}}else if(a&&dg(t,"!ELEMENT",r)){r+=8;var _this_readElementExp=this.readElementExp(t,r+1),c10=_this_readElementExp.index;r=c10}else if(a&&dg(t,"!ATTLIST",r))r+=8;else if(a&&dg(t,"!NOTATION",r)){r+=9;var _this_readNotationExp=this.readNotationExp(t,r+1,this.suppressValidationErr),c11=_this_readNotationExp.index;r=c11}else{if(!dg(t,"!--",r))throw new Error("Invalid DOCTYPE");s=!0}o++,l=""}if(o!==0)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:r}}},{key:"readEntityExp",value:function readEntityExp(t,r){var n=r=qs(t,r);for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;var i=t.substring(n,r);if(rb(i),r=qs(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}var o="";var ref;if(ref=_sliced_to_array(this.readIdentifierVal(t,r,"entity"),2),r=ref[0],o=ref[1],ref,this.options.enabled!==!1&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error('Entity "'.concat(i,'" size (').concat(o.length,") exceeds maximum allowed size (").concat(this.options.maxEntitySize,")"));return[i,o,--r]}},{key:"readNotationExp",value:function readNotationExp(t,r){var n=r=qs(t,r);for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);!this.suppressValidationErr&&rb(i),r=qs(t,r);var o=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error('Expected SYSTEM or PUBLIC, found "'.concat(o,'"'));r+=o.length,r=qs(t,r);var a=null,s=null;var ref,ref1,ref2;if(o==="PUBLIC")ref=_sliced_to_array(this.readIdentifierVal(t,r,"publicIdentifier"),2),r=ref[0],a=ref[1],ref,t[r=qs(t,r)]!=='"'&&t[r]!=="'"||(ref1=_sliced_to_array(this.readIdentifierVal(t,r,"systemIdentifier"),2),r=ref1[0],s=ref1[1],ref1);else if(o==="SYSTEM"&&(ref2=_sliced_to_array(this.readIdentifierVal(t,r,"systemIdentifier"),2),r=ref2[0],s=ref2[1],ref2,!this.suppressValidationErr&&!s))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:a,systemIdentifier:s,index:--r}}},{key:"readIdentifierVal",value:function readIdentifierVal(t,r,n){var i="",o=t[r];if(o!=='"'&&o!=="'")throw new Error('Expected quoted string, found "'.concat(o,'"'));var a=++r;for(;r<t.length&&t[r]!==o;)r++;if(i=t.substring(a,r),t[r]!==o)throw new Error("Unterminated ".concat(n," value"));return[++r,i]}},{key:"readElementExp",value:function readElementExp(t,r){var n=r=qs(t,r);for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);if(!this.suppressValidationErr&&!m7(i))throw new Error('Invalid element name: "'.concat(i,'"'));var o="";if(t[r=qs(t,r)]==="E"&&dg(t,"MPTY",r))r+=4;else if(t[r]==="A"&&dg(t,"NY",r))r+=2;else if(t[r]==="("){var a=++r;for(;r<t.length&&t[r]!==")";)r++;if(o=t.substring(a,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'.concat(t[r],'"'));return{elementName:i,contentModel:o.trim(),index:r}}},{key:"readAttlistExp",value:function readAttlistExp(t,r){var n=r=qs(t,r);for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);for(rb(i),n=r=qs(t,r);r<t.length&&!/\s/.test(t[r]);)r++;var o=t.substring(n,r);if(!rb(o))throw new Error('Invalid attribute name: "'.concat(o,'"'));r=qs(t,r);var a="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(a="NOTATION",t[r=qs(t,r+=8)]!=="(")throw new Error("Expected '(', found \"".concat(t[r],'"'));r++;var l=[];for(;r<t.length&&t[r]!==")";){var c=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;var d=t.substring(c,r);if(d=d.trim(),!rb(d))throw new Error('Invalid notation name: "'.concat(d,'"'));l.push(d),t[r]==="|"&&(r++,r=qs(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,a+=" ("+l.join("|")+")"}else{var l10=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;a+=t.substring(l10,r);var c10=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!c10.includes(a.toUpperCase()))throw new Error('Invalid attribute type: "'.concat(a,'"'))}r=qs(t,r);var s="";var ref;return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(s="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(s="#IMPLIED",r+=7):(ref=_sliced_to_array(this.readIdentifierVal(t,r,"ATTLIST"),2),r=ref[0],s=ref[1],ref),{elementName:i,attributeName:o,attributeType:a,defaultValue:s,index:r}}}]);return UM1}(),qs=function(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function dg(e,t,r){for(var n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function rb(e){if(m7(e))return e;throw new Error("Invalid entity name ".concat(e))}var _obj;var IRe=/^[-+]?0x[a-fA-F0-9]+$/,PRe=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,RRe={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"},MRe=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/,BM=/*#__PURE__*/function(){"use strict";function BM1(t){_class_call_check(this,BM1);this._matcher=t}_create_class(BM1,[{key:"separator",get:function get1(){return this._matcher.separator}},{key:"getCurrentTag",value:function getCurrentTag(){var t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}},{key:"getCurrentNamespace",value:function getCurrentNamespace(){var t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}},{key:"getAttrValue",value:function getAttrValue(t){var n;var r=this._matcher.path;if(r.length!==0)return(n=r[r.length-1].values)==null?void 0:n[t]}},{key:"hasAttr",value:function hasAttr(t){var r=this._matcher.path;if(r.length===0)return!1;var n=r[r.length-1];return n.values!==void 0&&t in n.values}},{key:"getPosition",value:function getPosition(){var r;var t=this._matcher.path;return t.length===0?-1:(r=t[t.length-1].position)!=null?r:0}},{key:"getCounter",value:function getCounter(){var r;var t=this._matcher.path;return t.length===0?-1:(r=t[t.length-1].counter)!=null?r:0}},{key:"getIndex",value:function getIndex(){return this.getPosition()}},{key:"getDepth",value:function getDepth(){return this._matcher.path.length}},{key:"toString",value:function toString(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._matcher.toString(t,r)}},{key:"toArray",value:function toArray(){return this._matcher.path.map(function(t){return t.tag})}},{key:"matches",value:function matches(t){return this._matcher.matches(t)}},{key:"matchesAny",value:function matchesAny(t){return t.matchesAny(this._matcher)}}]);return BM1}(),lb=/*#__PURE__*/function(){"use strict";function lb1(){_class_call_check(this,lb1);var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new BM(this)}_create_class(lb1,[{key:"push",value:function push(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);var i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);var o=this.siblingStacks[i],a=n?"".concat(n,":").concat(t):t,s=o.get(a)||0,l=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;l+=d}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o.set(a,s+1);var c={tag:t,position:l,counter:s};n!=null&&(c.namespace=n),r!=null&&(c.values=r),this.path.push(c)}},{key:"pop",value:function pop(){if(this.path.length===0)return;this._pathStringCache=null;var t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}},{key:"updateCurrent",value:function updateCurrent(t){if(this.path.length>0){var r=this.path[this.path.length-1];t!=null&&(r.values=t)}}},{key:"getCurrentTag",value:function getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}},{key:"getCurrentNamespace",value:function getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}},{key:"getAttrValue",value:function getAttrValue(t){var r;if(this.path.length!==0)return(r=this.path[this.path.length-1].values)==null?void 0:r[t]}},{key:"hasAttr",value:function hasAttr(t){if(this.path.length===0)return!1;var r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}},{key:"getPosition",value:function getPosition(){var t;return this.path.length===0?-1:(t=this.path[this.path.length-1].position)!=null?t:0}},{key:"getCounter",value:function getCounter(){var t;return this.path.length===0?-1:(t=this.path[this.path.length-1].counter)!=null?t:0}},{key:"getIndex",value:function getIndex(){return this.getPosition()}},{key:"getDepth",value:function getDepth(){return this.path.length}},{key:"toString",value:function toString(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;var i=this.path.map(function(o){return o.namespace?"".concat(o.namespace,":").concat(o.tag):o.tag}).join(n);return this._pathStringCache=i,i}return this.path.map(function(i){return r&&i.namespace?"".concat(i.namespace,":").concat(i.tag):i.tag}).join(n)}},{key:"toArray",value:function toArray(){return this.path.map(function(t){return t.tag})}},{key:"reset",value:function reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}},{key:"matches",value:function matches(t){var r=t.segments;return r.length!==0&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r))}},{key:"_matchSimple",value:function _matchSimple(t){if(this.path.length!==t.length)return!1;for(var r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}},{key:"_matchWithDeepWildcard",value:function _matchWithDeepWildcard(t){var r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){var i=t[n];if(i.type==="deep-wildcard"){if(n--,n<0)return!0;var o=t[n],a=!1;for(var s=r;s>=0;s--)if(this._matchSegment(o,this.path[s],s===this.path.length-1)){r=s-1,n--,a=!0;break}if(!a)return!1}else{if(!this._matchSegment(i,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}},{key:"_matchSegment",value:function _matchSegment(t,r,n){var i;if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;var o=(i=r.counter)!=null?i:0;if(t.position==="first"&&o!==0||t.position==="odd"&&o%2!=1||t.position==="even"&&o%2!=0||t.position==="nth"&&o!==t.positionValue)return!1}return!0}},{key:"matchesAny",value:function matchesAny(t){return t.matchesAny(this)}},{key:"snapshot",value:function snapshot(){return{path:this.path.map(function(t){return _object_spread({},t)}),siblingStacks:this.siblingStacks.map(function(t){return new Map(t)})}}},{key:"restore",value:function restore(t){this._pathStringCache=null,this.path=t.path.map(function(r){return _object_spread({},r)}),this.siblingStacks=t.siblingStacks.map(function(r){return new Map(r)})}},{key:"readOnly",value:function readOnly(){return this._view}}]);return lb1}(),am=/*#__PURE__*/function(){"use strict";function am1(t){_class_call_check(this,am1);var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(function(i){return i.type==="deep-wildcard"}),this._hasAttributeCondition=this.segments.some(function(i){return i.attrName!==void 0}),this._hasPositionSelector=this.segments.some(function(i){return i.position!==void 0})}_create_class(am1,[{key:"_parse",value:function _parse(t){var r=[],n=0,i="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(r.push(this._parseSegment(i.trim())),i=""),r.push({type:"deep-wildcard"}),n+=2):(i.trim()&&r.push(this._parseSegment(i.trim())),i="",n++):(i+=t[n],n++);return i.trim()&&r.push(this._parseSegment(i.trim())),r}},{key:"_parseSegment",value:function _parseSegment(t){var r={type:"tag"},n=null,i=t,o=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(i=o[1]+o[3],o[2])){var d=o[2].slice(1,-1);d&&(n=d)}var a,s,l=i;if(i.includes("::")){var d10=i.indexOf("::");if(a=i.substring(0,d10).trim(),l=i.substring(d10+2).trim(),!a)throw new Error("Invalid namespace in pattern: ".concat(t))}var c=null;if(l.includes(":")){var d11=l.lastIndexOf(":"),u=l.substring(0,d11).trim(),p=l.substring(d11+1).trim();["first","last","odd","even"].includes(p)||/^nth\(\d+\)$/.test(p)?(s=u,c=p):s=l}else s=l;if(!s)throw new Error("Invalid segment pattern: ".concat(t));if(r.tag=s,a&&(r.namespace=a),n)if(n.includes("=")){var d12=n.indexOf("=");r.attrName=n.substring(0,d12).trim(),r.attrValue=n.substring(d12+1).trim()}else r.attrName=n.trim();if(c){var d13=c.match(/^nth\((\d+)\)$/);d13?(r.position="nth",r.positionValue=parseInt(d13[1],10)):r.position=c}return r}},{key:"length",get:function get1(){return this.segments.length}},{key:"hasDeepWildcard",value:function hasDeepWildcard(){return this._hasDeepWildcard}},{key:"hasAttributeCondition",value:function hasAttributeCondition(){return this._hasAttributeCondition}},{key:"hasPositionSelector",value:function hasPositionSelector(){return this._hasPositionSelector}},{key:"toString",value:function toString(){return this.pattern}}]);return am1}(),qM=/*#__PURE__*/function(){"use strict";function qM1(){_class_call_check(this,qM1);this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}_create_class(qM1,[{key:"add",value:function add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;var r=t.length,n=t.segments[t.segments.length-1],i=n==null?void 0:n.tag;if(i&&i!=="*"){var o="".concat(r,":").concat(i);this._byDepthAndTag.has(o)||this._byDepthAndTag.set(o,[]),this._byDepthAndTag.get(o).push(t)}else this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);return this}},{key:"addAll",value:function addAll(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;this.add(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}},{key:"has",value:function has(t){return this._patterns.has(t.pattern)}},{key:"size",get:function get1(){return this._patterns.size}},{key:"seal",value:function seal(){return this._sealed=!0,this}},{key:"isSealed",get:function get1(){return this._sealed}},{key:"matchesAny",value:function matchesAny(t){return this.findMatch(t)!==null}},{key:"findMatch",value:function findMatch(t){var r=t.getDepth(),n="".concat(r,":").concat(t.getCurrentTag()),i=this._byDepthAndTag.get(n);if(i){for(var a=0;a<i.length;a++)if(t.matches(i[a]))return i[a]}var o=this._wildcardByDepth.get(r);if(o){for(var a9=0;a9<o.length;a9++)if(t.matches(o[a9]))return o[a9]}for(var a10=0;a10<this._deepWildcards.length;a10++)if(t.matches(this._deepWildcards[a10]))return this._deepWildcards[a10];return null}}]);return qM1}(),ORe=(_obj={cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",euro:"€",dollar:"$"},_define_property(_obj,"euro","€"),_define_property(_obj,"fnof","ƒ"),_define_property(_obj,"inr","₹"),_define_property(_obj,"af","؋"),_define_property(_obj,"birr","ብር"),_define_property(_obj,"peso","₱"),_define_property(_obj,"rub","₽"),_define_property(_obj,"won","₩"),_define_property(_obj,"yuan","\xa5"),_define_property(_obj,"cedil","\xb8"),_obj),iJ={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},$Re={nbsp:"\xa0",copy:"\xa9",reg:"\xae",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"\xab",raquo:"\xbb",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"\xb6",sect:"\xa7",deg:"\xb0",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe"},NRe=new Set("!?\\\\/[]$%{}^&*()<>|+");function SQ(e){if(e[0]==="#")throw new Error("[EntityReplacer] Invalid character '#' in entity name: \"".concat(e,'"'));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(NRe.has(t))throw new Error("[EntityReplacer] Invalid character '".concat(t,"' in entity name: \"").concat(e,'"'))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e}function SM(){var e=Object.create(null);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var i=_step.value;if(i)try{for(var _iterator1=Object.keys(i)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var o=_step1.value;var a=i[o];if(typeof a=="string")e[o]=a;else if(a&&(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&a.val!==void 0){var s=a.val;typeof s=="string"&&(e[o]=s)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return e}var pg="external",Zk="base",kM="all",Nl=Object.freeze({allow:0,leave:1,remove:2,throw:3}),DRe=new Set([9,10,13]),n7=/*#__PURE__*/function(){"use strict";function n71(){_class_call_check(this,n71);var i,o;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:function(a){return a},this._limitTiers=(r=(i=this._limit.applyLimitsTo)!=null?i:pg)&&r!==pg?r===kM?new Set([kM]):r===Zk?new Set([Zk]):Array.isArray(r)?new Set(r):new Set([pg]):new Set([pg]),this._numericAllowed=(o=t.numericAllowed)!=null?o:!0,this._baseMap=SM(iJ,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);var n=function(a){var d,u;if(!a)return{xmlVersion:1,onLevel:Nl.allow,nullLevel:Nl.remove};var s=a.xmlVersion===1.1?1.1:1,l=(d=Nl[a.onNCR])!=null?d:Nl.allow,c=(u=Nl[a.nullNCR])!=null?u:Nl.remove;return{xmlVersion:s,onLevel:l,nullLevel:Math.max(c,Nl.remove)}}(t.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel}_create_class(n71,[{key:"setExternalEntities",value:function setExternalEntities(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t)try{for(var _iterator=Object.keys(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;SQ(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this._externalMap=SM(t)}},{key:"addExternalEntity",value:function addExternalEntity(t,r){SQ(t),typeof r=="string"&&r.indexOf("&")===-1&&(this._externalMap[t]=r)}},{key:"addInputEntities",value:function addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=SM(t)}},{key:"reset",value:function reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}},{key:"setXmlVersion",value:function setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}},{key:"decode",value:function decode(t){if(typeof t!="string"||t.length===0)return t;var r=t,n=[],i=t.length,o=0,a=0,s=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,c=s||l;for(;a<i;){if(t.charCodeAt(a)!==38){a++;continue}var u=a+1;for(;u<i&&t.charCodeAt(u)!==59&&u-a<=32;)u++;if(u>=i||t.charCodeAt(u)!==59){a++;continue}var p=t.slice(a+1,u);if(p.length===0){a++;continue}var m=void 0,h=void 0;if(this._removeSet.has(p))m="",h===void 0&&(h=pg);else{if(this._leaveSet.has(p)){a++;continue}if(p.charCodeAt(0)===35){var g=this._resolveNCR(p);if(g===void 0){a++;continue}m=g,h=Zk}else{var g10=this._resolveName(p);m=g10==null?void 0:g10.value,h=g10==null?void 0:g10.tier}}if(m!==void 0){if(a>o&&n.push(t.slice(o,a)),n.push(m),o=u+1,a=o,c&&this._tierCounts(h)){if(s&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error("[EntityReplacer] Entity expansion count limit exceeded: ".concat(this._totalExpansions," > ").concat(this._maxTotalExpansions));if(l){var g11=m.length-(p.length+2);if(g11>0&&(this._expandedLength+=g11,this._expandedLength>this._maxExpandedLength))throw new Error("[EntityReplacer] Expanded content length limit exceeded: ".concat(this._expandedLength," > ").concat(this._maxExpandedLength))}}}else a++}o<i&&n.push(t.slice(o));var d=n.length===0?t:n.join("");return this._postCheck(d,r)}},{key:"_tierCounts",value:function _tierCounts(t){return!!this._limitTiers.has(kM)||this._limitTiers.has(t)}},{key:"_resolveName",value:function _resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:pg}:t in this._externalMap?{value:this._externalMap[t],tier:pg}:t in this._baseMap?{value:this._baseMap[t],tier:Zk}:void 0}},{key:"_classifyNCR",value:function _classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!DRe.has(t)?Nl.remove:-1}},{key:"_applyNCRAction",value:function _applyNCRAction(t,r,n){switch(t){case Nl.allow:return String.fromCodePoint(n);case Nl.remove:return"";case Nl.leave:return;case Nl.throw:throw new Error("[EntityDecoder] Prohibited numeric character reference &".concat(r,"; (U+").concat(n.toString(16).toUpperCase().padStart(4,"0"),")"));default:return String.fromCodePoint(n)}}},{key:"_resolveNCR",value:function _resolveNCR(t){var r=t.charCodeAt(1),n;if(n=r===120||r===88?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;var i=this._classifyNCR(n);if(!this._numericAllowed&&i<Nl.remove)return;var o=i===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(o,t,n)}}]);return n71}();function LRe(e,t){if(!e)return{};var r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};var n={};for(var i in r)i.startsWith(t.attributeNamePrefix)?n[i.substring(t.attributeNamePrefix.length)]=r[i]:n[i]=r[i];return n}function FRe(e){if(!e||typeof e!="string")return;var t=e.indexOf(":");if(t!==-1&&t>0){var r=e.substring(0,t);if(r!=="xmlns")return r}}var WM=function WM1(t,r){"use strict";_class_call_check(this,WM1);var n;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=qRe,this.parseTextData=zRe,this.resolveNameSpace=jRe,this.buildAttributesMap=BRe,this.isItStopNode=HRe,this.replaceEntitiesValue=VRe,this.readStopNodeData=KRe,this.saveTextToParentTag=GRe,this.addChild=WRe,this.ignoreAttributesFn=typeof(n=this.options.ignoreAttributes)=="function"?n:Array.isArray(n)?function(a){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(typeof s=="string"&&a===s||_instanceof(s,RegExp)&&s.test(a))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}:function(){return!1},this.entityExpansionCount=0,this.currentExpandedLength=0;var i=_object_spread({},iJ);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(_type_of(this.options.htmlEntities)=="object"?i=this.options.htmlEntities:this.options.htmlEntities===!0&&(i=_object_spread({},$Re,ORe)),this.entityDecoder=new n7({namedEntities:_object_spread({},i,r),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new lb,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new qM;var o=this.options.stopNodes;if(o&&o.length>0){for(var a=0;a<o.length;a++){var s=o[a];typeof s=="string"?this.stopNodeExpressionsSet.add(new am(s)):_instanceof(s,am)&&this.stopNodeExpressionsSet.add(s)}this.stopNodeExpressionsSet.seal()}};function zRe(e,t,r,n,i,o,a){var s=this.options;if(e!==void 0&&(s.trimValues&&!n&&(e=e.trim()),e.length>0)){a||(e=this.replaceEntitiesValue(e,t,r));var l=s.jPath?r.toString():r,c=s.tagValueProcessor(t,e,l,i,o);return c==null?e:(typeof c==="undefined"?"undefined":_type_of(c))!=(typeof e==="undefined"?"undefined":_type_of(e))||c!==e?c:s.trimValues||e.trim()===e?oJ(e,s.parseTagValue,s.numberParseOptions):e}}function jRe(e){if(this.options.removeNSPrefix){var t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var URe=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function BRe(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=this.options;if(n===!0||i.ignoreAttributes!==!0&&typeof e=="string"){var o=eJ(e,URe),a=o.length,s={},l=new Array(a),c=!1,d={};for(var m=0;m<a;m++){var h=this.resolveNameSpace(o[m][1]),g=o[m][4];if(h.length&&g!==void 0){var x=g;i.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x,r,this.readonlyMatcher),l[m]=x,d[h]=x,c=!0}}c&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&t.updateCurrent&&t.updateCurrent(d);var u=i.jPath?t.toString():this.readonlyMatcher,p=!1;for(var m10=0;m10<a;m10++){var h10=this.resolveNameSpace(o[m10][1]);if(this.ignoreAttributesFn(h10,u))continue;var g10=i.attributeNamePrefix+h10;if(h10.length)if(i.transformAttributeName&&(g10=i.transformAttributeName(g10)),g10=aJ(g10,i),o[m10][4]!==void 0){var x10=l[m10],v=i.attributeValueProcessor(h10,x10,u);s[g10]=v==null?x10:(typeof v==="undefined"?"undefined":_type_of(v))!=(typeof x10==="undefined"?"undefined":_type_of(x10))||v!==x10?v:oJ(x10,i.parseAttributeValue,i.numberParseOptions),p=!0}else i.allowBooleanAttributes&&(s[g10]=!0,p=!0)}if(!p)return;if(i.attributesGroupName&&!i.preserveOrder){var m11={};return m11[i.attributesGroupName]=s,m11}return s}}var qRe=function qRe1(e){e=e.replace(/\r\n?/g,"\n");var t=new vd("!xml"),r=t,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;var i=this.options,o=new UM(i.processEntities),a=e.length;for(var s=0;s<a;s++)if(e[s]==="<"){var l=e.charCodeAt(s+1);if(l===47){var c=H1(e,">",s,"Closing Tag is not closed."),d=e.substring(s+2,c).trim();if(i.removeNSPrefix){var p=d.indexOf(":");p!==-1&&(d=d.substr(p+1))}d=CM(i.transformTagName,d,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));var u=this.matcher.getCurrentTag();if(d&&i.unpairedTagsSet.has(d))throw new Error("Unpaired tag can not be used as closing tag: </".concat(d,">"));u&&i.unpairedTagsSet.has(u)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",s=c}else if(l===63){var c10=VM(e,s,!1,"?>");if(!c10)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var d10=this.buildAttributesMap(c10.tagExp,this.matcher,c10.tagName,!0);if(d10){var u10=d10[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(u10)||1)}if(!(i.ignoreDeclaration&&c10.tagName==="?xml"||i.ignorePiTags)){var u11=new vd(c10.tagName);u11.add(i.textNodeName,""),c10.tagName!==c10.tagExp&&c10.attrExpPresent&&i.ignoreAttributes!==!0&&(u11[":@"]=d10),this.addChild(r,u11,this.readonlyMatcher,s)}s=c10.closeIndex+1}else if(l===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){var c11=H1(e,"-->",s+4,"Comment is not closed.");if(i.commentPropName){var d11=e.substring(s+4,c11-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[_define_property({},i.textNodeName,d11)])}s=c11}else if(l===33&&e.charCodeAt(s+2)===68){var c12=o.readDocType(e,s);this.entityDecoder.addInputEntities(c12.entities),s=c12.i}else if(l===33&&e.charCodeAt(s+2)===91){var c13=H1(e,"]]>",s,"CDATA is not closed.")-2,d12=e.substring(s+9,c13);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var u12=this.parseTextData(d12,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);u12==null&&(u12=""),i.cdataPropName?r.add(i.cdataPropName,[_define_property({},i.textNodeName,d12)]):r.add(i.textNodeName,u12),s=c13+2}else{var c14=VM(e,s,i.removeNSPrefix);if(!c14){var w=e.substring(Math.max(0,s-50),Math.min(a,s+50));throw new Error("readTagExp returned undefined at position ".concat(s,'. Context: "').concat(w,'"'))}var d13=c14.tagName,u13=c14.rawTagName,p10=c14.tagExp,m=c14.attrExpPresent,h=c14.closeIndex;var ref;if(ref=CM(i.transformTagName,d13,p10,i),d13=ref.tagName,p10=ref.tagExp,ref,i.strictReservedNames&&(d13===i.commentPropName||d13===i.cdataPropName||d13===i.textNodeName||d13===i.attributesGroupName))throw new Error("Invalid tag name: ".concat(d13));r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));var g=r;g&&i.unpairedTagsSet.has(g.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var x=!1;p10.length>0&&p10.lastIndexOf("/")===p10.length-1&&(x=!0,d13[d13.length-1]==="/"?(d13=d13.substr(0,d13.length-1),p10=d13):p10=p10.substr(0,p10.length-1),m=d13!==p10);var v=void 0,y=null,_={};v=FRe(u13),d13!==t.tagname&&this.matcher.push(d13,{},v),d13!==p10&&m&&(y=this.buildAttributesMap(p10,this.matcher,d13),y&&(_=LRe(y,i))),d13!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var b=s;if(this.isCurrentNodeStopNode){var w10="";if(x)s=c14.closeIndex;else if(i.unpairedTagsSet.has(d13))s=c14.closeIndex;else{var k=this.readStopNodeData(e,u13,h+1);if(!k)throw new Error("Unexpected end of ".concat(u13));s=k.i,w10=k.tagContent}var S=new vd(d13);y&&(S[":@"]=y),S.add(i.textNodeName,w10),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,S,this.readonlyMatcher,b)}else{if(x){var ref1;ref1=CM(i.transformTagName,d13,p10,i),d13=ref1.tagName,p10=ref1.tagExp,ref1;var w11=new vd(d13);y&&(w11[":@"]=y),this.addChild(r,w11,this.readonlyMatcher,b),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(i.unpairedTagsSet.has(d13)){var w12=new vd(d13);y&&(w12[":@"]=y),this.addChild(r,w12,this.readonlyMatcher,b),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=c14.closeIndex;continue}{var w13=new vd(d13);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),y&&(w13[":@"]=y),this.addChild(r,w13,this.readonlyMatcher,b),r=w13}}n="",s=h}}}else n+=e[s];return t.child};function WRe(e,t,r,n){this.options.captureMetaData||(n=void 0);var i=this.options.jPath?r.toString():r,o=this.options.updateTag(t.tagname,i,t[":@"]);o===!1||(typeof o=="string"&&(t.tagname=o),e.addChild(t,n))}function VRe(e,t,r){var n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){var i=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,i)))return e}if(n.tagFilter){var i10=this.options.jPath?r.toString():r;if(!n.tagFilter(t,i10))return e}return this.entityDecoder.decode(e)}function GRe(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),(e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&Object.keys(t[":@"]).length!==0,n))!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function HRe(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function H1(e,t,r,n){var i=e.indexOf(t,r);if(i===-1)throw new Error(n);return i+t.length-1}function ZRe(e,t,r,n){var i=e.indexOf(t,r);if(i===-1)throw new Error(n);return i}function VM(e,t,r){var n=function(d,u){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",m=0,h=d.length,g=p.charCodeAt(0),x=p.length>1?p.charCodeAt(1):-1,v="",y=u;for(var _=u;_<h;_++){var b=d.charCodeAt(_);if(m)b===m&&(m=0);else if(b===34||b===39)m=b;else if(b===g){if(x===-1)return v+=d.substring(y,_),{data:v,index:_};if(d.charCodeAt(_+1)===x)return v+=d.substring(y,_),{data:v,index:_}}else b!==9||m||(v+=d.substring(y,_)+" ",y=_+1)}}(e,t+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!n)return;var i=n.data,o=n.index,a=i.search(/\s/),s=i,l=!0;a!==-1&&(s=i.substring(0,a),i=i.substring(a+1).trimStart());var c=s;if(r){var d=s.indexOf(":");d!==-1&&(s=s.substr(d+1),l=s!==n.data.substr(d+1))}return{tagName:s,tagExp:i,closeIndex:o,attrExpPresent:l,rawTagName:c}}function KRe(e,t,r){var n=r,i=1,o=e.length;for(;r<o;r++)if(e[r]==="<"){var a=e.charCodeAt(r+1);if(a===47){var s=ZRe(e,">",r,"".concat(t," is not closed"));if(e.substring(r+2,s).trim()===t&&(i--,i===0))return{tagContent:e.substring(n,r),i:s};r=s}else if(a===63)r=H1(e,"?>",r+1,"StopNode is not closed.");else if(a===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=H1(e,"-->",r+3,"StopNode is not closed.");else if(a===33&&e.charCodeAt(r+2)===91)r=H1(e,"]]>",r,"StopNode is not closed.")-2;else{var s10=VM(e,r,">");s10&&((s10&&s10.tagName)===t&&s10.tagExp[s10.tagExp.length-1]!=="/"&&i++,r=s10.closeIndex)}}}function oJ(e,t,r){if(t&&typeof e=="string"){var n=e.trim();return n==="true"||n!=="false"&&function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(o=Object.assign({},RRe,o),!i||typeof i!="string")return i;var a=i.trim();if(a.length===0||o.skipLike!==void 0&&o.skipLike.test(a))return i;if(a==="0")return 0;if(o.hex&&IRe.test(a))return function(l){if(parseInt)return parseInt(l,16);if(Number.parseInt)return Number.parseInt(l,16);if(window&&window.parseInt)return window.parseInt(l,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(a);if(isFinite(a)){if(a.includes("e")||a.includes("E"))return function(l,c,d){if(!d.eNotation)return l;var u=c.match(MRe);if(u){var p=u[1]||"",m=u[3].indexOf("e")===-1?"E":"e",h=u[2],g=p?l[h.length+1]===m:l[h.length]===m;return h.length>1&&g?l:(h.length!==1||!u[3].startsWith(".".concat(m))&&u[3][0]!==m)&&h.length>0?d.leadingZeros&&!g?(c=(u[1]||"")+u[3],Number(c)):l:Number(c)}return l}(i,a,o);{var l=PRe.exec(a);if(l){var c=l[1]||"",d=l[2],u=((s=l[3])&&s.indexOf(".")!==-1&&((s=s.replace(/0+$/,""))==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substring(0,s.length-1))),s),p=c?i[d.length+1]===".":i[d.length]===".";if(!o.leadingZeros&&(d.length>1||d.length===1&&!p))return i;{var m=Number(a),h=String(m);if(m===0)return m;if(h.search(/[eE]/)!==-1)return o.eNotation?m:i;if(a.indexOf(".")!==-1)return h==="0"||h===u||h==="".concat(c).concat(u)?m:i;var g=d?u:a;return d?g===h||c+g===h?m:i:g===h||g===c+h?m:i}}return i}}var s;return function(l,c,d){var u=c===1/0;switch(d.infinity.toLowerCase()){case"null":return null;case"infinity":return c;case"string":return u?"Infinity":"-Infinity";default:return l}}(i,Number(a),o)}(e,r)}return e!==void 0?e:""}function CM(e,t,r,n){if(e){var i=e(t);r===t&&(r=i),t=i}return{tagName:t=aJ(t,n),tagExp:r}}function aJ(e,t){if(tJ.includes(e))throw new Error('[SECURITY] Invalid name: "'.concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'));return XM.includes(e)?t.onDangerousProperty(e):e}var EM=vd.getMetaDataSymbol();function QRe(e,t){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return{};if(!t)return e;var r={};for(var n in e)n.startsWith(t)?r[n.substring(t.length)]=e[n]:r[n]=e[n];return r}function JRe(e,t,r,n){return sJ(e,t,r,n)}function sJ(e,t,r,n){var i,o={};for(var a=0;a<e.length;a++){var s=e[a],l=YRe(s);if(l!==void 0&&l!==t.textNodeName){var c=QRe(s[":@"]||{},t.attributeNamePrefix);r.push(l,c)}if(l===t.textNodeName)i===void 0?i=s[l]:i+=""+s[l];else{if(l===void 0)continue;if(s[l]){var c10=sJ(s[l],t,r,n),d=eMe(c10,t);if(s[":@"]?XRe(c10,s[":@"],n,t):Object.keys(c10).length!==1||c10[t.textNodeName]===void 0||t.alwaysCreateTextNode?Object.keys(c10).length===0&&(t.alwaysCreateTextNode?c10[t.textNodeName]="":c10=""):c10=c10[t.textNodeName],s[EM]!==void 0&&(typeof c10==="undefined"?"undefined":_type_of(c10))=="object"&&c10!==null&&(c10[EM]=s[EM]),o[l]!==void 0&&Object.prototype.hasOwnProperty.call(o,l))Array.isArray(o[l])||(o[l]=[o[l]]),o[l].push(c10);else{var u=t.jPath?n.toString():n;t.isArray(l,u,d)?o[l]=[c10]:o[l]=c10}l!==void 0&&l!==t.textNodeName&&r.pop()}}}return typeof i=="string"?i.length>0&&(o[t.textNodeName]=i):i!==void 0&&(o[t.textNodeName]=i),o}function YRe(e){var t=Object.keys(e);for(var r=0;r<t.length;r++){var n=t[r];if(n!==":@")return n}}function XRe(e,t,r,n){if(t){var i=Object.keys(t),o=i.length;for(var a=0;a<o;a++){var s=i[a],l=s.startsWith(n.attributeNamePrefix)?s.substring(n.attributeNamePrefix.length):s,c=n.jPath?r.toString()+"."+l:r;n.isArray(s,c,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function eMe(e,t){var r=t.textNodeName,n=Object.keys(e).length;return n===0||!(n!==1||!e[r]&&typeof e[r]!="boolean"&&e[r]!==0)}var tMe={allowBooleanAttributes:!1,unpairedTags:[]};function kQ(e){return e===" "||e===" "||e==="\n"||e==="\r"}function CQ(e,t){var r=t;for(;t<e.length;t++)if(!(e[t]!="?"&&e[t]!=" ")){var n=e.substr(r,t-r);if(t>5&&n==="xml")return oo("InvalidXml","XML declaration allowed only at the start of the document.",ms(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}}return t}function EQ(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){var r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}function rMe(e,t){var r="",n="",i=!1;for(;t<e.length;t++){if(e[t]==='"'||e[t]==="'")n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){i=!0;break}r+=e[t]}return n===""&&{value:r,index:t,tagClosed:i}}var nMe=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function TQ(e,t){var r=eJ(e,nMe),n={};for(var i=0;i<r.length;i++){if(r[i][1].length===0)return oo("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",nb(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return oo("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",nb(r[i]));if(r[i][3]===void 0&&!t.allowBooleanAttributes)return oo("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",nb(r[i]));var o=r[i][2];if(!oMe(o))return oo("InvalidAttr","Attribute '"+o+"' is an invalid name.",nb(r[i]));if(Object.prototype.hasOwnProperty.call(n,o))return oo("InvalidAttr","Attribute '"+o+"' is repeated.",nb(r[i]));n[o]=1}return!0}function iMe(e,t){if(e[++t]===";")return-1;if(e[t]==="#")return function(n,i){var o=/\d/;for(n[i]==="x"&&(i++,o=/[\da-fA-F]/);i<n.length;i++){if(n[i]===";")return i;if(!n[i].match(o))break}return-1}(e,++t);var r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function oo(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function oMe(e){return m7(e)}function ms(e,t){var r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function nb(e){return e.startIndex+e[1].length}var i7=/*#__PURE__*/function(){"use strict";function i71(t){_class_call_check(this,i71);this.externalEntities={},this.options=ARe(t)}_create_class(i71,[{key:"parse",value:function parse(t,r){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});var o=function(a,s){s=Object.assign({},tMe,s);var l=[],c=!1,d=!1;a[0]==="\uFEFF"&&(a=a.substr(1));for(var u=0;u<a.length;u++)if(a[u]==="<"&&a[u+1]==="?"){if(u+=2,u=CQ(a,u),u.err)return u}else{if(a[u]!=="<"){if(kQ(a[u]))continue;return oo("InvalidChar","char '"+a[u]+"' is not expected.",ms(a,u))}{var p=u;if(u++,a[u]==="!"){u=EQ(a,u);continue}{var m=!1;a[u]==="/"&&(m=!0,u++);var h="";for(;u<a.length&&a[u]!==">"&&a[u]!==" "&&a[u]!==" "&&a[u]!=="\n"&&a[u]!=="\r";u++)h+=a[u];if(h=h.trim(),h[h.length-1]==="/"&&(h=h.substring(0,h.length-1),u--),!m7(h)){var v=void 0;return v=h.trim().length===0?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",oo("InvalidTag",v,ms(a,u))}var g=rMe(a,u);if(g===!1)return oo("InvalidAttr","Attributes for '"+h+"' have open quote.",ms(a,u));var x=g.value;if(u=g.index,x[x.length-1]==="/"){var v10=u-x.length;x=x.substring(0,x.length-1);var y=TQ(x,s);if(y!==!0)return oo(y.err.code,y.err.msg,ms(a,v10+y.err.line));c=!0}else if(m){if(!g.tagClosed)return oo("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",ms(a,u));if(x.trim().length>0)return oo("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",ms(a,p));if(l.length===0)return oo("InvalidTag","Closing tag '"+h+"' has not been opened.",ms(a,p));{var v11=l.pop();if(h!==v11.tagName){var y10=ms(a,v11.tagStartPos);return oo("InvalidTag","Expected closing tag '"+v11.tagName+"' (opened in line "+y10.line+", col "+y10.col+") instead of closing tag '"+h+"'.",ms(a,p))}l.length==0&&(d=!0)}}else{var v12=TQ(x,s);if(v12!==!0)return oo(v12.err.code,v12.err.msg,ms(a,u-x.length+v12.err.line));if(d===!0)return oo("InvalidXml","Multiple possible root nodes found.",ms(a,u));s.unpairedTags.indexOf(h)!==-1||l.push({tagName:h,tagStartPos:p}),c=!0}for(u++;u<a.length;u++)if(a[u]==="<"){if(a[u+1]==="!"){u++,u=EQ(a,u);continue}if(a[u+1]!=="?")break;if(u=CQ(a,++u),u.err)return u}else if(a[u]==="&"){var v13=iMe(a,u);if(v13==-1)return oo("InvalidChar","char '&' is not expected.",ms(a,u));u=v13}else if(d===!0&&!kQ(a[u]))return oo("InvalidXml","Extra text at the end",ms(a,u));a[u]==="<"&&u--}}}return c?l.length==1?oo("InvalidTag","Unclosed tag '"+l[0].tagName+"'.",ms(a,l[0].tagStartPos)):!(l.length>0)||oo("InvalidXml","Invalid '"+JSON.stringify(l.map(function(u){return u.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):oo("InvalidXml","Start tag expected.",1)}(t,r);if(o!==!0)throw Error("".concat(o.err.msg,":").concat(o.err.line,":").concat(o.err.col))}var n=new WM(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||i===void 0?i:JRe(i,this.options,n.matcher,n.readonlyMatcher)}},{key:"addEntity",value:function addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}}],[{key:"getMetaDataSymbol",value:function getMetaDataSymbol(){return vd.getMetaDataSymbol()}}]);return i71}(),aMe=wi(829),Mp=wi.n(aMe),V1=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(V1||{});function AQ(e){return typeof e=="string"?e:e.toString(".",!1)}function lJ(e,t){if(!e.endsWith("propstat.prop.displayname"))return t}function Kk(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V1.Original,n=Mp().get(e,t);return r==="array"&&Array.isArray(n)===!1?[n]:r==="object"&&Array.isArray(n)?n[0]:n}function h7(e,t){return t=t!=null?t:{attributeNamePrefix:"@",attributeParsers:[],tagParsers:[lJ]},new Promise(function(r){r(function(n){var i=n.multistatus;if(i==="")return{multistatus:{response:[]}};if(!i)throw new Error("Invalid response: No root multistatus found");var o={multistatus:Array.isArray(i)?i[0]:i};return Mp().set(o,"multistatus.response",Kk(o,"multistatus.response",V1.Array)),Mp().set(o,"multistatus.response",Mp().get(o,"multistatus.response").map(function(a){return function(s){var l=Object.assign({},s);return l.status?Mp().set(l,"status",Kk(l,"status",V1.Object)):(Mp().set(l,"propstat",Kk(l,"propstat",V1.Object)),Mp().set(l,"propstat.prop",Kk(l,"propstat.prop",V1.Object))),l}(a)})),o}((function(n){var c,d,u,p;var i=n.attributeNamePrefix,o=n.attributeParsers,a=n.entityDecoder,s=n.tagParsers,l={allowBooleanAttributes:!0,attributeNamePrefix:i,textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,jPath:!1,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:function attributeValueProcessor(m,h,g){var x=AQ(g);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;try{var y=v(x,h);if(y!==h)return y}catch(y){}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return h},tagValueProcessor:function tagValueProcessor(m,h,g){var x=AQ(g);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;try{var y=v(x,h);if(y!==h)return y}catch(y){}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return h}};return a&&(l.entityDecoder=new n7({limit:{maxTotalExpansions:(d=(c=a.limit)==null?void 0:c.maxTotalExpansions)!=null?d:0,maxExpandedLength:(p=(u=a.limit)==null?void 0:u.maxExpandedLength)!=null?p:0}})),new i7(l)})(t).parse(e)))})}function eO(e,t){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],tmp=e.getlastmodified,n=tmp===void 0?null:tmp,tmp1=e.getcontentlength,i=tmp1===void 0?"0":tmp1,tmp2=e.resourcetype,o=tmp2===void 0?null:tmp2,tmp3=e.getcontenttype,a=tmp3===void 0?null:tmp3,tmp4=e.getetag,s=tmp4===void 0?null:tmp4,l=o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&o.collection!==void 0?"directory":"file",c={filename:t,basename:Xk().basename(t),lastmod:n,size:parseInt(i,10),type:l,etag:typeof s=="string"?s.replace(/"/g,""):null};return l==="file"&&(c.mime=a&&typeof a=="string"?a.split(";")[0]:""),r&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),c.props=e),c}function sMe(e,t){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=null;try{e.multistatus.response[0].propstat&&(n=e.multistatus.response[0])}catch(d){}if(!n)throw new Error("Failed getting item stat: bad response");var _n_propstat=n.propstat,i=_n_propstat.prop,o=_n_propstat.status,_o_split=_sliced_to_array(o.split(" ",3),3),a=_o_split[0],s=_o_split[1],l=_o_split[2],c=parseInt(s,10);if(c>=400){var d=new Error("Invalid response: ".concat(c," ").concat(l));throw d.status=c,d}return eO(i,ab(t),r)}function lMe(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function TM(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var tO=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},tmp=r.details,n=tmp===void 0?!1:tmp,i=Ho({url:ji(e.remoteURL,zi(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,r);return TM(Go(i,e),function(o){return Zo(e,o),TM(o.text(),function(a){return TM(h7(a,e.parsing),function(s){var l=sMe(s,t,n);return X1(o,l,n)})})})});function uJ(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var uMe=cJ(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=function(o){if(!o||o==="/")return[];var a=o,s=[];do s.push(a),a=Xk().dirname(a);while(a&&a!=="/");return s}(ab(t));n.sort(function(o,a){return o.length>a.length?1:a.length>o.length?-1:0});var i=!1;return function(o,a,s){if(typeof o[PQ]=="function"){var g=function g10(x){try{for(;!(l=u.next()).done;)if((x=a(l.value))&&x.then){if(!RQ(x))return void x.then(g,d||(d=hs.bind(null,c=new G1,2)));x=x.v}c?hs(c,1,x):c=x}catch(v){hs(c||(c=new G1),2,v)}};var l,c,d,u=o[PQ]();if(g(),u.return){var p=function p(x){try{l.done||u.return()}catch(v){}return x};if(c&&c.then)return c.then(p,function(x){throw p(x)});p()}return c}if(!("length"in o))throw new TypeError("Object is not iterable");for(var m=[],h=0;h<o.length;h++)m.push(o[h]);return function(g,x,v){var y,_,b=-1;return function w(S){try{for(;++b<g.length&&(!v||!v());)if((S=x(b))&&S.then){if(!RQ(S))return void S.then(w,_||(_=hs.bind(null,y=new G1,2)));S=S.v}y?hs(y,1,S):y=S}catch(k){hs(y||(y=new G1),2,k)}}(),y}(m,function(g){return a(m[g])},s)}(n,function(o){return a=function a(){return function(l,c){try{var d=uJ(tO(e,o),function(u){if(u.type!=="directory")throw new Error("Path includes a file: ".concat(t))})}catch(u){return c(u)}return d&&d.then?d.then(void 0,c):d}(0,function(l){var c=l;return function(){if(c.status===404)return i=!0,IQ(GM(e,o,_object_spread_props(_object_spread({},r),{recursive:!1})));throw l}()})},(s=function(){if(i)return IQ(GM(e,o,_object_spread_props(_object_spread({},r),{recursive:!1})))}())&&s.then?s.then(a):a();var a,s},function(){return!1})});function cJ(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}function cMe(){}function IQ(e,t){if(!t)return e&&e.then?e.then(cMe):Promise.resolve()}var PQ=typeof Symbol!="undefined"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function hs(e,t,r){if(!e.s){if(_instanceof(r,G1)){if(!r.s)return void(r.o=hs.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(hs.bind(null,e,t),hs.bind(null,e,2));e.s=t,e.v=r;var n=e.o;n&&n(e)}}var G1=function(){function e(){}return e.prototype.then=function(t,r){var n=new e,i=this.s;if(i){var o=1&i?t:r;if(o){try{hs(n,1,o(this.v))}catch(a){hs(n,2,a)}return n}return this}return this.o=function(o){try{var _$a=o.v;1&o.s?hs(n,1,t?t(_$a):_$a):r?hs(n,1,r(_$a)):hs(n,2,_$a)}catch(a){hs(n,2,a)}},n},e}();function RQ(e){return _instanceof(e,G1)&&1&e.s}var GM=cJ(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r.recursive===!0)return uMe(e,t,r);var n=Ho({url:ji(e.remoteURL,(i=zi(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,r);var i;return uJ(Go(n,e),function(o){Zo(e,o)})}),dMe=wi(388),MQ=wi.n(dMe),pMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n={};if(_type_of(r.range)=="object"&&typeof r.range.start=="number"){var s="bytes=".concat(r.range.start,"-");typeof r.range.end=="number"&&(s="".concat(s).concat(r.range.end)),n.Range=s}var i=Ho({url:ji(e.remoteURL,zi(t)),method:"GET",headers:n},e,r);return a=function a(s){if(Zo(e,s),n.Range&&s.status!==206){var l=new Error("Invalid response code for partial request: ".concat(s.status));throw l.status=s.status,l}return r.callback&&setTimeout(function(){r.callback(s)},0),s.body},(o=Go(i,e))&&o.then||(o=Promise.resolve(o)),a?o.then(a):o;var o,a}),fMe=function(){},mMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){r.url||(r.url=ji(e.remoteURL,zi(t)));var n=Ho(r,e,{});return o=function o(a){return Zo(e,a),a},(i=Go(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}),hMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Ho({url:ji(e.remoteURL,zi(t)),method:"DELETE"},e,r);return o=function o(a){Zo(e,a)},(i=Go(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}),gMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(n,i){try{var o=(a=tO(e,t,r),s=function s(){return!0},l?s?s(a):a:(a&&a.then||(a=Promise.resolve(a)),s?a.then(s):a))}catch(c){return i(c)}var a,s,l;return o&&o.then?o.then(void 0,i):o}(0,function(n){if(n.status===404)return!1;throw n})});function AM(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var xMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Ho({url:ji(e.remoteURL,zi(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:r.deep?"infinity":"1"}},e,r);return AM(Go(n,e),function(i){return Zo(e,i),AM(i.text(),function(o){if(!o)throw new Error("Failed parsing directory contents: Empty response");return AM(h7(o,e.parsing),function(a){var s=uQ(t),l=function(c,d,u){var p=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4],h=Xk().join(d,"/"),_c_multistatus=c.multistatus,g=_c_multistatus.response,x=g.map(function(v){var y=function(b){try{return b.replace(/^https?:\/\/[^\/]+/,"")}catch(w){throw new Aa(w,"Failed normalising HREF")}}(v.href),_v_propstat=v.propstat,_=_v_propstat.prop;return eO(_,h==="/"?decodeURIComponent(ab(y)):ab(Xk().relative(decodeURIComponent(h),decodeURIComponent(y))),p)});return m?x:x.filter(function(v){return v.basename&&(v.type==="file"||v.filename!==u.replace(/\/$/,""))})}(a,uQ(e.remoteBasePath||e.remotePath),s,r.details,r.includeSelf);return r.glob&&(l=function(c,d){return c.filter(function(u){return Za(u.filename,d,{matchBase:!0})})}(l,r.glob)),X1(i,l,r.details)})})})});function rO(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}var yMe=rO(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Ho({url:ji(e.remoteURL,zi(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[bMe]},e,r);return o7(Go(n,e),function(i){return Zo(e,i),o7(i.text(),function(o){return X1(i,o,r.details)})})});function o7(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var vMe=rO(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Ho({url:ji(e.remoteURL,zi(t)),method:"GET"},e,r);return o7(Go(n,e),function(i){var o;return Zo(e,i),function(a,s){var l=a();return l&&l.then?l.then(s):s()}(function(){return o7(i.arrayBuffer(),function(a){o=a})},function(){return X1(i,o,r.details)})})}),_Me=rO(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},tmp=r.format,n=tmp===void 0?"binary":tmp;if(n!=="binary"&&n!=="text")throw new Aa({info:{code:om.InvalidOutputFormat}},"Invalid output format: ".concat(n));return n==="text"?yMe(e,t,r):vMe(e,t,r)}),bMe=function(e){return e};function wMe(e,t){var r="";t.format&&t.indentBy.length>0&&(r="\n");var n=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(var i=0;i<t.stopNodes.length;i++){var o=t.stopNodes[i];typeof o=="string"?n.push(new am(o)):_instanceof(o,am)&&n.push(o)}return dJ(e,t,r,new lb,n)}function dJ(e,t,r,n,i){var o="",a=!1;if(t.maxNestedTags&&n.getDepth()>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(e)){if(e!=null){var s=e.toString();return s=HM(s,t),s}return""}for(var s10=0;s10<e.length;s10++){var l=e[s10],c=fJ(l);if(c===void 0)continue;var d=SMe(l[":@"],t);n.push(c,d);var u=CMe(n,i);if(c===t.textNodeName){var g=l[c];u||(g=t.tagValueProcessor(c,g),g=HM(g,t)),a&&(o+=r),o+=g,a=!1,n.pop();continue}if(c===t.cdataPropName){a&&(o+=r);var g10=l[c][0][t.textNodeName];o+="<![CDATA[".concat(String(g10).replace(/\]\]>/g,"]]]]><![CDATA[>"),"]]>"),a=!1,n.pop();continue}if(c===t.commentPropName){var g11=l[c][0][t.textNodeName];o+=r+"<!--".concat(String(g11).replace(/--/g,"- -").replace(/-$/,"- "),"-->"),a=!0,n.pop();continue}if(c[0]==="?"){var g12=OQ(l[":@"],t,u),x=c==="?xml"?"":r,v=l[c][0][t.textNodeName];v=v.length!==0?" "+v:"",o+=x+"<".concat(c).concat(v).concat(g12,"?>"),a=!0,n.pop();continue}var p=r;p!==""&&(p+=t.indentBy);var m=r+"<".concat(c).concat(OQ(l[":@"],t,u)),h=void 0;h=u?pJ(l[c],t):dJ(l[c],t,p,n,i),t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?o+=m+">":o+=m+"/>":h&&h.length!==0||!t.suppressEmptyNode?h&&h.endsWith(">")?o+=m+">".concat(h).concat(r,"</").concat(c,">"):(o+=m+">",h&&r!==""&&(h.includes("/>")||h.includes("</"))?o+=r+t.indentBy+h+r:o+=h,o+="</".concat(c,">")):o+=m+"/>",a=!0,n.pop()}return o}function SMe(e,t){if(!e||t.ignoreAttributes)return null;var r={},n=!1;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i]=e[i],n=!0);return n?r:null}function pJ(e,t){if(!Array.isArray(e))return e!=null?e.toString():"";var r="";for(var n=0;n<e.length;n++){var i=e[n],o=fJ(i);if(o===t.textNodeName)r+=i[o];else if(o===t.cdataPropName)r+=i[o][0][t.textNodeName];else if(o===t.commentPropName)r+=i[o][0][t.textNodeName];else{if(o&&o[0]==="?")continue;if(o){var a=kMe(i[":@"],t),s=pJ(i[o],t);s&&s.length!==0?r+="<".concat(o).concat(a,">").concat(s,"</").concat(o,">"):r+="<".concat(o).concat(a,"/>")}}}return r}function kMe(e,t){var r="";if(e&&!t.ignoreAttributes)for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;var i=e[n];i===!0&&t.suppressBooleanAttributes?r+=" ".concat(n.substr(t.attributeNamePrefix.length)):r+=" ".concat(n.substr(t.attributeNamePrefix.length),'="').concat(i,'"')}return r}function fJ(e){var t=Object.keys(e);for(var r=0;r<t.length;r++){var n=t[r];if(Object.prototype.hasOwnProperty.call(e,n)&&n!==":@")return n}}function OQ(e,t,r){var n="";if(e&&!t.ignoreAttributes)for(var i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;var o=void 0;r?o=e[i]:(o=t.attributeValueProcessor(i,e[i]),o=HM(o,t)),o===!0&&t.suppressBooleanAttributes?n+=" ".concat(i.substr(t.attributeNamePrefix.length)):n+=" ".concat(i.substr(t.attributeNamePrefix.length),'="').concat(o,'"')}return n}function CMe(e,t){if(!t||t.length===0)return!1;for(var r=0;r<t.length;r++)if(e.matches(t[r]))return!0;return!1}function HM(e,t){if(e&&e.length>0&&t.processEntities)for(var r=0;r<t.entities.length;r++){var n=t.entities[r];e=e.replace(n.regex,n.val)}return e}var EMe={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function tagValueProcessor(e,t){return t},attributeValueProcessor:function attributeValueProcessor(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function wu(e){if(this.options=Object.assign({},EMe,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(function(r){return typeof r=="string"&&r.startsWith("*.")?".."+r.substring(2):r})),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(var r=0;r<this.options.stopNodes.length;r++){var n=this.options.stopNodes[r];typeof n=="string"?this.stopNodeExpressions.push(new am(n)):_instanceof(n,am)&&this.stopNodeExpressions.push(n)}var t;this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=typeof(t=this.options.ignoreAttributes)=="function"?t:Array.isArray(t)?function(r){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(typeof n=="string"&&r===n||_instanceof(n,RegExp)&&n.test(r))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}:function(){return!1},this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=IMe),this.processTextOrObjNode=TMe,this.options.format?(this.indentate=AMe,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function TMe(e,t,r,n){var i=this.extractAttributes(e);if(n.push(t,i),this.checkStopNode(n)){var a=this.buildRawContent(e),s=this.buildAttributesForStopNode(e);return n.pop(),this.buildObjectNode(a,t,s,r)}var o=this.j2x(e,r+1,n);return n.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,o.attrStr,r,n):this.buildObjectNode(o.val,t,o.attrStr,r)}function AMe(e){return this.options.indentBy.repeat(e)}function IMe(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}wu.prototype.build=function(e){if(this.options.preserveOrder)return wMe(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=_define_property({},this.options.arrayNodeName,e));var t=new lb;return this.j2x(e,0,t).val}},wu.prototype.j2x=function(e,t,r){var n="",i="";if(this.options.maxNestedTags&&r.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");var o=this.options.jPath?r.toString():r,a=this.checkStopNode(r);for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+="");else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+="":s[0]==="?"?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(_instanceof(e[s],Date))i+=this.buildTextValNode(e[s],s,"",t,r);else if(_type_of(e[s])!="object"){var l=this.isAttribute(s);if(l&&!this.ignoreAttributesFn(l,o))n+=this.buildAttrPairStr(l,""+e[s],a);else if(!l)if(s===this.options.textNodeName){var c=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(c)}else{r.push(s);var c10=this.checkStopNode(r);if(r.pop(),c10){var d=""+e[s];i+=d===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+d+"</"+s+this.tagEndChar}else i+=this.buildTextValNode(e[s],s,"",t,r)}}else if(Array.isArray(e[s])){var l10=e[s].length,c11="",d10="";for(var u=0;u<l10;u++){var p=e[s][u];if(p!==void 0)if(p===null)s[0]==="?"?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if((typeof p==="undefined"?"undefined":_type_of(p))=="object")if(this.options.oneListGroup){r.push(s);var m=this.j2x(p,t+1,r);r.pop(),c11+=m.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(d10+=m.attrStr)}else c11+=this.processTextOrObjNode(p,s,t,r);else if(this.options.oneListGroup){var m10=this.options.tagValueProcessor(s,p);m10=this.replaceEntitiesValue(m10),c11+=m10}else{r.push(s);var m11=this.checkStopNode(r);if(r.pop(),m11){var h=""+p;c11+=h===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+h+"</"+s+this.tagEndChar}else c11+=this.buildTextValNode(p,s,"",t,r)}}this.options.oneListGroup&&(c11=this.buildObjectNode(c11,s,d10,t)),i+=c11}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){var l11=Object.keys(e[s]),c12=l11.length;for(var d11=0;d11<c12;d11++)n+=this.buildAttrPairStr(l11[d11],""+e[s][l11[d11]],a)}else i+=this.processTextOrObjNode(e[s],s,t,r);return{attrStr:n,val:i}},wu.prototype.buildAttrPairStr=function(e,t,r){return r||(t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'},wu.prototype.extractAttributes=function(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return null;var t={},r=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){var n=e[this.options.attributesGroupName];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i.startsWith(this.options.attributeNamePrefix)?i.substring(this.options.attributeNamePrefix.length):i]=n[i],r=!0)}else for(var n10 in e){if(!Object.prototype.hasOwnProperty.call(e,n10))continue;var i10=this.isAttribute(n10);i10&&(t[i10]=e[n10],r=!0)}return r?t:null},wu.prototype.buildRawContent=function(e){if(typeof e=="string")return e;if((typeof e==="undefined"?"undefined":_type_of(e))!="object"||e===null)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];var t="";for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||this.isAttribute(r)||this.options.attributesGroupName&&r===this.options.attributesGroupName)continue;var n=e[r];if(r===this.options.textNodeName)t+=n;else if(Array.isArray(n)){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(typeof i=="string"||typeof i=="number")t+="<".concat(r,">").concat(i,"</").concat(r,">");else if((typeof i==="undefined"?"undefined":_type_of(i))=="object"&&i!==null){var o=this.buildRawContent(i),a=this.buildAttributesForStopNode(i);t+=o===""?"<".concat(r).concat(a,"/>"):"<".concat(r).concat(a,">").concat(o,"</").concat(r,">")}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else if((typeof n==="undefined"?"undefined":_type_of(n))=="object"&&n!==null){var i10=this.buildRawContent(n),o10=this.buildAttributesForStopNode(n);t+=i10===""?"<".concat(r).concat(o10,"/>"):"<".concat(r).concat(o10,">").concat(i10,"</").concat(r,">")}else t+="<".concat(r,">").concat(n,"</").concat(r,">")}return t},wu.prototype.buildAttributesForStopNode=function(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return"";var t="";if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){var r=e[this.options.attributesGroupName];for(var n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;var i=n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n,o=r[n];o===!0&&this.options.suppressBooleanAttributes?t+=" "+i:t+=" "+i+'="'+o+'"'}}else for(var r10 in e){if(!Object.prototype.hasOwnProperty.call(e,r10))continue;var n10=this.isAttribute(r10);if(n10){var i10=e[r10];i10===!0&&this.options.suppressBooleanAttributes?t+=" "+n10:t+=" "+n10+'="'+i10+'"'}}return t},wu.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{var i="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",i=""),!r&&r!==""||e.indexOf("<")!==-1?this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(n)+"<!--".concat(e,"-->")+this.newLine:this.indentate(n)+"<"+t+r+o+this.tagEndChar+e+this.indentate(n)+i:this.indentate(n)+"<"+t+r+o+">"+e+i}},wu.prototype.closeTag=function(e){var t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":"></".concat(e),t},wu.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(var t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},wu.prototype.buildTextValNode=function(e,t,r,n,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){var o=String(e).replace(/\]\]>/g,"]]]]><![CDATA[>");return this.indentate(n)+"<![CDATA[".concat(o,"]]>")+this.newLine}if(this.options.commentPropName!==!1&&t===this.options.commentPropName){var o10=String(e).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(n)+"<!--".concat(o10,"-->")+this.newLine}if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{var o11=this.options.tagValueProcessor(t,e);return o11=this.replaceEntitiesValue(o11),o11===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+o11+"</"+t+this.tagEndChar}},wu.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(var t=0;t<this.options.entities.length;t++){var r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};var PMe=wu;function RMe(e){return new PMe({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(mJ({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function mJ(e,t){var r=_object_spread({},e);for(var n in r)r.hasOwnProperty(n)&&(r[n]&&_type_of(r[n])=="object"&&n.indexOf(":")===-1?(r["".concat(t,":").concat(n)]=mJ(r[n],t),delete r[n]):/^@_/.test(n)===!1&&(r["".concat(t,":").concat(n)]=r[n],delete r[n]));return r}function ZM(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function hJ(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}var MMe=hJ(function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=Ho({url:ji(e.remoteURL,zi(t)),method:"UNLOCK",headers:{"Lock-Token":r}},e,n);return ZM(Go(i,e),function(o){if(Zo(e,o),o.status!==204&&o.status!==200)throw YM(o)})}),OMe=hJ(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.refreshToken,tmp=r.timeout,i=tmp===void 0?$Me:tmp,o={Accept:"text/plain,application/xml",Timeout:i};n&&(o.If=n);var a=Ho({url:ji(e.remoteURL,zi(t)),method:"LOCK",headers:o,data:RMe(e.contactHref)},e,r);return ZM(Go(a,e),function(s){return Zo(e,s),ZM(s.text(),function(l){var c=(p=l,new i7({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(p)),d=Mp().get(c,"prop.lockdiscovery.activelock.locktoken.href"),u=Mp().get(c,"prop.lockdiscovery.activelock.timeout");var p;if(!d)throw YM(s,"No lock token received: ");return{token:d,serverTimeout:u}})})}),$Me="Infinite, Second-4100000000";function IM(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var NMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.path||"/",n=Ho({url:ji(e.remoteURL,r),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return IM(Go(n,e),function(i){return Zo(e,i),IM(i.text(),function(o){return IM(h7(o,e.parsing),function(a){var s=function(l){try{var _l_multistatus_response=_sliced_to_array(l.multistatus.response,1),c=_l_multistatus_response[0],_c_propstat=c.propstat,_c_propstat_prop=_c_propstat.prop,d=_c_propstat_prop["quota-used-bytes"],u=_c_propstat_prop["quota-available-bytes"];return d!==void 0&&u!==void 0?{used:parseInt(String(d),10),available:lMe(u)}:null}catch(c){}return null}(a);return X1(i,s,t.details)})})})});function PM(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var DMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},tmp=r.details,n=tmp===void 0?!1:tmp,i=Ho({url:ji(e.remoteURL,zi(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,r);return PM(Go(i,e),function(o){return Zo(e,o),PM(o.text(),function(a){return PM(h7(a,e.parsing),function(s){var l=function(c,d,u){var p={truncated:!1,results:[]};return p.truncated=c.multistatus.response.some(function(m){var h,g;return((g=(m.status||((h=m.propstat)==null?void 0:h.status)).split(" ",3))==null?void 0:g[1])==="507"&&m.href.replace(/\/$/,"").endsWith(zi(d).replace(/\/$/,""))}),c.multistatus.response.forEach(function(m){if(m.propstat===void 0)return;var h=m.href.split("/").map(decodeURIComponent).join("/");p.results.push(eO(m.propstat.prop,h,u))}),p}(s,t,n);return X1(o,l,n)})})})}),LMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=Ho({url:ji(e.remoteURL,zi(t)),method:"MOVE",headers:{Destination:ji(e.remoteURL,zi(r)),Overwrite:n.overwrite===!1?"F":"T"}},e,n);return a=function a(s){Zo(e,s)},(o=Go(i,e))&&o.then||(o=Promise.resolve(o)),a?o.then(a):o;var o,a}),FMe=wi(172);function zMe(e){if(zQ(e))return e.byteLength;if(jQ(e))return e.length;if(typeof e=="string")return(0,FMe.d)(e);throw new Aa({info:{code:om.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}var jMe=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},tmp=n.contentLength,i=tmp===void 0?!0:tmp,tmp1=n.overwrite,o=tmp1===void 0?!0:tmp1,a={"Content-Type":"application/octet-stream"};i===!1||(a["Content-Length"]=typeof i=="number"?"".concat(i):"".concat(zMe(r))),o||(a["If-None-Match"]="*");var s=Ho({url:ji(e.remoteURL,zi(t)),method:"PUT",headers:a,data:r},e,n);return c=function c(d){try{Zo(e,d)}catch(u){var p=u;if(p.status!==412||o)throw p;return!1}return!0},(l=Go(s,e))&&l.then||(l=Promise.resolve(l)),c?l.then(c):l;var l,c}),gJ=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}(function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Ho({url:ji(e.remoteURL,zi(t)),method:"OPTIONS"},e,r);return o=function o(a){var s,l;try{Zo(e,a)}catch(c){throw c}return{compliance:((s=a.headers.get("DAV"))!=null?s:"").split(",").map(function(c){return c.trim()}),server:(l=a.headers.get("Server"))!=null?l:""}},(i=Go(n,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o});function ob(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var UMe=nO(function(e,t,r,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new Aa({info:{code:om.InvalidUpdateRange}},"Invalid update range ".concat(r," for partial update"));var a={"Content-Type":"application/octet-stream","Content-Length":""+(n-r+1),"Content-Range":"bytes ".concat(r,"-").concat(n,"/*")},s=Ho({url:ji(e.remoteURL,zi(t)),method:"PUT",headers:a,data:i},e,o);return ob(Go(s,e),function(l){Zo(e,l)})});function $Q(e,t){var r=e();return r&&r.then?r.then(t):t(r)}var BMe=nO(function(e,t,r,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(r>n||r<0)throw new Aa({info:{code:om.InvalidUpdateRange}},"Invalid update range ".concat(r," for partial update"));var a={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(n-r+1),"X-Update-Range":"bytes=".concat(r,"-").concat(n)},s=Ho({url:ji(e.remoteURL,zi(t)),method:"PATCH",headers:a,data:i},e,o);return ob(Go(s,e),function(l){Zo(e,l)})});function nO(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(n){return Promise.reject(n)}}}var qMe=nO(function(e,t,r,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return ob(gJ(e,t,o),function(a){var s=!1;return $Q(function(){if(a.compliance.includes("sabredav-partialupdate"))return ob(BMe(e,t,r,n,i,o),function(l){return s=!0,l})},function(l){var c=!1;return s?l:$Q(function(){if(a.server.includes("Apache")&&a.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return ob(UMe(e,t,r,n,i,o),function(d){return c=!0,d})},function(d){if(c)return d;throw new Aa({info:{code:om.NotSupported}},"Not supported")})})})}),WMe="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function iO(e){var x;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=t.authType,r=tmp===void 0?null:tmp,n=t.remoteBasePath,tmp1=t.contactHref,i=tmp1===void 0?WMe:tmp1,o=t.entityDecoder,a=t.ha1,tmp2=t.headers,s=tmp2===void 0?{}:tmp2,l=t.httpAgent,c=t.httpsAgent,d=t.password,u=t.token,p=t.username,m=t.withCredentials,h=r;h||(h=p||d?Vs.Password:Vs.None);var g={authType:h,remoteBasePath:n,contactHref:i,ha1:a,headers:Object.assign({},s),httpAgent:l,httpsAgent:c,password:d,parsing:{attributeNamePrefix:(x=t.attributeNamePrefix)!=null?x:"@",attributeParsers:[],entityDecoder:o,tagParsers:[lJ]},remotePath:UPe(e),remoteURL:e,token:u,username:p,withCredentials:m};return LQ(g,p,d,u,a),{copyFile:function(v,y,_){return kRe(g,v,y,_)},createDirectory:function(v,y){return GM(g,v,y)},createReadStream:function(v,y){return function(_,b){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=new(MQ()).PassThrough;return pMe(_,b,w).then(function(k){k.pipe(S)}).catch(function(k){S.emit("error",k)}),S}(g,v,y)},createWriteStream:function(v,y,_){return function(b,w){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:fMe,E=new(MQ()).PassThrough,C={};S.overwrite===!1&&(C["If-None-Match"]="*");var T=Ho({url:ji(b.remoteURL,zi(w)),method:"PUT",headers:C,data:E,maxRedirects:0},b,S);return Go(T,b).then(function(I){return Zo(b,I)}).then(function(I){setTimeout(function(){k(I)},0)}).catch(function(I){E.emit("error",I)}),E}(g,v,y,_)},customRequest:function(v,y){return mMe(g,v,y)},deleteFile:function(v,y){return hMe(g,v,y)},exists:function(v,y){return gMe(g,v,y)},getDirectoryContents:function(v,y){return xMe(g,v,y)},getFileContents:function(v,y){return _Me(g,v,y)},getFileDownloadLink:function(v){return function(y,_){var b=ji(y.remoteURL,zi(_)),w=/^https:/i.test(b)?"https":"http";switch(y.authType){case Vs.None:break;case Vs.Password:{var S=dQ(y.headers.Authorization.replace(/^Basic /i,"").trim());b=b.replace(/^https?:\/\//,"".concat(w,"://").concat(S,"@"));break}default:throw new Aa({info:{code:om.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(y.authType))}return b}(g,v)},getFileUploadLink:function(v){return function(y,_){var b="".concat(ji(y.remoteURL,zi(_)),"?Content-Type=application/octet-stream"),w=/^https:/i.test(b)?"https":"http";switch(y.authType){case Vs.None:break;case Vs.Password:{var S=dQ(y.headers.Authorization.replace(/^Basic /i,"").trim());b=b.replace(/^https?:\/\//,"".concat(w,"://").concat(S,"@"));break}default:throw new Aa({info:{code:om.LinkUnsupportedAuthType}},"Unsupported auth type for file link: ".concat(y.authType))}return b}(g,v)},getHeaders:function(){return Object.assign({},g.headers)},getQuota:function(v){return NMe(g,v)},lock:function(v,y){return OMe(g,v,y)},moveFile:function(v,y,_){return LMe(g,v,y,_)},putFileContents:function(v,y,_){return jMe(g,v,y,_)},partialUpdateFileContents:function(v,y,_,b,w){return qMe(g,v,y,_,b,w)},getDAVCompliance:function(v){return gJ(g,v)},search:function(v,y){return DMe(g,v,y)},setHeaders:function(v){g.headers=Object.assign({},v)},stat:function(v,y){return tO(g,v,y)},unlock:function(v,y,_){return MMe(g,v,y,_)},registerAttributeParser:function(v){g.parsing.attributeParsers.push(v)},registerTagParser:function(v){g.parsing.tagParsers.push(v)}}}var ex=require("obsidian");var VMe="0.13.26",GMe="0.14.6";var xJ=!ex.Platform.isAndroidApp&&(0,ex.requireApiVersion)(VMe)||ex.Platform.isAndroidApp&&(0,ex.requireApiVersion)(GMe);var TJ=require("obsidian");var Ka={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},lO={silent:{level:-1},fatal:{level:Ka.fatal},error:{level:Ka.error},warn:{level:Ka.warn},log:{level:Ka.log},info:{level:Ka.info},success:{level:Ka.success},fail:{level:Ka.fail},ready:{level:Ka.info},start:{level:Ka.info},box:{level:Ka.info},debug:{level:Ka.debug},trace:{level:Ka.trace},verbose:{level:Ka.verbose}};function oO(e){if(e===null||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return!1;var t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function uO(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".",n=arguments.length>3?arguments[3]:void 0;if(!oO(t))return uO(e,{},r,n);var i=Object.assign({},t);for(var o in e){if(o==="__proto__"||o==="constructor")continue;var a=e[o];a!=null&&(n&&n(i,o,a,r)||(Array.isArray(a)&&Array.isArray(i[o])?i[o]=_to_consumable_array(a).concat(_to_consumable_array(i[o])):oO(a)&&oO(i[o])?i[o]=uO(a,i[o],(r?"".concat(r,"."):"")+o.toString(),n):i[o]=a))}return i}function HMe(e){return function(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}return t.reduce(function(r,n){return uO(r,n,"",e)},{})}}var ZMe=HMe();function KMe(e){return Object.prototype.toString.call(e)==="[object Object]"}function QMe(e){return!(!KMe(e)||!e.message&&!e.args||e.stack)}var aO=!1,yJ=[],To=/*#__PURE__*/function(){"use strict";function To1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,To1);A(this,"options");A(this,"_lastLog");A(this,"_mockFn");var r=t.types||lO;this.options=ZMe(_object_spread_props(_object_spread({},t),{defaults:_object_spread({},t.defaults),level:sO(t.level,r),reporters:_to_consumable_array(t.reporters||[])}),{types:lO,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(var n in r){var i=_object_spread({type:n},this.options.defaults,r[n]);this[n]=this._wrapLogFn(i),this[n].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}_create_class(To1,[{key:"level",get:function get1(){return this.options.level},set:function set1(t){this.options.level=sO(t,this.options.types,this.options.level)}},{key:"prompt",value:function prompt1(t,r){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(t,r)}},{key:"create",value:function create(t){var r=new To(_object_spread({},this.options,t));return this._mockFn&&r.mockTypes(this._mockFn),r}},{key:"withDefaults",value:function withDefaults(t){return this.create(_object_spread_props(_object_spread({},this.options),{defaults:_object_spread({},this.options.defaults,t)}))}},{key:"withTag",value:function withTag(t){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+t:t})}},{key:"addReporter",value:function addReporter(t){return this.options.reporters.push(t),this}},{key:"removeReporter",value:function removeReporter(t){if(t){var r=this.options.reporters.indexOf(t);if(r!==-1)return this.options.reporters.splice(r,1)}else this.options.reporters.splice(0);return this}},{key:"setReporters",value:function setReporters(t){return this.options.reporters=Array.isArray(t)?t:[t],this}},{key:"wrapAll",value:function wrapAll(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function restoreAll(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function wrapConsole(){for(var t in this.options.types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}},{key:"restoreConsole",value:function restoreConsole(){for(var t in this.options.types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}},{key:"wrapStd",value:function wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}},{key:"_wrapStream",value:function _wrapStream(t,r){var _this=this;t&&(t.__write||(t.__write=t.write),t.write=function(n){_this[r].raw(String(n).trim())})}},{key:"restoreStd",value:function restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}},{key:"_restoreStream",value:function _restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}},{key:"pauseLogs",value:function pauseLogs(){aO=!0}},{key:"resumeLogs",value:function resumeLogs(){aO=!1;var t=yJ.splice(0);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r[0]._logFn(r[1],r[2])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"mockTypes",value:function mockTypes(t){var r=t||this.options.mockFn;if(this._mockFn=r,typeof r=="function")for(var n in this.options.types)this[n]=r(n,this.options.types[n])||this[n],this[n].raw=this[n]}},{key:"_wrapLogFn",value:function _wrapLogFn(t,r){var _this=this;return function(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}if(aO){yJ.push([_this,t,n,r]);return}return _this._logFn(t,n,r)}}},{key:"_logFn",value:function _logFn(t,r,n){var _this=this;if((t.level||0)>this.level)return!1;var i=_object_spread_props(_object_spread({date:new Date,args:[]},t),{level:sO(t.level,this.options.types)});!n&&r.length===1&&QMe(r[0])?Object.assign(i,r[0]):i.args=_to_consumable_array(r),i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split("\n")),i.args.push("\n"+i.additional.join("\n")),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";var o=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var l=(_this._lastLog.count||0)-_this.options.throttleMin;if(_this._lastLog.object&&l>0){var c=_to_consumable_array(_this._lastLog.object.args);l>1&&c.push("(repeated ".concat(l," times)")),_this._log(_object_spread_props(_object_spread({},_this._lastLog.object),{args:c})),_this._lastLog.count=1}s&&(_this._lastLog.object=i,_this._log(i))};clearTimeout(this._lastLog.timeout);var a=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,a<this.options.throttle)try{var s=JSON.stringify([i.type,i.tag,i.args]),l=this._lastLog.serialized===s;if(this._lastLog.serialized=s,l&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(o,this.options.throttle);return}}catch(s){}o(!0)}},{key:"_log",value:function _log(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.options.reporters[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.log(t,{options:this.options})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}]);return To1}();function sO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3;return e===void 0?r:typeof e=="number"?e:t[e]&&t[e].level!==void 0?t[e].level:r}To.prototype.add=To.prototype.addReporter;To.prototype.remove=To.prototype.removeReporter;To.prototype.clear=To.prototype.removeReporter;To.prototype.withScope=To.prototype.withTag;To.prototype.mock=To.prototype.mockTypes;To.prototype.pause=To.prototype.pauseLogs;To.prototype.resume=To.prototype.resumeLogs;function vJ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new To(e)}var cO=/*#__PURE__*/function(){"use strict";function cO1(t){_class_call_check(this,cO1);A(this,"options");A(this,"defaultColor");A(this,"levelColorMap");A(this,"typeColorMap");this.options=_object_spread({},t),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_create_class(cO1,[{key:"_getLogFn",value:function _getLogFn(t){return t<1?console.__error||console.error:t===1?console.__warn||console.warn:console.__log||console.log}},{key:"log",value:function log(t){var r=this._getLogFn(t.level),n=t.type==="log"?"":t.type,i=t.tag||"",a="\n background: ".concat(this.typeColorMap[t.type]||this.levelColorMap[t.level]||this.defaultColor,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),s="%c".concat([i,n].filter(Boolean).join(":"));typeof t.args[0]=="string"?r.apply(void 0,["".concat(s,"%c ").concat(t.args[0]),a,""].concat(_to_consumable_array(t.args.slice(1)))):r.apply(void 0,[s,a].concat(_to_consumable_array(t.args)))}}]);return cO1}();function dO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return vJ(_object_spread({reporters:e.reporters||[new cO({})],prompt:function prompt1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n.type==="confirm"?Promise.resolve(confirm(r)):Promise.resolve(prompt(r))}},e))}var h$t=dO();var JMe=dO({level:Ka.verbose,formatOptions:{date:!0,colors:!1}}),Me=JMe;var bd=require("obsidian");var _J="https://dav.jianguoyun.com/nsdav",bJ="https://dav.jianguoyun.com/dav",wJ="1.5.0",SJ="dc_obsidian_dp0gymrn",_d="nutstore-llm-gateway";function YMe(){return bd.Platform.isWin?"Windows":bd.Platform.isMacOS?"macOS":bd.Platform.isLinux?"Linux":bd.Platform.isAndroidApp?"Android":bd.Platform.isIosApp?"iOS":"Unknown"}function XMe(){return bd.Platform.isTablet?"Tablet":bd.Platform.isPhone?"Phone":bd.Platform.isDesktopApp?"Desktop":bd.Platform.isMobileApp?"Mobile":"Unknown"}function kJ(e){try{return new URL(e).hostname.toLowerCase().includes("jianguoyun")}catch(t){return!1}}var CJ="Obsidian (".concat(YMe(),"; ").concat(XMe(),"; ObsidianNutstoreSync/").concat(wJ,")"),EJ="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36";var pO=/*#__PURE__*/function(Error1){"use strict";_inherits(pO1,Error1);function pO1(r){_class_call_check(this,pO1);var _this;_this=_call_super(this,pO1,["".concat(r.status,": ").concat(r.text)]);_this.res=r;return _this}return pO1}(_wrap_native_super(Error));function Su(e){return _async_to_generator(function(){var t,r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=typeof e=="string"?e:e.url,r=typeof e=="string"?{}:e.headers||{},n=kJ(t)?_object_spread_props(_object_spread({},r),{"User-Agent":CJ}):_object_spread_props(_object_spread({},r),{"User-Agent":EJ}),i=typeof e=="string"?{url:t,throw:!1,headers:n}:_object_spread_props(_object_spread({},e),{throw:!1,headers:n});return[4,(0,TJ.requestUrl)(i)];case 1:o=_state.sent();if(o.status>=400&&(Me.error(o),typeof e=="string"||e.throw!==!1))throw new pO(o);return[2,o]}})})()}function AJ(e){return Object.fromEntries(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return[t.toLowerCase(),r]}))}function eOe(e){return!/[^\u0000-\u00ff]/g.test(e)}xJ&&KM().patch("request",function(e){return _async_to_generator(function(){var d,t,r,n,i,o,a,_tmp,s,u,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e,r=AJ(_object_spread({},t.headers));delete r.host,delete r["content-length"];n=(d=r.accept)!=null?d:r["content-type"],i=_object_spread({},r);Object.prototype.hasOwnProperty.call(i,"authorization")&&(i.authorization="<retracted>");o={url:t.url,method:t.method,body:t.data,headers:r,contentType:n,throw:!1};return[4,Su(o)];case 1:a=_state.sent();_tmp=a.status===401&&PJ.Platform.isIosApp&&!t.url.endsWith("/")&&!t.url.endsWith(".md")&&t.method.toUpperCase()==="PROPFIND";if(!_tmp)return[3,3];o.url="".concat(t.url,"/");return[4,Su(o)];case 2:_tmp=a=_state.sent();_state.label=3;case 3:_tmp;s=AJ(_object_spread({},a.headers));for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(eOe(s[u])||(s[u]=encodeURIComponent(s[u])));c=(0,IJ.getReasonPhrase)(a.status);return[2,([101,103,204,205,304].includes(a.status)?l=new Response(null,{status:a.status,statusText:c,headers:s}):l=new Response(a.arrayBuffer,{status:a.status,statusText:c,headers:s}),l)]}})})()});var mb=typeof Buffer=="function",D$t=typeof TextDecoder=="function"?new TextDecoder:void 0,RJ=typeof TextEncoder=="function"?new TextEncoder:void 0,tOe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",fb=Array.prototype.slice.call(tOe),g7=function(e){var t={};return e.forEach(function(r,n){return t[r]=n}),t}(fb),rOe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Dl=String.fromCharCode.bind(String),MJ=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},$J=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,function(t){return t=="+"?"-":"_"})},NJ=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},nOe=function(e){var t,r,n,i,o="",a=e.length%3;for(var s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=fb[t>>18&63]+fb[t>>12&63]+fb[t>>6&63]+fb[t&63]}return a?o.slice(0,a-3)+"===".substring(a):o},DJ=typeof btoa=="function"?function(e){return btoa(e)}:mb?function(e){return Buffer.from(e,"binary").toString("base64")}:nOe,fO=mb?function(e){return Buffer.from(e).toString("base64")}:function(e){var r=[];for(var n=0,i=e.length;n<i;n+=4096)r.push(Dl.apply(null,e.subarray(n,n+4096)));return DJ(r.join(""))},tx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return t?$J(fO(e)):fO(e)},iOe=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Dl(192|t>>>6)+Dl(128|t&63):Dl(224|t>>>12&15)+Dl(128|t>>>6&63)+Dl(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Dl(240|t>>>18&7)+Dl(128|t>>>12&63)+Dl(128|t>>>6&63)+Dl(128|t&63)}},oOe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,aOe=function(e){return e.replace(oOe,iOe)},OJ=mb?function(e){return Buffer.from(e,"utf8").toString("base64")}:RJ?function(e){return fO(RJ.encode(e))}:function(e){return DJ(aOe(e))},LJ=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return t?$J(OJ(e)):OJ(e)};var sOe=function(e){if(e=e.replace(/\s+/g,""),!rOe.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));var t,r,n,i=[];for(var o=0;o<e.length;)t=g7[e.charAt(o++)]<<18|g7[e.charAt(o++)]<<12|(r=g7[e.charAt(o++)])<<6|(n=g7[e.charAt(o++)]),r===64?i.push(Dl(t>>16&255)):n===64?i.push(Dl(t>>16&255,t>>8&255)):i.push(Dl(t>>16&255,t>>8&255,t&255));return i.join("")},lOe=typeof atob=="function"?function(e){return atob(NJ(e))}:mb?function(e){return Buffer.from(e,"base64").toString("binary")}:sOe,uOe=mb?function(e){return MJ(Buffer.from(e,"base64"))}:function(e){return MJ(lOe(e).split("").map(function(t){return t.charCodeAt(0)}))},hb=function(e){return uOe(cOe(e))};var cOe=function(e){return NJ(e.replace(/[-_]/g,function(t){return t=="-"?"+":"/"}))};var hM=require("obsidian");var FJ=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function gb(e,t){t?t=_object_spread({},FJ,t):t=FJ;var r=jJ(t);return r.dispatch(e),r.toString()}var dOe=Object.freeze(["prototype","__proto__","constructor"]);function jJ(e){var t="",r=new Map,n=function(i){t+=i};return{toString:function toString(){return t},getContext:function getContext(){return r},dispatch:function dispatch(i){return e.replacer&&(i=e.replacer(i)),this[i===null?"null":typeof i==="undefined"?"undefined":_type_of(i)](i)},object:function object(i){var _this=this;if(i&&typeof i.toJSON=="function")return this.object(i.toJSON());var o=Object.prototype.toString.call(i),a="",s=o.length;s<10?a="unknown:["+o+"]":a=o.slice(8,s-1),a=a.toLowerCase();var l=null;if((l=r.get(i))===void 0)r.set(i,r.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(i))return n("buffer:"),n(i.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](i):e.ignoreUnknown||this.unkown(i,a);else{var c=Object.keys(i);e.unorderedObjects&&(c=c.sort());var d=[];e.respectType!==!1&&!zJ(i)&&(d=dOe),e.excludeKeys&&(c=c.filter(function(p){return!e.excludeKeys(p)}),d=d.filter(function(p){return!e.excludeKeys(p)})),n("object:"+(c.length+d.length)+":");var u=function(p){_this.dispatch(p),n(":"),e.excludeValues||_this.dispatch(i[p]),n(",")};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;u(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=d[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var p10=_step1.value;u(p10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}},array:function array(i,o){if(o=o===void 0?e.unorderedArrays!==!1:o,n("array:"+i.length+":"),!o||i.length<=1){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;this.dispatch(l)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return}var a=new Map,s=i.map(function(l){var c=jJ(e);c.dispatch(l);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c.getContext()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),d=_step_value[0],u=_step_value[1];a.set(d,u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return c.toString()});return r=a,s.sort(),this.array(s,!1)},date:function date(i){return n("date:"+i.toJSON())},symbol:function symbol(i){return n("symbol:"+i.toString())},unkown:function unkown(i,o){if(n(o),!!i&&(n(":"),i&&typeof i.entries=="function"))return this.array(Array.from(i.entries()),!0)},error:function error(i){return n("error:"+i.toString())},boolean:function boolean(i){return n("bool:"+i)},string:function string(i){n("string:"+i.length+":"),n(i)},function:function _function(i){n("fn:"),zJ(i)?this.dispatch("[native]"):this.dispatch(i.toString()),e.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),e.respectFunctionProperties&&this.object(i)},number:function number(i){return n("number:"+i)},xml:function xml(i){return n("xml:"+i.toString())},null:function _null(){return n("Null")},undefined:function undefined1(){return n("Undefined")},regexp:function regexp(i){return n("regex:"+i.toString())},uint8array:function uint8array(i){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},uint8clampedarray:function uint8clampedarray(i){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},int8array:function int8array(i){return n("int8array:"),this.dispatch(Array.prototype.slice.call(i))},uint16array:function uint16array(i){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},int16array:function int16array(i){return n("int16array:"),this.dispatch(Array.prototype.slice.call(i))},uint32array:function uint32array(i){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},int32array:function int32array(i){return n("int32array:"),this.dispatch(Array.prototype.slice.call(i))},float32array:function float32array(i){return n("float32array:"),this.dispatch(Array.prototype.slice.call(i))},float64array:function float64array(i){return n("float64array:"),this.dispatch(Array.prototype.slice.call(i))},arraybuffer:function arraybuffer(i){return n("arraybuffer:"),this.dispatch(new Uint8Array(i))},url:function url(i){return n("url:"+i.toString())},map:function map(i){n("map:");var o=_to_consumable_array(i);return this.array(o,e.unorderedSets!==!1)},set:function set1(i){n("set:");var o=_to_consumable_array(i);return this.array(o,e.unorderedSets!==!1)},file:function file(i){return n("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},blob:function blob(){if(e.ignoreUnknown)return n("[blob]");throw new Error('Hashing Blob objects is currently not supported\nUse "options.replacer" or "options.ignoreUnknown"\n')},domwindow:function domwindow(){return n("domwindow")},bigint:function bigint(i){return n("bigint:"+i.toString())},process:function process1(){return n("process")},timer:function timer(){return n("timer")},pipe:function pipe(){return n("pipe")},tcp:function tcp(){return n("tcp")},udp:function udp(){return n("udp")},tty:function tty(){return n("tty")},statwatcher:function statwatcher(){return n("statwatcher")},securecontext:function securecontext(){return n("securecontext")},connection:function connection(){return n("connection")},zlib:function zlib(){return n("zlib")},context:function context(){return n("context")},nodescript:function nodescript(){return n("nodescript")},httpparser:function httpparser(){return n("httpparser")},dataview:function dataview(){return n("dataview")},signal:function signal(){return n("signal")},fsevent:function fsevent(){return n("fsevent")},tlswrap:function tlswrap(){return n("tlswrap")}}}var UJ="[native code] }",pOe=UJ.length;function zJ(e){return typeof e!="function"?!1:Function.prototype.toString.call(e).slice(-pOe)===UJ}var wd=/*#__PURE__*/function(){"use strict";function wd1(t,r){_class_call_check(this,wd1);A(this,"words");A(this,"sigBytes");t=this.words=t||[],this.sigBytes=r===void 0?t.length*4:r}_create_class(wd1,[{key:"toString",value:function toString(t){return(t||fOe).stringify(this)}},{key:"concat",value:function concat(t){if(this.clamp(),this.sigBytes%4)for(var r=0;r<t.sigBytes;r++){var n=t.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=n<<24-(this.sigBytes+r)%4*8}else for(var r10=0;r10<t.sigBytes;r10+=4)this.words[this.sigBytes+r10>>>2]=t.words[r10>>>2];return this.sigBytes+=t.sigBytes,this}},{key:"clamp",value:function clamp(){this.words[this.sigBytes>>>2]&=0xffffffff<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}},{key:"clone",value:function clone(){return new wd(_to_consumable_array(this.words))}}]);return wd1}(),fOe={stringify:function stringify(e){var t=[];for(var r=0;r<e.sigBytes;r++){var n=e.words[r>>>2]>>>24-r%4*8&255;t.push((n>>>4).toString(16),(n&15).toString(16))}return t.join("")}},mOe={stringify:function stringify(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(var n=0;n<e.sigBytes;n+=3){var i=e.words[n>>>2]>>>24-n%4*8&255,o=e.words[n+1>>>2]>>>24-(n+1)%4*8&255,a=e.words[n+2>>>2]>>>24-(n+2)%4*8&255,s=i<<16|o<<8|a;for(var l=0;l<4&&n*8+l*6<e.sigBytes*8;l++)r.push(t.charAt(s>>>6*(3-l)&63))}return r.join("")}},hOe={parse:function parse(e){var t=e.length,r=[];for(var n=0;n<t;n++)r[n>>>2]|=(e.charCodeAt(n)&255)<<24-n%4*8;return new wd(r,t)}},gOe={parse:function parse(e){return hOe.parse(unescape(encodeURIComponent(e)))}},mO=/*#__PURE__*/function(){"use strict";function mO1(){_class_call_check(this,mO1);A(this,"_data",new wd);A(this,"_nDataBytes",0);A(this,"_minBufferSize",0);A(this,"blockSize",512/32)}_create_class(mO1,[{key:"reset",value:function reset(){this._data=new wd,this._nDataBytes=0}},{key:"_append",value:function _append(t){typeof t=="string"&&(t=gOe.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}},{key:"_doProcessBlock",value:function _doProcessBlock(t,r){}},{key:"_process",value:function _process(t){var r,n=this._data.sigBytes/(this.blockSize*4);t?n=Math.ceil(n):n=Math.max((n|0)-this._minBufferSize,0);var i=n*this.blockSize,o=Math.min(i*4,this._data.sigBytes);if(i){for(var a=0;a<i;a+=this.blockSize)this._doProcessBlock(this._data.words,a);r=this._data.words.splice(0,i),this._data.sigBytes-=o}return new wd(r,o)}}]);return mO1}(),hO=/*#__PURE__*/function(mO1){"use strict";_inherits(hO1,mO1);function hO1(){_class_call_check(this,hO1);return _call_super(this,hO1,arguments)}_create_class(hO1,[{key:"update",value:function update(t){return this._append(t),this._process(),this}},{key:"finalize",value:function finalize(t){t&&this._append(t)}}]);return hO1}(mO),BJ=[0x6a09e667,-0x4498517b,0x3c6ef372,-0x5ab00ac6,0x510e527f,-0x64fa9774,0x1f83d9ab,0x5be0cd19],xOe=[0x428a2f98,0x71374491,-0x4a3f0431,-0x164a245b,0x3956c25b,0x59f111f1,-0x6dc07d5c,-0x54e3a12b,-0x27f85568,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,-0x7f214e02,-0x6423f959,-0x3e640e8c,-0x1b64963f,-0x1041b87a,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,-0x67c1aeae,-0x57ce3993,-0x4ffcd838,-0x40a68039,-0x391ff40d,-0x2a586eb9,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,-0x7e3d36d2,-0x6d8dd37b,-0x5d40175f,-0x57e599b5,-0x3db47490,-0x3893ae5d,-0x2e6d17e7,-0x2966f9dc,-0xbf1ca7b,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,-0x7b3787ec,-0x7338fdf8,-0x6f410006,-0x5baf9315,-0x41065c09,-0x398e870e],hg=[],gO=/*#__PURE__*/function(hO1){"use strict";_inherits(gO1,hO1);function gO1(){_class_call_check(this,gO1);var _this;_this=_call_super(this,gO1,arguments);A(_this,"_hash",new wd(_to_consumable_array(BJ)));return _this}_create_class(gO1,[{key:"reset",value:function reset(){_get(_get_prototype_of(gO1.prototype),"reset",this).call(this),this._hash=new wd(_to_consumable_array(BJ))}},{key:"_doProcessBlock",value:function _doProcessBlock(r,n){var i=this._hash.words,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],d=i[5],u=i[6],p=i[7];for(var m=0;m<64;m++){if(m<16)hg[m]=r[n+m]|0;else{var b=hg[m-15],w=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,S=hg[m-2],k=(S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10;hg[m]=w+hg[m-7]+k+hg[m-16]}var h=c&d^~c&u,g=o&a^o&s^a&s,x=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),v=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),y=p+v+h+xOe[m]+hg[m],_=x+g;p=u,u=d,d=c,c=l+y|0,l=s,s=a,a=o,o=y+_|0}i[0]=i[0]+o|0,i[1]=i[1]+a|0,i[2]=i[2]+s|0,i[3]=i[3]+l|0,i[4]=i[4]+c|0,i[5]=i[5]+d|0,i[6]=i[6]+u|0,i[7]=i[7]+p|0}},{key:"finalize",value:function finalize(r){_get(_get_prototype_of(gO1.prototype),"finalize",this).call(this,r);var n=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(n/0x100000000),this._data.words[(i+64>>>9<<4)+15]=n,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}]);return gO1}(hO);function yOe(e){return new gO().finalize(e).toString(mOe)}function Qa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=typeof e=="string"?e:gb(e,t);return yOe(r).slice(0,10)}function rx(e,t){return{hash:Qa({type:"vault-path",kind:t,path:e}),type:"vault-path",kind:t,path:e}}function x7(e){return _object_spread_props(_object_spread({},e),{range:{from:_object_spread({},e.range.from),to:_object_spread({},e.range.to)},hash:Qa(e)})}function y7(e,t){return _async_to_generator(function(){var a,r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(t==null?void 0:t.mimeType)||e.type||"image/png",n=(a=t==null?void 0:t.size)!=null?a:e.size,i=e.type===r?e:new Blob([e],{type:r});return[4,_Oe(i)];case 1:o=_state.sent();return[2,{hash:Qa({type:"image",mimeType:r,size:n,dataUrl:o}),type:"image",blob:e,mimeType:r,name:t==null?void 0:t.name,size:n}]}})})()}function WJ(e,t){var o;var r=t.mimeType||e.type||"application/octet-stream",n=(o=t.size)!=null?o:e.size,i="lastModified"in e&&typeof e.lastModified=="number"?e.lastModified:void 0;return{hash:Qa({type:"file",mimeType:r,filename:t.filename,size:n,lastModified:i}),type:"file",blob:e,mimeType:r,filename:t.filename,size:n}}var qJ=0;function v7(e,t){qJ+=1;var r="pending-context-".concat(Date.now().toString(36),"-").concat(qJ);return{type:"pending-context",placeholderType:e,id:r,placeholder:t}}function Sd(e){return e.type==="pending-context"?e.id:e.hash?e.hash:e.type==="vault-path"?Qa({type:"vault-path",kind:e.kind,path:e.path}):e.type==="selection"?Qa({type:"selection",filePath:e.filePath,range:e.range,selectedText:e.selectedText}):e.type==="file"?Qa({type:"file",mimeType:e.mimeType,filename:e.filename,size:e.size}):Qa({type:"image",mimeType:e.mimeType,size:e.size})}function vOe(e){if(e.type==="pending-context")return _object_spread({},e);var t=Sd(e);return e.type==="vault-path"?_object_spread_props(_object_spread({},e),{hash:t}):e.type==="image"?_object_spread_props(_object_spread({},e),{hash:t}):e.type==="file"?_object_spread_props(_object_spread({},e),{hash:t}):_object_spread_props(_object_spread({},e),{hash:t,range:{from:_object_spread({},e.range.from),to:_object_spread({},e.range.to)}})}function sm(e){var t=vOe(e);return t.type==="vault-path"?_object_spread({},t):t.type==="image"?_object_spread({},t):t.type==="file"?_object_spread({},t):t.type==="pending-context"?_object_spread({},t):{hash:t.hash,type:"selection",filePath:t.filePath,range:{from:_object_spread({},t.range.from),to:_object_spread({},t.range.to)},selectedText:t.selectedText}}function gg(e){return e.map(sm)}function _Oe(e){return new Promise(function(t,r){var n=new FileReader;n.onerror=function(){r(n.error||new Error("Failed to read image blob."))},n.onload=function(){if(typeof n.result=="string"){t(n.result);return}r(new Error("Unexpected FileReader result while reading image."))},n.readAsDataURL(e)})}function _7(e){var t=e.reduce(function(n,i){return i.type==="vault-path"&&n.push({type:i.kind,path:i.path}),i.type==="selection"&&n.push({type:"selection",filePath:i.filePath,range:{from:i.range.from,to:i.range.to},selectedText:i.selectedText}),n},[]);return"<UserProvidedContext>\n".concat(JSON.stringify(t,null,2),"\n</UserProvidedContext>")}var GJ=require("obsidian");var VJ='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="64" height="64" viewBox="0 0 64 64"><defs><clipPath id="master_svg0_76_581"><rect x="0" y="0" width="64" height="64" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_76_581)"><g><path d="M24.91868971875,3.763011816484375Q22.25622771875,4.200204786484375,20.31660671875,5.383955496484375Q18.58577871875,6.440286596484375,18.04270171875,7.876518296484375L18.03976871875,7.884278796484375L17.88870471875,8.327732096484375L17.88485871875,8.341570896484374Q17.61695071875,9.306256296484374,17.85651771875,10.527470596484374Q17.56680271875,10.728216696484374,17.427778718749998,10.856081496484375Q15.01283371875,12.474077196484375,12.49025871875,15.376217396484375Q10.65332121875,17.489560396484375,8.99621961875,20.020349396484374Q8.16438861875,21.290754396484374,7.69159791875,22.154214396484374L7.30611321875,22.867670396484375Q3.35540201875,30.369964396484374,1.97412013875,39.971176396484374Q0.71160173875,48.74686839648437,2.41673850875,50.94031539648437L2.4552907187499997,51.08335539648437L2.45756641875,51.09085839648438Q3.72770021875,55.27651239648438,9.174266818749999,58.12265739648438Q15.07181771875,61.20447139648437,23.38866271875,61.20447139648437L25.93904871875,61.20447139648437L25.95363571875,61.203617396484375Q33.68470371875,60.75146139648437,39.99413271875,57.763618396484375L36.47021871875,56.588974396484375Q34.83179071875,56.042831396484374,33.66497371875,55.025070396484374Q29.93586771875,56.14892539648437,25.78332871875,56.39348239648437L23.35288071875,56.39252839648437Q15.79051671875,56.24885939648438,10.74965761875,53.16005339648437Q9.16814231875,52.19097139648437,8.029026018749999,51.02109539648438Q7.03602981875,50.00128539648438,6.90854171875,49.433948396484375L6.90332841875,49.410747396484375L6.89593651875,49.38814939648437Q5.66133121875,45.61313639648437,6.66894291875,39.15967939648438Q7.85980321875,31.532569396484377,11.82213271875,24.380405396484374L12.22549071875,23.652328396484375Q12.26844571875,23.586790396484375,12.31528471875,23.515968396484375Q13.14246971875,22.265234396484374,14.16092971875,20.882190396484376L14.70802371875,20.150831396484374Q15.45096771875,19.174249396484377,16.02337071875,18.515156396484375Q18.19827271875,16.010892396484373,20.30210871875,14.584247396484376L20.32306471875,14.570037396484375L20.34247571875,14.553783396484375Q21.06974371875,13.944841396484374,21.55487971875,13.904400396484375Q25.33176971875,16.608351396484373,28.60783971875,20.008693396484375Q32.54951871875,24.084884396484377,36.27443671875,28.856058396484375Q39.32876571875,32.76669539648438,41.45218671875,36.348053396484374Q42.35539971875,33.75170139648438,44.46885671875,32.365600396484375Q42.50112871875,29.254058396484375,39.93862571875,25.965309396484376Q36.23887271875,21.156654396484374,31.98337171875,16.757158396484375Q28.42930971875,13.000215496484374,24.26257671875,10.033409096484375L24.24984571875,10.024343496484375L23.79365871875,9.740715996484376L23.78089571875,9.733773196484375Q23.46529771875,9.562118996484376,23.13445471875,9.443146196484374Q23.30805571875,9.374032496484375,23.53288671875,9.291170096484375Q24.73341371875,8.848709596484376,26.18176271875,8.638209296484375Q28.65269671875,8.247315396484375,32.516429718750004,8.778126196484376L32.519395718750005,8.778571096484374Q35.76023871875,9.264327496484375,39.03018171875,10.750094896484375Q45.19951671875,13.553264396484375,49.25328071875,19.023053396484375L49.26018571875,19.032369396484377L49.26751671875,19.041357396484376Q49.58934771875,19.435959396484375,50.05120871875,20.218912396484374Q53.77889971875,26.415191396484374,54.11987271875,32.830978396484376Q55.84202171875,34.22777139648437,56.58948471875,36.469940396484375L57.82466871875,40.175151396484374L58.58056271875,40.42711639648437Q58.91106071875,38.558410396484376,59.00783571875,36.523136396484375L59.08315271875,35.422128396484375Q59.51863871875,26.387655396484377,54.67422471875,18.376701396484375L54.48629371875,18.078500396484372Q55.64711771875,17.271928396484377,57.08214171875,17.563861396484377L57.08999671875,17.565460396484376L57.09788871875,17.566804396484375Q57.69280271875,17.668098396484375,58.41468071875,17.960947396484375Q58.58766171875,18.039201396484373,58.71761371875,18.089912396484372Q60.00208271875,18.591100396484375,61.06592171875,18.040811396484376Q61.23415371875,17.953790396484376,61.39159771875,17.841336396484373Q62.58396571875,17.029429396484375,62.49473971875,15.395732396484375L62.49332071875,15.369782396484375L62.48921971875,15.344120396484374Q62.24406471875,13.809578396484374,61.64554171875,12.477365496484374Q60.56824071875,10.079511596484375,58.69319871875,9.199366996484375L58.68274271875,9.194458996484375L58.26103971875,9.019794496484375L58.24691771875,9.014910196484376Q56.36548271875,8.364334096484374,53.77186571875,9.308506996484375Q51.49167271875,10.138580296484374,49.43977371875,11.902675596484375L49.15436571875,11.633909196484375Q44.44250071875,7.340658896484375,38.79006571875,5.293024996484375Q36.81631071875,4.5780171964843746,34.73442071875,4.151451586484375Q34.52596671875,4.108740086484375,34.16455071875,4.042045596484375L33.51501471875,3.924504276484375Q33.43757671875,3.910669806484375,33.290393718749996,3.884442566484375Q32.74358771875,3.787005666484375,32.72013871875,3.781043026484375L32.69242671875,3.773995876484375L32.66409071875,3.770154026484375Q28.26746171875,3.174051466484375,24.91868971875,3.763011816484375ZM53.29203071875,55.610405396484374Q53.87183371875,53.871124396484376,55.61103071875,53.291446396484375L59.94871471875,51.84554639648437C60.70352971875,51.59394039648438,61.32747671875,51.05279539648438,61.68328871875,50.341163396484376C62.03910871875,49.629531396484374,62.09764871875,48.80570239648438,61.84603871875,48.05091139648437C61.54742771875,47.155147396484374,60.84450571875,46.45224339648438,59.94871471875,46.15364839648438L57.23115171875,45.24778739648438L55.61118671875,44.707794396484374L55.61111471875,44.707771396484375Q55.11549371875,44.54257939648438,54.71402371875,44.28322939648437Q53.70668071875,43.632427396484374,53.29211471875,42.38881639648437L53.12792971875,41.896312396484376L53.12789571875,41.89642339648437L51.84603471875,38.051200396484376C51.59441371875,37.29640939648438,51.05324971875,36.67248939648437,50.34159471875,36.31668839648437C49.62993571875,35.960884396484374,48.80607971875,35.90235139648438,48.05126971875,36.153965396484374C47.15549471875,36.45256439648438,46.45258371875,37.155456396484375,46.15397271875,38.051200396484376L44.70796971875,42.38878239648437Q44.12816571875,44.12806339648437,42.38897371875,44.70774439648437L38.05128871875,46.153644396484374C37.29647071875,46.40525039648438,36.67252371875,46.94639239648438,36.31670771875,47.658023396484374C35.96088771875,48.36965939648437,35.90234771875,49.19348539648438,36.15396471875,49.94828039648438C36.45257171875,50.84404339648437,37.15549871875,51.54694739648438,38.05128871875,51.84554639648437L39.79347271875,52.42627739648437L42.38889271875,53.29142039648438L42.38896971875,53.291435396484374Q42.49761971875,53.32764839648438,42.60177571875,53.368400396484375Q42.98430671875,53.51806639648437,43.30575971875,53.72879839648437Q44.29746271875,54.378982396484375,44.70796171875,55.61038939648437L46.15397271875,59.94799039648438C46.67794771875,61.51976039648437,48.37692271875,62.36917839648437,49.94874571875,61.845222396484374C50.84451271875,61.546619396484374,51.54742471875,60.843727396484375,51.84603471875,59.947986396484374L53.29203071875,55.610405396484374Z" fill-rule="evenodd" fill="#000000" fill-opacity="1"/></g></g></svg>';var xg="nutstore-ai",wOe=VJ.replaceAll("#000000","currentColor"),SOe=wOe.replace(/^<svg\b[^>]*>/,"").replace(/<\/svg>\s*$/,""),kOe='<g transform="scale(1.5625)">'.concat(SOe,"</g>");function HJ(){(0,GJ.addIcon)(xg,kOe)}var nxe=require("obsidian");function xO(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.flatMap(function(t){return t.split(/\s+/).filter(Boolean)})}function Er(e){for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key]}var _e_classList;(_e_classList=e.classList).add.apply(_e_classList,_to_consumable_array(xO.apply(void 0,_to_consumable_array(t))))}function Dn(e){for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key]}var _e_classList;(_e_classList=e.classList).remove.apply(_e_classList,_to_consumable_array(xO.apply(void 0,_to_consumable_array(t))))}function $p(e,t,r){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=xO(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;e.classList.toggle(n,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var yO=function yO1(e,t){return yO=Object.setPrototypeOf||_instanceof({__proto__:[]},Array)&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},yO(e,t)};function ku(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yO(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function xb(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function next(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Np(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function Dp(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Gs(e){return typeof e=="function"}function b7(e){var t=function t(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var w7=b7(function(e){return function(r){e(this),this.message=r?r.length+" errors occurred during unsubscription:\n"+r.map(function(n,i){return i+1+") "+n.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=r}});function yg(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var lm=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xb(a),l=s.next();!l.done;l=s.next()){var c=l.value;c.remove(this)}}catch(g){t={error:g}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var d=this.initialTeardown;if(Gs(d))try{d()}catch(g){o=_instanceof(g,w7)?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var p=xb(u),m=p.next();!m.done;m=p.next()){var h=m.value;try{ZJ(h)}catch(g){o=o!=null?o:[],_instanceof(g,w7)?o=Dp(Dp([],Np(o)),Np(g.errors)):o.push(g)}}}catch(g){n={error:g}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}if(o)throw new w7(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ZJ(t);else{if(_instanceof(t,e)){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&yg(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&yg(r,t),_instanceof(t,e)&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var vO=lm.EMPTY;function S7(e){return _instanceof(e,lm)||e&&"closed"in e&&Gs(e.remove)&&Gs(e.add)&&Gs(e.unsubscribe)}function ZJ(e){Gs(e)?e():e.unsubscribe()}var gc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var nx={setTimeout:function setTimeout1(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=nx.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,Dp([e,t],Np(r))):setTimeout.apply(void 0,Dp([e,t],Np(r)))},clearTimeout:function clearTimeout1(e){var t=nx.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function KJ(e){nx.setTimeout(function(){var t=gc.onUnhandledError;if(t)t(e);else throw e})}function _O(){}var QJ=function(){return bO("C",void 0,void 0)}();function JJ(e){return bO("E",void 0,e)}function YJ(e){return bO("N",e,void 0)}function bO(e,t,r){return{kind:e,value:t,error:r}}var vg=null;function ix(e){if(gc.useDeprecatedSynchronousErrorHandling){var t=!vg;if(t&&(vg={errorThrown:!1,error:null}),e(),t){var r=vg,n=r.errorThrown,i=r.error;if(vg=null,n)throw i}}else e()}function XJ(e){gc.useDeprecatedSynchronousErrorHandling&&vg&&(vg.errorThrown=!0,vg.error=e)}var kO=function(e){ku(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,S7(r)&&r.add(n)):n.destination=AOe,n}return t.create=function(r,n,i){return new C7(r,n,i)},t.prototype.next=function(r){this.isStopped?SO(YJ(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?SO(JJ(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?SO(QJ,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(lm);var COe=Function.prototype.bind;function wO(e,t){return COe.call(e,t)}var EOe=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){k7(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){k7(n)}else k7(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){k7(r)}},e}(),C7=function(e){ku(t,e);function t(r,n,i){var o=e.call(this)||this,a;if(Gs(r)||!r)a={next:r!=null?r:void 0,error:n!=null?n:void 0,complete:i!=null?i:void 0};else{var s;o&&gc.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return o.unsubscribe()},a={next:r.next&&wO(r.next,s),error:r.error&&wO(r.error,s),complete:r.complete&&wO(r.complete,s)}):a=r}return o.destination=new EOe(a),o}return t}(kO);function k7(e){gc.useDeprecatedSynchronousErrorHandling?XJ(e):KJ(e)}function TOe(e){throw e}function SO(e,t){var r=gc.onStoppedNotification;r&&nx.setTimeout(function(){return r(e,t)})}var AOe={closed:!0,next:_O,error:TOe,complete:_O};var eY=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function tY(e){return e}function rY(e){return e.length===0?tY:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var yb=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=POe(t)?t:new C7(t,r,n);return ix(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=nY(r),new r(function(i,o){var a=new C7({next:function next(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[eY]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return rY(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=nY(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();function nY(e){var t;return(t=e!=null?e:gc.Promise)!==null&&t!==void 0?t:Promise}function IOe(e){return e&&Gs(e.next)&&Gs(e.error)&&Gs(e.complete)}function POe(e){return e&&_instanceof(e,kO)||IOe(e)&&S7(e)}var iY=b7(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var Ln=function(e){ku(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new oY(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new iY},t.prototype.next=function(r){var n=this;ix(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=xb(n.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;ix(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;ix(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function get1(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?vO:(this.currentObservers=null,s.push(r),new lm(function(){n.currentObservers=null,yg(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new yb;return r.source=this,r},t.create=function(r,n){return new oY(r,n)},t}(yb);var oY=function(e){ku(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:vO},t}(Ln);var CO={now:function now(){return(CO.delegate||Date).now()},delegate:void 0};var aY=function(e){ku(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(lm);var vb={setInterval:function setInterval1(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=vb.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,Dp([e,t],Np(r))):setInterval.apply(void 0,Dp([e,t],Np(r)))},clearInterval:function clearInterval1(e){var t=vb.delegate;return((t==null?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0};var sY=function(e){ku(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),vb.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&vb.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,yg(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(aY);var EO=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=CO.now,e}();var lY=function(e){ku(t,e);function t(r,n){n===void 0&&(n=EO.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t}(EO);var ROe=new lY(sY),uY=ROe;function cY(e){return e&&Gs(e.schedule)}function dY(e){return _instanceof(e,Date)&&!isNaN(e)}function E7(e,t,r){e===void 0&&(e=0),r===void 0&&(r=uY);var n=-1;return t!=null&&(cY(t)?r=t:n=t),new yb(function(i){var o=dY(e)?+e-r.now():e;o<0&&(o=0);var a=0;return r.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},o)})}var pY=new Ln,fY=function(){return pY.asObservable()},mY=function(){return pY.next()};var hY=new Ln,_b=function(){return hY.asObservable()},um=function(){return hY.next()};var gY=new Ln,T7=function(){return gY.asObservable()},_g=function(){return gY.next()};var xY=new Ln,A7=function(){return xY.asObservable()},I7=function(e){return xY.next(e)};var yY=new Ln,P7=function(){return yY.asObservable()},R7=function(e){return yY.next(e)};var vY=new Ln,M7=function(){return vY.asObservable()},_Y=function(e){return vY.next(e)};var bY=new Ln,O7=function(){return bY.asObservable()},wY=function(e){return bY.next(e)};var SY=new Ln,$7=function(){return SY.asObservable()},N7=function(e,t,r){return SY.next({total:e,completed:t,current:r})};var kY=new Ln,D7=function(){return kY.asObservable()},CY=function(e){return kY.next(e)};var EY=new Ln,TY=function(){return EY.asObservable()},L7=function(e,t){return EY.next({total:e,completed:t})};var WDt=new Ln;var vr=function(e){return typeof e=="string"},bb=function(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r},AY=function(e){return e==null?"":""+e},MOe=function(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})},OOe=/###/g,IY=function(e){return e&&e.indexOf("###")>-1?e.replace(OOe,"."):e},PY=function(e){return!e||vr(e)},wb=function(e,t,r){var n=vr(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(PY(e))return{};var o=IY(n[i]);!e[o]&&r&&(e[o]=new r),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return PY(e)?{}:{obj:e,k:IY(n[i])}},RY=function(e,t,r){var _wb=wb(e,t,Object),n=_wb.obj,i=_wb.k;if(n!==void 0||t.length===1){n[i]=r;return}var o=t[t.length-1],a=t.slice(0,t.length-1),s=wb(e,a,Object);for(;s.obj===void 0&&a.length;)o="".concat(a[a.length-1],".").concat(o),a=a.slice(0,a.length-1),s=wb(e,a,Object),s!=null&&s.obj&&typeof s.obj["".concat(s.k,".").concat(o)]!="undefined"&&(s.obj=void 0);s.obj["".concat(s.k,".").concat(o)]=r},$Oe=function(e,t,r,n){var _wb=wb(e,t,Object),i=_wb.obj,o=_wb.k;i[o]=i[o]||[],i[o].push(r)},z7=function(e,t){var _wb=wb(e,t),r=_wb.obj,n=_wb.k;if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},NOe=function(e,t,r){var n=z7(e,r);return n!==void 0?n:z7(t,r)},zY=function(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?vr(e[n])||_instanceof(e[n],String)||vr(t[n])||_instanceof(t[n],String)?r&&(e[n]=t[n]):zY(e[n],t[n],r):e[n]=t[n]);return e},ox=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},DOe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},LOe=function(e){return vr(e)?e.replace(/[&<>"'\/]/g,function(t){return DOe[t]}):e},AO=/*#__PURE__*/function(){"use strict";function AO1(t){_class_call_check(this,AO1);this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}_create_class(AO1,[{key:"getRegExp",value:function getRegExp(t){var r=this.regExpMap.get(t);if(r!==void 0)return r;var n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}]);return AO1}(),FOe=[" ",",","?","!",";"],zOe=new AO(20),jOe=function(e,t,r){t=t||"",r=r||"";var n=FOe.filter(function(a){return t.indexOf(a)<0&&r.indexOf(a)<0});if(n.length===0)return!0;var i=zOe.getRegExp("(".concat(n.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},IO=function IO1(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;var n=t.split(r),i=e;for(var o=0;o<n.length;){if(!i||(typeof i==="undefined"?"undefined":_type_of(i))!="object")return;var a=void 0,s="";for(var l=o;l<n.length;++l)if(l!==o&&(s+=r),s+=n[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a==="undefined"?"undefined":_type_of(a))>-1&&l<n.length-1)continue;o+=l-o+1;break}i=a}return i},j7=function(e){return e==null?void 0:e.replace("_","-")},UOe={type:"logger",log:function log(e){this.output("log",e)},warn:function warn(e){this.output("warn",e)},error:function error(e){this.output("error",e)},output:function output(e,t){var r,n;(n=(r=console==null?void 0:console[e])==null?void 0:r.apply)==null||n.call(r,console,t)}},sx=/*#__PURE__*/function(){"use strict";function sx1(t){_class_call_check(this,sx1);var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}_create_class(sx1,[{key:"init",value:function init(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||UOe,this.options=r,this.debug=r.debug}},{key:"log",value:function log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}},{key:"warn",value:function warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}},{key:"error",value:function error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}},{key:"deprecate",value:function deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function forward(t,r,n,i){return i&&!this.debug?null:(vr(t[0])&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[r](t))}},{key:"create",value:function create(t){return new sx(this.logger,_object_spread({prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}},{key:"clone",value:function clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new sx(this.logger,t)}}]);return sx1}(),kd=new sx,lx=/*#__PURE__*/function(){"use strict";function lx1(){_class_call_check(this,lx1);this.observers={}}_create_class(lx1,[{key:"on",value:function on1(t,r){var _this=this;return t.split(" ").forEach(function(n){_this.observers[n]||(_this.observers[n]=new Map);var i=_this.observers[n].get(r)||0;_this.observers[n].set(r,i+1)}),this}},{key:"off",value:function off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}},{key:"emit",value:function emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(function(a){var _a1=_sliced_to_array(a,2),s=_a1[0],l=_a1[1];for(var c=0;c<l;c++)s.apply(void 0,_to_consumable_array(n))}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(function(a){var _a1=_sliced_to_array(a,2),s=_a1[0],l=_a1[1];for(var c=0;c<l;c++)s.apply(s,[t].concat(_to_consumable_array(n)))})}}]);return lx1}(),U7=/*#__PURE__*/function(lx1){"use strict";_inherits(U71,lx1);function U71(t){_class_call_check(this,U71);var _this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};_this=_call_super(this,U71),_this.data=t||{},_this.options=r,_this.options.keySeparator===void 0&&(_this.options.keySeparator="."),_this.options.ignoreJSONStructure===void 0&&(_this.options.ignoreJSONStructure=!0);return _this}_create_class(U71,[{key:"addNamespaces",value:function addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function removeNamespaces(t){var r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function getResource(t,r,n){var _s1,_s2;var c,d;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure,s;t.indexOf(".")>-1?s=t.split("."):(s=[t,r],n&&(Array.isArray(n)?(_s1=s).push.apply(_s1,_to_consumable_array(n)):vr(n)&&o?(_s2=s).push.apply(_s2,_to_consumable_array(n.split(o))):s.push(n)));var l=z7(this.data,s);return!l&&!r&&!n&&t.indexOf(".")>-1&&(t=s[0],r=s[1],n=s.slice(2).join(".")),l||!a||!vr(n)?l:IO((d=(c=this.data)==null?void 0:c[t])==null?void 0:d[r],n,o)}},{key:"addResource",value:function addResource(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=[t,r];n&&(s=s.concat(a?n.split(a):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),RY(this.data,s,i),o.silent||this.emit("added",t,r,n,i)}},{key:"addResources",value:function addResources(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var o in n)(vr(n[o])||Array.isArray(n[o]))&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}},{key:"addResourceBundle",value:function addResourceBundle(t,r,n,i,o){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);var l=z7(this.data,s)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?zY(l,n,o):l=_object_spread({},l,n),RY(this.data,s,l),a.silent||this.emit("added",t,r,n)}},{key:"removeResourceBundle",value:function removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}},{key:"getResourceBundle",value:function getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}},{key:"getDataByLanguage",value:function getDataByLanguage(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function hasLanguageSomeTranslations(t){var r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(function(i){return r[i]&&Object.keys(r[i]).length>0})}},{key:"toJSON",value:function toJSON(){return this.data}}]);return U71}(lx),jY={processors:{},addPostProcessor:function addPostProcessor(e){this.processors[e.name]=e},handle:function handle(e,t,r,n,i){var _this=this;return e.forEach(function(o){var a,s;t=(s=(a=_this.processors[o])==null?void 0:a.process(t,r,n,i))!=null?s:t}),t}},MY={},OY=function(e){return!vr(e)&&typeof e!="boolean"&&typeof e!="number"},ux=/*#__PURE__*/function(lx1){"use strict";_inherits(ux1,lx1);function ux1(t){_class_call_check(this,ux1);var _this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_this=_call_super(this,ux1),MOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,_this),_this.options=r,_this.options.keySeparator===void 0&&(_this.options.keySeparator="."),_this.logger=kd.create("translator");return _this}_create_class(ux1,[{key:"changeLanguage",value:function changeLanguage(t){t&&(this.language=t)}},{key:"exists",value:function exists(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;var n=this.resolve(t,r);return(n==null?void 0:n.res)!==void 0}},{key:"extractFromKey",value:function extractFromKey(t,r){var n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");var i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ns||this.options.defaultNS||[],a=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!jOe(t,n,i);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:vr(o)?[o]:o};var c=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:vr(o)?[o]:o}}},{key:"translate",value:function translate(t,r,n){var _this=this;if((typeof r==="undefined"?"undefined":_type_of(r))!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&(r=_object_spread({},r)),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);var i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,_this_extractFromKey=this.extractFromKey(t[t.length-1],r),a=_this_extractFromKey.key,s=_this_extractFromKey.namespaces,l=s[s.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode"){if(d){var I=r.nsSeparator||this.options.nsSeparator;return i?{res:"".concat(l).concat(I).concat(a),usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:"".concat(l).concat(I).concat(a)}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a}var u=this.resolve(t,r),p=u==null?void 0:u.res,m=(u==null?void 0:u.usedKey)||a,h=(u==null?void 0:u.exactUsedKey)||a,g=["[object Number]","[object Function]","[object RegExp]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=r.count!==void 0&&!vr(r.count),_=ux.hasDefaultValue(r),b=y?this.pluralResolver.getSuffix(c,r.count,r):"",w=r.ordinal&&y?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",S=y&&!r.ordinal&&r.count===0,k=S&&r["defaultValue".concat(this.options.pluralSeparator,"zero")]||r["defaultValue".concat(b)]||r["defaultValue".concat(w)]||r.defaultValue,E=p;v&&!p&&_&&(E=k);var C=OY(E),T=Object.prototype.toString.apply(E);if(v&&E&&C&&g.indexOf(T)<0&&!(vr(x)&&Array.isArray(E))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var I1=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,_object_spread_props(_object_spread({},r),{ns:s})):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");return i?(u.res=I1,u.usedParams=this.getUsedParamsDetails(r),u):I1}if(o){var I10=Array.isArray(E),O=I10?[]:{},M=I10?h:m;for(var R in E)if(Object.prototype.hasOwnProperty.call(E,R)){var $="".concat(M).concat(o).concat(R);_&&!p?O[R]=this.translate($,_object_spread_props(_object_spread({},r),{defaultValue:OY(k)?k[R]:void 0,joinArrays:!1,ns:s})):O[R]=this.translate($,_object_spread_props(_object_spread({},r),{joinArrays:!1,ns:s})),O[R]===$&&(O[R]=E[R])}p=O}}else if(v&&vr(x)&&Array.isArray(p))p=p.join(x),p&&(p=this.extendTranslation(p,t,r,n));else{var I11=!1,O1=!1;!this.isValidLookup(p)&&_&&(I11=!0,p=k),this.isValidLookup(p)||(O1=!0,p=a);var R1=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O1?void 0:p,$1=_&&k!==p&&this.options.updateMissing;if(O1||I11||$1){if(this.logger.log($1?"updateKey":"missingKey",c,l,a,$1?k:p),o){var ee=this.resolve(a,_object_spread_props(_object_spread({},r),{keySeparator:!1}));ee&&ee.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var z=[],D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(var ee1=0;ee1<D.length;ee1++)z.push(D[ee1]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(r.lng||this.language):z.push(r.lng||this.language);var L=function(ee,pe,N){var G;var U=_&&N!==p?N:R1;_this.options.missingKeyHandler?_this.options.missingKeyHandler(ee,l,pe,U,$1,r):(G=_this.backendConnector)!=null&&G.saveMissing&&_this.backendConnector.saveMissing(ee,l,pe,U,$1,r),_this.emit("missingKey",ee,l,pe,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?z.forEach(function(ee){var pe=_this.pluralResolver.getSuffixes(ee,r);S&&r["defaultValue".concat(_this.options.pluralSeparator,"zero")]&&pe.indexOf("".concat(_this.options.pluralSeparator,"zero"))<0&&pe.push("".concat(_this.options.pluralSeparator,"zero")),pe.forEach(function(N){L([ee],a+N,r["defaultValue".concat(N)]||k)})}):L(z,a,k))}p=this.extendTranslation(p,t,r,u,n),O1&&p===a&&this.options.appendNamespaceToMissingKey&&(p="".concat(l,":").concat(a)),(O1||I11)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(a):a,I11?p:void 0))}return i?(u.res=p,u.usedParams=this.getUsedParamsDetails(r),u):p}},{key:"extendTranslation",value:function extendTranslation(t,r,n,i,o){var c,d;var a=this;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,_object_spread({},this.options.interpolation.defaultVariables,n),n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(_object_spread_props(_object_spread({},n),{interpolation:_object_spread({},this.options.interpolation,n.interpolation)}));var u=vr(t)&&(((d=n==null?void 0:n.interpolation)==null?void 0:d.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),p;if(u){var h=t.match(this.interpolator.nestingRegexp);p=h&&h.length}var m=n.replace&&!vr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(m=_object_spread({},this.options.interpolation.defaultVariables,m)),t=this.interpolator.interpolate(t,m,n.lng||this.language||i.usedLng,n),u){var h10=t.match(this.interpolator.nestingRegexp),g=h10&&h10.length;p<g&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){var _a1;for(var h=arguments.length,g=new Array(h),x=0;x<h;x++)g[x]=arguments[x];return(o==null?void 0:o[0])===g[0]&&!n.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(g[0]," in key: ").concat(r[0])),null):(_a1=a).translate.apply(_a1,_to_consumable_array(g).concat([r]))},n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,l=vr(s)?[s]:s;return t!=null&&l!=null&&l.length&&n.applyPostProcessor!==!1&&(t=jY.handle(l,t,r,this.options&&this.options.postProcessPassResolved?_object_spread({i18nResolved:_object_spread_props(_object_spread({},i),{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),t}},{key:"resolve",value:function resolve(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,a,s;return vr(t)&&(t=[t]),t.forEach(function(l){if(_this.isValidLookup(n))return;var c=_this.extractFromKey(l,r),d=c.key;i=d;var u=c.namespaces;_this.options.fallbackNS&&(u=u.concat(_this.options.fallbackNS));var p=r.count!==void 0&&!vr(r.count),m=p&&!r.ordinal&&r.count===0,h=r.context!==void 0&&(vr(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:_this.languageUtils.toResolveHierarchy(r.lng||_this.language,r.fallbackLng);u.forEach(function(x){var v,y;_this.isValidLookup(n)||(s=x,!MY["".concat(g[0],"-").concat(x)]&&(v=_this.utils)!=null&&v.hasLoadedNamespace&&!((y=_this.utils)!=null&&y.hasLoadedNamespace(s))&&(MY["".concat(g[0],"-").concat(x)]=!0,_this.logger.warn('key "'.concat(i,'" for languages "').concat(g.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(function(_){var S;if(_this.isValidLookup(n))return;a=_;var b=[d];if((S=_this.i18nFormat)!=null&&S.addLookupKeys)_this.i18nFormat.addLookupKeys(b,d,_,x,r);else{var k;p&&(k=_this.pluralResolver.getSuffix(_,r.count,r));var E="".concat(_this.options.pluralSeparator,"zero"),C="".concat(_this.options.pluralSeparator,"ordinal").concat(_this.options.pluralSeparator);if(p&&(b.push(d+k),r.ordinal&&k.indexOf(C)===0&&b.push(d+k.replace(C,_this.options.pluralSeparator)),m&&b.push(d+E)),h){var T="".concat(d).concat(_this.options.contextSeparator).concat(r.context);b.push(T),p&&(b.push(T+k),r.ordinal&&k.indexOf(C)===0&&b.push(T+k.replace(C,_this.options.pluralSeparator)),m&&b.push(T+E))}}var w;for(;w=b.pop();)_this.isValidLookup(n)||(o=w,n=_this.getResource(_,x,w,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}},{key:"isValidLookup",value:function isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}},{key:"getResource",value:function getResource(t,r,n){var o;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}},{key:"getUsedParamsDetails",value:function getUsedParamsDetails(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!vr(t.replace),i=n?t.replace:t;if(n&&typeof t.count!="undefined"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i=_object_spread({},this.options.interpolation.defaultVariables,i)),!n){i=_object_spread({},i);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;delete i[o]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return i}}],[{key:"hasDefaultValue",value:function hasDefaultValue(t){var r="defaultValue";for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}]);return ux1}(lx),B7=/*#__PURE__*/function(){"use strict";function B71(t){_class_call_check(this,B71);this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kd.create("languageUtils")}_create_class(B71,[{key:"getScriptPartFromCode",value:function getScriptPartFromCode(t){if(t=j7(t),!t||t.indexOf("-")<0)return null;var r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function getLanguagePartFromCode(t){if(t=j7(t),!t||t.indexOf("-")<0)return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function formatLanguageCode(t){if(vr(t)&&t.indexOf("-")>-1){var r;try{r=Intl.getCanonicalLocales(t)[0]}catch(n){}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function getBestMatchFromCodes(t){var _this=this;if(!t)return null;var r;return t.forEach(function(n){if(r)return;var i=_this.formatLanguageCode(n);(!_this.options.supportedLngs||_this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(function(n){if(r)return;var i=_this.getLanguagePartFromCode(n);if(_this.isSupportedCode(i))return r=i;r=_this.options.supportedLngs.find(function(o){if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),vr(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];var n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function toResolveHierarchy(t,r){var _this=this;var n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=function(a){a&&(_this.isSupportedCode(a)?i.push(a):_this.logger.warn("rejecting language code not found in supportedLngs: ".concat(a)))};return vr(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):vr(t)&&o(this.formatLanguageCode(t)),n.forEach(function(a){i.indexOf(a)<0&&o(_this.formatLanguageCode(a))}),i}}]);return B71}(),$Y={zero:0,one:1,two:2,few:3,many:4,other:5},NY={select:function(e){return e===1?"one":"other"},resolvedOptions:function(){return{pluralCategories:["one","other"]}}},PO=/*#__PURE__*/function(){"use strict";function PO1(t){_class_call_check(this,PO1);var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=kd.create("pluralResolver"),this.pluralRulesCache={}}_create_class(PO1,[{key:"addRule",value:function addRule(t,r){this.rules[t]=r}},{key:"clearCache",value:function clearCache(){this.pluralRulesCache={}}},{key:"getRule",value:function getRule(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=j7(t==="dev"?"en":t),i=r.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];var a;try{a=new Intl.PluralRules(n,{type:i})}catch(s){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),NY;if(!t.match(/-|_/))return NY;var l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,r)}return this.pluralRulesCache[o]=a,a}},{key:"needsPlural",value:function needsPlural(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}},{key:"getPluralFormsOfKey",value:function getPluralFormsOfKey(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function getSuffixes(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort(function(i,o){return $Y[i]-$Y[o]}).map(function(i){return"".concat(_this.options.prepend).concat(r.ordinal?"ordinal".concat(_this.options.prepend):"").concat(i)}):[]}},{key:"getSuffix",value:function getSuffix(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(t,n);return i?"".concat(this.options.prepend).concat(n.ordinal?"ordinal".concat(this.options.prepend):"").concat(i.select(r)):(this.logger.warn("no plural rule found for: ".concat(t)),this.getSuffix("dev",r,n))}}]);return PO1}(),DY=function DY1(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=NOe(e,t,r);return!o&&i&&vr(r)&&(o=IO(e,r,n),o===void 0&&(o=IO(t,r,n))),o},TO=function(e){return e.replace(/\$/g,"$$$$")},RO=/*#__PURE__*/function(){"use strict";function RO1(){_class_call_check(this,RO1);var r;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kd.create("interpolator"),this.options=t,this.format=((r=t==null?void 0:t.interpolation)==null?void 0:r.format)||function(n){return n},this.init(t)}_create_class(RO1,[{key:"init",value:function init(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var _t_interpolation=t.interpolation,r=_t_interpolation.escape,n=_t_interpolation.escapeValue,i=_t_interpolation.useRawValueToEscape,o=_t_interpolation.prefix,a=_t_interpolation.prefixEscaped,s=_t_interpolation.suffix,l=_t_interpolation.suffixEscaped,c=_t_interpolation.formatSeparator,d=_t_interpolation.unescapeSuffix,u=_t_interpolation.unescapePrefix,p=_t_interpolation.nestingPrefix,m=_t_interpolation.nestingPrefixEscaped,h=_t_interpolation.nestingSuffix,g=_t_interpolation.nestingSuffixEscaped,x=_t_interpolation.nestingOptionsSeparator,v=_t_interpolation.maxReplaces,y=_t_interpolation.alwaysFormat;this.escape=r!==void 0?r:LOe,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?ox(o):a||"{{",this.suffix=s?ox(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?ox(p):m||ox("$t("),this.nestingSuffix=h?ox(h):g||ox(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}},{key:"reset",value:function reset(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function resetRegExp(){var t=function(r,n){return(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g")};this.regexp=t(this.regexp,"".concat(this.prefix,"(.+?)").concat(this.suffix)),this.regexpUnescape=t(this.regexpUnescape,"".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix)),this.nestingRegexp=t(this.nestingRegexp,"".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix))}},{key:"interpolate",value:function interpolate(t,r,n,i){var _this=this;var m;var o,a,s,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=function(h){if(h.indexOf(_this.formatSeparator)<0){var y=DY(r,l,h,_this.options.keySeparator,_this.options.ignoreJSONStructure);return _this.alwaysFormat?_this.format(y,void 0,n,_object_spread_props(_object_spread({},i,r),{interpolationkey:h})):y}var g=h.split(_this.formatSeparator),x=g.shift().trim(),v=g.join(_this.formatSeparator).trim();return _this.format(DY(r,l,x,_this.options.keySeparator,_this.options.ignoreJSONStructure),v,n,_object_spread_props(_object_spread({},i,r),{interpolationkey:x}))};this.resetRegExp();var d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=i==null?void 0:i.interpolation)==null?void 0:m.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(h){return TO(h)}},{regex:this.regexp,safeValue:function(h){return _this.escapeValue?TO(_this.escape(h)):TO(h)}}].forEach(function(h){for(s=0;o=h.regex.exec(t);){var g=o[1].trim();if(a=c(g),a===void 0)if(typeof d=="function"){var v=d(t,o,i);a=vr(v)?v:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))a="";else if(u){a=o[0];continue}else _this.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(t)),a="";else!vr(a)&&!_this.useRawValueToEscape&&(a=AY(a));var x=h.safeValue(a);if(t=t.replace(o[0],x),u?(h.regex.lastIndex+=a.length,h.regex.lastIndex-=o[0].length):h.regex.lastIndex=0,s++,s>=_this.maxReplaces)break}}),t}},{key:"nest",value:function nest(t,r){var _this=this;var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a,s=function(l,c){var g;var d=_this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;var u=l.split(new RegExp("".concat(d,"[ ]*{"))),p="{".concat(u[1]);l=u[0],p=_this.interpolate(p,a);var m=p.match(/'/g),h=p.match(/"/g);(((g=m==null?void 0:m.length)!=null?g:0)%2===0&&!h||h.length%2!==0)&&(p=p.replace(/'/g,'"'));try{a=JSON.parse(p),c&&(a=_object_spread({},c,a))}catch(x){return _this.logger.warn("failed parsing options string in nesting for key ".concat(l),x),"".concat(l).concat(d).concat(p)}return a.defaultValue&&a.defaultValue.indexOf(_this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){var l=[];a=_object_spread({},n),a=a.replace&&!vr(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;var c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){var d=i[1].split(this.formatSeparator).map(function(u){return u.trim()});i[1]=d.shift(),l=d,c=!0}if(o=r(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!vr(o))return o;vr(o)||(o=AY(o)),o||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),o=""),c&&(o=l.reduce(function(d,u){return _this.format(d,u,n.lng,_object_spread_props(_object_spread({},n),{interpolationkey:i[1].trim()}))},o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}]);return RO1}(),BOe=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(function(a){if(a){var _a_split=_to_array(a.split(":")),s=_a_split[0],l=_a_split.slice(1),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=c),c==="false"&&(r[d]=!1),c==="true"&&(r[d]=!0),isNaN(c)||(r[d]=parseInt(c,10))}})}return{formatName:t,formatOptions:r}},ax=function(e){var t={};return function(r,n,i){var o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o=_object_spread_props(_object_spread({},o),_define_property({},i.interpolationkey,void 0)));var a=n+JSON.stringify(o),s=t[a];return s||(s=e(j7(n),i),t[a]=s),s(r)}},MO=/*#__PURE__*/function(){"use strict";function MO1(){_class_call_check(this,MO1);var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kd.create("formatter"),this.options=t,this.formats={number:ax(function(r,n){var i=new Intl.NumberFormat(r,_object_spread({},n));return function(o){return i.format(o)}}),currency:ax(function(r,n){var i=new Intl.NumberFormat(r,_object_spread_props(_object_spread({},n),{style:"currency"}));return function(o){return i.format(o)}}),datetime:ax(function(r,n){var i=new Intl.DateTimeFormat(r,_object_spread({},n));return function(o){return i.format(o)}}),relativetime:ax(function(r,n){var i=new Intl.RelativeTimeFormat(r,_object_spread({},n));return function(o){return i.format(o,n.range||"day")}}),list:ax(function(r,n){var i=new Intl.ListFormat(r,_object_spread({},n));return function(o){return i.format(o)}})},this.init(t)}_create_class(MO1,[{key:"init",value:function init(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}},{key:"add",value:function add(t,r){this.formats[t.toLowerCase().trim()]=r}},{key:"addCached",value:function addCached(t,r){this.formats[t.toLowerCase().trim()]=ax(r)}},{key:"format",value:function format(t,r,n){var _this=this;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=r.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(function(s){return s.indexOf(")")>-1})){var s=o.findIndex(function(l){return l.indexOf(")")>-1});o[0]=[o[0]].concat(_to_consumable_array(o.splice(1,s))).join(this.formatSeparator)}return o.reduce(function(s,l){var u;var _BOe=BOe(l),c=_BOe.formatName,d=_BOe.formatOptions;if(_this.formats[c]){var p=s;try{var _$m=((u=i==null?void 0:i.formatParams)==null?void 0:u[i.interpolationkey])||{},h=_$m.locale||_$m.lng||i.locale||i.lng||n;p=_this.formats[c](s,h,_object_spread({},d,i,_$m))}catch(m){_this.logger.warn(m)}return p}else _this.logger.warn("there was no format function for ".concat(c));return s},t)}}]);return MO1}(),qOe=function(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},OO=/*#__PURE__*/function(lx1){"use strict";_inherits(OO1,lx1);function OO1(t,r,n){_class_call_check(this,OO1);var _this;var o,a;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};_this=_call_super(this,OO1),_this.backend=t,_this.store=r,_this.services=n,_this.languageUtils=n.languageUtils,_this.options=i,_this.logger=kd.create("backendConnector"),_this.waitingReads=[],_this.maxParallelReads=i.maxParallelReads||10,_this.readingCalls=0,_this.maxRetries=i.maxRetries>=0?i.maxRetries:5,_this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,_this.state={},_this.queue=[],(a=(o=_this.backend)==null?void 0:o.init)==null||a.call(o,n,i.backend,i);return _this}_create_class(OO1,[{key:"queueLoad",value:function queueLoad(t,r,n,i){var _this=this;var o={},a={},s={},l={};return t.forEach(function(c){var d=!0;r.forEach(function(u){var p="".concat(c,"|").concat(u);!n.reload&&_this.store.hasResourceBundle(c,u)?_this.state[p]=2:_this.state[p]<0||(_this.state[p]===1?a[p]===void 0&&(a[p]=!0):(_this.state[p]=1,d=!1,a[p]===void 0&&(a[p]=!0),o[p]===void 0&&(o[p]=!0),l[u]===void 0&&(l[u]=!0)))}),d||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function loaded(t,r,n){var i=t.split("|"),o=i[0],a=i[1];r&&this.emit("failedLoading",o,a,r),!r&&n&&this.store.addResourceBundle(o,a,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);var s={};this.queue.forEach(function(l){$Oe(l.loaded,[o],a),qOe(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(function(c){s[c]||(s[c]={});var d=l.loaded[c];d.length&&d.forEach(function(u){s[c][u]===void 0&&(s[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function read(t,r,n){var _this=this;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:a});return}this.readingCalls++;var s=function(c,d){if(_this.readingCalls--,_this.waitingReads.length>0){var u=_this.waitingReads.shift();_this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&d&&i<_this.maxRetries){setTimeout(function(){_this.read.call(_this,t,r,n,i+1,o*2,a)},o);return}a(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{var _$c=l(t,r);_$c&&typeof _$c.then=="function"?_$c.then(function(d){return s(null,d)}).catch(s):s(null,_$c)}catch(c){s(c)}return}return l(t,r,s)}},{key:"prepareLoading",value:function prepareLoading(t,r){var _this=this;var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();vr(t)&&(t=this.languageUtils.toResolveHierarchy(t)),vr(r)&&(r=[r]);var o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(function(a){_this.loadOne(a)})}},{key:"load",value:function load(t,r,n){this.prepareLoading(t,r,{},n)}},{key:"reload",value:function reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}},{key:"loadOne",value:function loadOne(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,function(a,s){a&&_this.logger.warn("".concat(r,"loading namespace ").concat(o," for language ").concat(i," failed"),a),!a&&s&&_this.logger.log("".concat(r,"loaded namespace ").concat(o," for language ").concat(i),s),_this.loaded(t,a,s)})}},{key:"saveMissing",value:function saveMissing(t,r,n,i,o){var l,c,d,u,p;var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((u=(d=this.services)==null?void 0:d.utils)!=null&&u.hasLoadedNamespace(r))){this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((p=this.backend)!=null&&p.create){var m=_object_spread_props(_object_spread({},a),{isUpdate:o}),h=this.backend.create.bind(this.backend);if(h.length<6)try{var _$g;h.length===5?_$g=h(t,r,n,i,m):_$g=h(t,r,n,i),_$g&&typeof _$g.then=="function"?_$g.then(function(x){return s(null,x)}).catch(s):s(null,_$g)}catch(g){s(g)}else h(t,r,n,i,s,m)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}]);return OO1}(lx),LY=function(){return{debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(_type_of(e[1])=="object"&&(t=e[1]),vr(e[1])&&(t.defaultValue=e[1]),vr(e[2])&&(t.tDescription=e[2]),_type_of(e[2])=="object"||_type_of(e[3])=="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(n){t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:function(e){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}},FY=function(e){var t,r;return vr(e.ns)&&(e.ns=[e.ns]),vr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),vr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((r=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:r.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},F7=function(){},WOe=function(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},bg=/*#__PURE__*/function(lx1){"use strict";_inherits(bg1,lx1);function bg1(){_class_call_check(this,bg1);var _this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(_this=_call_super(this,bg1),_this.options=FY(t),_this.services={},_this.logger=kd,_this.modules={external:[]},WOe(_this),r&&!_this.isInitialized&&!t.isClone){if(!_this.options.initAsync)return _possible_constructor_return(_this,(_this.init(t,r),_this));setTimeout(function(){_this.init(t,r)},0)}return _this}_create_class(bg1,[{key:"init",value:function init(){var _this=this;var t=this;var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),r.defaultNS==null&&r.ns&&(vr(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));var i=LY();this.options=_object_spread({},i,this.options,FY(r)),this.options.interpolation=_object_spread({},i.interpolation,this.options.interpolation),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);var o=function(d){return d?typeof d=="function"?new d:d:null};if(!this.options.isClone){this.modules.logger?kd.init(o(this.modules.logger),this.options):kd.init(null,this.options);var d;this.modules.formatter?d=this.modules.formatter:d=MO;var u=new B7(this.options);this.store=new U7(this.options.resources,this.options);var p=this.services;p.logger=kd,p.resourceStore=this.store,p.languageUtils=u,p.pluralResolver=new PO(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=o(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new RO(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new OO(o(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(m){var _t1;for(var h=arguments.length,g=new Array(h>1?h-1:0),x=1;x<h;x++)g[x-1]=arguments[x];(_t1=t).emit.apply(_t1,[m].concat(_to_consumable_array(g)))}),this.modules.languageDetector&&(p.languageDetector=o(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=o(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new ux(this.services,this.options),this.translator.on("*",function(m){var _t1;for(var h=arguments.length,g=new Array(h>1?h-1:0),x=1;x<h;x++)g[x-1]=arguments[x];(_t1=t).emit.apply(_t1,[m].concat(_to_consumable_array(g)))}),this.modules.external.forEach(function(m){m.init&&m.init(_this)})}if(this.format=this.options.interpolation.format,n||(n=F7),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var d10=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d10.length>0&&d10[0]!=="dev"&&(this.options.lng=d10[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(d){_this[d]=function(){var _t_store;return(_t_store=t.store)[d].apply(_t_store,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(d){_this[d]=function(){var _t_store;return(_t_store=t.store)[d].apply(_t_store,arguments),t}});var l=bb(),c=function(){var d=function(u,p){_this.isInitializing=!1,_this.isInitialized&&!_this.initializedStoreOnce&&_this.logger.warn("init: i18next is already initialized. You should call init just once!"),_this.isInitialized=!0,_this.options.isClone||_this.logger.log("initialized",_this.options),_this.emit("initialized",_this.options),l.resolve(p),n(u,p)};if(_this.languages&&!_this.isInitialized)return d(null,_this.t.bind(_this));_this.changeLanguage(_this.options.lng,d)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}},{key:"loadResources",value:function loadResources(t){var _this=this;var o,a;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F7,i=vr(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();var s=[],l=function(c){if(!c||c==="cimode")return;_this.services.languageUtils.toResolveHierarchy(c).forEach(function(u){u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(d){return l(d)}),(a=(o=this.options.preload)==null?void 0:o.forEach)==null||a.call(o,function(c){return l(c)}),this.services.backendConnector.load(s,this.options.ns,function(c){!c&&!_this.resolvedLanguage&&_this.language&&_this.setResolvedLanguage(_this.language),n(c)})}else n(null)}},{key:"reloadResources",value:function reloadResources(t,r,n){var i=bb();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=F7),this.services.backendConnector.reload(t,r,function(o){i.resolve(),n(o)}),i}},{key:"use",value:function use1(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&jY.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(var r=0;r<this.languages.length;r++){var n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function changeLanguage(t,r){var _this=this;var n=this;this.isLanguageChangingTo=t;var i=bb();this.emit("languageChanging",t);var o=function(l){_this.language=l,_this.languages=_this.services.languageUtils.toResolveHierarchy(l),_this.resolvedLanguage=void 0,_this.setResolvedLanguage(l)},a=function(l,c){c?(o(c),_this.translator.changeLanguage(c),_this.isLanguageChangingTo=void 0,_this.emit("languageChanged",c),_this.logger.log("languageChanged",c)):_this.isLanguageChangingTo=void 0,i.resolve(function(){var _n;return(_n=n).t.apply(_n,arguments)}),r&&r(l,function(){var _n;return(_n=n).t.apply(_n,arguments)})},s=function(l){var d,u;!t&&!l&&_this.services.languageDetector&&(l=[]);var c=vr(l)?l:_this.services.languageUtils.getBestMatchFromCodes(l);c&&(_this.language||o(c),_this.translator.language||_this.translator.changeLanguage(c),(u=(d=_this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||u.call(d,c)),_this.loadResources(c,function(p){a(p,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}},{key:"getFixedT",value:function getFixedT(t,r,n){var i=this;var o=function o10(a,s){var l;if((typeof s==="undefined"?"undefined":_type_of(s))!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),u=2;u<c;u++)d[u-2]=arguments[u];l=i.options.overloadTranslationOptionHandler([a,s].concat(d))}else l=_object_spread({},s);l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||o.keyPrefix);var p=i.options.keySeparator||".",m;return l.keyPrefix&&Array.isArray(a)?m=a.map(function(h){return"".concat(l.keyPrefix).concat(p).concat(h)}):m=l.keyPrefix?"".concat(l.keyPrefix).concat(p).concat(a):a,i.t(m,l)};return vr(t)?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}},{key:"t",value:function t(){var _i1;var i;for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(i=this.translator)==null?void 0:(_i1=i).translate.apply(_i1,_to_consumable_array(r))}},{key:"exists",value:function exists(){var _i1;var i;for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(i=this.translator)==null?void 0:(_i1=i).exists.apply(_i1,_to_consumable_array(r))}},{key:"setDefaultNamespace",value:function setDefaultNamespace(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function hasLoadedNamespace(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var a=function(s,l){var c=_this.services.backendConnector.state["".concat(s,"|").concat(l)];return c===-1||c===0||c===2};if(r.precheck){var s=r.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,t)&&(!i||a(o,t)))}},{key:"loadNamespaces",value:function loadNamespaces(t,r){var _this=this;var n=bb();return this.options.ns?(vr(t)&&(t=[t]),t.forEach(function(i){_this.options.ns.indexOf(i)<0&&_this.options.ns.push(i)}),this.loadResources(function(i){n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function loadLanguages(t,r){var _this=this;var n=bb();vr(t)&&(t=[t]);var i=this.options.preload||[],o=t.filter(function(a){return i.indexOf(a)<0&&_this.services.languageUtils.isSupportedCode(a)});return o.length?(this.options.preload=i.concat(o),this.loadResources(function(a){n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}},{key:"dir",value:function dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";var r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((o=this.services)==null?void 0:o.languageUtils)||new B7(LY());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function cloneInstance(){var _this=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F7,n=t.forkResourceStore;n&&delete t.forkResourceStore;var i=_object_spread_props(_object_spread({},this.options,t),{isClone:!0}),o=new bg(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(function(s){o[s]=_this[s]}),o.services=_object_spread({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){var s=Object.keys(this.store.data).reduce(function(l,c){return l[c]=_object_spread({},_this.store.data[c]),Object.keys(l[c]).reduce(function(d,u){return d[u]=_object_spread({},l[c][u]),d},{})},{});o.store=new U7(s,i),o.services.resourceStore=o.store}return o.translator=new ux(o.services,i),o.translator.on("*",function(s){var _o1;for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d<l;d++)c[d-1]=arguments[d];(_o1=o).emit.apply(_o1,[s].concat(_to_consumable_array(c)))}),o.init(i,r),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}],[{key:"createInstance",value:function createInstance(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new bg(t,r)}}]);return bg1}(lx),fa=bg.createInstance();fa.createInstance=bg.createInstance;var iLt=fa.createInstance,oLt=fa.dir,aLt=fa.init,sLt=fa.loadResources,lLt=fa.reloadResources,uLt=fa.use,cLt=fa.changeLanguage,dLt=fa.getFixedT,pLt=fa.t,fLt=fa.exists,mLt=fa.setDefaultNamespace,hLt=fa.hasLoadedNamespace,gLt=fa.loadNamespaces,xLt=fa.loadLanguages;var q7={errors:{filenameUnsupportedChars:"File {{path}} contains unsupported characters: {{chars}}"},settings:{language:{name:"Language",desc:"Select interface language",auto:"Auto detect"},account:{name:"Account",desc:"Enter your WebDAV account",placeholder:"Enter your account"},credential:{name:"Credential",desc:"Enter the app password you created in Nutstore (Account info → Security options), not your login password.",placeholder:"Your Nutstore app password"},checkConnection:{name:"Check connection",desc:"Click to check WebDAV connection",success:"WebDAV connection successful",failure:"WebDAV connection failed",successButton:"Connected ✓",failureButton:"Failed \xd7"},remoteDir:{name:"Remote directory",desc:"Which Nutstore folder this vault syncs with. Use the folder button to pick one visually.",placeholder:"e.g. /MyNotes"},login:{name:"Login",success:"Login successful",failure:"Login failed, please try again"},loginMode:{name:"Login mode",manual:"Manual input",sso:"Single sign-on"},enterpriseBaseUrl:{name:"Nutstore Enterprise",desc:"Optional Base URL for Nutstore Enterprise. Leave empty to use the default endpoint. Example: https://dav.jianguoyun.com",action:"Set",modalTitle:"Set Nutstore Enterprise Base URL",placeholder:"For example https://dav.jianguoyun.com",invalid:"Invalid Base URL",invalidWithReason:"Invalid Base URL: {{reason}}",errors:{invalidFormat:"enter a complete server address, for example: https://dav.jianguoyun.com",unsupportedProtocol:"the address must start with http:// or https://"}},ssoStatus:{loggedIn:"Logged in",notLoggedIn:"Not logged in",logout:"Logout",logoutSuccess:"Logged out successfully"},backupWarning:{name:"Backup warning",desc:"⚠️ Note: Sync process will modify or delete local files. Please backup important files before syncing."},conflictStrategy:{name:"Conflict resolution strategy",desc:"Choose how to resolve file conflicts. \nNote: We recommend backing up important files before using auto-merge to prevent data loss.",noConflictMerge:"Conflict-free merge",diff3:"Auto-merge (keeps both sides' edits, marked inline)",localPriority:"Local priority (overwrite server)",serverPriority:"Server priority (overwrite local)"},confirmBeforeSync:{name:"Confirm before sync",desc:"Show pending tasks and execute after confirmation"},confirmBeforeDeleteInAutoSync:{name:"Confirm before deleting files during auto-sync",desc:"Show a confirmation dialog when local files are about to be deleted during auto-sync, allowing you to choose to delete or re-upload them"},realtimeSync:{name:"Real-time sync",desc:"Automatically sync changes as soon as files are modified"},syncMode:{name:"Sync mode",desc:"Loose mode is faster when you have many files: it skips files with the same name and size that were never synced. Strict mode compares everything.",strict:"Strict",loose:"Loose"},syncPolicy:{name:"Sync policy",desc:'Controls how changes are shared between this device and the cloud. Policies with "Override" or "Revert" delete files on the other side — use with care.',twoWay:"Two Way",sendOnly:"Send Only",sendOnlyOverrideChanges:"Send Only: Override Changes",receiveOnly:"Receive Only",receiveOnlyRevertLocalChanges:"Receive Only: Revert Local Changes",modal:{title:"Confirm sync policy",twoWayDesc:"Sync rules: two-way sync\n\n• Local-only change → update the cloud\n• Cloud-only change → update the local vault\n• Both local and cloud changed → use the configured conflict strategy\n• One side deleted, the other unchanged → propagate the deletion\n• One side deleted, the other changed → keep the changed copy and restore the deleted side",sendOnlyDesc:"Sync rules: local → cloud (protect cloud-side changes)\n\n• Local new or modified file, unless the cloud copy was independently deleted → upload to the cloud\n• Cloud-only new or modified file → preserve it; do not download it\n• Both local and cloud changed → skip and preserve the cloud copy\n• Local deleted, cloud unchanged → delete the cloud copy\n• Local deleted, cloud also changed → skip and preserve the cloud copy\n• A file with sync history that was deleted in the cloud → preserve the cloud deletion; it is not restored unless you choose “Send Only: Override Changes”\n\nBest for: local as source of truth while protecting independent cloud changes.",sendOnlyOverrideChangesDesc:"Sync rules: cloud ← current local state\n\n• Local files → create or overwrite the cloud copy\n• Cloud exists, local does not → delete the cloud copy\n• Same path differs on both sides → use the local copy\n\n⚠️ May delete cloud-only content.\nUse when you need the cloud to match this device exactly.",receiveOnlyDesc:"Sync rules: cloud → local (protect local-side changes)\n\n• Cloud new or modified file, unless the local copy has a deletion to protect → download to the local vault\n• Local-only new or modified file → preserve it; do not upload it\n• Both local and cloud changed → skip and preserve the local copy\n• Cloud deleted, local unchanged → delete the local copy\n• Cloud deleted, local also changed → skip and preserve the local copy\n• A file with sync history that was deleted locally → preserve the local deletion; it is not restored unless you choose “Receive Only: Revert Local Changes”\n\nBest for: cloud as source of truth while protecting independent local changes.",receiveOnlyRevertLocalChangesDesc:"Sync rules: local ← current cloud state\n\n• Cloud files → create or overwrite the local copy\n• Local exists, cloud does not → delete the local copy\n• Same path differs on both sides → use the cloud copy\n\n⚠️ May delete local-only content.\nUse when you need the local vault to match the cloud exactly.",confirm:"Confirm",cancel:"Cancel"}},startupSyncDelay:{name:"Auto-sync on startup (seconds)",desc:"Set the number of seconds after startup to automatically perform a sync. Set to 0 to disable auto-sync on startup.",placeholder:"Enter seconds (e.g., 5, 0 to disable)",invalidValue:"Invalid value, reset to 0",exceedsMax:"Value exceeds maximum limit of {{max}} seconds (1 day), automatically adjusted"},autoSyncInterval:{name:"Auto-sync interval (minutes)",desc:"Set the interval for automatic background synchronization (in minutes). Set to 0 to disable automatic sync.",placeholder:"Enter minutes (e.g., 5, 0 to disable)",invalidValue:"Invalid value, reset to 0",exceedsMax:"Value exceeds maximum limit of {{max}} minutes (1 day), automatically adjusted"},sections:{account:"Account",common:"General",filters:"Filter rules",ai:"AI"},tabs:{sync:"Sync",ai:"AI",troubleshooting:"Troubleshoot"},ai:{saved:"AI settings saved",none:"Not set",unnamedProvider:"Unnamed provider",unnamedModel:"Unnamed model",defaultModel:{name:"Default model",desc:"Optional model selected for new chat sessions"},nutstoreLlmGateway:{name:"Nutstore AI (Experimental)",providerName:"Nutstore",desc:"Authorize to use models provided by Nutstore.",pendingDesc:"Finish authorization in your browser. Current code: {{code}}",connectedDesc:"Authorized with {{count}} model(s) available.",authorize:"Authorize",authorizing:"Authorizing...",openAuthorizationPage:"Open authorization page",cancelAuthorization:"Cancel authorization",authorized:"Nutstore AI authorized",disconnect:"Disconnect",disconnected:"Nutstore AI disconnected",refreshModels:"Refresh",betaModal:{title:"Feature in Beta",message:"Nutstore AI is currently in beta and not yet available to all users. If you are not on the beta list, you may not be able to use the feature after authorizing. We are gradually opening access — please check back later.",cancel:"Cancel",confirm:"I understand, continue"},errors:{authorizationRequired:"Authorize Nutstore AI first",authorizationExpired:"Nutstore AI authorization expired. Start again.",authorizationFailed:"Nutstore AI authorization failed: {{code}} {{message}}",missingClientId:"Missing LLM_GATEWAY_CLIENT_ID. Nutstore AI authorization cannot start.",modelsFailed:"Failed to fetch Nutstore AI models: {{status}}",emptyModels:"Nutstore AI did not return any available models",refreshFailed:"Failed to refresh Nutstore AI models"}},providers:{name:"Providers",desc:"Manage available AI providers",summary:"{{count}} provider(s) configured",emptyHint:"No providers configured yet. Click “Manage providers” to add one.",manage:"Manage providers",add:"Add provider",refreshPresetName:"Get latest model list",refreshPresetDesc:"Get the latest model list.",refreshPresetModels:"Get model list",refreshPresetModelsLoading:"Fetching...",refreshPresetModelsSuccess:"Fetched ✓ providers {{providers}} models {{models}}",refreshPresetModelsFailure:"Failed \xd7",presetModelsRefreshFailed:"Update failed. Continuing with local/built-in model list.",presetModelsRefreshFailedWithReason:"Update failed. Continuing with local/built-in model list: {{reason}}",empty:"No provider configured yet.",defaultEndpoint:"Default endpoint",presetCustom:"Custom",updateModels:"Update models",updateModelsHint:"{{count}} preset model(s) can be added to this provider.",updateModelsSuccess:"{{count}} model(s) added"},provider:{name:"Provider name",desc:"Label shown in the chatbox",baseUrl:{name:"Base URL",desc:"Optional override, for example https://api.openai.com/v1"},apiKey:{name:"API key",desc:"Secret used for requests"},allowBrowserCors:{name:"Allow browser CORS requests",desc:"Prefer native browser fetch for providers that support CORS, enabling streaming output"},apiFormat:{name:"API format",desc:"Protocol used to talk to this provider",openaiChatCompletions:"OpenAI Chat Completions",openaiResponses:"OpenAI Responses",anthropic:"Anthropic Messages",other:"Other ({{npm}})"}},models:{name:"Models",desc:"Models available under this provider",add:"Add model",empty:"No model configured yet."},model:{id:"Model ID",idDesc:"Model identifier sent to the API (e.g. gpt-4o)",inputModalities:"Input modalities"},modals:{confirmDeleteLabel:"Confirm",providers:{title:"Providers",updateModelsTitle:"Sync preset models",updateModelsDesc:"{{count}} model(s) will be added to {{provider}}. Please confirm the new models below:",updateModelsConfirm:"Add models"},provider:{createTitle:"Create provider",editTitle:"Edit provider",edit:"Edit",saved:"Provider saved",deleted:"Provider deleted",corsConfirmTitle:"Enable browser CORS requests",corsConfirmMessage:"Not every provider allows direct browser cross-origin access. When enabled, the plugin will prefer native browser fetch to support streaming output. If this provider stops working afterward, return here and turn this option off.",corsConfirmEnable:"Enable"},model:{createTitle:"Create model",editTitle:"Edit model",edit:"Edit",deleted:"Model deleted"}},mcp:{name:"MCP servers",summary:"{{count}} server(s) configured",manage:"Manage MCP servers",manager:{title:"MCP servers",add:"Add server",empty:"No MCP server configured yet.",configFileHint:"Stored in {{path}}. You can also ask the AI in chat to edit this file.",parseError:"Failed to parse {{path}}: {{reason}}",statusDisabled:"disabled",statusConnected:"{{count}} tool(s)",statusError:"connection failed: {{reason}}",test:"Test",testSuccess:"Connected: {{count}} tool(s) available",testFailed:"Connection failed: {{reason}}"},editor:{createTitle:"Add MCP server",editTitle:"Edit MCP server",serverName:"Server name",serverNameDesc:"Letters, numbers, hyphens and underscores only",url:"URL",urlDesc:"Streamable HTTP endpoint of the MCP server",headers:"Headers",headersDesc:"Custom HTTP headers, e.g. Authorization",headerKeyPlaceholder:"Header name",headerValuePlaceholder:"Header value",addHeader:"Add header",removeHeader:"Remove header",enabled:"Enabled"},errors:{emptyName:"Server name cannot be empty",invalidName:"Server name may only contain letters, numbers, hyphens and underscores",duplicateName:"A server with this name already exists",emptyUrl:"URL cannot be empty",invalidUrl:"Invalid URL"}},yolo:{name:"Full access",desc:"⚠️ When on, the AI can edit files and change plugin settings without asking for confirmation each time."},subagents:{heading:"Subagents",explorer:{name:"Explorer",desc:"A read-only agent for investigating vault contents.",model:{name:"Explorer model",desc:"Leave blank to inherit the model of the agent that dispatches the task."}},memory:{name:"Memory",desc:"An agent for retrieving and maintaining cross-session preferences, conventions and decisions.",model:{name:"Memory model",desc:"Leave blank to inherit the model of the agent that dispatches the task."}}},errors:{saveFailed:"Failed to save AI settings",saveFailedWithReason:"Failed to save AI settings: {{reason}}",invalidProvidersConfig:"AI provider configuration is invalid. Please fix it in settings. Details: {{reason}}",emptyModelId:"Model ID cannot be empty",duplicateModelId:"A model with this ID already exists",emptyProviderId:"Provider name cannot be empty",duplicateProviderId:"A provider with this name already exists",reservedProviderId:"This provider name is reserved by Nutstore AI. Use another name.",providerNotFoundForProtocolOpen:"Provider not found. It may have been deleted or renamed: {{providerId}}",networkDisconnected:"Network connection unavailable. Check your connection and try again.",browserCorsFallbackToBuiltinTransport:"Browser CORS request failed. Temporarily fell back to the built-in request transport.",browserCorsFailedWithDisableLink:"Browser CORS request failed. [Open this provider and disable CORS]({{link}})."}},logout:{confirmTitle:"Confirm logout",confirmMessage:"Are you sure you want to log out? You will need to log in again to continue syncing.",confirm:"Confirm logout",cancel:"Cancel"},help:{name:"How to get WebDAV account and credential?"},filters:{name:"Filter rules",desc:'Choose which files and folders are skipped or forced into sync. Use simple paths or wildcards, e.g. "图片" or "*.tmp". The last matching rule wins; the Aa switch controls case sensitivity.',add:"Add rule",remove:"Remove",confirmRemove:"Confirm remove",edit:"Edit rules",toggle:"Enable or disable this rule",save:"Save",cancel:"Cancel",placeholder:"e.g.: .DS_Store, *.pdf",types:{exclude:"Exclude",include:"Include"}},configDirSync:{name:"Config directory sync",desc:"Control whether {{configDir}} is included in sync.",none:"Do not sync",bookmarks:"Sync bookmarks only",all:"Sync all",bookmarksTitle:"Enable bookmark sync",bookmarksDesc:"Only {{configDir}}/bookmarks.json will be synced. Other config files are not affected.",warnTitle:"Enable full config directory sync?",warnSyncs:"What syncs: plugin settings (data.json), plugin binaries (main.js), themes, snippets, and all other config files.",warnExcludes:"Auto-excluded: {{configDir}}/plugins/**/node_modules, {{configDir}}/plugins/**/.git, and {{configDir}}/plugins/**/.pnpm-store.",warnConflict:"Conflict resolution: when both sides have changes, the more recently modified version wins and the other side is overwritten.",warnRisk:"Risks: running Obsidian on multiple devices simultaneously increases conflict risk; config changes may require restarting Obsidian to take effect.",warnPruned:"Rule `{{rule}}` excludes {{configDir}} itself, so the config folder won't sync. To sync the config folder, disable this rule in the filter rules first.",syncNotice:"Config folder won't sync: rule `{{rule}}` excludes {{configDir}}. Disable this rule first to sync it.",confirm:"Enable",cancel:"Cancel"},skipLargeFiles:{name:"Skip large files",desc:"Files larger than this are not synced, e.g. 100MB or 1GB. Lower it if sync is slow or error-prone.",placeholder:"e.g., 10 MiB or 500 KiB",invalidFormat:'Invalid file size format. Please use formats like "10MB" or "500KB"',exceedsMaxSize:"File size exceeds maximum limit of 500MB"},mobileAppDownloadFileChunkSize:{name:"Mobile download chunk size (advanced)",desc:"Only change this when mobile downloads fail. Controls how large each download chunk is.",placeholder:"e.g., 16 MiB",invalidFormat:'Invalid chunk size format. Please use formats like "16 MiB" or "512 KiB"',belowMinSize:"Chunk size cannot be below 64 KiB and was adjusted",exceedsMaxSize:"Chunk size cannot exceed 64 MiB and was adjusted"},log:{title:"Debug logs",name:"Console logs",desc:"View console output and debug information",saveToNote:"Save to note",savedToNote:"Logs saved to note: {{fileName}}",saveError:"Failed to save logs",clear:"Clear",cleared:"Console logs cleared",clearName:"Clear logs",clearDesc:"Delete all console output records"},troubleshooting:{title:"Troubleshoot"},cache:{title:"Cache management",clearName:"Clear local cache",clearDesc:"Delete local cache data stored on this device only. This action cannot be undone and will require rebuilding the cache before the next sync. Your Nutstore data remains intact.",clear:"Clear",confirm:"Confirm clear",cleared:"Cache cleared successfully",clearModal:{title:"Clear cache",description:"Select which cache types to clear. This action cannot be undone.",cancel:"Cancel",confirm:"Confirm clear",syncRecordCache:{name:"Sync record cache",desc:"Tracks synchronization status for each file."},blobCache:{name:"File snapshot cache",desc:"Stores file snapshots needed for comparing changes during sync."},traverseWebDAVCache:{name:"File scan cache",desc:"Stores remote folder structure to enable faster sync by fetching only changes. If you encounter file list anomalies or data inconsistencies after a plugin update, try clearing this cache. After clearing, the next sync will need to re-scan all remote files, which may take a while."},nothingSelected:"Please select at least one cache type to clear."},gcBlockedBySync:"Sync is currently running. Wait for sync to finish before running garbage collection.",gcBlockedByGc:"Garbage collection is already running. Please try again later.",generateBlobGarbageName:"GC stress test: generate garbage snapshots",generateBlobGarbageDesc:"Write {{count}} random file snapshots to blob cache (about {{sizeKiB}} KiB each) for GC testing.",generateBlobGarbage:"Generate garbage snapshots",generateBlobGarbageRunning:"Generating garbage snapshots...",generateBlobGarbageDone:"Generated {{count}} garbage snapshot(s)."}},aiPermission:{title:"AI Permission Request",sessionLabel:'Session "{{title}}" is requesting permission',message:"AI is requesting to perform the following file operations:",purpose:"Purpose",sessionScopeHint:'"Auto-approve this operation" only applies to this chat session and resets after restarting Obsidian.',allowOnce:"Approve",alwaysAllow:"Auto-approve this operation",deny:"Deny",denied:"Permission denied: {{summary}}",readonly:"This agent is read-only and cannot modify files. Attempted: {{summary}}",source:"Source",destination:"Destination",operations:{read:"read",write:"write",edit:"edit",delete:"delete",mkdir:"create directory",copy:"copy",move:"move",updateSettings:"update plugin settings"},settings:{emptySummary:"No readable settings change detected.",on:"on",off:"off",fields:{filterRules:{name:"Filter rules",empty:"(empty)",disabled:"(disabled)"},skipLargeFiles:{name:"Max file size to skip"},startupSyncDelay:{name:"Auto sync after startup"},autoSyncInterval:{name:"Scheduled auto sync interval"},realtimeSync:{name:"Realtime sync"},confirmBeforeSync:{name:"Confirm before manual sync"},confirmBeforeDeleteInAutoSync:{name:"Confirm before auto delete"},syncMode:{name:"Sync mode"},conflictStrategy:{name:"Conflict strategy"},configDirSyncMode:{name:"Config directory sync"},language:{name:"Language",auto:"auto"}}}},sync:{error:{localPathNotFound:"Local path not found: {{path}}",mergeNotSupported:"This file type is currently not supported for merging",failedToAutoMerge:"Failed to auto merge",failedToUploadMerged:"Failed to upload merged content",requestsTooFrequent:"Requests too frequent, please wait a few minutes and try again",accountNotConfigured:"Nutstore account not configured. Please configure your account in settings first.",ssoTokenInvalid:"Login has expired. Please log in again in settings."},requestsTooFrequent:"Requests too frequent, plugin will resume sync at {{time}}",preparing:"\uD83D\uDCCB Preparing sync",preparation:{checkingRemote:"Checking the remote directory…",loadingState:"Reading sync state…",scanningRemote:"Scanning remote directories…",checkingChanges:"Checking remote changes…",retryingRemote:"The server is busy. Retrying in 30 seconds…",analyzing:"Analyzing file differences…",savingCache:"Saving the remote traversal cache…",traversalStats:"Scanned {{processed}} directories, {{queued}} queued, {{items}} items found",incrementalStats:"Processed {{changes}} remote changes"},start:"⌛️ Starting sync",complete:"✅ Sync completed",completeWithFailed:"❌ Sync completed with {{failedCount}} failed tasks",failedWithError:"Sync failed with error: {{error}}",progress:"Sync progress: {{percent}}%",blockedBySync:"Sync is already running. Please try again later.",stoppingGcForSync:"Garbage collection is running. Stopping cleanup and starting sync.",startButton:"Start sync",stopButton:"Stop sync",hideButton:"Hide",closeButton:"Close",showProgressButton:"Show sync progress",notSyncing:"No sync currently in progress",percentComplete:"{{percent}}%",currentFile:"{{path}}",filePath:"{{path}}",progressTitle:"Sync progress",progressCompleteTitle:"Sync complete",progressLabel:"Sync progress",cacheProgressLabel:"Cache update progress",syncingFiles:"Syncing files...",updatingCache:"Updating local cache...",failedStatus:"Sync failed",cancelled:"Sync cancelled",suggestUseClientForManyTasks:"Tip: When there are many sync tasks, we recommend using the Nutstore client for better performance and stability. The plugin is more suitable for mobile use!",fileOp:{createLocalDir:"Create local directory",createRemoteDir:"Create remote directory",createRemoteDirs:"Create multi-level directories",download:"Download",filenameError:"Invalid path characters",merge:"Merge",removeLocal:"Remove local",removeRemote:"Remove remote",removeRemoteRecursively:"Remove remote recursively",sync:"Sync",upload:"Upload",noop:"Skip",cleanRecord:"Clean record",skip:"Skip"},skipReason:{"file-too-large":"File too large","folder-contains-ignored-items":"Folder contains ignored items","conflict-in-send-only-mode":"Both local and cloud changed; send-only mode preserved the cloud version","conflict-in-receive-only-mode":"Both local and cloud changed; receive-only mode preserved the local version","deleted-locally-but-changed-remotely":"Deleted locally, but the cloud has changes; skipped to protect cloud edits","deleted-remotely-but-changed-locally":"Deleted on the cloud, but local has changes; skipped to protect local edits"},confirmModal:{title:"Sync confirmation",policyTitle:"Sync policy for this sync",policyBasis:"Basis for the decision: current local and cloud states are compared with the last sync record.\nWithout a sync record, Loose mode treats same-path, same-type files with the same size as equal; Strict mode follows the selected policy.",policyRecordNote:"Preserved or skipped items are not marked as synchronized; the next sync will evaluate them again against the sync record.",message:"⚠️ Please note:\n\n1. Sync operation may modify or delete local files\n2. We recommend backing up important files before syncing\n3. In case of file conflicts, manual resolution may be required\n4. Initial sync will process all files and may take longer, please be patient\n\nAre you sure you want to start syncing?",confirm:"Confirm sync",cancel:"Cancel",remoteDir:"Remote directory: {{dir}}",strategy:"Conflict strategy: {{strategy}}"}},taskList:{title:"Sync task list",instruction:'Please review the tasks below. Click "Continue" to execute the selected tasks, or "Cancel" to skip this sync.',continue:"Continue ({{count}})",cancel:"Cancel"},deleteConfirm:{title:"Confirm local file deletion",instruction:"⚠️ The following local files will be deleted during auto-sync (because they were deleted remotely).\n\nCheck files to delete; unchecked files will be re-uploaded:",warningNotice:"Local files will be deleted, please confirm",select:"Select",filePath:"File path",deleteAndReupload:"Delete selected, re-upload unchecked",skipForNow:"Skip for now"},failedTasks:{title:"Failed sync tasks",instruction:"The following tasks failed during sync:",taskName:"Task",localPath:"Local path",errorMessage:"Error",close:"Close"},textAreaModal:{copy:"Copy",close:"Close",copied:"Text copied to clipboard"},time:{justNow:"just now",minutesAgo:"{{count}}min ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",longAgo:"long ago"},chatbox:{title:"Chatbox",openCommand:"Open chatbox",addToContext:"Add to AI context",newChat:"New chat",sessionDeleted:"Session deleted",exportSaved:"Session exported: {{fileName}}",exportFailed:"Failed to export session",conflictResolution:{action:"Resolve {{count}} conflict(s) with AI",prompt:"Resolve every merge conflict in the context file. Analyze both sides of each <<<<<<<, =======, and >>>>>>> block. Preserve useful, non-conflicting information from both sides, merge duplicate passages by meaning, and retain the existing Markdown structure, frontmatter, internal links, and writing style. Do not invent information that is not present in the file. If the two sides contradict each other, cannot both be true, and the file does not provide enough evidence to choose one, ask me a specific question in the chat and wait for my answer; do not modify the file or invent a compromise before I respond. Continue resolving the conflicts after receiving my answer. Remove every conflict marker when finished and verify that the result is coherent and complete. Modify only this file.",alreadyResolved:"The conflicts in this file are already resolved",modelUnavailable:"Configure a default AI provider and model first",failed:"Could not create an AI conflict-resolution session"},exportDialog:{title:"Export session",description:"Export to a Markdown file in your vault.",includeToolMessages:"Include tool call messages",cancel:"Cancel",confirm:"Export"},exportRole:{user:"User",tool:"Tool",systemNotification:"System notification"},exportFrontmatter:{title:"title",sessionId:"session_id",exportedAt:"exported_at",createdAt:"created_at",updatedAt:"updated_at",model:"model",includeToolMessages:"include_tool_messages",pluginVersion:"plugin_version"},exportMeta:{messageTime:"Time",emptyContent:"(no text content)",toolCalls:"Tool calls",toolName:"Tool name",toolCallId:"Tool call ID",duration:"Duration"},repeatedToolCallsStopped:"The agent repeated the same tool call with the same arguments {{count}} times in a row and was stopped.",task:{cancelledSummary:"Task {{task}} was cancelled.",emptyResult:"Task completed but returned no summary."},ui:{history:{title:"History",sessionActions:"Session actions",sessionRunning:"Running"},actions:{exportAsMarkdown:"Export as Markdown",deleteSession:"Delete",cancel:"Cancel",close:"Close",selectFile:"Select File",send:"Send",stopRun:"Stop",compressContext:"Compress Context",copy:"Copy",runHtmlCode:"Run",showHtmlCode:"Code",deleteMessage:"Delete message",regenerateMessage:"Regenerate",recallMessage:"Recall",removeContextItem:"Remove"},tooltips:{contextUsage:"Context: {{used}}% used (window {{total}} tokens \xb7 total {{usedTokens}})"},labels:{provider:"Provider",model:"Model",tool:"Tool",toolCall:"Tool call",params:"Params",result:"Result",queuedSubmissions:"Queued Submissions",contextArea:"Context",reasoning:"Reasoning",todoList:"Todo List",systemNotification:"System Notification"},fileChanges:{create:"Added",update:"Modified",delete:"Deleted",binary:"Binary file; text diff is unavailable"},states:{loading:"Restoring chat…",empty:"Start by sending a message",dragFilePrompt:"Drop to add file",thinking:"Thinking",compressing:"Compressing",processingTools:"Processing Tools",noProvider:"No provider",noModel:"No model",taskDispatching:"Dispatching…",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled",taskQueued:"Queued",taskWaiting:"Waiting for subtask",toolDenied:"Denied",toolWaitingApproval:"Waiting for approval",noSubagentMessages:"This subagent has not produced any messages yet.",copied:"Copied!",loadingContextItem:"Loading…",todoEmpty:"No todos"},placeholders:{input:"Type a message. Enter to send, Shift+Enter for newline"},dialogs:{subagentTimeline:{title:"Subagent timeline"},deleteSession:{title:"Delete Session",message:"Delete this session permanently? This action cannot be undone.",confirm:"Delete"},deleteMessage:{title:"Delete Message",userConfirm:"This will delete this message and all following AI responses and tool results. This action cannot be undone.",assistantConfirm:"This will delete this AI response. This action cannot be undone.",toolConfirm:"This will delete this tool result and remove the corresponding tool call from the AI message. This action cannot be undone.",toolRestoreWarning:"After deletion, these file changes can no longer be restored by recalling the message.",confirm:"Delete"},compressContext:{title:"Compress Context",message:"This asks the AI to condense the earlier conversation before continuing. It usually helps with long chats, but some details may be simplified.",confirm:"Compress"},regenerate:{title:"Regenerate",message:"This will regenerate this AI response in place. The original response will be replaced, and subsequent messages will be preserved. This action cannot be undone.",confirm:"Regenerate"},recall:{title:"Recall Message",message:"This will put the message content back into the input box and recall this message plus all following messages in the current fragment. This action cannot be undone.",onlySecondTitle:"Confirm Recall Only",onlySecondMessage:"This will recall the message without restoring related file changes. This action cannot be undone. Continue?",restoreSecondTitle:"Confirm Recall and Restore",restoreSecondMessage:"This will recall the message and restore related file changes. This action cannot be undone. Continue?",restoreConfirm:"Recall and restore files",onlyConfirm:"Recall only"}},mcp:{button:"MCP servers",title:"MCP servers for this session",empty:"No MCP servers configured",toolCount:"{{count}} tools",notConnected:"not connected"}},requestFailed:"Request failed",errors:{noProvider:"Select a provider before sending",apiKeyRequired:"The selected provider is missing an API key",providerBaseUrlRequired:"The selected OpenAI-compatible provider is missing a base URL",noModel:"Select a model before sending",unsupportedAttachmentType:"Unsupported file type: {{name}}",unknownTool:"Unknown tool: {{name}}",toolFieldRequired:"{{field}} is required",toolFieldTooLong:"{{field}} is too long",fileNotFound:"File not found: {{path}}",notFile:"Path is not a file: {{path}}",fileNotRead:"Editing failed — read {{path}} at least once before editing it.",sessionNotFound:"The target session no longer exists",corruptSessionFile:"A session file is corrupted and was skipped: {{path}}",agentNotDispatchable:"Agent type cannot be dispatched: {{agentType}}",taskSessionUnavailable:"The task session or model configuration is no longer available",contextCompressionFailed:"Context compression returned no summary"}},taskSelectionVirtualList:{filter:{all:"All ({{ count }})",searchPlaceholder:"Search by path…",empty:"No matching tasks."},footer:{totalItems:"Total {{ count }} items",filtered:"{{ count }} shown"},labels:{execute:"Execute",action:"Action",localPath:"Local Path",remotePath:"Remote Path"}},webdavExplorer:{actions:{newFolder:"New Folder",goBack:"Go Back",confirm:"Confirm",cancel:"Cancel"},labels:{currentPath:"Current Path"}}};var W7={errors:{filenameUnsupportedChars:"文件 {{path}} 包含不支持的字符:{{chars}}"},settings:{language:{name:"语言",desc:"选择界面语言",auto:"自动检测"},account:{name:"账号",desc:"输入你的 WebDAV 账号",placeholder:"输入你的账号"},credential:{name:"凭证",desc:"输入你在坚果云“安全选项”中创建的“应用密码”,不是你的登录密码",placeholder:"输入你的坚果云应用密码"},remoteDir:{name:"远程目录",desc:"本仓库与坚果云的哪个文件夹同步。可点右侧文件夹按钮可视化选择。",placeholder:"例如 /MyNotes"},checkConnection:{name:"检查连接",desc:"点击检查 WebDAV 连接",success:"WebDAV 连接成功",failure:"WebDAV 连接失败",successButton:"连接成功 ✓",failureButton:"连接失败 \xd7"},login:{name:"登录",success:"登录成功",failure:"登录失败,请重试"},backupWarning:{name:"备份提醒",desc:"⚠️ 请注意:同步过程会修改或删除本地文件,建议在同步前备份重要文件。"},conflictStrategy:{name:"冲突解决策略",desc:"选择解决文件冲突的方式。\n注意:建议在使用自动合并功能前,先手动备份重要文件,以防数据丢失。",noConflictMerge:"无冲突合并",diff3:"自动合并(保留双方改动并用标记标出)",localPriority:"本地优先(覆盖服务器)",serverPriority:"服务器优先(覆盖本地)"},loginMode:{name:"登录方式",manual:"手动输入",sso:"单点登录"},ssoStatus:{loggedIn:"已登录",notLoggedIn:"未登录",logout:"退出登录",logoutSuccess:"已退出登录"},logout:{confirmTitle:"确认退出",confirmMessage:"确定要退出登录吗?退出后需要重新登录才能继续同步。",confirm:"确认退出",cancel:"取消"},help:{name:"如何获取 WebDAV 账号和凭证?"},enterpriseBaseUrl:{name:"企业版坚果云",desc:"可选配置企业版坚果云 Base URL,留空则使用默认地址。例如:https://dav.jianguoyun.com",action:"设置",modalTitle:"设置企业版坚果云 Base URL",placeholder:"例如 https://dav.jianguoyun.com",invalid:"Base URL 不合法",invalidWithReason:"Base URL 不合法:{{reason}}",errors:{invalidFormat:"请输入完整的服务器地址,例如:https://dav.jianguoyun.com",unsupportedProtocol:"地址需要以 http:// 或 https:// 开头"}},sections:{account:"账号设置",common:"通用设置",filters:"过滤规则",ai:"AI 设置"},tabs:{sync:"同步",ai:"AI",troubleshooting:"排障"},ai:{saved:"AI 设置已保存",none:"未设置",unnamedProvider:"未命名模型提供商",unnamedModel:"未命名模型",defaultModel:{name:"默认模型",desc:"新建对话时可选的默认模型"},nutstoreLlmGateway:{name:"坚果云 AI(实验性)",providerName:"坚果云",desc:"授权后可使用坚果云提供的模型。",pendingDesc:"请在浏览器中完成授权,当前验证码:{{code}}",connectedDesc:"已授权,当前 {{count}} 个模型可用。",authorize:"授权",authorizing:"授权中...",openAuthorizationPage:"打开授权页",cancelAuthorization:"取消授权",authorized:"坚果云 AI 授权成功",disconnect:"断开",disconnected:"已断开坚果云 AI",refreshModels:"更新",betaModal:{title:"功能内测中",message:"坚果云 AI 目前处于内测阶段,尚未向所有用户开放。如果您不在内测名单中,授权后可能暂时无法使用相关功能,请继续等待,我们正在陆续开放中。",cancel:"取消",confirm:"我知道了,继续授权"},errors:{authorizationRequired:"请先授权坚果云 AI",authorizationExpired:"坚果云 AI 授权已过期,请重新发起授权",authorizationFailed:"坚果云 AI 授权失败:{{code}} {{message}}",missingClientId:"缺少 LLM_GATEWAY_CLIENT_ID,无法启动坚果云 AI 授权",modelsFailed:"获取坚果云 AI 模型失败:{{status}}",emptyModels:"坚果云 AI 没有返回可用模型",refreshFailed:"刷新坚果云 AI 模型失败"}},providers:{name:"模型提供商",desc:"管理可用的 AI 模型提供商",summary:"已配置 {{count}} 个模型提供商",emptyHint:"尚未配置模型提供商。点击“管理模型提供商”添加一个后再开始对话。",manage:"管理模型提供商",add:"新增模型提供商",refreshPresetName:"获取最新模型列表",refreshPresetDesc:"可以获取最新的模型列表。",refreshPresetModels:"获取模型列表",refreshPresetModelsLoading:"获取中...",refreshPresetModelsSuccess:"提供商 {{providers}},模型 {{models}}",refreshPresetModelsFailure:"获取失败 \xd7",presetModelsRefreshFailed:"更新失败,继续使用本地/内置模型列表",presetModelsRefreshFailedWithReason:"更新失败,继续使用本地/内置模型列表:{{reason}}",empty:"当前还没有配置模型提供商。",defaultEndpoint:"默认端点",presetCustom:"自定义",updateModels:"更新",updateModelsHint:"预设中还有 {{count}} 个模型可同步到当前提供商。",updateModelsSuccess:"已增加 {{count}} 个模型"},provider:{name:"模型提供商名称",desc:"用于在 Chatbox 中显示的名称",baseUrl:{name:"Base URL",desc:"可选覆盖,例如 https://api.openai.com/v1"},apiKey:{name:"API Key",desc:"发送请求时使用的密钥"},allowBrowserCors:{name:"允许浏览器跨域请求",desc:"开启后将优先使用浏览器原生 fetch,可在支持的提供商上获得流式输出"},apiFormat:{name:"API 格式",desc:"与该提供商通信使用的协议",openaiChatCompletions:"OpenAI Chat Completions",openaiResponses:"OpenAI Responses",anthropic:"Anthropic Messages",other:"其他({{npm}})"}},models:{name:"模型",desc:"在当前模型提供商下可用的模型",add:"新增模型",empty:"当前模型提供商下还没有模型。"},model:{id:"模型 ID",idDesc:"请求 API 时使用的模型标识(如 gpt-4o)",inputModalities:"输入模态"},modals:{confirmDeleteLabel:"确认",providers:{title:"模型提供商管理",updateModelsTitle:"同步预设模型",updateModelsDesc:"将为 {{provider}} 增加 {{count}} 个模型,请确认以下新增项:",updateModelsConfirm:"确认增加"},provider:{createTitle:"新建提供商",editTitle:"编辑提供商",edit:"编辑",saved:"提供商已保存",deleted:"提供商已删除",corsConfirmTitle:"确认启用浏览器跨域请求",corsConfirmMessage:"并不是所有模型提供商都允许浏览器直接跨域访问。开启后将优先使用浏览器原生 fetch 以支持流式输出;如果之后发现该提供商无法使用,请回到这里关闭此开关。",corsConfirmEnable:"确认启用"},model:{createTitle:"新建模型",editTitle:"编辑模型",edit:"编辑",deleted:"模型已删除"}},mcp:{name:"MCP 服务",summary:"已配置 {{count}} 个服务",manage:"管理 MCP 服务",manager:{title:"MCP 服务",add:"添加服务",empty:"尚未配置 MCP 服务。",configFileHint:"配置保存在 {{path}},也可以在聊天中让 AI 帮你编辑该文件。",parseError:"解析 {{path}} 失败:{{reason}}",statusDisabled:"已停用",statusConnected:"{{count}} 个工具",statusError:"连接失败:{{reason}}",test:"测试",testSuccess:"连接成功:共 {{count}} 个可用工具",testFailed:"连接失败:{{reason}}"},editor:{createTitle:"添加 MCP 服务",editTitle:"编辑 MCP 服务",serverName:"服务名称",serverNameDesc:"仅限字母、数字、连字符和下划线",url:"URL",urlDesc:"MCP 服务的 Streamable HTTP 端点",headers:"请求头",headersDesc:"自定义 HTTP 请求头,例如 Authorization",headerKeyPlaceholder:"请求头名称",headerValuePlaceholder:"请求头值",addHeader:"添加请求头",removeHeader:"删除请求头",enabled:"启用"},errors:{emptyName:"服务名称不能为空",invalidName:"服务名称只能包含字母、数字、连字符和下划线",duplicateName:"已存在同名服务",emptyUrl:"URL 不能为空",invalidUrl:"URL 格式不正确"}},yolo:{name:"完全访问权限",desc:"⚠️ 开启后,AI 可自动修改文件和插件设置,不再逐次询问确认"},subagents:{heading:"子 Agent",explorer:{name:"Explorer",desc:"用于只读调查库内内容的 Agent。",model:{name:"Explorer 模型",desc:"留空时继承派发该任务的 Agent 所使用的模型。"}},memory:{name:"Memory",desc:"用于检索和维护跨会话偏好、约定和决定的 Agent。",model:{name:"Memory 模型",desc:"留空时继承派发该任务的 Agent 所使用的模型。"}}},errors:{saveFailed:"AI 设置保存失败",saveFailedWithReason:"AI 设置保存失败:{{reason}}",invalidProvidersConfig:"AI 模型提供商配置无效,请在设置中修正。详情:{{reason}}",emptyModelId:"模型 ID 不能为空",duplicateModelId:"已存在相同 ID 的模型",emptyProviderId:"模型提供商名称不能为空",duplicateProviderId:"已存在相同名称的模型提供商",reservedProviderId:"该模型提供商名称由坚果云 AI 保留,请使用其他名称",providerNotFoundForProtocolOpen:"未找到对应的模型提供商,可能已被删除或重命名:{{providerId}}",networkDisconnected:"网络连接不可用,请检查网络后重试。",browserCorsFallbackToBuiltinTransport:"浏览器跨域请求失败,已临时回退到内置请求方式。",browserCorsFailedWithDisableLink:"浏览器跨域请求失败。[打开此提供商并关闭 CORS]({{link}})。"}},confirmBeforeSync:{name:"同步前确认",desc:"同步前显示待执行的任务列表,确认后再执行"},confirmBeforeDeleteInAutoSync:{name:"自动同步时删除文件前确认",desc:"自动同步过程中检测到本地文件将被删除时,弹出确认对话框让你选择删除或重新上传"},realtimeSync:{name:"实时同步",desc:"文件修改后自动进行同步"},syncMode:{name:"同步模式",desc:"文件很多时建议选“宽松”,速度更快:它会跳过两边都存在、同名且大小相同但从未同步过的文件。严格模式会逐一比对。",strict:"严格",loose:"宽松"},syncPolicy:{name:"同步策略",desc:"控制本机与云端如何同步变更。带“覆盖”或“还原”的策略会删除另一端的多余文件,请谨慎使用。",twoWay:"双向同步",sendOnly:"仅发送",sendOnlyOverrideChanges:"仅发送:覆盖云端变更",receiveOnly:"仅接收",receiveOnlyRevertLocalChanges:"仅接收:还原本地变更",modal:{title:"确认同步策略",twoWayDesc:"同步规则:双向同步\n\n• 仅本地变更 → 更新云端\n• 仅云端变更 → 更新本地\n• 本地和云端都变更 → 按已配置的冲突策略处理\n• 一侧删除、另一侧未变更 → 将删除同步到另一侧\n• 一侧删除、另一侧已变更 → 保留已变更内容,并恢复被删除的一侧",sendOnlyDesc:"同步规则:本地 → 云端(保护云端独立变更)\n\n• 本地新增或修改,且云端未独立删除 → 上传到云端\n• 云端独立新增或修改 → 保留云端,不下载\n• 本地和云端都修改 → 跳过并保留云端\n• 本地删除、云端未变更 → 删除云端\n• 本地删除、云端也变更 → 跳过并保留云端\n• 已有同步记录的文件若已在云端删除 → 保留云端删除,不自动恢复;需要“仅发送:覆盖云端”才恢复\n\n适合:以本地为主,同时保护云端独立变更。",sendOnlyOverrideChangesDesc:"同步规则:云端 ← 本地当前状态\n\n• 本地存在的文件 → 创建或覆盖云端文件\n• 云端存在、本地不存在 → 删除云端\n• 同一路径两边不一致 → 以本地为准\n\n⚠️ 可能删除云端多余文件。\n适合:需要让云端与本地完全一致时使用。",receiveOnlyDesc:"同步规则:云端 → 本地(保护本地独立变更)\n\n• 云端新增或修改,且本地没有需要保护的删除 → 下载到本地\n• 本地独立新增或修改 → 保留本地,不上传\n• 本地和云端都修改 → 跳过并保留本地\n• 云端删除、本地未变更 → 删除本地\n• 云端删除、本地也变更 → 跳过并保留本地\n• 已有同步记录的文件若已在本地删除 → 保留本地删除,不自动恢复;需要“仅接收:还原本地”才恢复\n\n适合:以云端为主,同时保护本地独立变更。",receiveOnlyRevertLocalChangesDesc:"同步规则:本地 ← 云端当前状态\n\n• 云端存在的文件 → 创建或覆盖本地文件\n• 本地存在、云端不存在 → 删除本地\n• 同一路径两边不一致 → 以云端为准\n\n⚠️ 可能删除本地多余文件。\n适合:需要让本地与云端完全一致时使用。",confirm:"确认",cancel:"取消"}},startupSyncDelay:{name:"启动后自动同步(秒)",desc:"设置启动后第几秒自动执行一次同步。设置为 0 则禁用启动时自动同步。",placeholder:"输入秒数 (例如 5, 0 则禁用)",invalidValue:"无效的数值,已重置为 0",exceedsMax:"数值超过最大限制 {{max}} 秒(1天),已自动调整"},autoSyncInterval:{name:"定时自动同步(分钟)",desc:"设置每隔多长时间在后台自动执行一次同步(分钟)。设置为 0 则禁用定时自动同步。",placeholder:"输入分钟数 (例如 5, 0 则禁用)",invalidValue:"无效的数值,已重置为 0",exceedsMax:"数值超过最大限制 {{max}} 分钟(1天),已自动调整"},filters:{name:"过滤规则",desc:"选择哪些文件或文件夹不参与同步。可用简单路径或通配符,例如“图片”或“*.tmp”。从上到下判定,最后命中的规则生效;每条规则的 Aa 开关控制是否区分大小写。",add:"添加规则",remove:"删除",confirmRemove:"确认删除",edit:"编辑规则",toggle:"启用或禁用该规则",save:"保存",cancel:"取消",placeholder:"例如: .DS_Store, *.pdf",types:{exclude:"排除",include:"包含"}},configDirSync:{name:"配置目录同步",desc:"控制 {{configDir}} 目录是否参与同步。",none:"不同步",bookmarks:"仅同步书签",all:"同步全部",bookmarksTitle:"启用书签同步",bookmarksDesc:"仅同步 {{configDir}}/bookmarks.json,其他配置文件不受影响。",warnTitle:"启用完整配置目录同步?",warnSyncs:"同步内容:插件设置(data.json)、插件二进制(main.js)、主题、代码片段等所有配置文件。",warnExcludes:"自动排除:{{configDir}}/plugins/**/node_modules、{{configDir}}/plugins/**/.git 和 {{configDir}}/plugins/**/.pnpm-store。",warnConflict:"冲突处理:两端同一文件均有修改时,保留修改时间较新的版本,另一端的修改将被覆盖。",warnRisk:"风险:多台设备同时运行 Obsidian 容易引发冲突;插件设置变更后可能需要重启 Obsidian 才能生效。",warnPruned:"规则 `{{rule}}` 会排除 {{configDir}} 本身,导致配置文件夹无法同步。若要同步配置文件夹,请先在过滤规则里禁用这条规则。",syncNotice:"配置文件夹无法同步:规则 `{{rule}}` 排除了 {{configDir}}。若要同步,请先禁用这条规则。",confirm:"启用",cancel:"取消"},skipLargeFiles:{name:"跳过大文件",desc:"超过该大小的文件将不参与同步,例如 100MB 或 1GB。同步慢或报错时可适当调低。",placeholder:"例如:10 MiB 或 500 KiB",invalidFormat:'无效的文件大小格式,请使用如 "10MB" 或 "500KB" 的格式',exceedsMaxSize:"文件大小超过最大限制 500MB"},mobileAppDownloadFileChunkSize:{name:"移动端下载分块大小(高级)",desc:"仅当移动端下载文件失败时才需要调整。控制每次下载文件的分块大小。",placeholder:"例如:16 MiB",invalidFormat:'无效的分块大小格式,请使用如 "16 MiB" 或 "512 KiB" 的格式',belowMinSize:"分块大小不能小于 64 KiB,已自动调整",exceedsMaxSize:"分块大小不能超过 64 MiB,已自动调整"},log:{title:"调试日志",name:"控制台日志",desc:"查看控制台输出和调试信息",saveToNote:"保存到笔记",savedToNote:"日志已保存到笔记: {{fileName}}",saveError:"保存日志失败",clear:"清除",cleared:"控制台日志已清除",clearName:"清除日志",clearDesc:"删除所有控制台输出记录"},troubleshooting:{title:"排障"},cache:{title:"缓存管理",clearName:"清除本地缓存",clearDesc:"删除当前设备上的本地缓存数据。此操作无法撤销,会导致下次同步前需要重新建立缓存。仅影响当前设备,不会影响您在坚果云中的数据。",clear:"清除",confirm:"确认清除",cleared:"缓存已成功清除",clearModal:{title:"清除缓存",description:"选择需要清除的缓存类型。此操作无法撤销。",cancel:"取消",confirm:"确认清除",syncRecordCache:{name:"同步记录缓存",desc:"跟踪每个文件的同步状态。"},blobCache:{name:"文件快照缓存",desc:"存储用于同步时对比变化的文件快照。"},traverseWebDAVCache:{name:"文件扫描缓存",desc:"存储远程文件夹结构,下次同步时只需获取变化的部分,加快同步速度。如果插件更新后同步出现文件列表异常或数据不一致,可尝试清除此缓存。清除后下次同步需要重新扫描所有远程文件,可能需要较长时间。"},nothingSelected:"请至少选择一种缓存类型进行清除。"},gcBlockedBySync:"当前正在同步,请等待同步结束后再进行垃圾回收。",gcBlockedByGc:"垃圾回收正在进行中,请稍后再试。",generateBlobGarbageName:"GC 压测:生成垃圾快照",generateBlobGarbageDesc:"向 blob 缓存中写入 {{count}} 个随机文件快照(每个约 {{sizeKiB}} KiB),用于测试 GC 清理效果。",generateBlobGarbage:"生成垃圾快照",generateBlobGarbageRunning:"正在生成垃圾快照...",generateBlobGarbageDone:"已生成 {{count}} 个垃圾快照。"}},aiPermission:{title:"AI 权限请求",sessionLabel:"会话「{{title}}」正在请求权限",message:"AI 正在请求执行以下文件操作:",purpose:"用途",sessionScopeHint:"“自动同意该操作”仅在当前会话生效,重启 Obsidian 后将恢复询问。",allowOnce:"同意",alwaysAllow:"自动同意该操作",deny:"拒绝",denied:"操作已拒绝:{{summary}}",readonly:"该 agent 是只读的,不能修改文件。尝试的操作:{{summary}}",source:"源路径",destination:"目标路径",operations:{read:"读取",write:"写入",edit:"编辑",delete:"删除",mkdir:"创建目录",copy:"复制",move:"移动",updateSettings:"更新插件设置"},settings:{emptySummary:"未检测到可读取的设置变更。",on:"开启",off:"关闭",fields:{filterRules:{name:"过滤规则",empty:"(空)",disabled:"(已禁用)"},skipLargeFiles:{name:"跳过的大文件上限"},startupSyncDelay:{name:"启动后自动同步(秒)"},autoSyncInterval:{name:"定时自动同步间隔"},realtimeSync:{name:"实时同步"},confirmBeforeSync:{name:"同步前确认"},confirmBeforeDeleteInAutoSync:{name:"自动同步删除前确认"},syncMode:{name:"同步模式"},conflictStrategy:{name:"冲突解决策略"},configDirSyncMode:{name:"配置目录同步"},language:{name:"语言",auto:"自动"}}}},sync:{error:{localPathNotFound:"本地路径未找到: {{path}}",mergeNotSupported:"该文件类型暂不支持合并",failedToAutoMerge:"自动合并失败",failedToUploadMerged:"上传合并内容失败",requestsTooFrequent:"请求过于频繁,请等待几分钟后再试",accountNotConfigured:"尚未配置坚果云账号,请先在设置中配置账号信息",ssoTokenInvalid:"登录已失效,请在设置中重新登录。"},requestsTooFrequent:"请求过于频繁,插件将在 {{time}} 后自动继续同步任务",preparing:"\uD83D\uDCCB 准备同步",preparation:{checkingRemote:"正在检查远端目录…",loadingState:"正在读取同步状态…",scanningRemote:"正在扫描远端目录…",checkingChanges:"正在检查远端变化…",retryingRemote:"服务器繁忙,30 秒后重试…",analyzing:"正在分析文件差异…",savingCache:"正在保存远端遍历缓存…",traversalStats:"已扫描 {{processed}} 个目录,待扫描 {{queued}} 个目录,已发现 {{items}} 个项目",incrementalStats:"已处理 {{changes}} 项远端变化"},start:"⌛️ 开始同步",complete:"✅ 同步完成",completeWithFailed:"❌ 同步完成,但有 {{failedCount}} 个任务失败",failedWithError:"同步失败,错误信息: {{error}}",progress:"同步进度: {{percent}}%",blockedBySync:"同步正在进行中,请稍后再试。",stoppingGcForSync:"检测到垃圾回收正在进行,正在停止清理并开始同步。",startButton:"开始同步",stopButton:"停止同步",hideButton:"隐藏",closeButton:"关闭",showProgressButton:"显示同步进度",notSyncing:"尚未开始同步",percentComplete:"{{percent}}%",currentFile:"{{path}}",filePath:"{{path}}",progressTitle:"同步进度",progressCompleteTitle:"同步完成",progressLabel:"同步进度",cacheProgressLabel:"缓存更新进度",syncingFiles:"正在同步文件...",updatingCache:"正在更新本地缓存...",failedStatus:"同步失败",cancelled:"同步已取消",suggestUseClientForManyTasks:"提示:当同步任务较多时,建议使用坚果云客户端同步,可获得更好的性能和稳定性,插件更适合在移动端使用!",fileOp:{createLocalDir:"创建本地目录",createRemoteDir:"创建远程目录",createRemoteDirs:"创建多级目录",download:"下载",filenameError:"路径含无效字符",merge:"合并",removeLocal:"删除本地",removeRemote:"删除远程",removeRemoteRecursively:"递归删除远程",sync:"同步",upload:"上传",noop:"跳过",cleanRecord:"清理记录",skip:"跳过"},skipReason:{"file-too-large":"文件过大","folder-contains-ignored-items":"文件夹包含被忽略的文件","conflict-in-send-only-mode":"本地和云端都已变更;当前为仅发送模式,已保留云端版本","conflict-in-receive-only-mode":"本地和云端都已变更;当前为仅接收模式,已保留本地版本","deleted-locally-but-changed-remotely":"本地已删除,但云端有修改;为避免误删云端改动,已跳过此项","deleted-remotely-but-changed-locally":"云端已删除,但本地有修改;为避免误删本地改动,已跳过此项"},confirmModal:{title:"同步确认",policyTitle:"本次同步策略",policyBasis:"判断基准:将当前本地与云端状态分别和上次同步记录比较。\n没有同步记录时,宽松模式会把同路径、同类型且大小相同的文件视为一致;严格模式按所选策略处理。",policyRecordNote:"“保留”或“跳过”不会标记为已同步,下一次仍会按同步记录重新判断。",message:"⚠️ 请注意:\n\n1. 同步操作可能会修改或删除本地文件\n2. 建议在同步前手动备份重要文件\n3. 如果出现文件冲突,可能需要手动解决\n4. 首次同步需要处理所有文件,可能会比较慢,请耐心等待\n\n确定要开始同步吗?",confirm:"确认同步",cancel:"取消",remoteDir:"远程目录:{{dir}}",strategy:"冲突处理策略:{{strategy}}"}},taskList:{title:"同步任务列表",instruction:'请检查以下待执行的任务。点击"继续"将执行选中的任务,点击"取消"则跳过本次同步。',continue:"继续({{count}})",cancel:"取消"},deleteConfirm:{title:"确认删除本地文件",instruction:"⚠️ 在自动同步过程中检测到以下本地文件将被删除(因远程已删除)。\n\n勾选要删除的文件,未勾选的文件将重新上传到远程:",warningNotice:"检测到本地文件将被删除,请确认",select:"选择",filePath:"文件路径",deleteAndReupload:"删除选中的,重新上传未选中的",skipForNow:"暂时忽略"},failedTasks:{title:"同步失败任务",instruction:"以下任务在同步时失败:",taskName:"任务",localPath:"本地路径",errorMessage:"失败原因",close:"关闭"},textAreaModal:{copy:"复制",close:"关闭",copied:"文本已复制到剪贴板"},time:{justNow:"刚刚",minutesAgo:"{{count}}分钟前",hoursAgo:"{{count}}小时前",daysAgo:"{{count}}天前",longAgo:"很久前"},chatbox:{title:"Chatbox",openCommand:"打开 Chatbox",addToContext:"添加到 AI 上下文",newChat:"新对话",sessionDeleted:"会话已删除",exportSaved:"会话已导出:{{fileName}}",exportFailed:"导出会话失败",conflictResolution:{action:"使用 AI 解决 {{count}} 处冲突",prompt:"请解决上下文文件中的所有版本冲突。逐个分析 <<<<<<<、=======、>>>>>>> 标记两侧的内容,保留双方不冲突且有价值的信息,对重复内容进行语义合并,保持原有 Markdown 结构、Frontmatter、内部链接和语言风格。不要臆造文件中不存在的信息。如果两侧内容相互矛盾、无法同时成立,并且文件中没有足够依据确定取舍,请先在对话中向我提出具体问题,等待我的回答,不要修改文件或自行添加折中方案;收到回答后再继续解决冲突。完成后删除所有冲突标记,并检查结果是否连贯完整。只修改这个文件。",alreadyResolved:"文件中的冲突已经解决",modelUnavailable:"请先配置默认 AI Provider 和 Model",failed:"无法创建 AI 冲突解决会话"},exportDialog:{title:"导出会话",description:"导出为 Markdown 文件并保存到笔记库。",includeToolMessages:"包含工具调用消息",cancel:"取消",confirm:"导出"},exportRole:{user:"用户",tool:"工具",systemNotification:"系统通知"},exportFrontmatter:{title:"标题",sessionId:"会话ID",exportedAt:"导出时间",createdAt:"创建时间",updatedAt:"更新时间",model:"模型",includeToolMessages:"包含工具消息",pluginVersion:"插件版本"},exportMeta:{messageTime:"时间",emptyContent:"(无文本内容)",toolCalls:"工具调用",toolName:"工具名称",toolCallId:"工具调用 ID",duration:"运行时间"},repeatedToolCallsStopped:"Agent 连续 {{count}} 次调用了完全相同的工具与参数,已停止继续调用。",task:{cancelledSummary:"任务 {{task}} 已取消。",emptyResult:"任务已完成,但没有返回摘要。"},ui:{history:{title:"历史",sessionActions:"会话操作",sessionRunning:"运行中"},actions:{exportAsMarkdown:"导出为 Markdown",deleteSession:"删除",cancel:"取消",close:"关闭",selectFile:"选择文件",send:"发送",stopRun:"终止",compressContext:"压缩上下文",copy:"复制",runHtmlCode:"运行",showHtmlCode:"代码",deleteMessage:"删除消息",regenerateMessage:"重新生成",recallMessage:"撤回",removeContextItem:"移除"},tooltips:{contextUsage:"上下文:已用 {{used}}%(窗口 {{total}} tokens \xb7 总计 {{usedTokens}})"},labels:{provider:"Provider",model:"Model",tool:"工具",toolCall:"工具调用",params:"参数",result:"结果",queuedSubmissions:"排队内容",contextArea:"上下文",reasoning:"推理",todoList:"待办列表",systemNotification:"系统通知"},fileChanges:{create:"新增",update:"修改",delete:"删除",binary:"二进制文件,无法显示文本差异"},states:{loading:"正在恢复聊天…",empty:"开始发送一条消息",dragFilePrompt:"松手以添加文件",thinking:"思考中",compressing:"压缩中",processingTools:"工具处理中",noProvider:"未选择 Provider",noModel:"未选择 Model",taskDispatching:"正在派发…",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消",taskQueued:"排队中",taskWaiting:"等待子任务",toolDenied:"已拒绝",toolWaitingApproval:"等待批准",noSubagentMessages:"该子 Agent 尚未产生消息。",copied:"已复制",loadingContextItem:"加载中…",todoEmpty:"暂无待办"},placeholders:{input:"输入消息,Enter 发送,Shift+Enter 换行"},dialogs:{subagentTimeline:{title:"子 Agent 时间线"},deleteSession:{title:"删除会话",message:"确认删除这个会话吗?删除后不可恢复。",confirm:"确认删除"},deleteMessage:{title:"删除消息",userConfirm:"此操作将删除该用户消息,以及其后所有 AI 回复和工具调用结果,无法恢复。",assistantConfirm:"此操作将删除该 AI 回复,无法恢复。",toolConfirm:"此操作将删除该工具调用结果,并从对应的 AI 消息中移除该工具调用记录,无法恢复。",toolRestoreWarning:"删除后将无法通过撤回消息恢复这些文件修改。",confirm:"确认删除"},compressContext:{title:"压缩上下文",message:"这会让 AI 先整理前面的聊天内容,再继续当前对话。这样通常能减少长度带来的影响,但部分细节可能会被简化。",confirm:"开始压缩"},regenerate:{title:"重新生成",message:"此操作将重新生成该 AI 回复,原回复内容将被替换,其后的消息将被保留,无法恢复。",confirm:"重新生成"},recall:{title:"撤回消息",message:"此操作将把消息内容放回输入框,并撤回该消息及当前段中之后的所有消息,无法恢复。",onlySecondTitle:"确认仅撤回",onlySecondMessage:"将仅撤回消息,不还原相关修改。此操作无法恢复,确认继续吗?",restoreSecondTitle:"确认撤回并还原修改",restoreSecondMessage:"将撤回消息,并还原相关修改。此操作无法恢复,确认继续吗?",restoreConfirm:"撤回并还原修改",onlyConfirm:"仅撤回"}},mcp:{button:"MCP 服务",title:"本会话的 MCP 服务",empty:"尚未配置 MCP 服务",toolCount:"{{count}} 个工具",notConnected:"未连接"}},requestFailed:"请求失败",errors:{noProvider:"发送前请先选择模型提供商",apiKeyRequired:"当前模型提供商缺少 API Key",providerBaseUrlRequired:"当前 OpenAI-compatible 模型提供商缺少 Base URL",noModel:"发送前请先选择模型",unsupportedAttachmentType:"暂不支持该文件类型:{{name}}",unknownTool:"未知工具:{{name}}",toolFieldRequired:"{{field}} 为必填项",toolFieldTooLong:"{{field}} 过长",fileNotFound:"未找到文件:{{path}}",notFile:"该路径不是文件:{{path}}",fileNotRead:"编辑失败,请至少先读取一次 {{path}} 再编辑。",sessionNotFound:"目标会话已不存在",corruptSessionFile:"会话文件已损坏,已跳过加载:{{path}}",agentNotDispatchable:"该 Agent 类型不可派发:{{agentType}}",taskSessionUnavailable:"任务对应的会话或模型配置已不可用",contextCompressionFailed:"上下文压缩未返回摘要"}},taskSelectionVirtualList:{filter:{all:"全部 ({{ count }})",searchPlaceholder:"按路径搜索……",empty:"没有匹配的任务。"},footer:{totalItems:"共 {{ count }} 项",filtered:"筛选后 {{ count }} 项"},labels:{execute:"执行",action:"操作",localPath:"本地路径",remotePath:"远程路径"}},webdavExplorer:{actions:{newFolder:"新建文件夹",goBack:"返回上一层",confirm:"确定",cancel:"取消"},labels:{currentPath:"当前路径"}}};var HOe="translation",ZOe={zh:{translation:W7},en:{translation:q7}};fa.init({ns:["translation"],defaultNS:HOe,resources:ZOe,fallbackLng:"en",interpolation:{escapeValue:!1}});var P=fa;var Pr=/*#__PURE__*/function(){"use strict";function Pr1(){_class_call_check(this,Pr1)}_create_class(Pr1,[{key:"onload",value:function onload(){}},{key:"onunload",value:function onunload(){}}]);return Pr1}();var KOe=(typeof global==="undefined"?"undefined":_type_of(global))=="object"&&global&&global.Object===Object&&global,V7=KOe;var QOe=(typeof self==="undefined"?"undefined":_type_of(self))=="object"&&self&&self.Object===Object&&self,JOe=V7||QOe||Function("return this")(),En=JOe;var YOe=En.Symbol,Cu=YOe;var UY=Object.prototype,XOe=UY.hasOwnProperty,e$e=UY.toString,Sb=Cu?Cu.toStringTag:void 0;function t$e(e){var t=XOe.call(e,Sb),r=e[Sb];try{e[Sb]=void 0;var n=!0}catch(o){}var i=e$e.call(e);return n&&(t?e[Sb]=r:delete e[Sb]),i}var BY=t$e;var r$e=Object.prototype,n$e=r$e.toString;function i$e(e){return n$e.call(e)}var qY=i$e;var o$e="[object Null]",a$e="[object Undefined]",WY=Cu?Cu.toStringTag:void 0;function s$e(e){return e==null?e===void 0?a$e:o$e:WY&&WY in Object(e)?BY(e):qY(e)}var ao=s$e;function l$e(e){return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"}var ni=l$e;var u$e="[object Symbol]";function c$e(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="symbol"||ni(e)&&ao(e)==u$e}var kb=c$e;var d$e=Array.isArray,Ll=d$e;var p$e=/\s/;function f$e(e){for(var t=e.length;t--&&p$e.test(e.charAt(t)););return t}var VY=f$e;var m$e=/^\s+/;function h$e(e){return e&&e.slice(0,VY(e)+1).replace(m$e,"")}var GY=h$e;function g$e(e){var t=typeof e==="undefined"?"undefined":_type_of(e);return e!=null&&(t=="object"||t=="function")}var so=g$e;var HY=0/0,x$e=/^[-+]0x[0-9a-f]+$/i,y$e=/^0b[01]+$/i,v$e=/^0o[0-7]+$/i,_$e=parseInt;function b$e(e){if(typeof e=="number")return e;if(kb(e))return HY;if(so(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=so(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=GY(e);var r=y$e.test(e);return r||v$e.test(e)?_$e(e.slice(2),r?2:8):x$e.test(e)?HY:+e}var Lp=b$e;var ZY=1/0,w$e=17976931348623157e292;function S$e(e){if(!e)return e===0?e:0;if(e=Lp(e),e===ZY||e===-ZY){var t=e<0?-1:1;return t*w$e}return e===e?e:0}var KY=S$e;function k$e(e){var t=KY(e),r=t%1;return t===t?r?t-r:t:0}var Cb=k$e;function C$e(e){return e}var cx=C$e;var E$e="[object AsyncFunction]",T$e="[object Function]",A$e="[object GeneratorFunction]",I$e="[object Proxy]";function P$e(e){if(!so(e))return!1;var t=ao(e);return t==T$e||t==A$e||t==E$e||t==I$e}var wg=P$e;var R$e=En["__core-js_shared__"],G7=R$e;var QY=function(){var e=/[^.]+$/.exec(G7&&G7.keys&&G7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function M$e(e){return!!QY&&QY in e}var JY=M$e;var O$e=Function.prototype,$$e=O$e.toString;function N$e(e){if(e!=null){try{return $$e.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Fp=N$e;var D$e=/[\\^$.*+?()[\]{}|]/g,L$e=/^\[object .+?Constructor\]$/,F$e=Function.prototype,z$e=Object.prototype,j$e=F$e.toString,U$e=z$e.hasOwnProperty,B$e=RegExp("^"+j$e.call(U$e).replace(D$e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q$e(e){if(!so(e)||JY(e))return!1;var t=wg(e)?B$e:L$e;return t.test(Fp(e))}var YY=q$e;function W$e(e,t){return e==null?void 0:e[t]}var XY=W$e;function V$e(e,t){var r=XY(e,t);return YY(r)?r:void 0}var Hs=V$e;var G$e=Hs(En,"WeakMap"),Sg=G$e;var H$e=Sg&&new Sg,dx=H$e;var Z$e=dx?function Z$e1(e,t){return dx.set(e,t),e}:cx,H7=Z$e;var eX=Object.create,K$e=function(){function e(){}return function(t){if(!so(t))return{};if(eX)return eX(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),cm=K$e;function Q$e(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=cm(e.prototype),n=e.apply(r,t);return so(n)?n:r}}var zp=Q$e;var J$e=1;function Y$e(e,t,r){var n=t&J$e,i=zp(e);function o(){var a=this&&this!==En&&_instanceof(this,o)?i:e;return a.apply(n?r:this,arguments)}return o}var tX=Y$e;function X$e(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)}var px=X$e;var eNe=Math.max;function tNe(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=eNe(o-a,0),d=Array(l+c),u=!n;++s<l;)d[s]=t[s];for(;++i<a;)(u||i<o)&&(d[r[i]]=e[i]);for(;c--;)d[s++]=e[i++];return d}var Z7=tNe;var rNe=Math.max;function nNe(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,d=rNe(o-s,0),u=Array(d+c),p=!n;++i<d;)u[i]=e[i];for(var m=i;++l<c;)u[m+l]=t[l];for(;++a<s;)(p||i<o)&&(u[m+r[a]]=e[i++]);return u}var K7=nNe;function iNe(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var rX=iNe;function oNe(){}var fx=oNe;var aNe=0xffffffff;function Q7(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=aNe,this.__views__=[]}Q7.prototype=cm(fx.prototype);Q7.prototype.constructor=Q7;var mx=Q7;function sNe(){}var nX=sNe;var lNe=dx?function lNe1(e){return dx.get(e)}:nX,J7=lNe;var uNe={},$O=uNe;var cNe=Object.prototype,dNe=cNe.hasOwnProperty;function pNe(e){for(var t=e.name+"",r=$O[t],n=dNe.call($O,t)?r.length:0;n--;){var i=r[n],o=i.func;if(o==null||o==e)return i.name}return t}var iX=pNe;function Y7(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Y7.prototype=cm(fx.prototype);Y7.prototype.constructor=Y7;var Eb=Y7;function fNe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var hx=fNe;function mNe(e){if(_instanceof(e,mx))return e.clone();var t=new Eb(e.__wrapped__,e.__chain__);return t.__actions__=hx(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var oX=mNe;var hNe=Object.prototype,gNe=hNe.hasOwnProperty;function X7(e){if(ni(e)&&!Ll(e)&&!_instanceof(e,mx)){if(_instanceof(e,Eb))return e;if(gNe.call(e,"__wrapped__"))return oX(e)}return new Eb(e)}X7.prototype=fx.prototype;X7.prototype.constructor=X7;var aX=X7;function xNe(e){var t=iX(e),r=aX[t];if(typeof r!="function"||!(t in mx.prototype))return!1;if(e===r)return!0;var n=J7(r);return!!n&&e===n[0]}var sX=xNe;var yNe=800,vNe=16,_Ne=Date.now;function bNe(e){var t=0,r=0;return function(){var n=_Ne(),i=vNe-(n-r);if(r=n,i>0){if(++t>=yNe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var e8=bNe;var wNe=e8(H7),t8=wNe;var SNe=/\{\n\/\* \[wrapped with (.+)\] \*/,kNe=/,? & /;function CNe(e){var t=e.match(SNe);return t?t[1].split(kNe):[]}var lX=CNe;var ENe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function TNe(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(ENe,"{\n/* [wrapped with "+t+"] */\n")}var uX=TNe;function ANe(e){return function(){return e}}var cX=ANe;var INe=function(){try{var e=Hs(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),gx=INe;var PNe=gx?function PNe1(e,t){return gx(e,"toString",{configurable:!0,enumerable:!1,value:cX(t),writable:!0})}:cx,dX=PNe;var RNe=e8(dX),r8=RNe;function MNe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var n8=MNe;function ONe(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var pX=ONe;function $Ne(e){return e!==e}var fX=$Ne;function NNe(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var mX=NNe;function DNe(e,t,r){return t===t?mX(e,t,r):pX(e,fX,r)}var hX=DNe;function LNe(e,t){var r=e==null?0:e.length;return!!r&&hX(e,t,0)>-1}var gX=LNe;var FNe=1,zNe=2,jNe=8,UNe=16,BNe=32,qNe=64,WNe=128,VNe=256,GNe=512,HNe=[["ary",WNe],["bind",FNe],["bindKey",zNe],["curry",jNe],["curryRight",UNe],["flip",GNe],["partial",BNe],["partialRight",qNe],["rearg",VNe]];function ZNe(e,t){return n8(HNe,function(r){var n="_."+r[0];t&r[1]&&!gX(e,n)&&e.push(n)}),e.sort()}var xX=ZNe;function KNe(e,t,r){var n=t+"";return r8(e,uX(n,xX(lX(n),r)))}var i8=KNe;var QNe=1,JNe=2,YNe=4,XNe=8,yX=32,vX=64;function eDe(e,t,r,n,i,o,a,s,l,c){var d=t&XNe,u=d?a:void 0,p=d?void 0:a,m=d?o:void 0,h=d?void 0:o;t|=d?yX:vX,t&=~(d?vX:yX),t&YNe||(t&=~(QNe|JNe));var g=[e,t,i,m,u,h,p,s,l,c],x=r.apply(void 0,g);return sX(e)&&t8(x,g),x.placeholder=n,i8(x,e,t)}var o8=eDe;function tDe(e){var t=e;return t.placeholder}var xx=tDe;var rDe=0x1fffffffffffff,nDe=/^(?:0|[1-9]\d*)$/;function iDe(e,t){var r=typeof e==="undefined"?"undefined":_type_of(e);return t=t==null?rDe:t,!!t&&(r=="number"||r!="symbol"&&nDe.test(e))&&e>-1&&e%1==0&&e<t}var yx=iDe;var oDe=Math.min;function aDe(e,t){for(var r=e.length,n=oDe(t.length,r),i=hx(e);n--;){var o=t[n];e[n]=yx(o,r)?i[o]:void 0}return e}var _X=aDe;var bX="__lodash_placeholder__";function sDe(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];(a===t||a===bX)&&(e[r]=bX,o[i++]=r)}return o}var jp=sDe;var lDe=1,uDe=2,cDe=8,dDe=16,pDe=128,fDe=512;function wX(e,t,r,n,i,o,a,s,l,c){var d=t&pDe,u=t&lDe,p=t&uDe,m=t&(cDe|dDe),h=t&fDe,g=p?void 0:zp(e);function x(){for(var v=arguments.length,y=Array(v),_=v;_--;)y[_]=arguments[_];if(m)var b=xx(x),w=rX(y,b);if(n&&(y=Z7(y,n,i,m)),o&&(y=K7(y,o,a,m)),v-=w,m&&v<c){var S=jp(y,b);return o8(e,t,wX,x.placeholder,r,y,S,s,l,c-v)}var k=u?r:this,E=p?k[e]:e;return v=y.length,s?y=_X(y,s):h&&v>1&&y.reverse(),d&&l<v&&(y.length=l),this&&this!==En&&_instanceof(this,x)&&(E=g||zp(E)),E.apply(k,y)}return x}var a8=wX;function mDe(e,t,r){var n=zp(e);function i(){for(var o=arguments.length,a=Array(o),s=o,l=xx(i);s--;)a[s]=arguments[s];var c=o<3&&a[0]!==l&&a[o-1]!==l?[]:jp(a,l);if(o-=c.length,o<r)return o8(e,t,a8,i.placeholder,void 0,a,c,void 0,void 0,r-o);var d=this&&this!==En&&_instanceof(this,i)?n:e;return px(d,this,a)}return i}var SX=mDe;var hDe=1;function gDe(e,t,r,n){var i=t&hDe,o=zp(e);function a(){for(var s=-1,l=arguments.length,c=-1,d=n.length,u=Array(d+l),p=this&&this!==En&&_instanceof(this,a)?o:e;++c<d;)u[c]=n[c];for(;l--;)u[c++]=arguments[++s];return px(p,i?r:this,u)}return a}var kX=gDe;var CX="__lodash_placeholder__",NO=1,xDe=2,yDe=4,EX=8,Tb=128,TX=256,vDe=Math.min;function _De(e,t){var r=e[1],n=t[1],i=r|n,o=i<(NO|xDe|Tb),a=n==Tb&&r==EX||n==Tb&&r==TX&&e[7].length<=t[8]||n==(Tb|TX)&&t[7].length<=t[8]&&r==EX;if(!(o||a))return e;n&NO&&(e[2]=t[2],i|=r&NO?0:yDe);var s=t[3];if(s){var l=e[3];e[3]=l?Z7(l,s,t[4]):s,e[4]=l?jp(e[3],CX):t[4]}return s=t[5],s&&(l=e[5],e[5]=l?K7(l,s,t[6]):s,e[6]=l?jp(e[5],CX):t[6]),s=t[7],s&&(e[7]=s),n&Tb&&(e[8]=e[8]==null?t[8]:vDe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var AX=_De;var bDe="Expected a function",IX=1,wDe=2,DO=8,LO=16,FO=32,PX=64,RX=Math.max;function SDe(e,t,r,n,i,o,a,s){var l=t&wDe;if(!l&&typeof e!="function")throw new TypeError(bDe);var c=n?n.length:0;if(c||(t&=~(FO|PX),n=i=void 0),a=a===void 0?a:RX(Cb(a),0),s=s===void 0?s:Cb(s),c-=i?i.length:0,t&PX){var d=n,u=i;n=i=void 0}var p=l?void 0:J7(e),m=[e,t,r,n,i,d,u,o,a,s];if(p&&AX(m,p),e=m[0],t=m[1],r=m[2],n=m[3],i=m[4],s=m[9]=m[9]===void 0?l?0:e.length:RX(m[9]-c,0),!s&&t&(DO|LO)&&(t&=~(DO|LO)),!t||t==IX)var h=tX(e,t,r);else t==DO||t==LO?h=SX(e,t,s):(t==FO||t==(IX|FO))&&!i.length?h=kX(e,t,r,n):h=a8.apply(void 0,m);var g=p?H7:t8;return i8(g(h,m),e,t)}var MX=SDe;function kDe(e,t,r){t=="__proto__"&&gx?gx(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var s8=kDe;function CDe(e,t){return e===t||e!==e&&t!==t}var dm=CDe;var EDe=Object.prototype,TDe=EDe.hasOwnProperty;function ADe(e,t,r){var n=e[t];(!(TDe.call(e,t)&&dm(n,r))||r===void 0&&!(t in e))&&s8(e,t,r)}var l8=ADe;function IDe(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),i?s8(r,s,l):l8(r,s,l)}return r}var pm=IDe;var OX=Math.max;function PDe(e,t,r){return t=OX(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=OX(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),px(e,this,s)}}var $X=PDe;function RDe(e,t){return r8($X(e,t,cx),e+"")}var NX=RDe;var MDe=0x1fffffffffffff;function ODe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MDe}var u8=ODe;function $De(e){return e!=null&&u8(e.length)&&!wg(e)}var vx=$De;function NDe(e,t,r){if(!so(r))return!1;var n=typeof t==="undefined"?"undefined":_type_of(t);return(n=="number"?vx(r)&&yx(t,r.length):n=="string"&&t in r)?dm(r[t],e):!1}var DX=NDe;var DDe=Object.prototype;function LDe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||DDe;return e===r}var _x=LDe;function FDe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var LX=FDe;var zDe="[object Arguments]";function jDe(e){return ni(e)&&ao(e)==zDe}var zO=jDe;var FX=Object.prototype,UDe=FX.hasOwnProperty,BDe=FX.propertyIsEnumerable,qDe=zO(function(){return arguments}())?zO:function qDe1(e){return ni(e)&&UDe.call(e,"callee")&&!BDe.call(e,"callee")},zX=qDe;function WDe(){return!1}var jX=WDe;var qX=(typeof exports==="undefined"?"undefined":_type_of(exports))=="object"&&exports&&!exports.nodeType&&exports,UX=qX&&(typeof module==="undefined"?"undefined":_type_of(module))=="object"&&module&&!module.nodeType&&module,VDe=UX&&UX.exports===qX,BX=VDe?En.Buffer:void 0,GDe=BX?BX.isBuffer:void 0,HDe=GDe||jX,kg=HDe;var ZDe="[object Arguments]",KDe="[object Array]",QDe="[object Boolean]",JDe="[object Date]",YDe="[object Error]",XDe="[object Function]",eLe="[object Map]",tLe="[object Number]",rLe="[object Object]",nLe="[object RegExp]",iLe="[object Set]",oLe="[object String]",aLe="[object WeakMap]",sLe="[object ArrayBuffer]",lLe="[object DataView]",uLe="[object Float32Array]",cLe="[object Float64Array]",dLe="[object Int8Array]",pLe="[object Int16Array]",fLe="[object Int32Array]",mLe="[object Uint8Array]",hLe="[object Uint8ClampedArray]",gLe="[object Uint16Array]",xLe="[object Uint32Array]",Si={};Si[uLe]=Si[cLe]=Si[dLe]=Si[pLe]=Si[fLe]=Si[mLe]=Si[hLe]=Si[gLe]=Si[xLe]=!0;Si[ZDe]=Si[KDe]=Si[sLe]=Si[QDe]=Si[lLe]=Si[JDe]=Si[YDe]=Si[XDe]=Si[eLe]=Si[tLe]=Si[rLe]=Si[nLe]=Si[iLe]=Si[oLe]=Si[aLe]=!1;function yLe(e){return ni(e)&&u8(e.length)&&!!Si[ao(e)]}var WX=yLe;function vLe(e){return function(t){return e(t)}}var Cd=vLe;var VX=(typeof exports==="undefined"?"undefined":_type_of(exports))=="object"&&exports&&!exports.nodeType&&exports,Ab=VX&&(typeof module==="undefined"?"undefined":_type_of(module))=="object"&&module&&!module.nodeType&&module,_Le=Ab&&Ab.exports===VX,jO=_Le&&V7.process,bLe=function(){try{var e=Ab&&Ab.require&&Ab.require("util").types;return e||jO&&jO.binding&&jO.binding("util")}catch(t){}}(),gs=bLe;var GX=gs&&gs.isTypedArray,wLe=GX?Cd(GX):WX,c8=wLe;var SLe=Object.prototype,kLe=SLe.hasOwnProperty;function CLe(e,t){var r=Ll(e),n=!r&&zX(e),i=!r&&!n&&kg(e),o=!r&&!n&&!i&&c8(e),a=r||n||i||o,s=a?LX(e.length,String):[],l=s.length;for(var c in e)(t||kLe.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||yx(c,l)))&&s.push(c);return s}var d8=CLe;function ELe(e,t){return function(r){return e(t(r))}}var p8=ELe;var TLe=p8(Object.keys,Object),HX=TLe;var ALe=Object.prototype,ILe=ALe.hasOwnProperty;function PLe(e){if(!_x(e))return HX(e);var t=[];for(var r in Object(e))ILe.call(e,r)&&r!="constructor"&&t.push(r);return t}var ZX=PLe;function RLe(e){return vx(e)?d8(e):ZX(e)}var bx=RLe;function MLe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var KX=MLe;var OLe=Object.prototype,$Le=OLe.hasOwnProperty;function NLe(e){if(!so(e))return KX(e);var t=_x(e),r=[];for(var n in e)n=="constructor"&&(t||!$Le.call(e,n))||r.push(n);return r}var QX=NLe;function DLe(e){return vx(e)?d8(e,!0):QX(e)}var wx=DLe;var LLe=Hs(Object,"create"),Up=LLe;function FLe(){this.__data__=Up?Up(null):{},this.size=0}var JX=FLe;function zLe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var YX=zLe;var jLe="__lodash_hash_undefined__",ULe=Object.prototype,BLe=ULe.hasOwnProperty;function qLe(e){var t=this.__data__;if(Up){var r=t[e];return r===jLe?void 0:r}return BLe.call(t,e)?t[e]:void 0}var XX=qLe;var WLe=Object.prototype,VLe=WLe.hasOwnProperty;function GLe(e){var t=this.__data__;return Up?t[e]!==void 0:VLe.call(t,e)}var eee=GLe;var HLe="__lodash_hash_undefined__";function ZLe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Up&&t===void 0?HLe:t,this}var tee=ZLe;function Sx(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Sx.prototype.clear=JX;Sx.prototype.delete=YX;Sx.prototype.get=XX;Sx.prototype.has=eee;Sx.prototype.set=tee;var UO=Sx;function KLe(){this.__data__=[],this.size=0}var ree=KLe;function QLe(e,t){for(var r=e.length;r--;)if(dm(e[r][0],t))return r;return-1}var fm=QLe;var JLe=Array.prototype,YLe=JLe.splice;function XLe(e){var t=this.__data__,r=fm(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():YLe.call(t,r,1),--this.size,!0}var nee=XLe;function eFe(e){var t=this.__data__,r=fm(t,e);return r<0?void 0:t[r][1]}var iee=eFe;function tFe(e){return fm(this.__data__,e)>-1}var oee=tFe;function rFe(e,t){var r=this.__data__,n=fm(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var aee=rFe;function kx(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kx.prototype.clear=ree;kx.prototype.delete=nee;kx.prototype.get=iee;kx.prototype.has=oee;kx.prototype.set=aee;var mm=kx;var nFe=Hs(En,"Map"),hm=nFe;function iFe(){this.size=0,this.__data__={hash:new UO,map:new(hm||mm),string:new UO}}var see=iFe;function oFe(e){var t=typeof e==="undefined"?"undefined":_type_of(e);return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var lee=oFe;function aFe(e,t){var r=e.__data__;return lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var gm=aFe;function sFe(e){var t=gm(this,e).delete(e);return this.size-=t?1:0,t}var uee=sFe;function lFe(e){return gm(this,e).get(e)}var cee=lFe;function uFe(e){return gm(this,e).has(e)}var dee=uFe;function cFe(e,t){var r=gm(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var pee=cFe;function Cx(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cx.prototype.clear=see;Cx.prototype.delete=uee;Cx.prototype.get=cee;Cx.prototype.has=dee;Cx.prototype.set=pee;var f8=Cx;function dFe(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var m8=dFe;var pFe=p8(Object.getPrototypeOf,Object),h8=pFe;function fFe(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}var fee=fFe;var mFe=Math.ceil,hFe=Math.max;function gFe(e,t,r){(r?DX(e,t,r):t===void 0)?t=1:t=hFe(Cb(t),0);var n=e==null?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=Array(mFe(n/t));i<n;)a[o++]=fee(e,i,i+=t);return a}var Ib=gFe;function xFe(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}var mee=xFe;function yFe(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=Lp(r),r=r===r?r:0),t!==void 0&&(t=Lp(t),t=t===t?t:0),mee(Lp(e),t,r)}var Ed=yFe;function vFe(){this.__data__=new mm,this.size=0}var hee=vFe;function _Fe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var gee=_Fe;function bFe(e){return this.__data__.get(e)}var xee=bFe;function wFe(e){return this.__data__.has(e)}var yee=wFe;var SFe=200;function kFe(e,t){var r=this.__data__;if(_instanceof(r,mm)){var n=r.__data__;if(!hm||n.length<SFe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new f8(n)}return r.set(e,t),this.size=r.size,this}var vee=kFe;function Ex(e){var t=this.__data__=new mm(e);this.size=t.size}Ex.prototype.clear=hee;Ex.prototype.delete=gee;Ex.prototype.get=xee;Ex.prototype.has=yee;Ex.prototype.set=vee;var Tx=Ex;function CFe(e,t){return e&&pm(t,bx(t),e)}var _ee=CFe;function EFe(e,t){return e&&pm(t,wx(t),e)}var bee=EFe;var Cee=(typeof exports==="undefined"?"undefined":_type_of(exports))=="object"&&exports&&!exports.nodeType&&exports,wee=Cee&&(typeof module==="undefined"?"undefined":_type_of(module))=="object"&&module&&!module.nodeType&&module,TFe=wee&&wee.exports===Cee,See=TFe?En.Buffer:void 0,kee=See?See.allocUnsafe:void 0;function AFe(e,t){if(t)return e.slice();var r=e.length,n=kee?kee(r):new e.constructor(r);return e.copy(n),n}var Eee=AFe;function IFe(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}var Tee=IFe;function PFe(){return[]}var g8=PFe;var RFe=Object.prototype,MFe=RFe.propertyIsEnumerable,Aee=Object.getOwnPropertySymbols,OFe=Aee?function OFe1(e){return e==null?[]:(e=Object(e),Tee(Aee(e),function(t){return MFe.call(e,t)}))}:g8,Ax=OFe;function $Fe(e,t){return pm(e,Ax(e),t)}var Iee=$Fe;var NFe=Object.getOwnPropertySymbols,DFe=NFe?function DFe1(e){for(var t=[];e;)m8(t,Ax(e)),e=h8(e);return t}:g8,x8=DFe;function LFe(e,t){return pm(e,x8(e),t)}var Pee=LFe;function FFe(e,t,r){var n=t(e);return Ll(e)?n:m8(n,r(e))}var y8=FFe;function zFe(e){return y8(e,bx,Ax)}var Pb=zFe;function jFe(e){return y8(e,wx,x8)}var Ree=jFe;var UFe=Hs(En,"DataView"),v8=UFe;var BFe=Hs(En,"Promise"),_8=BFe;var qFe=Hs(En,"Set"),b8=qFe;var Mee="[object Map]",WFe="[object Object]",Oee="[object Promise]",$ee="[object Set]",Nee="[object WeakMap]",Dee="[object DataView]",VFe=Fp(v8),GFe=Fp(hm),HFe=Fp(_8),ZFe=Fp(b8),KFe=Fp(Sg),Cg=ao;(v8&&Cg(new v8(new ArrayBuffer(1)))!=Dee||hm&&Cg(new hm)!=Mee||_8&&Cg(_8.resolve())!=Oee||b8&&Cg(new b8)!=$ee||Sg&&Cg(new Sg)!=Nee)&&(Cg=function Cg1(e){var t=ao(e),r=t==WFe?e.constructor:void 0,n=r?Fp(r):"";if(n)switch(n){case VFe:return Dee;case GFe:return Mee;case HFe:return Oee;case ZFe:return $ee;case KFe:return Nee}return t});var Bp=Cg;var QFe=Object.prototype,JFe=QFe.hasOwnProperty;function YFe(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&JFe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Lee=YFe;var XFe=En.Uint8Array,Ix=XFe;function eze(e){var t=new e.constructor(e.byteLength);return new Ix(t).set(new Ix(e)),t}var Px=eze;function tze(e,t){var r=t?Px(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Fee=tze;var rze=/\w*$/;function nze(e){var t=new e.constructor(e.source,rze.exec(e));return t.lastIndex=e.lastIndex,t}var zee=nze;var jee=Cu?Cu.prototype:void 0,Uee=jee?jee.valueOf:void 0;function ize(e){return Uee?Object(Uee.call(e)):{}}var Bee=ize;function oze(e,t){var r=t?Px(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var qee=oze;var aze="[object Boolean]",sze="[object Date]",lze="[object Map]",uze="[object Number]",cze="[object RegExp]",dze="[object Set]",pze="[object String]",fze="[object Symbol]",mze="[object ArrayBuffer]",hze="[object DataView]",gze="[object Float32Array]",xze="[object Float64Array]",yze="[object Int8Array]",vze="[object Int16Array]",_ze="[object Int32Array]",bze="[object Uint8Array]",wze="[object Uint8ClampedArray]",Sze="[object Uint16Array]",kze="[object Uint32Array]";function Cze(e,t,r){var n=e.constructor;switch(t){case mze:return Px(e);case aze:case sze:return new n(+e);case hze:return Fee(e,r);case gze:case xze:case yze:case vze:case _ze:case bze:case wze:case Sze:case kze:return qee(e,r);case lze:return new n;case uze:case pze:return new n(e);case cze:return zee(e);case dze:return new n;case fze:return Bee(e)}}var Wee=Cze;function Eze(e){return typeof e.constructor=="function"&&!_x(e)?cm(h8(e)):{}}var Vee=Eze;var Tze="[object Map]";function Aze(e){return ni(e)&&Bp(e)==Tze}var Gee=Aze;var Hee=gs&&gs.isMap,Ize=Hee?Cd(Hee):Gee,Zee=Ize;var Pze="[object Set]";function Rze(e){return ni(e)&&Bp(e)==Pze}var Kee=Rze;var Qee=gs&&gs.isSet,Mze=Qee?Cd(Qee):Kee,Jee=Mze;var Oze=1,$ze=2,Nze=4,Yee="[object Arguments]",Dze="[object Array]",Lze="[object Boolean]",Fze="[object Date]",zze="[object Error]",Xee="[object Function]",jze="[object GeneratorFunction]",Uze="[object Map]",Bze="[object Number]",ete="[object Object]",qze="[object RegExp]",Wze="[object Set]",Vze="[object String]",Gze="[object Symbol]",Hze="[object WeakMap]",Zze="[object ArrayBuffer]",Kze="[object DataView]",Qze="[object Float32Array]",Jze="[object Float64Array]",Yze="[object Int8Array]",Xze="[object Int16Array]",eje="[object Int32Array]",tje="[object Uint8Array]",rje="[object Uint8ClampedArray]",nje="[object Uint16Array]",ije="[object Uint32Array]",mi={};mi[Yee]=mi[Dze]=mi[Zze]=mi[Kze]=mi[Lze]=mi[Fze]=mi[Qze]=mi[Jze]=mi[Yze]=mi[Xze]=mi[eje]=mi[Uze]=mi[Bze]=mi[ete]=mi[qze]=mi[Wze]=mi[Vze]=mi[Gze]=mi[tje]=mi[rje]=mi[nje]=mi[ije]=!0;mi[zze]=mi[Xee]=mi[Hze]=!1;function w8(e,t,r,n,i,o){var a,s=t&Oze,l=t&$ze,c=t&Nze;if(r&&(a=i?r(e,n,i,o):r(e)),a!==void 0)return a;if(!so(e))return e;var d=Ll(e);if(d){if(a=Lee(e),!s)return hx(e,a)}else{var u=Bp(e),p=u==Xee||u==jze;if(kg(e))return Eee(e,s);if(u==ete||u==Yee||p&&!i){if(a=l||p?{}:Vee(e),!s)return l?Pee(e,bee(a,e)):Iee(e,_ee(a,e))}else{if(!mi[u])return i?e:{};a=Wee(e,u,s)}}o||(o=new Tx);var m=o.get(e);if(m)return m;o.set(e,a),Jee(e)?e.forEach(function(x){a.add(w8(x,t,r,x,e,o))}):Zee(e)&&e.forEach(function(x,v){a.set(v,w8(x,t,r,v,e,o))});var h=c?l?Ree:Pb:l?wx:bx,g=d?void 0:h(e);return n8(g||e,function(x,v){g&&(v=x,x=e[v]),l8(a,v,w8(x,t,r,v,e,o))}),a}var tte=w8;var oje=1,aje=4;function sje(e){return tte(e,oje|aje)}var Ko=sje;var lje="__lodash_hash_undefined__";function uje(e){return this.__data__.set(e,lje),this}var rte=uje;function cje(e){return this.__data__.has(e)}var nte=cje;function S8(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new f8;++t<r;)this.add(e[t])}S8.prototype.add=S8.prototype.push=rte;S8.prototype.has=nte;var ite=S8;function dje(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var ote=dje;function pje(e,t){return e.has(t)}var ate=pje;var fje=1,mje=2;function hje(e,t,r,n,i,o){var a=r&fje,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,m=r&mje?new ite:void 0;for(o.set(e,t),o.set(t,e);++u<s;){var h=e[u],g=t[u];if(n)var x=a?n(g,h,u,t,e,o):n(h,g,u,e,t,o);if(x!==void 0){if(x)continue;p=!1;break}if(m){if(!ote(t,function(v,y){if(!ate(m,y)&&(h===v||i(h,v,r,n,o)))return m.push(y)})){p=!1;break}}else if(!(h===g||i(h,g,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var k8=hje;function gje(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var ste=gje;function xje(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var lte=xje;var yje=1,vje=2,_je="[object Boolean]",bje="[object Date]",wje="[object Error]",Sje="[object Map]",kje="[object Number]",Cje="[object RegExp]",Eje="[object Set]",Tje="[object String]",Aje="[object Symbol]",Ije="[object ArrayBuffer]",Pje="[object DataView]",ute=Cu?Cu.prototype:void 0,BO=ute?ute.valueOf:void 0;function Rje(e,t,r,n,i,o,a){switch(r){case Pje:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ije:return!(e.byteLength!=t.byteLength||!o(new Ix(e),new Ix(t)));case _je:case bje:case kje:return dm(+e,+t);case wje:return e.name==t.name&&e.message==t.message;case Cje:case Tje:return e==t+"";case Sje:var s=ste;case Eje:var l=n&yje;if(s||(s=lte),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=vje,a.set(e,t);var d=k8(s(e),s(t),n,i,o,a);return a.delete(e),d;case Aje:if(BO)return BO.call(e)==BO.call(t)}return!1}var cte=Rje;var Mje=1,Oje=Object.prototype,$je=Oje.hasOwnProperty;function Nje(e,t,r,n,i,o){var a=r&Mje,s=Pb(e),l=s.length,c=Pb(t),d=c.length;if(l!=d&&!a)return!1;for(var u=l;u--;){var p=s[u];if(!(a?p in t:$je.call(t,p)))return!1}var m=o.get(e),h=o.get(t);if(m&&h)return m==t&&h==e;var g=!0;o.set(e,t),o.set(t,e);for(var x=a;++u<l;){p=s[u];var v=e[p],y=t[p];if(n)var _=a?n(y,v,p,t,e,o):n(v,y,p,e,t,o);if(!(_===void 0?v===y||i(v,y,r,n,o):_)){g=!1;break}x||(x=p=="constructor")}if(g&&!x){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&_instanceof(b,b)&&typeof w=="function"&&_instanceof(w,w))&&(g=!1)}return o.delete(e),o.delete(t),g}var dte=Nje;var Dje=1,pte="[object Arguments]",fte="[object Array]",C8="[object Object]",Lje=Object.prototype,mte=Lje.hasOwnProperty;function Fje(e,t,r,n,i,o){var a=Ll(e),s=Ll(t),l=a?fte:Bp(e),c=s?fte:Bp(t);l=l==pte?C8:l,c=c==pte?C8:c;var d=l==C8,u=c==C8,p=l==c;if(p&&kg(e)){if(!kg(t))return!1;a=!0,d=!1}if(p&&!d)return o||(o=new Tx),a||c8(e)?k8(e,t,r,n,i,o):cte(e,t,l,r,n,i,o);if(!(r&Dje)){var m=d&&mte.call(e,"__wrapped__"),h=u&&mte.call(t,"__wrapped__");if(m||h){var g=m?e.value():e,x=h?t.value():t;return o||(o=new Tx),i(g,x,r,n,o)}}return p?(o||(o=new Tx),dte(e,t,r,n,i,o)):!1}var hte=Fje;function gte(e,t,r,n,i){return e===t?!0:e==null||t==null||!ni(e)&&!ni(t)?e!==e&&t!==t:hte(e,t,r,n,gte,i)}var xte=gte;var zje=function zje1(){return En.Date.now()},E8=zje;var jje="Expected a function",Uje=Math.max,Bje=Math.min;function qje(e,t,r){var n,i,o,a,s,l,c=0,d=!1,u=!1,p=!0;if(typeof e!="function")throw new TypeError(jje);t=Lp(t)||0,so(r)&&(d=!!r.leading,u="maxWait"in r,o=u?Uje(Lp(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p);function m(S){var k=n,E=i;return n=i=void 0,c=S,a=e.apply(E,k),a}function h(S){return c=S,s=setTimeout(v,t),d?m(S):a}function g(S){var k=S-l,E=S-c,C=t-k;return u?Bje(C,o-E):C}function x(S){var k=S-l,E=S-c;return l===void 0||k>=t||k<0||u&&E>=o}function v(){var S=E8();if(x(S))return y(S);s=setTimeout(v,g(S))}function y(S){return s=void 0,p&&n?m(S):(n=i=void 0,a)}function _(){s!==void 0&&clearTimeout(s),c=0,n=l=i=s=void 0}function b(){return s===void 0?a:y(E8())}function w(){var S=E8(),k=x(S);if(n=arguments,i=this,l=S,k){if(s===void 0)return h(l);if(u)return clearTimeout(s),s=setTimeout(v,t),m(l)}return s===void 0&&(s=setTimeout(v,t)),a}return w.cancel=_,w.flush=b,w}var qp=qje;var Wje="[object String]";function Vje(e){return typeof e=="string"||!Ll(e)&&ni(e)&&ao(e)==Wje}var qO=Vje;var Gje="[object Boolean]";function Hje(e){return e===!0||e===!1||ni(e)&&ao(e)==Gje}var WO=Hje;var Zje="[object Date]";function Kje(e){return ni(e)&&ao(e)==Zje}var yte=Kje;var vte=gs&&gs.isDate,Qje=vte?Cd(vte):yte,VO=Qje;function Jje(e,t){return xte(e,t)}var GO=Jje;var Yje=En.isFinite;function Xje(e){return typeof e=="number"&&Yje(e)}var T8=Xje;var eUe="[object Number]";function tUe(e){return typeof e=="number"||ni(e)&&ao(e)==eUe}var Rb=tUe;function rUe(e){return e==null}var lo=rUe;function nUe(e){return e===null}var HO=nUe;var iUe="[object RegExp]";function oUe(e){return ni(e)&&ao(e)==iUe}var _te=oUe;var bte=gs&&gs.isRegExp,aUe=bte?Cd(bte):_te,ZO=aUe;function sUe(e){return e===void 0}var KO=sUe;var lUe=32,QO=NX(function(e,t){var r=jp(t,xx(QO));return MX(e,lUe,void 0,t,r)});QO.placeholder={};var JO=QO;var uUe="Expected a function";function cUe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(uUe);return so(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qp(e,t,{leading:n,maxWait:t,trailing:i})}var YO=cUe;var iu=require("obsidian"),hS=nr(ln(),1);var A8=require("obsidian");var Mb=/*#__PURE__*/function(_A8_Modal){"use strict";_inherits(Mb1,_A8_Modal);function Mb1(r,n){_class_call_check(this,Mb1);var _this;_this=_call_super(this,Mb1,[r]);_this.tasks=n;A(_this,"confirmed",!1);A(_this,"selectedTasks",[]);_this.selectedTasks=Array.from({length:n.length},function(){return!0});return _this}_create_class(Mb1,[{key:"onOpen",value:function onOpen(){var _this=this;this.setTitle(P.t("deleteConfirm.title"));var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("p",{cls:"ns-24abin"}).setText(P.t("deleteConfirm.instruction"));var o=r.createDiv({cls:"ns-tjnmw4"}).createEl("table",{cls:"task-list-table"}),s=o.createEl("thead").createEl("tr");s.createEl("th",{cls:"ns-6cuyp4",text:P.t("deleteConfirm.select")}),s.createEl("th",{text:P.t("deleteConfirm.filePath")});var l=o.createEl("tbody");this.tasks.forEach(function(d,u){var p=l.createEl("tr"),h=p.createEl("td",{cls:"ns-6cuyp4"}).createEl("input");h.type="checkbox",h.checked=_this.selectedTasks[u],h.addEventListener("change",function(g){_this.selectedTasks[u]=h.checked,g.stopPropagation()}),p.addEventListener("click",function(g){g.target!==h&&(h.checked=!h.checked,_this.selectedTasks[u]=h.checked,g.stopPropagation())}),p.createEl("td",{text:d.localPath})});var c=r.createDiv({cls:"ns-842365"});new A8.Setting(c).addButton(function(d){d.setButtonText(P.t("deleteConfirm.deleteAndReupload")).setCta().onClick(function(){_this.confirmed=!0,_this.close()})}).addButton(function(d){d.setButtonText(P.t("deleteConfirm.skipForNow")).onClick(function(){_this.confirmed=!1,_this.close()})})}},{key:"openAndWait",value:function openAndWait(){var _this=this;return _get(_get_prototype_of(Mb1.prototype),"open",this).call(this),new Promise(function(r){_this.onClose=function(){if(!_this.confirmed){r({tasksToDelete:[],tasksToReupload:[]});return}var n=_this.tasks.filter(function(o,a){return _this.selectedTasks[a]}),i=_this.tasks.filter(function(o,a){return!_this.selectedTasks[a]});r({tasksToDelete:n,tasksToReupload:i})}})}}]);return Mb1}(A8.Modal);var I8=require("obsidian");var Ob=/*#__PURE__*/function(_I8_Modal){"use strict";_inherits(Ob1,_I8_Modal);function Ob1(r,n){_class_call_check(this,Ob1);var _this;_this=_call_super(this,Ob1,[r]);_this.failedTasks=n;return _this}_create_class(Ob1,[{key:"onOpen",value:function onOpen(){var _this=this;this.setTitle(P.t("failedTasks.title"));var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("p",{cls:"ns-24abin",text:P.t("failedTasks.instruction")});var i=r.createDiv({cls:"ns-tjnmw4"}).createEl("table",{cls:"task-list-table"}),a=i.createEl("thead").createEl("tr");a.createEl("th",{text:P.t("failedTasks.taskName")}),a.createEl("th",{text:P.t("failedTasks.localPath")}),a.createEl("th",{text:P.t("failedTasks.errorMessage")});var s=i.createEl("tbody");this.failedTasks.forEach(function(c){var d=s.createEl("tr");d.createEl("td",{text:c.taskName}),d.createEl("td",{text:c.localPath}),d.createEl("td",{text:c.errorMessage})});var l=r.createDiv({cls:"ns-842365"});new I8.Setting(l).addButton(function(c){c.setButtonText(P.t("failedTasks.close")).setCta().onClick(function(){return _this.close()})})}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty()}}]);return Ob1}(I8.Modal);var eA=require("obsidian");var P8=nr(ln(),1);function xm(e){return e?e.replace(/[\\/]+/g,"/").replace(/^\/+/,"").replace(/\/+$/,""):""}var Kn=/*#__PURE__*/function(){"use strict";function Kn1(t){_class_call_check(this,Kn1);this.options=t}_create_class(Kn1,[{key:"vault",get:function get1(){return this.options.vault}},{key:"syncRecord",get:function get1(){return this.options.syncRecord}},{key:"webdav",get:function get1(){return this.options.webdav}},{key:"remoteBaseDir",get:function get1(){return this.options.remoteBaseDir}},{key:"remotePath",get:function get1(){return(0,P8.isAbsolute)(this.options.remotePath)?this.options.remotePath:(0,P8.join)(this.remoteBaseDir,this.options.remotePath)}},{key:"localPath",get:function get1(){return xm(this.options.localPath)}},{key:"logger",get:function get1(){return this.options.logger}},{key:"toJSON",value:function toJSON(){var _this=this,t=_this.localPath,r=_this.remoteBaseDir,n=_this.remotePath;return{taskName:this.constructor.name,localPath:t,remoteBaseDir:r,remotePath:n}}}]);return Kn1}(),Eg=/*#__PURE__*/function(Error1){"use strict";_inherits(Eg1,Error1);function Eg1(r,n,i){_class_call_check(this,Eg1);var _this;_this=_call_super(this,Eg1,[r]);_this.task=n;_this.cause=i;_this.name="TaskError";return _this}return Eg1}(_wrap_native_super(Error));function hi(e,t){if(_instanceof(e,Eg))return e;var r=_instanceof(e,Error)?e.message:String(e);return new Eg(r,t,_instanceof(e,Error)?e:void 0)}var Zs=/*#__PURE__*/function(Kn1){"use strict";_inherits(Zs1,Kn1);function Zs1(){_class_call_check(this,Zs1);return _call_super(this,Zs1,arguments)}_create_class(Zs1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.syncRecord.deleteFileRecord(this.localPath)];case 1:return[2,(_state.sent(),{success:!0,skipRecord:!0})];case 2:t=_state.sent();return[2,(this.logger.error(this,t),{success:!1,error:hi(t,this)})];case 3:return[2]}})}).call(this)}}]);return Zs1}(Kn);function kte(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,crypto.subtle.digest("SHA-256",e)]})})()}function Cte(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,kte(e)];case 1:t=_state.sent();return[2,Array.from(new Uint8Array(t)).map(function(i){return i.toString(16).padStart(2,"0")}).join("")]}})})()}function XO(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,kte(e)];case 1:t=_state.sent();return[2,tx(new Uint8Array(t),!1)]}})})()}var Ate=nr(Tte(),1);var pUe=[/connection to indexeddb server lost/i,/connection to indexeddatabase server lost/i,/internal error opening backing store/i,/the database connection is closing/i];function fUe(e){if(!e)return!1;var t=e,r=typeof t.name=="string"?t.name:"",n=typeof t.message=="string"?t.message:typeof e=="string"?e:"",i="".concat(r," ").concat(n).trim();return i?pUe.some(function(o){return o.test(i)}):!1}function mUe(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&"getFreshInstance"in e&&typeof e.getFreshInstance=="function"}function t$(e){var m,h;var t=mUe(e)?e:{getFreshInstance:function(){return e},maxRetries:0},r=t.getFreshInstance(),n=(m=t.shouldRecover)!=null?m:fUe,i=Math.max(0,(h=t.maxRetries)!=null?h:0);function o(g){return _async_to_generator(function(){var x,v,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:v=0;_state.label=1;case 1:if(!(v<=i))return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,g(r)];case 3:return[2,_state.sent()];case 4:y=_state.sent();if(v===0&&(x=y),!(v<i&&n(y)))throw x!=null?x:y;r=t.getFreshInstance();return[3,5];case 5:v++;return[3,1];case 6:throw new Error("Unexpected storage retry state")}})})()}function a(g,x){return o(function(v){return v.setItem(g,x)})}function s(g){return o(function(x){return x.getItem(g)})}function l(g){return o(function(x){return x.removeItem(g)})}function c(){return o(function(g){return g.clear()})}function d(){return _async_to_generator(function(){var g,x,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,o(function(v){return v.keys()})];case 1:g=_state.sent(),x={};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_loop=function(){var v,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:v=_step.value;return[4,o(function(_){return _.getItem(v)})];case 1:y=_state.sent();y&&(x[v]=y);return[2]}})};_iterator=g[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];return[5,_ts_values(_loop())];case 4:_state.sent();_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,x]}})})()}function u(g){return _async_to_generator(function(){var x,_tmp,_tmp1,_tmp2,_i1,v,v10,_tmp3,_tmp4,_tmp5,_i2,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!g||(typeof g==="undefined"?"undefined":_type_of(g))!="object")throw new Error("Invalid data format for restore");return[4,d()];case 1:x=_state.sent();_state.label=2;case 2:_state.trys.push([2,8,,14]);return[4,c()];case 3:_state.sent();_tmp=g;_tmp1=[];for(_tmp2 in _tmp)_tmp1.push(_tmp2);_i1=0;_state.label=4;case 4:if(!(_i1<_tmp1.length))return[3,7];_tmp2=_tmp1[_i1];if(!(_tmp2 in _tmp))return[3,6];v=_tmp2;return[4,a(v,g[v])];case 5:_state.sent();_state.label=6;case 6:_i1++;return[3,4];case 7:return[3,14];case 8:v10=_state.sent();return[4,c()];case 9:_state.sent();_tmp3=x;_tmp4=[];for(_tmp5 in _tmp3)_tmp4.push(_tmp5);_i2=0;_state.label=10;case 10:if(!(_i2<_tmp4.length))return[3,13];_tmp5=_tmp4[_i2];if(!(_tmp5 in _tmp3))return[3,12];y=_tmp5;return[4,a(y,x[y])];case 11:_state.sent();_state.label=12;case 12:_i2++;return[3,10];case 13:return[3,14];case 14:return[2]}})})()}function p(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,o(function(g){return g.keys()})];case 1:return[2,_state.sent()]}})})()}return{set:a,get:s,unset:l,clear:c,dump:d,restore:u,keys:p}}var hUe="Nutstore_Plugin_Cache";function Mx(e){return t$({getFreshInstance:function(){return Ate.default.createInstance({name:hUe,storeName:e})},maxRetries:1})}var Ad=Mx("sync_record"),ym=Mx("base_blob_store"),Eu=Mx("traverse_webdav_cache"),r$=Mx("cache_upload_meta"),R8=Mx("chat_sessions"),n$=Mx("chat_meta");function gUe(){function e(r){return ym.get(r)}function t(r){return _async_to_generator(function(){var n,i,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!_instanceof(r,Blob))return[3,3];return[4,r.arrayBuffer()];case 1:return[4,XO.apply(void 0,[_state.sent()])];case 2:_tmp=(n=_state.sent(),i=r);return[3,5];case 3:return[4,XO(r)];case 4:_tmp=(n=_state.sent(),i=new Blob([r]));_state.label=5;case 5:_tmp;_tmp1={key:n};return[4,ym.set(n,i)];case 6:return[2,(_tmp1.value=_state.sent(),_tmp1)]}})})()}return{get:e,store:t}}var vm=gUe();var xUe=new Set(["c","cc","conf","cpp","cs","css","csv","cts","env","fish","go","gql","graphql","h","hpp","htm","html","ini","java","js","json","jsonc","jsx","kt","kts","less","log","markdown","md","mjs","mts","php","properties","ps1","py","rb","rs","sass","scss","sh","sql","svelte","svg","swift","text","toml","ts","tsv","tsx","txt","vue","xml","yaml","yml","zsh"]),yUe=new Set(["dockerfile","license","makefile","readme"]);function $b(e){var n;var t=(n=e.trim().toLowerCase().split("/").pop())!=null?n:"";if(yUe.has(t))return!0;var r=t.lastIndexOf(".");return r<0?!1:xUe.has(t.slice(r+1))}function M8(e,t){if(e.byteLength!==t.byteLength)return!1;var r=Ite(e),n=Ite(t),i=r.length;if(r.byteOffset%4===0&&n.byteOffset%4===0){var o=i>>2;if(o>0){var a=new Uint32Array(r.buffer,r.byteOffset,o),s=new Uint32Array(n.buffer,n.byteOffset,o);for(var l=0;l<o;l+=1)if(a[l]!==s[l])return!1}for(var a9=o<<2;a9<i;a9+=1)if(r[a9]!==n[a9])return!1;return!0}for(var o10=0;o10<i;o10+=1)if(r[o10]!==n[o10])return!1;return!0}function Ite(e){return _instanceof(e,Uint8Array)?e:new Uint8Array(e)}var Lb=require("obsidian"),d$=nr(ln(),1);var Ag=nr(Tg(),1);function a$(e){return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e["@@functional/placeholder"]===!0}function Nb(e){return function t(r){return arguments.length===0||a$(r)?t:e.apply(this,arguments)}}var IUe=Nb(function(t){return t==null}),$te=IUe;var PUe=Nb(function(t){return!$te(t)}),Db=PUe;function Nte(e){return typeof e!="number"&&typeof e!="string"?!1:!Number.isNaN(Number.parseFloat(String(e)))&&Number.isFinite(Number(e))}var Id="16 MiB",s$=(0,Ag.parse)("64 KiB",{mode:"jedec"}),l$=(0,Ag.parse)("64 MiB",{mode:"jedec"});function $x(e,t){var r=e.trim();return r?((Nte(r)||lo((0,Ag.parse)(r))&&Db((0,Ag.parse)(r+"B")))&&(r+="B"),r):t}function Dte(e){var t=$x(e!=null?e:"",Id),r=(0,Ag.parse)(t,{mode:"jedec"});return r===null?(0,Ag.parse)(Id,{mode:"jedec"}):Math.min(l$,Math.max(s$,r))}var xs=require("obsidian");function Nx(e,t){var r=t.replace(/^\/+/,"").replace(/\/+$/,""),n=(0,xs.normalizePath)(e.configDir).replace(/^\/+/,"").replace(/\/+$/,"");return n&&(r===n||r.startsWith("".concat(n,"/")))?!0:r.split("/").some(function(i){return i!=="."&&i!==".."&&i.startsWith(".")})}function _m(e,t){return Nx(e,(0,xs.normalizePath)(t))}function Fl(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(0,xs.normalizePath)(t);return[4,e.adapter.exists(r)];case 1:return[2,_state.sent()]}})})()}function xc(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(0,xs.normalizePath)(t);if(!Nx(e,r))return[3,2];return[4,e.adapter.readBinary(r)];case 1:return[2,_state.sent()];case 2:n=e.getAbstractFileByPath(r);if(!n)throw new Error("cannot find file in local fs: "+r);if(!_instanceof(n,xs.TFile))throw new Error("local path is not a file: "+r);return[4,e.readBinary(n)];case 3:return[2,_state.sent()]}})})()}function Wp(e,t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=(0,xs.normalizePath)(t);if(!Nx(e,n))return[3,2];return[4,e.adapter.writeBinary(n,r)];case 1:_state.sent();return[2];case 2:i=e.getAbstractFileByPath(n);if(!_instanceof(i,xs.TFile))return[3,4];return[4,e.modifyBinary(i,r)];case 3:_state.sent();return[2];case 4:return[4,e.adapter.exists(n)];case 5:if(!_state.sent())return[3,7];return[4,e.adapter.writeBinary(n,r)];case 6:_state.sent();return[2];case 7:return[4,e.createBinary(n,r)];case 8:_state.sent();return[2]}})})()}function Dx(e,t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=(0,xs.normalizePath)(t);if(!Nx(e,n))return[3,2];return[4,e.adapter.write(n,r)];case 1:_state.sent();return[2];case 2:i=e.getAbstractFileByPath(n);if(!_instanceof(i,xs.TFile))return[3,4];return[4,e.modify(i,r)];case 3:_state.sent();return[2];case 4:return[4,e.adapter.exists(n)];case 5:if(!_state.sent())return[3,7];return[4,e.adapter.write(n,r)];case 6:_state.sent();return[2];case 7:return[4,e.create(n,r)];case 8:_state.sent();return[2]}})})()}function u$(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(0,xs.normalizePath)(t);if(!Nx(e,r))return[3,2];return[4,e.adapter.read(r)];case 1:return[2,_state.sent()];case 2:n=e.getAbstractFileByPath(r);if(!n)throw new Error("cannot find file in local fs: "+r);if(!_instanceof(n,xs.TFile))throw new Error("local path is not a file: "+r);return[4,e.read(n)];case 3:return[2,_state.sent()]}})})()}function c$(e,t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Dx(e,(0,xs.normalizePath)(t),r)];case 1:_state.sent();return[2]}})})()}function Lx(_01,_11){return _async_to_generator(function(e,t){var r,n,o,i,_tmp;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;n=(0,xs.normalizePath)(t);if(!Nx(e,n))return[3,5];return[4,e.adapter.stat(n)];case 1:o=_state.sent();if(!o)return[2];if(!(o.type==="folder"))return[3,3];return[4,e.adapter.rmdir(n,r)];case 2:_state.sent();return[2];case 3:return[4,e.adapter.remove(n)];case 4:_state.sent();return[2];case 5:i=e.getAbstractFileByPath(n);_tmp=i;if(!_tmp)return[3,7];return[4,e.trash(i,!1)];case 6:_tmp=_state.sent();_state.label=7;case 7:_tmp;return[2]}})}).apply(this,arguments)}var O8=nr(ln(),1);function Ja(e,t){return _async_to_generator(function(){var r,n,_tmp,_tmp1,i,_tmp2,_tmp3,_tmp4;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=(0,O8.normalize)(t);_tmp=!(n==="/"||n===".");if(!_tmp)return[3,2];return[4,Fl(e,n)];case 1:_tmp=!_state.sent();_state.label=2;case 2:if(!_tmp)return[3,16];_state.label=3;case 3:_tmp1=n!==""&&n!=="/"&&n!==".";if(!_tmp1)return[3,5];return[4,Fl(e,n)];case 4:_tmp1=!_state.sent();_state.label=5;case 5:if(!_tmp1)return[3,7];r.push(n),n=(0,O8.dirname)(n);_state.label=6;case 6:return[3,3];case 7:if(!r.length)return[3,16];i=r.pop();_tmp2=i;if(!_tmp2)return[3,14];return[4,Fl(e,i)];case 8:_tmp3=_state.sent();if(_tmp3)return[3,13];if(!_m(e,i))return[3,10];return[4,e.adapter.mkdir(i)];case 9:_tmp4=_state.sent();return[3,12];case 10:return[4,e.createFolder(i)];case 11:_tmp4=_state.sent();_state.label=12;case 12:_tmp3=_tmp4;_state.label=13;case 13:_tmp2=_tmp3;_state.label=14;case 14:_tmp2;_state.label=15;case 15:return[3,7];case 16:return[2]}})})()}function $8(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!!Lb.Platform.isMobileApp)return[3,2];return[4,OUe(e)];case 1:_state.sent();return[2];case 2:return[4,$Ue(e)];case 3:_state.sent();return[2]}})})()}function RUe(e){return _instanceof(e,ArrayBuffer)?e:DUe(e)}function MUe(e,t){var r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;n.set(new Uint8Array(o),i),i+=o.byteLength}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(i!==t)throw new Error("Remote Size Not Match!");return r}function OUe(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.vault,t=param.webdav,r=param.remotePath,n=param.localPath,i=param.remoteSize;return[4,t.getFileContents(r,{format:"binary",details:!1})];case 1:o=_state.sent(),a=RUe(o);if(a.byteLength!==i)throw new Error("Remote Size Not Match!");return[4,Ja(e,(0,d$.dirname)(n))];case 2:_state.sent();return[4,Wp(e,n,a)];case 3:_state.sent();return[2]}})}).apply(this,arguments)}function $Ue(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,m,a,s,l,c,d,u,p,_$h,g,x,v,_tmp,_tmp1,_tmp2,_tmp3,h,_tmp4;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.vault,t=param.webdav,r=param.remotePath,n=param.localPath,i=param.remoteSize,o=param.mobileAppDownloadFileChunkSize;a=(0,Lb.normalizePath)(n);return[4,Ja(e,(0,d$.dirname)(a))];case 1:if(!(_state.sent(),i===0))return[3,3];return[4,Wp(e,a,new ArrayBuffer(0))];case 2:_state.sent();return[2];case 3:s=(m=e.adapter.appendBinary)==null?void 0:m.bind(e.adapter),l=[],c=Dte(o),d=(0,Lb.normalizePath)("".concat(a,".nutstore-sync-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2),".download")),u=0,p=0;Me.info("[ChunkedDownload] start ".concat(r," (").concat(i," bytes, chunkSize=").concat(c,")"));_state.label=4;case 4:_state.trys.push([4,23,,26]);_state.label=5;case 5:if(!(u<i))return[3,15];_$h=Math.min(u+c,i)-1;return[4,t.customRequest(r,{method:"GET",headers:{Range:"bytes=".concat(u,"-").concat(_$h)}})];case 6:g=_state.sent();if(g.status!==206)throw new Error("Range download failed with status ".concat(g.status));return[4,g.arrayBuffer()];case 7:x=_state.sent(),v=_$h-u+1;if(x.byteLength!==v)throw new Error("Remote chunk size not match!");if(!(s&&u===0))return[3,9];return[4,e.adapter.writeBinary(d,x)];case 8:_tmp=_state.sent();return[3,13];case 9:if(!s)return[3,11];return[4,s(d,x)];case 10:_tmp1=_state.sent();return[3,12];case 11:_tmp1=l.push(x);_state.label=12;case 12:_tmp=_tmp1;_state.label=13;case 13:_tmp,u+=x.byteLength,p++,p%5===0&&Me.debug("[ChunkedDownload] progress ".concat(u,"/").concat(i," bytes (chunk #").concat(p,")"));_state.label=14;case 14:return[3,5];case 15:if(u!==i)throw new Error("Remote Size Not Match!");if(!s)return[3,20];return[4,e.adapter.exists(a)];case 16:_tmp3=_state.sent();if(!_tmp3)return[3,18];return[4,e.adapter.remove(a)];case 17:_tmp3=_state.sent();_state.label=18;case 18:_tmp3;return[4,e.adapter.rename(d,a)];case 19:_tmp2=_state.sent();return[3,22];case 20:Me.warn("[ChunkedDownload] adapter.appendBinary is unavailable; assembling chunks in memory");return[4,Wp(e,a,MUe(l,i))];case 21:_tmp2=_state.sent();_state.label=22;case 22:_tmp2,Me.info("[ChunkedDownload] done ".concat(r," (").concat(p," chunks)"));return[3,26];case 23:h=_state.sent();_tmp4=s;if(!_tmp4)return[3,25];return[4,NUe(e,d)];case 24:_tmp4=_state.sent();_state.label=25;case 25:throw _tmp4,h;case 26:return[2]}})}).apply(this,arguments)}function NUe(e,t){return _async_to_generator(function(){var _tmp,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);return[4,e.adapter.exists(t)];case 1:_tmp=_state.sent();if(!_tmp)return[3,3];return[4,e.adapter.remove(t)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[3,5];case 4:r=_state.sent();return[3,5];case 5:return[2]}})})()}function DUe(e){if(_instanceof(e.buffer,SharedArrayBuffer)){var t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}var Fx=require("obsidian"),Fb=nr(ln(),1);function Ya(e,t){return _async_to_generator(function(){var n,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t=(0,Fx.normalizePath)(t),!_m(e,t)){n=e.getAbstractFileByPath(t);if(_instanceof(n,Fx.TFolder))return[2,{path:t,basename:(0,Fb.basename)(t),isDir:!0,isDeleted:!1}];if(_instanceof(n,Fx.TFile))return[2,{path:t,basename:(0,Fb.basename)(t),isDir:!1,isDeleted:!1,mtime:n.stat.mtime,size:n.stat.size}]}return[4,e.adapter.stat(t)];case 1:r=_state.sent();if(r){if(r.type==="folder")return[2,{path:t,basename:(0,Fb.basename)(t),isDir:!0,isDeleted:!1,mtime:r.mtime}];if(r.type==="file")return[2,{path:t,basename:(0,Fb.basename)(t),isDir:!1,isDeleted:!1,mtime:r.mtime,size:r.size}]}return[2]}})})()}var Lte=nr(ln(),1);function zx(e){return{path:e.filename,basename:e.basename,isDir:e.type==="directory",isDeleted:!1,mtime:new Date(e.lastmod).valueOf(),size:e.size}}function Fte(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(0,Lte.isAbsolute)(t))throw new Error("stat WebDAV item, path must be absolute: "+t);return[4,e.stat(t,{details:!1})];case 1:r=_state.sent();return[2,zx(r)]}})})()}var fw=nr(p$(),1);function LUe(e,t){var r={};for(var o=0;o<t.length;o++){var a=t[o];r[a]?r[a].push(o):r[a]=[o]}var i=[{buffer1index:-1,buffer2index:-1,chain:null}];for(var o10=0;o10<e.length;o10++){var a9=e[o10],s=r[a9]||[],l=0,c=i[0];for(var d=0;d<s.length;d++){var u=s[d],p=void 0;for(p=l;p<i.length&&!(i[p].buffer2index<u&&(p===i.length-1||i[p+1].buffer2index>u));p++);if(p<i.length){var m={buffer1index:o10,buffer2index:u,chain:i[p]};if(l===i.length?i.push(c):i[l]=c,l=p+1,c=m,l===i.length)break}}i[l]=c}return i[i.length-1]}function zte(e,t){var r=LUe(e,t),n=[],i=e.length,o=t.length;for(var a=r;a!==null;a=a.chain){var s=i-a.buffer1index-1,l=o-a.buffer2index-1;i=a.buffer1index,o=a.buffer2index,(s||l)&&n.push({buffer1:[i+1,s],buffer1Content:e.slice(i+1,i+1+s),buffer2:[o+1,l],buffer2Content:t.slice(o+1,o+1+l)})}return n.reverse(),n}function FUe(e,t,r){var n=[];function i(l,c){n.push({ab:c,oStart:l.buffer1[0],oLength:l.buffer1[1],abStart:l.buffer2[0],abLength:l.buffer2[1]})}zte(t,e).forEach(function(l){return i(l,"a")}),zte(t,r).forEach(function(l){return i(l,"b")}),n.sort(function(l,c){return l.oStart-c.oStart});var o=[],a=0;function s(l){l>a&&(o.push({stable:!0,buffer:"o",bufferStart:a,bufferLength:l-a,bufferContent:t.slice(a,l)}),a=l)}for(;n.length;){var l=n.shift(),c=l.oStart,d=l.oStart+l.oLength,u=[l];for(s(c);n.length;){var p=n[0],m=p.oStart;if(m>d)break;d=Math.max(d,m+p.oLength),u.push(n.shift())}if(u.length===1){if(l.abLength>0){var p10=l.ab==="a"?e:r;o.push({stable:!0,buffer:l.ab,bufferStart:l.abStart,bufferLength:l.abLength,bufferContent:p10.slice(l.abStart,l.abStart+l.abLength)})}}else{var p11={a:[e.length,-1,t.length,-1],b:[r.length,-1,t.length,-1]};for(;u.length;){l=u.shift();var y=l.oStart,_=y+l.oLength,b=l.abStart,w=b+l.abLength,S=p11[l.ab];S[0]=Math.min(b,S[0]),S[1]=Math.max(w,S[1]),S[2]=Math.min(y,S[2]),S[3]=Math.max(_,S[3])}var m10=p11.a[0]+(c-p11.a[2]),h=p11.a[1]+(d-p11.a[3]),g=p11.b[0]+(c-p11.b[2]),x=p11.b[1]+(d-p11.b[3]),v={stable:!1,aStart:m10,aLength:h-m10,aContent:e.slice(m10,h),oStart:c,oLength:d-c,oContent:t.slice(c,d),bStart:g,bLength:x-g,bContent:r.slice(g,x)};o.push(v)}a=d}return s(t.length),o}function f$(e,t,r,n){n=Object.assign({excludeFalseConflicts:!0,stringSeparator:/\s+/},n),typeof e=="string"&&(e=e.split(n.stringSeparator)),typeof t=="string"&&(t=t.split(n.stringSeparator)),typeof r=="string"&&(r=r.split(n.stringSeparator));var o=[],a=FUe(e,t,r),s=[];function l(){s.length&&o.push({ok:s}),s=[]}function c(d,u){if(d.length!==u.length)return!1;for(var p=0;p<d.length;p++)if(d[p]!==u[p])return!1;return!0}return a.forEach(function(d){var _s1,_s2;d.stable?(_s1=s).push.apply(_s1,_to_consumable_array(d.bufferContent)):n.excludeFalseConflicts&&c(d.aContent,d.bContent)?(_s2=s).push.apply(_s2,_to_consumable_array(d.aContent)):(l(),o.push({conflict:{a:d.aContent,aIndex:d.aStart,o:d.oContent,oIndex:d.oStart,b:d.bContent,bIndex:d.bStart}}))}),l(),o}function jte(e,t,r,n){n=Object.assign({excludeFalseConflicts:!0,stringSeparator:/\s+/,label:{}},n);var o="<<<<<<<"+(n.label.a?" ".concat(n.label.a):""),a="|||||||"+(n.label.o?" ".concat(n.label.o):""),s="=======",l=">>>>>>>"+(n.label.b?" ".concat(n.label.b):""),c=f$(e,t,r,n),d=!1,u=[];return c.forEach(function(p){p.ok?u=u.concat(p.ok):p.conflict&&(d=!0,u=u.concat([o],p.conflict.a,[a],p.conflict.o,[s],p.conflict.b,[l]))}),{conflict:d,result:u}}var ys=function(){return new Map},N8=function(e){var t=ys();return e.forEach(function(r,n){t.set(n,r)}),t},Pd=function(e,t,r){var n=e.get(t);return n===void 0&&e.set(t,n=r()),n},Ute=function(e,t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];r.push(t(i,n))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r},Bte=function(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];if(t(n,r))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1};var Vp=function(){return new Set};var D8=function(e){return e[e.length-1]};var qte=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},Rd=Array.from,L8=function(e,t){for(var r=0;r<e.length;r++)if(!t(e[r],r,e))return!1;return!0},F8=function(e,t){for(var r=0;r<e.length;r++)if(t(e[r],r,e))return!0;return!1};var Wte=function(e,t){var r=new Array(e);for(var n=0;n<e;n++)r[n]=t(n,r);return r};var Ig=Array.isArray;var z8=/*#__PURE__*/function(){"use strict";function z81(){_class_call_check(this,z81);this._observers=ys()}_create_class(z81,[{key:"on",value:function on1(t,r){return Pd(this._observers,t,Vp).add(r),r}},{key:"once",value:function once(t,r){var _this=this;var n=function(){for(var _len=arguments.length,i=new Array(_len),_key=0;_key<_len;_key++){i[_key]=arguments[_key]}_this.off(t,n),r.apply(void 0,_to_consumable_array(i))};this.on(t,n)}},{key:"off",value:function off(t,r){var n=this._observers.get(t);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(t))}},{key:"emit",value:function emit(t,r){return Rd((this._observers.get(t)||ys()).values()).forEach(function(n){return n.apply(void 0,_to_consumable_array(r))})}},{key:"destroy",value:function destroy(){this._observers=ys()}}]);return z81}();var vs=Math.floor;var Pg=Math.abs;var j8=function(e,t){return e<t?e:t},Gp=function(e,t){return e>t?e:t},jZt=Number.isNaN;var U8=function(e){return e!==0?e<0:1/e<0};var Ux=Number.MAX_SAFE_INTEGER,h$=Number.MIN_SAFE_INTEGER,UZt=1<<31;var Vte=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&vs(e)===e},BZt=Number.isNaN,qZt=Number.parseInt;var x$=String.fromCharCode,zUe=String.fromCodePoint,WZt=x$(65535),jUe=function(e){return e.toLowerCase()},UUe=/^\s*/g,BUe=function(e){return e.replace(UUe,"")},qUe=/([A-Z])/g,y$=function(e,t){return BUe(e.replace(qUe,function(r){return"".concat(t).concat(jUe(r))}))};var WUe=function(e){var t=unescape(encodeURIComponent(e)),r=t.length,n=new Uint8Array(r);for(var i=0;i<r;i++)n[i]=t.codePointAt(i);return n},qx=typeof TextEncoder!="undefined"?new TextEncoder:null,VUe=function(e){return qx.encode(e)},Gte=qx?VUe:WUe;var Bx=typeof TextDecoder=="undefined"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Bx&&Bx.decode(new Uint8Array).length===1&&(Bx=null);var Hte=function(e,t){return Wte(t,function(){return e}).join("")};var Rg=function Rg1(){"use strict";_class_call_check(this,Rg1);this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]},qb=function(){return new Rg};var GUe=function(e){var t=e.cpos;for(var r=0;r<e.bufs.length;r++)t+=e.bufs[r].length;return t};var yc=function(e){var t=new Uint8Array(GUe(e)),r=0;for(var n=0;n<e.bufs.length;n++){var i=e.bufs[n];t.set(i,r),r+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),r),t},HUe=function(e,t){var r=e.cbuf.length;r-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Gp(r,t)*2),e.cpos=0)},ma=function(e,t){var r=e.cbuf.length;e.cpos===r&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(r*2),e.cpos=0),e.cbuf[e.cpos++]=t};var W8=ma;var en=function(e,t){for(;t>127;)ma(e,128|127&t),t=vs(t/128);ma(e,127&t)},V8=function(e,t){var r=U8(t);for(r&&(t=-t),ma(e,(t>63?128:0)|(r?64:0)|63&t),t=vs(t/64);t>0;)ma(e,(t>127?128:0)|127&t),t=vs(t/128)},v$=new Uint8Array(3e4),ZUe=v$.length/3,KUe=function(e,t){if(t.length<ZUe){var r=qx.encodeInto(t,v$).written||0;en(e,r);for(var n=0;n<r;n++)ma(e,v$[n])}else Ks(e,Gte(t))},QUe=function(e,t){var r=unescape(encodeURIComponent(t)),n=r.length;en(e,n);for(var i=0;i<n;i++)ma(e,r.codePointAt(i))},Mg=qx&&qx.encodeInto?KUe:QUe;var Wb=function(e,t){var r=e.cbuf.length,n=e.cpos,i=j8(r-n,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),n),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Gp(r*2,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},Ks=function(e,t){en(e,t.byteLength),Wb(e,t)},_$=function(e,t){HUe(e,t);var r=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,r},JUe=function(e,t){return _$(e,4).setFloat32(0,t,!1)},YUe=function(e,t){return _$(e,8).setFloat64(0,t,!1)},XUe=function(e,t){return _$(e,8).setBigInt64(0,t,!1)};var Kte=new DataView(new ArrayBuffer(4)),eBe=function(e){return Kte.setFloat32(0,e),Kte.getFloat32(0)===e},Vx=function(e,t){switch(typeof t==="undefined"?"undefined":_type_of(t)){case"string":ma(e,119),Mg(e,t);break;case"number":Vte(t)&&Pg(t)<=0x7fffffff?(ma(e,125),V8(e,t)):eBe(t)?(ma(e,124),JUe(e,t)):(ma(e,123),YUe(e,t));break;case"bigint":ma(e,122),XUe(e,t);break;case"object":if(t===null)ma(e,126);else if(Ig(t)){ma(e,117),en(e,t.length);for(var r=0;r<t.length;r++)Vx(e,t[r])}else if(_instanceof(t,Uint8Array))ma(e,116),Ks(e,t);else{ma(e,118);var r10=Object.keys(t);en(e,r10.length);for(var n=0;n<r10.length;n++){var i=r10[n];Mg(e,i),Vx(e,t[i])}}break;case"boolean":ma(e,t?120:121);break;default:ma(e,127)}},Bb=/*#__PURE__*/function(Rg1){"use strict";_inherits(Bb1,Rg1);function Bb1(t){_class_call_check(this,Bb1);var _this;_this=_call_super(this,Bb1),_this.w=t,_this.s=null,_this.count=0;return _this}_create_class(Bb1,[{key:"write",value:function write(t){this.s===t?this.count++:(this.count>0&&en(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}]);return Bb1}(Rg);var Qte=function(e){e.count>0&&(V8(e.encoder,e.count===1?e.s:-e.s),e.count>1&&en(e.encoder,e.count-2))},Og=/*#__PURE__*/function(){"use strict";function Og1(){_class_call_check(this,Og1);this.encoder=new Rg,this.s=0,this.count=0}_create_class(Og1,[{key:"write",value:function write(t){this.s===t?this.count++:(Qte(this),this.count=1,this.s=t)}},{key:"toUint8Array",value:function toUint8Array(){return Qte(this),yc(this.encoder)}}]);return Og1}();var Jte=function(e){if(e.count>0){var t=e.diff*2+(e.count===1?0:1);V8(e.encoder,t),e.count>1&&en(e.encoder,e.count-2)}},Gx=/*#__PURE__*/function(){"use strict";function Gx1(){_class_call_check(this,Gx1);this.encoder=new Rg,this.s=0,this.count=0,this.diff=0}_create_class(Gx1,[{key:"write",value:function write(t){this.diff===t-this.s?(this.s=t,this.count++):(Jte(this),this.count=1,this.diff=t-this.s,this.s=t)}},{key:"toUint8Array",value:function toUint8Array(){return Jte(this),yc(this.encoder)}}]);return Gx1}(),q8=/*#__PURE__*/function(){"use strict";function q81(){_class_call_check(this,q81);this.sarr=[],this.s="",this.lensE=new Og}_create_class(q81,[{key:"write",value:function write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}},{key:"toUint8Array",value:function toUint8Array(){var t=new Rg;return this.sarr.push(this.s),this.s="",Mg(t,this.sarr.join("")),Wb(t,this.lensE.toUint8Array()),yc(t)}}]);return q81}();var zl=function(e){return new Error(e)},jl=function(){throw zl("Method unimplemented")},Qs=function(){throw zl("Unexpected case")};var Yte=zl("Unexpected end of array"),Xte=zl("Integer out of Range"),Hx=function Hx1(t){"use strict";_class_call_check(this,Hx1);this.arr=t,this.pos=0},Lg=function(e){return new Hx(e)},ere=function(e){return e.pos!==e.arr.length};var rBe=function(e,t){var r=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,r},Js=function(e){return rBe(e,qr(e))};var $g=function(e){return e.arr[e.pos++]};var qr=function(e){var t=0,r=1,n=e.arr.length;for(;e.pos<n;){var i=e.arr[e.pos++];if(t=t+(i&127)*r,r*=128,i<128)return t;if(t>Ux)throw Xte}throw Yte},H8=function(e){var t=e.arr[e.pos++],r=t&63,n=64,i=(t&64)>0?-1:1;if(!(t&128))return i*r;var o=e.arr.length;for(;e.pos<o;){if(t=e.arr[e.pos++],r=r+(t&127)*n,n*=128,t<128)return i*r;if(r>Ux)throw Xte}throw Yte};var nBe=function(e){var t=qr(e);if(t===0)return"";{var r=String.fromCodePoint($g(e));if(--t<100)for(;t--;)r+=String.fromCodePoint($g(e));else for(;t>0;){var n=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+n);e.pos+=n,r+=String.fromCodePoint.apply(null,i),t-=n}return decodeURIComponent(escape(r))}},iBe=function(e){return Bx.decode(Js(e))},Ng=Bx?iBe:nBe;var w$=function(e,t){var r=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,r},oBe=function(e){return w$(e,4).getFloat32(0,!1)},aBe=function(e){return w$(e,8).getFloat64(0,!1)},sBe=function(e){return w$(e,8).getBigInt64(0,!1)};var lBe=[function(e){},function(e){return null},H8,oBe,aBe,sBe,function(e){return!1},function(e){return!0},Ng,function(e){var t=qr(e),r={};for(var n=0;n<t;n++){var i=Ng(e);r[i]=Zx(e)}return r},function(e){var t=qr(e),r=[];for(var n=0;n<t;n++)r.push(Zx(e));return r},Js],Zx=function(e){return lBe[127-$g(e)](e)},Vb=/*#__PURE__*/function(Hx1){"use strict";_inherits(Vb1,Hx1);function Vb1(t,r){_class_call_check(this,Vb1);var _this;_this=_call_super(this,Vb1,[t]),_this.reader=r,_this.s=null,_this.count=0;return _this}_create_class(Vb1,[{key:"read",value:function read(){return this.count===0&&(this.s=this.reader(this),ere(this)?this.count=qr(this)+1:this.count=-1),this.count--,this.s}}]);return Vb1}(Hx);var Dg=/*#__PURE__*/function(Hx1){"use strict";_inherits(Dg1,Hx1);function Dg1(t){_class_call_check(this,Dg1);var _this;_this=_call_super(this,Dg1,[t]),_this.s=0,_this.count=0;return _this}_create_class(Dg1,[{key:"read",value:function read(){if(this.count===0){this.s=H8(this);var t=U8(this.s);this.count=1,t&&(this.s=-this.s,this.count=qr(this)+2)}return this.count--,this.s}}]);return Dg1}(Hx);var Kx=/*#__PURE__*/function(Hx1){"use strict";_inherits(Kx1,Hx1);function Kx1(t){_class_call_check(this,Kx1);var _this;_this=_call_super(this,Kx1,[t]),_this.s=0,_this.count=0,_this.diff=0;return _this}_create_class(Kx1,[{key:"read",value:function read(){if(this.count===0){var t=H8(this),r=t&1;this.diff=vs(t/2),this.count=1,r&&(this.count=qr(this)+2)}return this.s+=this.diff,this.count--,this.s}}]);return Kx1}(Hx),G8=/*#__PURE__*/function(){"use strict";function G81(t){_class_call_check(this,G81);this.decoder=new Dg(t),this.str=Ng(this.decoder),this.spos=0}_create_class(G81,[{key:"read",value:function read(){var t=this.spos+this.decoder.read(),r=this.str.slice(this.spos,t);return this.spos=t,r}}]);return G81}();var HZt=crypto.subtle,tre=crypto.getRandomValues.bind(crypto);var S$=function(){return tre(new Uint32Array(1))[0]};var cBe=[1e7]+-1e3+-4e3+-8e3+-1e11,rre=function(){return cBe.replace(/[018]/g,function(e){return(e^S$()&15>>e/4).toString(16)})};var nre=Date.now;var k$=function(e){return new Promise(e)};var QZt=Promise.all.bind(Promise);var C$=function(e){return e===void 0?null:e};var E$=/*#__PURE__*/function(){"use strict";function E$1(){_class_call_check(this,E$1);this.map=new Map}_create_class(E$1,[{key:"setItem",value:function setItem(t,r){this.map.set(t,r)}},{key:"getItem",value:function getItem(t){return this.map.get(t)}}]);return E$1}(),ire=new E$,hBe=!0;try{typeof localStorage!="undefined"&&localStorage&&(ire=localStorage,hBe=!1)}catch(e){}var ore=ire;var Fg=Symbol("Equality"),Z8=function(e,t){var r;return e===t||!!((r=e==null?void 0:e[Fg])!=null&&r.call(e,t))||!1};var are=function(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"},sre=Object.assign,xBe=Object.keys;var lre=function(e,t){for(var r in e)t(e[r],r)};var Gb=function(e){return xBe(e).length};var ure=function(e){for(var t in e)return!1;return!0},Qx=function(e,t){for(var r in e)if(!t(e[r],r))return!1;return!0},Hb=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},A$=function(e,t){return e===t||Gb(e)===Gb(t)&&Qx(e,function(r,n){return(r!==void 0||Hb(t,n))&&Z8(t[n],r)})},yBe=Object.freeze,I$=function(e){for(var t in e){var r=e[t];((typeof r==="undefined"?"undefined":_type_of(r))=="object"||typeof r=="function")&&I$(e[t])}return yBe(e)};var Kb=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;try{var _e1;for(;r<e.length;r++)(_e1=e)[r].apply(_e1,_to_consumable_array(t))}finally{r<e.length&&Kb(e,t,r+1)}};var cre=function(e){return e};var Zb=function(e,t){if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[Fg]!=null)return e[Fg](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;break}case Set:{if(e.size!==t.size)return!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r10=_step.value;if(!t.has(r10))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}break}case Map:{if(e.size!==t.size)return!1;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e.keys()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r11=_step1.value;if(!t.has(r11)||!Zb(e.get(r11),t.get(r11)))return!1}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break}case void 0:case Object:if(Gb(e)!==Gb(t))return!1;for(var r12 in e)if(!Hb(e,r12)||!Zb(e[r12],t[r12]))return!1;break;case Array:if(e.length!==t.length)return!1;for(var r13=0;r13<e.length;r13++)if(!Zb(e[r13],t[r13]))return!1;break;default:return!1}return!0},dre=function(e,t){return t.includes(e)};var Qb=typeof process!="undefined"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]";var JZt=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1,Md,vBe=[],_Be=function(){if(Md===void 0)if(Qb){Md=ys();var e=process.argv,t=null;for(var r=0;r<e.length;r++){var n=e[r];n[0]==="-"?(t!==null&&Md.set(t,""),t=n):t!==null?(Md.set(t,n),t=null):vBe.push(n)}t!==null&&Md.set(t,"")}else(typeof location==="undefined"?"undefined":_type_of(location))=="object"?(Md=ys(),(location.search||"?").slice(1).split("&").forEach(function(e){if(e.length!==0){var _e_split=_sliced_to_array(e.split("="),2),t=_e_split[0],r=_e_split[1];Md.set("--".concat(y$(t,"-")),r),Md.set("-".concat(y$(t,"-")),r)}})):Md=ys();return Md},M$=function(e){return _Be().has(e)};var Jb=function(e){return Qb?C$(process.env[e.toUpperCase().replaceAll("-","_")]):C$(ore.getItem(e))};var pre=function(e){return M$("--"+e)||Jb(e)!==null},fre=pre("production"),bBe=Qb&&dre(process.env.FORCE_COLOR,["true","1","2"]),mre=bBe||!M$("--no-colors")&&!pre("no-color")&&(!Qb||process.stdout.isTTY)&&(!Qb||M$("--color")||Jb("COLORTERM")!==null||(Jb("TERM")||"").includes("color"));var wBe=function(e){return new Uint8Array(e)};var hre=function(e){var t=wBe(e.byteLength);return t.set(e),t};var $$=function $$1(t,r){"use strict";_class_call_check(this,$$1);this.left=t,this.right=r},Od=function(e,t){return new $$(e,t)};var N$=function(e){return e.next()>=.5},K8=function(e,t,r){return vs(e.next()*(r+1-t)+t)};var D$=function(e,t,r){return vs(e.next()*(r+1-t)+t)};var L$=function(e,t,r){return D$(e,t,r)};var CBe=function(e){return x$(L$(e,97,122))},gre=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:20;var n=L$(e,t,r),i="";for(var o=0;o<n;o++)i+=CBe(e);return i};var Q8=function(e,t){return t[L$(e,0,t.length-1)]};var TBe=Symbol("0schema"),F$=/*#__PURE__*/function(){"use strict";function F$1(){_class_call_check(this,F$1);this._rerrs=[]}_create_class(F$1,[{key:"extend",value:function extend(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._rerrs.push({path:t,expected:r,has:n,message:i})}},{key:"toString",value:function toString(){var t=[];for(var r=this._rerrs.length-1;r>0;r--){var n=this._rerrs[r];t.push(Hte(" ",(this._rerrs.length-r)*2)+"".concat(n.path!=null?"[".concat(n.path,"] "):"").concat(n.has," doesn't match ").concat(n.expected,". ").concat(n.message))}return t.join("\n")}}]);return F$1}(),z$=function(e,t){return e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Fg]?Z8(e,t):Ig(e)?L8(e,function(r){return F8(t,function(n){return z$(r,n)})}):are(e)?Qx(e,function(r,n){return z$(r,t[n])}):!1},ha=/*#__PURE__*/function(){"use strict";function ha1(){_class_call_check(this,ha1)}_create_class(ha1,[{key:"extends",value:function _extends(t){var _ref=[this.shape,t.shape],r=_ref[0],n=_ref[1];var ref;return this.constructor._dilutes&&(ref=[r,n],n=ref[0],r=ref[1],ref),z$(r,n)}},{key:"equals",value:function equals(t){return this.constructor===t.constructor&&Zb(this.shape,t.shape)}},{key:TBe,value:function value(){return!0}},{key:Fg,value:function value(t){return this.equals(t)}},{key:"validate",value:function validate(t){return this.check(t)}},{key:"check",value:function check(t,r){jl()}},{key:"nullable",get:function get1(){return ry(this,sC)}},{key:"optional",get:function get1(){return new J8(this)}},{key:"cast",value:function cast(t){return xre(t,this),t}},{key:"expect",value:function expect(t){return xre(t,this),t}}]);return ha1}();A(ha,"_dilutes",!1);var Xb=/*#__PURE__*/function(ha1){"use strict";_inherits(Xb1,ha1);function Xb1(t,r){_class_call_check(this,Xb1);var _this;_this=_call_super(this,Xb1),_this.shape=t,_this._c=r;return _this}_create_class(Xb1,[{key:"check",value:function check(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;var n=(t==null?void 0:t.constructor)===this.shape&&(this._c==null||this._c(t));return!n&&(r==null||r.extend(null,this.shape.name,t==null?void 0:t.constructor.name,(t==null?void 0:t.constructor)!==this.shape?"Constructor match failed":"Check failed")),n}}]);return Xb1}(ha),Ao=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return new Xb(e,t)},XZt=Ao(Xb),ew=/*#__PURE__*/function(ha1){"use strict";_inherits(ew1,ha1);function ew1(t){_class_call_check(this,ew1);var _this;_this=_call_super(this,ew1),_this.shape=t;return _this}_create_class(ew1,[{key:"check",value:function check(t,r){var n=this.shape(t);return!n&&(r==null||r.extend(null,"custom prop",t==null?void 0:t.constructor.name,"failed to check custom prop")),n}}]);return ew1}(ha),Qo=function(e){return new ew(e)},eKt=Ao(ew),ey=/*#__PURE__*/function(ha1){"use strict";_inherits(ey1,ha1);function ey1(t){_class_call_check(this,ey1);var _this;_this=_call_super(this,ey1),_this.shape=t;return _this}_create_class(ey1,[{key:"check",value:function check(t,r){var n=this.shape.some(function(i){return i===t});return!n&&(r==null||r.extend(null,this.shape.join(" | "),t.toString())),n}}]);return ey1}(ha),oC=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return new ey(e)},yre=Ao(ey),ABe=RegExp.escape||function(e){return e.replace(/[().|&,$^[\]]/g,function(t){return"\\"+t})},vre=function(e){if(ty.check(e))return[ABe(e)];if(yre.check(e))return e.shape.map(function(t){return t+""});if(kre.check(e))return["[+-]?\\d+.?\\d*"];if(Cre.check(e))return[".*"];if(nC.check(e))return e.shape.map(vre).flat(1);Qs()},j$=/*#__PURE__*/function(ha1){"use strict";_inherits(j$1,ha1);function j$1(t){_class_call_check(this,j$1);var _this;_this=_call_super(this,j$1),_this.shape=t,_this._r=new RegExp("^"+t.map(vre).map(function(r){return"(".concat(r.join("|"),")")}).join("")+"$");return _this}_create_class(j$1,[{key:"check",value:function check(t,r){var n=this._r.exec(t)!=null;return!n&&(r==null||r.extend(null,this._r.toString(),t.toString(),"String doesn't match string template.")),n}}]);return j$1}(ha);var tKt=Ao(j$),IBe=Symbol("optional"),J8=/*#__PURE__*/function(ha1){"use strict";_inherits(J81,ha1);function J81(t){_class_call_check(this,J81);var _this;_this=_call_super(this,J81),_this.shape=t;return _this}_create_class(J81,[{key:"check",value:function check(t,r){var n=t===void 0||this.shape.check(t);return!n&&(r==null||r.extend(null,"undefined (optional)","()")),n}},{key:IBe,get:function get1(){return!0}}]);return J81}(ha),PBe=Ao(J8),Y8=/*#__PURE__*/function(ha1){"use strict";_inherits(Y81,ha1);function Y81(){_class_call_check(this,Y81);return _call_super(this,Y81,arguments)}_create_class(Y81,[{key:"check",value:function check(t,r){return r==null||r.extend(null,"never",typeof t==="undefined"?"undefined":_type_of(t)),!1}}]);return Y81}(ha),rKt=new Y8,nKt=Ao(Y8),V$=/*#__PURE__*/function(ha1){"use strict";_inherits(V$1,ha1);function V$1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_class_call_check(this,V$1);var _this;_this=_call_super(this,V$1),_this.shape=t,_this._isPartial=r;return _this}_create_class(V$1,[{key:"partial",get:function get1(){return new V$(this.shape,!0)}},{key:"check",value:function check(t,r){var _this=this;return t==null?(r==null||r.extend(null,"object","null"),!1):Qx(this.shape,function(n,i){var o=_this._isPartial&&!Hb(t,i)||n.check(t[i],r);return!o&&(r==null||r.extend(i.toString(),n.toString(),_type_of(t[i]),"Object property does not match")),o})}}]);return V$1}(ha),Yb=V$;A(Yb,"_dilutes",!0);var RBe=function(e){return new Yb(e)},MBe=Ao(Yb),OBe=Qo(function(e){return e!=null&&(e.constructor===Object||e.constructor==null)}),X8=/*#__PURE__*/function(ha1){"use strict";_inherits(X81,ha1);function X81(t,r){_class_call_check(this,X81);var _this;_this=_call_super(this,X81),_this.shape={keys:t,values:r};return _this}_create_class(X81,[{key:"check",value:function check(t,r){var _this=this;return t!=null&&Qx(t,function(n,i){var o=_this.shape.keys.check(i,r);return!o&&(r==null||r.extend(i+"","Record",typeof t==="undefined"?"undefined":_type_of(t),o?"Key doesn't match schema":"Value doesn't match value")),o&&_this.shape.values.check(n,r)})}}]);return X81}(ha),_re=function(e,t){return new X8(e,t)},$Be=Ao(X8),eC=/*#__PURE__*/function(ha1){"use strict";_inherits(eC1,ha1);function eC1(t){_class_call_check(this,eC1);var _this;_this=_call_super(this,eC1),_this.shape=t;return _this}_create_class(eC1,[{key:"check",value:function check(t,r){return t!=null&&Qx(this.shape,function(n,i){var o=n.check(t[i],r);return!o&&(r==null||r.extend(i.toString(),"Tuple",typeof n==="undefined"?"undefined":_type_of(n))),o})}}]);return eC1}(ha),NBe=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return new eC(e)},iKt=Ao(eC),tC=/*#__PURE__*/function(ha1){"use strict";_inherits(tC1,ha1);function tC1(t){_class_call_check(this,tC1);var _this;_this=_call_super(this,tC1),_this.shape=t.length===1?t[0]:new Yx(t);return _this}_create_class(tC1,[{key:"check",value:function check(t,r){var _this=this;var n=Ig(t)&&L8(t,function(i){return _this.shape.check(i)});return!n&&(r==null||r.extend(null,"Array","")),n}}]);return tC1}(ha),bre=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return new tC(e)},DBe=Ao(tC),LBe=Qo(function(e){return Ig(e)}),rC=/*#__PURE__*/function(ha1){"use strict";_inherits(rC1,ha1);function rC1(t,r){_class_call_check(this,rC1);var _this;_this=_call_super(this,rC1),_this.shape=t,_this._c=r;return _this}_create_class(rC1,[{key:"check",value:function check(t,r){var n=_instanceof(t,this.shape)&&(this._c==null||this._c(t));return!n&&(r==null||r.extend(null,this.shape.name,t==null?void 0:t.constructor.name)),n}}]);return rC1}(ha),FBe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return new rC(e,t)},oKt=Ao(rC),zBe=FBe(ha),U$=/*#__PURE__*/function(ha1){"use strict";_inherits(U$1,ha1);function U$1(t){_class_call_check(this,U$1);var _this;_this=_call_super(this,U$1),_this.len=t.length-1,_this.args=NBe.apply(void 0,_to_consumable_array(t.slice(-1))),_this.res=t[_this.len];return _this}_create_class(U$1,[{key:"check",value:function check(t,r){var n=t.constructor===Function&&t.length<=this.len;return!n&&(r==null||r.extend(null,"function",typeof t==="undefined"?"undefined":_type_of(t))),n}}]);return U$1}(ha);var jBe=Ao(U$),UBe=Qo(function(e){return typeof e=="function"}),B$=/*#__PURE__*/function(ha1){"use strict";_inherits(B$1,ha1);function B$1(t){_class_call_check(this,B$1);var _this;_this=_call_super(this,B$1),_this.shape=t;return _this}_create_class(B$1,[{key:"check",value:function check(t,r){var n=L8(this.shape,function(i){return i.check(t,r)});return!n&&(r==null||r.extend(null,"Intersectinon",typeof t==="undefined"?"undefined":_type_of(t))),n}}]);return B$1}(ha);var aKt=Ao(B$,function(e){return e.shape.length>0}),Yx=/*#__PURE__*/function(ha1){"use strict";_inherits(Yx1,ha1);function Yx1(t){_class_call_check(this,Yx1);var _this;_this=_call_super(this,Yx1),_this.shape=t;return _this}_create_class(Yx1,[{key:"check",value:function check(t,r){var n=F8(this.shape,function(i){return i.check(t,r)});return r==null||r.extend(null,"Union",typeof t==="undefined"?"undefined":_type_of(t)),n}}]);return Yx1}(ha);A(Yx,"_dilutes",!0);var ry=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.findIndex(function(t){return nC.check(t)})>=0?ry.apply(void 0,_to_consumable_array(e.map(function(t){return tw(t)}).map(function(t){return nC.check(t)?t.shape:[t]}).flat(1))):e.length===1?e[0]:new Yx(e)},nC=Ao(Yx),wre=function(){return!0},iC=Qo(wre),BBe=Ao(ew,function(e){return e.shape===wre}),W$=Qo(function(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="bigint"}),qBe=Qo(function(e){return e===W$}),Sre=Qo(function(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="symbol"}),sKt=Qo(function(e){return e===Sre}),Xx=Qo(function(e){return typeof e=="number"}),kre=Qo(function(e){return e===Xx}),ty=Qo(function(e){return typeof e=="string"}),Cre=Qo(function(e){return e===ty}),aC=Qo(function(e){return typeof e=="boolean"}),WBe=Qo(function(e){return e===aC}),Ere=oC(void 0),lKt=Ao(ey,function(e){return e.shape.length===1&&e.shape[0]===void 0}),uKt=oC(void 0);var sC=oC(null),VBe=Ao(ey,function(e){return e.shape.length===1&&e.shape[0]===null}),cKt=Ao(Uint8Array),dKt=Ao(Xb,function(e){return e.shape===Uint8Array}),GBe=ry(Xx,ty,sC,Ere,W$,aC,Sre),pKt=function(){var e=bre(iC),t=_re(ty,iC),r=ry(Xx,ty,sC,aC,e,t);return e.shape=r,t.shape.values=r,r}(),tw=function(e){if(zBe.check(e))return e;if(OBe.check(e)){var t={};for(var r in e)t[r]=tw(e[r]);return RBe(t)}else{if(LBe.check(e))return ry.apply(void 0,_to_consumable_array(e.map(tw)));if(GBe.check(e))return oC(e);if(UBe.check(e))return Ao(e)}Qs()},xre=fre?function(){}:function(e,t){var r=new F$;if(!t.check(e,r))throw zl("Expected value to be of type ".concat(t.constructor.name,".\n").concat(r.toString()))},q$=/*#__PURE__*/function(){"use strict";function q$1(t){_class_call_check(this,q$1);this.patterns=[],this.$state=t}_create_class(q$1,[{key:"if",value:function _if(t,r){return this.patterns.push({if:tw(t),h:r}),this}},{key:"else",value:function _else(t){return this.if(iC,t)}},{key:"done",value:function done(){var _this=this;return function(t,r){for(var n=0;n<_this.patterns.length;n++){var i=_this.patterns[n];if(i.if.check(t))return i.h(t,r)}throw zl("Unhandled pattern")}}}]);return q$1}(),HBe=function(e){return new q$(e)},Tre=HBe(iC).if(kre,function(e,t){return K8(t,h$,Ux)}).if(Cre,function(e,t){return gre(t)}).if(WBe,function(e,t){return N$(t)}).if(qBe,function(e,t){return BigInt(K8(t,h$,Ux))}).if(nC,function(e,t){return Jx(t,Q8(t,e.shape))}).if(MBe,function(e,t){var r={};for(var n in e.shape){var i=e.shape[n];if(PBe.check(i)){if(N$(t))continue;i=i.shape}r[n]=Tre(i,t)}return r}).if(DBe,function(e,t){var r=[],n=D$(t,0,42);for(var i=0;i<n;i++)r.push(Jx(t,e.shape));return r}).if(yre,function(e,t){return Q8(t,e.shape)}).if(VBe,function(e,t){return null}).if(jBe,function(e,t){var r=Jx(t,e.res);return function(){return r}}).if(BBe,function(e,t){return Jx(t,Q8(t,[Xx,ty,sC,Ere,W$,aC,bre(Xx),_re(ry("a","b","c"),Xx)]))}).if($Be,function(e,t){var r={},n=K8(t,0,3);for(var i=0;i<n;i++){var o=Jx(t,e.shape.keys),a=Jx(t,e.shape.values);r[o]=a}return r}).done(),Jx=function(e,t){return Tre(tw(t),e)};var zg=typeof document!="undefined"?document:{};var mKt=Qo(function(e){return e.nodeType===YBe});var hKt=typeof DOMParser!="undefined"?new DOMParser:null;var gKt=Qo(function(e){return e.nodeType===KBe});var xKt=Qo(function(e){return e.nodeType===QBe});var Are=function(e){return Ute(e,function(t,r){return"".concat(r,":").concat(t,";")}).join("")};var KBe=zg.ELEMENT_NODE,QBe=zg.TEXT_NODE,yKt=zg.CDATA_SECTION_NODE,vKt=zg.COMMENT_NODE,JBe=zg.DOCUMENT_NODE,_Kt=zg.DOCUMENT_TYPE_NODE,YBe=zg.DOCUMENT_FRAGMENT_NODE,bKt=Qo(function(e){return e.nodeType===JBe});var $d=Symbol;var rw=$d(),nw=$d(),G$=$d(),H$=$d(),Z$=$d(),iw=$d(),K$=$d(),ny=$d(),Q$=$d(),Ire=function(e){var i;e.length===1&&((i=e[0])==null?void 0:i.constructor)===Function&&(e=e[0]());var t=[],r=[],n=0;for(;n<e.length;n++){var o=e[n];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)t.push(o);else if(o.constructor===Object)break}for(n>0&&r.push(t.join(""));n<e.length;n++){var o10=e[n];_instanceof(o10,Symbol)||r.push(o10)}return r};var wKt=nre();var _obj1;var rqe=(_obj1={},_define_property(_obj1,rw,Od("font-weight","bold")),_define_property(_obj1,nw,Od("font-weight","normal")),_define_property(_obj1,G$,Od("color","blue")),_define_property(_obj1,Z$,Od("color","green")),_define_property(_obj1,H$,Od("color","grey")),_define_property(_obj1,iw,Od("color","red")),_define_property(_obj1,K$,Od("color","purple")),_define_property(_obj1,ny,Od("color","orange")),_define_property(_obj1,Q$,Od("color","black")),_obj1),nqe=function(e){var a;e.length===1&&((a=e[0])==null?void 0:a.constructor)===Function&&(e=e[0]());var t=[],r=[],n=ys(),i=[],o=0;for(;o<e.length;o++){var s=e[o],l=rqe[s];if(l!==void 0)n.set(l.left,l.right);else{if(s===void 0)break;if(s.constructor===String||s.constructor===Number){var c=Are(n);o>0||c.length>0?(t.push("%c"+s),r.push(c)):t.push(s)}else break}}for(o>0&&(i=r,i.unshift(t.join("")));o<e.length;o++){var s10=e[o];_instanceof(s10,Symbol)||i.push(s10)}return i},Pre=mre?nqe:Ire,Rre=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var _console;(_console=console).log.apply(_console,_to_consumable_array(Pre(e))),Ore.forEach(function(t){return t.print(e)})},Mre=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var _console;(_console=console).warn.apply(_console,_to_consumable_array(Pre(e))),e.unshift(ny),Ore.forEach(function(t){return t.print(e)})};var Ore=Vp();var $re=function(e){var _obj;return _obj={},_define_property(_obj,Symbol.iterator,function(){return this}),_define_property(_obj,"next",e),_obj},Nre=function(e,t){return $re(function(){var r;do r=e.next();while(!r.done&&!t(r.value));return r})},lC=function(e,t){return $re(function(){var _e_next=e.next(),r=_e_next.done,n=_e_next.value;return{done:r,value:r?void 0:t(n)}})};var oy=function oy1(t,r){"use strict";_class_call_check(this,oy1);this.clock=t,this.len=r},jg=function jg1(){"use strict";_class_call_check(this,jg1);this.clients=new Map},Kre=function(e,t,r){return t.clients.forEach(function(n,i){var o=e.doc.store.clients.get(i);if(o!=null){var a=o[o.length-1],s=a.id.clock+a.length;for(var l=0,c=n[l];l<n.length&&c.clock<s;c=n[++l])one(e,o,c.clock,c.len,r)}})},lqe=function(e,t){var r=0,n=e.length-1;for(;r<=n;){var i=vs((r+n)/2),o=e[i],a=o.clock;if(a<=t){if(t<a+o.len)return i;r=i+1}else n=i-1}return null},Qre=function(e,t){var r=e.clients.get(t.client);return r!==void 0&&lqe(r,t.clock)!==null},dN=function(e){e.clients.forEach(function(t){t.sort(function(i,o){return i.clock-o.clock});var r,n;for(r=1,n=1;r<t.length;r++){var i=t[n-1],o=t[r];i.clock+i.len>=o.clock?t[n-1]=new oy(i.clock,Gp(i.len,o.clock+o.len-i.clock)):(n<r&&(t[n]=o),n++)}t.length=n})},uqe=function(e){var _loop=function(r){e[r].clients.forEach(function(n,i){if(!t.clients.has(i)){var o=n.slice();for(var a=r+1;a<e.length;a++)qte(o,e[a].clients.get(i)||[]);t.clients.set(i,o)}})};var t=new jg;for(var r=0;r<e.length;r++)_loop(r);return dN(t),t},mC=function(e,t,r,n){Pd(e.clients,t,function(){return[]}).push(new oy(r,n))},Jre=function(){return new jg},cqe=function(e){var t=Jre();return e.clients.forEach(function(r,n){var i=[];for(var o=0;o<r.length;o++){var a=r[o];if(a.deleted){var s=a.id.clock,l=a.length;if(o+1<r.length)for(var c=r[o+1];o+1<r.length&&c.deleted;c=r[++o+1])l+=c.length;i.push(new oy(s,l))}}i.length>0&&t.clients.set(n,i)}),t},cy=function(e,t){en(e.restEncoder,t.clients.size),Rd(t.clients.entries()).sort(function(r,n){return n[0]-r[0]}).forEach(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];e.resetDsCurVal(),en(e.restEncoder,r);var i=n.length;en(e.restEncoder,i);for(var o=0;o<i;o++){var a=n[o];e.writeDsClock(a.clock),e.writeDsLen(a.len)}})},pN=function(e){var t=new jg,r=qr(e.restDecoder);for(var n=0;n<r;n++){e.resetDsCurVal();var i=qr(e.restDecoder),o=qr(e.restDecoder);if(o>0){var a=Pd(t.clients,i,function(){return[]});for(var s=0;s<o;s++)a.push(new oy(e.readDsClock(),e.readDsLen()))}}return t},Fre=function(e,t,r){var n=new jg,i=qr(e.restDecoder);for(var o=0;o<i;o++){e.resetDsCurVal();var a=qr(e.restDecoder),s=qr(e.restDecoder),l=r.clients.get(a)||[],c=ga(r,a);for(var d=0;d<s;d++){var u=e.readDsClock(),p=u+e.readDsLen();if(u<c){c<p&&mC(n,a,c,p-c);var m=Nd(l,u),h=l[m];for(!h.deleted&&h.id.clock<u&&(l.splice(m+1,0,SC(t,h,u-h.id.clock)),m++);m<l.length&&(h=l[m++],h.id.clock<p);)h.deleted||(p<h.id.clock+h.length&&l.splice(m,0,SC(t,h,p-h.id.clock)),h.delete(t))}else mC(n,a,u,p-u)}}if(n.clients.size>0){var o10=new Hp;return en(o10.restEncoder,0),cy(o10,n),o10.toUint8Array()}return null};var Yre=S$,vc=/*#__PURE__*/function(z81){"use strict";_inherits(vc1,z81);function vc1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.guid,t=tmp===void 0?rre():tmp,tmp1=_ref.collectionid,r=tmp1===void 0?null:tmp1,tmp2=_ref.gc,n=tmp2===void 0?!0:tmp2,tmp3=_ref.gcFilter,i=tmp3===void 0?function(){return!0}:tmp3,tmp4=_ref.meta,o=tmp4===void 0?null:tmp4,tmp5=_ref.autoLoad,a=tmp5===void 0?!1:tmp5,tmp6=_ref.shouldLoad,s=tmp6===void 0?!0:tmp6;_class_call_check(this,vc1);var _this;_this=_call_super(this,vc1),_this.gc=n,_this.gcFilter=i,_this.clientID=Yre(),_this.guid=t,_this.collectionid=r,_this.share=new Map,_this.store=new vC,_this._transaction=null,_this._transactionCleanups=[],_this.subdocs=new Set,_this._item=null,_this.shouldLoad=s,_this.autoLoad=a,_this.meta=o,_this.isLoaded=!1,_this.isSynced=!1,_this.isDestroyed=!1,_this.whenLoaded=k$(function(c){_this.on("load",function(){_this.isLoaded=!0,c(_this)})});var l=function(){return k$(function(c){var d=function(u){(u===void 0||u===!0)&&(_this.off("sync",d),c())};_this.on("sync",d)})};_this.on("sync",function(c){c===!1&&_this.isSynced&&(_this.whenSynced=l()),_this.isSynced=c===void 0||c===!0,_this.isSynced&&!_this.isLoaded&&_this.emit("load",[_this])}),_this.whenSynced=l();return _this}_create_class(vc1,[{key:"load",value:function load(){var _this=this;var t=this._item;t!==null&&!this.shouldLoad&&xi(t.parent.doc,function(r){r.subdocsLoaded.add(_this)},null,!0),this.shouldLoad=!0}},{key:"getSubdocs",value:function getSubdocs(){return this.subdocs}},{key:"getSubdocGuids",value:function getSubdocGuids(){return new Set(Rd(this.subdocs).map(function(t){return t.guid}))}},{key:"transact",value:function transact(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return xi(this,t,r)}},{key:"get",value:function get1(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jo;var n=Pd(this.share,t,function(){var o=new r;return o._integrate(_this,null),o}),i=n.constructor;if(r!==Jo&&i!==r)if(i===Jo){var o=new r;o._map=n._map,n._map.forEach(function(a){for(;a!==null;a=a.left)a.parent=o}),o._start=n._start;for(var a=o._start;a!==null;a=a.right)a.parent=o;return o._length=n._length,this.share.set(t,o),o._integrate(this,null),o}else throw new Error("Type with the name ".concat(t," has already been defined with a different constructor"));return n}},{key:"getArray",value:function getArray(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.get(t,Cm)}},{key:"getText",value:function getText(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.get(t,Im)}},{key:"getMap",value:function getMap(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.get(t,Am)}},{key:"getXmlElement",value:function getXmlElement(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.get(t,Pm)}},{key:"getXmlFragment",value:function getXmlFragment(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.get(t,Zp)}},{key:"toJSON",value:function toJSON(){var t={};return this.share.forEach(function(r,n){t[n]=r.toJSON()}),t}},{key:"destroy",value:function destroy(){var _this=this;this.isDestroyed=!0,Rd(this.subdocs).forEach(function(r){return r.destroy()});var t=this._item;if(t!==null){this._item=null;var r=t.content;r.doc=new vc(_object_spread_props(_object_spread({guid:this.guid},r.opts),{shouldLoad:!1})),r.doc._item=t,xi(t.parent.doc,function(n){var i=r.doc;t.deleted||n.subdocsAdded.add(i),n.subdocsRemoved.add(_this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),_get(_get_prototype_of(vc1.prototype),"destroy",this).call(this)}}]);return vc1}(z8),hC=/*#__PURE__*/function(){"use strict";function hC1(t){_class_call_check(this,hC1);this.restDecoder=t}_create_class(hC1,[{key:"resetDsCurVal",value:function resetDsCurVal(){}},{key:"readDsClock",value:function readDsClock(){return qr(this.restDecoder)}},{key:"readDsLen",value:function readDsLen(){return qr(this.restDecoder)}}]);return hC1}(),gC=/*#__PURE__*/function(hC1){"use strict";_inherits(gC1,hC1);function gC1(){_class_call_check(this,gC1);return _call_super(this,gC1,arguments)}_create_class(gC1,[{key:"readLeftID",value:function readLeftID(){return dn(qr(this.restDecoder),qr(this.restDecoder))}},{key:"readRightID",value:function readRightID(){return dn(qr(this.restDecoder),qr(this.restDecoder))}},{key:"readClient",value:function readClient(){return qr(this.restDecoder)}},{key:"readInfo",value:function readInfo(){return $g(this.restDecoder)}},{key:"readString",value:function readString(){return Ng(this.restDecoder)}},{key:"readParentInfo",value:function readParentInfo(){return qr(this.restDecoder)===1}},{key:"readTypeRef",value:function readTypeRef(){return qr(this.restDecoder)}},{key:"readLen",value:function readLen(){return qr(this.restDecoder)}},{key:"readAny",value:function readAny(){return Zx(this.restDecoder)}},{key:"readBuf",value:function readBuf(){return hre(Js(this.restDecoder))}},{key:"readJSON",value:function readJSON(){return JSON.parse(Ng(this.restDecoder))}},{key:"readKey",value:function readKey(){return Ng(this.restDecoder)}}]);return gC1}(hC),X$=/*#__PURE__*/function(){"use strict";function X$1(t){_class_call_check(this,X$1);this.dsCurrVal=0,this.restDecoder=t}_create_class(X$1,[{key:"resetDsCurVal",value:function resetDsCurVal(){this.dsCurrVal=0}},{key:"readDsClock",value:function readDsClock(){return this.dsCurrVal+=qr(this.restDecoder),this.dsCurrVal}},{key:"readDsLen",value:function readDsLen(){var t=qr(this.restDecoder)+1;return this.dsCurrVal+=t,t}}]);return X$1}(),Em=/*#__PURE__*/function(X$1){"use strict";_inherits(Em1,X$1);function Em1(t){_class_call_check(this,Em1);var _this;_this=_call_super(this,Em1,[t]),_this.keys=[],qr(t),_this.keyClockDecoder=new Kx(Js(t)),_this.clientDecoder=new Dg(Js(t)),_this.leftClockDecoder=new Kx(Js(t)),_this.rightClockDecoder=new Kx(Js(t)),_this.infoDecoder=new Vb(Js(t),$g),_this.stringDecoder=new G8(Js(t)),_this.parentInfoDecoder=new Vb(Js(t),$g),_this.typeRefDecoder=new Dg(Js(t)),_this.lenDecoder=new Dg(Js(t));return _this}_create_class(Em1,[{key:"readLeftID",value:function readLeftID(){return new km(this.clientDecoder.read(),this.leftClockDecoder.read())}},{key:"readRightID",value:function readRightID(){return new km(this.clientDecoder.read(),this.rightClockDecoder.read())}},{key:"readClient",value:function readClient(){return this.clientDecoder.read()}},{key:"readInfo",value:function readInfo(){return this.infoDecoder.read()}},{key:"readString",value:function readString(){return this.stringDecoder.read()}},{key:"readParentInfo",value:function readParentInfo(){return this.parentInfoDecoder.read()===1}},{key:"readTypeRef",value:function readTypeRef(){return this.typeRefDecoder.read()}},{key:"readLen",value:function readLen(){return this.lenDecoder.read()}},{key:"readAny",value:function readAny(){return Zx(this.restDecoder)}},{key:"readBuf",value:function readBuf(){return Js(this.restDecoder)}},{key:"readJSON",value:function readJSON(){return Zx(this.restDecoder)}},{key:"readKey",value:function readKey(){var t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{var r=this.stringDecoder.read();return this.keys.push(r),r}}}]);return Em1}(X$),xC=/*#__PURE__*/function(){"use strict";function xC1(){_class_call_check(this,xC1);this.restEncoder=qb()}_create_class(xC1,[{key:"toUint8Array",value:function toUint8Array(){return yc(this.restEncoder)}},{key:"resetDsCurVal",value:function resetDsCurVal(){}},{key:"writeDsClock",value:function writeDsClock(t){en(this.restEncoder,t)}},{key:"writeDsLen",value:function writeDsLen(t){en(this.restEncoder,t)}}]);return xC1}(),Ug=/*#__PURE__*/function(xC1){"use strict";_inherits(Ug1,xC1);function Ug1(){_class_call_check(this,Ug1);return _call_super(this,Ug1,arguments)}_create_class(Ug1,[{key:"writeLeftID",value:function writeLeftID(t){en(this.restEncoder,t.client),en(this.restEncoder,t.clock)}},{key:"writeRightID",value:function writeRightID(t){en(this.restEncoder,t.client),en(this.restEncoder,t.clock)}},{key:"writeClient",value:function writeClient(t){en(this.restEncoder,t)}},{key:"writeInfo",value:function writeInfo(t){W8(this.restEncoder,t)}},{key:"writeString",value:function writeString(t){Mg(this.restEncoder,t)}},{key:"writeParentInfo",value:function writeParentInfo(t){en(this.restEncoder,t?1:0)}},{key:"writeTypeRef",value:function writeTypeRef(t){en(this.restEncoder,t)}},{key:"writeLen",value:function writeLen(t){en(this.restEncoder,t)}},{key:"writeAny",value:function writeAny(t){Vx(this.restEncoder,t)}},{key:"writeBuf",value:function writeBuf(t){Ks(this.restEncoder,t)}},{key:"writeJSON",value:function writeJSON(t){Mg(this.restEncoder,JSON.stringify(t))}},{key:"writeKey",value:function writeKey(t){Mg(this.restEncoder,t)}}]);return Ug1}(xC),yC=/*#__PURE__*/function(){"use strict";function yC1(){_class_call_check(this,yC1);this.restEncoder=qb(),this.dsCurrVal=0}_create_class(yC1,[{key:"toUint8Array",value:function toUint8Array(){return yc(this.restEncoder)}},{key:"resetDsCurVal",value:function resetDsCurVal(){this.dsCurrVal=0}},{key:"writeDsClock",value:function writeDsClock(t){var r=t-this.dsCurrVal;this.dsCurrVal=t,en(this.restEncoder,r)}},{key:"writeDsLen",value:function writeDsLen(t){t===0&&Qs(),en(this.restEncoder,t-1),this.dsCurrVal+=t}}]);return yC1}(),Hp=/*#__PURE__*/function(yC1){"use strict";_inherits(Hp1,yC1);function Hp1(){_class_call_check(this,Hp1);var _this;_this=_call_super(this,Hp1),_this.keyMap=new Map,_this.keyClock=0,_this.keyClockEncoder=new Gx,_this.clientEncoder=new Og,_this.leftClockEncoder=new Gx,_this.rightClockEncoder=new Gx,_this.infoEncoder=new Bb(W8),_this.stringEncoder=new q8,_this.parentInfoEncoder=new Bb(W8),_this.typeRefEncoder=new Og,_this.lenEncoder=new Og;return _this}_create_class(Hp1,[{key:"toUint8Array",value:function toUint8Array(){var t=qb();return en(t,0),Ks(t,this.keyClockEncoder.toUint8Array()),Ks(t,this.clientEncoder.toUint8Array()),Ks(t,this.leftClockEncoder.toUint8Array()),Ks(t,this.rightClockEncoder.toUint8Array()),Ks(t,yc(this.infoEncoder)),Ks(t,this.stringEncoder.toUint8Array()),Ks(t,yc(this.parentInfoEncoder)),Ks(t,this.typeRefEncoder.toUint8Array()),Ks(t,this.lenEncoder.toUint8Array()),Wb(t,yc(this.restEncoder)),yc(t)}},{key:"writeLeftID",value:function writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}},{key:"writeRightID",value:function writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}},{key:"writeClient",value:function writeClient(t){this.clientEncoder.write(t)}},{key:"writeInfo",value:function writeInfo(t){this.infoEncoder.write(t)}},{key:"writeString",value:function writeString(t){this.stringEncoder.write(t)}},{key:"writeParentInfo",value:function writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}},{key:"writeTypeRef",value:function writeTypeRef(t){this.typeRefEncoder.write(t)}},{key:"writeLen",value:function writeLen(t){this.lenEncoder.write(t)}},{key:"writeAny",value:function writeAny(t){Vx(this.restEncoder,t)}},{key:"writeBuf",value:function writeBuf(t){Ks(this.restEncoder,t)}},{key:"writeJSON",value:function writeJSON(t){Vx(this.restEncoder,t)}},{key:"writeKey",value:function writeKey(t){var r=this.keyMap.get(t);r===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(r)}}]);return Hp1}(yC),dqe=function(e,t,r,n){n=Gp(n,t[0].id.clock);var i=Nd(t,n);en(e.restEncoder,t.length-i),e.writeClient(r),en(e.restEncoder,n);var o=t[i];o.write(e,n-o.id.clock);for(var a=i+1;a<t.length;a++)t[a].write(e,0)},fN=function(e,t,r){var n=new Map;r.forEach(function(i,o){ga(t,o)>i&&n.set(o,i)}),kC(t).forEach(function(i,o){r.has(o)||n.set(o,0)}),en(e.restEncoder,n.size),Rd(n.entries()).sort(function(i,o){return o[0]-i[0]}).forEach(function(param){var _param=_sliced_to_array(param,2),i=_param[0],o=_param[1];dqe(e,t.clients.get(i),i,o)})},pqe=function(e,t){var r=ys(),n=qr(e.restDecoder);for(var i=0;i<n;i++){var o=qr(e.restDecoder),a=new Array(o),s=e.readClient(),l=qr(e.restDecoder);r.set(s,{i:0,refs:a});for(var c=0;c<o;c++){var d=e.readInfo();switch(31&d){case 0:{var u=e.readLen();a[c]=new Ys(dn(s,l),u),l+=u;break}case 10:{var u10=qr(e.restDecoder);a[c]=new Xs(dn(s,l),u10),l+=u10;break}default:{var u11=(d&192)===0,p=new uo(dn(s,l),null,(d&128)===128?e.readLeftID():null,null,(d&64)===64?e.readRightID():null,u11?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u11&&(d&32)===32?e.readString():null,kne(e,d));a[c]=p,l+=p.length}}}}return r},fqe=function(e,t,r){var n=[],i=Rd(r.keys()).sort(function(m,h){return m-h});if(i.length===0)return null;var o=function(){if(i.length===0)return null;var m=r.get(i[i.length-1]);for(;m.refs.length===m.i;)if(i.pop(),i.length>0)m=r.get(i[i.length-1]);else return null;return m},a=o();if(a===null)return null;var s=new vC,l=new Map,c=function(m,h){var g=l.get(m);(g==null||g>h)&&l.set(m,h)},d=a.refs[a.i++],u=new Map,p=function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var m=_step.value;var h=m.id.client,g=r.get(h);g?(g.i--,s.clients.set(h,g.refs.slice(g.i)),r.delete(h),g.i=0,g.refs=[]):s.clients.set(h,[m]),i=i.filter(function(x){return x!==h})};for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n.length=0};for(;;){if(d.constructor!==Xs){var h=Pd(u,d.id.client,function(){return ga(t,d.id.client)})-d.id.clock;if(h<0)n.push(d),c(d.id.client,d.id.clock-1),p();else{var g=d.getMissing(e,t);if(g!==null){n.push(d);var x=r.get(g)||{refs:[],i:0};if(x.refs.length===x.i)c(g,ga(t,g)),p();else{d=x.refs[x.i++];continue}}else(h===0||h<d.length)&&(d.integrate(e,h),u.set(d.id.client,d.id.clock+d.length))}}if(n.length>0)d=n.pop();else if(a!==null&&a.i<a.refs.length)d=a.refs[a.i++];else{if(a=o(),a===null)break;d=a.refs[a.i++]}}if(s.clients.size>0){var m=new Hp;return fN(m,s,new Map),en(m.restEncoder,0),{missing:l,update:m.toUint8Array()}}return null},mqe=function(e,t){return fN(e,t.doc.store,t.beforeState)},hqe=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Em(e);return xi(t,function(i){i.local=!1;var o=!1,a=i.doc,s=a.store,l=pqe(n,a),c=fqe(i,s,l),d=s.pendingStructs;if(d){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=d.missing[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),p=_step_value[0],m=_step_value[1];if(m<ga(s,p)){o=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(c){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=c.missing[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,2),p10=_step_value1[0],m10=_step_value1[1];var h=d.missing.get(p10);(h==null||h>m10)&&d.missing.set(p10,m10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}d.update=_C([d.update,c.update])}}else s.pendingStructs=c;var u=Fre(n,i,s);if(s.pendingDs){var p11=new Em(Lg(s.pendingDs));qr(p11.restDecoder);var m11=Fre(p11,i,s);u&&m11?s.pendingDs=_C([u,m11]):s.pendingDs=u||m11}else s.pendingDs=u;if(o){var p12=s.pendingStructs.update;s.pendingStructs=null,Xre(i.doc,p12)}},r,!1)};var Xre=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Em;var i=Lg(t);hqe(i,e,r,new n(i))},pw=function(e,t,r){return Xre(e,t,r,gC)},gqe=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map;fN(e,t.store,r),cy(e,cqe(t.store))},xqe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Uint8Array([0]),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Hp;var n=ene(t);gqe(r,e,n);var i=[r.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(Pqe(e.store.pendingStructs.update,t)),i.length>1){if(r.constructor===Ug)return Aqe(i.map(function(o,a){return a===0?o:Mqe(o)}));if(r.constructor===Hp)return _C(i)}return i[0]},mN=function(e,t){return xqe(e,t,new Ug)},yqe=function(e){var t=new Map,r=qr(e.restDecoder);for(var n=0;n<r;n++){var i=qr(e.restDecoder),o=qr(e.restDecoder);t.set(i,o)}return t},ene=function(e){return yqe(new hC(Lg(e)))},tne=function(e,t){return en(e.restEncoder,t.size),Rd(t.entries()).sort(function(r,n){return n[0]-r[0]}).forEach(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];en(e.restEncoder,r),en(e.restEncoder,n)}),e},vqe=function(e,t){return tne(e,kC(t.store))},_qe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new yC;return _instanceof(e,Map)?tne(t,e):vqe(t,e),t.toUint8Array()},rne=function(e){return _qe(e,new xC)},eN=function eN1(){"use strict";_class_call_check(this,eN1);this.l=[]},zre=function(){return new eN},jre=function(e,t){return e.l.push(t)},Ure=function(e,t){var r=e.l,n=r.length;e.l=r.filter(function(i){return t!==i}),n===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},nne=function(e,t,r){return Kb(e.l,[t,r])},km=function km1(t,r){"use strict";_class_call_check(this,km1);this.client=t,this.clock=r},uC=function(e,t){return e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock},dn=function(e,t){return new km(e,t)};var bqe=function(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.doc.share.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),t=_step_value[0],r=_step_value[1];if(r===e)return t}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}throw Qs()};var tN=function tN1(t,r){"use strict";_class_call_check(this,tN1);this.ds=t,this.sv=r};var wqe=function(e,t){return new tN(e,t)},OKt=wqe(Jre(),new Map);var iy=function(e,t){return t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Qre(t.ds,e.id)},rN=function(e,t){var r=Pd(e.meta,rN,Vp),n=e.doc.store;r.has(t)||(t.sv.forEach(function(i,o){i<ga(n,o)&&Tm(e,dn(o,i))}),Kre(e,t.ds,function(i){}),r.add(t))};var vC=function vC1(){"use strict";_class_call_check(this,vC1);this.clients=new Map,this.pendingStructs=null,this.pendingDs=null},kC=function(e){var t=new Map;return e.clients.forEach(function(r,n){var i=r[r.length-1];t.set(n,i.id.clock+i.length)}),t},ga=function(e,t){var r=e.clients.get(t);if(r===void 0)return 0;var n=r[r.length-1];return n.id.clock+n.length},ine=function(e,t){var r=e.clients.get(t.id.client);if(r===void 0)r=[],e.clients.set(t.id.client,r);else{var n=r[r.length-1];if(n.id.clock+n.length!==t.id.clock)throw Qs()}r.push(t)},Nd=function(e,t){var r=0,n=e.length-1,i=e[n],o=i.id.clock;if(o===t)return n;var a=vs(t/(o+i.length-1)*n);for(;r<=n;){if(i=e[a],o=i.id.clock,o<=t){if(t<o+i.length)return a;r=a+1}else n=a-1;a=vs((r+n)/2)}throw Qs()},Sqe=function(e,t){var r=e.clients.get(t.client);return r[Nd(r,t.clock)]},J$=Sqe,nN=function(e,t,r){var n=Nd(t,r),i=t[n];return i.id.clock<r&&_instanceof(i,uo)?(t.splice(n+1,0,SC(e,i,r-i.id.clock)),n+1):n},Tm=function(e,t){var r=e.doc.store.clients.get(t.client);return r[nN(e,r,t.clock)]},Bre=function(e,t,r){var n=t.clients.get(r.client),i=Nd(n,r.clock),o=n[i];return r.clock!==o.id.clock+o.length-1&&o.constructor!==Ys&&n.splice(i+1,0,SC(e,o,r.clock-o.id.clock+1)),o},kqe=function(e,t,r){var n=e.clients.get(t.id.client);n[Nd(n,t.id.clock)]=r},one=function(e,t,r,n,i){if(n===0)return;var o=r+n,a=nN(e,t,r),s;do s=t[a++],o<s.id.clock+s.length&&nN(e,t,o),i(s);while(a<t.length&&t[a].id.clock<o)},iN=function iN1(t,r,n){"use strict";_class_call_check(this,iN1);this.doc=t,this.deleteSet=new jg,this.beforeState=kC(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=r,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1},qre=function(e,t){return t.deleteSet.clients.size===0&&!Bte(t.afterState,function(r,n){return t.beforeState.get(n)!==r})?!1:(dN(t.deleteSet),mqe(e,t),cy(e,t.deleteSet),!0)},Wre=function(e,t,r){var n=t._item;(n===null||n.id.clock<(e.beforeState.get(n.id.client)||0)&&!n.deleted)&&Pd(e.changed,t,Vp).add(r)},pC=function(e,t){var r=e[t],n=e[t-1],i=t;for(;i>0;r=n,n=e[--i-1]){if(n.deleted===r.deleted&&n.constructor===r.constructor&&n.mergeWith(r)){_instanceof(r,uo)&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r&&r.parent._map.set(r.parentSub,n);continue}break}var o=t-i;return o&&e.splice(t+1-o,o),o},Cqe=function(e,t,r){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.clients.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];var o=t.clients.get(n);for(var a=i.length-1;a>=0;a--){var s=i[a],l=s.clock+s.len;for(var c=Nd(o,s.clock),d=o[c];c<o.length&&d.id.clock<l;d=o[++c]){var u=o[c];if(s.clock+s.len<=u.id.clock)break;_instanceof(u,uo)&&u.deleted&&!u.keep&&r(u)&&u.gc(t,!1)}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}},Eqe=function(e,t){e.clients.forEach(function(r,n){var i=t.clients.get(n);for(var o=r.length-1;o>=0;o--){var a=r[o],s=j8(i.length-1,1+Nd(i,a.clock+a.len-1));for(var l=s,c=i[l];l>0&&c.id.clock>=a.clock;c=i[l])l-=1+pC(i,l)}})};var ane=function(e,t){if(t<e.length){var r=e[t],n=r.doc,i=n.store,o=r.deleteSet,a=r._mergeStructs;try{dN(o),r.afterState=kC(r.doc.store),n.emit("beforeObserverCalls",[r,n]);var s=[];r.changed.forEach(function(l,c){return s.push(function(){(c._item===null||!c._item.deleted)&&c._callObserver(r,l)})}),s.push(function(){r.changedParentTypes.forEach(function(l,c){c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(function(d){return d.target._item===null||!d.target._item.deleted}),l.forEach(function(d){d.currentTarget=c,d._path=null}),l.sort(function(d,u){return d.path.length-u.path.length}),s.push(function(){nne(c._dEH,l,r)}))}),s.push(function(){return n.emit("afterTransaction",[r,n])}),s.push(function(){r._needFormattingCleanup&&qqe(r)})}),Kb(s,[])}finally{n.gc&&Cqe(o,i,n.gcFilter),Eqe(o,i),r.afterState.forEach(function(d,u){var p=r.beforeState.get(u)||0;if(p!==d){var m=i.clients.get(u),h=Gp(Nd(m,p),1);for(var g=m.length-1;g>=h;)g-=1+pC(m,g)}});for(var d=a.length-1;d>=0;d--){var _a_d_id=a[d].id,u=_a_d_id.client,p=_a_d_id.clock,m=i.clients.get(u),h=Nd(m,p);h+1<m.length&&pC(m,h+1)>1||h>0&&pC(m,h)}if(!r.local&&r.afterState.get(n.clientID)!==r.beforeState.get(n.clientID)&&(Rre(ny,rw,"[yjs] ",nw,iw,"Changed the client-id because another client seems to be using it."),n.clientID=Yre()),n.emit("afterTransactionCleanup",[r,n]),n._observers.has("update")){var d10=new Ug;qre(d10,r)&&n.emit("update",[d10.toUint8Array(),r.origin,n,r])}if(n._observers.has("updateV2")){var d11=new Hp;qre(d11,r)&&n.emit("updateV2",[d11.toUint8Array(),r.origin,n,r])}var s10=r.subdocsAdded,l=r.subdocsLoaded,c=r.subdocsRemoved;(s10.size>0||c.size>0||l.size>0)&&(s10.forEach(function(d){d.clientID=n.clientID,d.collectionid==null&&(d.collectionid=n.collectionid),n.subdocs.add(d)}),c.forEach(function(d){return n.subdocs.delete(d)}),n.emit("subdocs",[{loaded:l,added:s10,removed:c},n,r]),c.forEach(function(d){return d.destroy()})),e.length<=t+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,e])):ane(e,t+1)}}},xi=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;var i=e._transactionCleanups,o=!1,a=null;e._transaction===null&&(o=!0,e._transaction=new iN(e,r,n),i.push(e._transaction),i.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{a=t(e._transaction)}finally{if(o){var s=e._transaction===i[0];e._transaction=null,s&&ane(i,0)}}return a};function Tqe(e){var t,r,n,i,o,a,s,l,l10,c,l11;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=qr(e.restDecoder);r=0;_state.label=1;case 1:if(!(r<t))return[3,10];n=qr(e.restDecoder),i=e.readClient(),o=qr(e.restDecoder);a=0;_state.label=2;case 2:if(!(a<n))return[3,9];s=e.readInfo();if(!(s===10))return[3,4];l=qr(e.restDecoder);return[4,new Xs(dn(i,o),l)];case 3:_state.sent(),o+=l;return[3,8];case 4:if(!(31&s))return[3,6];l10=(s&192)===0,c=new uo(dn(i,o),null,(s&128)===128?e.readLeftID():null,null,(s&64)===64?e.readRightID():null,l10?e.readParentInfo()?e.readString():e.readLeftID():null,l10&&(s&32)===32?e.readString():null,kne(e,s));return[4,c];case 5:_state.sent(),o+=c.length;return[3,8];case 6:l11=e.readLen();return[4,new Ys(dn(i,o),l11)];case 7:_state.sent(),o+=l11;_state.label=8;case 8:a++;return[3,2];case 9:r++;return[3,1];case 10:return[2]}})}var aw=/*#__PURE__*/function(){"use strict";function aw1(t,r){_class_call_check(this,aw1);this.gen=Tqe(t),this.curr=null,this.done=!1,this.filterSkips=r,this.next()}_create_class(aw1,[{key:"next",value:function next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Xs);return this.curr}}]);return aw1}();var sw=function sw1(t){"use strict";_class_call_check(this,sw1);this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]},Aqe=function(e){return _C(e,gC,Ug)};var Iqe=function(e,t){if(e.constructor===Ys){var _e_id=e.id,r=_e_id.client,n=_e_id.clock;return new Ys(dn(r,n+t),e.length-t)}else if(e.constructor===Xs){var _e_id1=e.id,r10=_e_id1.client,n10=_e_id1.clock;return new Xs(dn(r10,n10+t),e.length-t)}else{var r11=e,_r_id=r11.id,n11=_r_id.client,i=_r_id.clock;return new uo(dn(n11,i+t),null,dn(n11,i+t-1),null,r11.rightOrigin,r11.parent,r11.parentSub,r11.content.splice(t))}},_C=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Em,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hp;if(e.length===1)return e[0];var n=e.map(function(d){return new t(Lg(d))}),i=n.map(function(d){return new aw(d,!0)}),o=null,a=new r,s=new sw(a);for(;i=i.filter(function(p){return p.curr!==null}),i.sort(function(p,m){if(p.curr.id.client===m.curr.id.client){var h=p.curr.id.clock-m.curr.id.clock;return h===0?p.curr.constructor===m.curr.constructor?0:p.curr.constructor===Xs?1:-1:h}else return m.curr.id.client-p.curr.id.client}),i.length!==0;){var d=i[0],u=d.curr.id.client;if(o!==null){var p=d.curr,m=!1;for(;p!==null&&p.id.clock+p.length<=o.struct.id.clock+o.struct.length&&p.id.client>=o.struct.id.client;)p=d.next(),m=!0;if(p===null||p.id.client!==u||m&&p.id.clock>o.struct.id.clock+o.struct.length)continue;if(u!==o.struct.id.client)wm(s,o.struct,o.offset),o={struct:p,offset:0},d.next();else if(o.struct.id.clock+o.struct.length<p.id.clock)if(o.struct.constructor===Xs)o.struct.length=p.id.clock+p.length-o.struct.id.clock;else{wm(s,o.struct,o.offset);var h=p.id.clock-o.struct.id.clock-o.struct.length;o={struct:new Xs(dn(u,o.struct.id.clock+o.struct.length),h),offset:0}}else{var h10=o.struct.id.clock+o.struct.length-p.id.clock;h10>0&&(o.struct.constructor===Xs?o.struct.length-=h10:p=Iqe(p,h10)),o.struct.mergeWith(p)||(wm(s,o.struct,o.offset),o={struct:p,offset:0},d.next())}}else o={struct:d.curr,offset:0},d.next();for(var p10=d.curr;p10!==null&&p10.id.client===u&&p10.id.clock===o.struct.id.clock+o.struct.length&&p10.constructor!==Xs;p10=d.next())wm(s,o.struct,o.offset),o={struct:p10,offset:0}}o!==null&&(wm(s,o.struct,o.offset),o=null),hN(s);var l=n.map(function(d){return pN(d)}),c=uqe(l);return cy(a,c),a.toUint8Array()},Pqe=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Em,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Hp;var i=ene(t),o=new n,a=new sw(o),s=new r(Lg(e)),l=new aw(s,!1);for(;l.curr;){var d=l.curr,u=d.id.client,p=i.get(u)||0;if(l.curr.constructor===Xs){l.next();continue}if(d.id.clock+d.length>p)for(wm(a,d,Gp(p-d.id.clock,0)),l.next();l.curr&&l.curr.id.client===u;)wm(a,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===u&&l.curr.id.clock+l.curr.length<=p;)l.next()}hN(a);var c=pN(s);return cy(o,c),o.toUint8Array()};var sne=function(e){e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:yc(e.encoder.restEncoder)}),e.encoder.restEncoder=qb(),e.written=0)},wm=function(e,t,r){e.written>0&&e.currClient!==t.id.client&&sne(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),en(e.encoder.restEncoder,t.id.clock+r)),t.write(e.encoder,r),e.written++},hN=function(e){sne(e);var t=e.encoder.restEncoder;en(t,e.clientStructs.length);for(var r=0;r<e.clientStructs.length;r++){var n=e.clientStructs[r];en(t,n.written),Wb(t,n.restEncoder)}},Rqe=function(e,t,r,n){var i=new r(Lg(e)),o=new aw(i,!1),a=new n,s=new sw(a);for(var c=o.curr;c!==null;c=o.next())wm(s,t(c),0);hN(s);var l=pN(i);return cy(a,l),a.toUint8Array()};var Mqe=function(e){return Rqe(e,cre,Em,Ug)},Vre="You must not compute changes after the event-handler fired.",ay=/*#__PURE__*/function(){"use strict";function ay1(t,r){_class_call_check(this,ay1);this.target=t,this.currentTarget=t,this.transaction=r,this._changes=null,this._keys=null,this._delta=null,this._path=null}_create_class(ay1,[{key:"path",get:function get1(){return this._path||(this._path=Oqe(this.currentTarget,this.target))}},{key:"deletes",value:function deletes(t){return Qre(this.transaction.deleteSet,t.id)}},{key:"keys",get:function get1(){var _this=this;if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw zl(Vre);var t=new Map,r=this.target;this.transaction.changed.get(r).forEach(function(i){if(i!==null){var o=r._map.get(i),a,s;if(_this.adds(o)){var l=o.left;for(;l!==null&&_this.adds(l);)l=l.left;if(_this.deletes(o))if(l!==null&&_this.deletes(l))a="delete",s=D8(l.content.getContent());else return;else l!==null&&_this.deletes(l)?(a="update",s=D8(l.content.getContent())):(a="add",s=void 0)}else if(_this.deletes(o))a="delete",s=D8(o.content.getContent());else return;t.set(i,{action:a,oldValue:s})}}),this._keys=t}return this._keys}},{key:"delta",get:function get1(){return this.changes.delta}},{key:"adds",value:function adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}},{key:"changes",get:function get1(){var t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw zl(Vre);var r=this.target,n=Vp(),i=Vp(),o=[];if(t={added:n,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(r).has(null)){var s=null,l=function(){s&&o.push(s)};for(var c=r._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((s===null||s.delete===void 0)&&(l(),s={delete:0}),s.delete+=c.length,i.add(c)):this.adds(c)?((s===null||s.insert===void 0)&&(l(),s={insert:[]}),s.insert=s.insert.concat(c.content.getContent()),n.add(c)):((s===null||s.retain===void 0)&&(l(),s={retain:0}),s.retain+=c.length);s!==null&&s.retain===void 0&&l()}this._changes=t}return t}}]);return ay1}(),Oqe=function(e,t){var r=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)r.unshift(t._item.parentSub);else{var n=0,i=t._item.parent._start;for(;i!==t._item&&i!==null;)!i.deleted&&i.countable&&(n+=i.length),i=i.right;r.unshift(n)}t=t._item.parent}return r},Xa=function(){Mre("Invalid access: Add Yjs type to a document before reading data.")},lne=80,gN=0,oN=function oN1(t,r){"use strict";_class_call_check(this,oN1);t.marker=!0,this.p=t,this.index=r,this.timestamp=gN++},$qe=function(e){e.timestamp=gN++},une=function(e,t,r){e.p.marker=!1,e.p=t,t.marker=!0,e.index=r,e.timestamp=gN++},Nqe=function(e,t,r){if(e.length>=lne){var n=e.reduce(function(i,o){return i.timestamp<o.timestamp?i:o});return une(n,t,r),n}else{var n10=new oN(t,r);return e.push(n10),n10}},CC=function(e,t){if(e._start===null||t===0||e._searchMarker===null)return null;var r=e._searchMarker.length===0?null:e._searchMarker.reduce(function(o,a){return Pg(t-o.index)<Pg(t-a.index)?o:a}),n=e._start,i=0;for(r!==null&&(n=r.p,i=r.index,$qe(r));n.right!==null&&i<t;){if(!n.deleted&&n.countable){if(t<i+n.length)break;i+=n.length}n=n.right}for(;n.left!==null&&i>t;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);return r!==null&&Pg(r.index-i)<n.parent.length/lne?(une(r,n,i),r):Nqe(e._searchMarker,n,i)},lw=function(e,t,r){for(var n=e.length-1;n>=0;n--){var i=e[n];if(r>0){var o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){e.splice(n,1);continue}i.p=o,o.marker=!0}(t<i.index||r>0&&t===i.index)&&(i.index=Gp(t,i.index+r))}};var EC=function(e,t,r){var n=e,i=t.changedParentTypes;for(;Pd(i,e,function(){return[]}).push(r),e._item!==null;)e=e._item.parent;nne(n._eH,r,t)},Jo=/*#__PURE__*/function(){"use strict";function Jo1(){_class_call_check(this,Jo1);this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=zre(),this._dEH=zre(),this._searchMarker=null}_create_class(Jo1,[{key:"parent",get:function get1(){return this._item?this._item.parent:null}},{key:"_integrate",value:function _integrate(t,r){this.doc=t,this._item=r}},{key:"_copy",value:function _copy(){throw jl()}},{key:"clone",value:function clone(){throw jl()}},{key:"_write",value:function _write(t){}},{key:"_first",get:function get1(){var t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}},{key:"_callObserver",value:function _callObserver(t,r){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}},{key:"observe",value:function observe(t){jre(this._eH,t)}},{key:"observeDeep",value:function observeDeep(t){jre(this._dEH,t)}},{key:"unobserve",value:function unobserve(t){Ure(this._eH,t)}},{key:"unobserveDeep",value:function unobserveDeep(t){Ure(this._dEH,t)}},{key:"toJSON",value:function toJSON(){}}]);return Jo1}(),cne=function(e,t,r){var a;(a=e.doc)!=null||Xa(),t<0&&(t=e._length+t),r<0&&(r=e._length+r);var n=r-t,i=[],o=e._start;for(;o!==null&&n>0;){if(o.countable&&!o.deleted){var s=o.content.getContent();if(s.length<=t)t-=s.length;else{for(var l=t;l<s.length&&n>0;l++)i.push(s[l]),n--;t=0}}o=o.right}return i},dne=function(e){var n;(n=e.doc)!=null||Xa();var t=[],r=e._start;for(;r!==null;){if(r.countable&&!r.deleted){var i=r.content.getContent();for(var o=0;o<i.length;o++)t.push(i[o])}r=r.right}return t};var uw=function(e,t){var i;var r=0,n=e._start;for((i=e.doc)!=null||Xa();n!==null;){if(n.countable&&!n.deleted){var o=n.content.getContent();for(var a=0;a<o.length;a++)t(o[a],r++,e)}n=n.right}},pne=function(e,t){var r=[];return uw(e,function(n,i){r.push(t(n,i,e))}),r},Dqe=function(e){var t=e._start,r=null,n=0;var _obj;return _obj={},_define_property(_obj,Symbol.iterator,function(){return this}),_define_property(_obj,"next",function(){if(r===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};r=t.content.getContent(),n=0,t=t.right}var i=r[n++];return r.length<=n&&(r=null),{done:!1,value:i}}),_obj},fne=function(e,t){var i;(i=e.doc)!=null||Xa();var r=CC(e,t),n=e._start;for(r!==null&&(n=r.p,t-=r.index);n!==null;n=n.right)if(!n.deleted&&n.countable){if(t<n.length)return n.content.getContent()[t];t-=n.length}},bC=function(e,t,r,n){var i=r,o=e.doc,a=o.clientID,s=o.store,l=r===null?t._start:r.right,c=[],d=function(){c.length>0&&(i=new uo(dn(a,ga(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new Qp(c)),i.integrate(e,0),c=[])};n.forEach(function(u){if(u===null)c.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(u);break;default:switch(d(),u.constructor){case Uint8Array:case ArrayBuffer:i=new uo(dn(a,ga(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new Bg(new Uint8Array(u))),i.integrate(e,0);break;case vc:i=new uo(dn(a,ga(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new Wg(u)),i.integrate(e,0);break;default:if(_instanceof(u,Jo))i=new uo(dn(a,ga(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new _c(u)),i.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),d()},mne=function(){return zl("Length exceeded!")},hne=function(e,t,r,n){if(r>t._length)throw mne();if(r===0)return t._searchMarker&&lw(t._searchMarker,r,n.length),bC(e,t,null,n);var i=r,o=CC(t,r),a=t._start;for(o!==null&&(a=o.p,r-=o.index,r===0&&(a=a.prev,r+=a&&a.countable&&!a.deleted?a.length:0));a!==null;a=a.right)if(!a.deleted&&a.countable){if(r<=a.length){r<a.length&&Tm(e,dn(a.id.client,a.id.clock+r));break}r-=a.length}return t._searchMarker&&lw(t._searchMarker,i,n.length),bC(e,t,a,n)},Lqe=function(e,t,r){var i=(t._searchMarker||[]).reduce(function(o,a){return a.index>o.index?a:o},{index:0,p:t._start}).p;if(i)for(;i.right;)i=i.right;return bC(e,t,i,r)},gne=function(e,t,r,n){if(n===0)return;var i=r,o=n,a=CC(t,r),s=t._start;for(a!==null&&(s=a.p,r-=a.index);s!==null&&r>0;s=s.right)!s.deleted&&s.countable&&(r<s.length&&Tm(e,dn(s.id.client,s.id.clock+r)),r-=s.length);for(;n>0&&s!==null;)s.deleted||(n<s.length&&Tm(e,dn(s.id.client,s.id.clock+n)),s.delete(e),n-=s.length),s=s.right;if(n>0)throw mne();t._searchMarker&&lw(t._searchMarker,i,-o+n)},wC=function(e,t,r){var n=t._map.get(r);n!==void 0&&n.delete(e)},xN=function(e,t,r,n){var i=t._map.get(r)||null,o=e.doc,a=o.clientID,s;if(n==null)s=new Qp([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new Qp([n]);break;case Uint8Array:s=new Bg(n);break;case vc:s=new Wg(n);break;default:if(_instanceof(n,Jo))s=new _c(n);else throw new Error("Unexpected content type")}new uo(dn(a,ga(o.store,a)),i,i&&i.lastId,null,null,t,r,s).integrate(e,0)},yN=function(e,t){var n;(n=e.doc)!=null||Xa();var r=e._map.get(t);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},xne=function(e){var r;var t={};return(r=e.doc)!=null||Xa(),e._map.forEach(function(n,i){n.deleted||(t[i]=n.content.getContent()[n.length-1])}),t},yne=function(e,t){var n;(n=e.doc)!=null||Xa();var r=e._map.get(t);return r!==void 0&&!r.deleted};var Fqe=function(e,t){var r={};return e._map.forEach(function(n,i){var o=n;for(;o!==null&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;o!==null&&iy(o,t)&&(r[i]=o.content.getContent()[o.length-1])}),r},cC=function(e){var t;return(t=e.doc)!=null||Xa(),Nre(e._map.entries(),function(r){return!r[1].deleted})},aN=/*#__PURE__*/function(ay1){"use strict";_inherits(aN1,ay1);function aN1(){_class_call_check(this,aN1);return _call_super(this,aN1,arguments)}return aN1}(ay),Cm=/*#__PURE__*/function(Jo1){"use strict";_inherits(Cm1,Jo1);function Cm1(){_class_call_check(this,Cm1);var _this;_this=_call_super(this,Cm1),_this._prelimContent=[],_this._searchMarker=[];return _this}_create_class(Cm1,[{key:"_integrate",value:function _integrate(t,r){_get(_get_prototype_of(Cm1.prototype),"_integrate",this).call(this,t,r),this.insert(0,this._prelimContent),this._prelimContent=null}},{key:"_copy",value:function _copy(){return new Cm}},{key:"clone",value:function clone(){var t=new Cm;return t.insert(0,this.toArray().map(function(r){return _instanceof(r,Jo)?r.clone():r})),t}},{key:"length",get:function get1(){var t;return(t=this.doc)!=null||Xa(),this._length}},{key:"_callObserver",value:function _callObserver(t,r){_get(_get_prototype_of(Cm1.prototype),"_callObserver",this).call(this,t,r),EC(this,t,new aN(this,t))}},{key:"insert",value:function insert(t,r){var _this=this;var _this__prelimContent;this.doc!==null?xi(this.doc,function(n){hne(n,_this,t,r)}):(_this__prelimContent=this._prelimContent).splice.apply(_this__prelimContent,[t,0].concat(_to_consumable_array(r)))}},{key:"push",value:function push(t){var _this=this;var _this__prelimContent;this.doc!==null?xi(this.doc,function(r){Lqe(r,_this,t)}):(_this__prelimContent=this._prelimContent).push.apply(_this__prelimContent,_to_consumable_array(t))}},{key:"unshift",value:function unshift(t){this.insert(0,t)}},{key:"delete",value:function _delete(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.doc!==null?xi(this.doc,function(n){gne(n,_this,t,r)}):this._prelimContent.splice(t,r)}},{key:"get",value:function get1(t){return fne(this,t)}},{key:"toArray",value:function toArray(){return dne(this)}},{key:"slice",value:function slice(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length;return cne(this,t,r)}},{key:"toJSON",value:function toJSON(){return this.map(function(t){return _instanceof(t,Jo)?t.toJSON():t})}},{key:"map",value:function map(t){return pne(this,t)}},{key:"forEach",value:function forEach(t){uw(this,t)}},{key:Symbol.iterator,value:function value(){return Dqe(this)}},{key:"_write",value:function _write(t){t.writeTypeRef(aWe)}}],[{key:"from",value:function from(t){var r=new Cm;return r.push(t),r}}]);return Cm1}(Jo),zqe=function(e){return new Cm},sN=/*#__PURE__*/function(ay1){"use strict";_inherits(sN1,ay1);function sN1(t,r,n){_class_call_check(this,sN1);var _this;_this=_call_super(this,sN1,[t,r]),_this.keysChanged=n;return _this}return sN1}(ay),Am=/*#__PURE__*/function(Jo1){"use strict";_inherits(Am1,Jo1);function Am1(t){_class_call_check(this,Am1);var _this;_this=_call_super(this,Am1),_this._prelimContent=null,t===void 0?_this._prelimContent=new Map:_this._prelimContent=new Map(t);return _this}_create_class(Am1,[{key:"_integrate",value:function _integrate(t,r){var _this=this;_get(_get_prototype_of(Am1.prototype),"_integrate",this).call(this,t,r),this._prelimContent.forEach(function(n,i){_this.set(i,n)}),this._prelimContent=null}},{key:"_copy",value:function _copy(){return new Am}},{key:"clone",value:function clone(){var t=new Am;return this.forEach(function(r,n){t.set(n,_instanceof(r,Jo)?r.clone():r)}),t}},{key:"_callObserver",value:function _callObserver(t,r){EC(this,t,new sN(this,t,r))}},{key:"toJSON",value:function toJSON(){var r;(r=this.doc)!=null||Xa();var t={};return this._map.forEach(function(n,i){if(!n.deleted){var o=n.content.getContent()[n.length-1];t[i]=_instanceof(o,Jo)?o.toJSON():o}}),t}},{key:"size",get:function get1(){return _to_consumable_array(cC(this)).length}},{key:"keys",value:function keys(){return lC(cC(this),function(t){return t[0]})}},{key:"values",value:function values(){return lC(cC(this),function(t){return t[1].content.getContent()[t[1].length-1]})}},{key:"entries",value:function entries(){return lC(cC(this),function(t){return[t[0],t[1].content.getContent()[t[1].length-1]]})}},{key:"forEach",value:function forEach(t){var _this=this;var r;(r=this.doc)!=null||Xa(),this._map.forEach(function(n,i){n.deleted||t(n.content.getContent()[n.length-1],i,_this)})}},{key:Symbol.iterator,value:function value(){return this.entries()}},{key:"delete",value:function _delete(t){var _this=this;this.doc!==null?xi(this.doc,function(r){wC(r,_this,t)}):this._prelimContent.delete(t)}},{key:"set",value:function set1(t,r){var _this=this;return this.doc!==null?xi(this.doc,function(n){xN(n,_this,t,r)}):this._prelimContent.set(t,r),r}},{key:"get",value:function get1(t){return yN(this,t)}},{key:"has",value:function has(t){return yne(this,t)}},{key:"clear",value:function clear(){var _this=this;this.doc!==null?xi(this.doc,function(t){_this.forEach(function(r,n,i){wC(t,i,n)})}):this._prelimContent.clear()}},{key:"_write",value:function _write(t){t.writeTypeRef(sWe)}}]);return Am1}(Jo),jqe=function(e){return new Am},Sm=function(e,t){return e===t||(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&e&&t&&A$(e,t)},cw=/*#__PURE__*/function(){"use strict";function cw1(t,r,n,i){_class_call_check(this,cw1);this.left=t,this.right=r,this.index=n,this.currentAttributes=i}_create_class(cw1,[{key:"forward",value:function forward(){switch(this.right===null&&Qs(),this.right.content.constructor){case co:this.right.deleted||dy(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}]);return cw1}(),Gre=function(e,t,r){for(;t.right!==null&&r>0;){switch(t.right.content.constructor){case co:t.right.deleted||dy(t.currentAttributes,t.right.content);break;default:t.right.deleted||(r<t.right.length&&Tm(e,dn(t.right.id.client,t.right.id.clock+r)),t.index+=t.right.length,r-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},dC=function(e,t,r,n){var i=new Map,o=n?CC(t,r):null;if(o){var a=new cw(o.p.left,o.p,o.index,i);return Gre(e,a,r-o.index)}else{var a9=new cw(null,t._start,0,i);return Gre(e,a9,r)}},vne=function(e,t,r,n){for(;r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===co&&Sm(n.get(r.right.content.key),r.right.content.value));)r.right.deleted||n.delete(r.right.content.key),r.forward();var i=e.doc,o=i.clientID;n.forEach(function(a,s){var l=r.left,c=r.right,d=new uo(dn(o,ga(i.store,o)),l,l&&l.lastId,c,c&&c.id,t,null,new co(s,a));d.integrate(e,0),r.right=d,r.forward()})},dy=function(e,t){var r=t.key,n=t.value;n===null?e.delete(r):e.set(r,n)},_ne=function(e,t){var r;for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===co&&Sm((r=t[e.right.content.key])!=null?r:null,e.right.content.value)))break;e.forward()}},bne=function(e,t,r,n){var s;var i=e.doc,o=i.clientID,a=new Map;for(var l in n){var c=n[l],d=(s=r.currentAttributes.get(l))!=null?s:null;if(!Sm(d,c)){a.set(l,d);var u=r.left,p=r.right;r.right=new uo(dn(o,ga(i.store,o)),u,u&&u.lastId,p,p&&p.id,t,null,new co(l,c)),r.right.integrate(e,0),r.forward()}}return a},Y$=function(e,t,r,n,i){r.currentAttributes.forEach(function(p,m){i[m]===void 0&&(i[m]=null)});var o=e.doc,a=o.clientID;_ne(r,i);var s=bne(e,t,r,i),l=n.constructor===String?new Au(n):_instanceof(n,Jo)?new _c(n):new Kp(n),c=r.left,d=r.right,u=r.index;t._searchMarker&&lw(t._searchMarker,r.index,l.getLength()),d=new uo(dn(a,ga(o.store,a)),c,c&&c.lastId,d,d&&d.id,t,null,l),d.integrate(e,0),r.right=d,r.index=u,r.forward(),vne(e,t,r,s)},Hre=function(e,t,r,n,i){var o=e.doc,a=o.clientID;_ne(r,i);var s=bne(e,t,r,i);e:for(;r.right!==null&&(n>0||s.size>0&&(r.right.deleted||r.right.content.constructor===co));){if(!r.right.deleted)switch(r.right.content.constructor){case co:{var _r_right_content=r.right.content,l=_r_right_content.key,c=_r_right_content.value,d=i[l];if(d!==void 0){if(Sm(d,c))s.delete(l);else{if(n===0)break e;s.set(l,c)}r.right.delete(e)}else r.currentAttributes.set(l,c);break}default:n<r.right.length&&Tm(e,dn(r.right.id.client,r.right.id.clock+n)),n-=r.right.length;break}r.forward()}if(n>0){var l10="";for(;n>0;n--)l10+="\n";r.right=new uo(dn(a,ga(o.store,a)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,t,null,new Au(l10)),r.right.integrate(e,0),r.forward()}vne(e,t,r,s)},wne=function(e,t,r,n,i){var c,d;var o=t,a=ys();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===co){var u=o.content;a.set(u.key,u)}o=o.right}var s=0,l=!1;for(;t!==o;){if(r===t&&(l=!0),!t.deleted){var u10=t.content;switch(u10.constructor){case co:{var p=u10.key,m=u10.value,h=(c=n.get(p))!=null?c:null;(a.get(p)!==u10||h===m)&&(t.delete(e),s++,!l&&((d=i.get(p))!=null?d:null)===m&&h!==m&&(h===null?i.delete(p):i.set(p,h))),!l&&!t.deleted&&dy(i,u10);break}}}t=t.right}return s},Uqe=function(e,t){for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;var r=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===co){var n=t.content.key;r.has(n)?t.delete(e):r.add(n)}t=t.left}},Bqe=function(e){var t=0;return xi(e.doc,function(r){var n=e._start,i=e._start,o=ys(),a=N8(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case co:dy(a,i.content);break;default:t+=wne(r,n,i,o,a),o=N8(a),n=i;break}i=i.right}}),t},qqe=function(e){var t=new Set,r=e.doc;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.afterState.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];var o=e.beforeState.get(n)||0;i!==o&&one(e,r.store.clients.get(n),o,i,function(a){!a.deleted&&a.content.constructor===co&&a.constructor!==Ys&&t.add(a.parent)})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}xi(r,function(n){Kre(e,e.deleteSet,function(i){if(_instanceof(i,Ys)||!i.parent._hasFormatting||t.has(i.parent))return;var o=i.parent;i.content.constructor===co?t.add(o):Uqe(n,i)});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;Bqe(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}})},Zre=function(e,t,r){var n=r,i=N8(t.currentAttributes),o=t.right;for(;r>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case _c:case Kp:case Au:r<t.right.length&&Tm(e,dn(t.right.id.client,t.right.id.clock+r)),r-=t.right.length,t.right.delete(e);break}t.forward()}o&&wne(e,o,t.right,i,t.currentAttributes);var a=(t.left||t.right).parent;return a._searchMarker&&lw(a._searchMarker,t.index,-n+r),t},lN=/*#__PURE__*/function(ay1){"use strict";_inherits(lN1,ay1);function lN1(t,r,n){_class_call_check(this,lN1);var _this;_this=_call_super(this,lN1,[t,r]),_this.childListChanged=!1,_this.keysChanged=new Set,n.forEach(function(i){i===null?_this.childListChanged=!0:_this.keysChanged.add(i)});return _this}_create_class(lN1,[{key:"changes",get:function get1(){if(this._changes===null){var t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}},{key:"delta",get:function get1(){var _this=this;if(this._delta===null){var t=this.target.doc,r=[];xi(t,function(n){var m,h,g;var i=new Map,o=new Map,a=_this.target._start,s=null,l={},c="",d=0,u=0,p=function(){if(s!==null){var x=null;switch(s){case"delete":u>0&&(x={delete:u}),u=0;break;case"insert":((typeof c==="undefined"?"undefined":_type_of(c))=="object"||c.length>0)&&(x={insert:c},i.size>0&&(x.attributes={},i.forEach(function(v,y){v!==null&&(x.attributes[y]=v)}))),c="";break;case"retain":d>0&&(x={retain:d},ure(l)||(x.attributes=sre({},l))),d=0;break}x&&r.push(x),s=null}};for(;a!==null;){switch(a.content.constructor){case _c:case Kp:_this.adds(a)?_this.deletes(a)||(p(),s="insert",c=a.content.getContent()[0],p()):_this.deletes(a)?(s!=="delete"&&(p(),s="delete"),u+=1):a.deleted||(s!=="retain"&&(p(),s="retain"),d+=1);break;case Au:_this.adds(a)?_this.deletes(a)||(s!=="insert"&&(p(),s="insert"),c+=a.content.str):_this.deletes(a)?(s!=="delete"&&(p(),s="delete"),u+=a.length):a.deleted||(s!=="retain"&&(p(),s="retain"),d+=a.length);break;case co:{var _a_content=a.content,x=_a_content.key,v=_a_content.value;if(_this.adds(a)){if(!_this.deletes(a)){var y=(m=i.get(x))!=null?m:null;Sm(y,v)?v!==null&&a.delete(n):(s==="retain"&&p(),Sm(v,(h=o.get(x))!=null?h:null)?delete l[x]:l[x]=v)}}else if(_this.deletes(a)){o.set(x,v);var y10=(g=i.get(x))!=null?g:null;Sm(y10,v)||(s==="retain"&&p(),l[x]=y10)}else if(!a.deleted){o.set(x,v);var y11=l[x];y11!==void 0&&(Sm(y11,v)?y11!==null&&a.delete(n):(s==="retain"&&p(),v===null?delete l[x]:l[x]=v))}a.deleted||(s==="insert"&&p(),dy(i,a.content));break}}a=a.right}for(p();r.length>0;){var x10=r[r.length-1];if(x10.retain!==void 0&&x10.attributes===void 0)r.pop();else break}}),this._delta=r}return this._delta}}]);return lN1}(ay),Im=/*#__PURE__*/function(Jo1){"use strict";_inherits(Im1,Jo1);function Im1(t){_class_call_check(this,Im1);var _this;_this=_call_super(this,Im1),_this._pending=t!==void 0?[function(){return _this.insert(0,t)}]:[],_this._searchMarker=[],_this._hasFormatting=!1;return _this}_create_class(Im1,[{key:"length",get:function get1(){var t;return(t=this.doc)!=null||Xa(),this._length}},{key:"_integrate",value:function _integrate(t,r){_get(_get_prototype_of(Im1.prototype),"_integrate",this).call(this,t,r);try{this._pending.forEach(function(n){return n()})}catch(n){console.error(n)}this._pending=null}},{key:"_copy",value:function _copy(){return new Im}},{key:"clone",value:function clone(){var t=new Im;return t.applyDelta(this.toDelta()),t}},{key:"_callObserver",value:function _callObserver(t,r){_get(_get_prototype_of(Im1.prototype),"_callObserver",this).call(this,t,r);var n=new lN(this,t,r);EC(this,t,n),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}},{key:"toString",value:function toString(){var n;(n=this.doc)!=null||Xa();var t="",r=this._start;for(;r!==null;)!r.deleted&&r.countable&&r.content.constructor===Au&&(t+=r.content.str),r=r.right;return t}},{key:"toJSON",value:function toJSON(){return this.toString()}},{key:"applyDelta",value:function applyDelta(t){var _this=this;var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.sanitize,r=tmp===void 0?!0:tmp;this.doc!==null?xi(this.doc,function(n){var i=new cw(null,_this._start,0,new Map);for(var o=0;o<t.length;o++){var a=t[o];if(a.insert!==void 0){var s=!r&&typeof a.insert=="string"&&o===t.length-1&&i.right===null&&a.insert.slice(-1)==="\n"?a.insert.slice(0,-1):a.insert;(typeof s!="string"||s.length>0)&&Y$(n,_this,i,s,a.attributes||{})}else a.retain!==void 0?Hre(n,_this,i,a.retain,a.attributes||{}):a.delete!==void 0&&Zre(n,i,a.delete)}}):this._pending.push(function(){return _this.applyDelta(t)})}},{key:"toDelta",value:function toDelta(t,r,n){var u;(u=this.doc)!=null||Xa();var i=[],o=new Map,a=this.doc,s="",l=this._start;function c(){if(s.length>0){var p={},m=!1;o.forEach(function(g,x){m=!0,p[x]=g});var h={insert:s};m&&(h.attributes=p),i.push(h),s=""}}var d=function(){var _loop=function(){if(iy(l,t)||r!==void 0&&iy(l,r))switch(l.content.constructor){case Au:{var p=o.get("ychange");t!==void 0&&!iy(l,t)?(p===void 0||p.user!==l.id.client||p.type!=="removed")&&(c(),o.set("ychange",n?n("removed",l.id):{type:"removed"})):r!==void 0&&!iy(l,r)?(p===void 0||p.user!==l.id.client||p.type!=="added")&&(c(),o.set("ychange",n?n("added",l.id):{type:"added"})):p!==void 0&&(c(),o.delete("ychange")),s+=l.content.str;break}case _c:case Kp:{c();var p10={insert:l.content.getContent()[0]};if(o.size>0){var m={};p10.attributes=m,o.forEach(function(h,g){m[g]=h})}i.push(p10);break}case co:iy(l,t)&&(c(),dy(o,l.content));break}l=l.right};for(;l!==null;)_loop();c()};return t||r?xi(a,function(p){t&&rN(p,t),r&&rN(p,r),d()},"cleanup"):d(),i}},{key:"insert",value:function insert(t,r,n){var _this=this;if(r.length<=0)return;var i=this.doc;i!==null?xi(i,function(o){var a=dC(o,_this,t,!n);n||(n={},a.currentAttributes.forEach(function(s,l){n[l]=s})),Y$(o,_this,a,r,n)}):this._pending.push(function(){return _this.insert(t,r,n)})}},{key:"insertEmbed",value:function insertEmbed(t,r,n){var _this=this;var i=this.doc;i!==null?xi(i,function(o){var a=dC(o,_this,t,!n);Y$(o,_this,a,r,n||{})}):this._pending.push(function(){return _this.insertEmbed(t,r,n||{})})}},{key:"delete",value:function _delete(t,r){var _this=this;if(r===0)return;var n=this.doc;n!==null?xi(n,function(i){Zre(i,dC(i,_this,t,!0),r)}):this._pending.push(function(){return _this.delete(t,r)})}},{key:"format",value:function format(t,r,n){var _this=this;if(r===0)return;var i=this.doc;i!==null?xi(i,function(o){var a=dC(o,_this,t,!1);a.right!==null&&Hre(o,_this,a,r,n)}):this._pending.push(function(){return _this.format(t,r,n)})}},{key:"removeAttribute",value:function removeAttribute(t){var _this=this;this.doc!==null?xi(this.doc,function(r){wC(r,_this,t)}):this._pending.push(function(){return _this.removeAttribute(t)})}},{key:"setAttribute",value:function setAttribute(t,r){var _this=this;this.doc!==null?xi(this.doc,function(n){xN(n,_this,t,r)}):this._pending.push(function(){return _this.setAttribute(t,r)})}},{key:"getAttribute",value:function getAttribute(t){return yN(this,t)}},{key:"getAttributes",value:function getAttributes(){return xne(this)}},{key:"_write",value:function _write(t){t.writeTypeRef(lWe)}}]);return Im1}(Jo),Wqe=function(e){return new Im},ow=/*#__PURE__*/function(){"use strict";function ow1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0};_class_call_check(this,ow1);var n;this._filter=r,this._root=t,this._currentNode=t._start,this._firstCall=!0,(n=t.doc)!=null||Xa()}_create_class(ow1,[{key:Symbol.iterator,value:function value(){return this}},{key:"next",value:function next(){var t=this._currentNode,r=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(r)))do if(r=t.content.type,!t.deleted&&(r.constructor===Pm||r.constructor===Zp)&&r._start!==null)t=r._start;else for(;t!==null;){var n=t.next;if(n!==null){t=n;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}]);return ow1}(),Zp=/*#__PURE__*/function(Jo1){"use strict";_inherits(Zp1,Jo1);function Zp1(){_class_call_check(this,Zp1);var _this;_this=_call_super(this,Zp1),_this._prelimContent=[];return _this}_create_class(Zp1,[{key:"firstChild",get:function get1(){var t=this._first;return t?t.content.getContent()[0]:null}},{key:"_integrate",value:function _integrate(t,r){_get(_get_prototype_of(Zp1.prototype),"_integrate",this).call(this,t,r),this.insert(0,this._prelimContent),this._prelimContent=null}},{key:"_copy",value:function _copy(){return new Zp}},{key:"clone",value:function clone(){var t=new Zp;return t.insert(0,this.toArray().map(function(r){return _instanceof(r,Jo)?r.clone():r})),t}},{key:"length",get:function get1(){var t;return(t=this.doc)!=null||Xa(),this._prelimContent===null?this._length:this._prelimContent.length}},{key:"createTreeWalker",value:function createTreeWalker(t){return new ow(this,t)}},{key:"querySelector",value:function querySelector(t){t=t.toUpperCase();var n=new ow(this,function(i){return i.nodeName&&i.nodeName.toUpperCase()===t}).next();return n.done?null:n.value}},{key:"querySelectorAll",value:function querySelectorAll(t){return t=t.toUpperCase(),Rd(new ow(this,function(r){return r.nodeName&&r.nodeName.toUpperCase()===t}))}},{key:"_callObserver",value:function _callObserver(t,r){EC(this,t,new uN(this,r,t))}},{key:"toString",value:function toString(){return pne(this,function(t){return t.toString()}).join("")}},{key:"toJSON",value:function toJSON(){return this.toString()}},{key:"toDOM",value:function toDOM(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;var i=t.createDocumentFragment();return n!==void 0&&n._createAssociation(i,this),uw(this,function(o){i.insertBefore(o.toDOM(t,r,n),null)}),i}},{key:"insert",value:function insert(t,r){var _this=this;var _this__prelimContent;this.doc!==null?xi(this.doc,function(n){hne(n,_this,t,r)}):(_this__prelimContent=this._prelimContent).splice.apply(_this__prelimContent,[t,0].concat(_to_consumable_array(r)))}},{key:"insertAfter",value:function insertAfter(t,r){var _this=this;if(this.doc!==null)xi(this.doc,function(n){var i=t&&_instanceof(t,Jo)?t._item:t;bC(n,_this,i,r)});else{var _n;var n=this._prelimContent,i=t===null?0:n.findIndex(function(o){return o===t})+1;if(i===0&&t!==null)throw zl("Reference item not found");(_n=n).splice.apply(_n,[i,0].concat(_to_consumable_array(r)))}}},{key:"delete",value:function _delete(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.doc!==null?xi(this.doc,function(n){gne(n,_this,t,r)}):this._prelimContent.splice(t,r)}},{key:"toArray",value:function toArray(){return dne(this)}},{key:"push",value:function push(t){this.insert(this.length,t)}},{key:"unshift",value:function unshift(t){this.insert(0,t)}},{key:"get",value:function get1(t){return fne(this,t)}},{key:"slice",value:function slice(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length;return cne(this,t,r)}},{key:"forEach",value:function forEach(t){uw(this,t)}},{key:"_write",value:function _write(t){t.writeTypeRef(cWe)}}]);return Zp1}(Jo),Vqe=function(e){return new Zp},Pm=/*#__PURE__*/function(Zp1){"use strict";_inherits(Pm1,Zp1);function Pm1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"UNDEFINED";_class_call_check(this,Pm1);var _this;_this=_call_super(this,Pm1),_this.nodeName=t,_this._prelimAttrs=new Map;return _this}_create_class(Pm1,[{key:"nextSibling",get:function get1(){var t=this._item?this._item.next:null;return t?t.content.type:null}},{key:"prevSibling",get:function get1(){var t=this._item?this._item.prev:null;return t?t.content.type:null}},{key:"_integrate",value:function _integrate(t,r){var _this=this;_get(_get_prototype_of(Pm1.prototype),"_integrate",this).call(this,t,r),this._prelimAttrs.forEach(function(n,i){_this.setAttribute(i,n)}),this._prelimAttrs=null}},{key:"_copy",value:function _copy(){return new Pm(this.nodeName)}},{key:"clone",value:function clone(){var t=new Pm(this.nodeName),r=this.getAttributes();return lre(r,function(n,i){t.setAttribute(i,n)}),t.insert(0,this.toArray().map(function(n){return _instanceof(n,Jo)?n.clone():n})),t}},{key:"toString",value:function toString(){var t=this.getAttributes(),r=[],n=[];for(var s in t)n.push(s);n.sort();var i=n.length;for(var s10=0;s10<i;s10++){var l=n[s10];r.push(l+'="'+t[l]+'"')}var o=this.nodeName.toLocaleLowerCase(),a=r.length>0?" "+r.join(" "):"";return"<".concat(o).concat(a,">").concat(_get(_get_prototype_of(Pm1.prototype),"toString",this).call(this),"</").concat(o,">")}},{key:"removeAttribute",value:function removeAttribute(t){var _this=this;this.doc!==null?xi(this.doc,function(r){wC(r,_this,t)}):this._prelimAttrs.delete(t)}},{key:"setAttribute",value:function setAttribute(t,r){var _this=this;this.doc!==null?xi(this.doc,function(n){xN(n,_this,t,r)}):this._prelimAttrs.set(t,r)}},{key:"getAttribute",value:function getAttribute(t){return yN(this,t)}},{key:"hasAttribute",value:function hasAttribute(t){return yne(this,t)}},{key:"getAttributes",value:function getAttributes(t){return t?Fqe(this,t):xne(this)}},{key:"toDOM",value:function toDOM(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;var i=t.createElement(this.nodeName),o=this.getAttributes();for(var a in o){var s=o[a];typeof s=="string"&&i.setAttribute(a,s)}return uw(this,function(a){i.appendChild(a.toDOM(t,r,n))}),n!==void 0&&n._createAssociation(i,this),i}},{key:"_write",value:function _write(t){t.writeTypeRef(uWe),t.writeKey(this.nodeName)}}]);return Pm1}(Zp),Gqe=function(e){return new Pm(e.readKey())},uN=/*#__PURE__*/function(ay1){"use strict";_inherits(uN1,ay1);function uN1(t,r,n){_class_call_check(this,uN1);var _this;_this=_call_super(this,uN1,[t,n]),_this.childListChanged=!1,_this.attributesChanged=new Set,r.forEach(function(i){i===null?_this.childListChanged=!0:_this.attributesChanged.add(i)});return _this}return uN1}(ay),sy=/*#__PURE__*/function(Am1){"use strict";_inherits(sy1,Am1);function sy1(t){_class_call_check(this,sy1);var _this;_this=_call_super(this,sy1),_this.hookName=t;return _this}_create_class(sy1,[{key:"_copy",value:function _copy(){return new sy(this.hookName)}},{key:"clone",value:function clone(){var t=new sy(this.hookName);return this.forEach(function(r,n){t.set(n,r)}),t}},{key:"toDOM",value:function toDOM(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;var i=r[this.hookName],o;return i!==void 0?o=i.createDom(this):o=document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),n!==void 0&&n._createAssociation(o,this),o}},{key:"_write",value:function _write(t){t.writeTypeRef(dWe),t.writeKey(this.hookName)}}]);return sy1}(Am),Hqe=function(e){return new sy(e.readKey())},ly=/*#__PURE__*/function(Im1){"use strict";_inherits(ly1,Im1);function ly1(){_class_call_check(this,ly1);return _call_super(this,ly1,arguments)}_create_class(ly1,[{key:"nextSibling",get:function get1(){var t=this._item?this._item.next:null;return t?t.content.type:null}},{key:"prevSibling",get:function get1(){var t=this._item?this._item.prev:null;return t?t.content.type:null}},{key:"_copy",value:function _copy(){return new ly}},{key:"clone",value:function clone(){var t=new ly;return t.applyDelta(this.toDelta()),t}},{key:"toDOM",value:function toDOM(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;var i=t.createTextNode(this.toString());return n!==void 0&&n._createAssociation(i,this),i}},{key:"toString",value:function toString(){return this.toDelta().map(function(t){var r=[];for(var i in t.attributes){var o=[];for(var a in t.attributes[i])o.push({key:a,value:t.attributes[i][a]});o.sort(function(a,s){return a.key<s.key?-1:1}),r.push({nodeName:i,attrs:o})}r.sort(function(i,o){return i.nodeName<o.nodeName?-1:1});var n="";for(var i10=0;i10<r.length;i10++){var o10=r[i10];n+="<".concat(o10.nodeName);for(var a9=0;a9<o10.attrs.length;a9++){var s=o10.attrs[a9];n+=" ".concat(s.key,'="').concat(s.value,'"')}n+=">"}n+=t.insert;for(var i11=r.length-1;i11>=0;i11--)n+="</".concat(r[i11].nodeName,">");return n}).join("")}},{key:"toJSON",value:function toJSON(){return this.toString()}},{key:"_write",value:function _write(t){t.writeTypeRef(pWe)}}]);return ly1}(Im),Zqe=function(e){return new ly},dw=/*#__PURE__*/function(){"use strict";function dw1(t,r){_class_call_check(this,dw1);this.id=t,this.length=r}_create_class(dw1,[{key:"deleted",get:function get1(){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"write",value:function write(t,r,n){throw jl()}},{key:"integrate",value:function integrate(t,r){throw jl()}}]);return dw1}(),Kqe=0,Ys=/*#__PURE__*/function(dw1){"use strict";_inherits(Ys1,dw1);function Ys1(){_class_call_check(this,Ys1);return _call_super(this,Ys1,arguments)}_create_class(Ys1,[{key:"deleted",get:function get1(){return!0}},{key:"delete",value:function _delete(){}},{key:"mergeWith",value:function mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}},{key:"integrate",value:function integrate(t,r){r>0&&(this.id.clock+=r,this.length-=r),ine(t.doc.store,this)}},{key:"write",value:function write(t,r){t.writeInfo(Kqe),t.writeLen(this.length-r)}},{key:"getMissing",value:function getMissing(t,r){return null}}]);return Ys1}(dw),Bg=/*#__PURE__*/function(){"use strict";function Bg1(t){_class_call_check(this,Bg1);this.content=t}_create_class(Bg1,[{key:"getLength",value:function getLength(){return 1}},{key:"getContent",value:function getContent(){return[this.content]}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new Bg(this.content)}},{key:"splice",value:function splice(t){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"integrate",value:function integrate(t,r){}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeBuf(this.content)}},{key:"getRef",value:function getRef(){return 3}}]);return Bg1}(),Qqe=function(e){return new Bg(e.readBuf())},qg=/*#__PURE__*/function(){"use strict";function qg1(t){_class_call_check(this,qg1);this.len=t}_create_class(qg1,[{key:"getLength",value:function getLength(){return this.len}},{key:"getContent",value:function getContent(){return[]}},{key:"isCountable",value:function isCountable(){return!1}},{key:"copy",value:function copy(){return new qg(this.len)}},{key:"splice",value:function splice(t){var r=new qg(this.len-t);return this.len=t,r}},{key:"mergeWith",value:function mergeWith(t){return this.len+=t.len,!0}},{key:"integrate",value:function integrate(t,r){mC(t.deleteSet,r.id.client,r.id.clock,this.len),r.markDeleted()}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeLen(this.len-r)}},{key:"getRef",value:function getRef(){return 1}}]);return qg1}(),Jqe=function(e){return new qg(e.readLen())},Sne=function(e,t){return new vc(_object_spread_props(_object_spread({guid:e},t),{shouldLoad:t.shouldLoad||t.autoLoad||!1}))},Wg=/*#__PURE__*/function(){"use strict";function Wg1(t){_class_call_check(this,Wg1);t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;var r={};this.opts=r,t.gc||(r.gc=!1),t.autoLoad&&(r.autoLoad=!0),t.meta!==null&&(r.meta=t.meta)}_create_class(Wg1,[{key:"getLength",value:function getLength(){return 1}},{key:"getContent",value:function getContent(){return[this.doc]}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new Wg(Sne(this.doc.guid,this.opts))}},{key:"splice",value:function splice(t){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"integrate",value:function integrate(t,r){this.doc._item=r,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}},{key:"delete",value:function _delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeString(this.doc.guid),t.writeAny(this.opts)}},{key:"getRef",value:function getRef(){return 9}}]);return Wg1}(),Yqe=function(e){return new Wg(Sne(e.readString(),e.readAny()))},Kp=/*#__PURE__*/function(){"use strict";function Kp1(t){_class_call_check(this,Kp1);this.embed=t}_create_class(Kp1,[{key:"getLength",value:function getLength(){return 1}},{key:"getContent",value:function getContent(){return[this.embed]}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new Kp(this.embed)}},{key:"splice",value:function splice(t){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"integrate",value:function integrate(t,r){}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeJSON(this.embed)}},{key:"getRef",value:function getRef(){return 5}}]);return Kp1}(),Xqe=function(e){return new Kp(e.readJSON())},co=/*#__PURE__*/function(){"use strict";function co1(t,r){_class_call_check(this,co1);this.key=t,this.value=r}_create_class(co1,[{key:"getLength",value:function getLength(){return 1}},{key:"getContent",value:function getContent(){return[]}},{key:"isCountable",value:function isCountable(){return!1}},{key:"copy",value:function copy(){return new co(this.key,this.value)}},{key:"splice",value:function splice(t){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"integrate",value:function integrate(t,r){var n=r.parent;n._searchMarker=null,n._hasFormatting=!0}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeKey(this.key),t.writeJSON(this.value)}},{key:"getRef",value:function getRef(){return 6}}]);return co1}(),eWe=function(e){return new co(e.readKey(),e.readJSON())},uy=/*#__PURE__*/function(){"use strict";function uy1(t){_class_call_check(this,uy1);this.arr=t}_create_class(uy1,[{key:"getLength",value:function getLength(){return this.arr.length}},{key:"getContent",value:function getContent(){return this.arr}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new uy(this.arr)}},{key:"splice",value:function splice(t){var r=new uy(this.arr.slice(t));return this.arr=this.arr.slice(0,t),r}},{key:"mergeWith",value:function mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}},{key:"integrate",value:function integrate(t,r){}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){var n=this.arr.length;t.writeLen(n-r);for(var i=r;i<n;i++){var o=this.arr[i];t.writeString(o===void 0?"undefined":JSON.stringify(o))}}},{key:"getRef",value:function getRef(){return 2}}]);return uy1}(),tWe=function(e){var t=e.readLen(),r=[];for(var n=0;n<t;n++){var i=e.readString();i==="undefined"?r.push(void 0):r.push(JSON.parse(i))}return new uy(r)},rWe=Jb("node_env")==="development",Qp=/*#__PURE__*/function(){"use strict";function Qp1(t){_class_call_check(this,Qp1);this.arr=t,rWe&&I$(t)}_create_class(Qp1,[{key:"getLength",value:function getLength(){return this.arr.length}},{key:"getContent",value:function getContent(){return this.arr}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new Qp(this.arr)}},{key:"splice",value:function splice(t){var r=new Qp(this.arr.slice(t));return this.arr=this.arr.slice(0,t),r}},{key:"mergeWith",value:function mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}},{key:"integrate",value:function integrate(t,r){}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){var n=this.arr.length;t.writeLen(n-r);for(var i=r;i<n;i++){var o=this.arr[i];t.writeAny(o)}}},{key:"getRef",value:function getRef(){return 8}}]);return Qp1}(),nWe=function(e){var t=e.readLen(),r=[];for(var n=0;n<t;n++)r.push(e.readAny());return new Qp(r)},Au=/*#__PURE__*/function(){"use strict";function Au1(t){_class_call_check(this,Au1);this.str=t}_create_class(Au1,[{key:"getLength",value:function getLength(){return this.str.length}},{key:"getContent",value:function getContent(){return this.str.split("")}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new Au(this.str)}},{key:"splice",value:function splice(t){var r=new Au(this.str.slice(t));this.str=this.str.slice(0,t);var n=this.str.charCodeAt(t-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,t-1)+"�",r.str="�"+r.str.slice(1)),r}},{key:"mergeWith",value:function mergeWith(t){return this.str+=t.str,!0}},{key:"integrate",value:function integrate(t,r){}},{key:"delete",value:function _delete(t){}},{key:"gc",value:function gc1(t){}},{key:"write",value:function write(t,r){t.writeString(r===0?this.str:this.str.slice(r))}},{key:"getRef",value:function getRef(){return 4}}]);return Au1}(),iWe=function(e){return new Au(e.readString())},oWe=[zqe,jqe,Wqe,Gqe,Vqe,Hqe,Zqe],aWe=0,sWe=1,lWe=2,uWe=3,cWe=4,dWe=5,pWe=6,_c=/*#__PURE__*/function(){"use strict";function _c1(t){_class_call_check(this,_c1);this.type=t}_create_class(_c1,[{key:"getLength",value:function getLength(){return 1}},{key:"getContent",value:function getContent(){return[this.type]}},{key:"isCountable",value:function isCountable(){return!0}},{key:"copy",value:function copy(){return new _c(this.type._copy())}},{key:"splice",value:function splice(t){throw jl()}},{key:"mergeWith",value:function mergeWith(t){return!1}},{key:"integrate",value:function integrate(t,r){this.type._integrate(t.doc,r)}},{key:"delete",value:function _delete(t){var r=this.type._start;for(;r!==null;)r.deleted?r.id.clock<(t.beforeState.get(r.id.client)||0)&&t._mergeStructs.push(r):r.delete(t),r=r.right;this.type._map.forEach(function(n){n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t)}),t.changed.delete(this.type)}},{key:"gc",value:function gc1(t){var r=this.type._start;for(;r!==null;)r.gc(t,!0),r=r.right;this.type._start=null,this.type._map.forEach(function(n){for(;n!==null;)n.gc(t,!0),n=n.left}),this.type._map=new Map}},{key:"write",value:function write(t,r){this.type._write(t)}},{key:"getRef",value:function getRef(){return 7}}]);return _c1}(),fWe=function(e){return new _c(oWe[e.readTypeRef()](e))};var SC=function(e,t,r){var _t_id=t.id,n=_t_id.client,i=_t_id.clock,o=new uo(dn(n,i+r),t,dn(n,i+r-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(r));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),t.redone!==null&&(o.redone=dn(t.redone.client,t.redone.clock+r)),t.right=o,o.right!==null&&(o.right.left=o),e._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),t.length=r,o};var uo=/*#__PURE__*/function(dw1){"use strict";_inherits(uo1,dw1);function uo1(t,r,n,i,o,a,s,l){_class_call_check(this,uo1);var _this;_this=_call_super(this,uo1,[t,l.getLength()]),_this.origin=n,_this.left=r,_this.right=i,_this.rightOrigin=o,_this.parent=a,_this.parentSub=s,_this.redone=null,_this.content=l,_this.info=_this.content.isCountable()?2:0;return _this}_create_class(uo1,[{key:"marker",get:function get1(){return(this.info&8)>0},set:function set1(t){(this.info&8)>0!==t&&(this.info^=8)}},{key:"keep",get:function get1(){return(this.info&1)>0},set:function set1(t){this.keep!==t&&(this.info^=1)}},{key:"countable",get:function get1(){return(this.info&2)>0}},{key:"deleted",get:function get1(){return(this.info&4)>0},set:function set1(t){this.deleted!==t&&(this.info^=4)}},{key:"markDeleted",value:function markDeleted(){this.info|=4}},{key:"getMissing",value:function getMissing(t,r){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=ga(r,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=ga(r,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===km&&this.id.client!==this.parent.client&&this.parent.clock>=ga(r,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Bre(t,r,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Tm(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ys||this.right&&this.right.constructor===Ys)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===uo?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===uo&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===km){var n=J$(r,this.parent);n.constructor===Ys?this.parent=null:this.parent=n.content.type}return null}},{key:"integrate",value:function integrate(t,r){if(r>0&&(this.id.clock+=r,this.left=Bre(t,t.doc.store,dn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(r),this.length-=r),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){var n=this.left,i;if(n!==null)i=n.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;var o=new Set,a=new Set;for(;i!==null&&i!==this.right;){if(a.add(i),o.add(i),uC(this.origin,i.origin)){if(i.id.client<this.id.client)n=i,o.clear();else if(uC(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&a.has(J$(t.doc.store,i.origin)))o.has(J$(t.doc.store,i.origin))||(n=i,o.clear());else break;i=i.right}this.left=n}if(this.left!==null){var n10=this.left.right;this.right=n10,this.left.right=this}else{var n11;if(this.parentSub!==null)for(n11=this.parent._map.get(this.parentSub)||null;n11!==null&&n11.left!==null;)n11=n11.left;else n11=this.parent._start,this.parent._start=this;this.right=n11}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),ine(t.doc.store,this),this.content.integrate(t,this),Wre(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new Ys(this.id,this.length).integrate(t,0)}},{key:"next",get:function get1(){var t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}},{key:"prev",get:function get1(){var t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}},{key:"lastId",get:function get1(){return this.length===1?this.id:dn(this.id.client,this.id.clock+this.length-1)}},{key:"mergeWith",value:function mergeWith(t){var _this=this;if(this.constructor===t.constructor&&uC(t.origin,this.lastId)&&this.right===t&&uC(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){var r=this.parent._searchMarker;return r&&r.forEach(function(n){n.p===t&&(n.p=_this,!_this.deleted&&_this.countable&&(n.index-=_this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}},{key:"delete",value:function _delete(t){if(!this.deleted){var r=this.parent;this.countable&&this.parentSub===null&&(r._length-=this.length),this.markDeleted(),mC(t.deleteSet,this.id.client,this.id.clock,this.length),Wre(t,r,this.parentSub),this.content.delete(t)}}},{key:"gc",value:function gc1(t,r){if(!this.deleted)throw Qs();this.content.gc(t),r?kqe(t,this,new Ys(this.id,this.length)):this.content=new qg(this.length)}},{key:"write",value:function write(t,r){var n=r>0?dn(this.id.client,this.id.clock+r-1):this.origin,i=this.rightOrigin,o=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(i===null?0:64)|(o===null?0:32);if(t.writeInfo(a),n!==null&&t.writeLeftID(n),i!==null&&t.writeRightID(i),n===null&&i===null){var s=this.parent;if(s._item!==void 0){var l=s._item;if(l===null){var c=bqe(s);t.writeParentInfo(!0),t.writeString(c)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else s.constructor===String?(t.writeParentInfo(!0),t.writeString(s)):s.constructor===km?(t.writeParentInfo(!1),t.writeLeftID(s)):Qs();o!==null&&t.writeString(o)}this.content.write(t,r)}}]);return uo1}(dw),kne=function(e,t){return mWe[t&31](e)},mWe=[function(){Qs()},Jqe,tWe,Qqe,iWe,Xqe,eWe,fWe,nWe,Yqe,function(){Qs()}],hWe=10,Xs=/*#__PURE__*/function(dw1){"use strict";_inherits(Xs1,dw1);function Xs1(){_class_call_check(this,Xs1);return _call_super(this,Xs1,arguments)}_create_class(Xs1,[{key:"deleted",get:function get1(){return!0}},{key:"delete",value:function _delete(){}},{key:"mergeWith",value:function mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}},{key:"integrate",value:function integrate(t,r){Qs()}},{key:"write",value:function write(t,r){t.writeInfo(hWe),en(t.restEncoder,this.length-r)}},{key:"getMissing",value:function getMissing(t,r){return null}}]);return Xs1}(dw),Cne=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:{},Ene="__ $YJS$ __";Cne[Ene]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Cne[Ene]=!0;function xWe(e,t,r){var n=f$(t,e,r,{excludeFalseConflicts:!0,stringSeparator:"\n"});if(n.some(function(o){return!o.ok}))return!1;var i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;o.ok&&i.push(o.ok)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i.flat().join("\n")}function Tne(param){var e=param.localContentText,t=param.remoteContentText,r=param.baseContentText;if(e===t)return{success:!0,isIdentical:!0};var _jte=jte(e,r,t,{excludeFalseConflicts:!0,stringSeparator:"\n",label:{a:"LOCAL",o:"BASE",b:"REMOTE"}}),n=_jte.result;return{success:!0,mergedText:n.join("\n")}}var Dd=Symbol("missing-json-value");function vN(e){return e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)}function _N(e,t){return e===Dd||t===Dd?e===t:GO(e,t)}function Ane(e,t,r){if(_N(t,r))return t;if(_N(t,e))return r;if(_N(r,e))return t;if(vN(t)&&vN(r)&&(vN(e)||e===Dd)){var n=e===Dd?{}:e,i=new Set(_to_consumable_array(Object.keys(t)).concat(_to_consumable_array(Object.keys(r)),_to_consumable_array(Object.keys(n)))),o=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;var s=Ane(Object.hasOwn(n,a)?n[a]:Dd,Object.hasOwn(t,a)?t[a]:Dd,Object.hasOwn(r,a)?r[a]:Dd);s!==Dd&&(o[a]=s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o}return t}function yWe(e){if(!e.includes("\n"))return;var t=e.match(/\n([\t ]+)\S/);return t?t[1].startsWith(" ")?" ":t[1].length:2}function vWe(e,t,r,n){try{var i=JSON.parse(t),o=JSON.parse(r),a=n?JSON.parse(e):Dd,s=Ane(a,i,o);if(s===Dd)return;var l=t.endsWith("\n")?"\n":"";return JSON.stringify(s,null,yWe(t))+l}catch(i){return}}function _We(e,t,r){var i=new fw.diff_match_patch().diff_main(t,r),o=0;e.doc.transact(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];switch(a){case fw.diff_match_patch.DIFF_EQUAL:o+=s.length;break;case fw.diff_match_patch.DIFF_DELETE:e.delete(o,s.length);break;case fw.diff_match_patch.DIFF_INSERT:e.insert(o,s),o+=s.length}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}})}function bWe(e,t,r){var n=new vc;n.getText("content").insert(0,e);var i=mN(n),o=rne(n),a=function(c){var d=new vc;return pw(d,i),_We(d.getText("content"),e,c),mN(d,o)},s=new vc;return pw(s,i),pw(s,a(t)),pw(s,a(r)),s.getText("content").toJSON()}function Ine(e){return _async_to_generator(function(){var t,r,n,i,tmp,o,_$s,a;return _ts_generator(this,function(_state){t=e.localContentText,r=e.remoteContentText,n=e.baseContentText,i=e.filePath,tmp=e.hasBase,o=tmp===void 0?!0:tmp;if(t===r)return[2,{success:!0,isIdentical:!0}];if(i!=null&&i.trim().toLowerCase().endsWith(".json")){_$s=vWe(n,t,r,o);if(_$s!==void 0)return[2,{success:!0,mergedText:_$s}]}a=xWe(n,t,r);if(a!==!1)return[2,{success:!0,mergedText:a}];try{return[2,{success:!0,mergedText:bWe(n,t,r)}]}catch(s){return[2,{success:!1,error:_instanceof(s,Error)?s.message:String(s)}]}return[2]})})()}var py=function(i){return i.NoConflictMerge="no-conflict-merge",i.Diff3="diff3",i.LocalPriority="local-priority",i.ServerPriority="server-priority",i}(py||{}),Iu=/*#__PURE__*/function(Kn1){"use strict";_inherits(Iu1,Kn1);function Iu1(r){_class_call_check(this,Iu1);var _this;_this=_call_super(this,Iu1,[r]);_this.options=r;return _this}_create_class(Iu1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var r,n,_$i,_tmp,o,_tmp1,_,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,16,,17]);this.logger.info("[ConflictResolve] ".concat(this.localPath," strategy=").concat(this.options.strategy));if(!((r=this.options.localStat)!=null))return[3,1];_tmp=r;return[3,3];case 1:return[4,Ya(this.vault,this.localPath)];case 2:_tmp=_state.sent();_state.label=3;case 3:_$i=_tmp;if(!_$i)throw new Error("Local file not found: "+this.localPath);if(!((n=this.options.remoteStat)!=null))return[3,4];_tmp1=n;return[3,6];case 4:return[4,Fte(this.webdav,this.remotePath)];case 5:_tmp1=_state.sent();_state.label=6;case 6:o=_tmp1;if(o.isDir)throw new Error("Remote path is a directory: "+this.remotePath);if(_$i.isDir)throw new Error("Local path is a directory: "+this.localPath);if(_$i.size===0&&o.size===0)return[2,{success:!0}];_=this.options.strategy;switch(_){case"no-conflict-merge":return[3,7];case"diff3":return[3,9];case"local-priority":return[3,11];case"server-priority":return[3,13]}return[3,15];case 7:return[4,this.execMerge(Ine,"NoConflictMerge")];case 8:return[2,_state.sent()];case 9:return[4,this.execMerge(Tne,"Diff3")];case 10:return[2,_state.sent()];case 11:return[4,this.execLocalPriority()];case 12:return[2,_state.sent()];case 13:return[4,this.execServerPriority(o)];case 14:return[2,_state.sent()];case 15:return[3,17];case 16:i=_state.sent();return[2,(this.logger.error("[ConflictResolve] failed: ".concat(this.localPath),i),{success:!1,error:hi(i,this)})];case 17:return[2]}})}).call(this)}},{key:"execLocalPriority",value:function execLocalPriority(){return _async_to_generator(function(){var n,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);return[4,Fl(this.vault,this.localPath)];case 1:if(!_state.sent())return[2,{success:!1,error:hi(new Error("cannot find file in local fs: "+this.localPath),this)}];return[4,xc(this.vault,this.localPath)];case 2:n=_state.sent();return[4,this.webdav.putFileContents(this.remotePath,n,{overwrite:!0})];case 3:return[2,(_state.sent(),{success:!0})];case 4:r=_state.sent();return[2,(this.logger.error("[ConflictResolve/LocalPriority] failed: ".concat(this.localPath),r),{success:!1,error:hi(r,this)})];case 5:return[2]}})}).call(this)}},{key:"execServerPriority",value:function execServerPriority(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);if(r.isDir)throw new Error("Remote path is a directory: "+this.remotePath);return[4,$8({vault:this.vault,webdav:this.webdav,remotePath:this.remotePath,localPath:this.localPath,remoteSize:r.size,mobileAppDownloadFileChunkSize:this.options.mobileAppDownloadFileChunkSize})];case 1:return[2,(_state.sent(),{success:!0})];case 2:n=_state.sent();return[2,(this.logger.error("[ConflictResolve/ServerPriority] failed: ".concat(this.localPath),n),{success:!1,error:hi(n,this)})];case 3:return[2]}})}).call(this)}},{key:"execMerge",value:function execMerge(r,n){return _async_to_generator(function(){var i,o,s,l,_this_options,c,d,u,_tmp,p,m,h,g,x,v,y,_tmp1,_tmp2,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,16,,17]);return[4,Fl(this.vault,this.localPath)];case 1:if(!_state.sent())throw new Error("cannot find file in local fs: "+this.localPath);return[4,xc(this.vault,this.localPath)];case 2:s=_state.sent();return[4,this.webdav.getFileContents(this.remotePath,{format:"binary",details:!1})];case 3:l=_state.sent();if(M8(s,l))return[2,{success:!0}];_this_options=this.options,c=_this_options.record,d=null,u=(i=c==null?void 0:c.base)==null?void 0:i.key;_tmp=u;if(!_tmp)return[3,5];return[4,vm.get(u)];case 4:_tmp=d=_state.sent();_state.label=5;case 5:_tmp;p=$b(this.localPath),m=$b(this.remotePath);if(!(p&&m))throw new Error(P.t("sync.error.mergeNotSupported"));return[4,new Blob([new Uint8Array(s)]).text()];case 6:h=_state.sent();return[4,new Blob([new Uint8Array(l)]).text()];case 7:g=_state.sent();return[4,d==null?void 0:d.text()];case 8:x=(o=_state.sent())!=null?o:"";return[4,r({localContentText:h,remoteContentText:g,baseContentText:x,filePath:this.localPath,hasBase:d!==null})];case 9:v=_state.sent();if(this.logger.info("[ConflictResolve/".concat(n,"] ").concat(this.localPath,": merge ").concat(v.success?"ok":"failed")),!v.success)throw new Error(P.t("sync.error.failedToAutoMerge"));if(v.isIdentical)return[2,{success:!0}];y=v.mergedText;if(!(y===g))return[3,12];_tmp1=y!==h;if(!_tmp1)return[3,11];return[4,Dx(this.vault,this.localPath,y)];case 10:_tmp1=_state.sent();_state.label=11;case 11:return[2,(_tmp1,{success:!0})];case 12:return[4,this.webdav.putFileContents(this.remotePath,y,{overwrite:!0})];case 13:if(!_state.sent())throw new Error(P.t("sync.error.failedToUploadMerged"));_tmp2=h!==y;if(!_tmp2)return[3,15];return[4,Dx(this.vault,this.localPath,y)];case 14:_tmp2=_state.sent();_state.label=15;case 15:return[2,(_tmp2,{success:!0})];case 16:a=_state.sent();return[2,(this.logger.error("[ConflictResolve/".concat(n,"] failed: ").concat(this.localPath),a),{success:!1,error:hi(a,this)})];case 17:return[2]}})}).call(this)}}]);return Iu1}(Kn);var wWe=':*?"<>|',Pne=wWe.split("");function Pu(e){return Pne.some(function(t){return e.includes(t)})}function Rne(e){return Pne.filter(function(t){return e.includes(t)})}var mw=/*#__PURE__*/function _target(Error1){"use strict";_inherits(mw1,Error1);function mw1(r,n){_class_call_check(this,mw1);var _this;var i;_this=_call_super(this,mw1);_this.invalidChars=r;_this.filePath=n;_this.name="FilenameError",(i=Object.setPrototypeOf)==null||i.call(Object,_this,(_instanceof(this,mw1)?this.constructor:void 0).prototype),Object.defineProperty(_this,"message",{configurable:!0,get:function(){return mw.format(_this.invalidChars,_this.filePath)}});return _this}_create_class(mw1,null,[{key:"format",value:function format(r,n){var o=Array.from(new Set(r)).map(function(a){return"'".concat(a,"'")}).join(", ");return P.t("errors.filenameUnsupportedChars",{chars:o,path:n})}}]);return mw1}(_wrap_native_super(Error)),Jp=/*#__PURE__*/function(Kn1){"use strict";_inherits(Jp1,Kn1);function Jp1(){_class_call_check(this,Jp1);return _call_super(this,Jp1,arguments)}_create_class(Jp1,[{key:"exec",value:function exec(){var t=Rne(this.localPath);return{success:!1,error:hi(new mw(t,this.localPath),this)}}}]);return Jp1}(Kn);var bc=/*#__PURE__*/function(Kn1){"use strict";_inherits(bc1,Kn1);function bc1(){_class_call_check(this,bc1);return _call_super(this,bc1,arguments)}_create_class(bc1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);this.logger.info("[MkdirLocal] ".concat(this.localPath));return[4,Ja(this.vault,this.localPath)];case 1:return[2,(_state.sent(),{success:!0})];case 2:t=_state.sent();return[2,(this.logger.error("[MkdirLocal] failed: ".concat(this.localPath),t),{success:!1,error:hi(t,this)})];case 3:return[2]}})}).call(this)}}]);return bc1}(Kn);var Ia=/*#__PURE__*/function(Kn1){"use strict";_inherits(Ia1,Kn1);function Ia1(){_class_call_check(this,Ia1);return _call_super(this,Ia1,arguments)}_create_class(Ia1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);return[4,Ya(this.vault,this.localPath)];case 1:if(!_state.sent())throw this.logger.debug("[MkdirRemote] local path not found:",this.localPath),new Error(P.t("sync.error.localPathNotFound",{path:this.localPath}));this.logger.info("[MkdirRemote] ".concat(this.remotePath));return[4,this.webdav.createDirectory(this.remotePath,{recursive:!0})];case 2:return[2,(_state.sent(),{success:!0})];case 3:t=_state.sent();return[2,(this.logger.error("[MkdirRemote] failed: ".concat(this.remotePath),t),{success:!1,error:hi(t,this)})];case 4:return[2]}})}).call(this)}}]);return Ia1}(Kn);var Ru=/*#__PURE__*/function(Kn1){"use strict";_inherits(Ru1,Kn1);function Ru1(r){_class_call_check(this,Ru1);var _this;_this=_call_super(this,Ru1,[r]);A(_this,"additionalPaths");_this.additionalPaths=r.additionalPaths;return _this}_create_class(Ru1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);return[4,Ya(this.vault,this.localPath)];case 1:if(!_state.sent())throw this.logger.debug("MkdirsRemoteTask: local path:",this.localPath),this.logger.debug("MkdirsRemoteTask: local stat is null"),new Error(P.t("sync.error.localPathNotFound",{path:this.localPath}));return[4,this.webdav.createDirectory(this.remotePath,{recursive:!0})];case 2:return[2,(_state.sent(),{success:!0})];case 3:r=_state.sent();return[2,(this.logger.error(this,r),{success:!1,error:hi(r,this)})];case 4:return[2]}})}).call(this)}},{key:"getAllPaths",value:function getAllPaths(){return[{localPath:this.localPath,remotePath:this.remotePath}].concat(_to_consumable_array(this.additionalPaths))}},{key:"toJSON",value:function toJSON(){return _object_spread_props(_object_spread({},_get(_get_prototype_of(Ru1.prototype),"toJSON",this).call(this)),{additionalPaths:this.additionalPaths,totalDirs:this.getAllPaths().length})}}]);return Ru1}(Kn);var el=/*#__PURE__*/function(Kn1){"use strict";_inherits(el1,Kn1);function el1(){_class_call_check(this,el1);return _call_super(this,el1,arguments)}_create_class(el1,[{key:"exec",value:function exec(){return{success:!0}}}]);return el1}(Kn);var Mu=/*#__PURE__*/function(Kn1){"use strict";_inherits(Mu1,Kn1);function Mu1(r){_class_call_check(this,Mu1);var _this;_this=_call_super(this,Mu1,[r]);_this.options=r;return _this}_create_class(Mu1,[{key:"remoteSize",get:function get1(){return this.options.remoteSize}},{key:"exec",value:function exec(){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);this.logger.info("[PullTask] ".concat(this.remotePath," → ").concat(this.localPath," (").concat(this.remoteSize," bytes)"));return[4,$8({vault:this.vault,webdav:this.webdav,remotePath:this.remotePath,localPath:this.localPath,remoteSize:this.remoteSize,mobileAppDownloadFileChunkSize:this.options.mobileAppDownloadFileChunkSize})];case 1:return[2,(_state.sent(),{success:!0})];case 2:r=_state.sent();return[2,(this.logger.error("[PullTask] failed: ".concat(this.localPath),r),{success:!1,error:hi(r,this)})];case 3:return[2]}})}).call(this)}}]);return Mu1}(Kn);var Ou=/*#__PURE__*/function(Kn1){"use strict";_inherits(Ou1,Kn1);function Ou1(){_class_call_check(this,Ou1);return _call_super(this,Ou1,arguments)}_create_class(Ou1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var r,n,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);return[4,Fl(this.vault,this.localPath)];case 1:if(!_state.sent())throw new Error("cannot find file in local fs: "+this.localPath);return[4,xc(this.vault,this.localPath)];case 2:r=_state.sent();this.logger.info("[PushTask] ".concat(this.localPath," → ").concat(this.remotePath," (").concat(r.byteLength," bytes)"));return[4,this.webdav.putFileContents(this.remotePath,r,{overwrite:!0})];case 3:n=_state.sent();if(!n)throw new Error("Upload failed");return[2,{success:n}];case 4:t=_state.sent();return[2,(this.logger.error("[PushTask] failed: ".concat(this.localPath),t),{success:!1,error:hi(t,this)})];case 5:return[2]}})}).call(this)}}]);return Ou1}(Kn);var tl=/*#__PURE__*/function(Kn1){"use strict";_inherits(tl1,Kn1);function tl1(r){_class_call_check(this,tl1);var _this;_this=_call_super(this,tl1,[r]);_this.options=r;return _this}_create_class(tl1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var _tmp,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,6]);return[4,Ya(this.vault,this.localPath)];case 1:if(!_state.sent())return[3,3];this.logger.info("[RemoveLocal] ".concat(this.localPath));return[4,Lx(this.vault,this.localPath,this.options.recursive)];case 2:_tmp=(_state.sent(),{success:!0});return[3,4];case 3:_tmp={success:!0};_state.label=4;case 4:return[2,_tmp];case 5:r=_state.sent();return[2,(this.logger.error("[RemoveLocal] failed: ".concat(this.localPath),r),{success:!1,error:hi(r,this)})];case 6:return[2]}})}).call(this)}}]);return tl1}(Kn);var wc=/*#__PURE__*/function(Kn1){"use strict";_inherits(wc1,Kn1);function wc1(){_class_call_check(this,wc1);return _call_super(this,wc1,arguments)}_create_class(wc1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.webdav.deleteFile(this.remotePath)];case 1:return[2,(_state.sent(),{success:!0})];case 2:t=_state.sent();return[2,(this.logger.error(t),{success:!1,error:hi(t,this)})];case 3:return[2]}})}).call(this)}}]);return wc1}(Kn);var Ul=/*#__PURE__*/function(Kn1){"use strict";_inherits(Ul1,Kn1);function Ul1(){_class_call_check(this,Ul1);return _call_super(this,Ul1,arguments)}_create_class(Ul1,[{key:"exec",value:function exec(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);this.logger.info("[RemoveRemote] ".concat(this.remotePath));return[4,this.webdav.deleteFile(this.remotePath)];case 1:return[2,(_state.sent(),{success:!0})];case 2:t=_state.sent();return[2,(this.logger.error("[RemoveRemote] failed: ".concat(this.remotePath),t),{success:!1,error:hi(t,this)})];case 3:return[2]}})}).call(this)}}]);return Ul1}(Kn);var Bl=/*#__PURE__*/function(Kn1){"use strict";_inherits(Bl1,Kn1);function Bl1(r){_class_call_check(this,Bl1);var _this;_this=_call_super(this,Bl1,[r]);_this.options=r;return _this}_create_class(Bl1,[{key:"exec",value:function exec(){return{success:!0,skipRecord:!0}}}]);return Bl1}(Kn);function Yp(e){if(_instanceof(e,Zs))return P.t("sync.fileOp.cleanRecord");if(_instanceof(e,Iu))return P.t("sync.fileOp.merge");if(_instanceof(e,Jp))return P.t("sync.fileOp.filenameError");if(_instanceof(e,bc))return P.t("sync.fileOp.createLocalDir");if(_instanceof(e,Ia))return P.t("sync.fileOp.createRemoteDir");if(_instanceof(e,Ru))return P.t("sync.fileOp.createRemoteDirs");if(_instanceof(e,el))return P.t("sync.fileOp.noop");if(_instanceof(e,Mu))return P.t("sync.fileOp.download");if(_instanceof(e,Ou))return P.t("sync.fileOp.upload");if(_instanceof(e,tl))return P.t("sync.fileOp.removeLocal");if(_instanceof(e,Ul))return P.t("sync.fileOp.removeRemote");if(_instanceof(e,wc))return P.t("sync.fileOp.removeRemoteRecursively");if(_instanceof(e,Bl)){var t=function(){if(e.options.reason==="file-too-large")return P.t("sync.skipReason.file-too-large");if(e.options.reason==="folder-contains-ignored-items")return P.t("sync.skipReason.folder-contains-ignored-items");if(e.options.reason==="conflict-in-send-only-mode")return P.t("sync.skipReason.conflict-in-send-only-mode");if(e.options.reason==="conflict-in-receive-only-mode")return P.t("sync.skipReason.conflict-in-receive-only-mode");if(e.options.reason==="deleted-locally-but-changed-remotely")return P.t("sync.skipReason.deleted-locally-but-changed-remotely");if(e.options.reason==="deleted-remotely-but-changed-locally")return P.t("sync.skipReason.deleted-remotely-but-changed-locally")}();return"".concat(P.t("sync.fileOp.skip"),": ").concat(t)}return P.t("sync.fileOp.sync")}var Tn={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId:function getContextId(){return Mne(this.context.count)},getNextContextId:function getNextContextId(){return Mne(this.context.count++)}};function Mne(e){var t=String(e),r=t.length-1;return Tn.context.id+(r?String.fromCharCode(96+r):"")+t}function SN(e){Tn.context=e}function SWe(){return _object_spread_props(_object_spread({},Tn.context),{id:Tn.getNextContextId(),count:0})}var kWe=!1,CWe=function(e,t){return e===t},Mm=Symbol("solid-proxy");var PC=Symbol("solid-track"),JQt=Symbol("solid-dev-component"),AC={equals:CWe},One=null,zne=Hne,ql=1,hw=2,jne={owned:null,cleanups:null,context:null,owner:null},wN={},Zr=null,rt=null,hy=null,fy=null,An=null,Io=null,es=null,RC=0;function my(e,t){var r=An,n=Zr,i=e.length===0,o=t===void 0?n:t,a=i?jne:{owned:null,cleanups:null,context:o?o.context:null,owner:o},s=i?e:function(){return e(function(){return Pa(function(){return Rm(a)})})};Zr=a,An=null;try{return rl(s,!0)}finally{An=r,Zr=n}}function Yt(e,t){t=t?Object.assign({},AC,t):AC;var r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=function(i){return typeof i=="function"&&(rt&&rt.running&&rt.sources.has(r)?i=i(r.tValue):i=i(r.value)),Gne(r,i)};return[Vne.bind(r),n]}function $ne(e,t,r){var n=NC(e,t,!0,ql);hy&&rt&&rt.running?Io.push(n):gy(n)}function yt(e,t,r){var n=NC(e,t,!1,ql);hy&&rt&&rt.running?Io.push(n):gy(n)}function ki(e,t,r){zne=RWe;var n=NC(e,t,!1,ql),i=gw&&Wne(gw);i&&(n.suspense=i),(!r||!r.render)&&(n.user=!0),es?es.push(n):gy(n)}function Bn(e,t,r){r=r?Object.assign({},AC,r):AC;var n=NC(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,hy&&rt&&rt.running?(n.tState=ql,Io.push(n)):gy(n),Vne.bind(n)}function EWe(e){return e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"then"in e}function Une(e,t,r){var n,i,o;typeof t=="function"?(n=e,i=t,o=r||{}):(n=!0,i=e,o=t||{});var a=null,s=wN,l=null,c=!1,d=!1,u="initialValue"in o,p=typeof n=="function"&&Bn(n),m=new Set,_ref=_sliced_to_array((o.storage||Yt)(o.initialValue),2),h=_ref[0],g=_ref[1],_Yt=_sliced_to_array(Yt(void 0),2),x=_Yt[0],v=_Yt[1],_Yt1=_sliced_to_array(Yt(void 0,{equals:!1}),2),y=_Yt1[0],_=_Yt1[1],_Yt2=_sliced_to_array(Yt(u?"ready":"unresolved"),2),b=_Yt2[0],w=_Yt2[1];Zr&&po(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=m.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var I=_step.value;I.decrement()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}m.clear(),rt&&a&&rt.promises.delete(a),a=null}),Tn.context&&(l=Tn.getNextContextId(),o.ssrLoadFrom==="initial"?s=o.initialValue:Tn.load&&Tn.has(l)&&(s=Tn.load(l)));function S(I,O,M,R){return a===I&&(a=null,R!==void 0&&(u=!0),(I===s||O===s)&&o.onHydrated&&queueMicrotask(function(){return o.onHydrated(R,{value:O})}),s=wN,rt&&I&&c?(rt.promises.delete(I),c=!1,rl(function(){rt.running=!0,k(O,M)},!1)):k(O,M)),O}function k(I,O){rl(function(){O===void 0&&g(function(){return I}),w(O!==void 0?"errored":u?"ready":"unresolved"),v(O);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=m.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var M=_step.value;M.decrement()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}m.clear()},!1)}function E(){var I=gw&&Wne(gw),O=h(),M=x();if(M!==void 0&&!a)throw M;return An&&!An.user&&I&&$ne(function(){y(),a&&(I.resolved&&rt&&c?rt.promises.add(a):m.has(I)||(I.increment(),m.add(I)))}),O}function C(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(I!==!1&&d)return;d=!1;var O=p?p():n;if(c=rt&&rt.running,O==null||O===!1){S(a,Pa(h));return}rt&&a&&rt.promises.delete(a);var M,R=s!==wN?s:Pa(function(){try{return i(O,{value:h(),refetching:I})}catch($){M=$}});if(M!==void 0){S(a,void 0,TC(M),O);return}else if(!EWe(R))return S(a,R,void 0,O),R;return a=R,"v"in R?(R.s===1?S(a,R.v,void 0,O):S(a,void 0,TC(R.v),O),R):(d=!0,queueMicrotask(function(){return d=!1}),rl(function(){w(u?"refreshing":"pending"),_()},!1),R.then(function($){return S(R,$,void 0,O)},function($){return S(R,void 0,TC($),O)}))}Object.defineProperties(E,{state:{get:function(){return b()}},error:{get:function(){return x()}},loading:{get:function get1(){var I=b();return I==="pending"||I==="refreshing"}},latest:{get:function get1(){if(!u)return E();var I=x();if(I&&!a)throw I;return h()}}});var T=Zr;return p?$ne(function(){return T=Zr,C(!1)}):C(!1),[E,{refetch:function(I){return CN(T,function(){return C(I)})},mutate:g}]}function Bne(e){return rl(e,!1)}function Pa(e){if(!fy&&An===null)return e();var t=An;An=null;try{return fy?fy.untrack(e):e()}finally{An=t}}function MC(e,t,r){var n=Array.isArray(e),i,o=r&&r.defer;return function(a){var s;if(n){s=Array(e.length);for(var c=0;c<e.length;c++)s[c]=e[c]()}else s=e();if(o)return o=!1,a;var l=Pa(function(){return t(s,i,a)});return i=s,l}}function qne(e){ki(function(){return Pa(e)})}function po(e){return Zr===null||(Zr.cleanups===null?Zr.cleanups=[e]:Zr.cleanups.push(e)),e}function OC(){return An}function $C(){return Zr}function CN(e,t){var r=Zr,n=An;Zr=e,An=null;try{return rl(t,!0)}catch(i){DC(i)}finally{Zr=r,An=n}}function TWe(e){if(rt&&rt.running)return e(),rt.done;var t=An,r=Zr;return Promise.resolve().then(function(){An=t,Zr=r;var n;return(hy||gw)&&(n=rt||(rt={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),n.done||(n.done=new Promise(function(i){return n.resolve=i})),n.running=!0),rl(e,!1),An=Zr=null,n?n.done:void 0})}var _Yt=_sliced_to_array(Yt(!1),2),YQt=_Yt[0],Nne=_Yt[1];function Wne(e){var t;return Zr&&Zr.context&&(t=Zr.context[e.id])!==void 0?t:e.defaultValue}function AWe(e){var t=Bn(e),r=Bn(function(){return kN(t())});return r.toArray=function(){var n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var gw;function Vne(){var _this=this;var e=rt&&rt.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===ql)gy(this);else{var t=Io;Io=null,rl(function(){return IC(_this)},!1),Io=t}if(An){var t10=this.observers;if(!t10||t10[t10.length-1]!==An){var r=t10?t10.length:0;An.sources?(An.sources.push(this),An.sourceSlots.push(r)):(An.sources=[this],An.sourceSlots=[r]),t10?(t10.push(An),this.observerSlots.push(An.sources.length-1)):(this.observers=[An],this.observerSlots=[An.sources.length-1])}}return e&&rt.sources.has(this)?this.tValue:this.value}function Gne(e,t,r){var n=rt&&rt.running&&rt.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(n,t)){if(rt){var i=rt.running;(i||!r&&rt.sources.has(e))&&(rt.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&rl(function(){for(var i=0;i<e.observers.length;i+=1){var o=e.observers[i],a=rt&&rt.running;a&&rt.disposed.has(o)||((a?!o.tState:!o.state)&&(o.pure?Io.push(o):es.push(o),o.observers&&Zne(o)),a?o.tState=ql:o.state=ql)}if(Io.length>1e6)throw Io=[],new Error},!1)}return t}function gy(e){if(!e.fn)return;Rm(e);var t=RC;Dne(e,rt&&rt.running&&rt.sources.has(e)?e.tValue:e.value,t),rt&&!rt.running&&rt.sources.has(e)&&queueMicrotask(function(){rl(function(){rt&&(rt.running=!0),An=Zr=e,Dne(e,e.tValue,t),An=Zr=null},!1)})}function Dne(e,t,r){var n,i=Zr,o=An;An=Zr=e;try{n=e.fn(t)}catch(a){return e.pure&&(rt&&rt.running?(e.tState=ql,e.tOwned&&e.tOwned.forEach(Rm),e.tOwned=void 0):(e.state=ql,e.owned&&e.owned.forEach(Rm),e.owned=null)),e.updatedAt=r+1,DC(a)}finally{An=o,Zr=i}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Gne(e,n,!0):rt&&rt.running&&e.pure?(rt.sources.has(e)||(e.value=n),rt.sources.add(e),e.tValue=n):e.value=n,e.updatedAt=r)}function NC(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ql,i=arguments.length>4?arguments[4]:void 0;var o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Zr,context:Zr?Zr.context:null,pure:r};if(rt&&rt.running&&(o.state=0,o.tState=n),Zr===null||Zr!==jne&&(rt&&rt.running&&Zr.pure?Zr.tOwned?Zr.tOwned.push(o):Zr.tOwned=[o]:Zr.owned?Zr.owned.push(o):Zr.owned=[o]),fy&&o.fn){var a=o.fn,_Yt=_sliced_to_array(Yt(void 0,{equals:!1}),2),s=_Yt[0],l=_Yt[1],c=fy.factory(a,l);po(function(){return c.dispose()});var d,u=!1,p=function(){return TWe(l).then(function(){d&&(d.dispose(),d=void 0,u||l())})};o.fn=function(m){return s(),rt&&rt.running?(d||(d=fy.factory(a,p)),d.track(m)):(u=!0,c.track(m))}}return o}function xw(e){var t=rt&&rt.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===hw)return IC(e);if(e.suspense&&Pa(e.suspense.inFallback))return e.suspense.effects.push(e);var r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<RC);){if(t&&rt.disposed.has(e))return;(t?e.tState:e.state)&&r.push(e)}for(var n=r.length-1;n>=0;n--){if(e=r[n],t){var i=e,o=r[n+1];for(;(i=i.owner)&&i!==o;)if(rt.disposed.has(i))return}if((t?e.tState:e.state)===ql)gy(e);else if((t?e.tState:e.state)===hw){var i10=Io;Io=null,rl(function(){return IC(e,r[0])},!1),Io=i10}}}function rl(e,t){if(Io)return e();var r=!1;t||(Io=[]),es?r=!0:es=[],RC++;try{var _$n=e();return IWe(r),_$n}catch(n){r||(es=null),Io=null,DC(n)}}function IWe(e){if(Io&&(hy&&rt&&rt.running?PWe(Io):Hne(Io),Io=null),e)return;var t;if(rt){if(!rt.promises.size&&!rt.queue.size){var n=rt.sources,i=rt.disposed;es.push.apply(es,rt.effects),t=rt.resolve;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=es[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;"tState"in o&&(o.state=o.tState),delete o.tState}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}rt=null,rl(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;Rm(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=n[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o10=_step1.value;if(o10.value=o10.tValue,o10.owned)for(var a=0,s=o10.owned.length;a<s;a++)Rm(o10.owned[a]);o10.tOwned&&(o10.owned=o10.tOwned),delete o10.tValue,delete o10.tOwned,o10.tState=0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}Nne(!1)},!1)}else if(rt.running){rt.running=!1,rt.effects.push.apply(rt.effects,es),es=null,Nne(!0);return}}var r=es;es=null,r.length&&rl(function(){return zne(r)},!1),t&&t()}function Hne(e){for(var t=0;t<e.length;t++)xw(e[t])}function PWe(e){var _loop=function(t){var r=e[t],n=rt.queue;n.has(r)||(n.add(r),hy(function(){n.delete(r),rl(function(){rt.running=!0,xw(r)},!1),rt&&(rt.running=!1)}))};for(var t=0;t<e.length;t++)_loop(t)}function RWe(e){var t,r=0;for(t=0;t<e.length;t++){var n=e[t];n.user?e[r++]=n:xw(n)}if(Tn.context){if(Tn.count){var _Tn_effects;Tn.effects||(Tn.effects=[]),(_Tn_effects=Tn.effects).push.apply(_Tn_effects,_to_consumable_array(e.slice(0,r)));return}SN()}for(Tn.effects&&(Tn.done||!Tn.count)&&(e=_to_consumable_array(Tn.effects).concat(_to_consumable_array(e)),r+=Tn.effects.length,delete Tn.effects),t=0;t<r;t++)xw(e[t])}function IC(e,t){var r=rt&&rt.running;r?e.tState=0:e.state=0;for(var n=0;n<e.sources.length;n+=1){var i=e.sources[n];if(i.sources){var o=r?i.tState:i.state;o===ql?i!==t&&(!i.updatedAt||i.updatedAt<RC)&&xw(i):o===hw&&IC(i,t)}}}function Zne(e){var t=rt&&rt.running;for(var r=0;r<e.observers.length;r+=1){var n=e.observers[r];(t?!n.tState:!n.state)&&(t?n.tState=hw:n.state=hw,n.pure?Io.push(n):es.push(n),n.observers&&Zne(n))}}function Rm(e){var t;if(e.sources)for(;e.sources.length;){var r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){var o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Rm(e.tOwned[t]);delete e.tOwned}if(rt&&rt.running&&e.pure)Kne(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Rm(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}rt&&rt.running?e.tState=0:e.state=0}function Kne(e,t){if(t||(e.tState=0,rt.disposed.add(e)),e.owned)for(var r=0;r<e.owned.length;r++)Kne(e.owned[r])}function TC(e){return _instanceof(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Lne(e,t,r){try{var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _$n=_step.value;_$n(e)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}catch(n){DC(n,r&&r.owner||null)}}function DC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zr;var r=One&&t&&t.context&&t.context[One],n=TC(e);if(!r)throw n;es?es.push({fn:function fn1(){Lne(n,r,t)},state:ql}):Lne(n,r,t)}function kN(e){if(typeof e=="function"&&!e.length)return kN(e());if(Array.isArray(e)){var t=[];for(var r=0;r<e.length;r++){var n=kN(e[r]);if(Array.isArray(n))if(n.length<32768)t.push.apply(t,n);else for(var i=0;i<n.length;i++)t.push(n[i]);else t.push(n)}return t}return e}var MWe=Symbol("fallback");function Fne(e){for(var t=0;t<e.length;t++)e[t]()}function OWe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return po(function(){return Fne(o)}),function(){var p=function p(m){if(o[u]=m,s){var _Yt=_sliced_to_array(Yt(u),2),h=_Yt[0],g=_Yt[1];return s[u]=g,t(l[u],h)}return t(l[u])};var l=e()||[],c=l.length,d,u;return l[PC],Pa(function(){var m,h,g,x,v,y,_,b,w;if(c===0)a!==0&&(Fne(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[MWe],i[0]=my(function(S){return o[0]=S,r.fallback()}),a=1);else if(a===0){for(i=new Array(c),u=0;u<c;u++)n[u]=l[u],i[u]=my(p);a=c}else{for(g=new Array(c),x=new Array(c),s&&(v=new Array(c)),y=0,_=Math.min(a,c);y<_&&n[y]===l[y];y++);for(_=a-1,b=c-1;_>=y&&b>=y&&n[_]===l[b];_--,b--)g[b]=i[_],x[b]=o[_],s&&(v[b]=s[_]);for(m=new Map,h=new Array(b+1),u=b;u>=y;u--)w=l[u],d=m.get(w),h[u]=d===void 0?-1:d,m.set(w,u);for(d=y;d<=_;d++)w=n[d],u=m.get(w),u!==void 0&&u!==-1?(g[u]=i[d],x[u]=o[d],s&&(v[u]=s[d]),u=h[u],m.set(w,u)):o[d]();for(u=y;u<c;u++)u in g?(i[u]=g[u],o[u]=x[u],s&&(s[u]=v[u],s[u](u))):i[u]=my(p);i=i.slice(0,a=c),n=l.slice(0)}return i})}}var $We=!1;function Se(e,t){if($We&&Tn.context){var r=Tn.context;SN(SWe());var n=Pa(function(){return e(t||{})});return SN(r),n}return Pa(function(){return e(t||{})})}var Qne=function(e){return"Stale read from <".concat(e,">.")};function In(e){var t="fallback"in e&&{fallback:function(){return e.fallback}};return Bn(OWe(function(){return e.each},e.children,t||void 0))}function Ct(e){var t=e.keyed,r=Bn(function(){return e.when},void 0,void 0),n=t?r:Bn(r,void 0,{equals:function(i,o){return!i==!o}});return Bn(function(){var i=n();if(i){var o=e.children;return typeof o=="function"&&o.length>0?Pa(function(){return o(t?i:function(){if(!Pa(n))throw Qne("Show");return r()})}):o}return e.fallback},void 0,void 0)}function Vg(e){var t=AWe(function(){return e.children}),r=Bn(function(){var _loop=function(a){var s=a,l=i[a],c=o,d=Bn(function(){return c()?void 0:l.when},void 0,void 0),u=l.keyed?d:Bn(d,void 0,{equals:function(p,m){return!p==!m}});o=function(){return c()||(u()?[s,d,l]:void 0)}};var n=t(),i=Array.isArray(n)?n:[n],o=function(){};for(var a=0;a<i.length;a++)_loop(a);return o});return Bn(function(){var n=r()();if(!n)return e.fallback;var _n=_sliced_to_array(n,3),i=_n[0],o=_n[1],a=_n[2],s=a.children;return typeof s=="function"&&s.length>0?Pa(function(){return s(a.keyed?o():function(){var c;if(((c=Pa(r)())==null?void 0:c[0])!==i)throw Qne("Match");return o()})}):s},void 0,void 0)}function nl(e){return e}var NWe=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],lJt=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable"].concat(_to_consumable_array(NWe)));var Xne=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]);var Qn=function(e){return Bn(function(){return e()})};function DWe(e,t,r){var n=r.length,i=t.length,o=n,a=0,s=0,l=t[i-1].nextSibling,c=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){var d=o<n?s?r[s-1].nextSibling:r[o-s]:l;for(;s<o;)e.insertBefore(r[s++],d)}else if(o===s)for(;a<i;)(!c||!c.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){var d10=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],d10),t[i]=r[o]}else{if(!c){c=new Map;var u=s;for(;u<o;)c.set(r[u],u++)}var d11=c.get(t[a]);if(d11!=null)if(s<d11&&d11<o){var u10=a,p=1,m=void 0;for(;++u10<i&&u10<o&&!((m=c.get(t[u10]))==null||m!==d11+p);)p++;if(p>d11-s){var h=t[a];for(;s<d11;)e.insertBefore(r[s++],h)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Jne="_$DX_DELEGATE";function eie(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var i;return my(function(o){i=o,t===document?e():_e(t,e(),t.firstChild?null:void 0,r)},n.owner),function(){i(),t.textContent=""}}function je(e,t,r,n){var i,o=function(){var s=n?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,r?s.content.firstChild.firstChild:n?s.firstChild:s.content.firstChild},a=t?function(){return Pa(function(){return document.importNode(i||(i=o()),!0)})}:function(){return(i||(i=o())).cloneNode(!0)};return a.cloneNode=a,a}function Kr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window.document;var r=t[Jne]||(t[Jne]=new Set);for(var n=0,i=e.length;n<i;n++){var o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,LWe))}}function Dt(e,t,r){AN(e)||(r==null?e.removeAttribute(t):e.setAttribute(t,r))}function tn(e,t){AN(e)||(t==null?e.removeAttribute("class"):e.className=t)}function tie(e,t,r,n){if(n)Array.isArray(r)?(e["$$".concat(t)]=r[0],e["$$".concat(t,"Data")]=r[1]):e["$$".concat(t)]=r;else if(Array.isArray(r)){var i=r[0];e.addEventListener(t,r[0]=function(o){return i.call(e,r[1],o)})}else e.addEventListener(t,r,typeof r!="function"&&r)}function FC(e,t,r){if(!t)return r?Dt(e,"style"):t;var n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});var i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function TN(e,t,r){r!=null?e.style.setProperty(t,r):e.style.removeProperty(t)}function Wl(e,t,r){return Pa(function(){return e(t,r)})}function _e(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return LC(e,t,n,r);yt(function(i){return LC(e,t(),i,r)},n)}function AN(e){return!!Tn.context&&!Tn.done&&(!e||e.isConnected)}function LWe(e){if(Tn.registry&&Tn.events&&Tn.events.find(function(param){var _param=_sliced_to_array(param,2),l=_param[0],c=_param[1];return c===e}))return;var t=e.target,r="$$".concat(e.type),n=e.target,i=e.currentTarget,o=function(l){return Object.defineProperty(e,"target",{configurable:!0,value:l})},a=function(){var l=t[r];if(l&&!t.disabled){var c=t["".concat(r,"Data")];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},s=function(){for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:function get1(){return t||document}}),Tn.registry&&!Tn.done&&(Tn.done=_$HY.done=!0),e.composedPath){var l=e.composedPath();o(l[0]);for(var c=0;c<l.length-2&&(t=l[c],!!a());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();o(n)}function LC(e,t,r,n,i){var o=AN(e);if(o){!r&&(r=_to_consumable_array(e.childNodes));var l=[];for(var c=0;c<r.length;c++){var d=r[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}r=l}for(;typeof r=="function";)r=r();if(t===r)return r;var a=typeof t==="undefined"?"undefined":_type_of(t),s=n!==void 0;if(e=s&&r[0]&&r[0].parentNode||e,a==="string"||a==="number"){if(o||a==="number"&&(t=t.toString(),t===r))return r;if(s){var l10=r[0];l10&&l10.nodeType===3?l10.data!==t&&(l10.data=t):l10=document.createTextNode(t),r=xy(e,r,n,l10)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||a==="boolean"){if(o)return r;r=xy(e,r,n)}else{if(a==="function")return yt(function(){var l=t();for(;typeof l=="function";)l=l();r=LC(e,l,r,n)}),function(){return r};if(Array.isArray(t)){var l11=[],c10=r&&Array.isArray(r);if(EN(l11,t,r,i))return yt(function(){return r=LC(e,l11,r,n,!0)}),function(){return r};if(o){if(!l11.length)return r;if(n===void 0)return r=_to_consumable_array(e.childNodes);var d10=l11[0];if(d10.parentNode!==e)return r;var u=[d10];for(;(d10=d10.nextSibling)!==n;)u.push(d10);return r=u}if(l11.length===0){if(r=xy(e,r,n),s)return r}else c10?r.length===0?Yne(e,l11,n):DWe(e,r,l11):(r&&xy(e),Yne(e,l11));r=l11}else if(t.nodeType){if(o&&t.parentNode)return r=s?[t]:t;if(Array.isArray(r)){if(s)return r=xy(e,r,n,t);xy(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function EN(e,t,r,n){var i=!1;for(var o=0,a=t.length;o<a;o++){var s=t[o],l=r&&r[e.length],c=void 0;if(!(s==null||s===!0||s===!1))if((c=typeof s==="undefined"?"undefined":_type_of(s))=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=EN(e,s,l)||i;else if(c==="function")if(n){for(;typeof s=="function";)s=s();i=EN(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{var d=String(s);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return i}function Yne(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;for(var n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function xy(e,t,r,n){if(r===void 0)return e.textContent="";var i=n||document.createTextNode("");if(t.length){var o=!1;for(var a=t.length-1;a>=0;a--){var s=t[a];if(i!==s){var l=s.parentNode===e;!o&&!a?l?e.replaceChild(i,s):e.insertBefore(i,r):l&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}var uJt=Symbol();var FWe="http://www.w3.org/2000/svg";function zWe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return t?document.createElementNS(FWe,e):document.createElement(e,{is:r})}function Ld(e){var t=e.useShadow,r=document.createTextNode(""),n=function(){return e.mount||document.body},i=$C(),o,a=!!Tn.context;return ki(function(){a&&($C().user=a=!1),o||(o=CN(i,function(){return Bn(function(){return e.children})}));var s=n();if(_instanceof(s,HTMLHeadElement)){var _Yt=_sliced_to_array(Yt(!1),2),l=_Yt[0],c=_Yt[1],d=function(){return c(!0)};my(function(u){return _e(s,function(){return l()?u():o()},null)}),po(d)}else{var l10=zWe(e.isSVG?"g":"div",e.isSVG),c10=t&&l10.attachShadow?l10.attachShadow({mode:"open"}):l10;Object.defineProperty(l10,"_$host",{get:function get1(){return r.parentNode},configurable:!0}),_e(c10,o),s.appendChild(l10),e.ref&&e.ref(l10),po(function(){return s.contains(l10)&&s.removeChild(l10)})}},void 0,{render:!a}),r}var IN=Symbol("store-raw"),vy=Symbol("store-node"),Xp=Symbol("store-has"),nie=Symbol("store-self");function iie(e){var t=e[Mm];if(!t&&(Object.defineProperty(e,Mm,{value:t=new Proxy(e,BWe)}),!Array.isArray(e))){var r=Object.keys(e),n=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),o=i!==null&&e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)&&i!==Object.prototype;if(o){var _r1;var a=Object.getOwnPropertyDescriptors(i);(_r1=r).push.apply(_r1,_to_consumable_array(Object.keys(a))),Object.assign(n,a)}for(var a9=0,s=r.length;a9<s;a9++){var l=r[a9];o&&l==="constructor"||n[l].get&&Object.defineProperty(e,l,{configurable:!0,enumerable:n[l].enumerable,get:n[l].get.bind(t)})}}return t}function Om(e){var t;return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&(e[Mm]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function _y(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;var r,n,i,o;if(r=e!=null&&e[IN])return r;if(!Om(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(var a=0,s=e.length;a<s;a++)i=e[a],(n=_y(i,t))!==i&&(e[a]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);var a9=Object.keys(e),s10=Object.getOwnPropertyDescriptors(e);for(var l=0,c=a9.length;l<c;l++)o=a9[l],!s10[o].get&&(i=e[o],(n=_y(i,t))!==i&&(e[o]=n))}return e}function zC(e,t){var r=e[t];return r||Object.defineProperty(e,t,{value:r=Object.create(null)}),r}function vw(e,t,r){if(e[t])return e[t];var _Yt=_sliced_to_array(Yt(r,{equals:!1,internal:!0}),2),n=_Yt[0],i=_Yt[1];return n.$=i,e[t]=n}function jWe(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);return!r||r.get||!r.configurable||t===Mm||t===vy||(delete r.value,delete r.writable,r.get=function(){return e[Mm][t]}),r}function oie(e){OC()&&vw(zC(e,vy),nie)()}function UWe(e){return oie(e),Reflect.ownKeys(e)}var BWe={get:function get1(e,t,r){if(t===IN)return e;if(t===Mm)return r;if(t===PC)return oie(e),r;var n=zC(e,vy),i=n[t],o=i?i():e[t];if(t===vy||t===Xp||t==="__proto__")return o;if(!i){var a=Object.getOwnPropertyDescriptor(e,t);OC()&&(typeof o!="function"||Object.prototype.hasOwnProperty.call(e,t))&&!(a&&a.get)&&(o=vw(n,t,o)())}return Om(o)?iie(o):o},has:function has(e,t){return t===IN||t===Mm||t===PC||t===vy||t===Xp||t==="__proto__"?!0:(OC()&&vw(zC(e,Xp),t)(),t in e)},set:function set1(){return!0},deleteProperty:function deleteProperty(){return!0},ownKeys:UWe,getOwnPropertyDescriptor:jWe};function $u(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t==="__proto__"||!n&&e[t]===r)return;var i=e[t],o=e.length;r===void 0?(delete e[t],e[Xp]&&e[Xp][t]&&i!==void 0&&e[Xp][t].$()):(e[t]=r,e[Xp]&&e[Xp][t]&&i===void 0&&e[Xp][t].$());var a=zC(e,vy),s;if((s=vw(a,t,i))&&s.$(function(){return r}),Array.isArray(e)&&e.length!==o){for(var l=e.length;l<o;l++)(s=a[l])&&s.$();(s=vw(a,"length",o))&&s.$(e.length)}(s=a[nie])&&s.$()}function aie(e,t){var r=Object.keys(t);for(var n=0;n<r.length;n+=1){var i=r[n];sie(i)||$u(e,i,t[i])}}function sie(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function qWe(e,t){if(typeof t=="function"&&(t=t(e)),t=_y(t),Array.isArray(t)){if(e===t)return;var r=0,n=t.length;for(;r<n;r++){var i=t[r];e[r]!==i&&$u(e,r,i)}$u(e,"length",n)}else aie(e,t)}function yw(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];var n,i=e;if(t.length>1){n=t.shift();var a=typeof n==="undefined"?"undefined":_type_of(n),s=Array.isArray(e);if(a==="string"&&(n==="__proto__"||t.length>1&&sie(n)))return;if(Array.isArray(n)){for(var l=0;l<n.length;l++)yw(e,[n[l]].concat(t),r);return}else if(s&&a==="function"){for(var l10=0;l10<e.length;l10++)n(e[l10],l10)&&yw(e,[l10].concat(t),r);return}else if(s&&a==="object"){var tmp=n.from,l11=tmp===void 0?0:tmp,tmp1=n.to,c=tmp1===void 0?e.length-1:tmp1,tmp2=n.by,d=tmp2===void 0?1:tmp2;for(var u=l11;u<=c;u+=d)yw(e,[u].concat(t),r);return}else if(t.length>1){yw(e[n],t,[n].concat(r));return}i=e[n],r=[n].concat(r)}var o=t[0];typeof o=="function"&&(o=o(i,r),o===i)||n===void 0&&o==null||(o=_y(o),n===void 0||Om(i)&&Om(o)&&!Array.isArray(o)?aie(i,o):$u(e,n,o))}function lie(){for(var _len=arguments.length,_tmp=new Array(_len),_key=0;_key<_len;_key++){_tmp[_key]=arguments[_key]}var _tmp1=_sliced_to_array(_tmp,2),e=_tmp1[0],t=_tmp1[1];var r=_y(e||{}),n=Array.isArray(r),i=iie(r);function o(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}Bne(function(){n&&a.length===1?qWe(r,a[0]):yw(r,a)})}return[i,o]}var PN=Symbol("store-root");function rie(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function yy(e,t,r,n,i){if(rie(r))return;var o=t[r];if(e===o)return;var a=Array.isArray(e);if(r!==PN&&(!Om(e)||!Om(o)||a!==Array.isArray(o)||i&&e[i]!==o[i])){$u(t,r,e);return}if(a){if(e.length&&o.length&&(!n||i&&e[0]&&e[0][i]!=null)){var c,d,u,p,m,h,g,x;for(u=0,p=Math.min(o.length,e.length);u<p&&(o[u]===e[u]||i&&o[u]&&e[u]&&o[u][i]&&o[u][i]===e[u][i]);u++)yy(e[u],o,u,n,i);var v=new Array(e.length),y=new Map;for(p=o.length-1,m=e.length-1;p>=u&&m>=u&&(o[p]===e[m]||i&&o[p]&&e[m]&&o[p][i]&&o[p][i]===e[m][i]);p--,m--)v[m]=o[p];if(u>m||u>p){for(d=u;d<=m;d++)$u(o,d,e[d]);for(;d<e.length;d++)$u(o,d,v[d]),yy(e[d],o,d,n,i);o.length>e.length&&$u(o,"length",e.length);return}for(g=new Array(m+1),d=m;d>=u;d--)h=e[d],x=i&&h?h[i]:h,c=y.get(x),g[d]=c===void 0?-1:c,y.set(x,d);for(c=u;c<=p;c++)h=o[c],x=i&&h?h[i]:h,d=y.get(x),d!==void 0&&d!==-1&&(v[d]=o[c],d=g[d],y.set(x,d));for(d=u;d<e.length;d++)d in v?($u(o,d,v[d]),yy(e[d],o,d,n,i)):$u(o,d,e[d])}else for(var c10=0,d10=e.length;c10<d10;c10++)yy(e[c10],o,c10,n,i);o.length>e.length&&$u(o,"length",e.length);return}var s=Object.keys(e);for(var c11=0,d11=s.length;c11<d11;c11++)rie(s[c11])||yy(e[s[c11]],o,s[c11],n,i);var l=Object.keys(o);for(var c12=0,d12=l.length;c12<d12;c12++)e[l[c12]]===void 0&&$u(o,l[c12],void 0)}function uie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=t.merge,tmp=t.key,n=tmp===void 0?"id":tmp,i=_y(e);return function(o){if(!Om(o)||!Om(i))return i;var a=yy(i,_define_property({},PN,o),PN,r,n);return a===void 0?o:a}}function by(e,t,r){var o;Kr(Array.from(Xne),(o=t.ownerDocument)!=null?o:document);var n,i=eie(function(){var _lie=_sliced_to_array(lie(r),2),a=_lie[0],s=_lie[1];return n=function(l){return s(uie(l))},Se(e,a)},t);return{update:function(a){return n(a)},destroy:i}}var Hme=require("obsidian");function jC(e){var t,r;return e?typeof e.totalTokens=="number"&&e.totalTokens>0?e.totalTokens:Math.max(0,((t=e.inputTokens)!=null?t:0)+((r=e.outputTokens)!=null?r:0)):0}function Yo(e){return e.subagents.master}function WWe(e){return Yo(e).timeline}function cie(e){return Object.values(e.subagents).flatMap(function(t){return[t].concat(_to_consumable_array(cie(t)))})}function Fd(e){return cie(Yo(e)).sort(function(t,r){return r.createdAt-t.createdAt})}function UC(e){var r;var t=WWe(e);for(var n=t.length-1;n>=0;n-=1){var i=(r=t[n])==null?void 0:r.parts.find(function(o){return o.type==="data-todos"});if((i==null?void 0:i.type)==="data-todos")return i.data.items.map(function(o){return _object_spread({},o)})}return[]}function Vl(e){return e.status==="completed"||e.status==="failed"||e.status==="cancelled"}function die(e){var r,n;var t=(r=e==null?void 0:e.getBoundingClientRect().width)!=null?r:0;return t>0?t:(n=e==null?void 0:e.clientWidth)!=null?n:0}function pie(e){var n,i;var t=(n=e==null?void 0:e.ownerDocument)!=null?n:document,r=die(e);return e!=null&&e.isConnected&&r>=486?{mountEl:e,contained:!0,hostEl:e}:{mountEl:(i=t.body)!=null?i:document.body,contained:!1,hostEl:e!=null&&e.isConnected?e:void 0}}function zd(e,t){var u,p,m,h,g;if(!t)return;var r=e,n=r.containerEl;if(!n)return;var i=r.modalEl,o=n.classList.contains("mod-dim"),a=(u=t.hostEl)!=null?u:t.contained?t.mountEl:void 0,s=(m=(p=a==null?void 0:a.ownerDocument)==null?void 0:p.body)!=null?m:t.mountEl,l=function(){var x=!!(a!=null&&a.isConnected)&&die(a)>=486,v=x?a:s;v!=null&&v.isConnected&&n.parentElement!==v&&v.appendChild(n),n.classList.toggle("ns-chatbox-contained-modal-container",x),o&&n.classList.toggle("mod-dim",!x),i==null||i.classList.toggle("ns-chatbox-contained-modal",x)};if(l(),!a)return;var c=(g=(h=a.ownerDocument)==null?void 0:h.defaultView)==null?void 0:g.ResizeObserver;if(!c)return;var d=new c(l);return d.observe(a),function(){d.disconnect(),o&&n.classList.add("mod-dim")}}var fie=function(e){return e!=null&&(e=Object.getPrototypeOf(e),e===Array.prototype||e===Object.prototype)};function mie(e,t,r){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];var o="".concat(r,".").concat(n);e[o]=i,fie(i)&&mie(e,i,o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function hie(e){var t=_object_spread({},e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];fie(n)&&mie(t,n,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var gie=function(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t)try{for(var _iterator=Object.entries(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];e=e.replace(new RegExp("{{\\s*".concat(r,"\\s*}}"),"g"),n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},VWe=function(e){return e};function xie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:VWe;return function(r){for(var _len=arguments.length,n=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){n[_key-1]=arguments[_key]}var o;r[0]==="."&&(r=r.slice(1));var i=(o=e())==null?void 0:o[r];switch(typeof i==="undefined"?"undefined":_type_of(i)){case"function":return i.apply(void 0,_to_consumable_array(n));case"string":return t(i,n[0]);default:return i}}}var HWe={en:q7,zh:W7};function ZWe(e){switch(e.split("-")[0].toLowerCase()){case"zh":return"zh";default:return"en"}}var KWe=hie(HWe[ZWe(typeof navigator=="undefined"?"en":navigator.language)]),Te=xie(function(){return KWe},gie);var yie=je("<button type=button>"),QWe=je('<div><div class="ns-qh7xmq"><div class="ns-yxsdt0"></div><div class="ns-4pl3cu"></div><div><button type=button>');function wy(e){var t=function(){return e.actionsLayout==="vertical"?"ns-x2055v":"ns-jvvln7"},r=function(){return function(){var i=yie();return i.$$click=function(){return e.onCancel()},_e(i,function(){return Te("chatbox.ui.actions.cancel")}),yt(function(){return tn(i,e.actionsLayout==="vertical"?"ns-gzz0fc":void 0)}),i}()},n=function(i){return"".concat(e.actionsLayout==="vertical"?"ns-gzz0fc":""," ").concat(i!=null?i:"").trim()};return Se(Ld,{get mount(){return e.mountEl},get children(){var i=QWe(),o=i.firstChild,a=o.firstChild,s=a.nextSibling,l=s.nextSibling,c=l.firstChild;return _e(a,function(){return e.title}),_e(s,function(){return e.message}),_e(l,Se(Ct,{get when(){return e.cancelPlacement!=="end"},get children(){return r()}}),c),_e(l,Se(Ct,{get when(){return e.secondaryConfirmLabel},get children(){var d=yie();return d.$$click=function(){var u;return(u=e.onSecondaryConfirm)==null?void 0:u.call(e)},_e(d,function(){return e.secondaryConfirmLabel}),yt(function(){return tn(d,n(e.secondaryConfirmClass))}),d}}),c),c.$$click=function(){return e.onConfirm()},_e(c,function(){return e.confirmLabel}),_e(l,Se(Ct,{get when(){return e.cancelPlacement==="end"},get children(){return r()}}),null),yt(function(d){var u=["ns-vcyfp0",e.contained?"ns-3u29x8":"ns-dxjyt5"].join(" "),p=t(),m=n(e.confirmClass);return u!==d.e&&tn(i,d.e=u),p!==d.t&&tn(l,d.t=p),m!==d.a&&tn(c,d.a=m),d},{e:void 0,t:void 0,a:void 0}),i}})}Kr(["click"]);var JWe=je("<span>"),YWe=je('<button class="ns-kb0p7x"type=button><span class="ns-vp6p3h">'),XWe=je('<div class="ns-uobx8p">'),eVe=je('<div class="ns-wz60nv"><span class="ns-idm853">');function vie(e){var t;return(t=e.split("/").pop())!=null?t:e}function tVe(e){var t=e.split(".");return t.length<2?"":t[t.length-1].toLowerCase()}var rVe=new Set(["md","markdown"]),nVe=new Set(["txt","text","log"]),iVe=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif","tiff"]),oVe=new Set(["js","ts","jsx","tsx","json","css","scss","html","xml","yaml","yml","toml","py","go","rs","java","c","cpp","h","sh","rb","php","vue","svelte"]),aVe=new Set(["csv","tsv","db","sqlite"]),sVe=new Set(["zip","tar","gz","rar","7z"]),lVe=new Set(["mp3","wav","ogg","flac","m4a","aac"]),uVe=new Set(["mp4","mkv","mov","avi","webm"]);function _ie(e){var t=tVe(e);return rVe.has(t)||nVe.has(t)?"ns-xlw7vw":iVe.has(t)?"ns-7g7w68":oVe.has(t)?"ns-hwflpe":aVe.has(t)?"ns-0abs3j":sVe.has(t)?"ns-a1us1v":lVe.has(t)?"ns-x7m6xj":uVe.has(t)?"ns-takyqu":t==="pdf"?"ns-xlw7vw":t==="canvas"?"ns-na69kd":"ns-vpmz3o"}function cVe(e){return e.type==="vault-path"?e.kind==="folder"?"ns-7fjsre":_ie(e.path):e.type==="selection"?"ns-dj661w":e.type==="image"?"ns-hx7o2f":e.type==="pending-context"?"ns-s9n11w":e.type==="file"?_ie(e.filename):"ns-vpmz3o"}function dVe(e){return function(){var t=JWe();return yt(function(){return tn(t,["ns-9y0ynp",cVe(e.item),e.item.type==="pending-context"?"ns-steumz":""].join(" "))}),t}()}function pVe(e){return function(){var t=YWe();return t.$$click=function(r){r.stopPropagation(),e.onClick()},yt(function(){return Dt(t,"title",Te("chatbox.ui.actions.removeContextItem"))}),t}()}function Gg(e){return Se(Ct,{get when(){return e.items.length>0},get children(){var t=XWe();return _e(t,Se(In,{get each(){return e.items},children:function(r,n){return function(){var i=eVe(),o=i.firstChild;return _e(i,Se(dVe,{item:r}),o),_e(o,function(){var a=Qn(function(){return r.type==="vault-path"});return function(){return a()&&vie(r.path)}}(),null),_e(o,function(){var a=Qn(function(){return r.type==="file"});return function(){return a()&&r.filename}}(),null),_e(o,function(){var a=Qn(function(){return r.type==="image"});return function(){return a()&&(r.name||"".concat(r.mimeType.split("/")[1]||"image"," ").concat(Math.max(1,Math.round(r.size/1024)),"KB"))}}(),null),_e(o,function(){var a=Qn(function(){return r.type==="pending-context"});return function(){return a()&&(r.placeholder||Te("chatbox.ui.states.loadingContextItem"))}}(),null),_e(o,function(){var a=Qn(function(){return r.type==="selection"});return function(){return a()&&"".concat(vie(r.filePath)," L").concat(r.range.from.line+1,":").concat(r.range.from.ch+1,"-L").concat(r.range.to.line+1,":").concat(r.range.to.ch+1)}}(),null),_e(i,Se(Ct,{get when(){return e.onRemove},get children(){return Se(pVe,{onClick:function(){return e.onRemove(n())}})}}),null),yt(function(){return Dt(i,"title",r.type==="selection"?r.selectedText:r.type==="file"?"".concat(r.filename," ").concat(Math.max(1,Math.round(r.size/1024)),"KB"):r.type==="image"?r.name||"".concat(r.mimeType," ").concat(Math.round(r.size/1024),"KB"):r.type==="pending-context"?r.placeholder||Te("chatbox.ui.states.loadingContextItem"):r.path)}),i}()}})),t}})}Kr(["click"]);var fVe=je("<title>"),mVe=je('<svg class="ns-9y0ynp context-ring"role=img><circle fill=none stroke="var(--background-modifier-border, rgba(125,125,125,0.35))"></circle><circle fill=none stroke-linecap=round>');function hVe(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}function gVe(e){return e>=.8?"var(--text-error, #e53935)":e>=.5?"var(--text-warning, #f0ad4e)":"var(--text-success, #4caf50)"}function bie(e){var t=Bn(function(){return!e.total||e.total<=0?0:hVe(e.used/e.total)}),r=Bn(function(){var c;return(c=e.size)!=null?c:18}),n=Bn(function(){var c;return(c=e.stroke)!=null?c:3}),i=Bn(function(){return(r()-n())/2}),o=Bn(function(){return 2*Math.PI*i()}),a=Bn(function(){return o()*(1-t())}),s=Bn(function(){return gVe(t())}),l=Bn(function(){return r()/2});return function(){var c=mVe(),d=c.firstChild,u=d.nextSibling;return _e(c,Se(Ct,{get when(){return e.title},get children(){var p=fVe();return _e(p,function(){return e.title}),p}}),d),yt(function(p){var m=r(),h=r(),g="0 0 ".concat(r()," ").concat(r()),x=e.title,v=l(),y=l(),_=i(),b=n(),w=l(),S=l(),k=i(),E=s(),C=n(),T="".concat(o()," ").concat(o()),I=a(),O="rotate(-90 ".concat(l()," ").concat(l(),")");return m!==p.e&&Dt(c,"width",p.e=m),h!==p.t&&Dt(c,"height",p.t=h),g!==p.a&&Dt(c,"viewBox",p.a=g),x!==p.o&&Dt(c,"aria-label",p.o=x),v!==p.i&&Dt(d,"cx",p.i=v),y!==p.n&&Dt(d,"cy",p.n=y),_!==p.s&&Dt(d,"r",p.s=_),b!==p.h&&Dt(d,"stroke-width",p.h=b),w!==p.r&&Dt(u,"cx",p.r=w),S!==p.d&&Dt(u,"cy",p.d=S),k!==p.l&&Dt(u,"r",p.l=k),E!==p.u&&Dt(u,"stroke",p.u=E),C!==p.c&&Dt(u,"stroke-width",p.c=C),T!==p.w&&Dt(u,"stroke-dasharray",p.w=T),I!==p.m&&Dt(u,"stroke-dashoffset",p.m=I),O!==p.f&&Dt(u,"transform",p.f=O),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),c}()}var xVe=je('<button class="ns-pte5qj"type=button><span class="ns-luhjda">'),yVe=je('<div><div class="ns-qh7xmq"><div class="ns-brd5lx"><div class="ns-yxsdt0"></div><button class="ns-c1sspd"type=button></button></div><div class="ns-yfy5mq">'),vVe=je('<label class="ns-est0ib"><input type=checkbox><span class="ns-bikxl1"></span><span class="ns-r3g875">');function wie(e){var _Yt=_sliced_to_array(Yt(!1),2),t=_Yt[0],r=_Yt[1];return Se(Ct,{get when(){return e.servers.length>0},get children(){return[function(){var n=xVe();return n.$$click=function(){return r(!0)},yt(function(i){var o=Te("chatbox.ui.mcp.button"),a=Te("chatbox.ui.mcp.button");return o!==i.e&&Dt(n,"title",i.e=o),a!==i.t&&Dt(n,"aria-label",i.t=a),i},{e:void 0,t:void 0}),n}(),Se(Ct,{get when(){return t()},get children(){return Se(Ld,{get mount(){return e.mountEl},get children(){var n=yVe(),i=n.firstChild,o=i.firstChild,a=o.firstChild,s=a.nextSibling,l=o.nextSibling;return n.$$pointerdown=function(c){c.target===c.currentTarget&&r(!1)},_e(a,function(){return Te("chatbox.ui.mcp.title")}),s.$$click=function(){return r(!1)},_e(s,function(){return Te("chatbox.ui.actions.close")}),_e(l,Se(In,{get each(){return e.servers},children:function(c){return function(){var d=vVe(),u=d.firstChild,p=u.nextSibling,m=p.nextSibling;return u.addEventListener("change",function(){var h;return(h=e.onToggle)==null?void 0:h.call(e,c.name)}),_e(p,function(){return c.name}),_e(m,function(){var h=Qn(function(){return!!c.connected});return function(){return h()?Te("chatbox.ui.mcp.toolCount",{count:c.toolCount}):Te("chatbox.ui.mcp.notConnected")}}()),yt(function(){return u.checked=!c.disabled}),d}()}})),yt(function(){return tn(n,["ns-g81v24",e.contained?"ns-3u29x8":"ns-dxjyt5"].join(" "))}),n}})}})]}})}Kr(["click","pointerdown"]);function Hg(e){var t=Math.max(0,Math.round(e));if(t<1e3)return"".concat(t,"ms");var r=Math.floor(t/1e3);if(r<60)return"".concat(r,"s");var n=Math.floor(r/60),i=r%60;if(n<60)return"".concat(n,"m ").concat(String(i).padStart(2,"0"),"s");var o=Math.floor(n/60),a=n%60;return"".concat(o,"h ").concat(String(a).padStart(2,"0"),"m")}function _Ve(e){var t=new Date(e),r=function(n){return String(n).padStart(2,"0")};return"".concat(r(t.getMonth()+1),"/").concat(r(t.getDate())," ").concat(r(t.getHours()),":").concat(r(t.getMinutes()))}function BC(e){try{if(typeof Intl!="undefined"&&typeof Intl.DateTimeFormat=="function")return new Intl.DateTimeFormat(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}catch(t){}return _Ve(e)}function Sie(e,t){return e.key==="Enter"&&!e.shiftKey&&!t&&!e.isComposing&&e.keyCode!==229}function kie(e,t,r){if(typeof e!="number"&&typeof t!="number"&&typeof r!="number")return"";var n=[];return typeof r=="number"&&n.push("Tokens: ".concat(r)),typeof e=="number"&&n.push("↑".concat(e)),typeof t=="number"&&n.push("↓".concat(t)),n.join(" ")}function Sy(e){var t;return e.state==="output-error"?e.errorText:e.state!=="output-available"?"":typeof e.output=="string"?e.output:(t=JSON.stringify(e.output,null,2))!=null?t:String(e.output)}function MN(e){var t=e.input;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&!Array.isArray(t)){var r=t.purpose;if(typeof r=="string"&&r.trim()!=="")return r.trim()}}function ON(e){var t;return(t=MN(e))!=null?t:e.toolName}function RN(e,t){var _Math;var r=(_Math=Math).max.apply(_Math,[0].concat(_to_consumable_array(Array.from(t.matchAll(/`+/g),function(i){return i[0].length})))),n="`".repeat(Math.max(3,r+1));return"".concat(n).concat(e,"\n").concat(t,"\n").concat(n)}function Cie(e){try{return JSON.stringify(e!=null?e:{},null,2)}catch(t){return _instanceof(e,Error)?e.message:"[Unserializable value]"}}function qC(e,t){var r=[];e!==void 0&&(r.push("".concat(Te("chatbox.ui.labels.params"),":"),""),r.push(RN("json",Cie(e))));var n=t==null?void 0:t.trim();return n&&r.push("","".concat(Te("chatbox.ui.labels.result"),":"),"",RN("text",n)),r.join("\n")}function WC(e){return RN("json",Cie(e))}function Eie(e){switch(e){case"thinking":return Te("chatbox.ui.states.thinking");case"compressing":return Te("chatbox.ui.states.compressing");case"waiting_for_tools":return Te("chatbox.ui.states.processingTools");default:return""}}var noe="vercel.ai.error",bVe=Symbol.for(noe),Tie,Aie,Ze=/*#__PURE__*/function(_superClass){"use strict";_inherits(ioe,_superClass);function ioe(param){var t=param.name,r=param.message,n=param.cause;_class_call_check(this,ioe);var _this;_this=_call_super(this,ioe,[r]),_this[Tie]=!0,_this.name=t,_this.cause=n;return _this}_create_class(ioe,null,[{key:"isInstance",value:function isInstance(t){return ioe.hasMarker(t,noe)}},{key:"hasMarker",value:function hasMarker(t,r){var n=Symbol.for(r);return t!=null&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}}]);return ioe}((Aie=Error,Tie=bVe,Aie)),ooe="AI_APICallError",aoe="vercel.ai.error.".concat(ooe),wVe=Symbol.for(aoe),Iie,Pie,Rr=/*#__PURE__*/function(_superClass){"use strict";_inherits(Rr1,_superClass);function Rr1(param){var e=param.message,t=param.url,r=param.requestBodyValues,n=param.statusCode,i=param.responseHeaders,o=param.responseBody,a=param.cause,tmp=param.isRetryable,s=tmp===void 0?n!=null&&(n===408||n===409||n===429||n>=500):tmp,l=param.data;_class_call_check(this,Rr1);var _this;_this=_call_super(this,Rr1,[{name:ooe,message:e,cause:a}]),_this[Iie]=!0,_this.url=t,_this.requestBodyValues=r,_this.statusCode=n,_this.responseHeaders=i,_this.responseBody=o,_this.isRetryable=s,_this.data=l;return _this}_create_class(Rr1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,aoe)}}]);return Rr1}((Pie=Ze,Iie=wVe,Pie)),soe="AI_EmptyResponseBodyError",loe="vercel.ai.error.".concat(soe),SVe=Symbol.for(loe),Rie,Mie,NN=/*#__PURE__*/function(_superClass){"use strict";_inherits(NN1,_superClass);function NN1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Empty response body":tmp;_class_call_check(this,NN1);var _this;_this=_call_super(this,NN1,[{name:soe,message:e}]),_this[Rie]=!0;return _this}_create_class(NN1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,loe)}}]);return NN1}((Mie=Ze,Rie=SVe,Mie));function xa(e){return e==null?"unknown error":typeof e=="string"?e:_instanceof(e,Error)?e.toString():JSON.stringify(e)}var uoe="AI_InvalidArgumentError",coe="vercel.ai.error.".concat(uoe),kVe=Symbol.for(coe),Oie,$ie,il=/*#__PURE__*/function(_superClass){"use strict";_inherits(il1,_superClass);function il1(param){var e=param.message,t=param.cause,r=param.argument;_class_call_check(this,il1);var _this;_this=_call_super(this,il1,[{name:uoe,message:e,cause:t}]),_this[Oie]=!0,_this.argument=r;return _this}_create_class(il1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,coe)}}]);return il1}(($ie=Ze,Oie=kVe,$ie)),doe="AI_InvalidPromptError",poe="vercel.ai.error.".concat(doe),CVe=Symbol.for(poe),Nie,Die,Gl=/*#__PURE__*/function(_superClass){"use strict";_inherits(Gl1,_superClass);function Gl1(param){var e=param.prompt,t=param.message,r=param.cause;_class_call_check(this,Gl1);var _this;_this=_call_super(this,Gl1,[{name:doe,message:"Invalid prompt: ".concat(t),cause:r}]),_this[Nie]=!0,_this.prompt=e;return _this}_create_class(Gl1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,poe)}}]);return Gl1}((Die=Ze,Nie=CVe,Die)),foe="AI_InvalidResponseDataError",moe="vercel.ai.error.".concat(foe),EVe=Symbol.for(moe),Lie,Fie,ky=/*#__PURE__*/function(_superClass){"use strict";_inherits(ky1,_superClass);function ky1(param){var e=param.data,tmp=param.message,t=tmp===void 0?"Invalid response data: ".concat(JSON.stringify(e),"."):tmp;_class_call_check(this,ky1);var _this;_this=_call_super(this,ky1,[{name:foe,message:t}]),_this[Lie]=!0,_this.data=e;return _this}_create_class(ky1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,moe)}}]);return ky1}((Fie=Ze,Lie=EVe,Fie)),hoe="AI_JSONParseError",goe="vercel.ai.error.".concat(hoe),TVe=Symbol.for(goe),zie,jie,Cy=/*#__PURE__*/function(_superClass){"use strict";_inherits(Cy1,_superClass);function Cy1(param){var e=param.text,t=param.cause;_class_call_check(this,Cy1);var _this;_this=_call_super(this,Cy1,[{name:hoe,message:"JSON parsing failed: Text: ".concat(e,".\nError message: ").concat(xa(t)),cause:t}]),_this[zie]=!0,_this.text=e;return _this}_create_class(Cy1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,goe)}}]);return Cy1}((jie=Ze,zie=TVe,jie)),xoe="AI_LoadAPIKeyError",yoe="vercel.ai.error.".concat(xoe),AVe=Symbol.for(yoe),Uie,Bie,Ey=/*#__PURE__*/function(_superClass){"use strict";_inherits(Ey1,_superClass);function Ey1(param){var e=param.message;_class_call_check(this,Ey1);var _this;_this=_call_super(this,Ey1,[{name:xoe,message:e}]),_this[Uie]=!0;return _this}_create_class(Ey1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,yoe)}}]);return Ey1}((Bie=Ze,Uie=AVe,Bie)),voe="AI_LoadSettingError",_oe="vercel.ai.error.".concat(voe),IVe=Symbol.for(_oe),qie,Wie,PVe=/*#__PURE__*/function(_superClass){"use strict";_inherits(PVe1,_superClass);function PVe1(param){var e=param.message;_class_call_check(this,PVe1);var _this;_this=_call_super(this,PVe1,[{name:voe,message:e}]),_this[qie]=!0;return _this}_create_class(PVe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,_oe)}}]);return PVe1}((Wie=Ze,qie=IVe,Wie)),boe="AI_NoContentGeneratedError",woe="vercel.ai.error.".concat(boe),RVe=Symbol.for(woe),Vie,Gie,MVe=/*#__PURE__*/function(_superClass){"use strict";_inherits(MVe1,_superClass);function MVe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"No content generated.":tmp;_class_call_check(this,MVe1);var _this;_this=_call_super(this,MVe1,[{name:boe,message:e}]),_this[Vie]=!0;return _this}_create_class(MVe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,woe)}}]);return MVe1}((Gie=Ze,Vie=RVe,Gie)),Soe="AI_NoSuchModelError",koe="vercel.ai.error.".concat(Soe),OVe=Symbol.for(koe),Hie,Zie,VC=/*#__PURE__*/function(_superClass){"use strict";_inherits(VC1,_superClass);function VC1(param){var tmp=param.errorName,e=tmp===void 0?Soe:tmp,t=param.modelId,r=param.modelType,tmp1=param.message,n=tmp1===void 0?"No such ".concat(r,": ").concat(t):tmp1;_class_call_check(this,VC1);var _this;_this=_call_super(this,VC1,[{name:e,message:n}]),_this[Hie]=!0,_this.modelId=t,_this.modelType=r;return _this}_create_class(VC1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,koe)}}]);return VC1}((Zie=Ze,Hie=OVe,Zie)),Coe="AI_NoSuchProviderReferenceError",Eoe="vercel.ai.error.".concat(Coe),$Ve=Symbol.for(Eoe),Kie,Qie,DN=/*#__PURE__*/function(_superClass){"use strict";_inherits(DN1,_superClass);function DN1(param){var e=param.provider,t=param.reference,tmp=param.message,r=tmp===void 0?"No provider reference found for provider '".concat(e,"'. Available providers: ").concat(Object.keys(t).join(", ")):tmp;_class_call_check(this,DN1);var _this;_this=_call_super(this,DN1,[{name:Coe,message:r}]),_this[Kie]=!0,_this.provider=e,_this.reference=t;return _this}_create_class(DN1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Eoe)}}]);return DN1}((Qie=Ze,Kie=$Ve,Qie)),Toe="AI_TooManyEmbeddingValuesForCallError",Aoe="vercel.ai.error.".concat(Toe),NVe=Symbol.for(Aoe),Jie,Yie,Zg=/*#__PURE__*/function(_superClass){"use strict";_inherits(Zg1,_superClass);function Zg1(e){_class_call_check(this,Zg1);var _this;_this=_call_super(this,Zg1,[{name:Toe,message:"Too many values for a single embedding call. The ".concat(e.provider,' model "').concat(e.modelId,'" can only embed up to ').concat(e.maxEmbeddingsPerCall," values per call, but ").concat(e.values.length," values were provided.")}]),_this[Jie]=!0,_this.provider=e.provider,_this.modelId=e.modelId,_this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,_this.values=e.values;return _this}_create_class(Zg1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Aoe)}}]);return Zg1}((Yie=Ze,Jie=NVe,Yie)),Ioe="AI_TypeValidationError",Poe="vercel.ai.error.".concat(Ioe),DVe=Symbol.for(Poe),Xie,eoe,Nu=/*#__PURE__*/function(_superClass){"use strict";_inherits($N,_superClass);function $N(param){var t=param.value,r=param.cause,n=param.context;_class_call_check(this,$N);var _this;var i="Type validation failed";if(n!=null&&n.field&&(i+=" for ".concat(n.field)),n!=null&&n.entityName||n!=null&&n.entityId){i+=" (";var o=[];n.entityName&&o.push(n.entityName),n.entityId&&o.push('id: "'.concat(n.entityId,'"')),i+=o.join(", "),i+=")"}_this=_call_super(this,$N,[{name:Ioe,message:"".concat(i,": Value: ").concat(JSON.stringify(t),".\nError message: ").concat(xa(r)),cause:r}]),_this[Xie]=!0,_this.value=t,_this.context=n;return _this}_create_class($N,null,[{key:"isInstance",value:function isInstance(t){return Ze.hasMarker(t,Poe)}},{key:"wrap",value:function wrap(param){var t=param.value,r=param.cause,n=param.context;var i,o,a;return $N.isInstance(r)&&r.value===t&&((i=r.context)==null?void 0:i.field)===(n==null?void 0:n.field)&&((o=r.context)==null?void 0:o.entityName)===(n==null?void 0:n.entityName)&&((a=r.context)==null?void 0:a.entityId)===(n==null?void 0:n.entityId)?r:new $N({value:t,cause:r,context:n})}}]);return $N}((eoe=Ze,Xie=DVe,eoe)),Roe="AI_UnsupportedFunctionalityError",Moe="vercel.ai.error.".concat(Roe),LVe=Symbol.for(Moe),toe,roe,or=/*#__PURE__*/function(_superClass){"use strict";_inherits(or1,_superClass);function or1(param){var e=param.functionality,tmp=param.message,t=tmp===void 0?"'".concat(e,"' functionality not supported."):tmp;_class_call_check(this,or1);var _this;_this=_call_super(this,or1,[{name:Roe,message:t}]),_this[toe]=!0,_this.functionality=e;return _this}_create_class(or1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Moe)}}]);return or1}((roe=Ze,toe=LVe,roe));var f={};$l(f,{$brand:function(){return Ty},$input:function(){return B4},$output:function(){return U4},NEVER:function(){return Kg},TimePrecision:function(){return G4},ZodAny:function(){return aF},ZodArray:function(){return cF},ZodBase64:function(){return UE},ZodBase64URL:function(){return BE},ZodBigInt:function(){return b2},ZodBigIntFormat:function(){return VE},ZodBoolean:function(){return _2},ZodCIDRv4:function(){return zE},ZodCIDRv6:function(){return jE},ZodCUID:function(){return ME},ZodCUID2:function(){return OE},ZodCatch:function(){return PF},ZodCodec:function(){return YE},ZodCustom:function(){return z3},ZodCustomStringFormat:function(){return y2},ZodDate:function(){return $3},ZodDefault:function(){return kF},ZodDiscriminatedUnion:function(){return pF},ZodE164:function(){return qE},ZodEmail:function(){return AE},ZodEmoji:function(){return PE},ZodEnum:function(){return g2},ZodError:function(){return JHe},ZodExactOptional:function(){return bF},ZodFile:function(){return vF},ZodFirstPartyTypeKind:function(){return BF},ZodFunction:function(){return zF},ZodGUID:function(){return I3},ZodIPv4:function(){return LE},ZodIPv6:function(){return FE},ZodISODate:function(){return SE},ZodISODateTime:function(){return wE},ZodISODuration:function(){return CE},ZodISOTime:function(){return kE},ZodIntersection:function(){return fF},ZodIssueCode:function(){return qF},ZodJWT:function(){return WE},ZodKSUID:function(){return DE},ZodLazy:function(){return DF},ZodLiteral:function(){return yF},ZodMAC:function(){return rF},ZodMap:function(){return gF},ZodNaN:function(){return MF},ZodNanoID:function(){return RE},ZodNever:function(){return lF},ZodNonOptional:function(){return QE},ZodNull:function(){return oF},ZodNullable:function(){return SF},ZodNumber:function(){return v2},ZodNumberFormat:function(){return i0},ZodObject:function(){return N3},ZodOptional:function(){return KE},ZodPipe:function(){return JE},ZodPrefault:function(){return EF},ZodPromise:function(){return FF},ZodReadonly:function(){return OF},ZodRealError:function(){return sl},ZodRecord:function(){return F3},ZodSet:function(){return xF},ZodString:function(){return x2},ZodStringFormat:function(){return Jn},ZodSuccess:function(){return IF},ZodSymbol:function(){return nF},ZodTemplateLiteral:function(){return NF},ZodTransform:function(){return _F},ZodTuple:function(){return mF},ZodType:function(){return Or},ZodULID:function(){return $E},ZodURL:function(){return M3},ZodUUID:function(){return Wd},ZodUndefined:function(){return iF},ZodUnion:function(){return D3},ZodUnknown:function(){return sF},ZodVoid:function(){return uF},ZodXID:function(){return NE},ZodXor:function(){return dF},_ZodString:function(){return TE},_default:function(){return CF},_function:function(){return ile},any:function(){return GE},array:function(){return lt},base64:function(){return kse},base64url:function(){return Cse},bigint:function(){return Dse},boolean:function(){return jn},catch:function(){return RF},check:function(){return ole},cidrv4:function(){return wse},cidrv6:function(){return Sse},clone:function(){return Po},codec:function(){return tle},coerce:function(){return S2},config:function(){return Ri},core:function(){return ts},cuid:function(){return mse},cuid2:function(){return hse},custom:function(){return XE},date:function(){return Bse},decode:function(){return KL},decodeAsync:function(){return JL},describe:function(){return ale},discriminatedUnion:function(){return L3},e164:function(){return Ese},email:function(){return ose},emoji:function(){return pse},encode:function(){return ZL},encodeAsync:function(){return QL},endsWith:function(){return Hm},enum:function(){return Ra},exactOptional:function(){return wF},file:function(){return Jse},flattenError:function(){return Jg},float32:function(){return Mse},float64:function(){return Ose},formatError:function(){return Yg},fromJSONSchema:function(){return ple},function:function(){return ile},getErrorMap:function(){return eZe},globalRegistry:function(){return Xo},gt:function(){return Fu},gte:function(){return Mo},guid:function(){return ase},hash:function(){return Rse},hex:function(){return Pse},hostname:function(){return Ise},httpUrl:function(){return dse},includes:function(){return Vm},instanceof:function(){return lle},int:function(){return EE},int32:function(){return $se},int64:function(){return Lse},intersection:function(){return w2},ipv4:function(){return vse},ipv6:function(){return bse},iso:function(){return lf},json:function(){return cle},jwt:function(){return Tse},keyof:function(){return qse},ksuid:function(){return yse},lazy:function(){return LF},length:function(){return af},literal:function(){return Lt},locales:function(){return jd},looseObject:function(){return fo},looseRecord:function(){return Hse},lowercase:function(){return qm},lt:function(){return Lu},lte:function(){return ya},mac:function(){return _se},map:function(){return Zse},maxLength:function(){return of},maxSize:function(){return Bd},meta:function(){return sle},mime:function(){return Zm},minLength:function(){return kc},minSize:function(){return zu},multipleOf:function(){return Ud},nan:function(){return ele},nanoid:function(){return fse},nativeEnum:function(){return Qse},negative:function(){return c2},never:function(){return HE},nonnegative:function(){return p2},nonoptional:function(){return AF},nonpositive:function(){return d2},normalize:function(){return Km},null:function(){return O3},nullable:function(){return P3},nullish:function(){return Yse},number:function(){return un},object:function(){return mt},optional:function(){return oi},overwrite:function(){return Zl},parse:function(){return VL},parseAsync:function(){return GL},partialRecord:function(){return Gse},pipe:function(){return R3},positive:function(){return u2},prefault:function(){return TF},preprocess:function(){return j3},prettifyError:function(){return Iw},promise:function(){return nle},property:function(){return f2},readonly:function(){return $F},record:function(){return Wn},refine:function(){return jF},regex:function(){return qd},regexes:function(){return Ro},registry:function(){return By},safeDecode:function(){return XL},safeDecodeAsync:function(){return tF},safeEncode:function(){return YL},safeEncodeAsync:function(){return eF},safeParse:function(){return HL},safeParseAsync:function(){return A3},set:function(){return Kse},setErrorMap:function(){return XHe},size:function(){return nf},slugify:function(){return m2},startsWith:function(){return Gm},strictObject:function(){return Wse},string:function(){return ce},stringFormat:function(){return Ase},stringbool:function(){return ule},success:function(){return Xse},superRefine:function(){return UF},symbol:function(){return zse},templateLiteral:function(){return rle},toJSONSchema:function(){return sf},toLowerCase:function(){return Jm},toUpperCase:function(){return Ym},transform:function(){return ZE},treeifyError:function(){return Aw},trim:function(){return Qm},tuple:function(){return hF},uint32:function(){return Nse},uint64:function(){return Fse},ulid:function(){return gse},undefined:function(){return jse},union:function(){return Xn},unknown:function(){return Yn},uppercase:function(){return Wm},url:function(){return IE},util:function(){return He},uuid:function(){return sse},uuidv4:function(){return lse},uuidv6:function(){return use},uuidv7:function(){return cse},void:function(){return Use},xid:function(){return xse},xor:function(){return Vse}});var ts={};$l(ts,{$ZodAny:function(){return u4},$ZodArray:function(){return m4},$ZodAsyncError:function(){return Sc},$ZodBase64:function(){return Xw},$ZodBase64URL:function(){return e4},$ZodBigInt:function(){return Fy},$ZodBigIntFormat:function(){return o4},$ZodBoolean:function(){return e0},$ZodCIDRv4:function(){return Jw},$ZodCIDRv6:function(){return Yw},$ZodCUID:function(){return zw},$ZodCUID2:function(){return jw},$ZodCatch:function(){return R4},$ZodCheck:function(){return qn},$ZodCheckBigIntFormat:function(){return ND},$ZodCheckEndsWith:function(){return HD},$ZodCheckGreaterThan:function(){return aE},$ZodCheckIncludes:function(){return VD},$ZodCheckLengthEquals:function(){return UD},$ZodCheckLessThan:function(){return oE},$ZodCheckLowerCase:function(){return qD},$ZodCheckMaxLength:function(){return zD},$ZodCheckMaxSize:function(){return DD},$ZodCheckMimeType:function(){return KD},$ZodCheckMinLength:function(){return jD},$ZodCheckMinSize:function(){return LD},$ZodCheckMultipleOf:function(){return OD},$ZodCheckNumberFormat:function(){return $D},$ZodCheckOverwrite:function(){return QD},$ZodCheckProperty:function(){return ZD},$ZodCheckRegex:function(){return BD},$ZodCheckSizeEquals:function(){return FD},$ZodCheckStartsWith:function(){return GD},$ZodCheckStringFormat:function(){return Dy},$ZodCheckUpperCase:function(){return WD},$ZodCodec:function(){return r0},$ZodCustom:function(){return z4},$ZodCustomStringFormat:function(){return n4},$ZodDate:function(){return f4},$ZodDefault:function(){return T4},$ZodDiscriminatedUnion:function(){return g4},$ZodE164:function(){return t4},$ZodEmail:function(){return Nw},$ZodEmoji:function(){return Lw},$ZodEncodeError:function(){return $m},$ZodEnum:function(){return b4},$ZodError:function(){return Tw},$ZodExactOptional:function(){return C4},$ZodFile:function(){return S4},$ZodFunction:function(){return D4},$ZodGUID:function(){return Ow},$ZodIPv4:function(){return Zw},$ZodIPv6:function(){return Kw},$ZodISODate:function(){return Vw},$ZodISODateTime:function(){return Ww},$ZodISODuration:function(){return Hw},$ZodISOTime:function(){return Gw},$ZodIntersection:function(){return x4},$ZodJWT:function(){return r4},$ZodKSUID:function(){return qw},$ZodLazy:function(){return F4},$ZodLiteral:function(){return w4},$ZodMAC:function(){return Qw},$ZodMap:function(){return v4},$ZodNaN:function(){return M4},$ZodNanoID:function(){return Fw},$ZodNever:function(){return d4},$ZodNonOptional:function(){return I4},$ZodNull:function(){return l4},$ZodNullable:function(){return E4},$ZodNumber:function(){return Ly},$ZodNumberFormat:function(){return i4},$ZodObject:function(){return pE},$ZodObjectJIT:function(){return eL},$ZodOptional:function(){return jy},$ZodPipe:function(){return O4},$ZodPrefault:function(){return A4},$ZodPromise:function(){return L4},$ZodReadonly:function(){return $4},$ZodRealError:function(){return al},$ZodRecord:function(){return y4},$ZodRegistry:function(){return gE},$ZodSet:function(){return _4},$ZodString:function(){return rf},$ZodStringFormat:function(){return Fn},$ZodSuccess:function(){return P4},$ZodSymbol:function(){return a4},$ZodTemplateLiteral:function(){return N4},$ZodTransform:function(){return k4},$ZodTuple:function(){return zy},$ZodType:function(){return sr},$ZodULID:function(){return Uw},$ZodURL:function(){return Dw},$ZodUUID:function(){return $w},$ZodUndefined:function(){return s4},$ZodUnion:function(){return t0},$ZodUnknown:function(){return c4},$ZodVoid:function(){return p4},$ZodXID:function(){return Bw},$ZodXor:function(){return h4},$brand:function(){return Ty},$constructor:function(){return X},$input:function(){return B4},$output:function(){return U4},Doc:function(){return Mw},JSONSchema:function(){return jL},JSONSchemaGenerator:function(){return _E},NEVER:function(){return Kg},TimePrecision:function(){return G4},_any:function(){return f3},_array:function(){return tL},_base64:function(){return o2},_base64url:function(){return a2},_bigint:function(){return a3},_boolean:function(){return i3},_catch:function(){return qHe},_check:function(){return nse},_cidrv4:function(){return n2},_cidrv6:function(){return i2},_coercedBigint:function(){return s3},_coercedBoolean:function(){return o3},_coercedDate:function(){return y3},_coercedNumber:function(){return Y4},_coercedString:function(){return W4},_cuid:function(){return Qy},_cuid2:function(){return Jy},_custom:function(){return b3},_date:function(){return x3},_decode:function(){return QC},_decodeAsync:function(){return YC},_default:function(){return jHe},_discriminatedUnion:function(){return AHe},_e164:function(){return s2},_email:function(){return qy},_emoji:function(){return Zy},_encode:function(){return KC},_encodeAsync:function(){return JC},_endsWith:function(){return Hm},_enum:function(){return $He},_file:function(){return _3},_float32:function(){return e3},_float64:function(){return t3},_gt:function(){return Fu},_gte:function(){return Mo},_guid:function(){return n0},_includes:function(){return Vm},_int:function(){return X4},_int32:function(){return r3},_int64:function(){return l3},_intersection:function(){return IHe},_ipv4:function(){return t2},_ipv6:function(){return r2},_isoDate:function(){return Z4},_isoDateTime:function(){return H4},_isoDuration:function(){return Q4},_isoTime:function(){return K4},_jwt:function(){return l2},_ksuid:function(){return e2},_lazy:function(){return HHe},_length:function(){return af},_literal:function(){return DHe},_lowercase:function(){return qm},_lt:function(){return Lu},_lte:function(){return ya},_mac:function(){return V4},_map:function(){return MHe},_max:function(){return ya},_maxLength:function(){return of},_maxSize:function(){return Bd},_mime:function(){return Zm},_min:function(){return Mo},_minLength:function(){return kc},_minSize:function(){return zu},_multipleOf:function(){return Ud},_nan:function(){return v3},_nanoid:function(){return Ky},_nativeEnum:function(){return NHe},_negative:function(){return c2},_never:function(){return h3},_nonnegative:function(){return p2},_nonoptional:function(){return UHe},_nonpositive:function(){return d2},_normalize:function(){return Km},_null:function(){return p3},_nullable:function(){return zHe},_number:function(){return J4},_optional:function(){return FHe},_overwrite:function(){return Zl},_parse:function(){return My},_parseAsync:function(){return Oy},_pipe:function(){return WHe},_positive:function(){return u2},_promise:function(){return ZHe},_property:function(){return f2},_readonly:function(){return VHe},_record:function(){return RHe},_refine:function(){return w3},_regex:function(){return qd},_safeDecode:function(){return eE},_safeDecodeAsync:function(){return rE},_safeEncode:function(){return XC},_safeEncodeAsync:function(){return tE},_safeParse:function(){return $y},_safeParseAsync:function(){return Ny},_set:function(){return OHe},_size:function(){return nf},_slugify:function(){return m2},_startsWith:function(){return Gm},_string:function(){return q4},_stringFormat:function(){return Cc},_stringbool:function(){return E3},_success:function(){return BHe},_superRefine:function(){return S3},_symbol:function(){return c3},_templateLiteral:function(){return GHe},_toLowerCase:function(){return Jm},_toUpperCase:function(){return Ym},_transform:function(){return LHe},_trim:function(){return Qm},_tuple:function(){return PHe},_uint32:function(){return n3},_uint64:function(){return u3},_ulid:function(){return Yy},_undefined:function(){return d3},_union:function(){return EHe},_unknown:function(){return m3},_uppercase:function(){return Wm},_url:function(){return Bm},_uuid:function(){return Wy},_uuidv4:function(){return Vy},_uuidv6:function(){return Gy},_uuidv7:function(){return Hy},_void:function(){return g3},_xid:function(){return Xy},_xor:function(){return THe},clone:function(){return Po},config:function(){return Ri},createStandardJSONSchemaMethod:function(){return h2},createToJSONSchemaMethod:function(){return rL},decode:function(){return YN},decodeAsync:function(){return eD},describe:function(){return k3},encode:function(){return JN},encodeAsync:function(){return XN},extractDefs:function(){return eh},finalize:function(){return th},flattenError:function(){return Jg},formatError:function(){return Yg},globalConfig:function(){return _w},globalRegistry:function(){return Xo},initializeContext:function(){return Xm},isValidBase64:function(){return XD},isValidBase64URL:function(){return tae},isValidJWT:function(){return rae},locales:function(){return jd},meta:function(){return C3},parse:function(){return zm},parseAsync:function(){return jm},prettifyError:function(){return Iw},process:function(){return zn},regexes:function(){return Ro},registry:function(){return By},safeDecode:function(){return rD},safeDecodeAsync:function(){return iD},safeEncode:function(){return tD},safeEncodeAsync:function(){return nD},safeParse:function(){return tf},safeParseAsync:function(){return Um},toDotPath:function(){return Loe},toJSONSchema:function(){return sf},treeifyError:function(){return Aw},util:function(){return He},version:function(){return JD}});var Kg=Object.freeze({status:"aborted"});function X(e,t,r){var s;function n(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);var d=a.prototype,u=Object.keys(d);for(var p=0;p<u.length;p++){var m=u[p];m in l||(l[m]=d[m].bind(l))}}var i=(s=r==null?void 0:r.Parent)!=null?s:Object;var o=/*#__PURE__*/function(i){"use strict";_inherits(o,i);function o(){_class_call_check(this,o);return _call_super(this,o,arguments)}return o}(i);Object.defineProperty(o,"name",{value:e});function a(l){var u;var c;var d=r!=null&&r.Parent?new o:this;n(d,l),(u=(c=d._zod).deferred)!=null||(c.deferred=[]);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=d._zod.deferred[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;p()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return d}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:function(l){var c,d;return r!=null&&r.Parent&&_instanceof(l,r.Parent)?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var Ty=Symbol("zod_brand"),Sc=/*#__PURE__*/function(Error1){"use strict";_inherits(Sc1,Error1);function Sc1(){_class_call_check(this,Sc1);return _call_super(this,Sc1,["Encountered Promise during synchronous parse. Use .parseAsync() instead."])}return Sc1}(_wrap_native_super(Error)),$m=/*#__PURE__*/function(Error1){"use strict";_inherits($m1,Error1);function $m1(t){_class_call_check(this,$m1);var _this;_this=_call_super(this,$m1,["Encountered unidirectional transform during encode: ".concat(t)]),_this.name="ZodEncodeError";return _this}return $m1}(_wrap_native_super(Error)),_w={};function Ri(e){return e&&Object.assign(_w,e),_w}var He={};$l(He,{BIGINT_FORMAT_RANGES:function(){return VN},Class:function(){return FN},NUMBER_FORMAT_RANGES:function(){return WN},aborted:function(){return Fm},allowsEval:function(){return UN},assert:function(){return BVe},assertEqual:function(){return FVe},assertIs:function(){return jVe},assertNever:function(){return UVe},assertNotEqual:function(){return zVe},assignProp:function(){return Dm},base64ToUint8Array:function(){return $oe},base64urlToUint8Array:function(){return XVe},cached:function(){return Iy},captureStackTrace:function(){return HC},cleanEnum:function(){return YVe},cleanRegex:function(){return Sw},clone:function(){return Po},cloneDef:function(){return WVe},createTransparentProxy:function(){return QVe},defineLazy:function(){return Mr},esc:function(){return GC},escapeRegex:function(){return Du},extend:function(){return ZC},finalizeIssue:function(){return ol},floatSafeRemainder:function(){return zN},getElementAtPath:function(){return VVe},getEnumValues:function(){return ww},getLengthableOrigin:function(){return Ew},getParsedType:function(){return KVe},getSizableOrigin:function(){return Cw},hexToUint8Array:function(){return tGe},isObject:function(){return Qg},isPlainObject:function(){return Lm},issue:function(){return Ry},joinValues:function(){return Ce},jsonStringifyReplacer:function(){return Ay},merge:function(){return JVe},mergeDefs:function(){return ef},normalizeParams:function(){return Ne},nullish:function(){return Nm},numKeys:function(){return ZVe},objectClone:function(){return qVe},omit:function(){return HN},optionalKeys:function(){return qN},parsedType:function(){return Je},partial:function(){return KN},pick:function(){return GN},prefixIssues:function(){return Hl},primitiveTypes:function(){return BN},promiseAllObject:function(){return GVe},propertyKeyTypes:function(){return kw},randomString:function(){return HVe},required:function(){return QN},safeExtend:function(){return ZN},shallowClone:function(){return Py},slugify:function(){return jN},stringifyPrimitive:function(){return Ke},uint8ArrayToBase64:function(){return Noe},uint8ArrayToBase64url:function(){return eGe},uint8ArrayToHex:function(){return rGe},unwrapMessage:function(){return bw}});function FVe(e){return e}function zVe(e){return e}function jVe(e){}function UVe(e){throw new Error("Unexpected value in exhaustive check")}function BVe(e){}function ww(e){var t=Object.values(e).filter(function(n){return typeof n=="number"});return Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,2),n=_param[0],i=_param[1];return t.indexOf(+n)===-1}).map(function(param){var _param=_sliced_to_array(param,2),n=_param[0],i=_param[1];return i})}function Ce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"|";return e.map(function(r){return Ke(r)}).join(t)}function Ay(e,t){return(typeof t==="undefined"?"undefined":_type_of(t))=="bigint"?t.toString():t}function Iy(e){return{get value(){{var r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Nm(e){return e==null}function Sw(e){var t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function zN(e,t){var r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){var l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}var o=r>i?r:i,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/Math.pow(10,o)}var Ooe=Symbol("evaluating");function Mr(e,t,r){var n;Object.defineProperty(e,t,{get:function get1(){if(n!==Ooe)return n===void 0&&(n=Ooe,n=r()),n},set:function set1(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function qVe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Dm(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ef(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Object.defineProperties({},t)}function WVe(e){return ef(e._zod.def)}function VVe(e,t){return t?t.reduce(function(r,n){return r==null?void 0:r[n]},e):e}function GVe(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){var i={};for(var o=0;o<t.length;o++)i[t[o]]=n[o];return i})}function HVe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;var t="abcdefghijklmnopqrstuvwxyz",r="";for(var n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function GC(e){return JSON.stringify(e)}function jN(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var HC="captureStackTrace"in Error?Error.captureStackTrace:function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}};function Qg(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&!Array.isArray(e)}var UN=Iy(function(){var e;if(typeof navigator!="undefined"&&(e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare"))return!1;try{var t=Function;return new t(""),!0}catch(t){return!1}});function Lm(e){if(Qg(e)===!1)return!1;var t=e.constructor;if(t===void 0||typeof t!="function")return!0;var r=t.prototype;return!(Qg(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Py(e){return Lm(e)?_object_spread({},e):Array.isArray(e)?_to_consumable_array(e):e}function ZVe(e){var t=0;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var KVe=function(e){var t=typeof e==="undefined"?"undefined":_type_of(e);switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map!="undefined"&&_instanceof(e,Map)?"map":typeof Set!="undefined"&&_instanceof(e,Set)?"set":typeof Date!="undefined"&&_instanceof(e,Date)?"date":typeof File!="undefined"&&_instanceof(e,File)?"file":"object";default:throw new Error("Unknown data type: ".concat(t))}},kw=new Set(["string","number","symbol"]),BN=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Du(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Po(e,t,r){var n=new e._zod.constr(t!=null?t:e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function Ne(e){var t=e;if(!t)return{};if(typeof t=="string")return{error:function(){return t}};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?_object_spread_props(_object_spread({},t),{error:function(){return t.error}}):t}function QVe(e){var t;return new Proxy({},{get:function get1(r,n,i){return t!=null||(t=e()),Reflect.get(t,n,i)},set:function set1(r,n,i,o){return t!=null||(t=e()),Reflect.set(t,n,i,o)},has:function has(r,n){return t!=null||(t=e()),Reflect.has(t,n)},deleteProperty:function deleteProperty(r,n){return t!=null||(t=e()),Reflect.deleteProperty(t,n)},ownKeys:function ownKeys(r){return t!=null||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(r,n){return t!=null||(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty:function defineProperty(r,n,i){return t!=null||(t=e()),Reflect.defineProperty(t,n,i)}})}function Ke(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="bigint"?e.toString()+"n":typeof e=="string"?'"'.concat(e,'"'):"".concat(e)}function qN(e){return Object.keys(e).filter(function(t){return e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional"})}var WN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},VN={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function GN(e,t){var r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");var o=ef(e._zod.def,{get shape(){var a={};for(var s in t){if(!(s in r.shape))throw new Error('Unrecognized key: "'.concat(s,'"'));t[s]&&(a[s]=r.shape[s])}return Dm(this,"shape",a),a},checks:[]});return Po(e,o)}function HN(e,t){var r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");var o=ef(e._zod.def,{get shape(){var a=_object_spread({},e._zod.def.shape);for(var s in t){if(!(s in r.shape))throw new Error('Unrecognized key: "'.concat(s,'"'));t[s]&&delete a[s]}return Dm(this,"shape",a),a},checks:[]});return Po(e,o)}function ZC(e,t){if(!Lm(t))throw new Error("Invalid input to extend: expected a plain object");var r=e._zod.def.checks;if(r&&r.length>0){var o=e._zod.def.shape;for(var a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}var i=ef(e._zod.def,{get shape(){var o10=_object_spread({},e._zod.def.shape,t);return Dm(this,"shape",o10),o10}});return Po(e,i)}function ZN(e,t){if(!Lm(t))throw new Error("Invalid input to safeExtend: expected a plain object");var r=ef(e._zod.def,{get shape(){var n=_object_spread({},e._zod.def.shape,t);return Dm(this,"shape",n),n}});return Po(e,r)}function JVe(e,t){var r=ef(e._zod.def,{get shape(){var n=_object_spread({},e._zod.def.shape,t._zod.def.shape);return Dm(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Po(e,r)}function KN(e,t,r){var i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");var a=ef(t._zod.def,{get shape(){var s=t._zod.def.shape,l=_object_spread({},s);if(r)for(var c in r){if(!(c in s))throw new Error('Unrecognized key: "'.concat(c,'"'));r[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(var c10 in s)l[c10]=e?new e({type:"optional",innerType:s[c10]}):s[c10];return Dm(this,"shape",l),l},checks:[]});return Po(t,a)}function QN(e,t,r){var n=ef(t._zod.def,{get shape(){var i=t._zod.def.shape,o=_object_spread({},i);if(r)for(var a in r){if(!(a in o))throw new Error('Unrecognized key: "'.concat(a,'"'));r[a]&&(o[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(var a9 in i)o[a9]=new e({type:"nonoptional",innerType:i[a9]});return Dm(this,"shape",o),o}});return Po(t,n)}function Fm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var r;if(e.aborted===!0)return!0;for(var n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function Hl(e,t){return t.map(function(r){var i;var n;return(i=(n=r).path)!=null||(n.path=[]),r.path.unshift(e),r})}function bw(e){return typeof e=="string"?e:e==null?void 0:e.message}function ol(e,t,r){var i,o,a,s,l,c,d,u,p,m,h;var n=_object_spread_props(_object_spread({},e),{path:(i=e.path)!=null?i:[]});if(!e.message){var g=(h=(m=(u=(c=bw((s=(a=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:a.error)==null?void 0:s.call(a,e)))!=null?c:bw((l=t==null?void 0:t.error)==null?void 0:l.call(t,e)))!=null?u:bw((d=r.customError)==null?void 0:d.call(r,e)))!=null?m:bw((p=r.localeError)==null?void 0:p.call(r,e)))!=null?h:"Invalid input";n.message=g}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Cw(e){return _instanceof(e,Set)?"set":_instanceof(e,Map)?"map":_instanceof(e,File)?"file":"unknown"}function Ew(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Je(e){var t=typeof e==="undefined"?"undefined":_type_of(e);switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";var r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ry(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var _e1=_sliced_to_array(e,3),t=_e1[0],r=_e1[1],n=_e1[2];return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:_object_spread({},t)}function YVe(e){return Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return Number.isNaN(Number.parseInt(t,10))}).map(function(t){return t[1]})}function $oe(e){var t=atob(e),r=new Uint8Array(t.length);for(var n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Noe(e){var t="";for(var r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function XVe(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $oe(t+r)}function eGe(e){return Noe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function tGe(e){var t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");var r=new Uint8Array(t.length/2);for(var n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function rGe(e){return Array.from(e).map(function(t){return t.toString(16).padStart(2,"0")}).join("")}var FN=function FN1(){"use strict";for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}_class_call_check(this,FN1)};var Doe=function(e,t){e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ay,2),Object.defineProperty(e,"toString",{value:function(){return e.message},enumerable:!1})},Tw=X("$ZodError",Doe),al=X("$ZodError",Doe,{Parent:Error});function Jg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(r){return r.message};var r={},n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{formErrors:n,fieldErrors:r}}function Yg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(r){return r.message};var r={_errors:[]},n=function(i){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(o.code==="invalid_union"&&o.errors.length)o.errors.map(function(a){return n({issues:a})});else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{var a=r,s=0;for(;s<o.path.length;){var l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return n(e),r}function Aw(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(r){return r.message};var r={errors:[]},n=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var l,c,d,u;var a,s;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var p=_step.value;if(p.code==="invalid_union"&&p.errors.length)p.errors.map(function(m){return n({issues:m},p.path)});else if(p.code==="invalid_key")n({issues:p.issues},p.path);else if(p.code==="invalid_element")n({issues:p.issues},p.path);else{var m=_to_consumable_array(o).concat(_to_consumable_array(p.path));if(m.length===0){r.errors.push(t(p));return"continue"}var h=r,g=0;for(;g<m.length;){var x=m[g],v=g===m.length-1;typeof x=="string"?((l=h.properties)!=null||(h.properties={}),(c=(a=h.properties)[x])!=null||(a[x]={errors:[]}),h=h.properties[x]):((d=h.items)!=null||(h.items=[]),(u=(s=h.items)[x])!=null||(s[x]={errors:[]}),h=h.items[x]),v&&h.errors.push(t(p)),g++}}};for(var _iterator=i.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return n(e),r}function Loe(e){var t=[],r=e.map(function(n){return(typeof n==="undefined"?"undefined":_type_of(n))=="object"?n.key:n});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;typeof n=="number"?t.push("[".concat(n,"]")):(typeof n==="undefined"?"undefined":_type_of(n))=="symbol"?t.push("[".concat(JSON.stringify(String(n)),"]")):/[^\w$]/.test(n)?t.push("[".concat(JSON.stringify(n),"]")):(t.length&&t.push("."),t.push(n))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.join("")}function Iw(e){var n;var t=[],r=_to_consumable_array(e.issues).sort(function(i,o){var a,s;return((a=i.path)!=null?a:[]).length-((s=o.path)!=null?s:[]).length});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;t.push("✖ ".concat(i.message)),(n=i.path)!=null&&n.length&&t.push(" → at ".concat(Loe(i.path)))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.join("\n")}var My=function(e){return function(t,r,n,i){var s;var o=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(_instanceof(a,Promise))throw new Sc;if(a.issues.length){var l=new((s=i==null?void 0:i.Err)!=null?s:e)(a.issues.map(function(c){return ol(c,o,Ri())}));throw HC(l,i==null?void 0:i.callee),l}return a.value}},zm=My(al),Oy=function(e){return function(t,r,n,i){return _async_to_generator(function(){var s,o,a,_tmp,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);_tmp=_instanceof(a,Promise);if(!_tmp)return[3,2];return[4,a];case 1:_tmp=a=_state.sent();_state.label=2;case 2:if(_tmp,a.issues.length){l=new((s=i==null?void 0:i.Err)!=null?s:e)(a.issues.map(function(c){return ol(c,o,Ri())}));throw HC(l,i==null?void 0:i.callee),l}return[2,a.value]}})})()}},jm=Oy(al),$y=function(e){return function(t,r,n){var i=n?_object_spread_props(_object_spread({},n),{async:!1}):{async:!1},o=t._zod.run({value:r,issues:[]},i);if(_instanceof(o,Promise))throw new Sc;return o.issues.length?{success:!1,error:new(e!=null?e:Tw)(o.issues.map(function(a){return ol(a,i,Ri())}))}:{success:!0,data:o.value}}},tf=$y(al),Ny=function(e){return function(t,r,n){return _async_to_generator(function(){var i,o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},i);_tmp=_instanceof(o,Promise);if(!_tmp)return[3,2];return[4,o];case 1:_tmp=o=_state.sent();_state.label=2;case 2:return[2,(_tmp,o.issues.length?{success:!1,error:new e(o.issues.map(function(a){return ol(a,i,Ri())}))}:{success:!0,data:o.value})]}})})()}},Um=Ny(al),KC=function(e){return function(t,r,n){var i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return My(e)(t,r,i)}},JN=KC(al),QC=function(e){return function(t,r,n){return My(e)(t,r,n)}},YN=QC(al),JC=function(e){return function(t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return[2,Oy(e)(t,r,i)]})})()}},XN=JC(al),YC=function(e){return function(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Oy(e)(t,r,n)]})})()}},eD=YC(al),XC=function(e){return function(t,r,n){var i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return $y(e)(t,r,i)}},tD=XC(al),eE=function(e){return function(t,r,n){return $y(e)(t,r,n)}},rD=eE(al),tE=function(e){return function(t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return[2,Ny(e)(t,r,i)]})})()}},nD=tE(al),rE=function(e){return function(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Ny(e)(t,r,n)]})})()}},iD=rE(al);var Ro={};$l(Ro,{base64:function(){return _D},base64url:function(){return nE},bigint:function(){return ED},boolean:function(){return AD},browserEmail:function(){return dGe},cidrv4:function(){return yD},cidrv6:function(){return vD},cuid:function(){return oD},cuid2:function(){return aD},date:function(){return wD},datetime:function(){return kD},domain:function(){return mGe},duration:function(){return dD},e164:function(){return bD},email:function(){return fD},emoji:function(){return mD},extendedDuration:function(){return iGe},guid:function(){return pD},hex:function(){return hGe},hostname:function(){return fGe},html5Email:function(){return lGe},idnEmail:function(){return cGe},integer:function(){return TD},ipv4:function(){return hD},ipv6:function(){return gD},ksuid:function(){return uD},lowercase:function(){return RD},mac:function(){return xD},md5_base64:function(){return xGe},md5_base64url:function(){return yGe},md5_hex:function(){return gGe},nanoid:function(){return cD},null:function(){return ID},number:function(){return iE},rfc5322Email:function(){return uGe},sha1_base64:function(){return _Ge},sha1_base64url:function(){return bGe},sha1_hex:function(){return vGe},sha256_base64:function(){return SGe},sha256_base64url:function(){return kGe},sha256_hex:function(){return wGe},sha384_base64:function(){return EGe},sha384_base64url:function(){return TGe},sha384_hex:function(){return CGe},sha512_base64:function(){return IGe},sha512_base64url:function(){return PGe},sha512_hex:function(){return AGe},string:function(){return CD},time:function(){return SD},ulid:function(){return sD},undefined:function(){return PD},unicodeEmail:function(){return Foe},uppercase:function(){return MD},uuid:function(){return Xg},uuid4:function(){return oGe},uuid6:function(){return aGe},uuid7:function(){return sGe},xid:function(){return lD}});var oD=/^[cC][^\s-]{8,}$/,aD=/^[0-9a-z]+$/,sD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lD=/^[0-9a-vA-V]{20}$/,uD=/^[A-Za-z0-9]{27}$/,cD=/^[a-zA-Z0-9_-]{21}$/,dD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iGe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pD=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Xg=function(e){return e?new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(e,"[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/},oGe=Xg(4),aGe=Xg(6),sGe=Xg(7),fD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lGe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uGe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Foe=RegExp('^[^\\s@"]{1,64}@[^\\s@]{1,255}$',"u"),cGe=Foe,dGe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pGe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mD(){return new RegExp(pGe,"u")}var hD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xD=function(e){var t=Du(e!=null?e:":");return new RegExp("^(?:[0-9A-F]{2}".concat(t,"){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}").concat(t,"){5}[0-9a-f]{2}$"))},yD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_D=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nE=/^[A-Za-z0-9_-]*$/,fGe=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,mGe=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,bD=/^\+[1-9]\d{6,14}$/,zoe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wD=new RegExp("^".concat(zoe,"$"));function joe(e){var t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?"".concat(t):e.precision===0?"".concat(t,":[0-5]\\d"):"".concat(t,":[0-5]\\d\\.\\d{").concat(e.precision,"}"):"".concat(t,"(?::[0-5]\\d(?:\\.\\d+)?)?")}function SD(e){return new RegExp("^".concat(joe(e),"$"))}function kD(e){var t=joe({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");var n="".concat(t,"(?:").concat(r.join("|"),")");return new RegExp("^".concat(zoe,"T(?:").concat(n,")$"))}var CD=function(e){var r,n;var t=e?"[\\s\\S]{".concat((r=e==null?void 0:e.minimum)!=null?r:0,",").concat((n=e==null?void 0:e.maximum)!=null?n:"","}"):"[\\s\\S]*";return new RegExp("^".concat(t,"$"))},ED=/^-?\d+n?$/,TD=/^-?\d+$/,iE=/^-?\d+(?:\.\d+)?$/,AD=/^(?:true|false)$/i,ID=/^null$/i;var PD=/^undefined$/i;var RD=/^[^A-Z]*$/,MD=/^[^a-z]*$/,hGe=/^[0-9a-fA-F]*$/;function Pw(e,t){return new RegExp("^[A-Za-z0-9+/]{".concat(e,"}").concat(t,"$"))}function Rw(e){return new RegExp("^[A-Za-z0-9_-]{".concat(e,"}$"))}var gGe=/^[0-9a-fA-F]{32}$/,xGe=Pw(22,"=="),yGe=Rw(22),vGe=/^[0-9a-fA-F]{40}$/,_Ge=Pw(27,"="),bGe=Rw(27),wGe=/^[0-9a-fA-F]{64}$/,SGe=Pw(43,"="),kGe=Rw(43),CGe=/^[0-9a-fA-F]{96}$/,EGe=Pw(64,""),TGe=Rw(64),AGe=/^[0-9a-fA-F]{128}$/,IGe=Pw(86,"=="),PGe=Rw(86);var qn=X("$ZodCheck",function(e,t){var n,i;var r;(n=e._zod)!=null||(e._zod={}),e._zod.def=t,(i=(r=e._zod).onattach)!=null||(r.onattach=[])}),Boe={number:"number",bigint:"bigint",object:"date"},oE=X("$ZodCheckLessThan",function(e,t){qn.init(e,t);var r=Boe[_type_of(t.value)];e._zod.onattach.push(function(n){var a;var i=n._zod.bag,o=(a=t.inclusive?i.maximum:i.exclusiveMaximum)!=null?a:Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=function(n){(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:_type_of(t.value)=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aE=X("$ZodCheckGreaterThan",function(e,t){qn.init(e,t);var r=Boe[_type_of(t.value)];e._zod.onattach.push(function(n){var a;var i=n._zod.bag,o=(a=t.inclusive?i.minimum:i.exclusiveMinimum)!=null?a:Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=function(n){(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:_type_of(t.value)=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),OD=X("$ZodCheckMultipleOf",function(e,t){qn.init(e,t),e._zod.onattach.push(function(r){var i;var n;(i=(n=r._zod.bag).multipleOf)!=null||(n.multipleOf=t.value)}),e._zod.check=function(r){if(_type_of(r.value)!=_type_of(t.value))throw new Error("Cannot mix number and bigint in multiple_of check.");(_type_of(r.value)=="bigint"?r.value%t.value===BigInt(0):zN(r.value,t.value)===0)||r.issues.push({origin:_type_of(r.value),code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),$D=X("$ZodCheckNumberFormat",function(e,t){var a;qn.init(e,t),t.format=t.format||"float64";var r=(a=t.format)==null?void 0:a.includes("int"),n=r?"int":"number",_WN_t_format=_sliced_to_array(WN[t.format],2),i=_WN_t_format[0],o=_WN_t_format[1];e._zod.onattach.push(function(s){var l=s._zod.bag;l.format=t.format,l.minimum=i,l.maximum=o,r&&(l.pattern=TD)}),e._zod.check=function(s){var l=s.value;if(r){if(!Number.isInteger(l)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?s.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&s.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&s.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ND=X("$ZodCheckBigIntFormat",function(e,t){qn.init(e,t);var _VN_t_format=_sliced_to_array(VN[t.format],2),r=_VN_t_format[0],n=_VN_t_format[1];e._zod.onattach.push(function(i){var o=i._zod.bag;o.format=t.format,o.minimum=r,o.maximum=n}),e._zod.check=function(i){var o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),DD=X("$ZodCheckMaxSize",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.size!==void 0}),e._zod.onattach.push(function(i){var a;var o=(a=i._zod.bag.maximum)!=null?a:Number.POSITIVE_INFINITY;t.maximum<o&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=function(i){var o=i.value;o.size<=t.maximum||i.issues.push({origin:Cw(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),LD=X("$ZodCheckMinSize",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.size!==void 0}),e._zod.onattach.push(function(i){var a;var o=(a=i._zod.bag.minimum)!=null?a:Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=function(i){var o=i.value;o.size>=t.minimum||i.issues.push({origin:Cw(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),FD=X("$ZodCheckSizeEquals",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.size!==void 0}),e._zod.onattach.push(function(i){var o=i._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=function(i){var o=i.value,a=o.size;if(a===t.size)return;var s=a>t.size;i.issues.push(_object_spread_props(_object_spread({origin:Cw(o)},s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort}))}}),zD=X("$ZodCheckMaxLength",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.length!==void 0}),e._zod.onattach.push(function(i){var a;var o=(a=i._zod.bag.maximum)!=null?a:Number.POSITIVE_INFINITY;t.maximum<o&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=function(i){var o=i.value;if(o.length<=t.maximum)return;var s=Ew(o);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),jD=X("$ZodCheckMinLength",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.length!==void 0}),e._zod.onattach.push(function(i){var a;var o=(a=i._zod.bag.minimum)!=null?a:Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=function(i){var o=i.value;if(o.length>=t.minimum)return;var s=Ew(o);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),UD=X("$ZodCheckLengthEquals",function(e,t){var n;var r;qn.init(e,t),(n=(r=e._zod.def).when)!=null||(r.when=function(i){var o=i.value;return!Nm(o)&&o.length!==void 0}),e._zod.onattach.push(function(i){var o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=function(i){var o=i.value,a=o.length;if(a===t.length)return;var s=Ew(o),l=a>t.length;i.issues.push(_object_spread_props(_object_spread({origin:s},l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort}))}}),Dy=X("$ZodCheckStringFormat",function(e,t){var i,o;var r,n;qn.init(e,t),e._zod.onattach.push(function(a){var l;var s=a._zod.bag;s.format=t.format,t.pattern&&((l=s.patterns)!=null||(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=(r=e._zod).check)!=null||(r.check=function(a){t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push(_object_spread_props(_object_spread({origin:"string",code:"invalid_format",format:t.format,input:a.value},t.pattern?{pattern:t.pattern.toString()}:{}),{inst:e,continue:!t.abort}))}):(o=(n=e._zod).check)!=null||(n.check=function(){})}),BD=X("$ZodCheckRegex",function(e,t){Dy.init(e,t),e._zod.check=function(r){t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qD=X("$ZodCheckLowerCase",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=RD),Dy.init(e,t)}),WD=X("$ZodCheckUpperCase",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=MD),Dy.init(e,t)}),VD=X("$ZodCheckIncludes",function(e,t){qn.init(e,t);var r=Du(t.includes),n=new RegExp(typeof t.position=="number"?"^.{".concat(t.position,"}").concat(r):r);t.pattern=n,e._zod.onattach.push(function(i){var a;var o=i._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=function(i){i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),GD=X("$ZodCheckStartsWith",function(e,t){var n;qn.init(e,t);var r=new RegExp("^".concat(Du(t.prefix),".*"));(n=t.pattern)!=null||(t.pattern=r),e._zod.onattach.push(function(i){var a;var o=i._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=function(i){i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),HD=X("$ZodCheckEndsWith",function(e,t){var n;qn.init(e,t);var r=new RegExp(".*".concat(Du(t.suffix),"$"));(n=t.pattern)!=null||(t.pattern=r),e._zod.onattach.push(function(i){var a;var o=i._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=function(i){i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Uoe(e,t,r){var _t_issues;e.issues.length&&(_t_issues=t.issues).push.apply(_t_issues,_to_consumable_array(Hl(r,e.issues)))}var ZD=X("$ZodCheckProperty",function(e,t){qn.init(e,t),e._zod.check=function(r){var n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(_instanceof(n,Promise))return n.then(function(i){return Uoe(i,r,t.property)});Uoe(n,r,t.property)}}),KD=X("$ZodCheckMimeType",function(e,t){qn.init(e,t);var r=new Set(t.mime);e._zod.onattach.push(function(n){n._zod.bag.mime=t.mime}),e._zod.check=function(n){r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),QD=X("$ZodCheckOverwrite",function(e,t){qn.init(e,t),e._zod.check=function(r){r.value=t.tx(r.value)}});var Mw=/*#__PURE__*/function(){"use strict";function Mw1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];_class_call_check(this,Mw1);this.content=[],this.indent=0,this&&(this.args=t)}_create_class(Mw1,[{key:"indented",value:function indented(t){this.indent+=1,t(this),this.indent-=1}},{key:"write",value:function write(t){var _this=this;var _Math;if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}var n=t.split("\n").filter(function(a){return a}),i=(_Math=Math).min.apply(_Math,_to_consumable_array(n.map(function(a){return a.length-a.trimStart().length}))),o=n.map(function(a){return a.slice(i)}).map(function(a){return" ".repeat(_this.indent*2)+a});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;this.content.push(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"compile",value:function compile(){var o;var t=Function,r=this==null?void 0:this.args,i=_to_consumable_array(((o=this==null?void 0:this.content)!=null?o:[""]).map(function(a){return" ".concat(a)}));return _construct(t,_to_consumable_array(r).concat([i.join("\n")]))}}]);return Mw1}();var JD={major:4,minor:3,patch:6};var sr=X("$ZodType",function(e,t){var i,o,a;var r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=JD;var n=_to_consumable_array((i=e._zod.def.checks)!=null?i:[]);e._zod.traits.has("$ZodCheck")&&n.unshift(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var s=_step.value;try{for(var _iterator1=s._zod.onattach[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var l=_step1.value;l(e)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(n.length===0)(o=(r=e._zod).deferred)!=null||(r.deferred=[]),(a=e._zod.deferred)==null||a.push(function(){e._zod.run=e._zod.parse});else{var s10=function(c,d,u){var p=Fm(c),m;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var h=_step.value;if(h._zod.def.when){if(!h._zod.def.when(c))return"continue"}else if(p)return"continue";var g=c.issues.length,x=h._zod.check(c);if(_instanceof(x,Promise)&&(u==null?void 0:u.async)===!1)throw new Sc;if(m||_instanceof(x,Promise))m=(m!=null?m:Promise.resolve()).then(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,x];case 1:_state.sent(),c.issues.length!==g&&(p||(p=Fm(c,g)));return[2]}})})()});else{if(c.issues.length===g)return"continue";p||(p=Fm(c,g))}};for(var _iterator=d[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return m?m.then(function(){return c}):c},l10=function(c,d,u){if(Fm(c))return c.aborted=!0,c;var p=s10(d,n,u);if(_instanceof(p,Promise)){if(u.async===!1)throw new Sc;return p.then(function(m){return e._zod.parse(m,u)})}return e._zod.parse(p,u)};e._zod.run=function(c,d){if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){var p=e._zod.parse({value:c.value,issues:[]},_object_spread_props(_object_spread({},d),{skipChecks:!0}));return _instanceof(p,Promise)?p.then(function(m){return l10(m,c,d)}):l10(p,c,d)}var u=e._zod.parse(c,d);if(_instanceof(u,Promise)){if(d.async===!1)throw new Sc;return u.then(function(p){return s10(p,n,d)})}return s10(u,n,d)}}Mr(e,"~standard",function(){return{validate:function(s){var l;try{var c=tf(e,s);return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}}catch(c){return Um(e,s).then(function(d){var u;return d.success?{value:d.data}:{issues:(u=d.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}})}),rf=X("$ZodString",function(e,t){var r,n,i;sr.init(e,t),e._zod.pattern=(i=_to_consumable_array((n=(r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)!=null?n:[]).pop())!=null?i:CD(e._zod.bag),e._zod.parse=function(o,a){if(t.coerce)try{o.value=String(o.value)}catch(s){}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Fn=X("$ZodStringFormat",function(e,t){Dy.init(e,t),rf.init(e,t)}),Ow=X("$ZodGUID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=pD),Fn.init(e,t)}),$w=X("$ZodUUID",function(e,t){var r,n;if(t.version){var o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error('Invalid UUID version: "'.concat(t.version,'"'));(r=t.pattern)!=null||(t.pattern=Xg(o))}else(n=t.pattern)!=null||(t.pattern=Xg());Fn.init(e,t)}),Nw=X("$ZodEmail",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=fD),Fn.init(e,t)}),Dw=X("$ZodURL",function(e,t){Fn.init(e,t),e._zod.check=function(r){try{var n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Lw=X("$ZodEmoji",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=mD()),Fn.init(e,t)}),Fw=X("$ZodNanoID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=cD),Fn.init(e,t)}),zw=X("$ZodCUID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=oD),Fn.init(e,t)}),jw=X("$ZodCUID2",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=aD),Fn.init(e,t)}),Uw=X("$ZodULID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=sD),Fn.init(e,t)}),Bw=X("$ZodXID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=lD),Fn.init(e,t)}),qw=X("$ZodKSUID",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=uD),Fn.init(e,t)}),Ww=X("$ZodISODateTime",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=kD(t)),Fn.init(e,t)}),Vw=X("$ZodISODate",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=wD),Fn.init(e,t)}),Gw=X("$ZodISOTime",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=SD(t)),Fn.init(e,t)}),Hw=X("$ZodISODuration",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=dD),Fn.init(e,t)}),Zw=X("$ZodIPv4",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=hD),Fn.init(e,t),e._zod.bag.format="ipv4"}),Kw=X("$ZodIPv6",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=gD),Fn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=function(n){try{new URL("http://[".concat(n.value,"]"))}catch(i){n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Qw=X("$ZodMAC",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=xD(t.delimiter)),Fn.init(e,t),e._zod.bag.format="mac"}),Jw=X("$ZodCIDRv4",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=yD),Fn.init(e,t)}),Yw=X("$ZodCIDRv6",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=vD),Fn.init(e,t),e._zod.check=function(n){var i=n.value.split("/");try{if(i.length!==2)throw new Error;var _i1=_sliced_to_array(i,2),o=_i1[0],a=_i1[1];if(!a)throw new Error;var s=Number(a);if("".concat(s)!==a)throw new Error;if(s<0||s>128)throw new Error;new URL("http://[".concat(o,"]"))}catch(o){n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function XD(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch(t){return!1}}var Xw=X("$ZodBase64",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=_D),Fn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=function(n){XD(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function tae(e){if(!nE.test(e))return!1;var t=e.replace(/[-_]/g,function(n){return n==="-"?"+":"/"}),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return XD(r)}var e4=X("$ZodBase64URL",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=nE),Fn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=function(n){tae(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t4=X("$ZodE164",function(e,t){var r;(r=t.pattern)!=null||(t.pattern=bD),Fn.init(e,t)});function rae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;try{var r=e.split(".");if(r.length!==3)return!1;var _r1=_sliced_to_array(r,1),n=_r1[0];if(!n)return!1;var i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch(r){return!1}}var r4=X("$ZodJWT",function(e,t){Fn.init(e,t),e._zod.check=function(r){rae(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),n4=X("$ZodCustomStringFormat",function(e,t){Fn.init(e,t),e._zod.check=function(r){t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ly=X("$ZodNumber",function(e,t){var r;sr.init(e,t),e._zod.pattern=(r=e._zod.bag.pattern)!=null?r:iE,e._zod.parse=function(n,i){if(t.coerce)try{n.value=Number(n.value)}catch(s){}var o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;var a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push(_object_spread({expected:"number",code:"invalid_type",input:o,inst:e},a?{received:a}:{})),n}}),i4=X("$ZodNumberFormat",function(e,t){$D.init(e,t),Ly.init(e,t)}),e0=X("$ZodBoolean",function(e,t){sr.init(e,t),e._zod.pattern=AD,e._zod.parse=function(r,n){if(t.coerce)try{r.value=Boolean(r.value)}catch(o){}var i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Fy=X("$ZodBigInt",function(e,t){sr.init(e,t),e._zod.pattern=ED,e._zod.parse=function(r,n){if(t.coerce)try{r.value=BigInt(r.value)}catch(i){}return _type_of(r.value)=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),o4=X("$ZodBigIntFormat",function(e,t){ND.init(e,t),Fy.init(e,t)}),a4=X("$ZodSymbol",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;return(typeof i==="undefined"?"undefined":_type_of(i))=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),s4=X("$ZodUndefined",function(e,t){sr.init(e,t),e._zod.pattern=PD,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=function(r,n){var i=r.value;return typeof i=="undefined"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),l4=X("$ZodNull",function(e,t){sr.init(e,t),e._zod.pattern=ID,e._zod.values=new Set([null]),e._zod.parse=function(r,n){var i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),u4=X("$ZodAny",function(e,t){sr.init(e,t),e._zod.parse=function(r){return r}}),c4=X("$ZodUnknown",function(e,t){sr.init(e,t),e._zod.parse=function(r){return r}}),d4=X("$ZodNever",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){return r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r}}),p4=X("$ZodVoid",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;return typeof i=="undefined"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),f4=X("$ZodDate",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){if(t.coerce)try{r.value=new Date(r.value)}catch(s){}var i=r.value,o=_instanceof(i,Date);return o&&!Number.isNaN(i.getTime())||r.issues.push(_object_spread_props(_object_spread({expected:"date",code:"invalid_type",input:i},o?{received:"Invalid Date"}:{}),{inst:e})),r}});function Woe(e,t,r){var _t_issues;e.issues.length&&(_t_issues=t.issues).push.apply(_t_issues,_to_consumable_array(Hl(r,e.issues))),t.value[r]=e.value}var m4=X("$ZodArray",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var _loop=function(a){var s=i[a],l=t.element._zod.run({value:s,issues:[]},n);_instanceof(l,Promise)?o.push(l.then(function(c){return Woe(c,r,a)})):Woe(l,r,a)};var i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);var o=[];for(var a=0;a<i.length;a++)_loop(a);return o.length?Promise.all(o).then(function(){return r}):r}});function dE(e,t,r,n,i){if(e.issues.length){var _t_issues;if(i&&!(r in n))return;(_t_issues=t.issues).push.apply(_t_issues,_to_consumable_array(Hl(r,e.issues)))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function nae(e){var n,i,o,a;var t=Object.keys(e.shape);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(!((a=(o=(i=(n=e.shape)==null?void 0:n[s])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error('Invalid element at key "'.concat(s,'": expected a Zod schema'))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var r=qN(e.shape);return _object_spread_props(_object_spread({},e),{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)})}function iae(e,t,r,n,i,o){var _loop=function(u){if(s.has(u))return"continue";if(c==="never"){a.push(u);return"continue"}var p=l.run({value:t[u],issues:[]},n);_instanceof(p,Promise)?e.push(p.then(function(m){return dE(m,r,u,t,d)})):dE(p,r,u,t,d)};var a=[],s=i.keySet,l=i.catchall._zod,c=l.def.type,d=l.optout==="optional";for(var u in t)_loop(u);return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(function(){return r}):r}var pE=X("$ZodObject",function(e,t){sr.init(e,t);var r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){var s=t.shape;Object.defineProperty(t,"shape",{get:function(){var l=_object_spread({},s);return Object.defineProperty(t,"shape",{value:l}),l}})}var n=Iy(function(){return nae(t)});Mr(e._zod,"propValues",function(){var c;var s=t.shape,l={};for(var d in s){var u=s[d]._zod;if(u.values){(c=l[d])!=null||(l[d]=new Set);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u.values[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;l[d].add(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}return l});var i=Qg,o=t.catchall,a;e._zod.parse=function(s,l){a!=null||(a=n.value);var c=s.value;if(!i(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};var d=[],u=a.shape;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var p=_step.value;var m=u[p],h=m._zod.optout==="optional",g=m._zod.run({value:c[p],issues:[]},l);_instanceof(g,Promise)?d.push(g.then(function(x){return dE(x,s,p,c,h)})):dE(g,s,p,c,h)};for(var _iterator=a.keys[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o?iae(d,c,s,l,n.value,e):d.length?Promise.all(d).then(function(){return s}):s}}),eL=X("$ZodObjectJIT",function(e,t){pE.init(e,t);var r=e._zod.parse,n=Iy(function(){return nae(t)}),i=function(p){var _;var m=new Mw(["shape","payload","ctx"]),h=n.value,g=function(b){var w=GC(b);return"shape[".concat(w,"]._zod.run({ value: input[").concat(w,"], issues: [] }, ctx)")};m.write("const input = payload.value;");var x=Object.create(null),v=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h.keys[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var b=_step.value;x[b]="key_".concat(v++)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}m.write("const newResult = {};");var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=h.keys[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var b10=_step1.value;var w=x[b10],S=GC(b10),k=p[b10],E=((_=k==null?void 0:k._zod)==null?void 0:_.optout)==="optional";m.write("const ".concat(w," = ").concat(g(b10),";")),E?m.write("\n if (".concat(w,".issues.length) {\n if (").concat(S," in input) {\n payload.issues = payload.issues.concat(").concat(w,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(S,", ...iss.path] : [").concat(S,"]\n })));\n }\n }\n \n if (").concat(w,".value === undefined) {\n if (").concat(S," in input) {\n newResult[").concat(S,"] = undefined;\n }\n } else {\n newResult[").concat(S,"] = ").concat(w,".value;\n }\n \n ")):m.write("\n if (".concat(w,".issues.length) {\n payload.issues = payload.issues.concat(").concat(w,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(S,", ...iss.path] : [").concat(S,"]\n })));\n }\n \n if (").concat(w,".value === undefined) {\n if (").concat(S," in input) {\n newResult[").concat(S,"] = undefined;\n }\n } else {\n newResult[").concat(S,"] = ").concat(w,".value;\n }\n \n "))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}m.write("payload.value = newResult;"),m.write("return payload;");var y=m.compile();return function(b,w){return y(p,b,w)}},o,a=Qg,s=!_w.jitless,c=s&&UN.value,d=t.catchall,u;e._zod.parse=function(p,m){u!=null||(u=n.value);var h=p.value;return a(h)?s&&c&&(m==null?void 0:m.async)===!1&&m.jitless!==!0?(o||(o=i(t.shape)),p=o(p,m),d?iae([],h,p,m,u,e):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p)}});function Voe(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(o.issues.length===0)return t.value=o.value,t}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var i=e.filter(function(o){return!Fm(o)});return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(function(o){return o.issues.map(function(a){return ol(a,n,Ri())})})}),t)}var t0=X("$ZodUnion",function(e,t){sr.init(e,t),Mr(e._zod,"optin",function(){return t.options.some(function(i){return i._zod.optin==="optional"})?"optional":void 0}),Mr(e._zod,"optout",function(){return t.options.some(function(i){return i._zod.optout==="optional"})?"optional":void 0}),Mr(e._zod,"values",function(){if(t.options.every(function(i){return i._zod.values}))return new Set(t.options.flatMap(function(i){return Array.from(i._zod.values)}))}),Mr(e._zod,"pattern",function(){if(t.options.every(function(i){return i._zod.pattern})){var i=t.options.map(function(o){return o._zod.pattern});return new RegExp("^(".concat(i.map(function(o){return Sw(o.source)}).join("|"),")$"))}});var r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=function(i,o){if(r)return n(i,o);var a=!1,s=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.options[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=l._zod.run({value:i.value,issues:[]},o);if(_instanceof(c,Promise))s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a?Promise.all(s).then(function(l){return Voe(l,i,e,o)}):Voe(s,i,e,o)}});function Goe(e,t,r,n){var i=e.filter(function(o){return o.issues.length===0});return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(function(o){return o.issues.map(function(a){return ol(a,n,Ri())})})}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var h4=X("$ZodXor",function(e,t){t0.init(e,t),t.inclusive=!1;var r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=function(i,o){if(r)return n(i,o);var a=!1,s=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.options[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=l._zod.run({value:i.value,issues:[]},o);_instanceof(c,Promise)?(s.push(c),a=!0):s.push(c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a?Promise.all(s).then(function(l){return Goe(l,i,e,o)}):Goe(s,i,e,o)}}),g4=X("$ZodDiscriminatedUnion",function(e,t){t.inclusive=!1,t0.init(e,t);var r=e._zod.parse;Mr(e._zod,"propValues",function(){var i={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.options[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(o),'"'));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries(a)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step1.value,2),s=_step_value[0],l=_step_value[1];i[s]||(i[s]=new Set);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=l[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c=_step2.value;i[s].add(c)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i});var n=Iy(function(){var a;var i=t.options,o=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;var l=(a=s._zod.propValues)==null?void 0:a[t.discriminator];if(!l||l.size===0)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(s),'"'));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=l[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var c=_step1.value;if(o.has(c))throw new Error('Duplicate discriminator value "'.concat(String(c),'"'));o.set(c,s)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o});e._zod.parse=function(i,o){var a=i.value;if(!Qg(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;var s=n.value.get(a==null?void 0:a[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),x4=X("$ZodIntersection",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value,o=t.left._zod.run({value:i,issues:[]},n),a=t.right._zod.run({value:i,issues:[]},n);return _instanceof(o,Promise)||_instanceof(a,Promise)?Promise.all([o,a]).then(function(param){var _param=_sliced_to_array(param,2),l=_param[0],c=_param[1];return Hoe(r,l,c)}):Hoe(r,o,a)}});function YD(e,t){if(e===t)return{valid:!0,data:e};if(_instanceof(e,Date)&&_instanceof(t,Date)&&+e==+t)return{valid:!0,data:e};if(Lm(e)&&Lm(t)){var r=Object.keys(t),n=Object.keys(e).filter(function(o){return r.indexOf(o)!==-1}),i=_object_spread({},e,t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=YD(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o].concat(_to_consumable_array(a.mergeErrorPath))};i[o]=a.data}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};var r10=[];for(var n10=0;n10<e.length;n10++){var i10=e[n10],o10=t[n10],a9=YD(i10,o10);if(!a9.valid)return{valid:!1,mergeErrorPath:[n10].concat(_to_consumable_array(a9.mergeErrorPath))};r10.push(a9.data)}return{valid:!0,data:r10}}return{valid:!1,mergeErrorPath:[]}}function Hoe(e,t,r){var n=new Map,i;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(s.code==="unrecognized_keys"){i!=null||(i=s);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=s.keys[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var l=_step1.value;n.has(l)||n.set(l,{}),n.get(l).l=!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else e.issues.push(s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined,_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator2=r.issues[Symbol.iterator](),_step2;!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){var s10=_step2.value;if(s10.code==="unrecognized_keys")try{for(var _iterator3=s10.keys[Symbol.iterator](),_step3;!(_iteratorNormalCompletion2=(_step3=_iterator3.next()).done);_iteratorNormalCompletion2=true){var l10=_step3.value;n.has(l10)||n.set(l10,{}),n.get(l10).r=!0}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}else e.issues.push(s10)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}var o=_to_consumable_array(n).filter(function(param){var _param=_sliced_to_array(param,2),s=_param[1];return s.l&&s.r}).map(function(param){var _param=_sliced_to_array(param,1),s=_param[0];return s});if(o.length&&i&&e.issues.push(_object_spread_props(_object_spread({},i),{keys:o})),Fm(e))return e;var a=YD(t.value,r.value);if(!a.valid)throw new Error("Unmergable intersection. Error path: ".concat(JSON.stringify(a.mergeErrorPath)));return e.value=a.data,e}var zy=X("$ZodTuple",function(e,t){sr.init(e,t);var r=t.items;e._zod.parse=function(n,i){var o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];var a=[],s=_to_consumable_array(r).reverse().findIndex(function(d){return d._zod.optin!=="optional"}),l=s===-1?0:r.length-s;if(!t.rest){var d=o.length>r.length,u=o.length<l-1;if(d||u)return n.issues.push(_object_spread_props(_object_spread({},d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length}),{input:o,inst:e,origin:"array"})),n}var c=-1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d10=_step.value;if(c++,c>=o.length&&c>=l)continue;var u10=d10._zod.run({value:o[c],issues:[]},i);_instanceof(u10,Promise)?a.push(u10.then(function(p){return sE(p,n,c)})):sE(u10,n,c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(t.rest){var d11=o.slice(r.length);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=d11[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u11=_step1.value;c++;var p=t.rest._zod.run({value:u11,issues:[]},i);_instanceof(p,Promise)?a.push(p.then(function(m){return sE(m,n,c)})):sE(p,n,c)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}return a.length?Promise.all(a).then(function(){return n}):n}});function sE(e,t,r){var _t_issues;e.issues.length&&(_t_issues=t.issues).push.apply(_t_issues,_to_consumable_array(Hl(r,e.issues))),t.value[r]=e.value}var y4=X("$ZodRecord",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;if(!Lm(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;var o=[],a=t.keyType._zod.values;if(a){r.value={};var s=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var c=_step.value;if(typeof c=="string"||typeof c=="number"||(typeof c==="undefined"?"undefined":_type_of(c))=="symbol"){var _r_issues;s.add(typeof c=="number"?c.toString():c);var d=t.valueType._zod.run({value:i[c],issues:[]},n);_instanceof(d,Promise)?o.push(d.then(function(u){var _r_issues;u.issues.length&&(_r_issues=r.issues).push.apply(_r_issues,_to_consumable_array(Hl(c,u.issues))),r.value[c]=u.value})):(d.issues.length&&(_r_issues=r.issues).push.apply(_r_issues,_to_consumable_array(Hl(c,d.issues))),r.value[c]=d.value)}};for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var l;for(var c in i)s.has(c)||(l=l!=null?l:[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l})}else{r.value={};var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{var _loop1=function(){var s=_step1.value;var _r_issues;if(s==="__proto__")return"continue";var l=t.keyType._zod.run({value:s,issues:[]},n);if(_instanceof(l,Promise))throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&iE.test(s)&&l.issues.length){var u=t.keyType._zod.run({value:Number(s),issues:[]},n);if(_instanceof(u,Promise))throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(function(u){return ol(u,n,Ri())}),input:s,path:[s],inst:e});return"continue"}var d=t.valueType._zod.run({value:i[s],issues:[]},n);_instanceof(d,Promise)?o.push(d.then(function(u){var _r_issues;u.issues.length&&(_r_issues=r.issues).push.apply(_r_issues,_to_consumable_array(Hl(s,u.issues))),r.value[l.value]=u.value})):(d.issues.length&&(_r_issues=r.issues).push.apply(_r_issues,_to_consumable_array(Hl(s,d.issues))),r.value[l.value]=d.value)};for(var _iterator1=Reflect.ownKeys(i)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true)_loop1()}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}return o.length?Promise.all(o).then(function(){return r}):r}}),v4=X("$ZodMap",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;if(!_instanceof(i,Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;var o=[];r.value=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];var l=t.keyType._zod.run({value:a,issues:[]},n),c=t.valueType._zod.run({value:s,issues:[]},n);_instanceof(l,Promise)||_instanceof(c,Promise)?o.push(Promise.all([l,c]).then(function(param){var _param=_sliced_to_array(param,2),d=_param[0],u=_param[1];Zoe(d,u,r,a,i,e,n)})):Zoe(l,c,r,a,i,e,n)};for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o.length?Promise.all(o).then(function(){return r}):r}});function Zoe(e,t,r,n,i,o,a){var _r_issues,_r_issues1;e.issues.length&&(kw.has(typeof n==="undefined"?"undefined":_type_of(n))?(_r_issues=r.issues).push.apply(_r_issues,_to_consumable_array(Hl(n,e.issues))):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(function(s){return ol(s,a,Ri())})})),t.issues.length&&(kw.has(typeof n==="undefined"?"undefined":_type_of(n))?(_r_issues1=r.issues).push.apply(_r_issues1,_to_consumable_array(Hl(n,t.issues))):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(function(s){return ol(s,a,Ri())})})),r.value.set(e.value,t.value)}var _4=X("$ZodSet",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;if(!_instanceof(i,Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;var o=[];r.value=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;var s=t.valueType._zod.run({value:a,issues:[]},n);_instanceof(s,Promise)?o.push(s.then(function(l){return Koe(l,r)})):Koe(s,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o.length?Promise.all(o).then(function(){return r}):r}});function Koe(e,t){var _t_issues;e.issues.length&&(_t_issues=t.issues).push.apply(_t_issues,_to_consumable_array(e.issues)),t.value.add(e.value)}var b4=X("$ZodEnum",function(e,t){sr.init(e,t);var r=ww(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp("^(".concat(r.filter(function(i){return kw.has(typeof i==="undefined"?"undefined":_type_of(i))}).map(function(i){return typeof i=="string"?Du(i):i.toString()}).join("|"),")$")),e._zod.parse=function(i,o){var a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:e}),i}}),w4=X("$ZodLiteral",function(e,t){if(sr.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");var r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp("^(".concat(t.values.map(function(n){return typeof n=="string"?Du(n):n?Du(n.toString()):String(n)}).join("|"),")$")),e._zod.parse=function(n,i){var o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),S4=X("$ZodFile",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){var i=r.value;return _instanceof(i,File)||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),k4=X("$ZodTransform",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){if(n.direction==="backward")throw new $m(e.constructor.name);var i=t.transform(r.value,r);if(n.async)return(_instanceof(i,Promise)?i:Promise.resolve(i)).then(function(a){return r.value=a,r});if(_instanceof(i,Promise))throw new Sc;return r.value=i,r}});function Qoe(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var jy=X("$ZodOptional",function(e,t){sr.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mr(e._zod,"values",function(){return t.innerType._zod.values?new Set(_to_consumable_array(t.innerType._zod.values).concat([void 0])):void 0}),Mr(e._zod,"pattern",function(){var r=t.innerType._zod.pattern;return r?new RegExp("^(".concat(Sw(r.source),")?$")):void 0}),e._zod.parse=function(r,n){if(t.innerType._zod.optin==="optional"){var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return Qoe(o,r.value)}):Qoe(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),C4=X("$ZodExactOptional",function(e,t){jy.init(e,t),Mr(e._zod,"values",function(){return t.innerType._zod.values}),Mr(e._zod,"pattern",function(){return t.innerType._zod.pattern}),e._zod.parse=function(r,n){return t.innerType._zod.run(r,n)}}),E4=X("$ZodNullable",function(e,t){sr.init(e,t),Mr(e._zod,"optin",function(){return t.innerType._zod.optin}),Mr(e._zod,"optout",function(){return t.innerType._zod.optout}),Mr(e._zod,"pattern",function(){var r=t.innerType._zod.pattern;return r?new RegExp("^(".concat(Sw(r.source),"|null)$")):void 0}),Mr(e._zod,"values",function(){return t.innerType._zod.values?new Set(_to_consumable_array(t.innerType._zod.values).concat([null])):void 0}),e._zod.parse=function(r,n){return r.value===null?r:t.innerType._zod.run(r,n)}}),T4=X("$ZodDefault",function(e,t){sr.init(e,t),e._zod.optin="optional",Mr(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(r,n){if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return Joe(o,t)}):Joe(i,t)}});function Joe(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var A4=X("$ZodPrefault",function(e,t){sr.init(e,t),e._zod.optin="optional",Mr(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(r,n){return n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n)}}),I4=X("$ZodNonOptional",function(e,t){sr.init(e,t),Mr(e._zod,"values",function(){var r=t.innerType._zod.values;return r?new Set(_to_consumable_array(r).filter(function(n){return n!==void 0})):void 0}),e._zod.parse=function(r,n){var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return Yoe(o,e)}):Yoe(i,e)}});function Yoe(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var P4=X("$ZodSuccess",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){if(n.direction==="backward")throw new $m("ZodSuccess");var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return r.value=o.issues.length===0,r}):(r.value=i.issues.length===0,r)}}),R4=X("$ZodCatch",function(e,t){sr.init(e,t),Mr(e._zod,"optin",function(){return t.innerType._zod.optin}),Mr(e._zod,"optout",function(){return t.innerType._zod.optout}),Mr(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(r,n){if(n.direction==="backward")return t.innerType._zod.run(r,n);var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return r.value=o.value,o.issues.length&&(r.value=t.catchValue(_object_spread_props(_object_spread({},r),{error:{issues:o.issues.map(function(a){return ol(a,n,Ri())})},input:r.value})),r.issues=[]),r}):(r.value=i.value,i.issues.length&&(r.value=t.catchValue(_object_spread_props(_object_spread({},r),{error:{issues:i.issues.map(function(o){return ol(o,n,Ri())})},input:r.value})),r.issues=[]),r)}}),M4=X("$ZodNaN",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){return(typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r}}),O4=X("$ZodPipe",function(e,t){sr.init(e,t),Mr(e._zod,"values",function(){return t.in._zod.values}),Mr(e._zod,"optin",function(){return t.in._zod.optin}),Mr(e._zod,"optout",function(){return t.out._zod.optout}),Mr(e._zod,"propValues",function(){return t.in._zod.propValues}),e._zod.parse=function(r,n){if(n.direction==="backward"){var o=t.out._zod.run(r,n);return _instanceof(o,Promise)?o.then(function(a){return lE(a,t.in,n)}):lE(o,t.in,n)}var i=t.in._zod.run(r,n);return _instanceof(i,Promise)?i.then(function(o){return lE(o,t.out,n)}):lE(i,t.out,n)}});function lE(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var r0=X("$ZodCodec",function(e,t){sr.init(e,t),Mr(e._zod,"values",function(){return t.in._zod.values}),Mr(e._zod,"optin",function(){return t.in._zod.optin}),Mr(e._zod,"optout",function(){return t.out._zod.optout}),Mr(e._zod,"propValues",function(){return t.in._zod.propValues}),e._zod.parse=function(r,n){if((n.direction||"forward")==="forward"){var o=t.in._zod.run(r,n);return _instanceof(o,Promise)?o.then(function(a){return uE(a,t,n)}):uE(o,t,n)}else{var o10=t.out._zod.run(r,n);return _instanceof(o10,Promise)?o10.then(function(a){return uE(a,t,n)}):uE(o10,t,n)}}});function uE(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){var i=t.transform(e.value,e);return _instanceof(i,Promise)?i.then(function(o){return cE(e,o,t.out,r)}):cE(e,i,t.out,r)}else{var i10=t.reverseTransform(e.value,e);return _instanceof(i10,Promise)?i10.then(function(o){return cE(e,o,t.in,r)}):cE(e,i10,t.in,r)}}function cE(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}var $4=X("$ZodReadonly",function(e,t){sr.init(e,t),Mr(e._zod,"propValues",function(){return t.innerType._zod.propValues}),Mr(e._zod,"values",function(){return t.innerType._zod.values}),Mr(e._zod,"optin",function(){var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),Mr(e._zod,"optout",function(){var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=function(r,n){if(n.direction==="backward")return t.innerType._zod.run(r,n);var i=t.innerType._zod.run(r,n);return _instanceof(i,Promise)?i.then(Xoe):Xoe(i)}});function Xoe(e){return e.value=Object.freeze(e.value),e}var N4=X("$ZodTemplateLiteral",function(e,t){sr.init(e,t);var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if((typeof n==="undefined"?"undefined":_type_of(n))=="object"&&n!==null){if(!n._zod.pattern)throw new Error("Invalid template literal part, no pattern found: ".concat(_to_consumable_array(n._zod.traits).shift()));var i=_instanceof(n._zod.pattern,RegExp)?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error("Invalid template literal part: ".concat(n._zod.traits));var o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,a))}else if(n===null||BN.has(typeof n==="undefined"?"undefined":_type_of(n)))r.push(Du("".concat(n)));else throw new Error("Invalid template literal part: ".concat(n))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}e._zod.pattern=new RegExp("^".concat(r.join(""),"$")),e._zod.parse=function(n,i){var o;return typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:(o=t.format)!=null?o:"template_literal",pattern:e._zod.pattern.source}),n)}}),D4=X("$ZodFunction",function(e,t){return sr.init(e,t),e._def=t,e._zod.def=t,e.implement=function(r){if(typeof r!="function")throw new Error("implement() must be called with a function");return function(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}var i=e._def.input?zm(e._def.input,n):n,o=Reflect.apply(r,this,i);return e._def.output?zm(e._def.output,o):o}},e.implementAsync=function(r){if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return function(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}return _async_to_generator(function(){var i,o,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e._def.input)return[3,2];return[4,jm(e._def.input,n)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=n;_state.label=3;case 3:i=_tmp;return[4,Reflect.apply(r,this,i)];case 4:o=_state.sent();if(!e._def.output)return[3,6];return[4,jm(e._def.output,o)];case 5:_tmp1=_state.sent();return[3,7];case 6:_tmp1=o;_state.label=7;case 7:return[2,_tmp1]}})}).call(this)}},e._zod.parse=function(r,n){return typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r)},e.input=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}var n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new zy({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=function(r){var n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e}),L4=X("$ZodPromise",function(e,t){sr.init(e,t),e._zod.parse=function(r,n){return Promise.resolve(r.value).then(function(i){return t.innerType._zod.run({value:i,issues:[]},n)})}}),F4=X("$ZodLazy",function(e,t){sr.init(e,t),Mr(e._zod,"innerType",function(){return t.getter()}),Mr(e._zod,"pattern",function(){var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.pattern}),Mr(e._zod,"propValues",function(){var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.propValues}),Mr(e._zod,"optin",function(){var r,n,i;return(i=(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optin)!=null?i:void 0}),Mr(e._zod,"optout",function(){var r,n,i;return(i=(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optout)!=null?i:void 0}),e._zod.parse=function(r,n){return e._zod.innerType._zod.run(r,n)}}),z4=X("$ZodCustom",function(e,t){qn.init(e,t),sr.init(e,t),e._zod.parse=function(r,n){return r},e._zod.check=function(r){var n=r.value,i=t.fn(n);if(_instanceof(i,Promise))return i.then(function(o){return eae(o,r,n,e)});eae(i,r,n,e)}});function eae(e,t,r,n){var i;if(!e){var o={code:"custom",input:r,inst:n,path:_to_consumable_array((i=n._zod.def.path)!=null?i:[]),continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ry(o))}}var jd={};$l(jd,{ar:function(){return oae},az:function(){return aae},be:function(){return lae},bg:function(){return uae},ca:function(){return cae},cs:function(){return dae},da:function(){return pae},de:function(){return fae},en:function(){return fE},eo:function(){return mae},es:function(){return hae},fa:function(){return gae},fi:function(){return xae},fr:function(){return yae},frCA:function(){return vae},he:function(){return _ae},hu:function(){return bae},hy:function(){return Sae},id:function(){return kae},is:function(){return Cae},it:function(){return Eae},ja:function(){return Tae},ka:function(){return Aae},kh:function(){return Iae},km:function(){return mE},ko:function(){return Pae},lt:function(){return Mae},mk:function(){return Oae},ms:function(){return $ae},nl:function(){return Nae},no:function(){return Dae},ota:function(){return Lae},pl:function(){return zae},ps:function(){return Fae},pt:function(){return jae},ru:function(){return Bae},sl:function(){return qae},sv:function(){return Wae},ta:function(){return Vae},th:function(){return Gae},tr:function(){return Hae},ua:function(){return Zae},uk:function(){return hE},ur:function(){return Kae},uz:function(){return Qae},vi:function(){return Jae},yo:function(){return ese},zhCN:function(){return Yae},zhTW:function(){return Xae}});var MGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};var r={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"مدخلات غير مقبولة: يفترض إدخال instanceof ".concat(i.expected,"، ولكن تم إدخال ").concat(m):"مدخلات غير مقبولة: يفترض إدخال ".concat(u,"، ولكن تم إدخال ").concat(m)}case"invalid_value":return i.values.length===1?"مدخلات غير مقبولة: يفترض إدخال ".concat(Ke(i.values[0])):"اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?" أكبر من اللازم: يفترض أن تكون ".concat((s=i.origin)!=null?s:"القيمة"," ").concat(u10," ").concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"عنصر"):"أكبر من اللازم: يفترض أن تكون ".concat((c=i.origin)!=null?c:"القيمة"," ").concat(u10," ").concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"أصغر من اللازم: يفترض لـ ".concat(i.origin," أن يكون ").concat(u11," ").concat(i.minimum.toString()," ").concat(p11.unit):"أصغر من اللازم: يفترض لـ ".concat(i.origin," أن يكون ").concat(u11," ").concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'نَص غير مقبول: يجب أن يبدأ بـ "'.concat(i.prefix,'"'):u12.format==="ends_with"?'نَص غير مقبول: يجب أن ينتهي بـ "'.concat(u12.suffix,'"'):u12.format==="includes"?'نَص غير مقبول: يجب أن يتضمَّن "'.concat(u12.includes,'"'):u12.format==="regex"?"نَص غير مقبول: يجب أن يطابق النمط ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," غير مقبول")}case"not_multiple_of":return"رقم غير مقبول: يجب أن يكون من مضاعفات ".concat(i.divisor);case"unrecognized_keys":return"معرف".concat(i.keys.length>1?"ات":""," غريب").concat(i.keys.length>1?"ة":"",": ").concat(Ce(i.keys,"، "));case"invalid_key":return"معرف غير مقبول في ".concat(i.origin);case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return"مدخل غير مقبول في ".concat(i.origin);default:return"مدخل غير مقبول"}}};function oae(){return{localeError:MGe()}}var OGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};var r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Yanlış dəyər: g\xf6zlənilən instanceof ".concat(i.expected,", daxil olan ").concat(m):"Yanlış dəyər: g\xf6zlənilən ".concat(u,", daxil olan ").concat(m)}case"invalid_value":return i.values.length===1?"Yanlış dəyər: g\xf6zlənilən ".concat(Ke(i.values[0])):"Yanlış se\xe7im: aşağıdakılardan biri olmalıdır: ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"\xc7ox b\xf6y\xfck: g\xf6zlənilən ".concat((s=i.origin)!=null?s:"dəyər"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"element"):"\xc7ox b\xf6y\xfck: g\xf6zlənilən ".concat((c=i.origin)!=null?c:"dəyər"," ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"\xc7ox ki\xe7ik: g\xf6zlənilən ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"\xc7ox ki\xe7ik: g\xf6zlənilən ".concat(i.origin," ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Yanlış mətn: "'.concat(u12.prefix,'" ilə başlamalıdır'):u12.format==="ends_with"?'Yanlış mətn: "'.concat(u12.suffix,'" ilə bitməlidir'):u12.format==="includes"?'Yanlış mətn: "'.concat(u12.includes,'" daxil olmalıdır'):u12.format==="regex"?"Yanlış mətn: ".concat(u12.pattern," şablonuna uyğun olmalıdır"):"Yanlış ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Yanlış ədəd: ".concat(i.divisor," ilə b\xf6l\xfcnə bilən olmalıdır");case"unrecognized_keys":return"Tanınmayan a\xe7ar".concat(i.keys.length>1?"lar":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," daxilində yanlış a\xe7ar");case"invalid_union":return"Yanlış dəyər";case"invalid_element":return"".concat(i.origin," daxilində yanlış dəyər");default:return"Yanlış dəyər"}}};function aae(){return{localeError:OGe()}}function sae(e,t,r,n){var i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?n:o===1?t:o>=2&&o<=4?r:n}var $Ge=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};var r={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},n={nan:"NaN",number:"лік",array:"масіў"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"Няправільны ўвод: чакаўся instanceof ".concat(i.expected,", атрымана ").concat(p):"Няправільны ўвод: чакаўся ".concat(d,", атрымана ").concat(p)}case"invalid_value":return i.values.length===1?"Няправільны ўвод: чакалася ".concat(Ke(i.values[0])):"Няправільны варыянт: чакаўся адзін з ".concat(Ce(i.values,"|"));case"too_big":{var d10=i.inclusive?"<=":"<",u10=t(i.origin);if(u10){var p10=Number(i.maximum),m=sae(p10,u10.unit.one,u10.unit.few,u10.unit.many);return"Занадта вялікі: чакалася, што ".concat((s=i.origin)!=null?s:"значэнне"," павінна ").concat(u10.verb," ").concat(d10).concat(i.maximum.toString()," ").concat(m)}return"Занадта вялікі: чакалася, што ".concat((l=i.origin)!=null?l:"значэнне"," павінна быць ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?">=":">",u11=t(i.origin);if(u11){var p11=Number(i.minimum),m10=sae(p11,u11.unit.one,u11.unit.few,u11.unit.many);return"Занадта малы: чакалася, што ".concat(i.origin," павінна ").concat(u11.verb," ").concat(d11).concat(i.minimum.toString()," ").concat(m10)}return"Занадта малы: чакалася, што ".concat(i.origin," павінна быць ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'Няправільны радок: павінен пачынацца з "'.concat(d12.prefix,'"'):d12.format==="ends_with"?'Няправільны радок: павінен заканчвацца на "'.concat(d12.suffix,'"'):d12.format==="includes"?'Няправільны радок: павінен змяшчаць "'.concat(d12.includes,'"'):d12.format==="regex"?"Няправільны радок: павінен адпавядаць шаблону ".concat(d12.pattern):"Няправільны ".concat((c=r[d12.format])!=null?c:i.format)}case"not_multiple_of":return"Няправільны лік: павінен быць кратным ".concat(i.divisor);case"unrecognized_keys":return"Нераспазнаны ".concat(i.keys.length>1?"ключы":"ключ",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Няправільны ключ у ".concat(i.origin);case"invalid_union":return"Няправільны ўвод";case"invalid_element":return"Няправільнае значэнне ў ".concat(i.origin);default:return"Няправільны ўвод"}}};function lae(){return{localeError:$Ge()}}var NGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};var r={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},n={nan:"NaN",number:"число",array:"масив"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Невалиден вход: очакван instanceof ".concat(i.expected,", получен ").concat(m):"Невалиден вход: очакван ".concat(u,", получен ").concat(m)}case"invalid_value":return i.values.length===1?"Невалиден вход: очакван ".concat(Ke(i.values[0])):"Невалидна опция: очаквано едно от ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Твърде голямо: очаква се ".concat((s=i.origin)!=null?s:"стойност"," да съдържа ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"елемента"):"Твърде голямо: очаква се ".concat((c=i.origin)!=null?c:"стойност"," да бъде ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Твърде малко: очаква се ".concat(i.origin," да съдържа ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Твърде малко: очаква се ".concat(i.origin," да бъде ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;if(u12.format==="starts_with")return'Невалиден низ: трябва да започва с "'.concat(u12.prefix,'"');if(u12.format==="ends_with")return'Невалиден низ: трябва да завършва с "'.concat(u12.suffix,'"');if(u12.format==="includes")return'Невалиден низ: трябва да включва "'.concat(u12.includes,'"');if(u12.format==="regex")return"Невалиден низ: трябва да съвпада с ".concat(u12.pattern);var p12="Невалиден";return u12.format==="emoji"&&(p12="Невалидно"),u12.format==="datetime"&&(p12="Невалидно"),u12.format==="date"&&(p12="Невалидна"),u12.format==="time"&&(p12="Невалидно"),u12.format==="duration"&&(p12="Невалидна"),"".concat(p12," ").concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Невалидно число: трябва да бъде кратно на ".concat(i.divisor);case"unrecognized_keys":return"Неразпознат".concat(i.keys.length>1?"и":""," ключ").concat(i.keys.length>1?"ове":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Невалиден ключ в ".concat(i.origin);case"invalid_union":return"Невалиден вход";case"invalid_element":return"Невалидна стойност в ".concat(i.origin);default:return"Невалиден вход"}}};function uae(){return{localeError:NGe()}}var DGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"car\xe0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};var r={regex:"entrada",email:"adre\xe7a electr\xf2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xe7a IPv4",ipv6:"adre\xe7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xfamero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Tipus inv\xe0lid: s'esperava instanceof ".concat(i.expected,", s'ha rebut ").concat(m):"Tipus inv\xe0lid: s'esperava ".concat(u,", s'ha rebut ").concat(m)}case"invalid_value":return i.values.length===1?"Valor inv\xe0lid: s'esperava ".concat(Ke(i.values[0])):"Opci\xf3 inv\xe0lida: s'esperava una de ".concat(Ce(i.values," o "));case"too_big":{var u10=i.inclusive?"com a m\xe0xim":"menys de",p10=t(i.origin);return p10?"Massa gran: s'esperava que ".concat((s=i.origin)!=null?s:"el valor"," contingu\xe9s ").concat(u10," ").concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elements"):"Massa gran: s'esperava que ".concat((c=i.origin)!=null?c:"el valor"," fos ").concat(u10," ").concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?"com a m\xednim":"m\xe9s de",p11=t(i.origin);return p11?"Massa petit: s'esperava que ".concat(i.origin," contingu\xe9s ").concat(u11," ").concat(i.minimum.toString()," ").concat(p11.unit):"Massa petit: s'esperava que ".concat(i.origin," fos ").concat(u11," ").concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Format inv\xe0lid: ha de comen\xe7ar amb "'.concat(u12.prefix,'"'):u12.format==="ends_with"?"Format inv\xe0lid: ha d'acabar amb \"".concat(u12.suffix,'"'):u12.format==="includes"?"Format inv\xe0lid: ha d'incloure \"".concat(u12.includes,'"'):u12.format==="regex"?"Format inv\xe0lid: ha de coincidir amb el patr\xf3 ".concat(u12.pattern):"Format inv\xe0lid per a ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"N\xfamero inv\xe0lid: ha de ser m\xfaltiple de ".concat(i.divisor);case"unrecognized_keys":return"Clau".concat(i.keys.length>1?"s":""," no reconeguda").concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Clau inv\xe0lida a ".concat(i.origin);case"invalid_union":return"Entrada inv\xe0lida";case"invalid_element":return"Element inv\xe0lid a ".concat(i.origin);default:return"Entrada inv\xe0lida"}}};function cae(){return{localeError:DGe()}}var LGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"znaků",verb:"m\xedt"},file:{unit:"bajtů",verb:"m\xedt"},array:{unit:"prvků",verb:"m\xedt"},set:{unit:"prvků",verb:"m\xedt"}};var r={regex:"regul\xe1rn\xed v\xfdraz",email:"e-mailov\xe1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve form\xe1tu ISO",date:"datum ve form\xe1tu ISO",time:"čas ve form\xe1tu ISO",duration:"doba trv\xe1n\xed ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zak\xf3dovan\xfd ve form\xe1tu base64",base64url:"řetězec zak\xf3dovan\xfd ve form\xe1tu base64url",json_string:"řetězec ve form\xe1tu JSON",e164:"č\xedslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"č\xedslo",string:"řetězec",function:"funkce",array:"pole"};return function(i){var o,a,s,l,c,d,u,p,m;switch(i.code){case"invalid_type":{var h=(o=n[i.expected])!=null?o:i.expected,g=Je(i.input),x=(a=n[g])!=null?a:g;return/^[A-Z]/.test(i.expected)?"Neplatn\xfd vstup: oček\xe1v\xe1no instanceof ".concat(i.expected,", obdrženo ").concat(x):"Neplatn\xfd vstup: oček\xe1v\xe1no ".concat(h,", obdrženo ").concat(x)}case"invalid_value":return i.values.length===1?"Neplatn\xfd vstup: oček\xe1v\xe1no ".concat(Ke(i.values[0])):"Neplatn\xe1 možnost: oček\xe1v\xe1na jedna z hodnot ".concat(Ce(i.values,"|"));case"too_big":{var h10=i.inclusive?"<=":"<",g10=t(i.origin);return g10?"Hodnota je př\xedliš velk\xe1: ".concat((s=i.origin)!=null?s:"hodnota"," mus\xed m\xedt ").concat(h10).concat(i.maximum.toString()," ").concat((l=g10.unit)!=null?l:"prvků"):"Hodnota je př\xedliš velk\xe1: ".concat((c=i.origin)!=null?c:"hodnota"," mus\xed b\xfdt ").concat(h10).concat(i.maximum.toString())}case"too_small":{var h11=i.inclusive?">=":">",g11=t(i.origin);return g11?"Hodnota je př\xedliš mal\xe1: ".concat((d=i.origin)!=null?d:"hodnota"," mus\xed m\xedt ").concat(h11).concat(i.minimum.toString()," ").concat((u=g11.unit)!=null?u:"prvků"):"Hodnota je př\xedliš mal\xe1: ".concat((p=i.origin)!=null?p:"hodnota"," mus\xed b\xfdt ").concat(h11).concat(i.minimum.toString())}case"invalid_format":{var h12=i;return h12.format==="starts_with"?'Neplatn\xfd řetězec: mus\xed zač\xednat na "'.concat(h12.prefix,'"'):h12.format==="ends_with"?'Neplatn\xfd řetězec: mus\xed končit na "'.concat(h12.suffix,'"'):h12.format==="includes"?'Neplatn\xfd řetězec: mus\xed obsahovat "'.concat(h12.includes,'"'):h12.format==="regex"?"Neplatn\xfd řetězec: mus\xed odpov\xeddat vzoru ".concat(h12.pattern):"Neplatn\xfd form\xe1t ".concat((m=r[h12.format])!=null?m:i.format)}case"not_multiple_of":return"Neplatn\xe9 č\xedslo: mus\xed b\xfdt n\xe1sobkem ".concat(i.divisor);case"unrecognized_keys":return"Nezn\xe1m\xe9 kl\xedče: ".concat(Ce(i.keys,", "));case"invalid_key":return"Neplatn\xfd kl\xedč v ".concat(i.origin);case"invalid_union":return"Neplatn\xfd vstup";case"invalid_element":return"Neplatn\xe1 hodnota v ".concat(i.origin);default:return"Neplatn\xfd vstup"}}};function dae(){return{localeError:LGe()}}var FGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};var r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xe6t",date:"ISO-dato",time:"ISO-klokkesl\xe6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xe5de",ipv6:"IPv6-omr\xe5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xe6t",file:"fil"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Ugyldigt input: forventede instanceof ".concat(i.expected,", fik ").concat(m):"Ugyldigt input: forventede ".concat(u,", fik ").concat(m)}case"invalid_value":return i.values.length===1?"Ugyldig v\xe6rdi: forventede ".concat(Ke(i.values[0])):"Ugyldigt valg: forventede en af f\xf8lgende ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin),m10=(s=n[i.origin])!=null?s:i.origin;return p10?"For stor: forventede ".concat(m10!=null?m10:"value"," ").concat(p10.verb," ").concat(u10," ").concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementer"):"For stor: forventede ".concat(m10!=null?m10:"value"," havde ").concat(u10," ").concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin),m11=(c=n[i.origin])!=null?c:i.origin;return p11?"For lille: forventede ".concat(m11," ").concat(p11.verb," ").concat(u11," ").concat(i.minimum.toString()," ").concat(p11.unit):"For lille: forventede ".concat(m11," havde ").concat(u11," ").concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Ugyldig streng: skal starte med "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Ugyldig streng: skal ende med "'.concat(u12.suffix,'"'):u12.format==="includes"?'Ugyldig streng: skal indeholde "'.concat(u12.includes,'"'):u12.format==="regex"?"Ugyldig streng: skal matche m\xf8nsteret ".concat(u12.pattern):"Ugyldig ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Ugyldigt tal: skal v\xe6re deleligt med ".concat(i.divisor);case"unrecognized_keys":return"".concat(i.keys.length>1?"Ukendte n\xf8gler":"Ukendt n\xf8gle",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Ugyldig n\xf8gle i ".concat(i.origin);case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return"Ugyldig v\xe6rdi i ".concat(i.origin);default:return"Ugyldigt input"}}};function pae(){return{localeError:FGe()}}var zGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};var r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Ung\xfcltige Eingabe: erwartet instanceof ".concat(i.expected,", erhalten ").concat(m):"Ung\xfcltige Eingabe: erwartet ".concat(u,", erhalten ").concat(m)}case"invalid_value":return i.values.length===1?"Ung\xfcltige Eingabe: erwartet ".concat(Ke(i.values[0])):"Ung\xfcltige Option: erwartet eine von ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Zu gro\xdf: erwartet, dass ".concat((s=i.origin)!=null?s:"Wert"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"Elemente"," hat"):"Zu gro\xdf: erwartet, dass ".concat((c=i.origin)!=null?c:"Wert"," ").concat(u10).concat(i.maximum.toString()," ist")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Zu klein: erwartet, dass ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," hat"):"Zu klein: erwartet, dass ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ist")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Ung\xfcltiger String: muss mit "'.concat(u12.prefix,'" beginnen'):u12.format==="ends_with"?'Ung\xfcltiger String: muss mit "'.concat(u12.suffix,'" enden'):u12.format==="includes"?'Ung\xfcltiger String: muss "'.concat(u12.includes,'" enthalten'):u12.format==="regex"?"Ung\xfcltiger String: muss dem Muster ".concat(u12.pattern," entsprechen"):"Ung\xfcltig: ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Ung\xfcltige Zahl: muss ein Vielfaches von ".concat(i.divisor," sein");case"unrecognized_keys":return"".concat(i.keys.length>1?"Unbekannte Schl\xfcssel":"Unbekannter Schl\xfcssel",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Ung\xfcltiger Schl\xfcssel in ".concat(i.origin);case"invalid_union":return"Ung\xfcltige Eingabe";case"invalid_element":return"Ung\xfcltiger Wert in ".concat(i.origin);default:return"Ung\xfcltige Eingabe"}}};function fae(){return{localeError:zGe()}}var jGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};var r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return"Invalid input: expected ".concat(u,", received ").concat(m)}case"invalid_value":return i.values.length===1?"Invalid input: expected ".concat(Ke(i.values[0])):"Invalid option: expected one of ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Too big: expected ".concat((s=i.origin)!=null?s:"value"," to have ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elements"):"Too big: expected ".concat((c=i.origin)!=null?c:"value"," to be ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Too small: expected ".concat(i.origin," to have ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Too small: expected ".concat(i.origin," to be ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Invalid string: must start with "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Invalid string: must end with "'.concat(u12.suffix,'"'):u12.format==="includes"?'Invalid string: must include "'.concat(u12.includes,'"'):u12.format==="regex"?"Invalid string: must match pattern ".concat(u12.pattern):"Invalid ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Invalid number: must be a multiple of ".concat(i.divisor);case"unrecognized_keys":return"Unrecognized key".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Invalid key in ".concat(i.origin);case"invalid_union":return"Invalid input";case"invalid_element":return"Invalid value in ".concat(i.origin);default:return"Invalid input"}}};function fE(){return{localeError:jGe()}}var UGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};var r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Nevalida enigo: atendiĝis instanceof ".concat(i.expected,", riceviĝis ").concat(m):"Nevalida enigo: atendiĝis ".concat(u,", riceviĝis ").concat(m)}case"invalid_value":return i.values.length===1?"Nevalida enigo: atendiĝis ".concat(Ke(i.values[0])):"Nevalida opcio: atendiĝis unu el ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Tro granda: atendiĝis ke ".concat((s=i.origin)!=null?s:"valoro"," havu ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementojn"):"Tro granda: atendiĝis ke ".concat((c=i.origin)!=null?c:"valoro"," havu ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Tro malgranda: atendiĝis ke ".concat(i.origin," havu ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Tro malgranda: atendiĝis ke ".concat(i.origin," estu ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Nevalida karaktraro: devas komenciĝi per "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Nevalida karaktraro: devas finiĝi per "'.concat(u12.suffix,'"'):u12.format==="includes"?'Nevalida karaktraro: devas inkluzivi "'.concat(u12.includes,'"'):u12.format==="regex"?"Nevalida karaktraro: devas kongrui kun la modelo ".concat(u12.pattern):"Nevalida ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Nevalida nombro: devas esti oblo de ".concat(i.divisor);case"unrecognized_keys":return"Nekonata".concat(i.keys.length>1?"j":""," ŝlosilo").concat(i.keys.length>1?"j":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Nevalida ŝlosilo en ".concat(i.origin);case"invalid_union":return"Nevalida enigo";case"invalid_element":return"Nevalida valoro en ".concat(i.origin);default:return"Nevalida enigo"}}};function mae(){return{localeError:UGe()}}var BGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};var r={regex:"entrada",email:"direcci\xf3n de correo electr\xf3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xf3n ISO",ipv4:"direcci\xf3n IPv4",ipv6:"direcci\xf3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xfamero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xfamero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xfamero grande",symbol:"s\xedmbolo",undefined:"indefinido",null:"nulo",function:"funci\xf3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xf3n",union:"uni\xf3n",literal:"literal",promise:"promesa",void:"vac\xedo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return function(i){var o,a,s,l,c,d,u,p;switch(i.code){case"invalid_type":{var m=(o=n[i.expected])!=null?o:i.expected,h=Je(i.input),g=(a=n[h])!=null?a:h;return/^[A-Z]/.test(i.expected)?"Entrada inv\xe1lida: se esperaba instanceof ".concat(i.expected,", recibido ").concat(g):"Entrada inv\xe1lida: se esperaba ".concat(m,", recibido ").concat(g)}case"invalid_value":return i.values.length===1?"Entrada inv\xe1lida: se esperaba ".concat(Ke(i.values[0])):"Opci\xf3n inv\xe1lida: se esperaba una de ".concat(Ce(i.values,"|"));case"too_big":{var m10=i.inclusive?"<=":"<",h10=t(i.origin),g10=(s=n[i.origin])!=null?s:i.origin;return h10?"Demasiado grande: se esperaba que ".concat(g10!=null?g10:"valor"," tuviera ").concat(m10).concat(i.maximum.toString()," ").concat((l=h10.unit)!=null?l:"elementos"):"Demasiado grande: se esperaba que ".concat(g10!=null?g10:"valor"," fuera ").concat(m10).concat(i.maximum.toString())}case"too_small":{var m11=i.inclusive?">=":">",h11=t(i.origin),g11=(c=n[i.origin])!=null?c:i.origin;return h11?"Demasiado peque\xf1o: se esperaba que ".concat(g11," tuviera ").concat(m11).concat(i.minimum.toString()," ").concat(h11.unit):"Demasiado peque\xf1o: se esperaba que ".concat(g11," fuera ").concat(m11).concat(i.minimum.toString())}case"invalid_format":{var m12=i;return m12.format==="starts_with"?'Cadena inv\xe1lida: debe comenzar con "'.concat(m12.prefix,'"'):m12.format==="ends_with"?'Cadena inv\xe1lida: debe terminar en "'.concat(m12.suffix,'"'):m12.format==="includes"?'Cadena inv\xe1lida: debe incluir "'.concat(m12.includes,'"'):m12.format==="regex"?"Cadena inv\xe1lida: debe coincidir con el patr\xf3n ".concat(m12.pattern):"Inv\xe1lido ".concat((d=r[m12.format])!=null?d:i.format)}case"not_multiple_of":return"N\xfamero inv\xe1lido: debe ser m\xfaltiplo de ".concat(i.divisor);case"unrecognized_keys":return"Llave".concat(i.keys.length>1?"s":""," desconocida").concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Llave inv\xe1lida en ".concat((u=n[i.origin])!=null?u:i.origin);case"invalid_union":return"Entrada inv\xe1lida";case"invalid_element":return"Valor inv\xe1lido en ".concat((p=n[i.origin])!=null?p:i.origin);default:return"Entrada inv\xe1lida"}}};function hae(){return{localeError:BGe()}}var qGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};var r={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},n={nan:"NaN",number:"عدد",array:"آرایه"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"ورودی نامعتبر: میبایست instanceof ".concat(i.expected," میبود، ").concat(m," دریافت شد"):"ورودی نامعتبر: میبایست ".concat(u," میبود، ").concat(m," دریافت شد")}case"invalid_value":return i.values.length===1?"ورودی نامعتبر: میبایست ".concat(Ke(i.values[0])," میبود"):"گزینه نامعتبر: میبایست یکی از ".concat(Ce(i.values,"|")," میبود");case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"خیلی بزرگ: ".concat((s=i.origin)!=null?s:"مقدار"," باید ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"عنصر"," باشد"):"خیلی بزرگ: ".concat((c=i.origin)!=null?c:"مقدار"," باید ").concat(u10).concat(i.maximum.toString()," باشد")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"خیلی کوچک: ".concat(i.origin," باید ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," باشد"):"خیلی کوچک: ".concat(i.origin," باید ").concat(u11).concat(i.minimum.toString()," باشد")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'رشته نامعتبر: باید با "'.concat(u12.prefix,'" شروع شود'):u12.format==="ends_with"?'رشته نامعتبر: باید با "'.concat(u12.suffix,'" تمام شود'):u12.format==="includes"?'رشته نامعتبر: باید شامل "'.concat(u12.includes,'" باشد'):u12.format==="regex"?"رشته نامعتبر: باید با الگوی ".concat(u12.pattern," مطابقت داشته باشد"):"".concat((d=r[u12.format])!=null?d:i.format," نامعتبر")}case"not_multiple_of":return"عدد نامعتبر: باید مضرب ".concat(i.divisor," باشد");case"unrecognized_keys":return"کلید".concat(i.keys.length>1?"های":""," ناشناس: ").concat(Ce(i.keys,", "));case"invalid_key":return"کلید ناشناس در ".concat(i.origin);case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return"مقدار نامعتبر در ".concat(i.origin);default:return"ورودی نامعتبر"}}};function gae(){return{localeError:qGe()}}var WGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"merkki\xe4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xe4iv\xe4m\xe4\xe4r\xe4n"}};var r={regex:"s\xe4\xe4nn\xf6llinen lauseke",email:"s\xe4hk\xf6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xe4iv\xe4m\xe4\xe4r\xe4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return function(i){var o,a,s;switch(i.code){case"invalid_type":{var l=(o=n[i.expected])!=null?o:i.expected,c=Je(i.input),d=(a=n[c])!=null?a:c;return/^[A-Z]/.test(i.expected)?"Virheellinen tyyppi: odotettiin instanceof ".concat(i.expected,", oli ").concat(d):"Virheellinen tyyppi: odotettiin ".concat(l,", oli ").concat(d)}case"invalid_value":return i.values.length===1?"Virheellinen sy\xf6te: t\xe4ytyy olla ".concat(Ke(i.values[0])):"Virheellinen valinta: t\xe4ytyy olla yksi seuraavista: ".concat(Ce(i.values,"|"));case"too_big":{var l10=i.inclusive?"<=":"<",c10=t(i.origin);return c10?"Liian suuri: ".concat(c10.subject," t\xe4ytyy olla ").concat(l10).concat(i.maximum.toString()," ").concat(c10.unit).trim():"Liian suuri: arvon t\xe4ytyy olla ".concat(l10).concat(i.maximum.toString())}case"too_small":{var l11=i.inclusive?">=":">",c11=t(i.origin);return c11?"Liian pieni: ".concat(c11.subject," t\xe4ytyy olla ").concat(l11).concat(i.minimum.toString()," ").concat(c11.unit).trim():"Liian pieni: arvon t\xe4ytyy olla ".concat(l11).concat(i.minimum.toString())}case"invalid_format":{var l12=i;return l12.format==="starts_with"?'Virheellinen sy\xf6te: t\xe4ytyy alkaa "'.concat(l12.prefix,'"'):l12.format==="ends_with"?'Virheellinen sy\xf6te: t\xe4ytyy loppua "'.concat(l12.suffix,'"'):l12.format==="includes"?'Virheellinen sy\xf6te: t\xe4ytyy sis\xe4lt\xe4\xe4 "'.concat(l12.includes,'"'):l12.format==="regex"?"Virheellinen sy\xf6te: t\xe4ytyy vastata s\xe4\xe4nn\xf6llist\xe4 lauseketta ".concat(l12.pattern):"Virheellinen ".concat((s=r[l12.format])!=null?s:i.format)}case"not_multiple_of":return"Virheellinen luku: t\xe4ytyy olla luvun ".concat(i.divisor," monikerta");case"unrecognized_keys":return"".concat(i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xf6te"}}};function xae(){return{localeError:WGe()}}var VGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"caract\xe8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xe9l\xe9ments",verb:"avoir"},set:{unit:"\xe9l\xe9ments",verb:"avoir"}};var r={regex:"entr\xe9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xe9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xeene encod\xe9e en base64",base64url:"cha\xeene encod\xe9e en base64url",json_string:"cha\xeene JSON",e164:"num\xe9ro E.164",jwt:"JWT",template_literal:"entr\xe9e"},n={nan:"NaN",number:"nombre",array:"tableau"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Entr\xe9e invalide : instanceof ".concat(i.expected," attendu, ").concat(m," re\xe7u"):"Entr\xe9e invalide : ".concat(u," attendu, ").concat(m," re\xe7u")}case"invalid_value":return i.values.length===1?"Entr\xe9e invalide : ".concat(Ke(i.values[0])," attendu"):"Option invalide : une valeur parmi ".concat(Ce(i.values,"|")," attendue");case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Trop grand : ".concat((s=i.origin)!=null?s:"valeur"," doit ").concat(p10.verb," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"\xe9l\xe9ment(s)"):"Trop grand : ".concat((c=i.origin)!=null?c:"valeur"," doit \xeatre ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Trop petit : ".concat(i.origin," doit ").concat(p11.verb," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Trop petit : ".concat(i.origin," doit \xeatre ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Cha\xeene invalide : doit commencer par "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Cha\xeene invalide : doit se terminer par "'.concat(u12.suffix,'"'):u12.format==="includes"?'Cha\xeene invalide : doit inclure "'.concat(u12.includes,'"'):u12.format==="regex"?"Cha\xeene invalide : doit correspondre au mod\xe8le ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," invalide")}case"not_multiple_of":return"Nombre invalide : doit \xeatre un multiple de ".concat(i.divisor);case"unrecognized_keys":return"Cl\xe9".concat(i.keys.length>1?"s":""," non reconnue").concat(i.keys.length>1?"s":""," : ").concat(Ce(i.keys,", "));case"invalid_key":return"Cl\xe9 invalide dans ".concat(i.origin);case"invalid_union":return"Entr\xe9e invalide";case"invalid_element":return"Valeur invalide dans ".concat(i.origin);default:return"Entr\xe9e invalide"}}};function yae(){return{localeError:VGe()}}var GGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"caract\xe8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xe9l\xe9ments",verb:"avoir"},set:{unit:"\xe9l\xe9ments",verb:"avoir"}};var r={regex:"entr\xe9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xe9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xeene encod\xe9e en base64",base64url:"cha\xeene encod\xe9e en base64url",json_string:"cha\xeene JSON",e164:"num\xe9ro E.164",jwt:"JWT",template_literal:"entr\xe9e"},n={nan:"NaN"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"Entr\xe9e invalide : attendu instanceof ".concat(i.expected,", re\xe7u ").concat(p):"Entr\xe9e invalide : attendu ".concat(d,", re\xe7u ").concat(p)}case"invalid_value":return i.values.length===1?"Entr\xe9e invalide : attendu ".concat(Ke(i.values[0])):"Option invalide : attendu l'une des valeurs suivantes ".concat(Ce(i.values,"|"));case"too_big":{var d10=i.inclusive?"≤":"<",u10=t(i.origin);return u10?"Trop grand : attendu que ".concat((s=i.origin)!=null?s:"la valeur"," ait ").concat(d10).concat(i.maximum.toString()," ").concat(u10.unit):"Trop grand : attendu que ".concat((l=i.origin)!=null?l:"la valeur"," soit ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?"≥":">",u11=t(i.origin);return u11?"Trop petit : attendu que ".concat(i.origin," ait ").concat(d11).concat(i.minimum.toString()," ").concat(u11.unit):"Trop petit : attendu que ".concat(i.origin," soit ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'Cha\xeene invalide : doit commencer par "'.concat(d12.prefix,'"'):d12.format==="ends_with"?'Cha\xeene invalide : doit se terminer par "'.concat(d12.suffix,'"'):d12.format==="includes"?'Cha\xeene invalide : doit inclure "'.concat(d12.includes,'"'):d12.format==="regex"?"Cha\xeene invalide : doit correspondre au motif ".concat(d12.pattern):"".concat((c=r[d12.format])!=null?c:i.format," invalide")}case"not_multiple_of":return"Nombre invalide : doit \xeatre un multiple de ".concat(i.divisor);case"unrecognized_keys":return"Cl\xe9".concat(i.keys.length>1?"s":""," non reconnue").concat(i.keys.length>1?"s":""," : ").concat(Ce(i.keys,", "));case"invalid_key":return"Cl\xe9 invalide dans ".concat(i.origin);case"invalid_union":return"Entr\xe9e invalide";case"invalid_element":return"Valeur invalide dans ".concat(i.origin);default:return"Entr\xe9e invalide"}}};function vae(){return{localeError:GGe()}}var HGe=function(){var e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},r=function(c){return c?e[c]:void 0},n=function(c){var d=r(c);return d?d.label:c!=null?c:e.unknown.label},i=function(c){return"ה".concat(n(c))},o=function(c){var p;var d=r(c);return((p=d==null?void 0:d.gender)!=null?p:"m")==="f"?"צריכה להיות":"צריך להיות"},a=function(c){var d;return c&&(d=t[c])!=null?d:null},s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},l={nan:"NaN"};return function(c){var d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R;switch(c.code){case"invalid_type":{var $=c.expected,z=(d=l[$!=null?$:""])!=null?d:n($),D=Je(c.input),L=(m=(p=l[D])!=null?p:(u=e[D])==null?void 0:u.label)!=null?m:D;return/^[A-Z]/.test(c.expected)?"קלט לא תקין: צריך להיות instanceof ".concat(c.expected,", התקבל ").concat(L):"קלט לא תקין: צריך להיות ".concat(z,", התקבל ").concat(L)}case"invalid_value":{if(c.values.length===1)return"ערך לא תקין: הערך חייב להיות ".concat(Ke(c.values[0]));var $1=c.values.map(function(L){return Ke(L)});if(c.values.length===2)return"ערך לא תקין: האפשרויות המתאימות הן ".concat($1[0]," או ").concat($1[1]);var z10=$1[$1.length-1];return"ערך לא תקין: האפשרויות המתאימות הן ".concat($1.slice(0,-1).join(", ")," או ").concat(z10)}case"too_big":{var $10=a(c.origin),z11=i((h=c.origin)!=null?h:"value");if(c.origin==="string")return"".concat((g=$10==null?void 0:$10.longLabel)!=null?g:"ארוך"," מדי: ").concat(z11," צריכה להכיל ").concat(c.maximum.toString()," ").concat((x=$10==null?void 0:$10.unit)!=null?x:""," ").concat(c.inclusive?"או פחות":"לכל היותר").trim();if(c.origin==="number"){var ee=c.inclusive?"קטן או שווה ל-".concat(c.maximum):"קטן מ-".concat(c.maximum);return"גדול מדי: ".concat(z11," צריך להיות ").concat(ee)}if(c.origin==="array"||c.origin==="set"){var ee1=c.origin==="set"?"צריכה":"צריך",pe=c.inclusive?"".concat(c.maximum," ").concat((v=$10==null?void 0:$10.unit)!=null?v:""," או פחות"):"פחות מ-".concat(c.maximum," ").concat((y=$10==null?void 0:$10.unit)!=null?y:"");return"גדול מדי: ".concat(z11," ").concat(ee1," להכיל ").concat(pe).trim()}var D10=c.inclusive?"<=":"<",L10=o((_=c.origin)!=null?_:"value");return $10!=null&&$10.unit?"".concat($10.longLabel," מדי: ").concat(z11," ").concat(L10," ").concat(D10).concat(c.maximum.toString()," ").concat($10.unit):"".concat((b=$10==null?void 0:$10.longLabel)!=null?b:"גדול"," מדי: ").concat(z11," ").concat(L10," ").concat(D10).concat(c.maximum.toString())}case"too_small":{var $11=a(c.origin),z12=i((w=c.origin)!=null?w:"value");if(c.origin==="string")return"".concat((S=$11==null?void 0:$11.shortLabel)!=null?S:"קצר"," מדי: ").concat(z12," צריכה להכיל ").concat(c.minimum.toString()," ").concat((k=$11==null?void 0:$11.unit)!=null?k:""," ").concat(c.inclusive?"או יותר":"לפחות").trim();if(c.origin==="number"){var ee2=c.inclusive?"גדול או שווה ל-".concat(c.minimum):"גדול מ-".concat(c.minimum);return"קטן מדי: ".concat(z12," צריך להיות ").concat(ee2)}if(c.origin==="array"||c.origin==="set"){var ee3=c.origin==="set"?"צריכה":"צריך";if(c.minimum===1&&c.inclusive){var N=(c.origin==="set","לפחות פריט אחד");return"קטן מדי: ".concat(z12," ").concat(ee3," להכיל ").concat(N)}var pe1=c.inclusive?"".concat(c.minimum," ").concat((E=$11==null?void 0:$11.unit)!=null?E:""," או יותר"):"יותר מ-".concat(c.minimum," ").concat((C=$11==null?void 0:$11.unit)!=null?C:"");return"קטן מדי: ".concat(z12," ").concat(ee3," להכיל ").concat(pe1).trim()}var D11=c.inclusive?">=":">",L11=o((T=c.origin)!=null?T:"value");return $11!=null&&$11.unit?"".concat($11.shortLabel," מדי: ").concat(z12," ").concat(L11," ").concat(D11).concat(c.minimum.toString()," ").concat($11.unit):"".concat((I=$11==null?void 0:$11.shortLabel)!=null?I:"קטן"," מדי: ").concat(z12," ").concat(L11," ").concat(D11).concat(c.minimum.toString())}case"invalid_format":{var $12=c;if($12.format==="starts_with")return'המחרוזת חייבת להתחיל ב "'.concat($12.prefix,'"');if($12.format==="ends_with")return'המחרוזת חייבת להסתיים ב "'.concat($12.suffix,'"');if($12.format==="includes")return'המחרוזת חייבת לכלול "'.concat($12.includes,'"');if($12.format==="regex")return"המחרוזת חייבת להתאים לתבנית ".concat($12.pattern);var z13=s[$12.format],D12=(O=z13==null?void 0:z13.label)!=null?O:$12.format,ee4=((M=z13==null?void 0:z13.gender)!=null?M:"m")==="f"?"תקינה":"תקין";return"".concat(D12," לא ").concat(ee4)}case"not_multiple_of":return"מספר לא תקין: חייב להיות מכפלה של ".concat(c.divisor);case"unrecognized_keys":return"מפתח".concat(c.keys.length>1?"ות":""," לא מזוה").concat(c.keys.length>1?"ים":"ה",": ").concat(Ce(c.keys,", "));case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return"ערך לא תקין ב".concat(i((R=c.origin)!=null?R:"array"));default:return"קלט לא תקין"}}};function _ae(){return{localeError:HGe()}}var ZGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};var r={regex:"bemenet",email:"email c\xedm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időb\xe9lyeg",date:"ISO d\xe1tum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 c\xedm",ipv6:"IPv6 c\xedm",cidrv4:"IPv4 tartom\xe1ny",cidrv6:"IPv6 tartom\xe1ny",base64:"base64-k\xf3dolt string",base64url:"base64url-k\xf3dolt string",json_string:"JSON string",e164:"E.164 sz\xe1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xe1m",array:"t\xf6mb"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k instanceof ".concat(i.expected,", a kapott \xe9rt\xe9k ").concat(m):"\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ".concat(u,", a kapott \xe9rt\xe9k ").concat(m)}case"invalid_value":return i.values.length===1?"\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ".concat(Ke(i.values[0])):"\xc9rv\xe9nytelen opci\xf3: valamelyik \xe9rt\xe9k v\xe1rt ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"T\xfal nagy: ".concat((s=i.origin)!=null?s:"\xe9rt\xe9k"," m\xe9rete t\xfal nagy ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elem"):"T\xfal nagy: a bemeneti \xe9rt\xe9k ".concat((c=i.origin)!=null?c:"\xe9rt\xe9k"," t\xfal nagy: ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"T\xfal kicsi: a bemeneti \xe9rt\xe9k ".concat(i.origin," m\xe9rete t\xfal kicsi ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"T\xfal kicsi: a bemeneti \xe9rt\xe9k ".concat(i.origin," t\xfal kicsi ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'\xc9rv\xe9nytelen string: "'.concat(u12.prefix,'" \xe9rt\xe9kkel kell kezdődnie'):u12.format==="ends_with"?'\xc9rv\xe9nytelen string: "'.concat(u12.suffix,'" \xe9rt\xe9kkel kell v\xe9gződnie'):u12.format==="includes"?'\xc9rv\xe9nytelen string: "'.concat(u12.includes,'" \xe9rt\xe9ket kell tartalmaznia'):u12.format==="regex"?"\xc9rv\xe9nytelen string: ".concat(u12.pattern," mint\xe1nak kell megfelelnie"):"\xc9rv\xe9nytelen ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"\xc9rv\xe9nytelen sz\xe1m: ".concat(i.divisor," t\xf6bbsz\xf6r\xf6s\xe9nek kell lennie");case"unrecognized_keys":return"Ismeretlen kulcs".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"\xc9rv\xe9nytelen kulcs ".concat(i.origin);case"invalid_union":return"\xc9rv\xe9nytelen bemenet";case"invalid_element":return"\xc9rv\xe9nytelen \xe9rt\xe9k: ".concat(i.origin);default:return"\xc9rv\xe9nytelen bemenet"}}};function bae(){return{localeError:ZGe()}}function wae(e,t,r){return Math.abs(e)===1?t:r}function Uy(e){if(!e)return"";var t=["ա","ե","ը","ի","ո","ու","օ"],r=e[e.length-1];return e+(t.includes(r)?"ն":"ը")}var KGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};var r={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},n={nan:"NaN",number:"թիվ",array:"զանգված"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"Սխալ մուտքագրում․ սպասվում էր instanceof ".concat(i.expected,", ստացվել է ").concat(p):"Սխալ մուտքագրում․ սպասվում էր ".concat(d,", ստացվել է ").concat(p)}case"invalid_value":return i.values.length===1?"Սխալ մուտքագրում․ սպասվում էր ".concat(Ke(i.values[1])):"Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ".concat(Ce(i.values,"|"));case"too_big":{var d10=i.inclusive?"<=":"<",u10=t(i.origin);if(u10){var p10=Number(i.maximum),m=wae(p10,u10.unit.one,u10.unit.many);return"Չափազանց մեծ արժեք․ սպասվում է, որ ".concat(Uy((s=i.origin)!=null?s:"արժեք")," կունենա ").concat(d10).concat(i.maximum.toString()," ").concat(m)}return"Չափազանց մեծ արժեք․ սպասվում է, որ ".concat(Uy((l=i.origin)!=null?l:"արժեք")," լինի ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?">=":">",u11=t(i.origin);if(u11){var p11=Number(i.minimum),m10=wae(p11,u11.unit.one,u11.unit.many);return"Չափազանց փոքր արժեք․ սպասվում է, որ ".concat(Uy(i.origin)," կունենա ").concat(d11).concat(i.minimum.toString()," ").concat(m10)}return"Չափազանց փոքր արժեք․ սպասվում է, որ ".concat(Uy(i.origin)," լինի ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'Սխալ տող․ պետք է սկսվի "'.concat(d12.prefix,'"-ով'):d12.format==="ends_with"?'Սխալ տող․ պետք է ավարտվի "'.concat(d12.suffix,'"-ով'):d12.format==="includes"?'Սխալ տող․ պետք է պարունակի "'.concat(d12.includes,'"'):d12.format==="regex"?"Սխալ տող․ պետք է համապատասխանի ".concat(d12.pattern," ձևաչափին"):"Սխալ ".concat((c=r[d12.format])!=null?c:i.format)}case"not_multiple_of":return"Սխալ թիվ․ պետք է բազմապատիկ լինի ".concat(i.divisor,"-ի");case"unrecognized_keys":return"Չճանաչված բանալի".concat(i.keys.length>1?"ներ":"",". ").concat(Ce(i.keys,", "));case"invalid_key":return"Սխալ բանալի ".concat(Uy(i.origin),"-ում");case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return"Սխալ արժեք ".concat(Uy(i.origin),"-ում");default:return"Սխալ մուտքագրում"}}};function Sae(){return{localeError:KGe()}}var QGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};var r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Input tidak valid: diharapkan instanceof ".concat(i.expected,", diterima ").concat(m):"Input tidak valid: diharapkan ".concat(u,", diterima ").concat(m)}case"invalid_value":return i.values.length===1?"Input tidak valid: diharapkan ".concat(Ke(i.values[0])):"Pilihan tidak valid: diharapkan salah satu dari ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Terlalu besar: diharapkan ".concat((s=i.origin)!=null?s:"value"," memiliki ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elemen"):"Terlalu besar: diharapkan ".concat((c=i.origin)!=null?c:"value"," menjadi ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Terlalu kecil: diharapkan ".concat(i.origin," memiliki ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Terlalu kecil: diharapkan ".concat(i.origin," menjadi ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'String tidak valid: harus dimulai dengan "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'String tidak valid: harus berakhir dengan "'.concat(u12.suffix,'"'):u12.format==="includes"?'String tidak valid: harus menyertakan "'.concat(u12.includes,'"'):u12.format==="regex"?"String tidak valid: harus sesuai pola ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," tidak valid")}case"not_multiple_of":return"Angka tidak valid: harus kelipatan dari ".concat(i.divisor);case"unrecognized_keys":return"Kunci tidak dikenali ".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Kunci tidak valid di ".concat(i.origin);case"invalid_union":return"Input tidak valid";case"invalid_element":return"Nilai tidak valid di ".concat(i.origin);default:return"Input tidak valid"}}};function kae(){return{localeError:QGe()}}var JGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"stafi",verb:"a\xf0 hafa"},file:{unit:"b\xe6ti",verb:"a\xf0 hafa"},array:{unit:"hluti",verb:"a\xf0 hafa"},set:{unit:"hluti",verb:"a\xf0 hafa"}};var r={regex:"gildi",email:"netfang",url:"vefsl\xf3\xf0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xedmi",date:"ISO dagsetning",time:"ISO t\xedmi",duration:"ISO t\xedmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xf6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xfamer",array:"fylki"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Rangt gildi: \xde\xfa sl\xf3st inn ".concat(m," \xfear sem \xe1 a\xf0 vera instanceof ").concat(i.expected):"Rangt gildi: \xde\xfa sl\xf3st inn ".concat(m," \xfear sem \xe1 a\xf0 vera ").concat(u)}case"invalid_value":return i.values.length===1?"Rangt gildi: gert r\xe1\xf0 fyrir ".concat(Ke(i.values[0])):"\xd3gilt val: m\xe1 vera eitt af eftirfarandi ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ".concat((s=i.origin)!=null?s:"gildi"," hafi ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"hluti"):"Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ".concat((c=i.origin)!=null?c:"gildi"," s\xe9 ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ".concat(i.origin," hafi ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ".concat(i.origin," s\xe9 ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'\xd3gildur strengur: ver\xf0ur a\xf0 byrja \xe1 "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'\xd3gildur strengur: ver\xf0ur a\xf0 enda \xe1 "'.concat(u12.suffix,'"'):u12.format==="includes"?'\xd3gildur strengur: ver\xf0ur a\xf0 innihalda "'.concat(u12.includes,'"'):u12.format==="regex"?"\xd3gildur strengur: ver\xf0ur a\xf0 fylgja mynstri ".concat(u12.pattern):"Rangt ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"R\xf6ng tala: ver\xf0ur a\xf0 vera margfeldi af ".concat(i.divisor);case"unrecognized_keys":return"\xd3\xfeekkt ".concat(i.keys.length>1?"ir lyklar":"ur lykill",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Rangur lykill \xed ".concat(i.origin);case"invalid_union":return"Rangt gildi";case"invalid_element":return"Rangt gildi \xed ".concat(i.origin);default:return"Rangt gildi"}}};function Cae(){return{localeError:JGe()}}var YGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};var r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Input non valido: atteso instanceof ".concat(i.expected,", ricevuto ").concat(m):"Input non valido: atteso ".concat(u,", ricevuto ").concat(m)}case"invalid_value":return i.values.length===1?"Input non valido: atteso ".concat(Ke(i.values[0])):"Opzione non valida: atteso uno tra ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Troppo grande: ".concat((s=i.origin)!=null?s:"valore"," deve avere ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementi"):"Troppo grande: ".concat((c=i.origin)!=null?c:"valore"," deve essere ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Troppo piccolo: ".concat(i.origin," deve avere ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Troppo piccolo: ".concat(i.origin," deve essere ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Stringa non valida: deve iniziare con "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Stringa non valida: deve terminare con "'.concat(u12.suffix,'"'):u12.format==="includes"?'Stringa non valida: deve includere "'.concat(u12.includes,'"'):u12.format==="regex"?"Stringa non valida: deve corrispondere al pattern ".concat(u12.pattern):"Invalid ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Numero non valido: deve essere un multiplo di ".concat(i.divisor);case"unrecognized_keys":return"Chiav".concat(i.keys.length>1?"i":"e"," non riconosciut").concat(i.keys.length>1?"e":"a",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Chiave non valida in ".concat(i.origin);case"invalid_union":return"Input non valido";case"invalid_element":return"Valore non valido in ".concat(i.origin);default:return"Input non valido"}}};function Eae(){return{localeError:YGe()}}var XGe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};var r={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},n={nan:"NaN",number:"数値",array:"配列"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"無効な入力: instanceof ".concat(i.expected,"が期待されましたが、").concat(m,"が入力されました"):"無効な入力: ".concat(u,"が期待されましたが、").concat(m,"が入力されました")}case"invalid_value":return i.values.length===1?"無効な入力: ".concat(Ke(i.values[0]),"が期待されました"):"無効な選択: ".concat(Ce(i.values,"、"),"のいずれかである必要があります");case"too_big":{var u10=i.inclusive?"以下である":"より小さい",p10=t(i.origin);return p10?"大きすぎる値: ".concat((s=i.origin)!=null?s:"値","は").concat(i.maximum.toString()).concat((l=p10.unit)!=null?l:"要素").concat(u10,"必要があります"):"大きすぎる値: ".concat((c=i.origin)!=null?c:"値","は").concat(i.maximum.toString()).concat(u10,"必要があります")}case"too_small":{var u11=i.inclusive?"以上である":"より大きい",p11=t(i.origin);return p11?"小さすぎる値: ".concat(i.origin,"は").concat(i.minimum.toString()).concat(p11.unit).concat(u11,"必要があります"):"小さすぎる値: ".concat(i.origin,"は").concat(i.minimum.toString()).concat(u11,"必要があります")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'無効な文字列: "'.concat(u12.prefix,'"で始まる必要があります'):u12.format==="ends_with"?'無効な文字列: "'.concat(u12.suffix,'"で終わる必要があります'):u12.format==="includes"?'無効な文字列: "'.concat(u12.includes,'"を含む必要があります'):u12.format==="regex"?"無効な文字列: パターン".concat(u12.pattern,"に一致する必要があります"):"無効な".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"無効な数値: ".concat(i.divisor,"の倍数である必要があります");case"unrecognized_keys":return"認識されていないキー".concat(i.keys.length>1?"群":"",": ").concat(Ce(i.keys,"、"));case"invalid_key":return"".concat(i.origin,"内の無効なキー");case"invalid_union":return"無効な入力";case"invalid_element":return"".concat(i.origin,"内の無効な値");default:return"無効な入力"}}};function Tae(){return{localeError:XGe()}}var eHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};var r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},n={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"არასწორი შეყვანა: მოსალოდნელი instanceof ".concat(i.expected,", მიღებული ").concat(p):"არასწორი შეყვანა: მოსალოდნელი ".concat(d,", მიღებული ").concat(p)}case"invalid_value":return i.values.length===1?"არასწორი შეყვანა: მოსალოდნელი ".concat(Ke(i.values[0])):"არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ".concat(Ce(i.values,"|"),"-დან");case"too_big":{var d10=i.inclusive?"<=":"<",u10=t(i.origin);return u10?"ზედმეტად დიდი: მოსალოდნელი ".concat((s=i.origin)!=null?s:"მნიშვნელობა"," ").concat(u10.verb," ").concat(d10).concat(i.maximum.toString()," ").concat(u10.unit):"ზედმეტად დიდი: მოსალოდნელი ".concat((l=i.origin)!=null?l:"მნიშვნელობა"," იყოს ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?">=":">",u11=t(i.origin);return u11?"ზედმეტად პატარა: მოსალოდნელი ".concat(i.origin," ").concat(u11.verb," ").concat(d11).concat(i.minimum.toString()," ").concat(u11.unit):"ზედმეტად პატარა: მოსალოდნელი ".concat(i.origin," იყოს ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'არასწორი სტრინგი: უნდა იწყებოდეს "'.concat(d12.prefix,'"-ით'):d12.format==="ends_with"?'არასწორი სტრინგი: უნდა მთავრდებოდეს "'.concat(d12.suffix,'"-ით'):d12.format==="includes"?'არასწორი სტრინგი: უნდა შეიცავდეს "'.concat(d12.includes,'"-ს'):d12.format==="regex"?"არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ".concat(d12.pattern):"არასწორი ".concat((c=r[d12.format])!=null?c:i.format)}case"not_multiple_of":return"არასწორი რიცხვი: უნდა იყოს ".concat(i.divisor,"-ის ჯერადი");case"unrecognized_keys":return"უცნობი გასაღებ".concat(i.keys.length>1?"ები":"ი",": ").concat(Ce(i.keys,", "));case"invalid_key":return"არასწორი გასაღები ".concat(i.origin,"-ში");case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return"არასწორი მნიშვნელობა ".concat(i.origin,"-ში");default:return"არასწორი შეყვანა"}}};function Aae(){return{localeError:eHe()}}var tHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};var r={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},n={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ".concat(i.expected," ប៉ុន្តែទទួលបាន ").concat(m):"ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ".concat(u," ប៉ុន្តែទទួលបាន ").concat(m)}case"invalid_value":return i.values.length===1?"ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ".concat(Ke(i.values[0])):"ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"ធំពេក៖ ត្រូវការ ".concat((s=i.origin)!=null?s:"តម្លៃ"," ").concat(u10," ").concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"ធាតុ"):"ធំពេក៖ ត្រូវការ ".concat((c=i.origin)!=null?c:"តម្លៃ"," ").concat(u10," ").concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"តូចពេក៖ ត្រូវការ ".concat(i.origin," ").concat(u11," ").concat(i.minimum.toString()," ").concat(p11.unit):"តូចពេក៖ ត្រូវការ ".concat(i.origin," ").concat(u11," ").concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "'.concat(u12.suffix,'"'):u12.format==="includes"?'ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "'.concat(u12.includes,'"'):u12.format==="regex"?"ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ".concat(u12.pattern):"មិនត្រឹមត្រូវ៖ ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ".concat(i.divisor);case"unrecognized_keys":return"រកឃើញសោមិនស្គាល់៖ ".concat(Ce(i.keys,", "));case"invalid_key":return"សោមិនត្រឹមត្រូវនៅក្នុង ".concat(i.origin);case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return"ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ".concat(i.origin);default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function mE(){return{localeError:tHe()}}function Iae(){return mE()}var rHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};var r={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d,u,p,m;switch(i.code){case"invalid_type":{var h=(o=n[i.expected])!=null?o:i.expected,g=Je(i.input),x=(a=n[g])!=null?a:g;return/^[A-Z]/.test(i.expected)?"잘못된 입력: 예상 타입은 instanceof ".concat(i.expected,", 받은 타입은 ").concat(x,"입니다"):"잘못된 입력: 예상 타입은 ".concat(h,", 받은 타입은 ").concat(x,"입니다")}case"invalid_value":return i.values.length===1?"잘못된 입력: 값은 ".concat(Ke(i.values[0])," 이어야 합니다"):"잘못된 옵션: ".concat(Ce(i.values,"또는 ")," 중 하나여야 합니다");case"too_big":{var h10=i.inclusive?"이하":"미만",g10=h10==="미만"?"이어야 합니다":"여야 합니다",x10=t(i.origin),v=(s=x10==null?void 0:x10.unit)!=null?s:"요소";return x10?"".concat((l=i.origin)!=null?l:"값","이 너무 큽니다: ").concat(i.maximum.toString()).concat(v," ").concat(h10).concat(g10):"".concat((c=i.origin)!=null?c:"값","이 너무 큽니다: ").concat(i.maximum.toString()," ").concat(h10).concat(g10)}case"too_small":{var h11=i.inclusive?"이상":"초과",g11=h11==="이상"?"이어야 합니다":"여야 합니다",x11=t(i.origin),v10=(d=x11==null?void 0:x11.unit)!=null?d:"요소";return x11?"".concat((u=i.origin)!=null?u:"값","이 너무 작습니다: ").concat(i.minimum.toString()).concat(v10," ").concat(h11).concat(g11):"".concat((p=i.origin)!=null?p:"값","이 너무 작습니다: ").concat(i.minimum.toString()," ").concat(h11).concat(g11)}case"invalid_format":{var h12=i;return h12.format==="starts_with"?'잘못된 문자열: "'.concat(h12.prefix,'"(으)로 시작해야 합니다'):h12.format==="ends_with"?'잘못된 문자열: "'.concat(h12.suffix,'"(으)로 끝나야 합니다'):h12.format==="includes"?'잘못된 문자열: "'.concat(h12.includes,'"을(를) 포함해야 합니다'):h12.format==="regex"?"잘못된 문자열: 정규식 ".concat(h12.pattern," 패턴과 일치해야 합니다"):"잘못된 ".concat((m=r[h12.format])!=null?m:i.format)}case"not_multiple_of":return"잘못된 숫자: ".concat(i.divisor,"의 배수여야 합니다");case"unrecognized_keys":return"인식할 수 없는 키: ".concat(Ce(i.keys,", "));case"invalid_key":return"잘못된 키: ".concat(i.origin);case"invalid_union":return"잘못된 입력";case"invalid_element":return"잘못된 값: ".concat(i.origin);default:return"잘못된 입력"}}};function Pae(){return{localeError:rHe()}}var j4=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};function Rae(e){var t=Math.abs(e),r=t%10,n=t%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}var nHe=function(){var t=function t(i,o,a,s){var c;var l=(c=e[i])!=null?c:null;return l===null?l:{unit:l.unit[o],verb:l.verb[s][a?"inclusive":"notInclusive"]}};var e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};var r={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},n={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return function(i){var o,a,s,l,c,d,u,p,m,h,g,x,v,y,_;switch(i.code){case"invalid_type":{var b=(o=n[i.expected])!=null?o:i.expected,w=Je(i.input),S=(a=n[w])!=null?a:w;return/^[A-Z]/.test(i.expected)?"Gautas tipas ".concat(S,", o tikėtasi - instanceof ").concat(i.expected):"Gautas tipas ".concat(S,", o tikėtasi - ").concat(b)}case"invalid_value":return i.values.length===1?"Privalo būti ".concat(Ke(i.values[0])):"Privalo būti vienas iš ".concat(Ce(i.values,"|")," pasirinkimų");case"too_big":{var b10=(s=n[i.origin])!=null?s:i.origin,w10=t(i.origin,Rae(Number(i.maximum)),(l=i.inclusive)!=null?l:!1,"smaller");if(w10!=null&&w10.verb)return"".concat(j4((c=b10!=null?b10:i.origin)!=null?c:"reikšmė")," ").concat(w10.verb," ").concat(i.maximum.toString()," ").concat((d=w10.unit)!=null?d:"elementų");var S10=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return"".concat(j4((u=b10!=null?b10:i.origin)!=null?u:"reikšmė")," turi būti ").concat(S10," ").concat(i.maximum.toString()," ").concat(w10==null?void 0:w10.unit)}case"too_small":{var b11=(p=n[i.origin])!=null?p:i.origin,w11=t(i.origin,Rae(Number(i.minimum)),(m=i.inclusive)!=null?m:!1,"bigger");if(w11!=null&&w11.verb)return"".concat(j4((h=b11!=null?b11:i.origin)!=null?h:"reikšmė")," ").concat(w11.verb," ").concat(i.minimum.toString()," ").concat((g=w11.unit)!=null?g:"elementų");var S11=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return"".concat(j4((x=b11!=null?b11:i.origin)!=null?x:"reikšmė")," turi būti ").concat(S11," ").concat(i.minimum.toString()," ").concat(w11==null?void 0:w11.unit)}case"invalid_format":{var b12=i;return b12.format==="starts_with"?'Eilutė privalo prasidėti "'.concat(b12.prefix,'"'):b12.format==="ends_with"?'Eilutė privalo pasibaigti "'.concat(b12.suffix,'"'):b12.format==="includes"?'Eilutė privalo įtraukti "'.concat(b12.includes,'"'):b12.format==="regex"?"Eilutė privalo atitikti ".concat(b12.pattern):"Neteisingas ".concat((v=r[b12.format])!=null?v:i.format)}case"not_multiple_of":return"Skaičius privalo būti ".concat(i.divisor," kartotinis.");case"unrecognized_keys":return"Neatpažint".concat(i.keys.length>1?"i":"as"," rakt").concat(i.keys.length>1?"ai":"as",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{var b13=(y=n[i.origin])!=null?y:i.origin;return"".concat(j4((_=b13!=null?b13:i.origin)!=null?_:"reikšmė")," turi klaidingą įvestį")}default:return"Klaidinga įvestis"}}};function Mae(){return{localeError:nHe()}}var iHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};var r={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},n={nan:"NaN",number:"број",array:"низа"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Грешен внес: се очекува instanceof ".concat(i.expected,", примено ").concat(m):"Грешен внес: се очекува ".concat(u,", примено ").concat(m)}case"invalid_value":return i.values.length===1?"Invalid input: expected ".concat(Ke(i.values[0])):"Грешана опција: се очекува една ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Премногу голем: се очекува ".concat((s=i.origin)!=null?s:"вредноста"," да има ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"елементи"):"Премногу голем: се очекува ".concat((c=i.origin)!=null?c:"вредноста"," да биде ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Премногу мал: се очекува ".concat(i.origin," да има ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Премногу мал: се очекува ".concat(i.origin," да биде ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Неважечка низа: мора да започнува со "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Неважечка низа: мора да завршува со "'.concat(u12.suffix,'"'):u12.format==="includes"?'Неважечка низа: мора да вклучува "'.concat(u12.includes,'"'):u12.format==="regex"?"Неважечка низа: мора да одгоара на патернот ".concat(u12.pattern):"Invalid ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Грешен број: мора да биде делив со ".concat(i.divisor);case"unrecognized_keys":return"".concat(i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Грешен клуч во ".concat(i.origin);case"invalid_union":return"Грешен внес";case"invalid_element":return"Грешна вредност во ".concat(i.origin);default:return"Грешен внес"}}};function Oae(){return{localeError:iHe()}}var oHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};var r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Input tidak sah: dijangka instanceof ".concat(i.expected,", diterima ").concat(m):"Input tidak sah: dijangka ".concat(u,", diterima ").concat(m)}case"invalid_value":return i.values.length===1?"Input tidak sah: dijangka ".concat(Ke(i.values[0])):"Pilihan tidak sah: dijangka salah satu daripada ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Terlalu besar: dijangka ".concat((s=i.origin)!=null?s:"nilai"," ").concat(p10.verb," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elemen"):"Terlalu besar: dijangka ".concat((c=i.origin)!=null?c:"nilai"," adalah ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Terlalu kecil: dijangka ".concat(i.origin," ").concat(p11.verb," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Terlalu kecil: dijangka ".concat(i.origin," adalah ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'String tidak sah: mesti bermula dengan "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'String tidak sah: mesti berakhir dengan "'.concat(u12.suffix,'"'):u12.format==="includes"?'String tidak sah: mesti mengandungi "'.concat(u12.includes,'"'):u12.format==="regex"?"String tidak sah: mesti sepadan dengan corak ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," tidak sah")}case"not_multiple_of":return"Nombor tidak sah: perlu gandaan ".concat(i.divisor);case"unrecognized_keys":return"Kunci tidak dikenali: ".concat(Ce(i.keys,", "));case"invalid_key":return"Kunci tidak sah dalam ".concat(i.origin);case"invalid_union":return"Input tidak sah";case"invalid_element":return"Nilai tidak sah dalam ".concat(i.origin);default:return"Input tidak sah"}}};function $ae(){return{localeError:oHe()}}var aHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};var r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Ongeldige invoer: verwacht instanceof ".concat(i.expected,", ontving ").concat(m):"Ongeldige invoer: verwacht ".concat(u,", ontving ").concat(m)}case"invalid_value":return i.values.length===1?"Ongeldige invoer: verwacht ".concat(Ke(i.values[0])):"Ongeldige optie: verwacht \xe9\xe9n van ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin),m10=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return p10?"Te ".concat(m10,": verwacht dat ").concat((s=i.origin)!=null?s:"waarde"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementen"," ").concat(p10.verb):"Te ".concat(m10,": verwacht dat ").concat((c=i.origin)!=null?c:"waarde"," ").concat(u10).concat(i.maximum.toString()," is")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin),m11=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return p11?"Te ".concat(m11,": verwacht dat ").concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," ").concat(p11.verb):"Te ".concat(m11,": verwacht dat ").concat(i.origin," ").concat(u11).concat(i.minimum.toString()," is")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Ongeldige tekst: moet met "'.concat(u12.prefix,'" beginnen'):u12.format==="ends_with"?'Ongeldige tekst: moet op "'.concat(u12.suffix,'" eindigen'):u12.format==="includes"?'Ongeldige tekst: moet "'.concat(u12.includes,'" bevatten'):u12.format==="regex"?"Ongeldige tekst: moet overeenkomen met patroon ".concat(u12.pattern):"Ongeldig: ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Ongeldig getal: moet een veelvoud van ".concat(i.divisor," zijn");case"unrecognized_keys":return"Onbekende key".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Ongeldige key in ".concat(i.origin);case"invalid_union":return"Ongeldige invoer";case"invalid_element":return"Ongeldige waarde in ".concat(i.origin);default:return"Ongeldige invoer"}}};function Nae(){return{localeError:aHe()}}var sHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"tegn",verb:"\xe5 ha"},file:{unit:"bytes",verb:"\xe5 ha"},array:{unit:"elementer",verb:"\xe5 inneholde"},set:{unit:"elementer",verb:"\xe5 inneholde"}};var r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xe5de",ipv6:"IPv6-omr\xe5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Ugyldig input: forventet instanceof ".concat(i.expected,", fikk ").concat(m):"Ugyldig input: forventet ".concat(u,", fikk ").concat(m)}case"invalid_value":return i.values.length===1?"Ugyldig verdi: forventet ".concat(Ke(i.values[0])):"Ugyldig valg: forventet en av ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"For stor(t): forventet ".concat((s=i.origin)!=null?s:"value"," til \xe5 ha ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementer"):"For stor(t): forventet ".concat((c=i.origin)!=null?c:"value"," til \xe5 ha ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"For lite(n): forventet ".concat(i.origin," til \xe5 ha ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"For lite(n): forventet ".concat(i.origin," til \xe5 ha ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Ugyldig streng: m\xe5 starte med "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Ugyldig streng: m\xe5 ende med "'.concat(u12.suffix,'"'):u12.format==="includes"?'Ugyldig streng: m\xe5 inneholde "'.concat(u12.includes,'"'):u12.format==="regex"?"Ugyldig streng: m\xe5 matche m\xf8nsteret ".concat(u12.pattern):"Ugyldig ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Ugyldig tall: m\xe5 v\xe6re et multiplum av ".concat(i.divisor);case"unrecognized_keys":return"".concat(i.keys.length>1?"Ukjente n\xf8kler":"Ukjent n\xf8kkel",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Ugyldig n\xf8kkel i ".concat(i.origin);case"invalid_union":return"Ugyldig input";case"invalid_element":return"Ugyldig verdi i ".concat(i.origin);default:return"Ugyldig input"}}};function Dae(){return{localeError:sHe()}}var lHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};var r={regex:"giren",email:"epostag\xe2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xe2mı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO m\xfcddeti",ipv4:"IPv4 niş\xe2nı",ipv6:"IPv6 niş\xe2nı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"F\xe2sit giren: umulan instanceof ".concat(i.expected,", alınan ").concat(m):"F\xe2sit giren: umulan ".concat(u,", alınan ").concat(m)}case"invalid_value":return i.values.length===1?"F\xe2sit giren: umulan ".concat(Ke(i.values[0])):"F\xe2sit tercih: m\xfbteberler ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Fazla b\xfcy\xfck: ".concat((s=i.origin)!=null?s:"value",", ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elements"," sahip olmalıydı."):"Fazla b\xfcy\xfck: ".concat((c=i.origin)!=null?c:"value",", ").concat(u10).concat(i.maximum.toString()," olmalıydı.")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Fazla k\xfc\xe7\xfck: ".concat(i.origin,", ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," sahip olmalıydı."):"Fazla k\xfc\xe7\xfck: ".concat(i.origin,", ").concat(u11).concat(i.minimum.toString()," olmalıydı.")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'F\xe2sit metin: "'.concat(u12.prefix,'" ile başlamalı.'):u12.format==="ends_with"?'F\xe2sit metin: "'.concat(u12.suffix,'" ile bitmeli.'):u12.format==="includes"?'F\xe2sit metin: "'.concat(u12.includes,'" ihtiv\xe2 etmeli.'):u12.format==="regex"?"F\xe2sit metin: ".concat(u12.pattern," nakşına uymalı."):"F\xe2sit ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"F\xe2sit sayı: ".concat(i.divisor," katı olmalıydı.");case"unrecognized_keys":return"Tanınmayan anahtar ".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," i\xe7in tanınmayan anahtar var.");case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return"".concat(i.origin," i\xe7in tanınmayan kıymet var.");default:return"Kıymet tanınamadı."}}};function Lae(){return{localeError:lHe()}}var uHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};var r={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},n={nan:"NaN",number:"عدد",array:"ارې"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"ناسم ورودي: باید instanceof ".concat(i.expected," وای, مګر ").concat(m," ترلاسه شو"):"ناسم ورودي: باید ".concat(u," وای, مګر ").concat(m," ترلاسه شو")}case"invalid_value":return i.values.length===1?"ناسم ورودي: باید ".concat(Ke(i.values[0])," وای"):"ناسم انتخاب: باید یو له ".concat(Ce(i.values,"|")," څخه وای");case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"ډیر لوی: ".concat((s=i.origin)!=null?s:"ارزښت"," باید ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"عنصرونه"," ولري"):"ډیر لوی: ".concat((c=i.origin)!=null?c:"ارزښت"," باید ").concat(u10).concat(i.maximum.toString()," وي")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"ډیر کوچنی: ".concat(i.origin," باید ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," ولري"):"ډیر کوچنی: ".concat(i.origin," باید ").concat(u11).concat(i.minimum.toString()," وي")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'ناسم متن: باید د "'.concat(u12.prefix,'" سره پیل شي'):u12.format==="ends_with"?'ناسم متن: باید د "'.concat(u12.suffix,'" سره پای ته ورسيږي'):u12.format==="includes"?'ناسم متن: باید "'.concat(u12.includes,'" ولري'):u12.format==="regex"?"ناسم متن: باید د ".concat(u12.pattern," سره مطابقت ولري"):"".concat((d=r[u12.format])!=null?d:i.format," ناسم دی")}case"not_multiple_of":return"ناسم عدد: باید د ".concat(i.divisor," مضرب وي");case"unrecognized_keys":return"ناسم ".concat(i.keys.length>1?"کلیډونه":"کلیډ",": ").concat(Ce(i.keys,", "));case"invalid_key":return"ناسم کلیډ په ".concat(i.origin," کې");case"invalid_union":return"ناسمه ورودي";case"invalid_element":return"ناسم عنصر په ".concat(i.origin," کې");default:return"ناسمه ورودي"}}};function Fae(){return{localeError:uHe()}}var cHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"znak\xf3w",verb:"mieć"},file:{unit:"bajt\xf3w",verb:"mieć"},array:{unit:"element\xf3w",verb:"mieć"},set:{unit:"element\xf3w",verb:"mieć"}};var r={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znak\xf3w zakodowany w formacie base64",base64url:"ciąg znak\xf3w zakodowany w formacie base64url",json_string:"ciąg znak\xf3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},n={nan:"NaN",number:"liczba",array:"tablica"};return function(i){var o,a,s,l,c,d,u,p,m;switch(i.code){case"invalid_type":{var h=(o=n[i.expected])!=null?o:i.expected,g=Je(i.input),x=(a=n[g])!=null?a:g;return/^[A-Z]/.test(i.expected)?"Nieprawidłowe dane wejściowe: oczekiwano instanceof ".concat(i.expected,", otrzymano ").concat(x):"Nieprawidłowe dane wejściowe: oczekiwano ".concat(h,", otrzymano ").concat(x)}case"invalid_value":return i.values.length===1?"Nieprawidłowe dane wejściowe: oczekiwano ".concat(Ke(i.values[0])):"Nieprawidłowa opcja: oczekiwano jednej z wartości ".concat(Ce(i.values,"|"));case"too_big":{var h10=i.inclusive?"<=":"<",g10=t(i.origin);return g10?"Za duża wartość: oczekiwano, że ".concat((s=i.origin)!=null?s:"wartość"," będzie mieć ").concat(h10).concat(i.maximum.toString()," ").concat((l=g10.unit)!=null?l:"element\xf3w"):"Zbyt duż(y/a/e): oczekiwano, że ".concat((c=i.origin)!=null?c:"wartość"," będzie wynosić ").concat(h10).concat(i.maximum.toString())}case"too_small":{var h11=i.inclusive?">=":">",g11=t(i.origin);return g11?"Za mała wartość: oczekiwano, że ".concat((d=i.origin)!=null?d:"wartość"," będzie mieć ").concat(h11).concat(i.minimum.toString()," ").concat((u=g11.unit)!=null?u:"element\xf3w"):"Zbyt mał(y/a/e): oczekiwano, że ".concat((p=i.origin)!=null?p:"wartość"," będzie wynosić ").concat(h11).concat(i.minimum.toString())}case"invalid_format":{var h12=i;return h12.format==="starts_with"?'Nieprawidłowy ciąg znak\xf3w: musi zaczynać się od "'.concat(h12.prefix,'"'):h12.format==="ends_with"?'Nieprawidłowy ciąg znak\xf3w: musi kończyć się na "'.concat(h12.suffix,'"'):h12.format==="includes"?'Nieprawidłowy ciąg znak\xf3w: musi zawierać "'.concat(h12.includes,'"'):h12.format==="regex"?"Nieprawidłowy ciąg znak\xf3w: musi odpowiadać wzorcowi ".concat(h12.pattern):"Nieprawidłow(y/a/e) ".concat((m=r[h12.format])!=null?m:i.format)}case"not_multiple_of":return"Nieprawidłowa liczba: musi być wielokrotnością ".concat(i.divisor);case"unrecognized_keys":return"Nierozpoznane klucze".concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Nieprawidłowy klucz w ".concat(i.origin);case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return"Nieprawidłowa wartość w ".concat(i.origin);default:return"Nieprawidłowe dane wejściowe"}}};function zae(){return{localeError:cHe()}}var dHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};var r={regex:"padr\xe3o",email:"endere\xe7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xe7\xe3o ISO",ipv4:"endere\xe7o IPv4",ipv6:"endere\xe7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xfamero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xfamero",null:"nulo"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Tipo inv\xe1lido: esperado instanceof ".concat(i.expected,", recebido ").concat(m):"Tipo inv\xe1lido: esperado ".concat(u,", recebido ").concat(m)}case"invalid_value":return i.values.length===1?"Entrada inv\xe1lida: esperado ".concat(Ke(i.values[0])):"Op\xe7\xe3o inv\xe1lida: esperada uma das ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Muito grande: esperado que ".concat((s=i.origin)!=null?s:"valor"," tivesse ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementos"):"Muito grande: esperado que ".concat((c=i.origin)!=null?c:"valor"," fosse ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Muito pequeno: esperado que ".concat(i.origin," tivesse ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Muito pequeno: esperado que ".concat(i.origin," fosse ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Texto inv\xe1lido: deve come\xe7ar com "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Texto inv\xe1lido: deve terminar com "'.concat(u12.suffix,'"'):u12.format==="includes"?'Texto inv\xe1lido: deve incluir "'.concat(u12.includes,'"'):u12.format==="regex"?"Texto inv\xe1lido: deve corresponder ao padr\xe3o ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," inv\xe1lido")}case"not_multiple_of":return"N\xfamero inv\xe1lido: deve ser m\xfaltiplo de ".concat(i.divisor);case"unrecognized_keys":return"Chave".concat(i.keys.length>1?"s":""," desconhecida").concat(i.keys.length>1?"s":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Chave inv\xe1lida em ".concat(i.origin);case"invalid_union":return"Entrada inv\xe1lida";case"invalid_element":return"Valor inv\xe1lido em ".concat(i.origin);default:return"Campo inv\xe1lido"}}};function jae(){return{localeError:dHe()}}function Uae(e,t,r,n){var i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?n:o===1?t:o>=2&&o<=4?r:n}var pHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};var r={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},n={nan:"NaN",number:"число",array:"массив"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"Неверный ввод: ожидалось instanceof ".concat(i.expected,", получено ").concat(p):"Неверный ввод: ожидалось ".concat(d,", получено ").concat(p)}case"invalid_value":return i.values.length===1?"Неверный ввод: ожидалось ".concat(Ke(i.values[0])):"Неверный вариант: ожидалось одно из ".concat(Ce(i.values,"|"));case"too_big":{var d10=i.inclusive?"<=":"<",u10=t(i.origin);if(u10){var p10=Number(i.maximum),m=Uae(p10,u10.unit.one,u10.unit.few,u10.unit.many);return"Слишком большое значение: ожидалось, что ".concat((s=i.origin)!=null?s:"значение"," будет иметь ").concat(d10).concat(i.maximum.toString()," ").concat(m)}return"Слишком большое значение: ожидалось, что ".concat((l=i.origin)!=null?l:"значение"," будет ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?">=":">",u11=t(i.origin);if(u11){var p11=Number(i.minimum),m10=Uae(p11,u11.unit.one,u11.unit.few,u11.unit.many);return"Слишком маленькое значение: ожидалось, что ".concat(i.origin," будет иметь ").concat(d11).concat(i.minimum.toString()," ").concat(m10)}return"Слишком маленькое значение: ожидалось, что ".concat(i.origin," будет ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'Неверная строка: должна начинаться с "'.concat(d12.prefix,'"'):d12.format==="ends_with"?'Неверная строка: должна заканчиваться на "'.concat(d12.suffix,'"'):d12.format==="includes"?'Неверная строка: должна содержать "'.concat(d12.includes,'"'):d12.format==="regex"?"Неверная строка: должна соответствовать шаблону ".concat(d12.pattern):"Неверный ".concat((c=r[d12.format])!=null?c:i.format)}case"not_multiple_of":return"Неверное число: должно быть кратным ".concat(i.divisor);case"unrecognized_keys":return"Нераспознанн".concat(i.keys.length>1?"ые":"ый"," ключ").concat(i.keys.length>1?"и":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Неверный ключ в ".concat(i.origin);case"invalid_union":return"Неверные входные данные";case"invalid_element":return"Неверное значение в ".concat(i.origin);default:return"Неверные входные данные"}}};function Bae(){return{localeError:pHe()}}var fHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};var r={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"število",array:"tabela"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Neveljaven vnos: pričakovano instanceof ".concat(i.expected,", prejeto ").concat(m):"Neveljaven vnos: pričakovano ".concat(u,", prejeto ").concat(m)}case"invalid_value":return i.values.length===1?"Neveljaven vnos: pričakovano ".concat(Ke(i.values[0])):"Neveljavna možnost: pričakovano eno izmed ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Preveliko: pričakovano, da bo ".concat((s=i.origin)!=null?s:"vrednost"," imelo ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"elementov"):"Preveliko: pričakovano, da bo ".concat((c=i.origin)!=null?c:"vrednost"," ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Premajhno: pričakovano, da bo ".concat(i.origin," imelo ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Premajhno: pričakovano, da bo ".concat(i.origin," ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Neveljaven niz: mora se začeti z "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Neveljaven niz: mora se končati z "'.concat(u12.suffix,'"'):u12.format==="includes"?'Neveljaven niz: mora vsebovati "'.concat(u12.includes,'"'):u12.format==="regex"?"Neveljaven niz: mora ustrezati vzorcu ".concat(u12.pattern):"Neveljaven ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Neveljavno število: mora biti večkratnik ".concat(i.divisor);case"unrecognized_keys":return"Neprepoznan".concat(i.keys.length>1?"i ključi":" ključ",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Neveljaven ključ v ".concat(i.origin);case"invalid_union":return"Neveljaven vnos";case"invalid_element":return"Neveljavna vrednost v ".concat(i.origin);default:return"Neveljaven vnos"}}};function qae(){return{localeError:fHe()}}var mHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xe5lla"},set:{unit:"objekt",verb:"att inneh\xe5lla"}};var r={regex:"regulj\xe4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xe4ng",base64url:"base64url-kodad str\xe4ng",json_string:"JSON-str\xe4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return function(i){var o,a,s,l,c,d,u,p,m,h;switch(i.code){case"invalid_type":{var g=(o=n[i.expected])!=null?o:i.expected,x=Je(i.input),v=(a=n[x])!=null?a:x;return/^[A-Z]/.test(i.expected)?"Ogiltig inmatning: f\xf6rv\xe4ntat instanceof ".concat(i.expected,", fick ").concat(v):"Ogiltig inmatning: f\xf6rv\xe4ntat ".concat(g,", fick ").concat(v)}case"invalid_value":return i.values.length===1?"Ogiltig inmatning: f\xf6rv\xe4ntat ".concat(Ke(i.values[0])):"Ogiltigt val: f\xf6rv\xe4ntade en av ".concat(Ce(i.values,"|"));case"too_big":{var g10=i.inclusive?"<=":"<",x10=t(i.origin);return x10?"F\xf6r stor(t): f\xf6rv\xe4ntade ".concat((s=i.origin)!=null?s:"v\xe4rdet"," att ha ").concat(g10).concat(i.maximum.toString()," ").concat((l=x10.unit)!=null?l:"element"):"F\xf6r stor(t): f\xf6rv\xe4ntat ".concat((c=i.origin)!=null?c:"v\xe4rdet"," att ha ").concat(g10).concat(i.maximum.toString())}case"too_small":{var g11=i.inclusive?">=":">",x11=t(i.origin);return x11?"F\xf6r lite(t): f\xf6rv\xe4ntade ".concat((d=i.origin)!=null?d:"v\xe4rdet"," att ha ").concat(g11).concat(i.minimum.toString()," ").concat(x11.unit):"F\xf6r lite(t): f\xf6rv\xe4ntade ".concat((u=i.origin)!=null?u:"v\xe4rdet"," att ha ").concat(g11).concat(i.minimum.toString())}case"invalid_format":{var g12=i;return g12.format==="starts_with"?'Ogiltig str\xe4ng: m\xe5ste b\xf6rja med "'.concat(g12.prefix,'"'):g12.format==="ends_with"?'Ogiltig str\xe4ng: m\xe5ste sluta med "'.concat(g12.suffix,'"'):g12.format==="includes"?'Ogiltig str\xe4ng: m\xe5ste inneh\xe5lla "'.concat(g12.includes,'"'):g12.format==="regex"?'Ogiltig str\xe4ng: m\xe5ste matcha m\xf6nstret "'.concat(g12.pattern,'"'):"Ogiltig(t) ".concat((p=r[g12.format])!=null?p:i.format)}case"not_multiple_of":return"Ogiltigt tal: m\xe5ste vara en multipel av ".concat(i.divisor);case"unrecognized_keys":return"".concat(i.keys.length>1?"Ok\xe4nda nycklar":"Ok\xe4nd nyckel",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Ogiltig nyckel i ".concat((m=i.origin)!=null?m:"v\xe4rdet");case"invalid_union":return"Ogiltig input";case"invalid_element":return"Ogiltigt v\xe4rde i ".concat((h=i.origin)!=null?h:"v\xe4rdet");default:return"Ogiltig input"}}};function Wae(){return{localeError:mHe()}}var hHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};var r={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ".concat(i.expected,", பெறப்பட்டது ").concat(m):"தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ".concat(u,", பெறப்பட்டது ").concat(m)}case"invalid_value":return i.values.length===1?"தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ".concat(Ke(i.values[0])):"தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ".concat(Ce(i.values,"|")," இல் ஒன்று");case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"மிக பெரியது: எதிர்பார்க்கப்பட்டது ".concat((s=i.origin)!=null?s:"மதிப்பு"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"உறுப்புகள்"," ஆக இருக்க வேண்டும்"):"மிக பெரியது: எதிர்பார்க்கப்பட்டது ".concat((c=i.origin)!=null?c:"மதிப்பு"," ").concat(u10).concat(i.maximum.toString()," ஆக இருக்க வேண்டும்")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," ஆக இருக்க வேண்டும்"):"மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ஆக இருக்க வேண்டும்")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'தவறான சரம்: "'.concat(u12.prefix,'" இல் தொடங்க வேண்டும்'):u12.format==="ends_with"?'தவறான சரம்: "'.concat(u12.suffix,'" இல் முடிவடைய வேண்டும்'):u12.format==="includes"?'தவறான சரம்: "'.concat(u12.includes,'" ஐ உள்ளடக்க வேண்டும்'):u12.format==="regex"?"தவறான சரம்: ".concat(u12.pattern," முறைபாட்டுடன் பொருந்த வேண்டும்"):"தவறான ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"தவறான எண்: ".concat(i.divisor," இன் பலமாக இருக்க வேண்டும்");case"unrecognized_keys":return"அடையாளம் தெரியாத விசை".concat(i.keys.length>1?"கள்":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," இல் தவறான விசை");case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return"".concat(i.origin," இல் தவறான மதிப்பு");default:return"தவறான உள்ளீடு"}}};function Vae(){return{localeError:hHe()}}var gHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};var r={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},n={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ".concat(i.expected," แต่ได้รับ ").concat(m):"ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ".concat(u," แต่ได้รับ ").concat(m)}case"invalid_value":return i.values.length===1?"ค่าไม่ถูกต้อง: ควรเป็น ".concat(Ke(i.values[0])):"ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"ไม่เกิน":"น้อยกว่า",p10=t(i.origin);return p10?"เกินกำหนด: ".concat((s=i.origin)!=null?s:"ค่า"," ควรมี").concat(u10," ").concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"รายการ"):"เกินกำหนด: ".concat((c=i.origin)!=null?c:"ค่า"," ควรมี").concat(u10," ").concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?"อย่างน้อย":"มากกว่า",p11=t(i.origin);return p11?"น้อยกว่ากำหนด: ".concat(i.origin," ควรมี").concat(u11," ").concat(i.minimum.toString()," ").concat(p11.unit):"น้อยกว่ากำหนด: ".concat(i.origin," ควรมี").concat(u11," ").concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "'.concat(u12.suffix,'"'):u12.format==="includes"?'รูปแบบไม่ถูกต้อง: ข้อความต้องมี "'.concat(u12.includes,'" อยู่ในข้อความ'):u12.format==="regex"?"รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ".concat(u12.pattern):"รูปแบบไม่ถูกต้อง: ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ".concat(i.divisor," ได้ลงตัว");case"unrecognized_keys":return"พบคีย์ที่ไม่รู้จัก: ".concat(Ce(i.keys,", "));case"invalid_key":return"คีย์ไม่ถูกต้องใน ".concat(i.origin);case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return"ข้อมูลไม่ถูกต้องใน ".concat(i.origin);default:return"ข้อมูลไม่ถูกต้อง"}}};function Gae(){return{localeError:gHe()}}var xHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"\xf6ğe",verb:"olmalı"},set:{unit:"\xf6ğe",verb:"olmalı"}};var r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xfcre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Ge\xe7ersiz değer: beklenen instanceof ".concat(i.expected,", alınan ").concat(m):"Ge\xe7ersiz değer: beklenen ".concat(u,", alınan ").concat(m)}case"invalid_value":return i.values.length===1?"Ge\xe7ersiz değer: beklenen ".concat(Ke(i.values[0])):"Ge\xe7ersiz se\xe7enek: aşağıdakilerden biri olmalı: ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"\xc7ok b\xfcy\xfck: beklenen ".concat((s=i.origin)!=null?s:"değer"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"\xf6ğe"):"\xc7ok b\xfcy\xfck: beklenen ".concat((c=i.origin)!=null?c:"değer"," ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"\xc7ok k\xfc\xe7\xfck: beklenen ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"\xc7ok k\xfc\xe7\xfck: beklenen ".concat(i.origin," ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Ge\xe7ersiz metin: "'.concat(u12.prefix,'" ile başlamalı'):u12.format==="ends_with"?'Ge\xe7ersiz metin: "'.concat(u12.suffix,'" ile bitmeli'):u12.format==="includes"?'Ge\xe7ersiz metin: "'.concat(u12.includes,'" i\xe7ermeli'):u12.format==="regex"?"Ge\xe7ersiz metin: ".concat(u12.pattern," desenine uymalı"):"Ge\xe7ersiz ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Ge\xe7ersiz sayı: ".concat(i.divisor," ile tam b\xf6l\xfcnebilmeli");case"unrecognized_keys":return"Tanınmayan anahtar".concat(i.keys.length>1?"lar":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," i\xe7inde ge\xe7ersiz anahtar");case"invalid_union":return"Ge\xe7ersiz değer";case"invalid_element":return"".concat(i.origin," i\xe7inde ge\xe7ersiz değer");default:return"Ge\xe7ersiz değer"}}};function Hae(){return{localeError:xHe()}}var yHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};var r={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},n={nan:"NaN",number:"число",array:"масив"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Неправильні вхідні дані: очікується instanceof ".concat(i.expected,", отримано ").concat(m):"Неправильні вхідні дані: очікується ".concat(u,", отримано ").concat(m)}case"invalid_value":return i.values.length===1?"Неправильні вхідні дані: очікується ".concat(Ke(i.values[0])):"Неправильна опція: очікується одне з ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Занадто велике: очікується, що ".concat((s=i.origin)!=null?s:"значення"," ").concat(p10.verb," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"елементів"):"Занадто велике: очікується, що ".concat((c=i.origin)!=null?c:"значення"," буде ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Занадто мале: очікується, що ".concat(i.origin," ").concat(p11.verb," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Занадто мале: очікується, що ".concat(i.origin," буде ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Неправильний рядок: повинен починатися з "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Неправильний рядок: повинен закінчуватися на "'.concat(u12.suffix,'"'):u12.format==="includes"?'Неправильний рядок: повинен містити "'.concat(u12.includes,'"'):u12.format==="regex"?"Неправильний рядок: повинен відповідати шаблону ".concat(u12.pattern):"Неправильний ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"Неправильне число: повинно бути кратним ".concat(i.divisor);case"unrecognized_keys":return"Нерозпізнаний ключ".concat(i.keys.length>1?"і":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"Неправильний ключ у ".concat(i.origin);case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return"Неправильне значення у ".concat(i.origin);default:return"Неправильні вхідні дані"}}};function hE(){return{localeError:yHe()}}function Zae(){return hE()}var vHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};var r={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},n={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"غلط ان پٹ: instanceof ".concat(i.expected," متوقع تھا، ").concat(m," موصول ہوا"):"غلط ان پٹ: ".concat(u," متوقع تھا، ").concat(m," موصول ہوا")}case"invalid_value":return i.values.length===1?"غلط ان پٹ: ".concat(Ke(i.values[0])," متوقع تھا"):"غلط آپشن: ".concat(Ce(i.values,"|")," میں سے ایک متوقع تھا");case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"بہت بڑا: ".concat((s=i.origin)!=null?s:"ویلیو"," کے ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"عناصر"," ہونے متوقع تھے"):"بہت بڑا: ".concat((c=i.origin)!=null?c:"ویلیو"," کا ").concat(u10).concat(i.maximum.toString()," ہونا متوقع تھا")}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"بہت چھوٹا: ".concat(i.origin," کے ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit," ہونے متوقع تھے"):"بہت چھوٹا: ".concat(i.origin," کا ").concat(u11).concat(i.minimum.toString()," ہونا متوقع تھا")}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'غلط سٹرنگ: "'.concat(u12.prefix,'" سے شروع ہونا چاہیے'):u12.format==="ends_with"?'غلط سٹرنگ: "'.concat(u12.suffix,'" پر ختم ہونا چاہیے'):u12.format==="includes"?'غلط سٹرنگ: "'.concat(u12.includes,'" شامل ہونا چاہیے'):u12.format==="regex"?"غلط سٹرنگ: پیٹرن ".concat(u12.pattern," سے میچ ہونا چاہیے"):"غلط ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"غلط نمبر: ".concat(i.divisor," کا مضاعف ہونا چاہیے");case"unrecognized_keys":return"غیر تسلیم شدہ کی".concat(i.keys.length>1?"ز":"",": ").concat(Ce(i.keys,"، "));case"invalid_key":return"".concat(i.origin," میں غلط کی");case"invalid_union":return"غلط ان پٹ";case"invalid_element":return"".concat(i.origin," میں غلط ویلیو");default:return"غلط ان پٹ"}}};function Kae(){return{localeError:vHe()}}var _He=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};var r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return function(i){var o,a,s,l,c;switch(i.code){case"invalid_type":{var d=(o=n[i.expected])!=null?o:i.expected,u=Je(i.input),p=(a=n[u])!=null?a:u;return/^[A-Z]/.test(i.expected)?"Noto‘g‘ri kirish: kutilgan instanceof ".concat(i.expected,", qabul qilingan ").concat(p):"Noto‘g‘ri kirish: kutilgan ".concat(d,", qabul qilingan ").concat(p)}case"invalid_value":return i.values.length===1?"Noto‘g‘ri kirish: kutilgan ".concat(Ke(i.values[0])):"Noto‘g‘ri variant: quyidagilardan biri kutilgan ".concat(Ce(i.values,"|"));case"too_big":{var d10=i.inclusive?"<=":"<",u10=t(i.origin);return u10?"Juda katta: kutilgan ".concat((s=i.origin)!=null?s:"qiymat"," ").concat(d10).concat(i.maximum.toString()," ").concat(u10.unit," ").concat(u10.verb):"Juda katta: kutilgan ".concat((l=i.origin)!=null?l:"qiymat"," ").concat(d10).concat(i.maximum.toString())}case"too_small":{var d11=i.inclusive?">=":">",u11=t(i.origin);return u11?"Juda kichik: kutilgan ".concat(i.origin," ").concat(d11).concat(i.minimum.toString()," ").concat(u11.unit," ").concat(u11.verb):"Juda kichik: kutilgan ".concat(i.origin," ").concat(d11).concat(i.minimum.toString())}case"invalid_format":{var d12=i;return d12.format==="starts_with"?'Noto‘g‘ri satr: "'.concat(d12.prefix,'" bilan boshlanishi kerak'):d12.format==="ends_with"?'Noto‘g‘ri satr: "'.concat(d12.suffix,'" bilan tugashi kerak'):d12.format==="includes"?'Noto‘g‘ri satr: "'.concat(d12.includes,'" ni o‘z ichiga olishi kerak'):d12.format==="regex"?"Noto‘g‘ri satr: ".concat(d12.pattern," shabloniga mos kelishi kerak"):"Noto‘g‘ri ".concat((c=r[d12.format])!=null?c:i.format)}case"not_multiple_of":return"Noto‘g‘ri raqam: ".concat(i.divisor," ning karralisi bo‘lishi kerak");case"unrecognized_keys":return"Noma’lum kalit".concat(i.keys.length>1?"lar":"",": ").concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," dagi kalit noto‘g‘ri");case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return"".concat(i.origin," da noto‘g‘ri qiymat");default:return"Noto‘g‘ri kirish"}}};function Qae(){return{localeError:_He()}}var bHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"k\xfd tự",verb:"c\xf3"},file:{unit:"byte",verb:"c\xf3"},array:{unit:"phần tử",verb:"c\xf3"},set:{unit:"phần tử",verb:"c\xf3"}};var r={regex:"đầu v\xe0o",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xe0y giờ ISO",date:"ng\xe0y ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi m\xe3 h\xf3a base64",base64url:"chuỗi m\xe3 h\xf3a base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu v\xe0o"},n={nan:"NaN",number:"số",array:"mảng"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi instanceof ".concat(i.expected,", nhận được ").concat(m):"Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ".concat(u,", nhận được ").concat(m)}case"invalid_value":return i.values.length===1?"Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ".concat(Ke(i.values[0])):"T\xf9y chọn kh\xf4ng hợp lệ: mong đợi một trong c\xe1c gi\xe1 trị ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"Qu\xe1 lớn: mong đợi ".concat((s=i.origin)!=null?s:"gi\xe1 trị"," ").concat(p10.verb," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"phần tử"):"Qu\xe1 lớn: mong đợi ".concat((c=i.origin)!=null?c:"gi\xe1 trị"," ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"Qu\xe1 nhỏ: mong đợi ".concat(i.origin," ").concat(p11.verb," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"Qu\xe1 nhỏ: mong đợi ".concat(i.origin," ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'Chuỗi kh\xf4ng hợp lệ: phải bắt đầu bằng "'.concat(u12.prefix,'"'):u12.format==="ends_with"?'Chuỗi kh\xf4ng hợp lệ: phải kết th\xfac bằng "'.concat(u12.suffix,'"'):u12.format==="includes"?'Chuỗi kh\xf4ng hợp lệ: phải bao gồm "'.concat(u12.includes,'"'):u12.format==="regex"?"Chuỗi kh\xf4ng hợp lệ: phải khớp với mẫu ".concat(u12.pattern):"".concat((d=r[u12.format])!=null?d:i.format," kh\xf4ng hợp lệ")}case"not_multiple_of":return"Số kh\xf4ng hợp lệ: phải l\xe0 bội số của ".concat(i.divisor);case"unrecognized_keys":return"Kh\xf3a kh\xf4ng được nhận dạng: ".concat(Ce(i.keys,", "));case"invalid_key":return"Kh\xf3a kh\xf4ng hợp lệ trong ".concat(i.origin);case"invalid_union":return"Đầu v\xe0o kh\xf4ng hợp lệ";case"invalid_element":return"Gi\xe1 trị kh\xf4ng hợp lệ trong ".concat(i.origin);default:return"Đầu v\xe0o kh\xf4ng hợp lệ"}}};function Jae(){return{localeError:bHe()}}var wHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};var r={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},n={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"无效输入:期望 instanceof ".concat(i.expected,",实际接收 ").concat(m):"无效输入:期望 ".concat(u,",实际接收 ").concat(m)}case"invalid_value":return i.values.length===1?"无效输入:期望 ".concat(Ke(i.values[0])):"无效选项:期望以下之一 ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"数值过大:期望 ".concat((s=i.origin)!=null?s:"值"," ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"个元素"):"数值过大:期望 ".concat((c=i.origin)!=null?c:"值"," ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"数值过小:期望 ".concat(i.origin," ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"数值过小:期望 ".concat(i.origin," ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'无效字符串:必须以 "'.concat(u12.prefix,'" 开头'):u12.format==="ends_with"?'无效字符串:必须以 "'.concat(u12.suffix,'" 结尾'):u12.format==="includes"?'无效字符串:必须包含 "'.concat(u12.includes,'"'):u12.format==="regex"?"无效字符串:必须满足正则表达式 ".concat(u12.pattern):"无效".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"无效数字:必须是 ".concat(i.divisor," 的倍数");case"unrecognized_keys":return"出现未知的键(key): ".concat(Ce(i.keys,", "));case"invalid_key":return"".concat(i.origin," 中的键(key)无效");case"invalid_union":return"无效输入";case"invalid_element":return"".concat(i.origin," 中包含无效值(value)");default:return"无效输入"}}};function Yae(){return{localeError:wHe()}}var SHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};var r={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},n={nan:"NaN"};return function(i){var o,a,s,l,c,d;switch(i.code){case"invalid_type":{var u=(o=n[i.expected])!=null?o:i.expected,p=Je(i.input),m=(a=n[p])!=null?a:p;return/^[A-Z]/.test(i.expected)?"無效的輸入值:預期為 instanceof ".concat(i.expected,",但收到 ").concat(m):"無效的輸入值:預期為 ".concat(u,",但收到 ").concat(m)}case"invalid_value":return i.values.length===1?"無效的輸入值:預期為 ".concat(Ke(i.values[0])):"無效的選項:預期為以下其中之一 ".concat(Ce(i.values,"|"));case"too_big":{var u10=i.inclusive?"<=":"<",p10=t(i.origin);return p10?"數值過大:預期 ".concat((s=i.origin)!=null?s:"值"," 應為 ").concat(u10).concat(i.maximum.toString()," ").concat((l=p10.unit)!=null?l:"個元素"):"數值過大:預期 ".concat((c=i.origin)!=null?c:"值"," 應為 ").concat(u10).concat(i.maximum.toString())}case"too_small":{var u11=i.inclusive?">=":">",p11=t(i.origin);return p11?"數值過小:預期 ".concat(i.origin," 應為 ").concat(u11).concat(i.minimum.toString()," ").concat(p11.unit):"數值過小:預期 ".concat(i.origin," 應為 ").concat(u11).concat(i.minimum.toString())}case"invalid_format":{var u12=i;return u12.format==="starts_with"?'無效的字串:必須以 "'.concat(u12.prefix,'" 開頭'):u12.format==="ends_with"?'無效的字串:必須以 "'.concat(u12.suffix,'" 結尾'):u12.format==="includes"?'無效的字串:必須包含 "'.concat(u12.includes,'"'):u12.format==="regex"?"無效的字串:必須符合格式 ".concat(u12.pattern):"無效的 ".concat((d=r[u12.format])!=null?d:i.format)}case"not_multiple_of":return"無效的數字:必須為 ".concat(i.divisor," 的倍數");case"unrecognized_keys":return"無法識別的鍵值".concat(i.keys.length>1?"們":"",":").concat(Ce(i.keys,"、"));case"invalid_key":return"".concat(i.origin," 中有無效的鍵值");case"invalid_union":return"無效的輸入值";case"invalid_element":return"".concat(i.origin," 中有無效的值");default:return"無效的輸入值"}}};function Xae(){return{localeError:SHe()}}var kHe=function(){var t=function t(i){var o;return(o=e[i])!=null?o:null};var e={string:{unit:"\xe0mi",verb:"n\xed"},file:{unit:"bytes",verb:"n\xed"},array:{unit:"nkan",verb:"n\xed"},set:{unit:"nkan",verb:"n\xed"}};var r={regex:"ẹ̀rọ \xecb\xe1wọl\xe9",email:"\xe0d\xedrẹ́s\xec \xecmẹ́l\xec",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xe0k\xf3k\xf2 ISO",date:"ọjọ́ ISO",time:"\xe0k\xf3k\xf2 ISO",duration:"\xe0k\xf3k\xf2 t\xf3 p\xe9 ISO",ipv4:"\xe0d\xedrẹ́s\xec IPv4",ipv6:"\xe0d\xedrẹ́s\xec IPv6",cidrv4:"\xe0gb\xe8gb\xe8 IPv4",cidrv6:"\xe0gb\xe8gb\xe8 IPv6",base64:"ọ̀rọ̀ t\xed a kọ́ n\xed base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mb\xe0 E.164",jwt:"JWT",template_literal:"ẹ̀rọ \xecb\xe1wọl\xe9"},n={nan:"NaN",number:"nọ́mb\xe0",array:"akopọ"};return function(i){var o,a,s,l;switch(i.code){case"invalid_type":{var c=(o=n[i.expected])!=null?o:i.expected,d=Je(i.input),u=(a=n[d])!=null?a:d;return/^[A-Z]/.test(i.expected)?"\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi instanceof ".concat(i.expected,", \xe0mọ̀ a r\xed ").concat(u):"\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi ".concat(c,", \xe0mọ̀ a r\xed ").concat(u)}case"invalid_value":return i.values.length===1?"\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi ".concat(Ke(i.values[0])):"\xc0ṣ\xe0y\xe0n aṣ\xecṣe: yan ọ̀kan l\xe1ra ".concat(Ce(i.values,"|"));case"too_big":{var c10=i.inclusive?"<=":"<",d10=t(i.origin);return d10?"T\xf3 pọ̀ j\xf9: a n\xed l\xe1ti jẹ́ p\xe9 ".concat((s=i.origin)!=null?s:"iye"," ").concat(d10.verb," ").concat(c10).concat(i.maximum," ").concat(d10.unit):"T\xf3 pọ̀ j\xf9: a n\xed l\xe1ti jẹ́ ".concat(c10).concat(i.maximum)}case"too_small":{var c11=i.inclusive?">=":">",d11=t(i.origin);return d11?"K\xe9r\xe9 ju: a n\xed l\xe1ti jẹ́ p\xe9 ".concat(i.origin," ").concat(d11.verb," ").concat(c11).concat(i.minimum," ").concat(d11.unit):"K\xe9r\xe9 ju: a n\xed l\xe1ti jẹ́ ".concat(c11).concat(i.minimum)}case"invalid_format":{var c12=i;return c12.format==="starts_with"?'Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀l\xfa "'.concat(c12.prefix,'"'):c12.format==="ends_with"?'Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ par\xed pẹ̀l\xfa "'.concat(c12.suffix,'"'):c12.format==="includes"?'Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ n\xed "'.concat(c12.includes,'"'):c12.format==="regex"?"Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ b\xe1 \xe0pẹẹrẹ mu ".concat(c12.pattern):"Aṣ\xecṣe: ".concat((l=r[c12.format])!=null?l:i.format)}case"not_multiple_of":return"Nọ́mb\xe0 aṣ\xecṣe: gbọ́dọ̀ jẹ́ \xe8y\xe0 p\xedp\xedn ti ".concat(i.divisor);case"unrecognized_keys":return"Bọt\xecn\xec \xe0\xecmọ̀: ".concat(Ce(i.keys,", "));case"invalid_key":return"Bọt\xecn\xec aṣ\xecṣe n\xedn\xfa ".concat(i.origin);case"invalid_union":return"\xccb\xe1wọl\xe9 aṣ\xecṣe";case"invalid_element":return"Iye aṣ\xecṣe n\xedn\xfa ".concat(i.origin);default:return"\xccb\xe1wọl\xe9 aṣ\xecṣe"}}};function ese(){return{localeError:kHe()}}var tse,U4=Symbol("ZodOutput"),B4=Symbol("ZodInput"),gE=/*#__PURE__*/function(){"use strict";function gE1(){_class_call_check(this,gE1);this._map=new WeakMap,this._idmap=new Map}_create_class(gE1,[{key:"add",value:function add(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var n=r[0];return this._map.set(t,n),n&&(typeof n==="undefined"?"undefined":_type_of(n))=="object"&&"id"in n&&this._idmap.set(n.id,t),this}},{key:"clear",value:function clear(){return this._map=new WeakMap,this._idmap=new Map,this}},{key:"remove",value:function remove(t){var r=this._map.get(t);return r&&(typeof r==="undefined"?"undefined":_type_of(r))=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}},{key:"get",value:function get1(t){var n;var r=t._zod.parent;if(r){var i=_object_spread({},(n=this.get(r))!=null?n:{});delete i.id;var o=_object_spread({},i,this._map.get(t));return Object.keys(o).length?o:void 0}return this._map.get(t)}},{key:"has",value:function has(t){return this._map.has(t)}}]);return gE1}();function By(){return new gE}var rse;(rse=(tse=globalThis).__zod_globalRegistry)!=null||(tse.__zod_globalRegistry=By());var Xo=globalThis.__zod_globalRegistry;function q4(e,t){return new e(_object_spread({type:"string"},Ne(t)))}function W4(e,t){return new e(_object_spread({type:"string",coerce:!0},Ne(t)))}function qy(e,t){return new e(_object_spread({type:"string",format:"email",check:"string_format",abort:!1},Ne(t)))}function n0(e,t){return new e(_object_spread({type:"string",format:"guid",check:"string_format",abort:!1},Ne(t)))}function Wy(e,t){return new e(_object_spread({type:"string",format:"uuid",check:"string_format",abort:!1},Ne(t)))}function Vy(e,t){return new e(_object_spread({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},Ne(t)))}function Gy(e,t){return new e(_object_spread({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},Ne(t)))}function Hy(e,t){return new e(_object_spread({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},Ne(t)))}function Bm(e,t){return new e(_object_spread({type:"string",format:"url",check:"string_format",abort:!1},Ne(t)))}function Zy(e,t){return new e(_object_spread({type:"string",format:"emoji",check:"string_format",abort:!1},Ne(t)))}function Ky(e,t){return new e(_object_spread({type:"string",format:"nanoid",check:"string_format",abort:!1},Ne(t)))}function Qy(e,t){return new e(_object_spread({type:"string",format:"cuid",check:"string_format",abort:!1},Ne(t)))}function Jy(e,t){return new e(_object_spread({type:"string",format:"cuid2",check:"string_format",abort:!1},Ne(t)))}function Yy(e,t){return new e(_object_spread({type:"string",format:"ulid",check:"string_format",abort:!1},Ne(t)))}function Xy(e,t){return new e(_object_spread({type:"string",format:"xid",check:"string_format",abort:!1},Ne(t)))}function e2(e,t){return new e(_object_spread({type:"string",format:"ksuid",check:"string_format",abort:!1},Ne(t)))}function t2(e,t){return new e(_object_spread({type:"string",format:"ipv4",check:"string_format",abort:!1},Ne(t)))}function r2(e,t){return new e(_object_spread({type:"string",format:"ipv6",check:"string_format",abort:!1},Ne(t)))}function V4(e,t){return new e(_object_spread({type:"string",format:"mac",check:"string_format",abort:!1},Ne(t)))}function n2(e,t){return new e(_object_spread({type:"string",format:"cidrv4",check:"string_format",abort:!1},Ne(t)))}function i2(e,t){return new e(_object_spread({type:"string",format:"cidrv6",check:"string_format",abort:!1},Ne(t)))}function o2(e,t){return new e(_object_spread({type:"string",format:"base64",check:"string_format",abort:!1},Ne(t)))}function a2(e,t){return new e(_object_spread({type:"string",format:"base64url",check:"string_format",abort:!1},Ne(t)))}function s2(e,t){return new e(_object_spread({type:"string",format:"e164",check:"string_format",abort:!1},Ne(t)))}function l2(e,t){return new e(_object_spread({type:"string",format:"jwt",check:"string_format",abort:!1},Ne(t)))}var G4={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function H4(e,t){return new e(_object_spread({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},Ne(t)))}function Z4(e,t){return new e(_object_spread({type:"string",format:"date",check:"string_format"},Ne(t)))}function K4(e,t){return new e(_object_spread({type:"string",format:"time",check:"string_format",precision:null},Ne(t)))}function Q4(e,t){return new e(_object_spread({type:"string",format:"duration",check:"string_format"},Ne(t)))}function J4(e,t){return new e(_object_spread({type:"number",checks:[]},Ne(t)))}function Y4(e,t){return new e(_object_spread({type:"number",coerce:!0,checks:[]},Ne(t)))}function X4(e,t){return new e(_object_spread({type:"number",check:"number_format",abort:!1,format:"safeint"},Ne(t)))}function e3(e,t){return new e(_object_spread({type:"number",check:"number_format",abort:!1,format:"float32"},Ne(t)))}function t3(e,t){return new e(_object_spread({type:"number",check:"number_format",abort:!1,format:"float64"},Ne(t)))}function r3(e,t){return new e(_object_spread({type:"number",check:"number_format",abort:!1,format:"int32"},Ne(t)))}function n3(e,t){return new e(_object_spread({type:"number",check:"number_format",abort:!1,format:"uint32"},Ne(t)))}function i3(e,t){return new e(_object_spread({type:"boolean"},Ne(t)))}function o3(e,t){return new e(_object_spread({type:"boolean",coerce:!0},Ne(t)))}function a3(e,t){return new e(_object_spread({type:"bigint"},Ne(t)))}function s3(e,t){return new e(_object_spread({type:"bigint",coerce:!0},Ne(t)))}function l3(e,t){return new e(_object_spread({type:"bigint",check:"bigint_format",abort:!1,format:"int64"},Ne(t)))}function u3(e,t){return new e(_object_spread({type:"bigint",check:"bigint_format",abort:!1,format:"uint64"},Ne(t)))}function c3(e,t){return new e(_object_spread({type:"symbol"},Ne(t)))}function d3(e,t){return new e(_object_spread({type:"undefined"},Ne(t)))}function p3(e,t){return new e(_object_spread({type:"null"},Ne(t)))}function f3(e){return new e({type:"any"})}function m3(e){return new e({type:"unknown"})}function h3(e,t){return new e(_object_spread({type:"never"},Ne(t)))}function g3(e,t){return new e(_object_spread({type:"void"},Ne(t)))}function x3(e,t){return new e(_object_spread({type:"date"},Ne(t)))}function y3(e,t){return new e(_object_spread({type:"date",coerce:!0},Ne(t)))}function v3(e,t){return new e(_object_spread({type:"nan"},Ne(t)))}function Lu(e,t){return new oE(_object_spread_props(_object_spread({check:"less_than"},Ne(t)),{value:e,inclusive:!1}))}function ya(e,t){return new oE(_object_spread_props(_object_spread({check:"less_than"},Ne(t)),{value:e,inclusive:!0}))}function Fu(e,t){return new aE(_object_spread_props(_object_spread({check:"greater_than"},Ne(t)),{value:e,inclusive:!1}))}function Mo(e,t){return new aE(_object_spread_props(_object_spread({check:"greater_than"},Ne(t)),{value:e,inclusive:!0}))}function u2(e){return Fu(0,e)}function c2(e){return Lu(0,e)}function d2(e){return ya(0,e)}function p2(e){return Mo(0,e)}function Ud(e,t){return new OD(_object_spread_props(_object_spread({check:"multiple_of"},Ne(t)),{value:e}))}function Bd(e,t){return new DD(_object_spread_props(_object_spread({check:"max_size"},Ne(t)),{maximum:e}))}function zu(e,t){return new LD(_object_spread_props(_object_spread({check:"min_size"},Ne(t)),{minimum:e}))}function nf(e,t){return new FD(_object_spread_props(_object_spread({check:"size_equals"},Ne(t)),{size:e}))}function of(e,t){return new zD(_object_spread_props(_object_spread({check:"max_length"},Ne(t)),{maximum:e}))}function kc(e,t){return new jD(_object_spread_props(_object_spread({check:"min_length"},Ne(t)),{minimum:e}))}function af(e,t){return new UD(_object_spread_props(_object_spread({check:"length_equals"},Ne(t)),{length:e}))}function qd(e,t){return new BD(_object_spread_props(_object_spread({check:"string_format",format:"regex"},Ne(t)),{pattern:e}))}function qm(e){return new qD(_object_spread({check:"string_format",format:"lowercase"},Ne(e)))}function Wm(e){return new WD(_object_spread({check:"string_format",format:"uppercase"},Ne(e)))}function Vm(e,t){return new VD(_object_spread_props(_object_spread({check:"string_format",format:"includes"},Ne(t)),{includes:e}))}function Gm(e,t){return new GD(_object_spread_props(_object_spread({check:"string_format",format:"starts_with"},Ne(t)),{prefix:e}))}function Hm(e,t){return new HD(_object_spread_props(_object_spread({check:"string_format",format:"ends_with"},Ne(t)),{suffix:e}))}function f2(e,t,r){return new ZD(_object_spread({check:"property",property:e,schema:t},Ne(r)))}function Zm(e,t){return new KD(_object_spread({check:"mime_type",mime:e},Ne(t)))}function Zl(e){return new QD({check:"overwrite",tx:e})}function Km(e){return Zl(function(t){return t.normalize(e)})}function Qm(){return Zl(function(e){return e.trim()})}function Jm(){return Zl(function(e){return e.toLowerCase()})}function Ym(){return Zl(function(e){return e.toUpperCase()})}function m2(){return Zl(function(e){return jN(e)})}function tL(e,t,r){return new e(_object_spread({type:"array",element:t},Ne(r)))}function EHe(e,t,r){return new e(_object_spread({type:"union",options:t},Ne(r)))}function THe(e,t,r){return new e(_object_spread({type:"union",options:t,inclusive:!1},Ne(r)))}function AHe(e,t,r,n){return new e(_object_spread({type:"union",options:r,discriminator:t},Ne(n)))}function IHe(e,t,r){return new e({type:"intersection",left:t,right:r})}function PHe(e,t,r,n){var i=_instanceof(r,sr),o=i?n:r,a=i?r:null;return new e(_object_spread({type:"tuple",items:t,rest:a},Ne(o)))}function RHe(e,t,r,n){return new e(_object_spread({type:"record",keyType:t,valueType:r},Ne(n)))}function MHe(e,t,r,n){return new e(_object_spread({type:"map",keyType:t,valueType:r},Ne(n)))}function OHe(e,t,r){return new e(_object_spread({type:"set",valueType:t},Ne(r)))}function $He(e,t,r){var n=Array.isArray(t)?Object.fromEntries(t.map(function(i){return[i,i]})):t;return new e(_object_spread({type:"enum",entries:n},Ne(r)))}function NHe(e,t,r){return new e(_object_spread({type:"enum",entries:t},Ne(r)))}function DHe(e,t,r){return new e(_object_spread({type:"literal",values:Array.isArray(t)?t:[t]},Ne(r)))}function _3(e,t){return new e(_object_spread({type:"file"},Ne(t)))}function LHe(e,t){return new e({type:"transform",transform:t})}function FHe(e,t){return new e({type:"optional",innerType:t})}function zHe(e,t){return new e({type:"nullable",innerType:t})}function jHe(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Py(r)}})}function UHe(e,t,r){return new e(_object_spread({type:"nonoptional",innerType:t},Ne(r)))}function BHe(e,t){return new e({type:"success",innerType:t})}function qHe(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:function(){return r}})}function WHe(e,t,r){return new e({type:"pipe",in:t,out:r})}function VHe(e,t){return new e({type:"readonly",innerType:t})}function GHe(e,t,r){return new e(_object_spread({type:"template_literal",parts:t},Ne(r)))}function HHe(e,t){return new e({type:"lazy",getter:t})}function ZHe(e,t){return new e({type:"promise",innerType:t})}function b3(e,t,r){var o;var n=Ne(r);return(o=n.abort)!=null||(n.abort=!0),new e(_object_spread({type:"custom",check:"custom",fn:t},n))}function w3(e,t,r){return new e(_object_spread({type:"custom",check:"custom",fn:t},Ne(r)))}function S3(e){var t=nse(function(r){return r.addIssue=function(n){var i,o,a,s;if(typeof n=="string")r.issues.push(Ry(n,r.value,t._zod.def));else{var l=n;l.fatal&&(l.continue=!1),(i=l.code)!=null||(l.code="custom"),(o=l.input)!=null||(l.input=r.value),(a=l.inst)!=null||(l.inst=t),(s=l.continue)!=null||(l.continue=!t._zod.def.abort),r.issues.push(Ry(l))}},e(r.value,r)});return t}function nse(e,t){var r=new qn(_object_spread({check:"custom"},Ne(t)));return r._zod.check=e,r}function k3(e){var t=new qn({check:"describe"});return t._zod.onattach=[function(r){var i;var n=(i=Xo.get(r))!=null?i:{};Xo.add(r,_object_spread_props(_object_spread({},n),{description:e}))}],t._zod.check=function(){},t}function C3(e){var t=new qn({check:"meta"});return t._zod.onattach=[function(r){var i;var n=(i=Xo.get(r))!=null?i:{};Xo.add(r,_object_spread({},n,e))}],t._zod.check=function(){},t}function E3(e,t){var m,h,g,x,v;var r=Ne(t),n=(m=r.truthy)!=null?m:["true","1","yes","on","y","enabled"],i=(h=r.falsy)!=null?h:["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(function(y){return typeof y=="string"?y.toLowerCase():y}),i=i.map(function(y){return typeof y=="string"?y.toLowerCase():y}));var o=new Set(n),a=new Set(i),s=(g=e.Codec)!=null?g:r0,l=(x=e.Boolean)!=null?x:e0,c=(v=e.String)!=null?v:rf,d=new c({type:"string",error:r.error}),u=new l({type:"boolean",error:r.error}),p=new s({type:"pipe",in:d,out:u,transform:function(y,_){var b=y;return r.case!=="sensitive"&&(b=b.toLowerCase()),o.has(b)?!0:a.has(b)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:_to_consumable_array(o).concat(_to_consumable_array(a)),input:_.value,inst:p,continue:!1}),{})},reverseTransform:function(y,_){return y===!0?n[0]||"true":i[0]||"false"},error:r.error});return p}function Cc(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};var i=Ne(n),o=_object_spread(_object_spread_props(_object_spread({},Ne(n)),{check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:function(s){return r.test(s)}}),i);return _instanceof(r,RegExp)&&(o.pattern=r),new e(o)}function Xm(e){var r,n,i,o,a,s,l,c,d;var t=(r=e==null?void 0:e.target)!=null?r:"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:(n=e.processors)!=null?n:{},metadataRegistry:(i=e==null?void 0:e.metadata)!=null?i:Xo,target:t,unrepresentable:(o=e==null?void 0:e.unrepresentable)!=null?o:"throw",override:(a=e==null?void 0:e.override)!=null?a:function(){},io:(s=e==null?void 0:e.io)!=null?s:"output",counter:0,seen:new Map,cycles:(l=e==null?void 0:e.cycles)!=null?l:"ref",reused:(c=e==null?void 0:e.reused)!=null?c:"inline",external:(d=e==null?void 0:e.external)!=null?d:void 0}}function zn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:[],schemaPath:[]};var d,u,p;var n;var i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;var a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);var s=(u=(d=e._zod).toJSONSchema)==null?void 0:u.call(d);if(s)a.schema=s;else{var m=_object_spread_props(_object_spread({},r),{schemaPath:_to_consumable_array(r.schemaPath).concat([e]),path:r.path});if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,m);else{var g=a.schema,x=t.processors[i.type];if(!x)throw new Error("[toJSONSchema]: Non-representable type encountered: ".concat(i.type));x(e,t,g,m)}var h=e._zod.parent;h&&(a.ref||(a.ref=h),zn(h,t,m),t.seen.get(h).isParent=!0)}var l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&_s(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((p=(n=a.schema).default)!=null||(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function eh(e,t){var a,s,l,c;var r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");var n=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.seen.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;var u=(a=e.metadataRegistry.get(d[0]))==null?void 0:a.id;if(u){var p=n.get(u);if(p&&p!==d[0])throw new Error('Duplicate schema id "'.concat(u,'" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.'));n.set(u,d[0])}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var i=function(d){var g,x,v,y,_;var u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){var b=(g=e.external.registry.get(d[0]))==null?void 0:g.id,w=(x=e.external.uri)!=null?x:function(k){return k};if(b)return{ref:w(b)};var S=(y=(v=d[1].defId)!=null?v:d[1].schema.id)!=null?y:"schema".concat(e.counter++);return d[1].defId=S,{defId:S,ref:"".concat(w("__shared"),"#/").concat(u,"/").concat(S)}}if(d[1]===r)return{ref:"#"};var m="#/".concat(u,"/"),h=(_=d[1].schema.id)!=null?_:"__schema".concat(e.counter++);return{defId:h,ref:m+h}},o=function(d){if(d[1].schema.$ref)return;var u=d[1],_i1=i(d),p=_i1.ref,m=_i1.defId;u.def=_object_spread({},u.schema),m&&(u.defId=m);var h=u.schema;for(var g in h)delete h[g];h.$ref=p};var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(e.cycles==="throw")try{for(var _iterator1=e.seen.entries()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d10=_step1.value;var u10=d10[1];if(u10.cycle)throw new Error("Cycle detected: #/".concat((s=u10.cycle)==null?void 0:s.join("/"),'/<root>\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.'))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=e.seen.entries()[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var d11=_step2.value;var u11=d11[1];if(t===d11[0]){o(d11);continue}if(e.external){var m=(l=e.external.registry.get(d11[0]))==null?void 0:l.id;if(t!==d11[0]&&m){o(d11);continue}}if((c=e.metadataRegistry.get(d11[0]))==null?void 0:c.id){o(d11);continue}if(u11.cycle){o(d11);continue}if(u11.count>1&&e.reused==="ref"){o(d11);continue}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}function th(e,t){var a,s,l,c,d;var r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");var n=function(u){var v,y,_;var p=e.seen.get(u);if(p.ref===null)return;var m=(v=p.def)!=null?v:p.schema,h=_object_spread({},m),g=p.ref;if(p.ref=null,g){n(g);var b=e.seen.get(g),w=b.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=(y=m.allOf)!=null?y:[],m.allOf.push(w)):Object.assign(m,w),Object.assign(m,h),u._zod.parent===g)for(var k in m)k==="$ref"||k==="allOf"||k in h||delete m[k];if(w.$ref&&b.def)for(var k10 in m)k10==="$ref"||k10==="allOf"||k10 in b.def&&JSON.stringify(m[k10])===JSON.stringify(b.def[k10])&&delete m[k10]}var x=u._zod.parent;if(x&&x!==g){n(x);var b10=e.seen.get(x);if(b10!=null&&b10.schema.$ref&&(m.$ref=b10.schema.$ref,b10.def))for(var w10 in m)w10==="$ref"||w10==="allOf"||w10 in b10.def&&JSON.stringify(m[w10])===JSON.stringify(b10.def[w10])&&delete m[w10]}e.override({zodSchema:u,jsonSchema:m,path:(_=p.path)!=null?_:[]})};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_to_consumable_array(e.seen.entries()).reverse()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;n(u[0])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){var u10=(s=e.external.registry.get(t))==null?void 0:s.id;if(!u10)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(u10)}Object.assign(i,(l=r.def)!=null?l:r.schema);var o=(d=(c=e.external)==null?void 0:c.defs)!=null?d:{};var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e.seen.entries()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u11=_step1.value;var p=u11[1];p.def&&p.defId&&(o[p.defId]=p.def)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{var u12=JSON.parse(JSON.stringify(i));return Object.defineProperty(u12,"~standard",{value:_object_spread_props(_object_spread({},t["~standard"]),{jsonSchema:{input:h2(t,"input",e.processors),output:h2(t,"output",e.processors)}}),enumerable:!1,writable:!1}),u12}catch(u){throw new Error("Error converting schema to JSON.")}}function _s(e,t){var r=t!=null?t:{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);var n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return _s(n.element,r);if(n.type==="set")return _s(n.valueType,r);if(n.type==="lazy")return _s(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return _s(n.innerType,r);if(n.type==="intersection")return _s(n.left,r)||_s(n.right,r);if(n.type==="record"||n.type==="map")return _s(n.keyType,r)||_s(n.valueType,r);if(n.type==="pipe")return _s(n.in,r)||_s(n.out,r);if(n.type==="object"){for(var i in n.shape)if(_s(n.shape[i],r))return!0;return!1}if(n.type==="union"){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n.options[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i10=_step.value;if(_s(i10,r))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}if(n.type==="tuple"){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=n.items[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var i11=_step1.value;if(_s(i11,r))return!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!!(n.rest&&_s(n.rest,r))}return!1}var rL=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(r){var n=Xm(_object_spread_props(_object_spread({},r),{processors:t}));return zn(e,n),eh(n,e),th(n,e)}},h2=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(n){var _ref=n!=null?n:{},i=_ref.libraryOptions,o=_ref.target,a=Xm(_object_spread_props(_object_spread({},i!=null?i:{}),{target:o,io:t,processors:r}));return zn(e,a),eh(a,e),th(a,e)}};var KHe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nL=function(e,t,r,n){var d;var i=r;i.type="string";var _e__zod_bag=e._zod.bag,o=_e__zod_bag.minimum,a=_e__zod_bag.maximum,s=_e__zod_bag.format,l=_e__zod_bag.patterns,c=_e__zod_bag.contentEncoding;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),s&&(i.format=(d=KHe[s])!=null?d:s,i.format===""&&delete i.format,s==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){var u=_to_consumable_array(l);u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=_to_consumable_array(u.map(function(p){return _object_spread_props(_object_spread({},t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{}),{pattern:p.source})})))}},iL=function(e,t,r,n){var i=r,_e__zod_bag=e._zod.bag,o=_e__zod_bag.minimum,a=_e__zod_bag.maximum,s=_e__zod_bag.format,l=_e__zod_bag.multipleOf,c=_e__zod_bag.exclusiveMaximum,d=_e__zod_bag.exclusiveMinimum;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof o=="number"&&(i.minimum=o,typeof d=="number"&&t.target!=="draft-04"&&(d>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c),typeof a=="number"&&(i.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},oL=function(e,t,r,n){r.type="boolean"},aL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},sL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},lL=function(e,t,r,n){t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},uL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},cL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},dL=function(e,t,r,n){r.not={}},pL=function(e,t,r,n){},fL=function(e,t,r,n){},mL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},hL=function(e,t,r,n){var i=e._zod.def,o=ww(i.entries);o.every(function(a){return typeof a=="number"})&&(r.type="number"),o.every(function(a){return typeof a=="string"})&&(r.type="string"),r.enum=o},gL=function(e,t,r,n){var i=e._zod.def,o=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.values[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if((typeof a==="undefined"?"undefined":_type_of(a))=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(o.length!==0)if(o.length===1){var a9=o[0];r.type=a9===null?"null":typeof a9==="undefined"?"undefined":_type_of(a9),t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a9]:r.const=a9}else o.every(function(a){return typeof a=="number"})&&(r.type="number"),o.every(function(a){return typeof a=="string"})&&(r.type="string"),o.every(function(a){return typeof a=="boolean"})&&(r.type="boolean"),o.every(function(a){return a===null})&&(r.type="null"),r.enum=o},xL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yL=function(e,t,r,n){var i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},vL=function(e,t,r,n){var i=r,o={type:"string",format:"binary",contentEncoding:"binary"},_e__zod_bag=e._zod.bag,a=_e__zod_bag.minimum,s=_e__zod_bag.maximum,l=_e__zod_bag.mime;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),l?l.length===1?(o.contentMediaType=l[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=l.map(function(c){return{contentMediaType:c}})):Object.assign(i,o)},_L=function(e,t,r,n){r.type="boolean"},bL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},SL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},CL=function(e,t,r,n){if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},EL=function(e,t,r,n){var i=r,o=e._zod.def,_e__zod_bag=e._zod.bag,a=_e__zod_bag.minimum,s=_e__zod_bag.maximum;typeof a=="number"&&(i.minItems=a),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=zn(o.element,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["items"])}))},TL=function(e,t,r,n){var c;var i=r,o=e._zod.def;i.type="object",i.properties={};var a=o.shape;for(var d in a)i.properties[d]=zn(a[d],t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["properties",d])}));var s=new Set(Object.keys(a)),l=new Set(_to_consumable_array(s).filter(function(d){var u=o.shape[d]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((c=o.catchall)==null?void 0:c._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=zn(o.catchall,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["additionalProperties"])}))):t.io==="output"&&(i.additionalProperties=!1)},yE=function(e,t,r,n){var i=e._zod.def,o=i.inclusive===!1,a=i.options.map(function(s,l){return zn(s,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat([o?"oneOf":"anyOf",l])}))});o?r.oneOf=a:r.anyOf=a},AL=function(e,t,r,n){var i=e._zod.def,o=zn(i.left,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["allOf",0])})),a=zn(i.right,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["allOf",1])})),s=function(c){return"allOf"in c&&Object.keys(c).length===1},l=_to_consumable_array(s(o)?o.allOf:[o]).concat(_to_consumable_array(s(a)?a.allOf:[a]));r.allOf=l},IL=function(e,t,r,n){var i=r,o=e._zod.def;i.type="array";var a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map(function(p,m){return zn(p,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat([a,m])}))}),c=o.rest?zn(o.rest,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat([s],_to_consumable_array(t.target==="openapi-3.0"?[o.items.length]:[]))})):null;t.target==="draft-2020-12"?(i.prefixItems=l,c&&(i.items=c)):t.target==="openapi-3.0"?(i.items={anyOf:l},c&&i.items.anyOf.push(c),i.minItems=l.length,c||(i.maxItems=l.length)):(i.items=l,c&&(i.additionalItems=c));var _e__zod_bag=e._zod.bag,d=_e__zod_bag.minimum,u=_e__zod_bag.maximum;typeof d=="number"&&(i.minItems=d),typeof u=="number"&&(i.maxItems=u)},PL=function(e,t,r,n){var i=r,o=e._zod.def;i.type="object";var a=o.keyType,s=a._zod.bag,l=s==null?void 0:s.patterns;if(o.mode==="loose"&&l&&l.size>0){var d=zn(o.valueType,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["patternProperties","*"])}));i.patternProperties={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=l[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;i.patternProperties[u.source]=d}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=zn(o.keyType,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["propertyNames"])}))),i.additionalProperties=zn(o.valueType,t,_object_spread_props(_object_spread({},n),{path:_to_consumable_array(n.path).concat(["additionalProperties"])}));var c=a._zod.values;if(c){var d10=_to_consumable_array(c).filter(function(u){return typeof u=="string"||typeof u=="number"});d10.length>0&&(i.required=d10)}},RL=function(e,t,r,n){var i=e._zod.def,o=zn(i.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},ML=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType},OL=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},$L=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},NL=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType;var a;try{a=i.catchValue(void 0)}catch(s){throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},DL=function(e,t,r,n){var i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;zn(o,t,n);var a=t.seen.get(e);a.ref=o},LL=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},FL=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType},vE=function(e,t,r,n){var i=e._zod.def;zn(i.innerType,t,n);var o=t.seen.get(e);o.ref=i.innerType},zL=function(e,t,r,n){var i=e._zod.innerType;zn(i,t,n);var o=t.seen.get(e);o.ref=i},xE={string:nL,number:iL,boolean:oL,bigint:aL,symbol:sL,null:lL,undefined:uL,void:cL,never:dL,any:pL,unknown:fL,date:mL,enum:hL,literal:gL,nan:xL,template_literal:yL,file:vL,success:_L,custom:bL,function:wL,transform:SL,map:kL,set:CL,array:EL,object:TL,union:yE,intersection:AL,tuple:IL,record:PL,nullable:RL,nonoptional:ML,default:OL,prefault:$L,catch:NL,pipe:DL,readonly:LL,promise:FL,optional:vE,lazy:zL};function sf(e,t){if("_idmap"in e){var n=e,i=Xm(_object_spread_props(_object_spread({},t),{processors:xE})),o={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n._idmap.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var _l1=_sliced_to_array(l,2),c=_l1[0],d=_l1[1];zn(d,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var a={},s={registry:n,uri:t==null?void 0:t.uri,defs:o};i.external=s;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=n._idmap.entries()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var l10=_step1.value;var _l2=_sliced_to_array(l10,2),c10=_l2[0],d10=_l2[1];eh(i,d10),a[c10]=th(i,d10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(Object.keys(o).length>0){var l11=i.target==="draft-2020-12"?"$defs":"definitions";a.__shared=_define_property({},l11,o)}return{schemas:a}}var r=Xm(_object_spread_props(_object_spread({},t),{processors:xE}));return zn(e,r),eh(r,e),th(r,e)}var _E=/*#__PURE__*/function(){"use strict";function _E1(t){_class_call_check(this,_E1);var n;var r=(n=t==null?void 0:t.target)!=null?n:"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Xm(_object_spread({processors:xE,target:r},(t==null?void 0:t.metadata)&&{metadata:t.metadata},(t==null?void 0:t.unrepresentable)&&{unrepresentable:t.unrepresentable},(t==null?void 0:t.override)&&{override:t.override},(t==null?void 0:t.io)&&{io:t.io}))}_create_class(_E1,[{key:"metadataRegistry",get:function get1(){return this.ctx.metadataRegistry}},{key:"target",get:function get1(){return this.ctx.target}},{key:"unrepresentable",get:function get1(){return this.ctx.unrepresentable}},{key:"override",get:function get1(){return this.ctx.override}},{key:"io",get:function get1(){return this.ctx.io}},{key:"counter",get:function get1(){return this.ctx.counter},set:function set1(t){this.ctx.counter=t}},{key:"seen",get:function get1(){return this.ctx.seen}},{key:"process",value:function process1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{path:[],schemaPath:[]};return zn(t,this.ctx,r)}},{key:"emit",value:function emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),eh(this.ctx,t);var n=th(this.ctx,t),i=n["~standard"],o=_object_without_properties(n,["~standard"]);return o}}]);return _E1}();var jL={};var T3={};$l(T3,{ZodAny:function(){return aF},ZodArray:function(){return cF},ZodBase64:function(){return UE},ZodBase64URL:function(){return BE},ZodBigInt:function(){return b2},ZodBigIntFormat:function(){return VE},ZodBoolean:function(){return _2},ZodCIDRv4:function(){return zE},ZodCIDRv6:function(){return jE},ZodCUID:function(){return ME},ZodCUID2:function(){return OE},ZodCatch:function(){return PF},ZodCodec:function(){return YE},ZodCustom:function(){return z3},ZodCustomStringFormat:function(){return y2},ZodDate:function(){return $3},ZodDefault:function(){return kF},ZodDiscriminatedUnion:function(){return pF},ZodE164:function(){return qE},ZodEmail:function(){return AE},ZodEmoji:function(){return PE},ZodEnum:function(){return g2},ZodExactOptional:function(){return bF},ZodFile:function(){return vF},ZodFunction:function(){return zF},ZodGUID:function(){return I3},ZodIPv4:function(){return LE},ZodIPv6:function(){return FE},ZodIntersection:function(){return fF},ZodJWT:function(){return WE},ZodKSUID:function(){return DE},ZodLazy:function(){return DF},ZodLiteral:function(){return yF},ZodMAC:function(){return rF},ZodMap:function(){return gF},ZodNaN:function(){return MF},ZodNanoID:function(){return RE},ZodNever:function(){return lF},ZodNonOptional:function(){return QE},ZodNull:function(){return oF},ZodNullable:function(){return SF},ZodNumber:function(){return v2},ZodNumberFormat:function(){return i0},ZodObject:function(){return N3},ZodOptional:function(){return KE},ZodPipe:function(){return JE},ZodPrefault:function(){return EF},ZodPromise:function(){return FF},ZodReadonly:function(){return OF},ZodRecord:function(){return F3},ZodSet:function(){return xF},ZodString:function(){return x2},ZodStringFormat:function(){return Jn},ZodSuccess:function(){return IF},ZodSymbol:function(){return nF},ZodTemplateLiteral:function(){return NF},ZodTransform:function(){return _F},ZodTuple:function(){return mF},ZodType:function(){return Or},ZodULID:function(){return $E},ZodURL:function(){return M3},ZodUUID:function(){return Wd},ZodUndefined:function(){return iF},ZodUnion:function(){return D3},ZodUnknown:function(){return sF},ZodVoid:function(){return uF},ZodXID:function(){return NE},ZodXor:function(){return dF},_ZodString:function(){return TE},_default:function(){return CF},_function:function(){return ile},any:function(){return GE},array:function(){return lt},base64:function(){return kse},base64url:function(){return Cse},bigint:function(){return Dse},boolean:function(){return jn},catch:function(){return RF},check:function(){return ole},cidrv4:function(){return wse},cidrv6:function(){return Sse},codec:function(){return tle},cuid:function(){return mse},cuid2:function(){return hse},custom:function(){return XE},date:function(){return Bse},describe:function(){return ale},discriminatedUnion:function(){return L3},e164:function(){return Ese},email:function(){return ose},emoji:function(){return pse},enum:function(){return Ra},exactOptional:function(){return wF},file:function(){return Jse},float32:function(){return Mse},float64:function(){return Ose},function:function(){return ile},guid:function(){return ase},hash:function(){return Rse},hex:function(){return Pse},hostname:function(){return Ise},httpUrl:function(){return dse},instanceof:function(){return lle},int:function(){return EE},int32:function(){return $se},int64:function(){return Lse},intersection:function(){return w2},ipv4:function(){return vse},ipv6:function(){return bse},json:function(){return cle},jwt:function(){return Tse},keyof:function(){return qse},ksuid:function(){return yse},lazy:function(){return LF},literal:function(){return Lt},looseObject:function(){return fo},looseRecord:function(){return Hse},mac:function(){return _se},map:function(){return Zse},meta:function(){return sle},nan:function(){return ele},nanoid:function(){return fse},nativeEnum:function(){return Qse},never:function(){return HE},nonoptional:function(){return AF},null:function(){return O3},nullable:function(){return P3},nullish:function(){return Yse},number:function(){return un},object:function(){return mt},optional:function(){return oi},partialRecord:function(){return Gse},pipe:function(){return R3},prefault:function(){return TF},preprocess:function(){return j3},promise:function(){return nle},readonly:function(){return $F},record:function(){return Wn},refine:function(){return jF},set:function(){return Kse},strictObject:function(){return Wse},string:function(){return ce},stringFormat:function(){return Ase},stringbool:function(){return ule},success:function(){return Xse},superRefine:function(){return UF},symbol:function(){return zse},templateLiteral:function(){return rle},transform:function(){return ZE},tuple:function(){return hF},uint32:function(){return Nse},uint64:function(){return Fse},ulid:function(){return gse},undefined:function(){return jse},union:function(){return Xn},unknown:function(){return Yn},url:function(){return IE},uuid:function(){return sse},uuidv4:function(){return lse},uuidv6:function(){return use},uuidv7:function(){return cse},void:function(){return Use},xid:function(){return xse},xor:function(){return Vse}});var bE={};$l(bE,{endsWith:function(){return Hm},gt:function(){return Fu},gte:function(){return Mo},includes:function(){return Vm},length:function(){return af},lowercase:function(){return qm},lt:function(){return Lu},lte:function(){return ya},maxLength:function(){return of},maxSize:function(){return Bd},mime:function(){return Zm},minLength:function(){return kc},minSize:function(){return zu},multipleOf:function(){return Ud},negative:function(){return c2},nonnegative:function(){return p2},nonpositive:function(){return d2},normalize:function(){return Km},overwrite:function(){return Zl},positive:function(){return u2},property:function(){return f2},regex:function(){return qd},size:function(){return nf},slugify:function(){return m2},startsWith:function(){return Gm},toLowerCase:function(){return Jm},toUpperCase:function(){return Ym},trim:function(){return Qm},uppercase:function(){return Wm}});var lf={};$l(lf,{ZodISODate:function(){return SE},ZodISODateTime:function(){return wE},ZodISODuration:function(){return CE},ZodISOTime:function(){return kE},date:function(){return BL},datetime:function(){return UL},duration:function(){return WL},time:function(){return qL}});var wE=X("ZodISODateTime",function(e,t){Ww.init(e,t),Jn.init(e,t)});function UL(e){return H4(wE,e)}var SE=X("ZodISODate",function(e,t){Vw.init(e,t),Jn.init(e,t)});function BL(e){return Z4(SE,e)}var kE=X("ZodISOTime",function(e,t){Gw.init(e,t),Jn.init(e,t)});function qL(e){return K4(kE,e)}var CE=X("ZodISODuration",function(e,t){Hw.init(e,t),Jn.init(e,t)});function WL(e){return Q4(CE,e)}var ise=function(e,t){Tw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:function(r){return Yg(e,r)}},flatten:{value:function(r){return Jg(e,r)}},addIssue:{value:function(r){e.issues.push(r),e.message=JSON.stringify(e.issues,Ay,2)}},addIssues:{value:function(r){var _e_issues;(_e_issues=e.issues).push.apply(_e_issues,_to_consumable_array(r)),e.message=JSON.stringify(e.issues,Ay,2)}},isEmpty:{get:function get1(){return e.issues.length===0}}})},JHe=X("ZodError",ise),sl=X("ZodError",ise,{Parent:Error});var VL=My(sl),GL=Oy(sl),HL=$y(sl),A3=Ny(sl),ZL=KC(sl),KL=QC(sl),QL=JC(sl),JL=YC(sl),YL=XC(sl),XL=eE(sl),eF=tE(sl),tF=rE(sl);var Or=X("ZodType",function(e,t){return sr.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:h2(e,"input"),output:h2(e,"output")}}),e.toJSONSchema=rL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}var n;return e.clone(He.mergeDefs(t,{checks:_to_consumable_array((n=t.checks)!=null?n:[]).concat(_to_consumable_array(r.map(function(i){return typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i})))}),{parent:!0})},e.with=e.check,e.clone=function(r,n){return Po(e,r,n)},e.brand=function(){return e},e.register=function(r,n){return r.add(e,n),e},e.parse=function(r,n){return VL(e,r,n,{callee:e.parse})},e.safeParse=function(r,n){return HL(e,r,n)},e.parseAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,GL(e,r,n,{callee:e.parseAsync})]})})()},e.safeParseAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,A3(e,r,n)]})})()},e.spa=e.safeParseAsync,e.encode=function(r,n){return ZL(e,r,n)},e.decode=function(r,n){return KL(e,r,n)},e.encodeAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,QL(e,r,n)]})})()},e.decodeAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,JL(e,r,n)]})})()},e.safeEncode=function(r,n){return YL(e,r,n)},e.safeDecode=function(r,n){return XL(e,r,n)},e.safeEncodeAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,eF(e,r,n)]})})()},e.safeDecodeAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,tF(e,r,n)]})})()},e.refine=function(r,n){return e.check(jF(r,n))},e.superRefine=function(r){return e.check(UF(r))},e.overwrite=function(r){return e.check(Zl(r))},e.optional=function(){return oi(e)},e.exactOptional=function(){return wF(e)},e.nullable=function(){return P3(e)},e.nullish=function(){return oi(P3(e))},e.nonoptional=function(r){return AF(e,r)},e.array=function(){return lt(e)},e.or=function(r){return Xn([e,r])},e.and=function(r){return w2(e,r)},e.transform=function(r){return R3(e,ZE(r))},e.default=function(r){return CF(e,r)},e.prefault=function(r){return TF(e,r)},e.catch=function(r){return RF(e,r)},e.pipe=function(r){return R3(e,r)},e.readonly=function(){return $F(e)},e.describe=function(r){var n=e.clone();return Xo.add(n,{description:r}),n},Object.defineProperty(e,"description",{get:function get1(){var r;return(r=Xo.get(e))==null?void 0:r.description},configurable:!0}),e.meta=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}if(r.length===0)return Xo.get(e);var n=e.clone();return Xo.add(n,r[0]),n},e.isOptional=function(){return e.safeParse(void 0).success},e.isNullable=function(){return e.safeParse(null).success},e.apply=function(r){return r(e)},e}),TE=X("_ZodString",function(e,t){var n,i,o;rf.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(a,s,l){return nL(e,a,s,l)};var r=e._zod.bag;e.format=(n=r.format)!=null?n:null,e.minLength=(i=r.minimum)!=null?i:null,e.maxLength=(o=r.maximum)!=null?o:null,e.regex=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(qd.apply(void 0,_to_consumable_array(a)))},e.includes=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(Vm.apply(void 0,_to_consumable_array(a)))},e.startsWith=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(Gm.apply(void 0,_to_consumable_array(a)))},e.endsWith=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(Hm.apply(void 0,_to_consumable_array(a)))},e.min=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(kc.apply(void 0,_to_consumable_array(a)))},e.max=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(of.apply(void 0,_to_consumable_array(a)))},e.length=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(af.apply(void 0,_to_consumable_array(a)))},e.nonempty=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(kc.apply(void 0,[1].concat(_to_consumable_array(a))))},e.lowercase=function(a){return e.check(qm(a))},e.uppercase=function(a){return e.check(Wm(a))},e.trim=function(){return e.check(Qm())},e.normalize=function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return e.check(Km.apply(void 0,_to_consumable_array(a)))},e.toLowerCase=function(){return e.check(Jm())},e.toUpperCase=function(){return e.check(Ym())},e.slugify=function(){return e.check(m2())}}),x2=X("ZodString",function(e,t){rf.init(e,t),TE.init(e,t),e.email=function(r){return e.check(qy(AE,r))},e.url=function(r){return e.check(Bm(M3,r))},e.jwt=function(r){return e.check(l2(WE,r))},e.emoji=function(r){return e.check(Zy(PE,r))},e.guid=function(r){return e.check(n0(I3,r))},e.uuid=function(r){return e.check(Wy(Wd,r))},e.uuidv4=function(r){return e.check(Vy(Wd,r))},e.uuidv6=function(r){return e.check(Gy(Wd,r))},e.uuidv7=function(r){return e.check(Hy(Wd,r))},e.nanoid=function(r){return e.check(Ky(RE,r))},e.guid=function(r){return e.check(n0(I3,r))},e.cuid=function(r){return e.check(Qy(ME,r))},e.cuid2=function(r){return e.check(Jy(OE,r))},e.ulid=function(r){return e.check(Yy($E,r))},e.base64=function(r){return e.check(o2(UE,r))},e.base64url=function(r){return e.check(a2(BE,r))},e.xid=function(r){return e.check(Xy(NE,r))},e.ksuid=function(r){return e.check(e2(DE,r))},e.ipv4=function(r){return e.check(t2(LE,r))},e.ipv6=function(r){return e.check(r2(FE,r))},e.cidrv4=function(r){return e.check(n2(zE,r))},e.cidrv6=function(r){return e.check(i2(jE,r))},e.e164=function(r){return e.check(s2(qE,r))},e.datetime=function(r){return e.check(UL(r))},e.date=function(r){return e.check(BL(r))},e.time=function(r){return e.check(qL(r))},e.duration=function(r){return e.check(WL(r))}});function ce(e){return q4(x2,e)}var Jn=X("ZodStringFormat",function(e,t){Fn.init(e,t),TE.init(e,t)}),AE=X("ZodEmail",function(e,t){Nw.init(e,t),Jn.init(e,t)});function ose(e){return qy(AE,e)}var I3=X("ZodGUID",function(e,t){Ow.init(e,t),Jn.init(e,t)});function ase(e){return n0(I3,e)}var Wd=X("ZodUUID",function(e,t){$w.init(e,t),Jn.init(e,t)});function sse(e){return Wy(Wd,e)}function lse(e){return Vy(Wd,e)}function use(e){return Gy(Wd,e)}function cse(e){return Hy(Wd,e)}var M3=X("ZodURL",function(e,t){Dw.init(e,t),Jn.init(e,t)});function IE(e){return Bm(M3,e)}function dse(e){return Bm(M3,_object_spread({protocol:/^https?$/,hostname:Ro.domain},He.normalizeParams(e)))}var PE=X("ZodEmoji",function(e,t){Lw.init(e,t),Jn.init(e,t)});function pse(e){return Zy(PE,e)}var RE=X("ZodNanoID",function(e,t){Fw.init(e,t),Jn.init(e,t)});function fse(e){return Ky(RE,e)}var ME=X("ZodCUID",function(e,t){zw.init(e,t),Jn.init(e,t)});function mse(e){return Qy(ME,e)}var OE=X("ZodCUID2",function(e,t){jw.init(e,t),Jn.init(e,t)});function hse(e){return Jy(OE,e)}var $E=X("ZodULID",function(e,t){Uw.init(e,t),Jn.init(e,t)});function gse(e){return Yy($E,e)}var NE=X("ZodXID",function(e,t){Bw.init(e,t),Jn.init(e,t)});function xse(e){return Xy(NE,e)}var DE=X("ZodKSUID",function(e,t){qw.init(e,t),Jn.init(e,t)});function yse(e){return e2(DE,e)}var LE=X("ZodIPv4",function(e,t){Zw.init(e,t),Jn.init(e,t)});function vse(e){return t2(LE,e)}var rF=X("ZodMAC",function(e,t){Qw.init(e,t),Jn.init(e,t)});function _se(e){return V4(rF,e)}var FE=X("ZodIPv6",function(e,t){Kw.init(e,t),Jn.init(e,t)});function bse(e){return r2(FE,e)}var zE=X("ZodCIDRv4",function(e,t){Jw.init(e,t),Jn.init(e,t)});function wse(e){return n2(zE,e)}var jE=X("ZodCIDRv6",function(e,t){Yw.init(e,t),Jn.init(e,t)});function Sse(e){return i2(jE,e)}var UE=X("ZodBase64",function(e,t){Xw.init(e,t),Jn.init(e,t)});function kse(e){return o2(UE,e)}var BE=X("ZodBase64URL",function(e,t){e4.init(e,t),Jn.init(e,t)});function Cse(e){return a2(BE,e)}var qE=X("ZodE164",function(e,t){t4.init(e,t),Jn.init(e,t)});function Ese(e){return s2(qE,e)}var WE=X("ZodJWT",function(e,t){r4.init(e,t),Jn.init(e,t)});function Tse(e){return l2(WE,e)}var y2=X("ZodCustomStringFormat",function(e,t){n4.init(e,t),Jn.init(e,t)});function Ase(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Cc(y2,e,t,r)}function Ise(e){return Cc(y2,"hostname",Ro.hostname,e)}function Pse(e){return Cc(y2,"hex",Ro.hex,e)}function Rse(e,t){var o;var r=(o=t==null?void 0:t.enc)!=null?o:"hex",n="".concat(e,"_").concat(r),i=Ro[n];if(!i)throw new Error("Unrecognized hash format: ".concat(n));return Cc(y2,n,i,t)}var v2=X("ZodNumber",function(e,t){var n,i,o,a,s,l,c,d,u;Ly.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(p,m,h){return iL(e,p,m,h)},e.gt=function(p,m){return e.check(Fu(p,m))},e.gte=function(p,m){return e.check(Mo(p,m))},e.min=function(p,m){return e.check(Mo(p,m))},e.lt=function(p,m){return e.check(Lu(p,m))},e.lte=function(p,m){return e.check(ya(p,m))},e.max=function(p,m){return e.check(ya(p,m))},e.int=function(p){return e.check(EE(p))},e.safe=function(p){return e.check(EE(p))},e.positive=function(p){return e.check(Fu(0,p))},e.nonnegative=function(p){return e.check(Mo(0,p))},e.negative=function(p){return e.check(Lu(0,p))},e.nonpositive=function(p){return e.check(ya(0,p))},e.multipleOf=function(p,m){return e.check(Ud(p,m))},e.step=function(p,m){return e.check(Ud(p,m))},e.finite=function(){return e};var r=e._zod.bag;e.minValue=(o=Math.max((n=r.minimum)!=null?n:Number.NEGATIVE_INFINITY,(i=r.exclusiveMinimum)!=null?i:Number.NEGATIVE_INFINITY))!=null?o:null,e.maxValue=(l=Math.min((a=r.maximum)!=null?a:Number.POSITIVE_INFINITY,(s=r.exclusiveMaximum)!=null?s:Number.POSITIVE_INFINITY))!=null?l:null,e.isInt=((c=r.format)!=null?c:"").includes("int")||Number.isSafeInteger((d=r.multipleOf)!=null?d:.5),e.isFinite=!0,e.format=(u=r.format)!=null?u:null});function un(e){return J4(v2,e)}var i0=X("ZodNumberFormat",function(e,t){i4.init(e,t),v2.init(e,t)});function EE(e){return X4(i0,e)}function Mse(e){return e3(i0,e)}function Ose(e){return t3(i0,e)}function $se(e){return r3(i0,e)}function Nse(e){return n3(i0,e)}var _2=X("ZodBoolean",function(e,t){e0.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return oL(e,r,n,i)}});function jn(e){return i3(_2,e)}var b2=X("ZodBigInt",function(e,t){var n,i,o;Fy.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(a,s,l){return aL(e,a,s,l)},e.gte=function(a,s){return e.check(Mo(a,s))},e.min=function(a,s){return e.check(Mo(a,s))},e.gt=function(a,s){return e.check(Fu(a,s))},e.gte=function(a,s){return e.check(Mo(a,s))},e.min=function(a,s){return e.check(Mo(a,s))},e.lt=function(a,s){return e.check(Lu(a,s))},e.lte=function(a,s){return e.check(ya(a,s))},e.max=function(a,s){return e.check(ya(a,s))},e.positive=function(a){return e.check(Fu(BigInt(0),a))},e.negative=function(a){return e.check(Lu(BigInt(0),a))},e.nonpositive=function(a){return e.check(ya(BigInt(0),a))},e.nonnegative=function(a){return e.check(Mo(BigInt(0),a))},e.multipleOf=function(a,s){return e.check(Ud(a,s))};var r=e._zod.bag;e.minValue=(n=r.minimum)!=null?n:null,e.maxValue=(i=r.maximum)!=null?i:null,e.format=(o=r.format)!=null?o:null});function Dse(e){return a3(b2,e)}var VE=X("ZodBigIntFormat",function(e,t){o4.init(e,t),b2.init(e,t)});function Lse(e){return l3(VE,e)}function Fse(e){return u3(VE,e)}var nF=X("ZodSymbol",function(e,t){a4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return sL(e,r,n,i)}});function zse(e){return c3(nF,e)}var iF=X("ZodUndefined",function(e,t){s4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return uL(e,r,n,i)}});function jse(e){return d3(iF,e)}var oF=X("ZodNull",function(e,t){l4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return lL(e,r,n,i)}});function O3(e){return p3(oF,e)}var aF=X("ZodAny",function(e,t){u4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return pL(e,r,n,i)}});function GE(){return f3(aF)}var sF=X("ZodUnknown",function(e,t){c4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return fL(e,r,n,i)}});function Yn(){return m3(sF)}var lF=X("ZodNever",function(e,t){d4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return dL(e,r,n,i)}});function HE(e){return h3(lF,e)}var uF=X("ZodVoid",function(e,t){p4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return cL(e,r,n,i)}});function Use(e){return g3(uF,e)}var $3=X("ZodDate",function(e,t){f4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(n,i,o){return mL(e,n,i,o)},e.min=function(n,i){return e.check(Mo(n,i))},e.max=function(n,i){return e.check(ya(n,i))};var r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Bse(e){return x3($3,e)}var cF=X("ZodArray",function(e,t){m4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return EL(e,r,n,i)},e.element=t.element,e.min=function(r,n){return e.check(kc(r,n))},e.nonempty=function(r){return e.check(kc(1,r))},e.max=function(r,n){return e.check(of(r,n))},e.length=function(r,n){return e.check(af(r,n))},e.unwrap=function(){return e.element}});function lt(e,t){return tL(cF,e,t)}function qse(e){var t=e._zod.def.shape;return Ra(Object.keys(t))}var N3=X("ZodObject",function(e,t){eL.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return TL(e,r,n,i)},He.defineLazy(e,"shape",function(){return t.shape}),e.keyof=function(){return Ra(Object.keys(e._zod.def.shape))},e.catchall=function(r){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:r}))},e.passthrough=function(){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:Yn()}))},e.loose=function(){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:Yn()}))},e.strict=function(){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:HE()}))},e.strip=function(){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:void 0}))},e.extend=function(r){return He.extend(e,r)},e.safeExtend=function(r){return He.safeExtend(e,r)},e.merge=function(r){return He.merge(e,r)},e.pick=function(r){return He.pick(e,r)},e.omit=function(r){return He.omit(e,r)},e.partial=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return He.partial(KE,e,r[0])},e.required=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return He.required(QE,e,r[0])}});function mt(e,t){var r=_object_spread({type:"object",shape:e!=null?e:{}},He.normalizeParams(t));return new N3(r)}function Wse(e,t){return new N3(_object_spread({type:"object",shape:e,catchall:HE()},He.normalizeParams(t)))}function fo(e,t){return new N3(_object_spread({type:"object",shape:e,catchall:Yn()},He.normalizeParams(t)))}var D3=X("ZodUnion",function(e,t){t0.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return yE(e,r,n,i)},e.options=t.options});function Xn(e,t){return new D3(_object_spread({type:"union",options:e},He.normalizeParams(t)))}var dF=X("ZodXor",function(e,t){D3.init(e,t),h4.init(e,t),e._zod.processJSONSchema=function(r,n,i){return yE(e,r,n,i)},e.options=t.options});function Vse(e,t){return new dF(_object_spread({type:"union",options:e,inclusive:!1},He.normalizeParams(t)))}var pF=X("ZodDiscriminatedUnion",function(e,t){D3.init(e,t),g4.init(e,t)});function L3(e,t,r){return new pF(_object_spread({type:"union",options:t,discriminator:e},He.normalizeParams(r)))}var fF=X("ZodIntersection",function(e,t){x4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return AL(e,r,n,i)}});function w2(e,t){return new fF({type:"intersection",left:e,right:t})}var mF=X("ZodTuple",function(e,t){zy.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return IL(e,r,n,i)},e.rest=function(r){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{rest:r}))}});function hF(e,t,r){var n=_instanceof(t,sr),i=n?r:t,o=n?t:null;return new mF(_object_spread({type:"tuple",items:e,rest:o},He.normalizeParams(i)))}var F3=X("ZodRecord",function(e,t){y4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return PL(e,r,n,i)},e.keyType=t.keyType,e.valueType=t.valueType});function Wn(e,t,r){return new F3(_object_spread({type:"record",keyType:e,valueType:t},He.normalizeParams(r)))}function Gse(e,t,r){var n=Po(e);return n._zod.values=void 0,new F3(_object_spread({type:"record",keyType:n,valueType:t},He.normalizeParams(r)))}function Hse(e,t,r){return new F3(_object_spread({type:"record",keyType:e,valueType:t,mode:"loose"},He.normalizeParams(r)))}var gF=X("ZodMap",function(e,t){v4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return kL(e,r,n,i)},e.keyType=t.keyType,e.valueType=t.valueType,e.min=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(zu.apply(void 0,_to_consumable_array(r)))},e.nonempty=function(r){return e.check(zu(1,r))},e.max=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(Bd.apply(void 0,_to_consumable_array(r)))},e.size=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(nf.apply(void 0,_to_consumable_array(r)))}});function Zse(e,t,r){return new gF(_object_spread({type:"map",keyType:e,valueType:t},He.normalizeParams(r)))}var xF=X("ZodSet",function(e,t){_4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return CL(e,r,n,i)},e.min=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(zu.apply(void 0,_to_consumable_array(r)))},e.nonempty=function(r){return e.check(zu(1,r))},e.max=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(Bd.apply(void 0,_to_consumable_array(r)))},e.size=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}return e.check(nf.apply(void 0,_to_consumable_array(r)))}});function Kse(e,t){return new xF(_object_spread({type:"set",valueType:e},He.normalizeParams(t)))}var g2=X("ZodEnum",function(e,t){b4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(n,i,o){return hL(e,n,i,o)},e.enum=t.entries,e.options=Object.values(t.entries);var r=new Set(Object.keys(t.entries));e.extract=function(n,i){var o={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(r.has(a))o[a]=t.entries[a];else throw new Error("Key ".concat(a," not found in enum"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new g2(_object_spread_props(_object_spread(_object_spread_props(_object_spread({},t),{checks:[]}),He.normalizeParams(i)),{entries:o}))},e.exclude=function(n,i){var o=_object_spread({},t.entries);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(r.has(a))delete o[a];else throw new Error("Key ".concat(a," not found in enum"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new g2(_object_spread_props(_object_spread(_object_spread_props(_object_spread({},t),{checks:[]}),He.normalizeParams(i)),{entries:o}))}});function Ra(e,t){var r=Array.isArray(e)?Object.fromEntries(e.map(function(n){return[n,n]})):e;return new g2(_object_spread({type:"enum",entries:r},He.normalizeParams(t)))}function Qse(e,t){return new g2(_object_spread({type:"enum",entries:e},He.normalizeParams(t)))}var yF=X("ZodLiteral",function(e,t){w4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return gL(e,r,n,i)},e.values=new Set(t.values),Object.defineProperty(e,"value",{get:function get1(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Lt(e,t){return new yF(_object_spread({type:"literal",values:Array.isArray(e)?e:[e]},He.normalizeParams(t)))}var vF=X("ZodFile",function(e,t){S4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return vL(e,r,n,i)},e.min=function(r,n){return e.check(zu(r,n))},e.max=function(r,n){return e.check(Bd(r,n))},e.mime=function(r,n){return e.check(Zm(Array.isArray(r)?r:[r],n))}});function Jse(e){return _3(vF,e)}var _F=X("ZodTransform",function(e,t){k4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return SL(e,r,n,i)},e._zod.parse=function(r,n){if(n.direction==="backward")throw new $m(e.constructor.name);r.addIssue=function(o){var a,s,l;if(typeof o=="string")r.issues.push(He.issue(o,r.value,t));else{var c=o;c.fatal&&(c.continue=!1),(a=c.code)!=null||(c.code="custom"),(s=c.input)!=null||(c.input=r.value),(l=c.inst)!=null||(c.inst=e),r.issues.push(He.issue(c))}};var i=t.transform(r.value,r);return _instanceof(i,Promise)?i.then(function(o){return r.value=o,r}):(r.value=i,r)}});function ZE(e){return new _F({type:"transform",transform:e})}var KE=X("ZodOptional",function(e,t){jy.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return vE(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function oi(e){return new KE({type:"optional",innerType:e})}var bF=X("ZodExactOptional",function(e,t){C4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return vE(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function wF(e){return new bF({type:"optional",innerType:e})}var SF=X("ZodNullable",function(e,t){E4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return RL(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function P3(e){return new SF({type:"nullable",innerType:e})}function Yse(e){return oi(P3(e))}var kF=X("ZodDefault",function(e,t){T4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return OL(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType},e.removeDefault=e.unwrap});function CF(e,t){return new kF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():He.shallowClone(t)}})}var EF=X("ZodPrefault",function(e,t){A4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return $L(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function TF(e,t){return new EF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():He.shallowClone(t)}})}var QE=X("ZodNonOptional",function(e,t){I4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return ML(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function AF(e,t){return new QE(_object_spread({type:"nonoptional",innerType:e},He.normalizeParams(t)))}var IF=X("ZodSuccess",function(e,t){P4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return _L(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function Xse(e){return new IF({type:"success",innerType:e})}var PF=X("ZodCatch",function(e,t){R4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return NL(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType},e.removeCatch=e.unwrap});function RF(e,t){return new PF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:function(){return t}})}var MF=X("ZodNaN",function(e,t){M4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return xL(e,r,n,i)}});function ele(e){return v3(MF,e)}var JE=X("ZodPipe",function(e,t){O4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return DL(e,r,n,i)},e.in=t.in,e.out=t.out});function R3(e,t){return new JE({type:"pipe",in:e,out:t})}var YE=X("ZodCodec",function(e,t){JE.init(e,t),r0.init(e,t)});function tle(e,t,r){return new YE({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var OF=X("ZodReadonly",function(e,t){$4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return LL(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function $F(e){return new OF({type:"readonly",innerType:e})}var NF=X("ZodTemplateLiteral",function(e,t){N4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return yL(e,r,n,i)}});function rle(e,t){return new NF(_object_spread({type:"template_literal",parts:e},He.normalizeParams(t)))}var DF=X("ZodLazy",function(e,t){F4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return zL(e,r,n,i)},e.unwrap=function(){return e._zod.def.getter()}});function LF(e){return new DF({type:"lazy",getter:e})}var FF=X("ZodPromise",function(e,t){L4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return FL(e,r,n,i)},e.unwrap=function(){return e._zod.def.innerType}});function nle(e){return new FF({type:"promise",innerType:e})}var zF=X("ZodFunction",function(e,t){D4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return wL(e,r,n,i)}});function ile(e){var t,r;return new zF({type:"function",input:Array.isArray(e==null?void 0:e.input)?hF(e==null?void 0:e.input):(t=e==null?void 0:e.input)!=null?t:lt(Yn()),output:(r=e==null?void 0:e.output)!=null?r:Yn()})}var z3=X("ZodCustom",function(e,t){z4.init(e,t),Or.init(e,t),e._zod.processJSONSchema=function(r,n,i){return bL(e,r,n,i)}});function ole(e){var t=new qn({check:"custom"});return t._zod.check=e,t}function XE(e,t){return b3(z3,e!=null?e:function(){return!0},t)}function jF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w3(z3,e,t)}function UF(e){return S3(e)}var ale=k3,sle=C3;function lle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=new z3(_object_spread({type:"custom",check:"custom",fn:function(n){return _instanceof(n,e)},abort:!0},He.normalizeParams(t)));return r._zod.bag.Class=e,r._zod.check=function(n){var i;_instanceof(n.value,e)||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:_to_consumable_array((i=r._zod.def.path)!=null?i:[])})},r}var ule=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return E3.apply(void 0,[{Codec:YE,Boolean:_2,String:x2}].concat(_to_consumable_array(e)))};function cle(e){var t=LF(function(){return Xn([ce(e),un(),jn(),O3(),lt(t),Wn(ce(),t)])});return t}function j3(e,t){return R3(ZE(e),t)}var qF={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function XHe(e){Ri({customError:e})}function eZe(){return Ri().customError}var BF;(function(e){})(BF||(BF={}));var vt=_object_spread_props(_object_spread({},T3,bE),{iso:lf}),tZe=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function rZe(e,t){var r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t!=null?t:"draft-2020-12"}function nZe(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");var r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;var n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){var i=r[1];if(!i||!t.defs[i])throw new Error("Reference not found: ".concat(e));return t.defs[i]}throw new Error("Reference not found: ".concat(e))}function dle(e,t){if(e.not!==void 0){if(_type_of(e.not)=="object"&&Object.keys(e.not).length===0)return vt.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){var i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return vt.lazy(function(){if(!t.refs.has(i))throw new Error("Circular reference not resolved: ".concat(i));return t.refs.get(i)});t.processing.add(i);var o=nZe(i,t),a=rs(o,t);return t.refs.set(i,a),t.processing.delete(i),a}if(e.enum!==void 0){var i10=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i10.length===1&&i10[0]===null)return vt.null();if(i10.length===0)return vt.never();if(i10.length===1)return vt.literal(i10[0]);if(i10.every(function(a){return typeof a=="string"}))return vt.enum(i10);var o10=i10.map(function(a){return vt.literal(a)});return o10.length<2?o10[0]:vt.union([o10[0],o10[1]].concat(_to_consumable_array(o10.slice(2))))}if(e.const!==void 0)return vt.literal(e.const);var r=e.type;if(Array.isArray(r)){var i11=r.map(function(o){var a=_object_spread_props(_object_spread({},e),{type:o});return dle(a,t)});return i11.length===0?vt.never():i11.length===1?i11[0]:vt.union(i11)}if(!r)return vt.any();var n;switch(r){case"string":{var i12=vt.string();if(e.format){var o11=e.format;o11==="email"?i12=i12.check(vt.email()):o11==="uri"||o11==="uri-reference"?i12=i12.check(vt.url()):o11==="uuid"||o11==="guid"?i12=i12.check(vt.uuid()):o11==="date-time"?i12=i12.check(vt.iso.datetime()):o11==="date"?i12=i12.check(vt.iso.date()):o11==="time"?i12=i12.check(vt.iso.time()):o11==="duration"?i12=i12.check(vt.iso.duration()):o11==="ipv4"?i12=i12.check(vt.ipv4()):o11==="ipv6"?i12=i12.check(vt.ipv6()):o11==="mac"?i12=i12.check(vt.mac()):o11==="cidr"?i12=i12.check(vt.cidrv4()):o11==="cidr-v6"?i12=i12.check(vt.cidrv6()):o11==="base64"?i12=i12.check(vt.base64()):o11==="base64url"?i12=i12.check(vt.base64url()):o11==="e164"?i12=i12.check(vt.e164()):o11==="jwt"?i12=i12.check(vt.jwt()):o11==="emoji"?i12=i12.check(vt.emoji()):o11==="nanoid"?i12=i12.check(vt.nanoid()):o11==="cuid"?i12=i12.check(vt.cuid()):o11==="cuid2"?i12=i12.check(vt.cuid2()):o11==="ulid"?i12=i12.check(vt.ulid()):o11==="xid"?i12=i12.check(vt.xid()):o11==="ksuid"&&(i12=i12.check(vt.ksuid()))}typeof e.minLength=="number"&&(i12=i12.min(e.minLength)),typeof e.maxLength=="number"&&(i12=i12.max(e.maxLength)),e.pattern&&(i12=i12.regex(new RegExp(e.pattern))),n=i12;break}case"number":case"integer":{var i13=r==="integer"?vt.number().int():vt.number();typeof e.minimum=="number"&&(i13=i13.min(e.minimum)),typeof e.maximum=="number"&&(i13=i13.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i13=i13.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i13=i13.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i13=i13.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i13=i13.lt(e.maximum)),typeof e.multipleOf=="number"&&(i13=i13.multipleOf(e.multipleOf)),n=i13;break}case"boolean":{n=vt.boolean();break}case"null":{n=vt.null();break}case"object":{var i14={},o12=e.properties||{},a9=new Set(e.required||[]);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(o12)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),l=_step_value[0],c=_step_value[1];var d=rs(c,t);i14[l]=a9.has(l)?d:d.optional()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(e.propertyNames){var l10=rs(e.propertyNames,t),c10=e.additionalProperties&&_type_of(e.additionalProperties)=="object"?rs(e.additionalProperties,t):vt.any();if(Object.keys(i14).length===0){n=vt.record(l10,c10);break}var d10=vt.object(i14).passthrough(),u=vt.looseRecord(l10,c10);n=vt.intersection(d10,u);break}if(e.patternProperties){var _u;var l11=e.patternProperties,c11=Object.keys(l11),d11=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=c11[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var p=_step1.value;var m=rs(l11[p],t),h=vt.string().regex(new RegExp(p));d11.push(vt.looseRecord(h,m))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var u10=[];if(Object.keys(i14).length>0&&u10.push(vt.object(i14).passthrough()),(_u=u10).push.apply(_u,_to_consumable_array(d11)),u10.length===0)n=vt.object({}).passthrough();else if(u10.length===1)n=u10[0];else{var p10=vt.intersection(u10[0],u10[1]);for(var m10=2;m10<u10.length;m10++)p10=vt.intersection(p10,u10[m10]);n=p10}break}var s=vt.object(i14);e.additionalProperties===!1?n=s.strict():_type_of(e.additionalProperties)=="object"?n=s.catchall(rs(e.additionalProperties,t)):n=s.passthrough();break}case"array":{var i15=e.prefixItems,o13=e.items;if(i15&&Array.isArray(i15)){var a10=i15.map(function(l){return rs(l,t)}),s10=o13&&(typeof o13==="undefined"?"undefined":_type_of(o13))=="object"&&!Array.isArray(o13)?rs(o13,t):void 0;s10?n=vt.tuple(a10).rest(s10):n=vt.tuple(a10),typeof e.minItems=="number"&&(n=n.check(vt.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(vt.maxLength(e.maxItems)))}else if(Array.isArray(o13)){var a11=o13.map(function(l){return rs(l,t)}),s11=e.additionalItems&&_type_of(e.additionalItems)=="object"?rs(e.additionalItems,t):void 0;s11?n=vt.tuple(a11).rest(s11):n=vt.tuple(a11),typeof e.minItems=="number"&&(n=n.check(vt.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(vt.maxLength(e.maxItems)))}else if(o13!==void 0){var a12=rs(o13,t),s12=vt.array(a12);typeof e.minItems=="number"&&(s12=s12.min(e.minItems)),typeof e.maxItems=="number"&&(s12=s12.max(e.maxItems)),n=s12}else n=vt.array(vt.any());break}default:throw new Error("Unsupported type: ".concat(r))}return e.description&&(n=n.describe(e.description)),e.default!==void 0&&(n=n.default(e.default)),n}function rs(e,t){if(typeof e=="boolean")return e?vt.any():vt.never();var r=dle(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){var s=e.anyOf.map(function(c){return rs(c,t)}),l=vt.union(s);r=n?vt.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){var s10=e.oneOf.map(function(c){return rs(c,t)}),l10=vt.xor(s10);r=n?vt.intersection(r,l10):l10}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:vt.any();else{var s11=n?r:rs(e.allOf[0],t),l11=n?0:1;for(var c=l11;c<e.allOf.length;c++)s11=vt.intersection(s11,rs(e.allOf[c],t));r=s11}e.nullable===!0&&t.version==="openapi-3.0"&&(r=vt.nullable(r)),e.readOnly===!0&&(r=vt.readonly(r));var i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s12=_step.value;s12 in e&&(i[s12]=e[s12])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var a=["contentEncoding","contentMediaType","contentSchema"];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s13=_step1.value;s13 in e&&(i[s13]=e[s13])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=Object.keys(e)[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var s14=_step2.value;tZe.has(s14)||(i[s14]=e[s14])}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return Object.keys(i).length>0&&t.registry.add(r,i),r}function ple(e,t){var o;if(typeof e=="boolean")return e?vt.any():vt.never();var r=rZe(e,t==null?void 0:t.defaultTarget),n=e.$defs||e.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:e,registry:(o=t==null?void 0:t.registry)!=null?o:Xo};return rs(e,i)}var S2={};$l(S2,{bigint:function(){return sZe},boolean:function(){return aZe},date:function(){return lZe},number:function(){return oZe},string:function(){return iZe}});function iZe(e){return W4(x2,e)}function oZe(e){return Y4(v2,e)}function aZe(e){return o3(_2,e)}function sZe(e){return s3(b2,e)}function lZe(e){return y3($3,e)}Ri(fE());var cn;(function(e){e.assertEqual=function(i){};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=function(i){var o={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;o[a]=a}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o},e.getValidEnumValues=function(i){var o=e.objectKeys(i).filter(function(s){return typeof i[i[s]]!="number"}),a={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;a[s]=i[s]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e.objectValues(a)},e.objectValues=function(i){return e.objectKeys(i).map(function(o){return i[o]})},e.objectKeys=typeof Object.keys=="function"?function(i){return Object.keys(i)}:function(i){var o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=function(i,o){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(o(a))return a}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}},e.isInteger=typeof Number.isInteger=="function"?function(i){return Number.isInteger(i)}:function(i){return typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i};function n(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" | ";return i.map(function(a){return typeof a=="string"?"'".concat(a,"'"):a}).join(o)}e.joinValues=n,e.jsonStringifyReplacer=function(i,o){return(typeof o==="undefined"?"undefined":_type_of(o))=="bigint"?o.toString():o}})(cn||(cn={}));var fle;(function(e){e.mergeShapes=function(t,r){return _object_spread({},t,r)}})(fle||(fle={}));var At=cn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),uf=function(e){switch(typeof e==="undefined"?"undefined":_type_of(e)){case"undefined":return At.undefined;case"string":return At.string;case"number":return Number.isNaN(e)?At.nan:At.number;case"boolean":return At.boolean;case"function":return At.function;case"bigint":return At.bigint;case"symbol":return At.symbol;case"object":return Array.isArray(e)?At.array:e===null?At.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?At.promise:typeof Map!="undefined"&&_instanceof(e,Map)?At.map:typeof Set!="undefined"&&_instanceof(e,Set)?At.set:typeof Date!="undefined"&&_instanceof(e,Date)?At.date:At.object;default:return At.unknown}};var Qe=cn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var bs=/*#__PURE__*/function _target(Error1){"use strict";_inherits(bs1,Error1);function bs1(t){_class_call_check(this,bs1);var _this;_this=_call_super(this,bs1),_this.issues=[],_this.addIssue=function(n){_this.issues=_to_consumable_array(_this.issues).concat([n])},_this.addIssues=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];_this.issues=_to_consumable_array(_this.issues).concat(_to_consumable_array(n))};var r=(_instanceof(this,bs1)?this.constructor:void 0).prototype;Object.setPrototypeOf?Object.setPrototypeOf(_this,r):_this.__proto__=r,_this.name="ZodError",_this.issues=t;return _this}_create_class(bs1,[{key:"errors",get:function get1(){return this.issues}},{key:"format",value:function format(t){var r=t||function(o){return o.message},n={_errors:[]},i=function(o){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{var s=n,l=0;for(;l<a.path.length;){var c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return i(this),n}},{key:"toString",value:function toString(){return this.message}},{key:"message",get:function get1(){return JSON.stringify(this.issues,cn.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function get1(){return this.issues.length===0}},{key:"flatten",value:function flatten(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(r){return r.message};var r=Object.create(null),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.issues[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.path.length>0){var o=i.path[0];r[o]=r[o]||[],r[o].push(t(i))}else n.push(t(i))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{formErrors:n,fieldErrors:r}}},{key:"formErrors",get:function get1(){return this.flatten()}}],[{key:"assert",value:function assert(t){if(!_instanceof(t,bs))throw new Error("Not a ZodError: ".concat(t))}}]);return bs1}(_wrap_native_super(Error));bs.create=function(e){return new bs(e)};var uZe=function(e,t){var r;switch(e.code){case Qe.invalid_type:e.received===At.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case Qe.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,cn.jsonStringifyReplacer));break;case Qe.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(cn.joinValues(e.keys,", "));break;case Qe.invalid_union:r="Invalid input";break;case Qe.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(cn.joinValues(e.options));break;case Qe.invalid_enum_value:r="Invalid enum value. Expected ".concat(cn.joinValues(e.options),", received '").concat(e.received,"'");break;case Qe.invalid_arguments:r="Invalid function arguments";break;case Qe.invalid_return_type:r="Invalid function return type";break;case Qe.invalid_date:r="Invalid date";break;case Qe.invalid_string:_type_of(e.validation)=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):cn.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case Qe.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="bigint"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case Qe.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case Qe.custom:r="Invalid input";break;case Qe.invalid_intersection_types:r="Intersection results could not be merged";break;case Qe.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case Qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,cn.assertNever(e)}return{message:r}},rh=uZe;var cZe=rh;function U3(){return cZe}var eT=function(e){var t=e.data,r=e.path,n=e.errorMaps,i=e.issueData,o=_to_consumable_array(r).concat(_to_consumable_array(i.path||[])),a=_object_spread_props(_object_spread({},i),{path:o});if(i.message!==void 0)return _object_spread_props(_object_spread({},i),{path:o,message:i.message});var s="",l=n.filter(function(c){return!!c}).slice().reverse();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=l[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;s=c(a,{data:t,defaultError:s}).message}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return _object_spread_props(_object_spread({},i),{path:o,message:s})};function _t(e,t){var r=U3(),n=eT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===rh?void 0:rh].filter(function(i){return!!i})});e.common.issues.push(n)}var va=/*#__PURE__*/function(){"use strict";function va1(){_class_call_check(this,va1);this.value="valid"}_create_class(va1,[{key:"dirty",value:function dirty(){this.value==="valid"&&(this.value="dirty")}},{key:"abort",value:function abort(){this.value!=="aborted"&&(this.value="aborted")}}],[{key:"mergeArray",value:function mergeArray(t,r){var n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.status==="aborted")return lr;i.status==="dirty"&&t.dirty(),n.push(i.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:t.value,value:n}}},{key:"mergeObjectAsync",value:function mergeObjectAsync(t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];i=_step.value;return[4,i.key];case 3:o=_state.sent();return[4,i.value];case 4:a=_state.sent();n.push({key:o,value:a});_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,va.mergeObjectSync(t,n)]}})})()}},{key:"mergeObjectSync",value:function mergeObjectSync(t,r){var n={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.key,a=i.value;if(o.status==="aborted"||a.status==="aborted")return lr;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value!="undefined"||i.alwaysSet)&&(n[o.value]=a.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:t.value,value:n}}}]);return va1}(),lr=Object.freeze({status:"aborted"}),k2=function(e){return{status:"dirty",value:e}},ws=function(e){return{status:"valid",value:e}},VF=function(e){return e.status==="aborted"},GF=function(e){return e.status==="dirty"},o0=function(e){return e.status==="valid"},B3=function(e){return typeof Promise!="undefined"&&_instanceof(e,Promise)};var Ft;(function(e){e.errToObj=function(t){return typeof t=="string"?{message:t}:t||{}},e.toString=function(t){return typeof t=="string"?t:t==null?void 0:t.message}})(Ft||(Ft={}));var Uu=/*#__PURE__*/function(){"use strict";function Uu1(t,r,n,i){_class_call_check(this,Uu1);this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}_create_class(Uu1,[{key:"path",get:function get1(){var _this__cachedPath,_this__cachedPath1;return this._cachedPath.length||(Array.isArray(this._key)?(_this__cachedPath=this._cachedPath).push.apply(_this__cachedPath,_to_consumable_array(this._path).concat(_to_consumable_array(this._key))):(_this__cachedPath1=this._cachedPath).push.apply(_this__cachedPath1,_to_consumable_array(this._path).concat([this._key]))),this._cachedPath}}]);return Uu1}(),mle=function(e,t){if(o0(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;var r=new bs(e.common.issues);return this._error=r,this._error}}};function $r(e){if(!e)return{};var t=e.errorMap,r=e.invalid_type_error,n=e.required_error,i=e.description;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:function(a,s){var c,d;var l=e.message;return a.code==="invalid_enum_value"?{message:l!=null?l:s.defaultError}:typeof s.data=="undefined"?{message:(c=l!=null?l:n)!=null?c:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(d=l!=null?l:r)!=null?d:s.defaultError}},description:i}}var Wr=/*#__PURE__*/function(){"use strict";function Wr1(t){var _this=this;_class_call_check(this,Wr1);this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:function(r){return _this["~validate"](r)}}}_create_class(Wr1,[{key:"description",get:function get1(){return this._def.description}},{key:"_getType",value:function _getType(t){return uf(t.data)}},{key:"_getOrReturnCtx",value:function _getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:uf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}},{key:"_processInputParams",value:function _processInputParams(t){return{status:new va,ctx:{common:t.parent.common,data:t.data,parsedType:uf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}},{key:"_parseSync",value:function _parseSync(t){var r=this._parse(t);if(B3(r))throw new Error("Synchronous parse encountered promise.");return r}},{key:"_parseAsync",value:function _parseAsync(t){var r=this._parse(t);return Promise.resolve(r)}},{key:"parse",value:function parse(t,r){var n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}},{key:"safeParse",value:function safeParse(t,r){var o;var n={common:{issues:[],async:(o=r==null?void 0:r.async)!=null?o:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uf(t)},i=this._parseSync({data:t,path:n.path,parent:n});return mle(n,i)}},{key:"~validate",value:function value(t){var n,i;var r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uf(t)};if(!this["~standard"].async)try{var _$o=this._parseSync({data:t,path:[],parent:r});return o0(_$o)?{value:_$o.value}:{issues:r.common.issues}}catch(o){(i=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(function(o){return o0(o)?{value:o.value}:{issues:r.common.issues}})}},{key:"parseAsync",value:function parseAsync(t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.safeParseAsync(t,r)];case 1:n=_state.sent();if(n.success)return[2,n.data];throw n.error}})}).call(this)}},{key:"safeParseAsync",value:function safeParseAsync(t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uf(t)},i=this._parse({data:t,path:n.path,parent:n});return[4,B3(i)?i:Promise.resolve(i)];case 1:o=_state.sent();return[2,mle(n,o)]}})}).call(this)}},{key:"refine",value:function refine(t,r){var n=function(i){return typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r};return this._refinement(function(i,o){var a=t(i),s=function(){return o.addIssue(_object_spread({code:Qe.custom},n(i)))};return typeof Promise!="undefined"&&_instanceof(a,Promise)?a.then(function(l){return l?!0:(s(),!1)}):a?!0:(s(),!1)})}},{key:"refinement",value:function refinement(t,r){return this._refinement(function(n,i){return t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1)})}},{key:"_refinement",value:function _refinement(t){return new Ic({schema:this,typeName:Ye.ZodEffects,effect:{type:"refinement",refinement:t}})}},{key:"superRefine",value:function superRefine(t){return this._refinement(t)}},{key:"optional",value:function optional(){return Tc.create(this,this._def)}},{key:"nullable",value:function nullable(){return pf.create(this,this._def)}},{key:"nullish",value:function nullish(){return this.nullable().optional()}},{key:"array",value:function array(){return ju.create(this)}},{key:"promise",value:function promise(){return l0.create(this,this._def)}},{key:"or",value:function or1(t){return A2.create([this,t],this._def)}},{key:"and",value:function and(t){return I2.create(this,t,this._def)}},{key:"transform",value:function transform(t){return new Ic(_object_spread_props(_object_spread({},$r(this._def)),{schema:this,typeName:Ye.ZodEffects,effect:{type:"transform",transform:t}}))}},{key:"default",value:function _default(t){var r=typeof t=="function"?t:function(){return t};return new $2(_object_spread_props(_object_spread({},$r(this._def)),{innerType:this,defaultValue:r,typeName:Ye.ZodDefault}))}},{key:"brand",value:function brand(){return new tT(_object_spread({typeName:Ye.ZodBranded,type:this},$r(this._def)))}},{key:"catch",value:function _catch(t){var r=typeof t=="function"?t:function(){return t};return new N2(_object_spread_props(_object_spread({},$r(this._def)),{innerType:this,catchValue:r,typeName:Ye.ZodCatch}))}},{key:"describe",value:function describe(t){var r=this.constructor;return new r(_object_spread_props(_object_spread({},this._def),{description:t}))}},{key:"pipe",value:function pipe(t){return D2.create(this,t)}},{key:"readonly",value:function readonly(){return L2.create(this)}},{key:"isOptional",value:function isOptional(){return this.safeParse(void 0).success}},{key:"isNullable",value:function isNullable(){return this.safeParse(null).success}}]);return Wr1}(),dZe=/^c[^\s-]{8,}$/i,pZe=/^[0-9a-z]+$/,fZe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mZe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hZe=/^[a-z0-9_-]{21}$/i,gZe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xZe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yZe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vZe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",HF,_Ze=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bZe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wZe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SZe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kZe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,CZe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hle="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",EZe=new RegExp("^".concat(hle,"$"));function gle(e){var t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));var r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}function TZe(e){return new RegExp("^".concat(gle(e),"$"))}function AZe(e){var t="".concat(hle,"T").concat(gle(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}function IZe(e,t){return!!((t==="v4"||!t)&&_Ze.test(e)||(t==="v6"||!t)&&wZe.test(e))}function PZe(e,t){if(!gZe.test(e))return!1;try{var _e_split=_sliced_to_array(e.split("."),1),r=_e_split[0];if(!r)return!1;var n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!((typeof i==="undefined"?"undefined":_type_of(i))!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(r){return!1}}function RZe(e,t){return!!((t==="v4"||!t)&&bZe.test(e)||(t==="v6"||!t)&&SZe.test(e))}var Ec=/*#__PURE__*/function(Wr1){"use strict";_inherits(Ec1,Wr1);function Ec1(){_class_call_check(this,Ec1);return _call_super(this,Ec1,arguments)}_create_class(Ec1,[{key:"_parse",value:function _parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==At.string){var o=this._getOrReturnCtx(t);return _t(o,{code:Qe.invalid_type,expected:At.string,received:o.parsedType}),lr}var n=new va,i;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o10=_step.value;if(o10.kind==="min")t.data.length<o10.value&&(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.too_small,minimum:o10.value,type:"string",inclusive:!0,exact:!1,message:o10.message}),n.dirty());else if(o10.kind==="max")t.data.length>o10.value&&(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.too_big,maximum:o10.value,type:"string",inclusive:!0,exact:!1,message:o10.message}),n.dirty());else if(o10.kind==="length"){var a=t.data.length>o10.value,s=t.data.length<o10.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?_t(i,{code:Qe.too_big,maximum:o10.value,type:"string",inclusive:!0,exact:!0,message:o10.message}):s&&_t(i,{code:Qe.too_small,minimum:o10.value,type:"string",inclusive:!0,exact:!0,message:o10.message}),n.dirty())}else if(o10.kind==="email")yZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"email",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="emoji")HF||(HF=new RegExp(vZe,"u")),HF.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"emoji",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="uuid")mZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"uuid",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="nanoid")hZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"nanoid",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="cuid")dZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"cuid",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="cuid2")pZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"cuid2",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="ulid")fZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"ulid",code:Qe.invalid_string,message:o10.message}),n.dirty());else if(o10.kind==="url")try{new URL(t.data)}catch(a){i=this._getOrReturnCtx(t,i),_t(i,{validation:"url",code:Qe.invalid_string,message:o10.message}),n.dirty()}else o10.kind==="regex"?(o10.regex.lastIndex=0,o10.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"regex",code:Qe.invalid_string,message:o10.message}),n.dirty())):o10.kind==="trim"?t.data=t.data.trim():o10.kind==="includes"?t.data.includes(o10.value,o10.position)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:{includes:o10.value,position:o10.position},message:o10.message}),n.dirty()):o10.kind==="toLowerCase"?t.data=t.data.toLowerCase():o10.kind==="toUpperCase"?t.data=t.data.toUpperCase():o10.kind==="startsWith"?t.data.startsWith(o10.value)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:{startsWith:o10.value},message:o10.message}),n.dirty()):o10.kind==="endsWith"?t.data.endsWith(o10.value)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:{endsWith:o10.value},message:o10.message}),n.dirty()):o10.kind==="datetime"?AZe(o10).test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:"datetime",message:o10.message}),n.dirty()):o10.kind==="date"?EZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:"date",message:o10.message}),n.dirty()):o10.kind==="time"?TZe(o10).test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.invalid_string,validation:"time",message:o10.message}),n.dirty()):o10.kind==="duration"?xZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"duration",code:Qe.invalid_string,message:o10.message}),n.dirty()):o10.kind==="ip"?IZe(t.data,o10.version)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"ip",code:Qe.invalid_string,message:o10.message}),n.dirty()):o10.kind==="jwt"?PZe(t.data,o10.alg)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"jwt",code:Qe.invalid_string,message:o10.message}),n.dirty()):o10.kind==="cidr"?RZe(t.data,o10.version)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"cidr",code:Qe.invalid_string,message:o10.message}),n.dirty()):o10.kind==="base64"?kZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"base64",code:Qe.invalid_string,message:o10.message}),n.dirty()):o10.kind==="base64url"?CZe.test(t.data)||(i=this._getOrReturnCtx(t,i),_t(i,{validation:"base64url",code:Qe.invalid_string,message:o10.message}),n.dirty()):cn.assertNever(o10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:n.value,value:t.data}}},{key:"_regex",value:function _regex(t,r,n){return this.refinement(function(i){return t.test(i)},_object_spread({validation:r,code:Qe.invalid_string},Ft.errToObj(n)))}},{key:"_addCheck",value:function _addCheck(t){return new Ec(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([t])}))}},{key:"email",value:function email(t){return this._addCheck(_object_spread({kind:"email"},Ft.errToObj(t)))}},{key:"url",value:function url(t){return this._addCheck(_object_spread({kind:"url"},Ft.errToObj(t)))}},{key:"emoji",value:function emoji(t){return this._addCheck(_object_spread({kind:"emoji"},Ft.errToObj(t)))}},{key:"uuid",value:function uuid(t){return this._addCheck(_object_spread({kind:"uuid"},Ft.errToObj(t)))}},{key:"nanoid",value:function nanoid(t){return this._addCheck(_object_spread({kind:"nanoid"},Ft.errToObj(t)))}},{key:"cuid",value:function cuid(t){return this._addCheck(_object_spread({kind:"cuid"},Ft.errToObj(t)))}},{key:"cuid2",value:function cuid2(t){return this._addCheck(_object_spread({kind:"cuid2"},Ft.errToObj(t)))}},{key:"ulid",value:function ulid(t){return this._addCheck(_object_spread({kind:"ulid"},Ft.errToObj(t)))}},{key:"base64",value:function base64(t){return this._addCheck(_object_spread({kind:"base64"},Ft.errToObj(t)))}},{key:"base64url",value:function base64url(t){return this._addCheck(_object_spread({kind:"base64url"},Ft.errToObj(t)))}},{key:"jwt",value:function jwt(t){return this._addCheck(_object_spread({kind:"jwt"},Ft.errToObj(t)))}},{key:"ip",value:function ip(t){return this._addCheck(_object_spread({kind:"ip"},Ft.errToObj(t)))}},{key:"cidr",value:function cidr(t){return this._addCheck(_object_spread({kind:"cidr"},Ft.errToObj(t)))}},{key:"datetime",value:function datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(_object_spread({kind:"datetime",precision:typeof(t==null?void 0:t.precision)=="undefined"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},Ft.errToObj(t==null?void 0:t.message)))}},{key:"date",value:function date(t){return this._addCheck({kind:"date",message:t})}},{key:"time",value:function time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(_object_spread({kind:"time",precision:typeof(t==null?void 0:t.precision)=="undefined"?null:t==null?void 0:t.precision},Ft.errToObj(t==null?void 0:t.message)))}},{key:"duration",value:function duration(t){return this._addCheck(_object_spread({kind:"duration"},Ft.errToObj(t)))}},{key:"regex",value:function regex(t,r){return this._addCheck(_object_spread({kind:"regex",regex:t},Ft.errToObj(r)))}},{key:"includes",value:function includes(t,r){return this._addCheck(_object_spread({kind:"includes",value:t,position:r==null?void 0:r.position},Ft.errToObj(r==null?void 0:r.message)))}},{key:"startsWith",value:function startsWith(t,r){return this._addCheck(_object_spread({kind:"startsWith",value:t},Ft.errToObj(r)))}},{key:"endsWith",value:function endsWith(t,r){return this._addCheck(_object_spread({kind:"endsWith",value:t},Ft.errToObj(r)))}},{key:"min",value:function min(t,r){return this._addCheck(_object_spread({kind:"min",value:t},Ft.errToObj(r)))}},{key:"max",value:function max(t,r){return this._addCheck(_object_spread({kind:"max",value:t},Ft.errToObj(r)))}},{key:"length",value:function length(t,r){return this._addCheck(_object_spread({kind:"length",value:t},Ft.errToObj(r)))}},{key:"nonempty",value:function nonempty(t){return this.min(1,Ft.errToObj(t))}},{key:"trim",value:function trim(){return new Ec(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([{kind:"trim"}])}))}},{key:"toLowerCase",value:function toLowerCase(){return new Ec(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([{kind:"toLowerCase"}])}))}},{key:"toUpperCase",value:function toUpperCase(){return new Ec(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([{kind:"toUpperCase"}])}))}},{key:"isDatetime",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="datetime"})}},{key:"isDate",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="date"})}},{key:"isTime",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="time"})}},{key:"isDuration",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="duration"})}},{key:"isEmail",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="email"})}},{key:"isURL",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="url"})}},{key:"isEmoji",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="emoji"})}},{key:"isUUID",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="uuid"})}},{key:"isNANOID",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="nanoid"})}},{key:"isCUID",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="cuid"})}},{key:"isCUID2",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="cuid2"})}},{key:"isULID",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="ulid"})}},{key:"isIP",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="ip"})}},{key:"isCIDR",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="cidr"})}},{key:"isBase64",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="base64"})}},{key:"isBase64url",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="base64url"})}},{key:"minLength",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="min"&&(t===null||r.value>t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"maxLength",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}}]);return Ec1}(Wr);Ec.create=function(e){var t;return new Ec(_object_spread({checks:[],typeName:Ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},$r(e)))};function MZe(e,t){var r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}var ih=/*#__PURE__*/function(Wr1){"use strict";_inherits(ih1,Wr1);function ih1(){_class_call_check(this,ih1);var _this;_this=_call_super(this,ih1,arguments),_this.min=_this.gte,_this.max=_this.lte,_this.step=_this.multipleOf;return _this}_create_class(ih1,[{key:"_parse",value:function _parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==At.number){var o=this._getOrReturnCtx(t);return _t(o,{code:Qe.invalid_type,expected:At.number,received:o.parsedType}),lr}var n,i=new va;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o10=_step.value;o10.kind==="int"?cn.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.invalid_type,expected:"integer",received:"float",message:o10.message}),i.dirty()):o10.kind==="min"?(o10.inclusive?t.data<o10.value:t.data<=o10.value)&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.too_small,minimum:o10.value,type:"number",inclusive:o10.inclusive,exact:!1,message:o10.message}),i.dirty()):o10.kind==="max"?(o10.inclusive?t.data>o10.value:t.data>=o10.value)&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.too_big,maximum:o10.value,type:"number",inclusive:o10.inclusive,exact:!1,message:o10.message}),i.dirty()):o10.kind==="multipleOf"?MZe(t.data,o10.value)!==0&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.not_multiple_of,multipleOf:o10.value,message:o10.message}),i.dirty()):o10.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.not_finite,message:o10.message}),i.dirty()):cn.assertNever(o10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:i.value,value:t.data}}},{key:"gte",value:function gte1(t,r){return this.setLimit("min",t,!0,Ft.toString(r))}},{key:"gt",value:function gt(t,r){return this.setLimit("min",t,!1,Ft.toString(r))}},{key:"lte",value:function lte1(t,r){return this.setLimit("max",t,!0,Ft.toString(r))}},{key:"lt",value:function lt1(t,r){return this.setLimit("max",t,!1,Ft.toString(r))}},{key:"setLimit",value:function setLimit(t,r,n,i){return new ih(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([{kind:t,value:r,inclusive:n,message:Ft.toString(i)}])}))}},{key:"_addCheck",value:function _addCheck(t){return new ih(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([t])}))}},{key:"int",value:function int1(t){return this._addCheck({kind:"int",message:Ft.toString(t)})}},{key:"positive",value:function positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ft.toString(t)})}},{key:"negative",value:function negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ft.toString(t)})}},{key:"nonpositive",value:function nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ft.toString(t)})}},{key:"nonnegative",value:function nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ft.toString(t)})}},{key:"multipleOf",value:function multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(r)})}},{key:"finite",value:function finite(t){return this._addCheck({kind:"finite",message:Ft.toString(t)})}},{key:"safe",value:function safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ft.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ft.toString(t)})}},{key:"minValue",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="min"&&(t===null||r.value>t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"maxValue",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"isInt",get:function get1(){return!!this._def.checks.find(function(t){return t.kind==="int"||t.kind==="multipleOf"&&cn.isInteger(t.value)})}},{key:"isFinite",get:function get1(){var t=null,r=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Number.isFinite(r)&&Number.isFinite(t)}}]);return ih1}(Wr);ih.create=function(e){return new ih(_object_spread({checks:[],typeName:Ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},$r(e)))};var oh=/*#__PURE__*/function(Wr1){"use strict";_inherits(oh1,Wr1);function oh1(){_class_call_check(this,oh1);var _this;_this=_call_super(this,oh1,arguments),_this.min=_this.gte,_this.max=_this.lte;return _this}_create_class(oh1,[{key:"_parse",value:function _parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(o){return this._getInvalidInput(t)}if(this._getType(t)!==At.bigint)return this._getInvalidInput(t);var n,i=new va;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),_t(n,{code:Qe.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):cn.assertNever(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:i.value,value:t.data}}},{key:"_getInvalidInput",value:function _getInvalidInput(t){var r=this._getOrReturnCtx(t);return _t(r,{code:Qe.invalid_type,expected:At.bigint,received:r.parsedType}),lr}},{key:"gte",value:function gte1(t,r){return this.setLimit("min",t,!0,Ft.toString(r))}},{key:"gt",value:function gt(t,r){return this.setLimit("min",t,!1,Ft.toString(r))}},{key:"lte",value:function lte1(t,r){return this.setLimit("max",t,!0,Ft.toString(r))}},{key:"lt",value:function lt1(t,r){return this.setLimit("max",t,!1,Ft.toString(r))}},{key:"setLimit",value:function setLimit(t,r,n,i){return new oh(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([{kind:t,value:r,inclusive:n,message:Ft.toString(i)}])}))}},{key:"_addCheck",value:function _addCheck(t){return new oh(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([t])}))}},{key:"positive",value:function positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}},{key:"negative",value:function negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}},{key:"nonpositive",value:function nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}},{key:"nonnegative",value:function nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}},{key:"multipleOf",value:function multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(r)})}},{key:"minValue",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="min"&&(t===null||r.value>t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"maxValue",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}}]);return oh1}(Wr);oh.create=function(e){var t;return new oh(_object_spread({checks:[],typeName:Ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},$r(e)))};var q3=/*#__PURE__*/function(Wr1){"use strict";_inherits(q31,Wr1);function q31(){_class_call_check(this,q31);return _call_super(this,q31,arguments)}_create_class(q31,[{key:"_parse",value:function _parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==At.boolean){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.boolean,received:n.parsedType}),lr}return ws(t.data)}}]);return q31}(Wr);q3.create=function(e){return new q3(_object_spread({typeName:Ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},$r(e)))};var s0=/*#__PURE__*/function(Wr1){"use strict";_inherits(s01,Wr1);function s01(){_class_call_check(this,s01);return _call_super(this,s01,arguments)}_create_class(s01,[{key:"_parse",value:function _parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==At.date){var o=this._getOrReturnCtx(t);return _t(o,{code:Qe.invalid_type,expected:At.date,received:o.parsedType}),lr}if(Number.isNaN(t.data.getTime())){var o10=this._getOrReturnCtx(t);return _t(o10,{code:Qe.invalid_date}),lr}var n=new va,i;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o11=_step.value;o11.kind==="min"?t.data.getTime()<o11.value&&(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.too_small,message:o11.message,inclusive:!0,exact:!1,minimum:o11.value,type:"date"}),n.dirty()):o11.kind==="max"?t.data.getTime()>o11.value&&(i=this._getOrReturnCtx(t,i),_t(i,{code:Qe.too_big,message:o11.message,inclusive:!0,exact:!1,maximum:o11.value,type:"date"}),n.dirty()):cn.assertNever(o11)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:n.value,value:new Date(t.data.getTime())}}},{key:"_addCheck",value:function _addCheck(t){return new s0(_object_spread_props(_object_spread({},this._def),{checks:_to_consumable_array(this._def.checks).concat([t])}))}},{key:"min",value:function min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ft.toString(r)})}},{key:"max",value:function max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ft.toString(r)})}},{key:"minDate",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="min"&&(t===null||r.value>t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t!=null?new Date(t):null}},{key:"maxDate",get:function get1(){var t=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t!=null?new Date(t):null}}]);return s01}(Wr);s0.create=function(e){return new s0(_object_spread({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ye.ZodDate},$r(e)))};var W3=/*#__PURE__*/function(Wr1){"use strict";_inherits(W31,Wr1);function W31(){_class_call_check(this,W31);return _call_super(this,W31,arguments)}_create_class(W31,[{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.symbol){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.symbol,received:n.parsedType}),lr}return ws(t.data)}}]);return W31}(Wr);W3.create=function(e){return new W3(_object_spread({typeName:Ye.ZodSymbol},$r(e)))};var E2=/*#__PURE__*/function(Wr1){"use strict";_inherits(E21,Wr1);function E21(){_class_call_check(this,E21);return _call_super(this,E21,arguments)}_create_class(E21,[{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.undefined){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.undefined,received:n.parsedType}),lr}return ws(t.data)}}]);return E21}(Wr);E2.create=function(e){return new E2(_object_spread({typeName:Ye.ZodUndefined},$r(e)))};var T2=/*#__PURE__*/function(Wr1){"use strict";_inherits(T21,Wr1);function T21(){_class_call_check(this,T21);return _call_super(this,T21,arguments)}_create_class(T21,[{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.null){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.null,received:n.parsedType}),lr}return ws(t.data)}}]);return T21}(Wr);T2.create=function(e){return new T2(_object_spread({typeName:Ye.ZodNull},$r(e)))};var V3=/*#__PURE__*/function(Wr1){"use strict";_inherits(V31,Wr1);function V31(){_class_call_check(this,V31);var _this;_this=_call_super(this,V31,arguments),_this._any=!0;return _this}_create_class(V31,[{key:"_parse",value:function _parse(t){return ws(t.data)}}]);return V31}(Wr);V3.create=function(e){return new V3(_object_spread({typeName:Ye.ZodAny},$r(e)))};var nh=/*#__PURE__*/function(Wr1){"use strict";_inherits(nh1,Wr1);function nh1(){_class_call_check(this,nh1);var _this;_this=_call_super(this,nh1,arguments),_this._unknown=!0;return _this}_create_class(nh1,[{key:"_parse",value:function _parse(t){return ws(t.data)}}]);return nh1}(Wr);nh.create=function(e){return new nh(_object_spread({typeName:Ye.ZodUnknown},$r(e)))};var Vd=/*#__PURE__*/function(Wr1){"use strict";_inherits(Vd1,Wr1);function Vd1(){_class_call_check(this,Vd1);return _call_super(this,Vd1,arguments)}_create_class(Vd1,[{key:"_parse",value:function _parse(t){var r=this._getOrReturnCtx(t);return _t(r,{code:Qe.invalid_type,expected:At.never,received:r.parsedType}),lr}}]);return Vd1}(Wr);Vd.create=function(e){return new Vd(_object_spread({typeName:Ye.ZodNever},$r(e)))};var G3=/*#__PURE__*/function(Wr1){"use strict";_inherits(G31,Wr1);function G31(){_class_call_check(this,G31);return _call_super(this,G31,arguments)}_create_class(G31,[{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.undefined){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.void,received:n.parsedType}),lr}return ws(t.data)}}]);return G31}(Wr);G3.create=function(e){return new G3(_object_spread({typeName:Ye.ZodVoid},$r(e)))};var ju=/*#__PURE__*/function(Wr1){"use strict";_inherits(ju1,Wr1);function ju1(){_class_call_check(this,ju1);return _call_super(this,ju1,arguments)}_create_class(ju1,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx,n=_this__processInputParams.status,i=this._def;if(r.parsedType!==At.array)return _t(r,{code:Qe.invalid_type,expected:At.array,received:r.parsedType}),lr;if(i.exactLength!==null){var a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(_t(r,{code:a?Qe.too_big:Qe.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(_t(r,{code:Qe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(_t(r,{code:Qe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all(_to_consumable_array(r.data).map(function(a,s){return i.type._parseAsync(new Uu(r,a,r.path,s))})).then(function(a){return va.mergeArray(n,a)});var o=_to_consumable_array(r.data).map(function(a,s){return i.type._parseSync(new Uu(r,a,r.path,s))});return va.mergeArray(n,o)}},{key:"element",get:function get1(){return this._def.type}},{key:"min",value:function min(t,r){return new ju(_object_spread_props(_object_spread({},this._def),{minLength:{value:t,message:Ft.toString(r)}}))}},{key:"max",value:function max(t,r){return new ju(_object_spread_props(_object_spread({},this._def),{maxLength:{value:t,message:Ft.toString(r)}}))}},{key:"length",value:function length(t,r){return new ju(_object_spread_props(_object_spread({},this._def),{exactLength:{value:t,message:Ft.toString(r)}}))}},{key:"nonempty",value:function nonempty(t){return this.min(1,t)}}]);return ju1}(Wr);ju.create=function(e,t){return new ju(_object_spread({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ye.ZodArray},$r(t)))};function C2(e){if(_instanceof(e,Mi)){var t={};for(var r in e.shape){var n=e.shape[r];t[r]=Tc.create(C2(n))}return new Mi(_object_spread_props(_object_spread({},e._def),{shape:function(){return t}}))}else return _instanceof(e,ju)?new ju(_object_spread_props(_object_spread({},e._def),{type:C2(e.element)})):_instanceof(e,Tc)?Tc.create(C2(e.unwrap())):_instanceof(e,pf)?pf.create(C2(e.unwrap())):_instanceof(e,Ac)?Ac.create(e.items.map(function(t){return C2(t)})):e}var Mi=/*#__PURE__*/function(Wr1){"use strict";_inherits(Mi1,Wr1);function Mi1(){_class_call_check(this,Mi1);var _this;_this=_call_super(this,Mi1,arguments),_this._cached=null,_this.nonstrict=_this.passthrough,_this.augment=_this.extend;return _this}_create_class(Mi1,[{key:"_getCached",value:function _getCached(){if(this._cached!==null)return this._cached;var t=this._def.shape(),r=cn.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}},{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.object){var c=this._getOrReturnCtx(t);return _t(c,{code:Qe.invalid_type,expected:At.object,received:c.parsedType}),lr}var _this__processInputParams=this._processInputParams(t),n=_this__processInputParams.status,i=_this__processInputParams.ctx,_this__getCached=this._getCached(),o=_this__getCached.shape,a=_this__getCached.keys,s=[];if(!(_instanceof(this._def.catchall,Vd)&&this._def.unknownKeys==="strip"))for(var c10 in i.data)a.includes(c10)||s.push(c10);var l=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c11=_step.value;var d=o[c11],u=i.data[c11];l.push({key:{status:"valid",value:c11},value:d._parse(new Uu(i,u,i.path,c11)),alwaysSet:c11 in i.data})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(_instanceof(this._def.catchall,Vd)){var c12=this._def.unknownKeys;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(c12==="passthrough")try{for(var _iterator1=s[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d10=_step1.value;l.push({key:{status:"valid",value:d10},value:{status:"valid",value:i.data[d10]}})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}else if(c12==="strict")s.length>0&&(_t(i,{code:Qe.unrecognized_keys,keys:s}),n.dirty());else if(c12!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{var c13=this._def.catchall;var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=s[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var d11=_step2.value;var u10=i.data[d11];l.push({key:{status:"valid",value:d11},value:c13._parse(new Uu(i,u10,i.path,d11)),alwaysSet:d11 in i.data})}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}return i.common.async?Promise.resolve().then(function(){return _async_to_generator(function(){var c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=l[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];d=_step.value;return[4,d.key];case 3:u=_state.sent();return[4,d.value];case 4:p=_state.sent();c.push({key:u,value:p,alwaysSet:d.alwaysSet});_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,c]}})})()}).then(function(c){return va.mergeObjectSync(n,c)}):va.mergeObjectSync(n,l)}},{key:"shape",get:function get1(){return this._def.shape()}},{key:"strict",value:function strict(t){var _this=this;return Ft.errToObj,new Mi(_object_spread(_object_spread_props(_object_spread({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:function(r,n){var o,a,s,l;var i=(s=(a=(o=_this._def).errorMap)==null?void 0:a.call(o,r,n).message)!=null?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Ft.errToObj(t).message)!=null?l:i}:{message:i}}}:{}))}},{key:"strip",value:function strip(){return new Mi(_object_spread_props(_object_spread({},this._def),{unknownKeys:"strip"}))}},{key:"passthrough",value:function passthrough(){return new Mi(_object_spread_props(_object_spread({},this._def),{unknownKeys:"passthrough"}))}},{key:"extend",value:function extend(t){var _this=this;return new Mi(_object_spread_props(_object_spread({},this._def),{shape:function(){return _object_spread({},_this._def.shape(),t)}}))}},{key:"merge",value:function merge(t){var _this=this;return new Mi({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return _object_spread({},_this._def.shape(),t._def.shape())},typeName:Ye.ZodObject})}},{key:"setKey",value:function setKey(t,r){return this.augment(_define_property({},t,r))}},{key:"catchall",value:function catchall(t){return new Mi(_object_spread_props(_object_spread({},this._def),{catchall:t}))}},{key:"pick",value:function pick(t){var r={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cn.objectKeys(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;t[n]&&this.shape[n]&&(r[n]=this.shape[n])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new Mi(_object_spread_props(_object_spread({},this._def),{shape:function(){return r}}))}},{key:"omit",value:function omit(t){var r={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cn.objectKeys(this.shape)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;t[n]||(r[n]=this.shape[n])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new Mi(_object_spread_props(_object_spread({},this._def),{shape:function(){return r}}))}},{key:"deepPartial",value:function deepPartial(){return C2(this)}},{key:"partial",value:function partial(t){var r={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cn.objectKeys(this.shape)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new Mi(_object_spread_props(_object_spread({},this._def),{shape:function(){return r}}))}},{key:"required",value:function required(t){var r={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cn.objectKeys(this.shape)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(t&&!t[n])r[n]=this.shape[n];else{var o=this.shape[n];for(;_instanceof(o,Tc);)o=o._def.innerType;r[n]=o}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new Mi(_object_spread_props(_object_spread({},this._def),{shape:function(){return r}}))}},{key:"keyof",value:function keyof(){return xle(cn.objectKeys(this.shape))}}]);return Mi1}(Wr);Mi.create=function(e,t){return new Mi(_object_spread({shape:function(){return e},unknownKeys:"strip",catchall:Vd.create(),typeName:Ye.ZodObject},$r(t)))};Mi.strictCreate=function(e,t){return new Mi(_object_spread({shape:function(){return e},unknownKeys:"strict",catchall:Vd.create(),typeName:Ye.ZodObject},$r(t)))};Mi.lazycreate=function(e,t){return new Mi(_object_spread({shape:e,unknownKeys:"strip",catchall:Vd.create(),typeName:Ye.ZodObject},$r(t)))};var A2=/*#__PURE__*/function(Wr1){"use strict";_inherits(A21,Wr1);function A21(){_class_call_check(this,A21);return _call_super(this,A21,arguments)}_create_class(A21,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx,n=this._def.options;function i(o){var _r_common_issues;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(s.result.status==="valid")return s.result}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s10=_step1.value;if(s10.result.status==="dirty")return(_r_common_issues=r.common.issues).push.apply(_r_common_issues,_to_consumable_array(s10.ctx.common.issues)),s10.result}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var a=o.map(function(s){return new bs(s.ctx.common.issues)});return _t(r,{code:Qe.invalid_union,unionErrors:a}),lr}if(r.common.async)return Promise.all(n.map(function(o){return _async_to_generator(function(){var a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=_object_spread_props(_object_spread({},r),{common:_object_spread_props(_object_spread({},r.common),{issues:[]}),parent:null});_tmp={};return[4,o._parseAsync({data:r.data,path:r.path,parent:a})];case 1:return[2,(_tmp.result=_state.sent(),_tmp.ctx=a,_tmp)]}})})()})).then(i);{var _r_common_issues;var o,a=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=_object_spread_props(_object_spread({},r),{common:_object_spread_props(_object_spread({},r.common),{issues:[]}),parent:null}),d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(o)return(_r_common_issues=r.common.issues).push.apply(_r_common_issues,_to_consumable_array(o.ctx.common.issues)),o.result;var s=a.map(function(l){return new bs(l)});return _t(r,{code:Qe.invalid_union,unionErrors:s}),lr}}},{key:"options",get:function get1(){return this._def.options}}]);return A21}(Wr);A2.create=function(e,t){return new A2(_object_spread({options:e,typeName:Ye.ZodUnion},$r(t)))};var cf=function(e){return _instanceof(e,R2)?cf(e.schema):_instanceof(e,Ic)?cf(e.innerType()):_instanceof(e,M2)?[e.value]:_instanceof(e,df)?e.options:_instanceof(e,O2)?cn.objectValues(e.enum):_instanceof(e,$2)?cf(e._def.innerType):_instanceof(e,E2)?[void 0]:_instanceof(e,T2)?[null]:_instanceof(e,Tc)?[void 0].concat(_to_consumable_array(cf(e.unwrap()))):_instanceof(e,pf)?[null].concat(_to_consumable_array(cf(e.unwrap()))):_instanceof(e,tT)||_instanceof(e,L2)?cf(e.unwrap()):_instanceof(e,N2)?cf(e._def.innerType):[]},H3=/*#__PURE__*/function(Wr1){"use strict";_inherits(H31,Wr1);function H31(){_class_call_check(this,H31);return _call_super(this,H31,arguments)}_create_class(H31,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx;if(r.parsedType!==At.object)return _t(r,{code:Qe.invalid_type,expected:At.object,received:r.parsedType}),lr;var n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(_t(r,{code:Qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),lr)}},{key:"discriminator",get:function get1(){return this._def.discriminator}},{key:"options",get:function get1(){return this._def.options}},{key:"optionsMap",get:function get1(){return this._def.optionsMap}}],[{key:"create",value:function create(t,r,n){var i=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=cf(o.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s=_step1.value;if(i.has(s))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(s)));i.set(s,o)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return new H3(_object_spread({typeName:Ye.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},$r(n)))}}]);return H31}(Wr);function ZF(e,t){var r=uf(e),n=uf(t);if(e===t)return{valid:!0,data:e};if(r===At.object&&n===At.object){var i=cn.objectKeys(t),o=cn.objectKeys(e).filter(function(s){return i.indexOf(s)!==-1}),a=_object_spread({},e,t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;var l=ZF(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{valid:!0,data:a}}else if(r===At.array&&n===At.array){if(e.length!==t.length)return{valid:!1};var i10=[];for(var o10=0;o10<e.length;o10++){var a9=e[o10],s10=t[o10],l10=ZF(a9,s10);if(!l10.valid)return{valid:!1};i10.push(l10.data)}return{valid:!0,data:i10}}else return r===At.date&&n===At.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var I2=/*#__PURE__*/function(Wr1){"use strict";_inherits(I21,Wr1);function I21(){_class_call_check(this,I21);return _call_super(this,I21,arguments)}_create_class(I21,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx,i=function(o,a){if(VF(o)||VF(a))return lr;var s=ZF(o.value,a.value);return s.valid?((GF(o)||GF(a))&&r.dirty(),{status:r.value,value:s.data}):(_t(n,{code:Qe.invalid_intersection_types}),lr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(function(param){var _param=_sliced_to_array(param,2),o=_param[0],a=_param[1];return i(o,a)}):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}]);return I21}(Wr);I2.create=function(e,t,r){return new I2(_object_spread({left:e,right:t,typeName:Ye.ZodIntersection},$r(r)))};var Ac=/*#__PURE__*/function(Wr1){"use strict";_inherits(Ac1,Wr1);function Ac1(){_class_call_check(this,Ac1);return _call_super(this,Ac1,arguments)}_create_class(Ac1,[{key:"_parse",value:function _parse(t){var _this=this;var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx;if(n.parsedType!==At.array)return _t(n,{code:Qe.invalid_type,expected:At.array,received:n.parsedType}),lr;if(n.data.length<this._def.items.length)return _t(n,{code:Qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lr;!this._def.rest&&n.data.length>this._def.items.length&&(_t(n,{code:Qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());var o=_to_consumable_array(n.data).map(function(a,s){var l=_this._def.items[s]||_this._def.rest;return l?l._parse(new Uu(n,a,n.path,s)):null}).filter(function(a){return!!a});return n.common.async?Promise.all(o).then(function(a){return va.mergeArray(r,a)}):va.mergeArray(r,o)}},{key:"items",get:function get1(){return this._def.items}},{key:"rest",value:function rest(t){return new Ac(_object_spread_props(_object_spread({},this._def),{rest:t}))}}]);return Ac1}(Wr);Ac.create=function(e,t){if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ac(_object_spread({items:e,typeName:Ye.ZodTuple,rest:null},$r(t)))};var P2=/*#__PURE__*/function(Wr1){"use strict";_inherits(P21,Wr1);function P21(){_class_call_check(this,P21);return _call_super(this,P21,arguments)}_create_class(P21,[{key:"keySchema",get:function get1(){return this._def.keyType}},{key:"valueSchema",get:function get1(){return this._def.valueType}},{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx;if(n.parsedType!==At.object)return _t(n,{code:Qe.invalid_type,expected:At.object,received:n.parsedType}),lr;var i=[],o=this._def.keyType,a=this._def.valueType;for(var s in n.data)i.push({key:o._parse(new Uu(n,s,n.path,s)),value:a._parse(new Uu(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?va.mergeObjectAsync(r,i):va.mergeObjectSync(r,i)}},{key:"element",get:function get1(){return this._def.valueType}}],[{key:"create",value:function create(t,r,n){return _instanceof(r,Wr)?new P2(_object_spread({keyType:t,valueType:r,typeName:Ye.ZodRecord},$r(n))):new P2(_object_spread({keyType:Ec.create(),valueType:t,typeName:Ye.ZodRecord},$r(r)))}}]);return P21}(Wr),Z3=/*#__PURE__*/function(Wr1){"use strict";_inherits(Z31,Wr1);function Z31(){_class_call_check(this,Z31);return _call_super(this,Z31,arguments)}_create_class(Z31,[{key:"keySchema",get:function get1(){return this._def.keyType}},{key:"valueSchema",get:function get1(){return this._def.valueType}},{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx;if(n.parsedType!==At.map)return _t(n,{code:Qe.invalid_type,expected:At.map,received:n.parsedType}),lr;var i=this._def.keyType,o=this._def.valueType,a=_to_consumable_array(n.data.entries()).map(function(param,c){var _param=_sliced_to_array(param,2),s=_param[0],l=_param[1];return{key:i._parse(new Uu(n,s,n.path,[c,"key"])),value:o._parse(new Uu(n,l,n.path,[c,"value"]))}});if(n.common.async){var s=new Map;return Promise.resolve().then(function(){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,d,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=a[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];l=_step.value;return[4,l.key];case 3:c=_state.sent();return[4,l.value];case 4:d=_state.sent();if(c.status==="aborted"||d.status==="aborted")return[2,lr];(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(c.value,d.value);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,{status:r.value,value:s}]}})})()})}else{var s10=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return lr;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s10.set(c.value,d.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:r.value,value:s10}}}}]);return Z31}(Wr);Z3.create=function(e,t,r){return new Z3(_object_spread({valueType:t,keyType:e,typeName:Ye.ZodMap},$r(r)))};var ah=/*#__PURE__*/function(Wr1){"use strict";_inherits(ah1,Wr1);function ah1(){_class_call_check(this,ah1);return _call_super(this,ah1,arguments)}_create_class(ah1,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx;if(n.parsedType!==At.set)return _t(n,{code:Qe.invalid_type,expected:At.set,received:n.parsedType}),lr;var i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(_t(n,{code:Qe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(_t(n,{code:Qe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());var o=this._def.valueType;function a(l){var c=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=l[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;if(d.status==="aborted")return lr;d.status==="dirty"&&r.dirty(),c.add(d.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{status:r.value,value:c}}var s=_to_consumable_array(n.data.values()).map(function(l,c){return o._parse(new Uu(n,l,n.path,c))});return n.common.async?Promise.all(s).then(function(l){return a(l)}):a(s)}},{key:"min",value:function min(t,r){return new ah(_object_spread_props(_object_spread({},this._def),{minSize:{value:t,message:Ft.toString(r)}}))}},{key:"max",value:function max(t,r){return new ah(_object_spread_props(_object_spread({},this._def),{maxSize:{value:t,message:Ft.toString(r)}}))}},{key:"size",value:function size(t,r){return this.min(t,r).max(t,r)}},{key:"nonempty",value:function nonempty(t){return this.min(1,t)}}]);return ah1}(Wr);ah.create=function(e,t){return new ah(_object_spread({valueType:e,minSize:null,maxSize:null,typeName:Ye.ZodSet},$r(t)))};var a0=/*#__PURE__*/function(Wr1){"use strict";_inherits(a01,Wr1);function a01(){_class_call_check(this,a01);var _this;_this=_call_super(this,a01,arguments),_this.validate=_this.implement;return _this}_create_class(a01,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx;if(r.parsedType!==At.function)return _t(r,{code:Qe.invalid_type,expected:At.function,received:r.parsedType}),lr;function n(s,l){return eT({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,U3(),rh].filter(function(c){return!!c}),issueData:{code:Qe.invalid_arguments,argumentsError:l}})}function i(s,l){return eT({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,U3(),rh].filter(function(c){return!!c}),issueData:{code:Qe.invalid_return_type,returnTypeError:l}})}var o={errorMap:r.common.contextualErrorMap},a=r.data;if(_instanceof(this._def.returns,l0)){var s=this;return ws(function(){for(var _len=arguments.length,l=new Array(_len),_key=0;_key<_len;_key++){l[_key]=arguments[_key]}return _async_to_generator(function(){var c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=new bs([]);return[4,s._def.args.parseAsync(l,o).catch(function(m){throw c.addIssue(n(l,m)),c})];case 1:d=_state.sent();return[4,Reflect.apply(a,this,d)];case 2:u=_state.sent();return[4,s._def.returns._def.type.parseAsync(u,o).catch(function(m){throw c.addIssue(i(u,m)),c})];case 3:return[2,_state.sent()]}})}).call(this)})}else{var s10=this;return ws(function(){for(var _len=arguments.length,l=new Array(_len),_key=0;_key<_len;_key++){l[_key]=arguments[_key]}var c=s10._def.args.safeParse(l,o);if(!c.success)throw new bs([n(l,c.error)]);var d=Reflect.apply(a,this,c.data),u=s10._def.returns.safeParse(d,o);if(!u.success)throw new bs([i(d,u.error)]);return u.data})}}},{key:"parameters",value:function parameters(){return this._def.args}},{key:"returnType",value:function returnType(){return this._def.returns}},{key:"args",value:function args(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}return new a0(_object_spread_props(_object_spread({},this._def),{args:Ac.create(t).rest(nh.create())}))}},{key:"returns",value:function returns(t){return new a0(_object_spread_props(_object_spread({},this._def),{returns:t}))}},{key:"implement",value:function implement(t){return this.parse(t)}},{key:"strictImplement",value:function strictImplement(t){return this.parse(t)}}],[{key:"create",value:function create(t,r,n){return new a0(_object_spread({args:t||Ac.create([]).rest(nh.create()),returns:r||nh.create(),typeName:Ye.ZodFunction},$r(n)))}}]);return a01}(Wr),R2=/*#__PURE__*/function(Wr1){"use strict";_inherits(R21,Wr1);function R21(){_class_call_check(this,R21);return _call_super(this,R21,arguments)}_create_class(R21,[{key:"schema",get:function get1(){return this._def.getter()}},{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx;return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}]);return R21}(Wr);R2.create=function(e,t){return new R2(_object_spread({getter:e,typeName:Ye.ZodLazy},$r(t)))};var M2=/*#__PURE__*/function(Wr1){"use strict";_inherits(M21,Wr1);function M21(){_class_call_check(this,M21);return _call_super(this,M21,arguments)}_create_class(M21,[{key:"_parse",value:function _parse(t){if(t.data!==this._def.value){var r=this._getOrReturnCtx(t);return _t(r,{received:r.data,code:Qe.invalid_literal,expected:this._def.value}),lr}return{status:"valid",value:t.data}}},{key:"value",get:function get1(){return this._def.value}}]);return M21}(Wr);M2.create=function(e,t){return new M2(_object_spread({value:e,typeName:Ye.ZodLiteral},$r(t)))};function xle(e,t){return new df(_object_spread({values:e,typeName:Ye.ZodEnum},$r(t)))}var df=/*#__PURE__*/function(Wr1){"use strict";_inherits(df1,Wr1);function df1(){_class_call_check(this,df1);return _call_super(this,df1,arguments)}_create_class(df1,[{key:"_parse",value:function _parse(t){if(typeof t.data!="string"){var r=this._getOrReturnCtx(t),n=this._def.values;return _t(r,{expected:cn.joinValues(n),received:r.parsedType,code:Qe.invalid_type}),lr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){var r10=this._getOrReturnCtx(t),n10=this._def.values;return _t(r10,{received:r10.data,code:Qe.invalid_enum_value,options:n10}),lr}return ws(t.data)}},{key:"options",get:function get1(){return this._def.values}},{key:"enum",get:function get1(){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.values[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t[r]=r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"Values",get:function get1(){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.values[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t[r]=r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"Enum",get:function get1(){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._def.values[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t[r]=r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"extract",value:function extract(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._def;return df.create(t,_object_spread({},this._def,r))}},{key:"exclude",value:function exclude(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._def;return df.create(this.options.filter(function(n){return!t.includes(n)}),_object_spread({},this._def,r))}}]);return df1}(Wr);df.create=xle;var O2=/*#__PURE__*/function(Wr1){"use strict";_inherits(O21,Wr1);function O21(){_class_call_check(this,O21);return _call_super(this,O21,arguments)}_create_class(O21,[{key:"_parse",value:function _parse(t){var r=cn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==At.string&&n.parsedType!==At.number){var i=cn.objectValues(r);return _t(n,{expected:cn.joinValues(i),received:n.parsedType,code:Qe.invalid_type}),lr}if(this._cache||(this._cache=new Set(cn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){var i10=cn.objectValues(r);return _t(n,{received:n.data,code:Qe.invalid_enum_value,options:i10}),lr}return ws(t.data)}},{key:"enum",get:function get1(){return this._def.values}}]);return O21}(Wr);O2.create=function(e,t){return new O2(_object_spread({values:e,typeName:Ye.ZodNativeEnum},$r(t)))};var l0=/*#__PURE__*/function(Wr1){"use strict";_inherits(l01,Wr1);function l01(){_class_call_check(this,l01);return _call_super(this,l01,arguments)}_create_class(l01,[{key:"unwrap",value:function unwrap(){return this._def.type}},{key:"_parse",value:function _parse(t){var _this=this;var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx;if(r.parsedType!==At.promise&&r.common.async===!1)return _t(r,{code:Qe.invalid_type,expected:At.promise,received:r.parsedType}),lr;var n=r.parsedType===At.promise?r.data:Promise.resolve(r.data);return ws(n.then(function(i){return _this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})}))}}]);return l01}(Wr);l0.create=function(e,t){return new l0(_object_spread({type:e,typeName:Ye.ZodPromise},$r(t)))};var Ic=/*#__PURE__*/function(Wr1){"use strict";_inherits(Ic1,Wr1);function Ic1(){_class_call_check(this,Ic1);return _call_super(this,Ic1,arguments)}_create_class(Ic1,[{key:"innerType",value:function innerType(){return this._def.schema}},{key:"sourceType",value:function sourceType(){return this._def.schema._def.typeName===Ye.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:"_parse",value:function _parse(t){var _this=this;var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx,i=this._def.effect||null,o={addIssue:function(a){_t(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){var a=i.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(function(s){return _async_to_generator(function(){var l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r.value==="aborted")return[2,lr];return[4,this._def.schema._parseAsync({data:s,path:n.path,parent:n})];case 1:l=_state.sent();return[2,l.status==="aborted"?lr:l.status==="dirty"?k2(l.value):r.value==="dirty"?k2(l.value):l]}})}).call(_this)});{if(r.value==="aborted")return lr;var s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?lr:s.status==="dirty"?k2(s.value):r.value==="dirty"?k2(s.value):s}}if(i.type==="refinement"){var a9=function(s){var l=i.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(_instanceof(l,Promise))throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){var s10=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s10.status==="aborted"?lr:(s10.status==="dirty"&&r.dirty(),a9(s10.value),{status:r.value,value:s10.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(function(s){return s.status==="aborted"?lr:(s.status==="dirty"&&r.dirty(),a9(s.value).then(function(){return{status:r.value,value:s.value}}))})}if(i.type==="transform")if(n.common.async===!1){var a10=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!o0(a10))return lr;var s11=i.transform(a10.value,o);if(_instanceof(s11,Promise))throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s11}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(function(a){return o0(a)?Promise.resolve(i.transform(a.value,o)).then(function(s){return{status:r.value,value:s}}):lr});cn.assertNever(i)}}]);return Ic1}(Wr);Ic.create=function(e,t,r){return new Ic(_object_spread({schema:e,typeName:Ye.ZodEffects,effect:t},$r(r)))};Ic.createWithPreprocess=function(e,t,r){return new Ic(_object_spread({schema:t,effect:{type:"preprocess",transform:e},typeName:Ye.ZodEffects},$r(r)))};var Tc=/*#__PURE__*/function(Wr1){"use strict";_inherits(Tc1,Wr1);function Tc1(){_class_call_check(this,Tc1);return _call_super(this,Tc1,arguments)}_create_class(Tc1,[{key:"_parse",value:function _parse(t){return this._getType(t)===At.undefined?ws(void 0):this._def.innerType._parse(t)}},{key:"unwrap",value:function unwrap(){return this._def.innerType}}]);return Tc1}(Wr);Tc.create=function(e,t){return new Tc(_object_spread({innerType:e,typeName:Ye.ZodOptional},$r(t)))};var pf=/*#__PURE__*/function(Wr1){"use strict";_inherits(pf1,Wr1);function pf1(){_class_call_check(this,pf1);return _call_super(this,pf1,arguments)}_create_class(pf1,[{key:"_parse",value:function _parse(t){return this._getType(t)===At.null?ws(null):this._def.innerType._parse(t)}},{key:"unwrap",value:function unwrap(){return this._def.innerType}}]);return pf1}(Wr);pf.create=function(e,t){return new pf(_object_spread({innerType:e,typeName:Ye.ZodNullable},$r(t)))};var $2=/*#__PURE__*/function(Wr1){"use strict";_inherits($21,Wr1);function $21(){_class_call_check(this,$21);return _call_super(this,$21,arguments)}_create_class($21,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx,n=r.data;return r.parsedType===At.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}},{key:"removeDefault",value:function removeDefault(){return this._def.innerType}}]);return $21}(Wr);$2.create=function(e,t){return new $2(_object_spread({innerType:e,typeName:Ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:function(){return t.default}},$r(t)))};var N2=/*#__PURE__*/function(Wr1){"use strict";_inherits(N21,Wr1);function N21(){_class_call_check(this,N21);return _call_super(this,N21,arguments)}_create_class(N21,[{key:"_parse",value:function _parse(t){var _this=this;var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx,n=_object_spread_props(_object_spread({},r),{common:_object_spread_props(_object_spread({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:_object_spread({},n)});return B3(i)?i.then(function(o){return{status:"valid",value:o.status==="valid"?o.value:_this._def.catchValue({get error(){return new bs(n.common.issues)},input:n.data})}}):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new bs(n.common.issues)},input:n.data})}}},{key:"removeCatch",value:function removeCatch(){return this._def.innerType}}]);return N21}(Wr);N2.create=function(e,t){return new N2(_object_spread({innerType:e,typeName:Ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:function(){return t.catch}},$r(t)))};var K3=/*#__PURE__*/function(Wr1){"use strict";_inherits(K31,Wr1);function K31(){_class_call_check(this,K31);return _call_super(this,K31,arguments)}_create_class(K31,[{key:"_parse",value:function _parse(t){if(this._getType(t)!==At.nan){var n=this._getOrReturnCtx(t);return _t(n,{code:Qe.invalid_type,expected:At.nan,received:n.parsedType}),lr}return{status:"valid",value:t.data}}}]);return K31}(Wr);K3.create=function(e){return new K3(_object_spread({typeName:Ye.ZodNaN},$r(e)))};var Ltr=Symbol("zod_brand"),tT=/*#__PURE__*/function(Wr1){"use strict";_inherits(tT1,Wr1);function tT1(){_class_call_check(this,tT1);return _call_super(this,tT1,arguments)}_create_class(tT1,[{key:"_parse",value:function _parse(t){var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.ctx,n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}},{key:"unwrap",value:function unwrap(){return this._def.type}}]);return tT1}(Wr),D2=/*#__PURE__*/function(Wr1){"use strict";_inherits(D21,Wr1);function D21(){_class_call_check(this,D21);return _call_super(this,D21,arguments)}_create_class(D21,[{key:"_parse",value:function _parse(t){var _this=this;var _this__processInputParams=this._processInputParams(t),r=_this__processInputParams.status,n=_this__processInputParams.ctx;if(n.common.async)return function(){return _async_to_generator(function(){var o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this._def.in._parseAsync({data:n.data,path:n.path,parent:n})];case 1:o=_state.sent();return[2,o.status==="aborted"?lr:o.status==="dirty"?(r.dirty(),k2(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})]}})}).call(_this)}();{var i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?lr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}}],[{key:"create",value:function create(t,r){return new D2({in:t,out:r,typeName:Ye.ZodPipeline})}}]);return D21}(Wr),L2=/*#__PURE__*/function(Wr1){"use strict";_inherits(L21,Wr1);function L21(){_class_call_check(this,L21);return _call_super(this,L21,arguments)}_create_class(L21,[{key:"_parse",value:function _parse(t){var r=this._def.innerType._parse(t),n=function(i){return o0(i)&&(i.value=Object.freeze(i.value)),i};return B3(r)?r.then(function(i){return n(i)}):n(r)}},{key:"unwrap",value:function unwrap(){return this._def.innerType}}]);return L21}(Wr);L2.create=function(e,t){return new L2(_object_spread({innerType:e,typeName:Ye.ZodReadonly},$r(t)))};var Ftr={object:Mi.lazycreate},Ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ye||(Ye={}));var ztr=Ec.create,jtr=ih.create,Utr=K3.create,Btr=oh.create,qtr=q3.create,Wtr=s0.create,Vtr=W3.create,Gtr=E2.create,Htr=T2.create,Ztr=V3.create,Ktr=nh.create,Qtr=Vd.create,Jtr=G3.create,Ytr=ju.create,OZe=Mi.create,Xtr=Mi.strictCreate,_$err=A2.create,trr=H3.create,rrr=I2.create,nrr=Ac.create,irr=P2.create,orr=Z3.create,arr=ah.create,srr=a0.create,lrr=R2.create,urr=M2.create,crr=df.create,drr=O2.create,prr=l0.create,frr=Ic.create,mrr=Tc.create,hrr=pf.create,grr=Ic.createWithPreprocess,xrr=D2.create;var Q3=/*#__PURE__*/function(Error1){"use strict";_inherits(Q31,Error1);function Q31(t,r){_class_call_check(this,Q31);var _this;_this=_call_super(this,Q31,[t]),_this.name="ParseError",_this.type=r.type,_this.field=r.field,_this.value=r.value,_this.line=r.line;return _this}return Q31}(_wrap_native_super(Error)),yle=10,DZe=13,u0=32;function KF(e){}function ble(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");var tmp=e.onEvent,t=tmp===void 0?KF:tmp,tmp1=e.onError,r=tmp1===void 0?KF:tmp1,tmp2=e.onRetry,n=tmp2===void 0?KF:tmp2,i=e.onComment,o=e.maxBufferSize,a=[],s=0,l=!0,c,d="",u=0,p,m=!1;function h(w){if(m)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,w.charCodeAt(0)===239&&w.charCodeAt(1)===187&&w.charCodeAt(2)===191&&(w=w.slice(3))),a.length===0){var E=x(w);E!==""&&(a.push(E),s=E.length),g();return}if(w.indexOf("\n")===-1&&w.indexOf("\r")===-1){a.push(w),s+=w.length,g();return}a.push(w);var S=a.join("");a.length=0,s=0;var k=x(S);k!==""&&(a.push(k),s=k.length),g()}function g(){o!==void 0&&(s+d.length<=o||(m=!0,a.length=0,s=0,c=void 0,d="",u=0,p=void 0,r(new Q3("Buffered data exceeded max buffer size of ".concat(o," characters"),{type:"max-buffer-size-exceeded"}))))}function x(w){var S=0;if(w.indexOf("\r")===-1){var k=w.indexOf("\n",S);for(;k!==-1;){if(S===k){u>0&&t({id:c,event:p,data:d}),c=void 0,d="",u=0,p=void 0,S=k+1,k=w.indexOf("\n",S);continue}var E=w.charCodeAt(S);if(vle(w,S,E)){var C=w.charCodeAt(S+5)===u0?S+6:S+5,T=w.slice(C,k);if(u===0&&w.charCodeAt(k+1)===yle){t({id:c,event:p,data:T}),c=void 0,d="",p=void 0,S=k+2,k=w.indexOf("\n",S);continue}d=u===0?T:"".concat(d,"\n").concat(T),u++}else _le(w,S,E)?p=w.slice(w.charCodeAt(S+6)===u0?S+7:S+6,k)||void 0:v(w,S,k);S=k+1,k=w.indexOf("\n",S)}return w.slice(S)}for(;S<w.length;){var k10=w.indexOf("\r",S),E1=w.indexOf("\n",S),C1=-1;if(k10!==-1&&E1!==-1?C1=k10<E1?k10:E1:k10!==-1?k10===w.length-1?C1=-1:C1=k10:E1!==-1&&(C1=E1),C1===-1)break;v(w,S,C1),S=C1+1,w.charCodeAt(S-1)===DZe&&w.charCodeAt(S)===yle&&S++}return w.slice(S)}function v(w,S,k){if(S===k){_();return}var E=w.charCodeAt(S);if(vle(w,S,E)){var R=w.charCodeAt(S+5)===u0?S+6:S+5,$=w.slice(R,k);d=u===0?$:"".concat(d,"\n").concat($),u++;return}if(_le(w,S,E)){p=w.slice(w.charCodeAt(S+6)===u0?S+7:S+6,k)||void 0;return}if(E===105&&w.charCodeAt(S+1)===100&&w.charCodeAt(S+2)===58){var R1=w.slice(w.charCodeAt(S+3)===u0?S+4:S+3,k);c=R1.includes("\0")?void 0:R1;return}if(E===58){if(i){var R10=w.slice(S,k);i(R10.slice(w.charCodeAt(S+1)===u0?2:1))}return}var C=w.slice(S,k),T=C.indexOf(":");if(T===-1){y(C,"",C);return}var I=C.slice(0,T),O=C.charCodeAt(T+1)===u0?2:1,M=C.slice(T+O);y(I,M,C)}function y(w,S,k){switch(w){case"event":p=S||void 0;break;case"data":d=u===0?S:"".concat(d,"\n").concat(S),u++;break;case"id":c=S.includes("\0")?void 0:S;break;case"retry":/^\d+$/.test(S)?n(parseInt(S,10)):r(new Q3('Invalid `retry` value: "'.concat(S,'"'),{type:"invalid-retry",value:S,line:k}));break;default:r(new Q3('Unknown field "'.concat(w.length>20?"".concat(w.slice(0,20),"…"):w,'"'),{type:"unknown-field",field:w,value:S,line:k}));break}}function _(){u>0&&t({id:c,event:p,data:d}),c=void 0,d="",u=0,p=void 0}function b(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(w.consume&&a.length>0){var S=a.join("");v(S,0,S.length)}l=!0,c=void 0,d="",u=0,p=void 0,a.length=0,s=0,m=!1}return{feed:h,reset:b}}function vle(e,t,r){return r===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function _le(e,t,r){return r===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var F2=/*#__PURE__*/function(TransformStream1){"use strict";_inherits(F21,TransformStream1);function F21(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_ref.onError,r=_ref.onRetry,n=_ref.onComment,i=_ref.maxBufferSize;_class_call_check(this,F21);var o;return _call_super(this,F21,[{start:function start(a){o=ble({onEvent:function(s){a.enqueue(s)},onError:function onError(s){typeof t=="function"&&t(s),(t==="terminate"||s.type==="max-buffer-size-exceeded")&&a.error(s)},onRetry:r,onComment:n,maxBufferSize:i})},transform:function transform(a){o.feed(a)}}])}return F21}(TransformStream);var _r=Symbol.for("workflow-serialize"),br=Symbol.for("workflow-deserialize");function ks(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function ht(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.reduce(function(t,r){return _object_spread({},t,r!=null?r:{})},{})}function LZe(e){return Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return r!=null}))}function Bu(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){if(e==null)return[2,Promise.resolve()];r=t==null?void 0:t.abortSignal;return[2,new Promise(function(n,i){if(r!=null&&r.aborted){i(wle());return}var o=setTimeout(function(){a(),n()},e),a=function(){clearTimeout(o),r==null||r.removeEventListener("abort",s)},s=function(){a(),i(wle())};r==null||r.addEventListener("abort",s)})]})})()}function wle(){return new DOMException("Delay was aborted","AbortError")}function FZe(e){var t=e!=null?e:globalThis.WebSocket;if(t==null)throw new Error("No WebSocket implementation available.");return t}function nT(e){var t=new URL(e);return t.protocol==="http:"?t.protocol="ws:":t.protocol==="https:"&&(t.protocol="wss:"),t}var Sle=new TextDecoder;function zZe(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,typeof e=="string"?e:_instanceof(e,ArrayBuffer)||ArrayBuffer.isView(e)?Sle.decode(e):typeof Blob!="undefined"&&_instanceof(e,Blob)?e.text():String(e)]})})()}var jZe=1;function sh(_01){return _async_to_generator(function(e){var _ref,tmp,t,tmp1,r,n,i;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{},tmp=_ref.highWaterMark,t=tmp===void 0?1024*1024:tmp,tmp1=_ref.pollIntervalMs,r=tmp1===void 0?20:tmp1,n=_ref.abortSignal;_state.label=1;case 1:if(!(e.readyState===jZe&&((i=e.bufferedAmount)!=null?i:0)>t))return[3,4];if((n==null?void 0:n.aborted)===!0)return[2];return[4,Bu(r)];case 2:_state.sent();_state.label=3;case 3:return[3,1];case 4:return[2]}})}).apply(this,arguments)}function lh(param){var e=param.url,t=param.protocols,r=param.headers,n=param.webSocket,i=param.abortSignal,o=param.onOpen,a=param.onMessageText,s=param.onProcessingError,l=param.onSocketError,c=param.onClose,d=param.onAbort;var u;var p,m,h=function(v){m!=null&&(i==null||i.removeEventListener("abort",m),m=void 0);try{p==null||p.close(v)}catch(y){}};if(i!=null&&i.aborted)return d==null||d((u=i.reason)!=null?u:new Error("Aborted")),{socket:void 0,close:h};try{var _$v=FZe(n);p=new _$v(e,t,{headers:LZe(r!=null?r:{})})}catch(v){return s(v),{socket:void 0,close:h}}i!=null&&d!=null&&(m=function(){var _$v;return d((_$v=i.reason)!=null?_$v:new Error("Aborted"))},i.addEventListener("abort",m,{once:!0}));var g=p;p.onopen=function(){try{o==null||o(g)}catch(v){s(v)}};var x=Promise.resolve();return p.onmessage=function(v){x=x.then(function(){return zZe(v.data)}).then(function(y){return a(y)}).catch(s)},p.onerror=function(){x=x.then(function(){return l==null?void 0:l()}).catch(s)},p.onclose=function(v){var y=v,_=typeof(y==null?void 0:y.code)=="number"?y.code:void 0,b=typeof(y==null?void 0:y.reason)=="string"?y.reason:void 0;x=x.then(function(){return c==null?void 0:c({code:_,reason:b})}).catch(s)},{socket:p,close:h}}var UZe=globalThis.btoa,BZe=globalThis.atob;function Ui(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=BZe(t);return Uint8Array.from(r,function(n){return n.codePointAt(0)})}function Jl(e){var t="";for(var r=0;r<e.length;r++)t+=String.fromCodePoint(e[r]);return UZe(t)}function Fr(e){return _instanceof(e,Uint8Array)?Jl(e):e}function Gd(e){return e.type==="text"?new TextEncoder().encode(e.text):_instanceof(e.data,Uint8Array)?e.data:_instanceof(e.data,ArrayBuffer)?new Uint8Array(e.data):Ui(e.data)}function iT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var tmp=t.useArrayBrackets,r=tmp===void 0?!0:tmp,n=new FormData;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];if(o!=null){if(Array.isArray(o)){if(o.length===1){n.append(i,o[0]);continue}var a=r?"".concat(i,"[]"):i;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s=_step1.value;n.append(a,s)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}continue}n.append(i,o)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}function oT(param){var tmp=param.tools,e=tmp===void 0?[]:tmp,t=param.providerToolNames;var r={},n={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.type==="provider"&&i.id in t){var o=t[i.id];r[i.name]=o,n[o]=i.name}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{toProviderToolName:function(i){var o;return(o=r[i])!=null?o:i},toCustomToolName:function(i){var o;return(o=n[i])!=null?o:i}}}var uh=/*#__PURE__*/function(){"use strict";function uh1(){_class_call_check(this,uh1);this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}_create_class(uh1,[{key:"promise",get:function get1(){var _this=this;return this._promise?this._promise:(this._promise=new Promise(function(e,t){_this.status.type==="resolved"?e(_this.status.value):_this.status.type==="rejected"&&t(_this.status.error),_this._resolve=e,_this._reject=t}),this._promise)}},{key:"resolve",value:function resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&((t=this._resolve)==null||t.call(this,e))}},{key:"reject",value:function reject(e){var t;this.status={type:"rejected",error:e},this._promise&&((t=this._reject)==null||t.call(this,e))}},{key:"isResolved",value:function isResolved(){return this.status.type==="resolved"}},{key:"isRejected",value:function isRejected(){return this.status.type==="rejected"}},{key:"isPending",value:function isPending(){return this.status.type==="pending"}}]);return uh1}(),Ole=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],$le=[{mediaType:"application/pdf",bytesPrefix:[37,80,68,70]}],Nle=[{mediaType:"audio/mpeg",bytesPrefix:[255,251]},{mediaType:"audio/mpeg",bytesPrefix:[255,250]},{mediaType:"audio/mpeg",bytesPrefix:[255,243]},{mediaType:"audio/mpeg",bytesPrefix:[255,242]},{mediaType:"audio/mpeg",bytesPrefix:[255,227]},{mediaType:"audio/mpeg",bytesPrefix:[255,226]},{mediaType:"audio/wav",bytesPrefix:[82,73,70,70,null,null,null,null,87,65,86,69]},{mediaType:"audio/ogg",bytesPrefix:[79,103,103,83]},{mediaType:"audio/flac",bytesPrefix:[102,76,97,67]},{mediaType:"audio/aac",bytesPrefix:[64,21,0,0]},{mediaType:"audio/webm",bytesPrefix:[26,69,223,163]}],qZe=_to_consumable_array(Nle).concat([{mediaType:"audio/mp4",bytesPrefix:[0,0,0,null,102,116,121,112]}]),Dle=[{mediaType:"video/mp4",bytesPrefix:[0,0,0,null,102,116,121,112]},{mediaType:"video/webm",bytesPrefix:[26,69,223,163]},{mediaType:"video/quicktime",bytesPrefix:[0,0,0,20,102,116,121,112,113,116]},{mediaType:"video/x-msvideo",bytesPrefix:[82,73,70,70]}],WZe=18,VZe=12,GZe=128*1024,HZe=GZe+VZe;function kle(e,t){if(typeof e!="string")return e.length>t?e.subarray(0,t):e;var r=Math.ceil(t/3)*4,n=Ui(e.substring(0,Math.min(e.length,r)));return n.length>t?n.subarray(0,t):n}function ZZe(e){return e.length>10&&e[0]===73&&e[1]===68&&e[2]===51}var KZe=function(e){var t=(e[6]&127)<<21|(e[7]&127)<<14|(e[8]&127)<<7|e[9]&127;return e.subarray(t+10)};function Cle(param){var e=param.data,t=param.signatures;var r=kle(e,WZe);ZZe(r)&&(r=KZe(kle(e,HZe)));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(r.length>=n.bytesPrefix.length&&n.bytesPrefix.every(function(i,o){return i===null||r[o]===i}))return n.mediaType}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var QZe={image:Ole,audio:qZe,video:Dle,application:$le};function ez(param){var e=param.data,t=param.topLevelType;if(t===void 0)return Cle({data:e,signatures:_to_consumable_array(Ole).concat(_to_consumable_array($le),_to_consumable_array(Nle),_to_consumable_array(Dle))});var r=QZe[t];if(r!==void 0)return Cle({data:e,signatures:r})}function ea(e){var t=e.indexOf("/");return t===-1?e:e.substring(0,t)}function qu(e){var t=e.indexOf("/");if(t===-1)return!1;var r=e.substring(t+1);return r.length>0&&r!=="*"}function Y3(e){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,(t=e.body)==null?void 0:t.cancel()];case 1:_state.sent();return[3,3];case 2:r=_state.sent();return[3,3];case 3:return[2]}})})()}var Lle="AI_DownloadError",Fle="vercel.ai.error.".concat(Lle),JZe=Symbol.for(Fle),Ele,Tle,Oa=/*#__PURE__*/function(_superClass){"use strict";_inherits(Oa1,_superClass);function Oa1(param){var e=param.url,t=param.statusCode,r=param.statusText,n=param.cause,tmp=param.message,i=tmp===void 0?n==null?"Failed to download ".concat(e,": ").concat(t," ").concat(r):"Failed to download ".concat(e,": ").concat(n):tmp;_class_call_check(this,Oa1);var _this;_this=_call_super(this,Oa1,[{name:Lle,message:i,cause:n}]),_this[Ele]=!0,_this.url=e,_this.statusCode=t,_this.statusText=r;return _this}_create_class(Oa1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Fle)}}]);return Oa1}((Tle=Ze,Ele=JZe,Tle));function YZe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:globalThis;return e.window!=null}function J3(e,t){try{return new URL(e).origin===new URL(t).origin}catch(r){return!1}}var XZe=["connection","keep-alive","te","trailer","transfer-encoding","upgrade","host","forwarded","proxy-authorization","via","x-forwarded-for","x-forwarded-host","x-forwarded-proto","x-real-ip","metadata","metadata-flavor","x-aws-ec2-metadata-token","x-metadata-token","cookie","set-cookie"];function eKe(e){var t=new Headers(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=XZe[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t.delete(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function tKe(e){var t;try{t=new URL(e)}catch(n){throw new Oa({url:e,message:"Invalid URL: ".concat(e)})}if(t.protocol==="data:")return;if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Oa({url:e,message:"URL scheme must be http, https, or data, got ".concat(t.protocol)});var r=t.hostname.toLowerCase().replace(/\.+$/,"");if(!r)throw new Oa({url:e,message:"URL must have a hostname"});if(r==="localhost"||r.endsWith(".local")||r.endsWith(".localhost"))throw new Oa({url:e,message:"URL with hostname ".concat(r," is not allowed")});if(r.startsWith("[")&&r.endsWith("]")){var n=r.slice(1,-1);if(nKe(n))throw new Oa({url:e,message:"URL with IPv6 address ".concat(r," is not allowed")});return}if(zle(r)){if(jle(r))throw new Oa({url:e,message:"URL with IP address ".concat(r," is not allowed")});return}}function zle(e){var t=e.split(".");return t.length!==4?!1:t.every(function(r){var n=Number(r);return Number.isInteger(n)&&n>=0&&n<=255&&String(n)===r})}function jle(e){var t=e.split(".").map(Number),_t1=_sliced_to_array(t,3),r=_t1[0],n=_t1[1],i=_t1[2];return r===0||r===10||r===100&&n>=64&&n<=127||r===127||r===169&&n===254||r===172&&n>=16&&n<=31||r===192&&n===0&&i===0||r===192&&n===0&&i===2||r===192&&n===168||r===198&&(n===18||n===19)||r===198&&n===51&&i===100||r===203&&n===0&&i===113||r>=224}function rKe(e){var t=e.toLowerCase(),r=t.indexOf("%");r!==-1&&(t=t.slice(0,r));var n=t.split("::");if(n.length>2)return null;var i=function(a){if(a==="")return[];var s=[],l=a.split(":");for(var c=0;c<l.length;c++){var d=l[c];if(d.includes(".")){if(c!==l.length-1||!zle(d))return null;var _d_split_map=_sliced_to_array(d.split(".").map(Number),4),u=_d_split_map[0],p=_d_split_map[1],m=_d_split_map[2],h=_d_split_map[3];s.push(u<<8|p,m<<8|h);continue}if(!/^[0-9a-f]{1,4}$/.test(d))return null;s.push(parseInt(d,16))}return s},o=i(n[0]);if(o===null)return null;if(n.length===2){var a=i(n[1]);if(a===null)return null;var s=8-o.length-a.length;return s<0?null:_to_consumable_array(o).concat(_to_consumable_array(new Array(s).fill(0)),_to_consumable_array(a))}return o.length===8?o:null}function nKe(e){var t=rKe(e);if(t===null)return!0;var r=function(i){return t.slice(0,i).every(function(o){return o===0})};if(r(7)&&(t[7]===0||t[7]===1)||(t[0]&65024)===64512||(t[0]&65472)===65152||(t[0]&65472)===65216||(t[0]&65280)===65280||t[0]===8193&&t[1]===3512||t[0]===16383&&!(t[1]&61440))return!0;if(r(6)||r(5)&&t[5]===65535||r(4)&&t[4]===65535&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===0||t[0]===100&&t[1]===65435&&t[2]===1){var i=t[6]>>8&255,o=t[6]&255,a=t[7]>>8&255,s=t[7]&255;return jle("".concat(i,".").concat(o,".").concat(a,".").concat(s))}return!1}var iKe=10,oKe=new Set([301,302,303,307,308]);function aT(_01){return _async_to_generator(function(param){var e,t,r,tmp,n,tmp1,i,o,a,s,l,c,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.url,t=param.headers,r=param.abortSignal,tmp=param.maxRedirects,n=tmp===void 0?iKe:tmp,tmp1=param.fetch,i=tmp1===void 0?globalThis.fetch:tmp1,o=param.trustedOrigin;a=t===void 0?void 0:eKe(t),s=function(c){var d={signal:r,redirect:c};return a!==void 0&&(d.headers=new Headers(a)),d},l=e;c=0;_state.label=1;case 1:if(!(c<=n))return[3,8];(o===void 0||!J3(l,o))&&tKe(l);return[4,i(l,s("manual"))];case 2:d=_state.sent();if(!(d.type==="opaqueredirect"))return[3,4];if(!YZe())throw new Oa({url:e,message:"Redirect from ".concat(l," could not be validated and was blocked")});return[4,i(l,s("follow"))];case 3:return[2,_state.sent()];case 4:u=d.headers.get("location");if(!(oKe.has(d.status)&&u))return[3,6];return[4,Y3(d)];case 5:_state.sent();p=new URL(u,l).toString();if(a!==void 0&&!J3(p,l)){m=a.get("user-agent");a=new Headers(m==null?void 0:{"user-agent":m})}l=p;return[3,7];case 6:return[2,d];case 7:c++;return[3,1];case 8:throw new Oa({url:e,message:"Too many redirects (max ".concat(n,")")})}})}).apply(this,arguments)}var sT=2*1024*1024*1024;function lT(_01){return _async_to_generator(function(param){var e,t,tmp,r,n,d,i,o,a,s,_ref,d10,u,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d11;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.response,t=param.url,tmp=param.maxBytes,r=tmp===void 0?sT:tmp;n=e.headers.get("content-length");if(!(n!=null))return[3,2];d=parseInt(n,10);if(!(!isNaN(d)&&d>r))return[3,2];return[4,Y3(e)];case 1:throw _state.sent(),new Oa({url:t,message:"Download of ".concat(t," exceeded maximum size of ").concat(r," bytes (Content-Length: ").concat(d,").")});case 2:i=e.body;if(i==null)return[2,new Uint8Array(0)];o=i.getReader(),a=[],s=0;_state.label=3;case 3:_state.trys.push([3,,8,12]);_state.label=4;case 4:return[4,o.read()];case 5:_ref=_state.sent(),d10=_ref.done,u=_ref.value;if(d10)return[3,7];if(s+=u.length,s>r)throw new Oa({url:t,message:"Download of ".concat(t," exceeded maximum size of ").concat(r," bytes.")});a.push(u);_state.label=6;case 6:return[3,4];case 7:return[3,12];case 8:_state.trys.push([8,,10,11]);return[4,o.cancel()];case 9:_state.sent();return[3,11];case 10:o.releaseLock();return[7];case 11:return[7];case 12:l=new Uint8Array(s),c=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=a[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d11=_step.value;l.set(d11,c),c+=d11.length}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,l]}})}).apply(this,arguments)}function X3(e,t){return _async_to_generator(function(){var r,n,_$i,o,a,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,6]);return[4,aT({url:e,abortSignal:t==null?void 0:t.abortSignal})];case 1:_$i=_state.sent();if(!!_$i.ok)return[3,3];return[4,Y3(_$i)];case 2:throw _state.sent(),new Oa({url:e,statusCode:_$i.status,statusText:_$i.statusText});case 3:return[4,lT({response:_$i,url:e,maxBytes:(r=t==null?void 0:t.maxBytes)!=null?r:sT})];case 4:o=_state.sent(),a=(n=_$i.headers.get("content-type"))!=null?n:void 0;return[2,new Blob([o],a?{type:a}:void 0)];case 5:i=_state.sent();throw Oa.isInstance(i)?i:new Oa({url:e,cause:i});case 6:return[2]}})})()}function z2(e){return Object.fromEntries(_to_consumable_array(e.headers))}function mf(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.filter(function(t){return t!=null})}var mo=function(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=_ref.prefix,tmp=_ref.size,t=tmp===void 0?16:tmp,tmp1=_ref.alphabet,r=tmp1===void 0?"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz":tmp1,tmp2=_ref.separator,n=tmp2===void 0?"-":tmp2;var i=function(){var o=r.length,a=new Array(t);for(var s=0;s<t;s++)a[s]=r[Math.random()*o|0];return a.join("")};if(e==null)return i;if(r.includes(n))throw new il({argument:"separator",message:'The separator "'.concat(n,'" must not be part of the alphabet "').concat(r,'".')});return function(){return"".concat(e).concat(n).concat(i())}},Qr=mo();function Kl(e){return(_instanceof(e,Error)||_instanceof(e,DOMException))&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var aKe=["fetch failed","failed to fetch"],sKe=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function lKe(e){if(!_instanceof(e,Error))return!1;var t=e.code;return!!(typeof t=="string"&&sKe.includes(t))}function Ule(param){var e=param.error,t=param.url,r=param.requestBodyValues;if(Kl(e))return e;if(_instanceof(e,TypeError)&&aKe.includes(e.message.toLowerCase())){var n=e.cause;if(n!=null)return new Rr({message:"Cannot connect to API: ".concat(n.message),cause:n,url:t,requestBodyValues:r,isRetryable:!0})}return lKe(e)?new Rr({message:"Cannot connect to API: ".concat(e.message),cause:e,url:t,requestBodyValues:r,isRetryable:!0}):e}function j2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:globalThis;var t,r,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?"runtime/".concat(e.navigator.userAgent.toLowerCase()):(n=(r=e.process)==null?void 0:r.versions)!=null&&n.node?"runtime/node.js/".concat(e.process.version.substring(0)):e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function tz(e){if(e==null)return{};var t={};if(_instanceof(e,Headers))e.forEach(function(r,n){t[n.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];n!=null&&(t[r.toLowerCase()]=n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return t}function Bi(e){for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key]}var r=new Headers(tz(e)),n=r.get("user-agent")||"";return r.set("user-agent",[n].concat(_to_consumable_array(t)).filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var Ble="5.0.14",uKe=function(){return globalThis.fetch},$a=function(param){var e=param.url,tmp=param.headers,t=tmp===void 0?{}:tmp,r=param.successfulResponseHandler,n=param.failedResponseHandler,i=param.abortSignal,tmp1=param.fetch,o=tmp1===void 0?uKe():tmp1,a=param.validateUrl,s=param.credentialedOrigin,l=param.trustedOrigin;return _async_to_generator(function(){var _$c,d,u,p,_tmp,_$m,h,m,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,13,,14]);_$c=s!==void 0&&!J3(e,s)?{}:t,d=Bi(_$c,"ai-sdk/provider-utils/".concat(Ble),j2());if(!a)return[3,2];return[4,aT({url:e,headers:d,abortSignal:i,fetch:o,trustedOrigin:l})];case 1:_tmp=_state.sent();return[3,4];case 2:return[4,o(e,{method:"GET",headers:d,signal:i})];case 3:_tmp=_state.sent();_state.label=4;case 4:u=_tmp,p=z2(u);if(!!u.ok)return[3,9];_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,n({response:u,url:e,requestBodyValues:{}})];case 6:_$m=_state.sent();return[3,8];case 7:h=_state.sent();throw Kl(h)||Rr.isInstance(h)?h:new Rr({message:"Failed to process error response",cause:h,statusCode:u.status,url:e,responseHeaders:p,requestBodyValues:{}});case 8:throw _$m.value;case 9:_state.trys.push([9,11,,12]);return[4,r({response:u,url:e,requestBodyValues:{}})];case 10:return[2,_state.sent()];case 11:m=_state.sent();throw _instanceof(m,Error)&&(Kl(m)||Rr.isInstance(m))?m:new Rr({message:"Failed to process successful response",cause:m,statusCode:u.status,url:e,responseHeaders:p,requestBodyValues:{}});case 12:return[3,14];case 13:c=_state.sent();throw Ule({error:c,url:e,requestBodyValues:{}});case 14:return[2]}})})()};function e6(e){var t,r;return(r=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?r:!1}function p0(e){return e!=null}function qle(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&!_instanceof(e,Uint8Array)&&!_instanceof(e,URL)&&!_instanceof(e,ArrayBuffer)&&!e6(e)&&!("type"in e)}function Wle(param){var e=param.mediaType,t=param.url,r=param.supportedUrls;t=t.toLowerCase(),e=e.toLowerCase();var n=!e.includes("/");return Object.entries(r).map(function(param){var _param=_sliced_to_array(param,2),i=_param[0],o=_param[1];var a=i.toLowerCase();return a==="*"||a==="*/*"?{mediaTypePrefix:"",regexes:o}:{mediaTypePrefix:a.replace(/\*/,""),regexes:o}}).filter(function(param){var i=param.mediaTypePrefix;return i===""?!0:n?"".concat(e,"/")===i:e.startsWith(i)}).flatMap(function(param){var i=param.regexes;return i}).some(function(i){return i.test(t)})}function U2(param){var e=param.apiKey,t=param.environmentVariableName,tmp=param.apiKeyParameterName,r=tmp===void 0?"apiKey":tmp,n=param.description;if(typeof e=="string")return e;if(e!=null)throw new Ey({message:"".concat(n," API key must be a string.")});if(typeof process=="undefined")throw new Ey({message:"".concat(n," API key is missing. Pass it using the '").concat(r,"' parameter. Environment variables are not supported in this environment.")});if(e=process.env[t],e==null)throw new Ey({message:"".concat(n," API key is missing. Pass it using the '").concat(r,"' parameter or the ").concat(t," environment variable.")});if(typeof e!="string")throw new Ey({message:"".concat(n," API key must be a string. The value of the ").concat(t," environment variable is not a string.")});return e}function Hd(param){var e=param.settingValue,t=param.environmentVariableName;if(typeof e=="string")return e;if(!(e!=null||typeof process=="undefined")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}function Oc(e){return e!==void 0&&e!=="provider-default"}function uT(param){var e=param.reasoning,t=param.effortMap,r=param.warnings;var n=t[e];if(n==null){r.push({type:"unsupported",feature:"reasoning",details:'reasoning "'.concat(e,'" is not supported by this model.')});return}return n!==e&&r.push({type:"compatibility",feature:"reasoning",details:'reasoning "'.concat(e,'" is not directly supported by this model. mapped to effort "').concat(n,'".')}),n}var cKe={minimal:.02,low:.1,medium:.3,high:.6,xhigh:.9};function cT(param){var e=param.reasoning,t=param.maxOutputTokens,r=param.maxReasoningBudget,tmp=param.minReasoningBudget,n=tmp===void 0?1024:tmp,tmp1=param.budgetPercentages,i=tmp1===void 0?cKe:tmp1,o=param.warnings;var a=i[e];if(a==null){o.push({type:"unsupported",feature:"reasoning",details:'reasoning "'.concat(e,'" is not supported by this model.')});return}return Math.min(r,Math.max(n,Math.round(t*a)))}function Vle(e){var t;var _e_toLowerCase_split=_sliced_to_array(e.toLowerCase().split("/"),2),r=_e_toLowerCase_split[0],tmp=_e_toLowerCase_split[1],n=tmp===void 0?"":tmp;return(t=({mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"})[n])!=null?t:n}var dKe=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,pKe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ale(e){var t=JSON.parse(e);return t===null||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||dKe.test(e)===!1&&pKe.test(e)===!1?t:fKe(t)}function fKe(e){var t=[e];for(;t.length;){var r=t;t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&_type_of(n.constructor)=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(var i in n){var o=n[i];o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&t.push(o)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return e}function ll(e){var t=Error.stackTraceLimit;try{Error.stackTraceLimit=0}catch(r){return Ale(e)}try{return Ale(e)}finally{Error.stackTraceLimit=t}}function rz(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;var r=e.properties;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(r!=null)try{for(var _iterator=Object.keys(r)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;r[n]=c0(r[n])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(c0):c0(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(c0)),e.allOf!=null&&(e.allOf=e.allOf.map(c0)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(c0));var t=e.definitions;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(t!=null)try{for(var _iterator1=Object.keys(t)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r10=_step1.value;t[r10]=c0(t[r10])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return e}function c0(e){return typeof e=="boolean"?e:rz(e)}var mKe=Symbol("Let zodToJsonSchema decide on which parser to use"),Ile={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},hKe=function(e){return typeof e=="string"?_object_spread_props(_object_spread({},Ile),{name:e}):_object_spread({},Ile,e)};function Ql(){return{}}function gKe(e,t){var r,n,i;var o={type:"array"};return(r=e.type)!=null&&r._def&&((i=(n=e.type)==null?void 0:n._def)==null?void 0:i.typeName)!==Ye.ZodAny&&(o.items=Vn(e.type._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items"])}))),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function xKe(e){var t={type:"integer",format:"int64"};if(!e.checks)return t;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r.kind){case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function yKe(){return{type:"boolean"}}function Gle(e,t){return Vn(e.type._def,t)}var vKe=function(e,t){return Vn(e.innerType._def,t)};function Hle(e,t,r){var n=r!=null?r:t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(function(i){return Hle(e,t,i)})};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _Ke(e)}}var _Ke=function(e){var t={type:"integer",format:"unix-time"};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r.kind){case"min":t.minimum=r.value;break;case"max":t.maximum=r.value;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t};function bKe(e,t){return _object_spread_props(_object_spread({},Vn(e.innerType._def,t)),{default:e.defaultValue()})}function wKe(e,t){return t.effectStrategy==="input"?Vn(e.schema._def,t):Ql()}function SKe(e){return{type:"string",enum:Array.from(e.values)}}var kKe=function(e){return"type"in e&&e.type==="string"?!1:"allOf"in e};function CKe(e,t){var r=[Vn(e.left._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["allOf","0"])})),Vn(e.right._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["allOf","1"])}))].filter(function(i){return!!i}),n=[];return r.forEach(function(i){var _n;if(kKe(i))(_n=n).push.apply(_n,_to_consumable_array(i.allOf));else{var o=i;if("additionalProperties"in i&&i.additionalProperties===!1){var a=i.additionalProperties,s=_object_without_properties(i,["additionalProperties"]);o=s}n.push(o)}}),n.length?{allOf:n}:void 0}function EKe(e){var t=_type_of(e.value);return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var QF=void 0,Pc={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:function(){return QF===void 0&&(QF=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),QF},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Zle(e,t){var r={type:"string"};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(e.checks)try{for(var _iterator=e.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;switch(n.kind){case"min":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value;break;case"max":r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":Rc(r,"email",n.message,t);break;case"format:idn-email":Rc(r,"idn-email",n.message,t);break;case"pattern:zod":Ss(r,Pc.email,n.message,t);break}break;case"url":Rc(r,"uri",n.message,t);break;case"uuid":Rc(r,"uuid",n.message,t);break;case"regex":Ss(r,n.regex,n.message,t);break;case"cuid":Ss(r,Pc.cuid,n.message,t);break;case"cuid2":Ss(r,Pc.cuid2,n.message,t);break;case"startsWith":Ss(r,RegExp("^".concat(JF(n.value,t))),n.message,t);break;case"endsWith":Ss(r,RegExp("".concat(JF(n.value,t),"$")),n.message,t);break;case"datetime":Rc(r,"date-time",n.message,t);break;case"date":Rc(r,"date",n.message,t);break;case"time":Rc(r,"time",n.message,t);break;case"duration":Rc(r,"duration",n.message,t);break;case"length":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"includes":{Ss(r,RegExp(JF(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Rc(r,"ipv4",n.message,t),n.version!=="v4"&&Rc(r,"ipv6",n.message,t);break}case"base64url":Ss(r,Pc.base64url,n.message,t);break;case"jwt":Ss(r,Pc.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Ss(r,Pc.ipv4Cidr,n.message,t),n.version!=="v4"&&Ss(r,Pc.ipv6Cidr,n.message,t);break}case"emoji":Ss(r,Pc.emoji(),n.message,t);break;case"ulid":{Ss(r,Pc.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Rc(r,"binary",n.message,t);break}case"contentEncoding:base64":{r.contentEncoding="base64";break}case"pattern:zod":{Ss(r,Pc.base64,n.message,t);break}}break}case"nanoid":Ss(r,Pc.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function JF(e,t){return t.patternStrategy==="escape"?AKe(e):e}var TKe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function AKe(e){var t="";for(var r=0;r<e.length;r++)TKe.has(e[r])||(t+="\\"),t+=e[r];return t}function Rc(e,t,r,n){var i;e.format||(i=e.anyOf)!=null&&i.some(function(o){return o.format})?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push(_object_spread({format:t},r&&n.errorMessages&&{errorMessage:{format:r}}))):e.format=t}function Ss(e,t,r,n){var i;e.pattern||(i=e.allOf)!=null&&i.some(function(o){return o.pattern})?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push(_object_spread({pattern:Ple(t,n)},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):e.pattern=Ple(t,n)}function Ple(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;var n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source,o="",a=!1,s=!1,l=!1;for(var c=0;c<i.length;c++){if(a){o+=i[c],a=!1;continue}if(n.i){if(s){if(i[c].match(/[a-z]/)){l?(o+=i[c],o+="".concat(i[c-2],"-").concat(i[c]).toUpperCase(),l=!1):i[c+1]==="-"&&(r=i[c+2])!=null&&r.match(/[a-z]/)?(o+=i[c],l=!0):o+="".concat(i[c]).concat(i[c].toUpperCase());continue}}else if(i[c].match(/[a-z]/)){o+="[".concat(i[c]).concat(i[c].toUpperCase(),"]");continue}}if(n.m){if(i[c]==="^"){o+="(^|(?<=[\r\n]))";continue}else if(i[c]==="$"){o+="($|(?=[\r\n]))";continue}}if(n.s&&i[c]==="."){o+=s?"".concat(i[c],"\r\n"):"[".concat(i[c],"\r\n]");continue}o+=i[c],i[c]==="\\"?a=!0:s&&i[c]==="]"?s=!1:!s&&i[c]==="["&&(s=!0)}try{new RegExp(o)}catch(c){return console.warn("Could not convert regex pattern at ".concat(t.currentPath.join("/")," to a flag-independent form! Falling back to the flag-ignorant source")),e.source}return o}function Kle(e,t){var r,n,i,o,a,s;var l={type:"object",additionalProperties:(r=Vn(e.valueType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["additionalProperties"])})))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Ye.ZodString&&(i=e.keyType._def.checks)!=null&&i.length){var _Zle=Zle(e.keyType._def,t),c=_Zle.type,d=_object_without_properties(_Zle,["type"]);return _object_spread_props(_object_spread({},l),{propertyNames:d})}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===Ye.ZodEnum)return _object_spread_props(_object_spread({},l),{propertyNames:{enum:e.keyType._def.values}});if(((a=e.keyType)==null?void 0:a._def.typeName)===Ye.ZodBranded&&e.keyType._def.type._def.typeName===Ye.ZodString&&(s=e.keyType._def.type._def.checks)!=null&&s.length){var _Gle=Gle(e.keyType._def,t),c10=_Gle.type,d10=_object_without_properties(_Gle,["type"]);return _object_spread_props(_object_spread({},l),{propertyNames:d10})}}return l}function IKe(e,t){if(t.mapStrategy==="record")return Kle(e,t);var r=Vn(e.keyType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items","items","0"])}))||Ql(),n=Vn(e.valueType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items","items","1"])}))||Ql();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function PKe(e){var t=e.values,n=Object.keys(e.values).filter(function(o){return typeof t[t[o]]!="number"}).map(function(o){return t[o]}),i=Array.from(new Set(n.map(function(o){return typeof o==="undefined"?"undefined":_type_of(o)})));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}function RKe(){return{not:Ql()}}function MKe(){return{type:"null"}}var YF={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function OKe(e,t){var r=_instanceof(e.options,Map)?Array.from(e.options.values()):e.options;if(r.every(function(n){return n._def.typeName in YF&&(!n._def.checks||!n._def.checks.length)})){var n=r.reduce(function(i,o){var a=YF[o._def.typeName];return a&&!i.includes(a)?_to_consumable_array(i).concat([a]):i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(function(n){return n._def.typeName==="ZodLiteral"&&!n.description})){var n10=r.reduce(function(i,o){var a=_type_of(o._def.value);switch(a){case"string":case"number":case"boolean":return _to_consumable_array(i).concat([a]);case"bigint":return _to_consumable_array(i).concat(["integer"]);case"object":if(o._def.value===null)return _to_consumable_array(i).concat(["null"]);case"symbol":case"undefined":case"function":default:return i}},[]);if(n10.length===r.length){var i=n10.filter(function(o,a,s){return s.indexOf(o)===a});return{type:i.length>1?i:i[0],enum:r.reduce(function(o,a){return o.includes(a._def.value)?o:_to_consumable_array(o).concat([a._def.value])},[])}}}else if(r.every(function(n){return n._def.typeName==="ZodEnum"}))return{type:"string",enum:r.reduce(function(n,i){return _to_consumable_array(n).concat(_to_consumable_array(i._def.values.filter(function(o){return!n.includes(o)})))},[])};return $Ke(e,t)}var $Ke=function(e,t){var r=(_instanceof(e.options,Map)?Array.from(e.options.values()):e.options).map(function(n,i){return Vn(n._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["anyOf","".concat(i)])}))}).filter(function(n){return!!n&&(!t.strictUnions||(typeof n==="undefined"?"undefined":_type_of(n))=="object"&&Object.keys(n).length>0)});return r.length?{anyOf:r}:void 0};function NKe(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[YF[e.innerType._def.typeName],"null"]};var r=Vn(e.innerType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["anyOf","0"])}));return r&&{anyOf:[r,{type:"null"}]}}function DKe(e){var t={type:"number"};if(!e.checks)return t;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.checks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function LKe(e,t){var r={type:"object",properties:{}},n=[],i=e.shape();for(var a in i){var s=i[a];if(s===void 0||s._def===void 0)continue;var l=zKe(s),c=Vn(s._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["properties",a]),propertyPath:_to_consumable_array(t.currentPath).concat(["properties",a])}));c!==void 0&&(r.properties[a]=c,l||n.push(a))}n.length&&(r.required=n);var o=FKe(e,t);return o!==void 0&&(r.additionalProperties=o),r}function FKe(e,t){if(e.catchall._def.typeName!=="ZodNever")return Vn(e.catchall._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["additionalProperties"])}));switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function zKe(e){try{return e.isOptional()}catch(t){return!0}}var jKe=function(e,t){var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return Vn(e.innerType._def,t);var n=Vn(e.innerType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["anyOf","1"])}));return n?{anyOf:[{not:Ql()},n]}:Ql()},UKe=function(e,t){if(t.pipeStrategy==="input")return Vn(e.in._def,t);if(t.pipeStrategy==="output")return Vn(e.out._def,t);var r=Vn(e.in._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["allOf","0"])})),n=Vn(e.out._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["allOf",r?"1":"0"])}));return{allOf:[r,n].filter(function(i){return i!==void 0})}};function BKe(e,t){return Vn(e.type._def,t)}function qKe(e,t){var n={type:"array",uniqueItems:!0,items:Vn(e.valueType._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items"])}))};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function WKe(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(function(r,n){return Vn(r._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items","".concat(n)])}))}).reduce(function(r,n){return n===void 0?r:_to_consumable_array(r).concat([n])},[]),additionalItems:Vn(e.rest._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["additionalItems"])}))}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(function(r,n){return Vn(r._def,_object_spread_props(_object_spread({},t),{currentPath:_to_consumable_array(t.currentPath).concat(["items","".concat(n)])}))}).reduce(function(r,n){return n===void 0?r:_to_consumable_array(r).concat([n])},[])}}function VKe(){return{not:Ql()}}function GKe(){return Ql()}var HKe=function(e,t){return Vn(e.innerType._def,t)},ZKe=function(e,t,r){switch(t){case Ye.ZodString:return Zle(e,r);case Ye.ZodNumber:return DKe(e);case Ye.ZodObject:return LKe(e,r);case Ye.ZodBigInt:return xKe(e);case Ye.ZodBoolean:return yKe();case Ye.ZodDate:return Hle(e,r);case Ye.ZodUndefined:return VKe();case Ye.ZodNull:return MKe();case Ye.ZodArray:return gKe(e,r);case Ye.ZodUnion:case Ye.ZodDiscriminatedUnion:return OKe(e,r);case Ye.ZodIntersection:return CKe(e,r);case Ye.ZodTuple:return WKe(e,r);case Ye.ZodRecord:return Kle(e,r);case Ye.ZodLiteral:return EKe(e);case Ye.ZodEnum:return SKe(e);case Ye.ZodNativeEnum:return PKe(e);case Ye.ZodNullable:return NKe(e,r);case Ye.ZodOptional:return jKe(e,r);case Ye.ZodMap:return IKe(e,r);case Ye.ZodSet:return qKe(e,r);case Ye.ZodLazy:return function(){return e.getter()._def};case Ye.ZodPromise:return BKe(e,r);case Ye.ZodNaN:case Ye.ZodNever:return RKe();case Ye.ZodEffects:return wKe(e,r);case Ye.ZodAny:return Ql();case Ye.ZodUnknown:return GKe();case Ye.ZodDefault:return bKe(e,r);case Ye.ZodBranded:return Gle(e,r);case Ye.ZodReadonly:return HKe(e,r);case Ye.ZodCatch:return vKe(e,r);case Ye.ZodPipeline:return UKe(e,r);case Ye.ZodFunction:case Ye.ZodVoid:case Ye.ZodSymbol:return;default:return function(n){}(t)}},KKe=function(e,t){var r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString()].concat(_to_consumable_array(t.slice(r))).join("/")};function Vn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var n;var i=t.seen.get(e);if(t.override){var l=(n=t.override)==null?void 0:n.call(t,e,t,i,r);if(l!==mKe)return l}if(i&&!r){var l10=QKe(i,t);if(l10!==void 0)return l10}var o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);var a=ZKe(e,e.typeName,t),s=typeof a=="function"?Vn(a(),t):a;if(s&&JKe(e,t,s),t.postProcess){var l11=t.postProcess(s,e,t);return o.jsonSchema=s,l11}return o.jsonSchema=s,s}var QKe=function(e,t){switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:KKe(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(function(r,n){return t.currentPath[n]===r})?(console.warn("Recursive reference detected at ".concat(t.currentPath.join("/"),"! Defaulting to any")),Ql()):t.$refStrategy==="seen"?Ql():void 0}},JKe=function(e,t,r){return e.description&&(r.description=e.description),r},YKe=function(e){var t=hKe(e),r=t.name!==void 0?_to_consumable_array(t.basePath).concat([t.definitionPath,t.name]):t.basePath;return _object_spread_props(_object_spread({},t),{currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(function(param){var _param=_sliced_to_array(param,2),n=_param[0],i=_param[1];return[i._def,{def:i._def,path:_to_consumable_array(t.basePath).concat([t.definitionPath,n]),jsonSchema:void 0}]}))})},XKe=function(e,t){var r;var n=YKe(t),i=(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&t.definitions?Object.entries(t.definitions).reduce(function(c,param){var _param=_sliced_to_array(param,2),d=_param[0],u=_param[1];var p;return _object_spread_props(_object_spread({},c),_define_property({},d,(p=Vn(u._def,_object_spread_props(_object_spread({},n),{currentPath:_to_consumable_array(n.basePath).concat([n.definitionPath,d])}),!0))!=null?p:Ql()))},{}):void 0,o=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,a=(r=Vn(e._def,o===void 0?n:_object_spread_props(_object_spread({},n),{currentPath:_to_consumable_array(n.basePath).concat([n.definitionPath,o])}),!1))!=null?r:Ql(),s=(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(a.title=s);var l=o===void 0?i?_object_spread_props(_object_spread({},a),_define_property({},n.definitionPath,i)):a:_define_property({$ref:_to_consumable_array(n.$refStrategy==="relative"?[]:n.basePath).concat([n.definitionPath,o]).join("/")},n.definitionPath,_object_spread_props(_object_spread({},i),_define_property({},o,a)));return l.$schema="http://json-schema.org/draft-07/schema#",l},XF=Symbol.for("vercel.ai.schema");function ne(e){var t;return function(){return t==null&&(t=e()),t}}function f0(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=_ref.validate;var _obj,_mutatorMap={};return _obj={},_define_property(_obj,XF,!0),_define_property(_obj,"_type",void 0),_mutatorMap["jsonSchema"]=_mutatorMap["jsonSchema"]||{},_mutatorMap["jsonSchema"].get=function(){return typeof e=="function"&&(e=e()),e},_define_property(_obj,"validate",t),_define_enumerable_properties(_obj,_mutatorMap),_obj}function eQe(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&XF in e&&e[XF]===!0&&"jsonSchema"in e&&"validate"in e}function Wu(e){return e==null?f0({type:"object",properties:{},additionalProperties:!1}):eQe(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?te(e):tQe(e):e()}function tQe(e){return f0(function(){if(!rQe(e))throw new Error("Standard schema vendor '".concat(e["~standard"].vendor,"' does not support JSON Schema conversion."));return rz(e["~standard"].jsonSchema.input({target:"draft-07"}))},{validate:function(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e["~standard"].validate(t)];case 1:r=_state.sent();return[2,"value"in r?{success:!0,value:r.value}:{success:!1,error:new Nu({value:t,cause:r.issues})}]}})})()}})}function rQe(e){return e["~standard"].jsonSchema!=null}function nQe(e,t){var r;var n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return f0(function(){return XKe(e,{$refStrategy:n?"root":"none"})},{validate:function(i){return _async_to_generator(function(){var o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.safeParseAsync(i)];case 1:o=_state.sent();return[2,o.success?{success:!0,value:o.data}:{success:!1,error:o.error}]}})})()}})}function iQe(e,t){var r;var n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return f0(function(){return rz(sf(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"}))},{validate:function(i){return _async_to_generator(function(){var o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,A3(e,i)];case 1:o=_state.sent();return[2,o.success?{success:!0,value:o.data}:{success:!1,error:o.error}]}})})()}})}function oQe(e){return"_zod"in e}function te(e,t){return oQe(e)?iQe(e,t):nQe(e,t)}function ur(_01){return _async_to_generator(function(param){var e,t,r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.value,t=param.schema,r=param.context;return[4,ta({value:e,schema:t,context:r})];case 1:n=_state.sent();if(!n.success)throw Nu.wrap({value:e,cause:n.error,context:r});return[2,n.value]}})}).apply(this,arguments)}function ta(_01){return _async_to_generator(function(param){var e,t,r,n,_$i,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.value,t=param.schema,r=param.context;n=Wu(t);_state.label=1;case 1:_state.trys.push([1,3,,4]);if(n.validate==null)return[2,{success:!0,value:e,rawValue:e}];return[4,n.validate(e)];case 2:_$i=_state.sent();return[2,_$i.success?{success:!0,value:_$i.value,rawValue:e}:{success:!1,error:Nu.wrap({value:e,cause:_$i.error,context:r}),rawValue:e}];case 3:i=_state.sent();return[2,{success:!1,error:Nu.wrap({value:e,cause:i,context:r}),rawValue:e}];case 4:return[2]}})}).apply(this,arguments)}function nz(_01){return _async_to_generator(function(param){var e,t,_$r,_tmp,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.text,t=param.schema;_state.label=1;case 1:_state.trys.push([1,5,,6]);_$r=ll(e);if(!(t==null))return[3,2];_tmp=_$r;return[3,4];case 2:return[4,ur({value:_$r,schema:t})];case 3:_tmp=_state.sent();_state.label=4;case 4:return[2,_tmp];case 5:r=_state.sent();throw Cy.isInstance(r)||Nu.isInstance(r)?r:new Cy({text:e,cause:r});case 6:return[2]}})}).apply(this,arguments)}function Ji(_01){return _async_to_generator(function(param){var e,t,_$r,_tmp,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.text,t=param.schema;_state.label=1;case 1:_state.trys.push([1,5,,6]);_$r=ll(e);if(!(t==null))return[3,2];_tmp={success:!0,value:_$r,rawValue:_$r};return[3,4];case 2:return[4,ta({value:_$r,schema:t})];case 3:_tmp=_state.sent();_state.label=4;case 4:return[2,_tmp];case 5:r=_state.sent();return[2,{success:!1,error:Cy.isInstance(r)?r:new Cy({text:e,cause:r}),rawValue:void 0}];case 6:return[2]}})}).apply(this,arguments)}function dT(param){var e=param.stream,t=param.schema;return e.pipeThrough(new TextDecoderStream).pipeThrough(new F2).pipeThrough(new TransformStream({transform:function transform(_01,_11){return _async_to_generator(function(param,n){var r,_tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=param.data;_tmp=r!=="[DONE]";if(!_tmp)return[3,2];_=n.enqueue;return[4,Ji({text:r,schema:t})];case 1:_tmp=_.apply(n,[_state.sent()]);_state.label=2;case 2:_tmp;return[2]}})}).apply(this,arguments)}}))}function $t(_01){return _async_to_generator(function(param){var e,t,r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.provider,t=param.providerOptions,r=param.schema;if((t==null?void 0:t[e])==null)return[2];return[4,ta({value:t[e],schema:r})];case 1:n=_state.sent();if(!n.success)throw new il({argument:"providerOptions",message:"invalid ".concat(e," provider options"),cause:n.error});return[2,n.value]}})}).apply(this,arguments)}var aQe=function(){return globalThis.fetch},zt=function(param){var e=param.url,t=param.headers,r=param.body,n=param.failedResponseHandler,i=param.successfulResponseHandler,o=param.abortSignal,a=param.fetch;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Qle({url:e,headers:_object_spread({"Content-Type":"application/json"},t),body:{content:JSON.stringify(r),values:r},failedResponseHandler:n,successfulResponseHandler:i,abortSignal:o,fetch:a})];case 1:return[2,_state.sent()]}})})()},ul=function(param){var e=param.url,t=param.headers,r=param.formData,n=param.failedResponseHandler,i=param.successfulResponseHandler,o=param.abortSignal,a=param.fetch;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Qle({url:e,headers:t,body:{content:r,values:Object.fromEntries(r.entries())},failedResponseHandler:n,successfulResponseHandler:i,abortSignal:o,fetch:a})];case 1:return[2,_state.sent()]}})})()},Qle=function(param){var e=param.url,tmp=param.headers,t=tmp===void 0?{}:tmp,r=param.body,n=param.successfulResponseHandler,i=param.failedResponseHandler,o=param.abortSignal,tmp1=param.fetch,a=tmp1===void 0?aQe():tmp1;return _async_to_generator(function(){var _$s,l,_$c,d,c,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,10,,11]);return[4,a(e,{method:"POST",headers:Bi(t,"ai-sdk/provider-utils/".concat(Ble),j2()),body:r.content,signal:o})];case 1:_$s=_state.sent(),l=z2(_$s);if(!!_$s.ok)return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,i({response:_$s,url:e,requestBodyValues:r.values})];case 3:_$c=_state.sent();return[3,5];case 4:d=_state.sent();throw Kl(d)||Rr.isInstance(d)?d:new Rr({message:"Failed to process error response",cause:d,statusCode:_$s.status,url:e,responseHeaders:l,requestBodyValues:r.values});case 5:throw _$c.value;case 6:_state.trys.push([6,8,,9]);return[4,n({response:_$s,url:e,requestBodyValues:r.values})];case 7:return[2,_state.sent()];case 8:c=_state.sent();throw _instanceof(c,Error)&&(Kl(c)||Rr.isInstance(c))?c:new Rr({message:"Failed to process successful response",cause:c,statusCode:_$s.status,url:e,responseHeaders:l,requestBodyValues:r.values});case 9:return[3,11];case 10:s=_state.sent();throw Ule({error:s,url:e,requestBodyValues:r.values});case 11:return[2]}})})()};function iz(e){return _object_spread_props(_object_spread({},e),{type:"dynamic"})}function Yi(param){var e=param.id,t=param.inputSchema;return function(_01){var r=_01.execute,n=_01.outputSchema,i=_01.needsApproval,o=_01.toModelOutput,a=_01.onInputStart,s=_01.onInputDelta,l=_01.onInputAvailable,c=_object_without_properties(_01,["execute","outputSchema","needsApproval","toModelOutput","onInputStart","onInputDelta","onInputAvailable"]);return{type:"provider",isProviderExecuted:!1,id:e,args:c,inputSchema:t,outputSchema:n,execute:r,needsApproval:i,toModelOutput:o,onInputStart:a,onInputDelta:s,onInputAvailable:l}}}function Zd(param){var e=param.id,t=param.inputSchema,r=param.outputSchema;return function(_01){var n=_01.execute,i=_01.needsApproval,o=_01.toModelOutput,a=_01.onInputStart,s=_01.onInputDelta,l=_01.onInputAvailable,c=_object_without_properties(_01,["execute","needsApproval","toModelOutput","onInputStart","onInputDelta","onInputAvailable"]);return{type:"provider",isProviderExecuted:!1,id:e,args:c,inputSchema:t,outputSchema:r,execute:n,needsApproval:i,toModelOutput:o,onInputStart:a,onInputDelta:s,onInputAvailable:l}}}function tr(param){var e=param.id,t=param.inputSchema,r=param.outputSchema,n=param.supportsDeferredResults;return function(_01){var i=_01.onInputStart,o=_01.onInputDelta,a=_01.onInputAvailable,s=_object_without_properties(_01,["onInputStart","onInputDelta","onInputAvailable"]);return{type:"provider",isProviderExecuted:!0,id:e,args:s,inputSchema:t,outputSchema:r,onInputStart:i,onInputDelta:o,onInputAvailable:a,supportsDeferredResults:n}}}function Kt(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,(typeof e=="function"&&(e=e()),Promise.resolve(e))]})})()}function ai(param){var e=param.part;if(qu(e.mediaType))return e.mediaType;if(e.data.type==="data"){var t=ez({data:e.data.data,topLevelType:ea(e.mediaType)});if(t)return t;throw new or({functionality:'file of media type "'.concat(e.mediaType,'" must specify subtype since it could not be auto-detected')})}throw new or({functionality:'file of media type "'.concat(e.mediaType,'" must specify subtype since it is not passed as inline bytes')})}function ns(param){var e=param.reference,t=param.provider;var r=e[t];if(r!=null)return r;throw new DN({provider:t,reference:e})}var Jle=function(param){var tmp=param.maxRetries,e=tmp===void 0?2:tmp,tmp1=param.initialDelayInMs,t=tmp1===void 0?2e3:tmp1,tmp2=param.backoffFactor,r=tmp2===void 0?2:tmp2,n=param.abortSignal,i=param.shouldRetry,tmp3=param.getDelayInMs,o=tmp3===void 0?function(param){var s=param.exponentialBackoffDelay;return s}:tmp3,tmp4=param.createRetryError,a=tmp4===void 0?function(param){var s=param.message;return new Error(s)}:tmp4;return function(s){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Yle(s,{maxRetries:e,delayInMs:t,backoffFactor:r,abortSignal:n,shouldRetry:i,getDelayInMs:o,createRetryError:a})]})})()}};function Yle(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,a,s,l,c,d,u,p;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.maxRetries,r=param.delayInMs,n=param.backoffFactor,i=param.abortSignal,o=param.shouldRetry,a=param.getDelayInMs,s=param.createRetryError,l=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:[];_state.label=1;case 1:_state.trys.push([1,3,,7]);return[4,e()];case 2:return[2,_state.sent()];case 3:c=_state.sent();if(Kl(c)||t===0)throw c;d=xa(c),u=_to_consumable_array(l).concat([c]),p=u.length;if(p>t)throw s({message:"Failed after ".concat(p," attempts. Last error: ").concat(d),reason:"maxRetriesExceeded",errors:u});return[4,o(c)];case 4:if(!(_state.sent()&&p<=t))return[3,6];return[4,Bu(a({error:c,exponentialBackoffDelay:r}),{abortSignal:i})];case 5:return[2,(_state.sent(),Yle(e,{maxRetries:t,delayInMs:n*r,backoffFactor:n,abortSignal:i,shouldRetry:o,getDelayInMs:a,createRetryError:s},u))];case 6:throw p===1?c:s({message:"Failed after ".concat(p," attempts with non-retryable error: '").concat(d,"'"),reason:"errorNotRetryable",errors:u});case 7:return[2]}})}).apply(this,arguments)}var sQe=new TextDecoder;function Xle(_01){return _async_to_generator(function(param){var e,t,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.response,t=param.url;_=sQe.decode;return[4,lT({response:e,url:t})];case 1:return[2,_.apply(sQe,[_state.sent()])]}})}).apply(this,arguments)}var Vr=function(param){var e=param.errorSchema,t=param.errorToMessage,r=param.isRetryable;return function(param){var n=param.response,i=param.url,o=param.requestBodyValues;return _async_to_generator(function(){var a,s,l,l10;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Xle({response:n,url:i})];case 1:a=_state.sent(),s=z2(n);if(a.trim()==="")return[2,{responseHeaders:s,value:new Rr({message:n.statusText,url:i,requestBodyValues:o,statusCode:n.status,responseHeaders:s,responseBody:a,isRetryable:r==null?void 0:r(n)})}];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,nz({text:a,schema:e})];case 3:l=_state.sent();return[2,{responseHeaders:s,value:new Rr({message:t(l),url:i,requestBodyValues:o,statusCode:n.status,responseHeaders:s,responseBody:a,data:l,isRetryable:r==null?void 0:r(n,l)})}];case 4:l10=_state.sent();return[2,{responseHeaders:s,value:new Rr({message:n.statusText,url:i,requestBodyValues:o,statusCode:n.status,responseHeaders:s,responseBody:a,isRetryable:r==null?void 0:r(n)})}];case 5:return[2]}})})()}},Oo=function(e){return function(param){var t=param.response;return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){r=z2(t);if(t.body==null)throw new NN({});return[2,{responseHeaders:r,value:dT({stream:t.body,schema:e})}]})})()}},wt=function(e){return function(param){var t=param.response,r=param.url,n=param.requestBodyValues;return _async_to_generator(function(){var i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Xle({response:t,url:r})];case 1:i=_state.sent();return[4,Ji({text:i,schema:e})];case 2:o=_state.sent(),a=z2(t);if(!o.success)throw new Rr({message:"Invalid JSON response",cause:o.error,statusCode:t.status,responseHeaders:a,responseBody:i,url:r,requestBodyValues:n});return[2,{responseHeaders:a,value:o.value,rawValue:o.rawValue}]}})})()}},eue=function(){return function(param){var e=param.response,t=param.url,r=param.requestBodyValues;return _async_to_generator(function(){var n,_$i,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=z2(e);if(!e.body)throw new Rr({message:"Response body is empty",url:t,requestBodyValues:r,statusCode:e.status,responseHeaders:n,responseBody:void 0});_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.arrayBuffer()];case 2:_$i=_state.sent();return[2,{responseHeaders:n,value:new Uint8Array(_$i)}];case 3:i=_state.sent();throw new Rr({message:"Failed to read response as array buffer",url:t,requestBodyValues:r,statusCode:e.status,responseHeaders:n,responseBody:void 0,cause:i});case 4:return[2]}})})()}};function rT(e){if(e==null)return!0;var t=typeof e==="undefined"?"undefined":_type_of(e);return t==="string"||t==="number"||t==="boolean"?!0:t==="function"||t==="symbol"||t==="bigint"?!1:Array.isArray(e)?e.every(rT):Object.getPrototypeOf(e)===Object.prototype?Object.values(e).every(rT):!1}var tue="AI_SerializationError",rue="vercel.ai.error.".concat(tue),lQe=Symbol.for(rue),Rle,Mle,uQe=/*#__PURE__*/function(_superClass){"use strict";_inherits(uQe1,_superClass);function uQe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Failed to serialize value.":tmp,t=_ref.cause;_class_call_check(this,uQe1);var _this;_this=_call_super(this,uQe1,[{name:tue,message:e,cause:t}]),_this[Rle]=!0;return _this}_create_class(uQe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,rue)}}]);return uQe1}((Mle=Ze,Rle=lQe,Mle));function Sr(e){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e.config)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];if(r==="headers"){var i=cQe(n);rT(i)&&(t[r]=i)}else rT(n)&&(t[r]=n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{modelId:e.modelId,config:t}}function cQe(e){var t=e;if(typeof e=="function"&&(t=e()),_instanceof(t,Promise))throw new uQe({message:"Cannot serialize asynchronous model options."});return t}var pT=/*#__PURE__*/function(){"use strict";function pT1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_class_call_check(this,pT1);this.toolCalls=[];var r,n;this.controller=e,this._generateId=(r=t.generateId)!=null?r:Qr,this.typeValidation=(n=t.typeValidation)!=null?n:"none",this.extractMetadata=t.extractMetadata,this.buildToolCallProviderMetadata=t.buildToolCallProviderMetadata}_create_class(pT1,[{key:"processDelta",value:function processDelta(e){var t;var r=(t=e.index)!=null?t:this.toolCalls.length;this.toolCalls[r]==null?this.processNewToolCall(r,e):this.processExistingToolCall(r,e)}},{key:"flush",value:function flush(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.toolCalls[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var e=_step.value;e.hasFinished||this.finishToolCall(e)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"processNewToolCall",value:function processNewToolCall(e,t){var r,n,i;if(this.typeValidation==="required"){if(t.type!=="function")throw new ky({data:t,message:"Expected 'function' type."})}else if(this.typeValidation==="if-present"&&t.type!=null&&t.type!=="function")throw new ky({data:t,message:"Expected 'function' type."});if(t.id==null)throw new ky({data:t,message:"Expected 'id' to be a string."});if(((r=t.function)==null?void 0:r.name)==null)throw new ky({data:t,message:"Expected 'function.name' to be a string."});this.controller.enqueue({type:"tool-input-start",id:t.id,toolName:t.function.name});var o=(n=this.extractMetadata)==null?void 0:n.call(this,t);this.toolCalls[e]={id:t.id,type:"function",function:{name:t.function.name,arguments:(i=t.function.arguments)!=null?i:""},hasFinished:!1,metadata:o};var a=this.toolCalls[e];a.function.arguments.length>0&&this.controller.enqueue({type:"tool-input-delta",id:a.id,delta:a.function.arguments})}},{key:"processExistingToolCall",value:function processExistingToolCall(e,t){var r;var n=this.toolCalls[e];n.hasFinished||((r=t.function)==null?void 0:r.arguments)!=null&&(n.function.arguments+=t.function.arguments,this.controller.enqueue({type:"tool-input-delta",id:n.id,delta:t.function.arguments}))}},{key:"finishToolCall",value:function finishToolCall(e){var t,r;this.controller.enqueue({type:"tool-input-end",id:e.id});var n=(t=this.buildToolCallProviderMetadata)==null?void 0:t.call(this,e.metadata);this.controller.enqueue(_object_spread({type:"tool-call",toolCallId:(r=e.id)!=null?r:this._generateId(),toolName:e.function.name,input:e.function.arguments},n?{providerMetadata:n}:{})),e.hasFinished=!0}}]);return pT1}();var nue="transcription-stream.start",iue="transcription-stream.audio-done";function oue(e){var t;try{t=ll(e)}catch(n){return}if(t==null||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||Array.isArray(t))return;var r=t;switch(r.type){case"stream-start":return Array.isArray(r.warnings)&&r.warnings.every(dQe)?r:void 0;case"transcript-delta":return Mc(r.delta)&&Ma(r.id,Mc)&&Ma(r.providerMetadata,d0)?r:void 0;case"transcript-partial":return Mc(r.text)&&Ma(r.id,Mc)&&Ma(r.startSecond,ff)&&Ma(r.durationInSeconds,ff)&&Ma(r.channelIndex,ff)&&Ma(r.providerMetadata,d0)?r:void 0;case"transcript-final":return Mc(r.text)&&Ma(r.id,Mc)&&Ma(r.startSecond,ff)&&Ma(r.endSecond,ff)&&Ma(r.channelIndex,ff)&&Ma(r.providerMetadata,d0)?r:void 0;case"finish":return Mc(r.text)&&Array.isArray(r.segments)&&r.segments.every(pQe)&&Ma(r.language,Mc)&&Ma(r.durationInSeconds,ff)&&Ma(r.providerMetadata,d0)?r:void 0;case"response-metadata":{if(!(Ma(r.modelId,Mc)&&Ma(r.headers,d0)))return;var n=r.timestamp;if(n==null)return _object_spread_props(_object_spread({},r),{timestamp:void 0});if(typeof n!="string")return;var i=new Date(n);return Number.isNaN(i.getTime())?void 0:_object_spread_props(_object_spread({},r),{timestamp:i})}case"raw":return"rawValue"in r?r:void 0;case"error":return"error"in r?r:void 0;default:return}}function Mc(e){return typeof e=="string"}function ff(e){return typeof e=="number"}function Ma(e,t){return e===void 0||t(e)}function d0(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!=null&&!Array.isArray(e)}function dQe(e){return d0(e)&&Mc(e.type)}function pQe(e){return d0(e)&&Mc(e.text)&&ff(e.startSecond)&&ff(e.endSecond)}function fT(e){if((e==null?void 0:e.trim())==="")throw new il({argument:"baseURL",message:"baseURL must be a non-empty string."});return e}function Kd(e){return e==null?void 0:e.replace(/\/$/,"")}function mT(e){return e!=null&&typeof e.execute=="function"}function fQe(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}function aue(_01){return _wrap_async_generator(function(param){var e,t,r,n,i,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,o,err,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.tool,t=param.input,r=param.options;n=e.execute(t,r);if(!fQe(n))return[3,15];_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=1;case 1:_state.trys.push([1,7,8,13]);_iterator=_async_iterator(n);_state.label=2;case 2:return[4,_await_async_generator(_iterator.next())];case 3:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,6];_value=_step.value;o=_value;i=o;return[4,{type:"preliminary",output:o}];case 4:_state.sent();_state.label=5;case 5:_iteratorAbruptCompletion=false;return[3,2];case 6:return[3,13];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 8:_state.trys.push([8,,11,12]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,10];return[4,_await_async_generator(_iterator.return())];case 9:_state.sent();_state.label=10;case 10:return[3,12];case 11:if(_didIteratorError){throw _iteratorError}return[7];case 12:return[7];case 13:return[4,{type:"final",output:i}];case 14:_state.sent();return[3,18];case 15:_tmp={type:"final"};return[4,_await_async_generator(n)];case 16:return[4,(_tmp.output=_state.sent(),_tmp)];case 17:_state.sent();_state.label=18;case 18:return[2]}})}).apply(this,arguments)}var bce=nr(cz(),1),wce=nr(cz(),1),LQe="ai-gateway-realtime.v1",tce="ai-gateway-transcription.v1",FQe="ai-gateway-auth.",zQe="ai-gateway-team.";function jQe(e,t){return rce(LQe,e,t)}function UQe(e,t){return rce(tce,e,t)}function rce(e,t,r){var n=[e,"".concat(FQe).concat(t)];return r!=null&&r.teamIdOrSlug&&n.push("".concat(zQe).concat(BQe(r.teamIdOrSlug))),n}function BQe(e){var t=new TextEncoder().encode(e),r="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;r+=String.fromCharCode(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(RegExp("=+$","u"),"")}var qQe="vercel.ai.gateway.error",dz=Symbol.for(qQe),xue,yue,ho=/*#__PURE__*/function(_superClass){"use strict";_inherits(nce,_superClass);function nce(param){var t=param.message,tmp=param.statusCode,r=tmp===void 0?500:tmp,n=param.cause,i=param.generationId,tmp1=param.isRetryable,o=tmp1===void 0?r!=null&&(r===408||r===409||r===429||r>=500):tmp1;_class_call_check(this,nce);var _this;_this=_call_super(this,nce,[i?"".concat(t," [").concat(i,"]"):t]),_this[xue]=!0,_this.statusCode=r,_this.cause=n,_this.generationId=i,_this.isRetryable=o;return _this}_create_class(nce,null,[{key:"isInstance",value:function isInstance(t){return nce.hasMarker(t)}},{key:"hasMarker",value:function hasMarker(t){return(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&t!==null&&dz in t&&t[dz]===!0}}]);return nce}((yue=Error,xue=dz,yue)),ice="GatewayAuthenticationError",WQe="vercel.ai.gateway.error.".concat(ice),vue=Symbol.for(WQe),_ue,bue,t6=/*#__PURE__*/function(_superClass){"use strict";_inherits(oce,_superClass);function oce(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,t=tmp===void 0?"Authentication failed":tmp,tmp1=_ref.statusCode,r=tmp1===void 0?401:tmp1,n=_ref.cause,i=_ref.generationId;_class_call_check(this,oce);var _this;_this=_call_super(this,oce,[{message:t,statusCode:r,cause:n,generationId:i}]),_this[_ue]=!0,_this.name=ice,_this.type="authentication_error";return _this}_create_class(oce,null,[{key:"isInstance",value:function isInstance(t){return ho.hasMarker(t)&&vue in t}},{key:"createContextualError",value:function createContextualError(param){var t=param.apiKeyProvided,r=param.oidcTokenProvided,tmp=param.statusCode,n=tmp===void 0?401:tmp,i=param.cause,o=param.generationId;var a;return t?a="AI Gateway authentication failed: Invalid API key or token.\n\nCreate a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\n\nProvide an API key or Vercel access token via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.":r?a="AI Gateway authentication failed: Invalid OIDC token.\n\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.\n\nAlternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nor pass a Vercel access token via the 'apiKey' option.":a="AI Gateway authentication failed: No authentication provided.\n\nOption 1 - API key:\nCreate an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.\n\nOption 2 - Vercel access token:\nPass a Vercel personal access token or Vercel app access token via the 'apiKey' option.\n\nOption 3 - OIDC token:\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.",new oce({message:a,statusCode:n,cause:i,generationId:o})}}]);return oce}((bue=ho,_ue=vue,bue)),ace="GatewayInvalidRequestError",VQe="vercel.ai.gateway.error.".concat(ace),wue=Symbol.for(VQe),Sue,kue,GQe=/*#__PURE__*/function(_superClass){"use strict";_inherits(GQe1,_superClass);function GQe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Invalid request":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?400:tmp1,r=_ref.cause,n=_ref.generationId;_class_call_check(this,GQe1);var _this;_this=_call_super(this,GQe1,[{message:e,statusCode:t,cause:r,generationId:n}]),_this[Sue]=!0,_this.name=ace,_this.type="invalid_request_error";return _this}_create_class(GQe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&wue in e}}]);return GQe1}((kue=ho,Sue=wue,kue)),sce="GatewayRateLimitError",HQe="vercel.ai.gateway.error.".concat(sce),Cue=Symbol.for(HQe),Eue,Tue,ZQe=/*#__PURE__*/function(_superClass){"use strict";_inherits(ZQe1,_superClass);function ZQe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Rate limit exceeded":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?429:tmp1,r=_ref.cause,n=_ref.generationId;_class_call_check(this,ZQe1);var _this;_this=_call_super(this,ZQe1,[{message:e,statusCode:t,cause:r,generationId:n}]),_this[Eue]=!0,_this.name=sce,_this.type="rate_limit_exceeded";return _this}_create_class(ZQe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Cue in e}}]);return ZQe1}((Tue=ho,Eue=Cue,Tue)),lce="GatewayModelNotFoundError",KQe="vercel.ai.gateway.error.".concat(lce),Aue=Symbol.for(KQe),QQe=ne(function(){return te(f.object({modelId:f.string()}))}),Iue,Pue,JQe=/*#__PURE__*/function(_superClass){"use strict";_inherits(JQe1,_superClass);function JQe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Model not found":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?404:tmp1,r=_ref.modelId,n=_ref.cause,i=_ref.generationId;_class_call_check(this,JQe1);var _this;_this=_call_super(this,JQe1,[{message:e,statusCode:t,cause:n,generationId:i}]),_this[Iue]=!0,_this.name=lce,_this.type="model_not_found",_this.modelId=r;return _this}_create_class(JQe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Aue in e}}]);return JQe1}((Pue=ho,Iue=Aue,Pue)),uce="GatewayInternalServerError",YQe="vercel.ai.gateway.error.".concat(uce),Rue=Symbol.for(YQe),Mue,Oue,$ue=/*#__PURE__*/function(_superClass){"use strict";_inherits($ue1,_superClass);function $ue1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Internal server error":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?500:tmp1,r=_ref.cause,n=_ref.generationId;_class_call_check(this,$ue1);var _this;_this=_call_super(this,$ue1,[{message:e,statusCode:t,cause:r,generationId:n}]),_this[Mue]=!0,_this.name=uce,_this.type="internal_server_error";return _this}_create_class($ue1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Rue in e}}]);return $ue1}((Oue=ho,Mue=Rue,Oue)),cce="GatewayFailedDependencyError",XQe="vercel.ai.gateway.error.".concat(cce),Nue=Symbol.for(XQe),Due,Lue,eJe=/*#__PURE__*/function(_superClass){"use strict";_inherits(eJe1,_superClass);function eJe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Failed dependency":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?424:tmp1,r=_ref.cause,n=_ref.generationId;_class_call_check(this,eJe1);var _this;_this=_call_super(this,eJe1,[{message:e,statusCode:t,cause:r,generationId:n}]),_this[Due]=!0,_this.name=cce,_this.type="failed_dependency";return _this}_create_class(eJe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Nue in e}}]);return eJe1}((Lue=ho,Due=Nue,Lue)),dce="GatewayForbiddenError",tJe="vercel.ai.gateway.error.".concat(dce),Fue=Symbol.for(tJe),rJe=ne(function(){return te(f.object({ruleId:f.string()}))}),zue,jue,nJe=/*#__PURE__*/function(_superClass){"use strict";_inherits(nJe1,_superClass);function nJe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Forbidden":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?403:tmp1,r=_ref.cause,n=_ref.generationId,i=_ref.ruleId;_class_call_check(this,nJe1);var _this;_this=_call_super(this,nJe1,[{message:e,statusCode:t,cause:r,generationId:n}]),_this[zue]=!0,_this.name=dce,_this.type="forbidden",_this.ruleId=i;return _this}_create_class(nJe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Fue in e}}]);return nJe1}((jue=ho,zue=Fue,jue)),pce="GatewayResponseError",iJe="vercel.ai.gateway.error.".concat(pce),Uue=Symbol.for(iJe),Bue,que,oJe=/*#__PURE__*/function(_superClass){"use strict";_inherits(oJe1,_superClass);function oJe1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"Invalid response from Gateway":tmp,tmp1=_ref.statusCode,t=tmp1===void 0?502:tmp1,r=_ref.response,n=_ref.validationError,i=_ref.cause,o=_ref.generationId;_class_call_check(this,oJe1);var _this;_this=_call_super(this,oJe1,[{message:e,statusCode:t,cause:i,generationId:o}]),_this[Bue]=!0,_this.name=pce,_this.type="response_error",_this.response=r,_this.validationError=n;return _this}_create_class(oJe1,null,[{key:"isInstance",value:function isInstance(e){return ho.hasMarker(e)&&Uue in e}}]);return oJe1}((que=ho,Bue=Uue,que));function fz(_01){return _async_to_generator(function(param){var e,t,tmp,r,n,i,o,a,u,s,l,c,d,u10,u11;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.response,t=param.statusCode,tmp=param.defaultMessage,r=tmp===void 0?"Gateway request failed":tmp,n=param.cause,i=param.authMethod;return[4,ta({value:e,schema:aJe})];case 1:a=_state.sent();if(!a.success){u=(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&"generationId"in e?e.generationId:void 0;return[2,new oJe({message:"Invalid error response format: ".concat(r),statusCode:t,response:e,validationError:a.error,cause:n,generationId:u})]}s=a.value,l=s.error.type,c=s.error.message,d=(o=s.generationId)!=null?o:void 0;switch(l){case"authentication_error":return[3,2];case"invalid_request_error":return[3,3];case"rate_limit_exceeded":return[3,4];case"model_not_found":return[3,5];case"internal_server_error":return[3,7];case"failed_dependency":return[3,8];case"forbidden":return[3,9]}return[3,11];case 2:return[2,t6.createContextualError({apiKeyProvided:i==="api-key",oidcTokenProvided:i==="oidc",statusCode:t,cause:n,generationId:d})];case 3:return[2,new GQe({message:c,statusCode:t,cause:n,generationId:d})];case 4:return[2,new ZQe({message:c,statusCode:t,cause:n,generationId:d})];case 5:return[4,ta({value:s.error.param,schema:QQe})];case 6:u10=_state.sent();return[2,new JQe({message:c,statusCode:t,modelId:u10.success?u10.value.modelId:void 0,cause:n,generationId:d})];case 7:return[2,new $ue({message:c,statusCode:t,cause:n,generationId:d})];case 8:return[2,new eJe({message:c,statusCode:t,cause:n,generationId:d})];case 9:return[4,ta({value:s.error.param,schema:rJe})];case 10:u11=_state.sent();return[2,new nJe({message:c,statusCode:t,cause:n,generationId:d,ruleId:u11.success?u11.value.ruleId:void 0})];case 11:return[2,new $ue({message:c,statusCode:t,cause:n,generationId:d})];case 12:return[2]}})}).apply(this,arguments)}var aJe=ne(function(){return te(f.object({error:f.object({message:f.string(),type:f.string().nullish(),param:f.unknown().nullish(),code:f.union([f.string(),f.number()]).nullish()}),generationId:f.string().nullish()}))});function sJe(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return ll(e.responseBody)}catch(t){return e.responseBody}return{}}var fce="GatewayTimeoutError",lJe="vercel.ai.gateway.error.".concat(fce),Wue=Symbol.for(lJe),Vue,Gue,Hue=/*#__PURE__*/function(_superClass){"use strict";_inherits(mce,_superClass);function mce(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,t=tmp===void 0?"Request timed out":tmp,tmp1=_ref.statusCode,r=tmp1===void 0?408:tmp1,n=_ref.cause,i=_ref.generationId;_class_call_check(this,mce);var _this;_this=_call_super(this,mce,[{message:t,statusCode:r,cause:n,generationId:i}]),_this[Vue]=!0,_this.name=fce,_this.type="timeout_error";return _this}_create_class(mce,null,[{key:"isInstance",value:function isInstance(t){return ho.hasMarker(t)&&Wue in t}},{key:"createTimeoutError",value:function createTimeoutError(param){var t=param.originalMessage,tmp=param.statusCode,r=tmp===void 0?408:tmp,n=param.cause,i=param.generationId;var o="Gateway request timed out: ".concat(t,"\n\n This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js");return new mce({message:o,statusCode:r,cause:n,generationId:i})}}]);return mce}((Gue=ho,Vue=Wue,Gue));function Zue(e){if(!_instanceof(e,Error))return!1;var t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}function _a(e,t){return _async_to_generator(function(){var r,_tmp,_tmp1,_tmp2,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!ho.isInstance(e))return[3,1];_tmp=e;return[3,10];case 1:if(!Zue(e))return[3,2];_tmp1=Hue.createTimeoutError({originalMessage:_instanceof(e,Error)?e.message:"Unknown error",cause:e});return[3,9];case 2:if(!Rr.isInstance(e))return[3,6];if(!(e.cause&&Zue(e.cause)))return[3,3];_tmp3=Hue.createTimeoutError({originalMessage:e.message,cause:e});return[3,5];case 3:return[4,fz({response:sJe(e),statusCode:(r=e.statusCode)!=null?r:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t})];case 4:_tmp3=_state.sent();_state.label=5;case 5:_tmp2=_tmp3;return[3,8];case 6:return[4,fz({response:{},statusCode:500,defaultMessage:_instanceof(e,Error)?"Gateway request failed: ".concat(e.message):"Unknown Gateway error",cause:e,authMethod:t})];case 7:_tmp2=_state.sent();_state.label=8;case 8:_tmp1=_tmp2;_state.label=9;case 9:_tmp=_tmp1;_state.label=10;case 10:return[2,_tmp]}})})()}var hce="ai-gateway-auth-method",gce="x-vercel-ai-gateway-team";function cl(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,ta({value:e[hce],schema:uJe})];case 1:t=_state.sent();return[2,t.success?t.value:void 0]}})})()}var uJe=ne(function(){return te(f.union([f.literal("api-key"),f.literal("oidc")]))}),cJe=["embedding","image","language","realtime","reranking","speech","transcription","video"],Kue=/*#__PURE__*/function(){"use strict";function Kue1(e){_class_call_check(this,Kue1);this.config=e}_create_class(Kue1,[{key:"getAvailableModels",value:function getAvailableModels(){return _async_to_generator(function(){var _ref,_$e1,_tmp,_tmp1,e;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,7]);_tmp={url:"".concat(this.config.baseURL,"/config"),validateUrl:!1};if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp1=_state.sent();return[3,3];case 2:_tmp1=void 0;_state.label=3;case 3:return[4,$a.apply(void 0,[(_tmp.headers=_tmp1,_tmp.successfulResponseHandler=wt(dJe),_tmp.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(t){return t}}),_tmp.fetch=this.config.fetch,_tmp)])];case 4:_ref=_state.sent(),_$e1=_ref.value;return[2,_$e1];case 5:e=_state.sent();return[4,_a(e)];case 6:throw _state.sent();case 7:return[2]}})}).call(this)}},{key:"getCredits",value:function getCredits(){return _async_to_generator(function(){var _$e1,_ref,t,_tmp,_tmp1,e;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,7]);_$e1=new URL(this.config.baseURL);_tmp={url:"".concat(_$e1.origin,"/v1/credits"),validateUrl:!1};if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp1=_state.sent();return[3,3];case 2:_tmp1=void 0;_state.label=3;case 3:return[4,$a.apply(void 0,[(_tmp.headers=_tmp1,_tmp.successfulResponseHandler=wt(pJe),_tmp.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(r){return r}}),_tmp.fetch=this.config.fetch,_tmp)])];case 4:_ref=_state.sent(),t=_ref.value;return[2,t];case 5:e=_state.sent();return[4,_a(e)];case 6:throw _state.sent();case 7:return[2]}})}).call(this)}}]);return Kue1}(),dJe=ne(function(){return te(f.object({models:f.array(f.object({id:f.string(),name:f.string(),description:f.string().nullish(),pricing:f.object({input:f.string(),output:f.string(),input_cache_read:f.string().nullish(),input_cache_write:f.string().nullish()}).transform(function(param){var e=param.input,t=param.output,r=param.input_cache_read,n=param.input_cache_write;return _object_spread({input:e,output:t},r?{cachedInputTokens:r}:{},n?{cacheCreationInputTokens:n}:{})}).nullish(),specification:f.object({specificationVersion:f.literal("v4"),provider:f.string(),modelId:f.string()}),modelType:f.string().nullish()})).transform(function(e){return e.filter(function(t){return t.modelType==null||cJe.includes(t.modelType)})})}))}),pJe=ne(function(){return te(f.object({balance:f.string(),total_used:f.string()}).transform(function(param){var e=param.balance,t=param.total_used;return{balance:e,totalUsed:t}}))}),fJe=/*#__PURE__*/function(){"use strict";function fJe1(e){_class_call_check(this,fJe1);this.config=e}_create_class(fJe1,[{key:"getSpendReport",value:function getSpendReport(e){return _async_to_generator(function(){var _$t,r,_ref,n,_tmp,_tmp1,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,7]);_$t=new URL(this.config.baseURL),r=new URLSearchParams;r.set("start_date",e.startDate),r.set("end_date",e.endDate),e.groupBy&&r.set("group_by",e.groupBy),e.datePart&&r.set("date_part",e.datePart),e.userId&&r.set("user_id",e.userId),e.model&&r.set("model",e.model),e.provider&&r.set("provider",e.provider),e.credentialType&&r.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&r.set("tags",e.tags.join(","));_tmp={url:"".concat(_$t.origin,"/v1/report?").concat(r.toString()),validateUrl:!1};if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp1=_state.sent();return[3,3];case 2:_tmp1=void 0;_state.label=3;case 3:return[4,$a.apply(void 0,[(_tmp.headers=_tmp1,_tmp.successfulResponseHandler=wt(mJe),_tmp.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(i){return i}}),_tmp.fetch=this.config.fetch,_tmp)])];case 4:_ref=_state.sent(),n=_ref.value;return[2,n];case 5:t=_state.sent();return[4,_a(t)];case 6:throw _state.sent();case 7:return[2]}})}).call(this)}}]);return fJe1}(),mJe=ne(function(){return te(f.object({results:f.array(f.object({day:f.string().optional(),hour:f.string().optional(),user:f.string().optional(),model:f.string().optional(),tag:f.string().optional(),provider:f.string().optional(),credential_type:f.enum(["byok","system"]).optional(),total_cost:f.number(),market_cost:f.number().optional(),input_tokens:f.number().optional(),output_tokens:f.number().optional(),cached_input_tokens:f.number().optional(),cache_creation_input_tokens:f.number().optional(),reasoning_tokens:f.number().optional(),request_count:f.number().optional()}).transform(function(_01){var e=_01.credential_type,t=_01.total_cost,r=_01.market_cost,n=_01.input_tokens,i=_01.output_tokens,o=_01.cached_input_tokens,a=_01.cache_creation_input_tokens,s=_01.reasoning_tokens,l=_01.request_count,c=_object_without_properties(_01,["credential_type","total_cost","market_cost","input_tokens","output_tokens","cached_input_tokens","cache_creation_input_tokens","reasoning_tokens","request_count"]);return _object_spread(_object_spread_props(_object_spread({},c,e!==void 0?{credentialType:e}:{}),{totalCost:t}),r!==void 0?{marketCost:r}:{},n!==void 0?{inputTokens:n}:{},i!==void 0?{outputTokens:i}:{},o!==void 0?{cachedInputTokens:o}:{},a!==void 0?{cacheCreationInputTokens:a}:{},s!==void 0?{reasoningTokens:s}:{},l!==void 0?{requestCount:l}:{})}))}))}),hJe=/*#__PURE__*/function(){"use strict";function hJe1(e){_class_call_check(this,hJe1);this.config=e}_create_class(hJe1,[{key:"getGenerationInfo",value:function getGenerationInfo(e){return _async_to_generator(function(){var _$t,_ref,r,_tmp,_tmp1,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,7]);_$t=new URL(this.config.baseURL);_tmp={url:"".concat(_$t.origin,"/v1/generation?id=").concat(encodeURIComponent(e.id)),validateUrl:!1};if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp1=_state.sent();return[3,3];case 2:_tmp1=void 0;_state.label=3;case 3:return[4,$a.apply(void 0,[(_tmp.headers=_tmp1,_tmp.successfulResponseHandler=wt(gJe),_tmp.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(n){return n}}),_tmp.fetch=this.config.fetch,_tmp)])];case 4:_ref=_state.sent(),r=_ref.value;return[2,r];case 5:t=_state.sent();return[4,_a(t)];case 6:throw _state.sent();case 7:return[2]}})}).call(this)}}]);return hJe1}(),gJe=ne(function(){return te(f.object({data:f.object({id:f.string(),total_cost:f.number(),upstream_inference_cost:f.number(),usage:f.number(),created_at:f.string(),model:f.string(),is_byok:f.boolean(),provider_name:f.string(),streamed:f.boolean(),finish_reason:f.string(),latency:f.number(),generation_time:f.number(),native_tokens_prompt:f.number(),native_tokens_completion:f.number(),native_tokens_reasoning:f.number(),native_tokens_cached:f.number(),native_tokens_cache_creation:f.number(),billable_web_search_calls:f.number()}).transform(function(_01){var e=_01.total_cost,t=_01.upstream_inference_cost,r=_01.created_at,n=_01.is_byok,i=_01.provider_name,o=_01.finish_reason,a=_01.generation_time,s=_01.native_tokens_prompt,l=_01.native_tokens_completion,c=_01.native_tokens_reasoning,d=_01.native_tokens_cached,u=_01.native_tokens_cache_creation,p=_01.billable_web_search_calls,m=_object_without_properties(_01,["total_cost","upstream_inference_cost","created_at","is_byok","provider_name","finish_reason","generation_time","native_tokens_prompt","native_tokens_completion","native_tokens_reasoning","native_tokens_cached","native_tokens_cache_creation","billable_web_search_calls"]);return _object_spread_props(_object_spread({},m),{totalCost:e,upstreamInferenceCost:t,createdAt:r,isByok:n,providerName:i,finishReason:o,generationTime:a,promptTokens:s,completionTokens:l,reasoningTokens:c,cachedTokens:d,cacheCreationTokens:u,billableWebSearchCalls:p})})}).transform(function(param){var e=param.data;return e}))}),xJe=/*#__PURE__*/function(){"use strict";function xce(t,r){_class_call_check(this,xce);this.modelId=t,this.config=r,this.specificationVersion="v4",this.supportedUrls={"*/*":[/.*/]}}_create_class(xce,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=t.abortSignal,n=_object_without_properties(t,["abortSignal"]);return[2,{args:this.maybeEncodeFileParts(n),warnings:[]}]})}).call(this)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var _ref,r,n,i,o,_tmp,_ref1,_$a,s,l,_tmp1,_tmp2,a,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),r=_ref.args,n=_ref.warnings,i=t.abortSignal;if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:o=_tmp;_state.label=5;case 5:_state.trys.push([5,8,,11]);_tmp1={url:this.getUrl()};_tmp2=[o,t.headers,this.getModelConfigHeaders(this.modelId,!1)];return[4,Kt(this.config.o11yHeaders)];case 6:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=r,_tmp1.successfulResponseHandler=wt(f.any()),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(c){return c}}),_tmp1),i&&{abortSignal:i}]),{fetch:this.config.fetch}])])];case 7:_ref1=_state.sent(),_$a=_ref1.responseHeaders,s=_ref1.value,l=_ref1.rawValue;return[2,_object_spread_props(_object_spread({},s),{request:{body:r},response:{headers:_$a,body:l},warnings:n})];case 8:a=_state.sent();_tmp3=[a];return[4,cl(o!=null?o:{})];case 9:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 10:throw _state.sent();case 11:return[2]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var _ref,r,n,i,o,_tmp,_ref1,_$a,s,_tmp1,_tmp2,a,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),r=_ref.args,n=_ref.warnings,i=t.abortSignal;if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:o=_tmp;_state.label=5;case 5:_state.trys.push([5,8,,11]);_tmp1={url:this.getUrl()};_tmp2=[o,t.headers,this.getModelConfigHeaders(this.modelId,!0)];return[4,Kt(this.config.o11yHeaders)];case 6:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=r,_tmp1.successfulResponseHandler=Oo(f.any()),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(l){return l}}),_tmp1),i&&{abortSignal:i}]),{fetch:this.config.fetch}])])];case 7:_ref1=_state.sent(),_$a=_ref1.value,s=_ref1.responseHeaders;return[2,{stream:_$a.pipeThrough(new TransformStream({start:function start(l){n.length>0&&l.enqueue({type:"stream-start",warnings:n})},transform:function transform(l,c){if(l.success){var d=l.value;if(d.type==="raw"&&!t.includeRawChunks)return;d.type==="response-metadata"&&d.timestamp&&typeof d.timestamp=="string"&&(d.timestamp=new Date(d.timestamp)),c.enqueue(d)}else c.error(l.error)}})),request:{body:r},response:{headers:s}}];case 8:a=_state.sent();_tmp3=[a];return[4,cl(o!=null?o:{})];case 9:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 10:throw _state.sent();case 11:return[2]}})}).call(this)}},{key:"maybeEncodeFileParts",value:function maybeEncodeFileParts(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.prompt[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(Array.isArray(r.content)){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined,_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator1=r.content[Symbol.iterator](),_step1;!(_iteratorNormalCompletion2=(_step1=_iterator1.next()).done);_iteratorNormalCompletion2=true){var n=_step1.value;if(n.type==="file"||n.type==="reasoning-file")n.data=Que(n.data);else if(n.type==="tool-result"&&n.output.type==="content")try{for(var _iterator2=n.output.value[Symbol.iterator](),_step2;!(_iteratorNormalCompletion1=(_step2=_iterator2.next()).done);_iteratorNormalCompletion1=true){var i=_step2.value;i.type==="file"&&(i.data=Que(i.data))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/language-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(t,r){return{"ai-language-model-specification-version":"4","ai-language-model-id":t,"ai-language-model-streaming":String(r)}}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new xce(t.modelId,t.config)}}]);return xce}();function Que(e){if(e.type==="data"){var t=e.data;if(_instanceof(t,Uint8Array))return _object_spread_props(_object_spread({},e),{data:Buffer.from(t).toString("base64")})}return e}var yJe=/*#__PURE__*/function(){"use strict";function yce(t,r){_class_call_check(this,yce);this.modelId=t,this.config=r,this.specificationVersion="v4",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}_create_class(yce,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doEmbed",value:function doEmbed(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,_tmp,_ref,_$l,c,d,_tmp1,_tmp2,l,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.values,r=param.headers,n=param.abortSignal,i=param.providerOptions;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:s=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[s,r!=null?r:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=_object_spread({values:t},i?{providerOptions:i}:{}),_tmp1.successfulResponseHandler=wt(_Je),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(u){return u}}),_tmp1),n&&{abortSignal:n}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$l=_ref.responseHeaders,c=_ref.value,d=_ref.rawValue;return[2,{embeddings:c.embeddings,usage:(o=c.usage)!=null?o:void 0,providerMetadata:c.providerMetadata,response:{headers:_$l,body:d},warnings:(a=c.warnings)!=null?a:[]}];case 7:l=_state.sent();_tmp3=[l];return[4,cl(s!=null?s:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/embedding-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"4","ai-model-id":this.modelId}}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new yce(t.modelId,t.config)}}]);return yce}(),vJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),_Je=ne(function(){return te(f.object({embeddings:f.array(f.array(f.number())),usage:f.object({tokens:f.number()}).nullish(),warnings:f.array(vJe).optional(),providerMetadata:f.record(f.string(),f.record(f.string(),f.unknown())).optional()}))}),bJe=/*#__PURE__*/function(){"use strict";function vce(t,r){_class_call_check(this,vce);this.modelId=t,this.config=r,this.specificationVersion="v4",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}_create_class(vce,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,_tmp,_ref,_$x,v,_tmp1,_tmp2,x,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.n,n=param.size,i=param.aspectRatio,o=param.seed,a=param.files,s=param.mask,l=param.providerOptions,c=param.headers,d=param.abortSignal;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:g=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[g,c!=null?c:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=_object_spread({prompt:t,n:r},n&&{size:n},i&&{aspectRatio:i},o&&{seed:o},l&&{providerOptions:l},a&&{files:a.map(function(y){return Jue(y)})},s&&{mask:Jue(s)}),_tmp1.successfulResponseHandler=wt(CJe),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(y){return y}}),_tmp1),d&&{abortSignal:d}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$x=_ref.responseHeaders,v=_ref.value;return[2,_object_spread({images:v.images,warnings:(u=v.warnings)!=null?u:[],providerMetadata:v.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:_$x}},v.usage!=null&&{usage:{inputTokens:(p=v.usage.inputTokens)!=null?p:void 0,outputTokens:(m=v.usage.outputTokens)!=null?m:void 0,totalTokens:(h=v.usage.totalTokens)!=null?h:void 0}})];case 7:x=_state.sent();_tmp3=[x];return[4,cl(g!=null?g:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/image-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-image-model-specification-version":"4","ai-model-id":this.modelId}}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new vce(t.modelId,t.config)}}]);return vce}();function Jue(e){return e.type==="file"&&_instanceof(e.data,Uint8Array)?_object_spread_props(_object_spread({},e),{data:Jl(e.data)}):e}var wJe=f.object({images:f.array(f.unknown()).optional()}).catchall(f.unknown()),SJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),kJe=f.object({inputTokens:f.number().nullish(),outputTokens:f.number().nullish(),totalTokens:f.number().nullish()}),CJe=f.object({images:f.array(f.string()),warnings:f.array(SJe).optional(),providerMetadata:f.record(f.string(),wJe).optional(),usage:kJe.optional()}),EJe=/*#__PURE__*/function(){"use strict";function EJe1(e,t){_class_call_check(this,EJe1);this.modelId=e,this.config=t,this.specificationVersion="v4",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}_create_class(EJe1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,_tmp,_ref,_$x,v,_tmp1,_tmp2,x,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.prompt,t=param.n,r=param.aspectRatio,n=param.resolution,i=param.duration,o=param.fps,a=param.seed,s=param.generateAudio,l=param.image,c=param.frameImages,d=param.inputReferences,u=param.providerOptions,p=param.headers,m=param.abortSignal;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:g=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[g,p!=null?p:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent(),{accept:"text/event-stream"}])),_tmp1.body=_object_spread({prompt:e,n:t},r&&{aspectRatio:r},n&&{resolution:n},i&&{duration:i},o&&{fps:o},a&&{seed:a},s!==void 0&&{generateAudio:s},u&&{providerOptions:u},l&&{image:pz(l)},c&&{frameImages:c.map(function(y){return _object_spread_props(_object_spread({},y),{image:pz(y.image)})})},d&&{inputReferences:d.map(function(y){return pz(y)})}),_tmp1.successfulResponseHandler=function(param){var y=param.response,_=param.url,b=param.requestBodyValues;return _async_to_generator(function(){var S,_ref,k,E,C;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(y.body==null)throw new Rr({message:"SSE response body is empty",url:_,requestBodyValues:b,statusCode:y.status});S=dT({stream:y.body,schema:PJe}).getReader();return[4,S.read()];case 1:_ref=_state.sent(),k=_ref.done,E=_ref.value;if(S.releaseLock(),k||!E)throw new Rr({message:"SSE stream ended without a data event",url:_,requestBodyValues:b,statusCode:y.status});if(!E.success)throw new Rr({message:"Failed to parse video SSE event",cause:E.error,url:_,requestBodyValues:b,statusCode:y.status});C=E.value;if(C.type==="error")throw new Rr({message:C.message,statusCode:C.statusCode,url:_,requestBodyValues:b,responseHeaders:Object.fromEntries(_to_consumable_array(y.headers)),responseBody:JSON.stringify(C),data:{error:{message:C.message,type:C.errorType,param:C.param}}});return[2,{value:{videos:C.videos,warnings:C.warnings,providerMetadata:C.providerMetadata},responseHeaders:Object.fromEntries(_to_consumable_array(y.headers))}]}})})()},_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(y){return y}}),_tmp1),m&&{abortSignal:m}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$x=_ref.responseHeaders,v=_ref.value;return[2,{videos:v.videos,warnings:(h=v.warnings)!=null?h:[],providerMetadata:v.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:_$x}}];case 7:x=_state.sent();_tmp3=[x];return[4,cl(g!=null?g:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/video-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-video-model-specification-version":"4","ai-model-id":this.modelId}}}]);return EJe1}();function pz(e){return e.type==="file"&&_instanceof(e.data,Uint8Array)?_object_spread_props(_object_spread({},e),{data:Jl(e.data)}):e}var TJe=f.object({videos:f.array(f.unknown()).optional()}).catchall(f.unknown()),AJe=f.union([f.object({type:f.literal("url"),url:f.string(),mediaType:f.string()}),f.object({type:f.literal("base64"),data:f.string(),mediaType:f.string()})]),IJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),PJe=f.discriminatedUnion("type",[f.object({type:f.literal("result"),videos:f.array(AJe),warnings:f.array(IJe).optional(),providerMetadata:f.record(f.string(),TJe).optional()}),f.object({type:f.literal("error"),message:f.string(),errorType:f.string(),statusCode:f.number(),param:f.unknown().nullable()})]),RJe=/*#__PURE__*/function(){"use strict";function RJe1(e,t){_class_call_check(this,RJe1);this.modelId=e,this.config=t,this.specificationVersion="v4"}_create_class(RJe1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doRerank",value:function doRerank(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,_tmp,_ref,_$l,c,d,_tmp1,_tmp2,l,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.documents,t=param.query,r=param.topN,n=param.headers,i=param.abortSignal,o=param.providerOptions;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:s=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[s,n!=null?n:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=_object_spread({documents:e,query:t},r!=null?{topN:r}:{},o?{providerOptions:o}:{}),_tmp1.successfulResponseHandler=wt(OJe),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(u){return u}}),_tmp1),i&&{abortSignal:i}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$l=_ref.responseHeaders,c=_ref.value,d=_ref.rawValue;return[2,{ranking:c.ranking,providerMetadata:c.providerMetadata,response:{headers:_$l,body:d},warnings:(a=c.warnings)!=null?a:[]}];case 7:l=_state.sent();_tmp3=[l];return[4,cl(s!=null?s:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/reranking-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"4","ai-model-id":this.modelId}}}]);return RJe1}(),MJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),OJe=ne(function(){return te(f.object({ranking:f.array(f.object({index:f.number(),relevanceScore:f.number()})),warnings:f.array(MJe).optional(),providerMetadata:f.record(f.string(),f.record(f.string(),f.unknown())).optional()}))}),$Je=/*#__PURE__*/function(){"use strict";function $Je1(e,t){_class_call_check(this,$Je1);this.modelId=e,this.config=t,this.specificationVersion="v4"}_create_class($Je1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,_tmp,_ref,_$u,p,m,_tmp1,_tmp2,u,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.text,t=param.voice,r=param.outputFormat,n=param.instructions,i=param.speed,o=param.language,a=param.providerOptions,s=param.headers,l=param.abortSignal;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:d=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[d,s!=null?s:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=_object_spread({text:e},t&&{voice:t},r&&{outputFormat:r},n&&{instructions:n},i!=null&&{speed:i},o&&{language:o},a&&{providerOptions:a}),_tmp1.successfulResponseHandler=wt(LJe),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(h){return h}}),_tmp1),l&&{abortSignal:l}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$u=_ref.responseHeaders,p=_ref.value,m=_ref.rawValue;return[2,{audio:p.audio,warnings:(c=p.warnings)!=null?c:[],providerMetadata:p.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:_$u,body:m}}];case 7:u=_state.sent();_tmp3=[u];return[4,cl(d!=null?d:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/speech-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-speech-model-specification-version":"4","ai-model-id":this.modelId}}}]);return $Je1}(),NJe=f.object({}).catchall(f.unknown()),DJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),LJe=f.object({audio:f.string(),warnings:f.array(DJe).optional(),providerMetadata:f.record(f.string(),NJe).optional()}),FJe=/*#__PURE__*/function(){"use strict";function FJe1(e,t){_class_call_check(this,FJe1);this.modelId=e,this.config=t,this.specificationVersion="v4"}_create_class(FJe1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,_tmp,_ref,_$d,u,p,_tmp1,_tmp2,d,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.audio,t=param.mediaType,r=param.providerOptions,n=param.headers,i=param.abortSignal;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:c=_tmp;_state.label=4;case 4:_state.trys.push([4,7,,10]);_tmp1={url:this.getUrl()};_tmp2=[c,n!=null?n:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 5:return[4,zt.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.headers=ht.apply(void 0,_tmp2.concat([_state.sent()])),_tmp1.body=_object_spread({audio:_instanceof(e,Uint8Array)?Jl(e):e,mediaType:t},r&&{providerOptions:r}),_tmp1.successfulResponseHandler=wt(qJe),_tmp1.failedResponseHandler=Vr({errorSchema:f.any(),errorToMessage:function(m){return m}}),_tmp1),i&&{abortSignal:i}]),{fetch:this.config.fetch}])])];case 6:_ref=_state.sent(),_$d=_ref.responseHeaders,u=_ref.value,p=_ref.rawValue;return[2,{text:u.text,segments:(o=u.segments)!=null?o:[],language:(a=u.language)!=null?a:void 0,durationInSeconds:(s=u.durationInSeconds)!=null?s:void 0,warnings:(l=u.warnings)!=null?l:[],providerMetadata:u.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:_$d,body:p}}];case 7:d=_state.sent();_tmp3=[d];return[4,cl(c!=null?c:{})];case 8:return[4,_a.apply(void 0,_tmp3.concat([_state.sent()]))];case 9:throw _state.sent();case 10:return[2]}})}).apply(this,arguments)}},{key:"doStream",value:function doStream(e){return _async_to_generator(function(){var t,r,n,i,o,a,s,l,c,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=(n=(r=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:r.call(t))!=null?n:new Date;return[4,Kt((i=this.config.headers)!=null?i:{})];case 1:_tmp=[_state.sent(),(o=e.headers)!=null?o:{},this.getModelConfigHeaders()];return[4,Kt(this.config.o11yHeaders)];case 2:s=ht.apply(void 0,_tmp.concat([_state.sent()]));return[4,cl(s)];case 3:l=_state.sent(),c=_object_spread({type:nue,inputAudioFormat:e.inputAudioFormat},e.providerOptions!=null&&{providerOptions:e.providerOptions},e.includeRawChunks!=null&&{includeRawChunks:e.includeRawChunks});return[2,{stream:jJe({webSocket:this.config.webSocket,url:_ce(this.config.baseURL,this.modelId),protocols:zJe(s),headers:s,startFrame:c,audio:e.audio,abortSignal:e.abortSignal,authMethod:l}),request:{body:c},response:{timestamp:a,modelId:this.modelId}}]}})}).call(this)}},{key:"getUrl",value:function getUrl(){return"".concat(this.config.baseURL,"/transcription-model")}},{key:"getModelConfigHeaders",value:function getModelConfigHeaders(){return{"ai-transcription-model-specification-version":"4","ai-model-id":this.modelId}}}]);return FJe1}();function _ce(e,t){var r=new URL("".concat(e.replace(/^http/,"ws"),"/transcription-model"));return r.searchParams.set("ai-model-id",t),r.toString()}function zJe(e){var t=tz(e),r=t.authorization,n=r!=null&&r.startsWith("Bearer ")?r.slice(7):void 0;return n==null?[tce]:UQe(n,{teamIdOrSlug:t[gce]})}var Yue=64*1024;function jJe(param){var e=param.webSocket,t=param.url,r=param.protocols,n=param.headers,i=param.startFrame,o=param.audio,a=param.abortSignal,s=param.authMethod;var l=!1,c=function(){};return new ReadableStream({start:function(d){var u,p=!1,m,h=!1,g;c=function(_){u!=null?u.cancel().catch(function(){}):o.cancel().catch(function(){}),g==null||g.close(_)};var x=function(){h=!0,u!=null?(u.cancel().catch(function(){}),u=void 0):o.cancel().catch(function(){})},v=function(_){l||(l=!0,c(),WJe(d,_,s))},y=function(_){return _async_to_generator(function(){var b,_ref,w,S,k,E;return _ts_generator(this,function(_state){switch(_state.label){case 0:b=o.getReader();u=b;_state.label=1;case 1:_state.trys.push([1,,9,10]);_state.label=2;case 2:return[4,b.read()];case 3:_ref=_state.sent(),w=_ref.done,S=_ref.value;if(w||l)return[3,8];k=typeof S=="string"?Ui(S):S;E=0;_state.label=4;case 4:if(!(E<k.length&&!l))return[3,7];_.send(k.subarray(E,E+Yue));return[4,sh(_)];case 5:_state.sent();_state.label=6;case 6:E+=Yue;return[3,4];case 7:return[3,2];case 8:return[3,10];case 9:b.releaseLock(),u===b&&(u=void 0);return[7];case 10:!l&&!h&&_.send(JSON.stringify({type:iue}));return[2]}})})()};g=lh({url:t,protocols:r,headers:n,webSocket:e,abortSignal:a,onAbort:function(_){l||(l=!0,c(),d.error(_))},onProcessingError:v,onOpen:function(_){_.send(JSON.stringify(i)),y(_).catch(v)},onMessageText:function(_){if(l)return;var b=oue(_);if(b!=null){if(b.type==="finish"){l=!0,d.enqueue(b),d.close(),c(1e3);return}b.type==="error"&&(p=!0,m=b.error,x()),d.enqueue(b)}},onSocketError:function(){v(new Error("Connection error on AI Gateway transcription stream"))},onClose:function(){if(p){if(l)return;GJe(m,s).then(v);return}v(new Error("AI Gateway transcription stream closed before a finish part was received"))}})},cancel:function(){l||(l=!0,c())}})}var UJe=f.object({}).catchall(f.unknown()),BJe=f.discriminatedUnion("type",[f.object({type:f.literal("unsupported"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("compatibility"),feature:f.string(),details:f.string().optional()}),f.object({type:f.literal("deprecated"),setting:f.string(),message:f.string()}),f.object({type:f.literal("other"),message:f.string()})]),qJe=f.object({text:f.string(),segments:f.array(f.object({text:f.string(),startSecond:f.number(),endSecond:f.number()})).optional(),language:f.string().nullish(),durationInSeconds:f.number().nullish(),warnings:f.array(BJe).optional(),providerMetadata:f.record(f.string(),UJe).optional()});function WJe(e,t,r){return _async_to_generator(function(){var _;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=e.error;return[4,_a(t,r)];case 1:_.apply(e,[_state.sent()]);return[2]}})})()}function VJe(e){return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"message"in e&&typeof e.message=="string"?e.message:xa(e)}var Xue={authentication_error:401,failed_dependency:424,forbidden:403,internal_server_error:500,invalid_request_error:400,model_not_found:404,rate_limit_exceeded:429};function GJe(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!=null&&"message"in e&&typeof e.message=="string"&&"type"in e&&typeof e.type=="string"&&e.type in Xue?fz({response:{error:{message:e.message,type:e.type}},statusCode:Xue[e.type],authMethod:t}):new Error("AI Gateway transcription stream failed: ".concat(VJe(e)))]})})()}var HJe=/*#__PURE__*/function(){"use strict";function HJe1(e,t){_class_call_check(this,HJe1);this.specificationVersion="v4",this.modelId=e,this.provider=t.provider,this.config=t}_create_class(HJe1,[{key:"doCreateClientSecret",value:function doCreateClientSecret(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.config.createClientSecret(_object_spread({modelId:this.modelId},(e==null?void 0:e.expiresAfterSeconds)!=null&&{expiresAfterSeconds:e.expiresAfterSeconds}))];case 1:t=_state.sent();return[2,_object_spread({token:t.token,url:ZJe(this.config.baseURL,this.modelId)},t.expiresAt!=null&&{expiresAt:t.expiresAt})]}})}).call(this)}},{key:"getWebSocketConfig",value:function getWebSocketConfig(e){return{url:e.url,protocols:jQe(e.token,{teamIdOrSlug:this.config.teamIdOrSlug})}}},{key:"parseServerEvent",value:function parseServerEvent(e){return e}},{key:"serializeClientEvent",value:function serializeClientEvent(e){return e}},{key:"buildSessionConfig",value:function buildSessionConfig(e){return e}}]);return HJe1}();function ZJe(e,t){var r=new URL("".concat(e.replace(/^http/,"ws"),"/realtime-model"));return r.searchParams.set("ai-model-id",t),r.toString()}var KJe=ne(function(){return te(f.object({query:f.string().describe("Natural-language web search query. This is required."),type:f.enum(["auto","fast","instant"]).optional().describe("Search method. Use auto for the default balance of speed and quality."),num_results:f.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),category:f.enum(["company","people","research paper","news","personal site","financial report"]).optional().describe("Optional content category to focus results."),user_location:f.string().optional().describe("Two-letter ISO country code such as 'US'."),include_domains:f.array(f.string()).optional().describe("Only return results from these domains."),exclude_domains:f.array(f.string()).optional().describe("Exclude results from these domains."),start_published_date:f.string().optional().describe("Only return links published after this ISO 8601 date."),end_published_date:f.string().optional().describe("Only return links published before this ISO 8601 date."),contents:f.object({text:f.union([f.boolean(),f.object({max_characters:f.number().optional(),include_html_tags:f.boolean().optional(),verbosity:f.enum(["compact","standard","full"]).optional(),include_sections:f.array(f.enum(["header","navigation","banner","body","sidebar","footer","metadata"])).optional(),exclude_sections:f.array(f.enum(["header","navigation","banner","body","sidebar","footer","metadata"])).optional()})]).optional(),highlights:f.union([f.boolean(),f.object({query:f.string().optional(),max_characters:f.number().optional()})]).optional(),max_age_hours:f.number().optional(),livecrawl_timeout:f.number().optional(),subpages:f.number().optional(),subpage_target:f.union([f.string(),f.array(f.string())]).optional(),extras:f.object({links:f.number().optional(),image_links:f.number().optional()}).optional()}).optional().describe("Controls extracted page content and freshness.")}))}),QJe=ne(function(){return te(f.union([f.object({requestId:f.string(),searchType:f.string().optional(),resolvedSearchType:f.string().optional(),results:f.array(f.object({title:f.string(),url:f.string(),id:f.string(),publishedDate:f.string().nullable().optional(),author:f.string().nullable().optional(),image:f.string().nullable().optional(),favicon:f.string().nullable().optional(),text:f.string().optional(),highlights:f.array(f.string()).optional(),highlightScores:f.array(f.number()).optional(),summary:f.string().optional(),subpages:f.array(f.any()).optional(),extras:f.object({links:f.array(f.string()).optional(),imageLinks:f.array(f.string()).optional()}).optional()})),costDollars:f.object({total:f.number().optional(),search:f.record(f.string(),f.number()).optional()}).optional()}),f.object({error:f.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","execution_error","unknown"]),statusCode:f.number().optional(),message:f.string()})]))}),JJe=tr({id:"gateway.exa_search",inputSchema:KJe,outputSchema:QJe}),YJe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return JJe(e)},XJe=ne(function(){return te(f.object({objective:f.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:f.array(f.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:f.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:f.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:f.object({include_domains:f.array(f.string()).optional().describe("Limit results to these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."),exclude_domains:f.array(f.string()).optional().describe("Exclude results from these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."),after_date:f.string().optional().describe("Only include results published after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time.")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:f.object({max_chars_per_result:f.number().optional().describe("Maximum characters per result."),max_chars_total:f.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:f.object({max_age_seconds:f.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))}),eYe=ne(function(){return te(f.union([f.object({searchId:f.string(),results:f.array(f.object({url:f.string(),title:f.string(),excerpt:f.string(),publishDate:f.string().nullable().optional(),relevanceScore:f.number().optional()}))}),f.object({error:f.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:f.number().optional(),message:f.string()})]))}),tYe=tr({id:"gateway.parallel_search",inputSchema:XJe,outputSchema:eYe}),rYe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return tYe(e)},nYe=ne(function(){return te(f.object({query:f.union([f.string(),f.array(f.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:f.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:f.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:f.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:f.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:f.array(f.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:f.array(f.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:f.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:f.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:f.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:f.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:f.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))}),iYe=ne(function(){return te(f.union([f.object({results:f.array(f.object({title:f.string(),url:f.string(),snippet:f.string(),date:f.string().optional(),lastUpdated:f.string().optional()})),id:f.string()}),f.object({error:f.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:f.number().optional(),message:f.string()})]))}),oYe=tr({id:"gateway.perplexity_search",inputSchema:nYe,outputSchema:iYe}),aYe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oYe(e)},sYe={exaSearch:YJe,parallelSearch:rYe,perplexitySearch:aYe};function lYe(){return _async_to_generator(function(){var e;return _ts_generator(this,function(_state){return[2,(e=(0,bce.getContext)().headers)==null?void 0:e["x-vercel-id"]]})})()}var uYe="4.0.30",cYe="0.0.1",dYe=f.object({token:f.string(),expiresAt:f.number().nullish()});function pYe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,r;var n=null,i=null,o=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,a=0,s=(r=Kd(e.baseURL))!=null?r:"https://ai-gateway.vercel.sh/v4/ai",l=function(E){return Bi(_object_spread(_define_property({Authorization:"Bearer ".concat(E.token),"ai-gateway-protocol-version":cYe},hce,E.authMethod),e.teamIdOrSlug!=null?_define_property({},gce,e.teamIdOrSlug):{},e.headers),"ai-sdk/gateway/".concat(uYe))},c=function(){return _async_to_generator(function(){var E;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,ece(e)];case 1:return[2,l.apply(void 0,[_state.sent()])];case 2:E=_state.sent();throw t6.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:E});case 3:return[2]}})})()},d=function(){return _async_to_generator(function(){var E;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,ece(e)];case 1:return[2,_state.sent()];case 2:E=_state.sent();throw t6.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:E});case 3:return[2]}})})()},u=function(E){return _async_to_generator(function(){var C,T,I,_ref,_$O,O,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:fYe();return[4,d()];case 1:C=_state.sent(),T=l(C),I=new URL("/v1/realtime/client-secrets",s).toString();_state.label=2;case 2:_state.trys.push([2,4,,7]);return[4,zt({url:I,headers:T,body:_object_spread({model:E.modelId},E.routeKind!=null&&{routeKind:E.routeKind},E.expiresAfterSeconds!=null&&{expiresIn:E.expiresAfterSeconds}),successfulResponseHandler:wt(dYe),failedResponseHandler:Vr({errorSchema:f.any(),errorToMessage:function(M){return M}}),fetch:e.fetch})];case 3:_ref=_state.sent(),_$O=_ref.value;return[2,_object_spread({token:_$O.token},_$O.expiresAt!=null&&{expiresAt:_$O.expiresAt})];case 4:O=_state.sent();_tmp=[O];return[4,cl(T)];case 5:return[4,_a.apply(void 0,_tmp.concat([_state.sent()]))];case 6:throw _state.sent();case 7:return[2]}})})()},p=function(){var E=Hd({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),C=Hd({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),T=Hd({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),I=Hd({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return function(){return _async_to_generator(function(){var O;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,lYe()];case 1:O=_state.sent();return[2,_object_spread({},E&&{"ai-o11y-deployment-id":E},C&&{"ai-o11y-environment":C},T&&{"ai-o11y-region":T},O&&{"ai-o11y-request-id":O},I&&{"ai-o11y-project-id":I})]}})})()}},m=function(E){return new xJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})},h=function(){return _async_to_generator(function(){var E,C,T,I;return _ts_generator(this,function(_state){I=(T=(C=(E=e._internal)==null?void 0:E.currentDate)==null?void 0:C.call(E).getTime())!=null?T:Date.now();return[2,((!n||I-a>o)&&(a=I,n=new Kue({baseURL:s,headers:c,fetch:e.fetch}).getAvailableModels().then(function(O){return i=O,O}).catch(function(O){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[O];return[4,c()];case 1:return[4,cl.apply(void 0,[_state.sent()])];case 2:return[4,_a.apply(void 0,_tmp.concat([_state.sent()]))];case 3:throw _state.sent()}})})()})),i?Promise.resolve(i):n)]})})()},g=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,new Kue({baseURL:s,headers:c,fetch:e.fetch}).getCredits().catch(function(E){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[E];return[4,c()];case 1:return[4,cl.apply(void 0,[_state.sent()])];case 2:return[4,_a.apply(void 0,_tmp.concat([_state.sent()]))];case 3:throw _state.sent()}})})()})]})})()},x=function(E){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,new fJe({baseURL:s,headers:c,fetch:e.fetch}).getSpendReport(E).catch(function(C){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[C];return[4,c()];case 1:return[4,cl.apply(void 0,[_state.sent()])];case 2:return[4,_a.apply(void 0,_tmp.concat([_state.sent()]))];case 3:throw _state.sent()}})})()})]})})()},v=function(E){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,new hJe({baseURL:s,headers:c,fetch:e.fetch}).getGenerationInfo(E).catch(function(C){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[C];return[4,c()];case 1:return[4,cl.apply(void 0,[_state.sent()])];case 2:return[4,_a.apply(void 0,_tmp.concat([_state.sent()]))];case 3:throw _state.sent()}})})()})]})})()},y=function _target(E){if(_instanceof(this,_target)?this.constructor:void 0)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return m(E)};y.specificationVersion="v4",y.getAvailableModels=h,y.getCredits=g,y.getSpendReport=x,y.getGenerationInfo=v,y.imageModel=function(E){return new bJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})},y.languageModel=m;var _=function(E){return new yJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})};y.embeddingModel=_,y.textEmbeddingModel=_,y.videoModel=function(E){return new EJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})};var b=function(E){return new RJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})};y.rerankingModel=b,y.reranking=b;var w=function(E){return new $Je(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p()})};y.speechModel=w,y.speech=w;var S=function(E){return new FJe(E,{provider:"gateway",baseURL:s,headers:c,fetch:e.fetch,o11yHeaders:p(),webSocket:e.webSocket})};y.transcriptionModel=S,y.transcription=S,y.experimental_transcription=Object.assign(function(E){return S(E)},{getToken:function(E){return _async_to_generator(function(){var C;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,u(_object_spread({modelId:E.model,routeKind:"transcription"},E.expiresAfterSeconds!=null&&{expiresAfterSeconds:E.expiresAfterSeconds}))];case 1:C=_state.sent();return[2,_object_spread({token:C.token,url:_ce(s,E.model)},C.expiresAt!=null&&{expiresAt:C.expiresAt})]}})})()}});var k=function(E){return new HJe(E,{provider:"gateway.realtime",baseURL:s,teamIdOrSlug:e.teamIdOrSlug,createClientSecret:u})};return y.experimental_realtime=Object.assign(function(E){return k(E)},{getToken:function(E){return _async_to_generator(function(){var C,T,O;return _ts_generator(this,function(_state){switch(_state.label){case 0:C=E.model,T=_object_without_properties(E,["model"]);return[4,k(C).doCreateClientSecret(T)];case 1:O=_state.sent();return[2,_object_spread({token:O.token,url:O.url},O.expiresAt!=null&&{expiresAt:O.expiresAt})]}})})()}}),y.chat=y.languageModel,y.embedding=y.embeddingModel,y.image=y.imageModel,y.video=y.videoModel,y.tools=sYe,y}var Sce=pYe();function ece(e){return _async_to_generator(function(){var t,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=Hd({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(!t)return[3,1];_tmp={token:t,authMethod:"api-key"};return[3,3];case 1:_tmp1={};return[4,(0,wce.getVercelOidcToken)()];case 2:_tmp=(_tmp1.token=_state.sent(),_tmp1.authMethod="oidc",_tmp1);_state.label=3;case 3:return[2,_tmp]}})})()}function fYe(){if(typeof globalThis.window!="undefined")throw new Error("AI Gateway client secrets must be minted server-side: minting needs your Gateway credential, which must never reach the browser. Call gateway.experimental_realtime.getToken() or gateway.experimental_transcription.getToken() from your server and pass the returned token to the client.")}var mYe=Object.defineProperty,hYe=function(e,t){for(var r in t)mYe(e,r,{get:t[r],enumerable:!0})},Uce="AI_InvalidArgumentError",Bce="vercel.ai.error.".concat(Uce),gYe=Symbol.for(Bce),qce,Qd=/*#__PURE__*/function(Ze1){"use strict";_inherits(Qd1,Ze1);function Qd1(param){var e=param.parameter,t=param.value,r=param.message;_class_call_check(this,Qd1);var _this;_this=_call_super(this,Qd1,[{name:Uce,message:"Invalid argument for parameter ".concat(e,": ").concat(r)}]),_this[qce]=!0,_this.parameter=e,_this.value=t;return _this}_create_class(Qd1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Bce)}}]);return Qd1}(Ze);qce=gYe;var xYe="AI_InvalidStreamPartError",yYe="vercel.ai.error.".concat(xYe),vYe=Symbol.for(yYe),_Ye;_Ye=vYe;var Wce="AI_InvalidToolApprovalError",Vce="vercel.ai.error.".concat(Wce),bYe=Symbol.for(Vce),Gce,wYe=/*#__PURE__*/function(Ze1){"use strict";_inherits(wYe1,Ze1);function wYe1(param){var e=param.approvalId;_class_call_check(this,wYe1);var _this;_this=_call_super(this,wYe1,[{name:Wce,message:'Tool approval response references unknown approvalId: "'.concat(e,'". No matching tool-approval-request found in message history.')}]),_this[Gce]=!0,_this.approvalId=e;return _this}_create_class(wYe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Vce)}}]);return wYe1}(Ze);Gce=bYe;var Hce="AI_InvalidToolApprovalSignatureError",Zce="vercel.ai.error.".concat(Hce),SYe=Symbol.for(Zce),Kce,kce=/*#__PURE__*/function(Ze1){"use strict";_inherits(kce1,Ze1);function kce1(param){var e=param.approvalId,t=param.toolCallId,r=param.reason;_class_call_check(this,kce1);var _this;_this=_call_super(this,kce1,[{name:Hce,message:'Tool approval signature verification failed for approval "'.concat(e,'" (tool call "').concat(t,'"): ').concat(r)}]),_this[Kce]=!0,_this.approvalId=e,_this.toolCallId=t;return _this}_create_class(kce1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Zce)}}]);return kce1}(Ze);Kce=SYe;var Qce="AI_InvalidToolInputError",Jce="vercel.ai.error.".concat(Qce),kYe=Symbol.for(Jce),Yce,bT=/*#__PURE__*/function(Ze1){"use strict";_inherits(bT1,Ze1);function bT1(param){var e=param.toolInput,t=param.toolName,r=param.cause,tmp=param.message,n=tmp===void 0?"Invalid input for tool ".concat(t,": ").concat(xa(r)):tmp;_class_call_check(this,bT1);var _this;_this=_call_super(this,bT1,[{name:Qce,message:n,cause:r}]),_this[Yce]=!0,_this.toolInput=e,_this.toolName=t;return _this}_create_class(bT1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Jce)}}]);return bT1}(Ze);Yce=kYe;var Xce="AI_ToolCallNotFoundForApprovalError",ede="vercel.ai.error.".concat(Xce),CYe=Symbol.for(ede),tde,$z=/*#__PURE__*/function(Ze1){"use strict";_inherits($z1,Ze1);function $z1(param){var e=param.toolCallId,t=param.approvalId;_class_call_check(this,$z1);var _this;_this=_call_super(this,$z1,[{name:Xce,message:'Tool call "'.concat(e,'" not found for approval request "').concat(t,'".')}]),_this[tde]=!0,_this.toolCallId=e,_this.approvalId=t;return _this}_create_class($z1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,ede)}}]);return $z1}(Ze);tde=CYe;var rde="AI_MissingToolResultsError",nde="vercel.ai.error.".concat(rde),EYe=Symbol.for(nde),ide,Cce=/*#__PURE__*/function(Ze1){"use strict";_inherits(Cce1,Ze1);function Cce1(param){var e=param.toolCallIds;_class_call_check(this,Cce1);var _this;_this=_call_super(this,Cce1,[{name:rde,message:"Tool result".concat(e.length>1?"s are":" is"," missing for tool call").concat(e.length>1?"s":""," ").concat(e.join(", "),".")}]),_this[ide]=!0,_this.toolCallIds=e;return _this}_create_class(Cce1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,nde)}}]);return Cce1}(Ze);ide=EYe;var TYe="AI_NoImageGeneratedError",AYe="vercel.ai.error.".concat(TYe),IYe=Symbol.for(AYe),PYe;PYe=IYe;var ode="AI_NoObjectGeneratedError",ade="vercel.ai.error.".concat(ode),RYe=Symbol.for(ade),sde,ph=/*#__PURE__*/function(Ze1){"use strict";_inherits(ph1,Ze1);function ph1(param){var tmp=param.message,e=tmp===void 0?"No object generated.":tmp,t=param.cause,r=param.text,n=param.response,i=param.usage,o=param.finishReason;_class_call_check(this,ph1);var _this;_this=_call_super(this,ph1,[{name:ode,message:e,cause:t}]),_this[sde]=!0,_this.text=r,_this.response=n,_this.usage=i,_this.finishReason=o;return _this}_create_class(ph1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,ade)}}]);return ph1}(Ze);sde=RYe;var lde="AI_NoOutputGeneratedError",ude="vercel.ai.error.".concat(lde),MYe=Symbol.for(ude),cde,gT=/*#__PURE__*/function(Ze1){"use strict";_inherits(gT1,Ze1);function gT1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.message,e=tmp===void 0?"No output generated.":tmp,t=_ref.cause;_class_call_check(this,gT1);var _this;_this=_call_super(this,gT1,[{name:lde,message:e,cause:t}]),_this[cde]=!0;return _this}_create_class(gT1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,ude)}}]);return gT1}(Ze);cde=MYe;var OYe="AI_NoSpeechGeneratedError",$Ye="vercel.ai.error.".concat(OYe),NYe=Symbol.for($Ye),DYe;DYe=NYe;var LYe="AI_NoTranscriptGeneratedError",FYe="vercel.ai.error.".concat(LYe),zYe=Symbol.for(FYe),jYe;jYe=zYe;var UYe="AI_NoTranslationGeneratedError",BYe="vercel.ai.error.".concat(UYe),qYe=Symbol.for(BYe),WYe;WYe=qYe;var VYe="AI_NoVideoGeneratedError",GYe="vercel.ai.error.".concat(VYe),HYe=Symbol.for(GYe),ZYe;ZYe=HYe;var dde="AI_NoSuchToolError",pde="vercel.ai.error.".concat(dde),KYe=Symbol.for(pde),fde,Sz=/*#__PURE__*/function(Ze1){"use strict";_inherits(Sz1,Ze1);function Sz1(param){var e=param.toolName,tmp=param.availableTools,t=tmp===void 0?void 0:tmp,tmp1=param.message,r=tmp1===void 0?"Model tried to call unavailable tool '".concat(e,"'. ").concat(t===void 0?"No tools are available.":"Available tools: ".concat(t.join(", "),".")):tmp1;_class_call_check(this,Sz1);var _this;_this=_call_super(this,Sz1,[{name:dde,message:r}]),_this[fde]=!0,_this.toolName=e,_this.availableTools=t;return _this}_create_class(Sz1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,pde)}}]);return Sz1}(Ze);fde=KYe;var mde="AI_ToolCallRepairError",hde="vercel.ai.error.".concat(mde),QYe=Symbol.for(hde),gde,JYe=/*#__PURE__*/function(Ze1){"use strict";_inherits(JYe1,Ze1);function JYe1(param){var e=param.cause,t=param.originalError,tmp=param.message,r=tmp===void 0?"Error repairing tool call: ".concat(xa(e)):tmp;_class_call_check(this,JYe1);var _this;_this=_call_super(this,JYe1,[{name:mde,message:r,cause:e}]),_this[gde]=!0,_this.originalError=t;return _this}_create_class(JYe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,hde)}}]);return JYe1}(Ze);gde=QYe;var YYe=/*#__PURE__*/function(Ze1){"use strict";_inherits(YYe1,Ze1);function YYe1(e){_class_call_check(this,YYe1);var _this;_this=_call_super(this,YYe1,[{name:"AI_UnsupportedModelVersionError",message:"Unsupported model version ".concat(e.version,' for provider "').concat(e.provider,'" and model "').concat(e.modelId,'". AI SDK 5 only supports models that implement specification version "v2".')}]),_this.version=e.version,_this.provider=e.provider,_this.modelId=e.modelId;return _this}return YYe1}(Ze),xde="AI_UIMessageStreamError",yde="vercel.ai.error.".concat(xde),XYe=Symbol.for(yde),vde,m0=/*#__PURE__*/function(Ze1){"use strict";_inherits(m01,Ze1);function m01(param){var e=param.chunkType,t=param.chunkId,r=param.message;_class_call_check(this,m01);var _this;_this=_call_super(this,m01,[{name:xde,message:r}]),_this[vde]=!0,_this.chunkType=e,_this.chunkId=t;return _this}_create_class(m01,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,yde)}}]);return m01}(Ze);vde=XYe;var _de="AI_InvalidDataContentError",bde="vercel.ai.error.".concat(_de),eXe=Symbol.for(bde),wde,Sde=/*#__PURE__*/function(Ze1){"use strict";_inherits(Sde1,Ze1);function Sde1(param){var e=param.content,t=param.cause,tmp=param.message,r=tmp===void 0?"Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ".concat(typeof e==="undefined"?"undefined":_type_of(e),"."):tmp;_class_call_check(this,Sde1);var _this;_this=_call_super(this,Sde1,[{name:_de,message:r,cause:t}]),_this[wde]=!0,_this.content=e;return _this}_create_class(Sde1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,bde)}}]);return Sde1}(Ze);wde=eXe;var kde="AI_InvalidMessageRoleError",Cde="vercel.ai.error.".concat(kde),tXe=Symbol.for(Cde),Ede,rXe=/*#__PURE__*/function(Ze1){"use strict";_inherits(rXe1,Ze1);function rXe1(param){var e=param.role,tmp=param.message,t=tmp===void 0?"Invalid message role: '".concat(e,'\'. Must be one of: "system", "user", "assistant", "tool".'):tmp;_class_call_check(this,rXe1);var _this;_this=_call_super(this,rXe1,[{name:kde,message:t}]),_this[Ede]=!0,_this.role=e;return _this}_create_class(rXe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Cde)}}]);return rXe1}(Ze);Ede=tXe;var Tde="AI_MessageConversionError",Ade="vercel.ai.error.".concat(Tde),nXe=Symbol.for(Ade),Ide,iXe=/*#__PURE__*/function(Ze1){"use strict";_inherits(iXe1,Ze1);function iXe1(param){var e=param.originalMessage,t=param.message;_class_call_check(this,iXe1);var _this;_this=_call_super(this,iXe1,[{name:Tde,message:t}]),_this[Ide]=!0,_this.originalMessage=e;return _this}_create_class(iXe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Ade)}}]);return iXe1}(Ze);Ide=nXe;var Pde="AI_RetryError",Rde="vercel.ai.error.".concat(Pde),oXe=Symbol.for(Rde),Mde,aXe=/*#__PURE__*/function(Ze1){"use strict";_inherits(aXe1,Ze1);function aXe1(param){var e=param.message,t=param.reason,r=param.errors;_class_call_check(this,aXe1);var _this;_this=_call_super(this,aXe1,[{name:Pde,message:e}]),_this[Mde]=!0,_this.reason=t,_this.errors=r,_this.lastError=r[r.length-1];return _this}_create_class(aXe1,null,[{key:"isInstance",value:function isInstance(e){return Ze.hasMarker(e,Rde)}}]);return aXe1}(Ze);Mde=oXe;function sXe(param){var e=param.warning,t=param.provider,r=param.model;var i="AI SDK Warning".concat(t!=null&&r!=null?" (".concat(t," / ").concat(r,")"):"",":");switch(e.type){case"unsupported":{var o="".concat(i,' The feature "').concat(e.feature,'" is not supported.');return e.details&&(o+=" ".concat(e.details)),o}case"compatibility":{var o10="".concat(i,' The feature "').concat(e.feature,'" is used in a compatibility mode.');return e.details&&(o10+=" ".concat(e.details)),o10}case"deprecated":return"".concat(i,' Deprecated: "').concat(e.setting,'". ').concat(e.message);case"other":return"".concat(i," ").concat(e.message);default:return"".concat(i," ").concat(JSON.stringify(e,null,2))}}var lXe="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",Ece=!1,W2=function(e){if(e.warnings.length===0)return;var t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}Ece||(Ece=!0,console.info(lXe));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.warnings[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=sXe({warning:r,provider:e.provider,model:e.model});typeof process!="undefined"&&typeof process.emitWarning=="function"?process.emitWarning(n,{type:r.type==="deprecated"?"DeprecationWarning":"Warning"}):console.warn(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}};function u6(param){var e=param.provider,t=param.modelId;W2({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}function Ode(e){return e.specificationVersion==="v3"?e:(u6({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get:function get1(t,r){return r==="specificationVersion"?"v3":t[r]}}))}function uXe(e){if(e.specificationVersion==="v4")return e;var t=e.specificationVersion==="v2"?Ode(e):e;return new Proxy(t,{get:function get1(r,n){return n==="specificationVersion"?"v4":r[n]}})}function $de(e){return e.specificationVersion==="v3"?e:(u6({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get:function get1(t,r){return r==="specificationVersion"?"v3":t[r]}}))}function cXe(e){if(e.specificationVersion==="v4")return e;var t=e.specificationVersion==="v2"?$de(e):e;return new Proxy(t,{get:function get1(r,n){return n==="specificationVersion"?"v4":r[n]}})}function Nde(e){return e.specificationVersion==="v3"?e:(u6({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get:function get1(t,r){switch(r){case"specificationVersion":return"v3";case"doGenerate":return function(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}return _async_to_generator(function(){var _t1,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(_t1=t).doGenerate.apply(_t1,_to_consumable_array(n))];case 1:i=_state.sent();return[2,_object_spread_props(_object_spread({},i),{finishReason:Dde(i.finishReason),usage:Lde(i.usage)})]}})})()};case"doStream":return function(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}return _async_to_generator(function(){var _t1,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(_t1=t).doStream.apply(_t1,_to_consumable_array(n))];case 1:i=_state.sent();return[2,_object_spread_props(_object_spread({},i),{stream:dXe(i.stream)})]}})})()};default:return t[r]}}}))}function dXe(e){return e.pipeThrough(new TransformStream({transform:function transform(t,r){switch(t.type){case"finish":r.enqueue(_object_spread_props(_object_spread({},t),{finishReason:Dde(t.finishReason),usage:Lde(t.usage)}));break;default:r.enqueue(t);break}}}))}function Dde(e){return{unified:e==="unknown"?"other":e,raw:void 0}}function Lde(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function Nz(e){if(e.specificationVersion==="v4")return e;var t=e.specificationVersion==="v2"?Nde(e):e;return new Proxy(t,{get:function get1(r,n){return n==="specificationVersion"?"v4":r[n]}})}function pXe(e){return e.specificationVersion==="v4"?e:new Proxy(e,{get:function get1(t,r){return r==="specificationVersion"?"v4":t[r]}})}function Fde(e){return e.specificationVersion==="v3"?e:(u6({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get:function get1(t,r){return r==="specificationVersion"?"v3":t[r]}}))}function fXe(e){if(e.specificationVersion==="v4")return e;var t=e.specificationVersion==="v2"?Fde(e):e;return new Proxy(t,{get:function get1(r,n){return n==="specificationVersion"?"v4":r[n]}})}function zde(e){return e.specificationVersion==="v3"?e:(u6({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get:function get1(t,r){return r==="specificationVersion"?"v3":t[r]}}))}function mXe(e){if(e.specificationVersion==="v4")return e;var t=e.specificationVersion==="v2"?zde(e):e;return new Proxy(t,{get:function get1(r,n){return n==="specificationVersion"?"v4":r[n]}})}function hXe(e){if("specificationVersion"in e&&e.specificationVersion==="v3")return e;var t=e;return{specificationVersion:"v3",languageModel:function(r){return Nde(t.languageModel(r))},embeddingModel:function(r){return Ode(t.textEmbeddingModel(r))},imageModel:function(r){return $de(t.imageModel(r))},transcriptionModel:t.transcriptionModel?function(r){return zde(t.transcriptionModel(r))}:void 0,speechModel:t.speechModel?function(r){return Fde(t.speechModel(r))}:void 0,rerankingModel:void 0}}function gXe(e){if("specificationVersion"in e&&e.specificationVersion==="v4")return e;var t=!("specificationVersion"in e)||e.specificationVersion!=="v3"?hXe(e):e;return{specificationVersion:"v4",languageModel:function(r){return Nz(t.languageModel(r))},embeddingModel:function(r){return uXe(t.embeddingModel(r))},imageModel:function(r){return cXe(t.imageModel(r))},transcriptionModel:t.transcriptionModel?function(r){return mXe(t.transcriptionModel(r))}:void 0,speechModel:t.speechModel?function(r){return fXe(t.speechModel(r))}:void 0,rerankingModel:t.rerankingModel?function(r){return pXe(t.rerankingModel(r))}:void 0}}function s6(e){if(typeof e=="string")return xXe().languageModel(e);if(!["v4","v3","v2"].includes(e.specificationVersion)){var t=e;throw new YYe({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return Nz(e)}function xXe(){var e;var t=(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:Sce;return gXe(t)}function o6(e){return e.map(function(t){return kz(t)})}function kz(e){return _instanceof(e,URL)?new URL(e.href):Array.isArray(e)?e.map(function(t){return kz(t)}):_instanceof(e,Uint8Array)?new Uint8Array(e):_instanceof(e,ArrayBuffer)?e.slice(0):_instanceof(e,Date)?new Date(e):e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"?Object.fromEntries(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return[t,kz(r)]})):e}var jde="7.0.40",Ude=function(param){var e=param.url,t=param.maxBytes,r=param.abortSignal;return _async_to_generator(function(){var n,i,_$o,a,_tmp,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=e.toString();_state.label=1;case 1:_state.trys.push([1,6,,7]);_$o=Bi({},"ai-sdk/".concat(jde),j2());return[4,aT({url:i,headers:_$o,abortSignal:r})];case 2:a=_state.sent();if(!!a.ok)return[3,4];return[4,Y3(a)];case 3:throw _state.sent(),new Oa({url:i,statusCode:a.status,statusText:a.statusText});case 4:_tmp={};return[4,lT({response:a,url:i,maxBytes:t!=null?t:sT})];case 5:return[2,(_tmp.data=_state.sent(),_tmp.mediaType=(n=a.headers.get("content-type"))!=null?n:void 0,_tmp)];case 6:o=_state.sent();throw Oa.isInstance(o)?o:new Oa({url:i,cause:o});case 7:return[2]}})})()},yXe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ude;return function(t){return Promise.all(t.map(function(r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!r.isUrlSupportedByModel)return[3,1];_tmp=null;return[3,3];case 1:return[4,e(r)];case 2:_tmp=_state.sent();_state.label=3;case 3:return[2,_tmp]}})})()}))}};function c6(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;var r=_object_spread({},e);for(var n in t)if(!(n==="__proto__"||n==="constructor"||n==="prototype")&&Object.prototype.hasOwnProperty.call(t,n)){var i=t[n];if(i===void 0)continue;var o=n in e?e[n]:void 0,a=i!==null&&(typeof i==="undefined"?"undefined":_type_of(i))=="object"&&!Array.isArray(i)&&!_instanceof(i,Date)&&!_instanceof(i,RegExp),s=o!=null&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&!Array.isArray(o)&&!_instanceof(o,Date)&&!_instanceof(o,RegExp);a&&s?r[n]=c6(o,i):r[n]=i}return r}function vXe(e){try{var _e_split=_sliced_to_array(e.split(","),2),t=_e_split[0],r=_e_split[1];return{mediaType:t.split(";")[0].split(":")[1],base64Content:r}}catch(t){return{mediaType:void 0,base64Content:void 0}}}function _Xe(e){if((typeof e==="undefined"?"undefined":_type_of(e))!="object"||e===null)return!1;var t=e.type;return t==="data"||t==="url"||t==="reference"||t==="text"}function mz(e){if(e.protocol==="data:"){var _vXe=vXe(e.toString()),t=_vXe.mediaType,r=_vXe.base64Content;if(t==null||r==null)throw new Sde({content:e,message:"Invalid data URL format in content ".concat(e.toString())});return{data:{type:"data",data:r},mediaType:t}}return{data:{type:"url",url:e},mediaType:void 0}}function hz(e){return _instanceof(e,Uint8Array)?{data:{type:"data",data:e},mediaType:void 0}:_instanceof(e,ArrayBuffer)?{data:{type:"data",data:new Uint8Array(e)},mediaType:void 0}:e6(e)?{data:{type:"data",data:new Uint8Array(e)},mediaType:void 0}:{data:{type:"data",data:e},mediaType:void 0}}function vT(e){if(_Xe(e))switch(e.type){case"data":if(typeof e.data=="string"&&e.data.startsWith("data:"))throw new Sde({content:e.data,message:'Data URLs are not valid inline data. Pass them as { type: "url", url } instead.'});return hz(e.data);case"url":return mz(e.url);case"reference":return{data:{type:"reference",reference:e.reference},mediaType:void 0};case"text":return{data:{type:"text",text:e.text},mediaType:void 0}}if(_instanceof(e,URL))return mz(e);if(typeof e=="string")try{return mz(new URL(e))}catch(t){return hz(e)}return qle(e)?{data:{type:"reference",reference:e},mediaType:void 0}:hz(e)}function Bde(_01){return _async_to_generator(function(param){var e,t,tmp,r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,d,_iterator1,_step1,u,a,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,d10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,u10,p,s,l,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,d11,u11,_u_content,p10,c,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,d12,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator6,_step6,u12,_iteratorNormalCompletion7,_didIteratorError7,_iteratorError7,_iterator7,_step7,u13,_iteratorNormalCompletion8,_didIteratorError8,_iteratorError8,_iterator8,_step8,u14,_iteratorNormalCompletion9,_didIteratorError9,_iteratorError9,_iterator9,_step9,d13;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.prompt,t=param.supportedUrls,tmp=param.download,r=tmp===void 0?yXe():tmp,n=param.provider;return[4,wXe(e.messages,r,t)];case 1:i=_state.sent(),o=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=e.messages[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){d=_step.value;if(d.role==="assistant"&&Array.isArray(d.content))try{for(_iterator1=d.content[Symbol.iterator]();!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){u=_step1.value;u.type==="tool-approval-request"&&"approvalId"in u&&"toolCallId"in u&&o.set(u.approvalId,u.toolCallId)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}a=new Set;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=e.messages[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){d10=_step2.value;if(d10.role==="tool"){_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=d10.content[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){u10=_step3.value;if(u10.type==="tool-approval-response"){p=o.get(u10.approvalId);p&&a.add(p)}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}s=_to_consumable_array(e.instructions!=null?typeof e.instructions=="string"?[{role:"system",content:e.instructions}]:ks(e.instructions).map(function(d){return{role:"system",content:d.content,providerOptions:d.providerOptions}}):[]).concat(_to_consumable_array(e.messages.map(function(d){return bXe({message:d,downloadedAssets:i,provider:n})}))),l=[];_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=s[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){d11=_step4.value;if(d11.role!=="tool"){l.push(d11);continue}u11=l.at(-1);if((u11==null?void 0:u11.role)==="tool"){;p10=u11.content.at(-1);p10!=null&&u11.providerOptions!=null&&(p10.providerOptions=c6(u11.providerOptions,p10.providerOptions)),(_u_content=u11.content).push.apply(_u_content,_to_consumable_array(d11.content)),u11.providerOptions=d11.providerOptions}else l.push(d11)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}c=new Set;_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator5=l[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){d12=_step5.value;switch(d12.role){case"assistant":{_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(_iterator6=d12.content[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){u12=_step6.value;u12.type==="tool-call"&&!u12.providerExecuted&&c.add(u12.toolCallId)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}break}case"tool":{_iteratorNormalCompletion7=true,_didIteratorError7=false,_iteratorError7=undefined;try{for(_iterator7=d12.content[Symbol.iterator]();!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=true){u13=_step7.value;u13.type==="tool-result"&&c.delete(u13.toolCallId)}}catch(err){_didIteratorError7=true;_iteratorError7=err}finally{try{if(!_iteratorNormalCompletion7&&_iterator7.return!=null){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}}break}case"user":case"system":_iteratorNormalCompletion8=true,_didIteratorError8=false,_iteratorError8=undefined;try{for(_iterator8=a[Symbol.iterator]();!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done);_iteratorNormalCompletion8=true){u14=_step8.value;c.delete(u14)}}catch(err){_didIteratorError8=true;_iteratorError8=err}finally{try{if(!_iteratorNormalCompletion8&&_iterator8.return!=null){_iterator8.return()}}finally{if(_didIteratorError8){throw _iteratorError8}}}if(c.size>0)throw new Cce({toolCallIds:Array.from(c)});break}}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}_iteratorNormalCompletion9=true,_didIteratorError9=false,_iteratorError9=undefined;try{for(_iterator9=a[Symbol.iterator]();!(_iteratorNormalCompletion9=(_step9=_iterator9.next()).done);_iteratorNormalCompletion9=true){d13=_step9.value;c.delete(d13)}}catch(err){_didIteratorError9=true;_iteratorError9=err}finally{try{if(!_iteratorNormalCompletion9&&_iterator9.return!=null){_iterator9.return()}}finally{if(_didIteratorError9){throw _iteratorError9}}}if(c.size>0)throw new Cce({toolCallIds:Array.from(c)});return[2,l.filter(function(d){return d.role!=="tool"||d.content.length>0})]}})}).apply(this,arguments)}function bXe(param){var e=param.message,t=param.downloadedAssets,r=param.provider;var n=[],i=e.role;switch(i){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":{if(typeof e.content=="string")return{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions};var o={role:"user",content:e.content.map(function(a){return a.type==="image"&&n.push({type:"deprecated",setting:'"image" content part',message:'The "image" content part type is deprecated. Use a "file" part with mediaType: \'image\' (or a more specific image/* subtype) instead.'}),qde(a)}).map(function(a){return Wde(a,t)}).filter(function(a){return a.type!=="text"||a.text!==""}),providerOptions:e.providerOptions};return n.length>0&&W2({warnings:n}),o}case"assistant":{if(typeof e.content=="string")return{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions};var o10={role:"assistant",content:e.content.filter(function(a){return a.type!=="text"||a.text!==""||a.providerOptions!=null}).filter(function(a){return a.type!=="tool-approval-request"}).map(function(a){var s=a.providerOptions;switch(a.type){case"custom":return{type:"custom",kind:a.kind,providerOptions:s};case"file":{var _vT=vT(a.data),l=_vT.data,c=_vT.mediaType;return{type:"file",data:l,filename:a.filename,mediaType:c!=null?c:a.mediaType,providerOptions:s}}case"reasoning":return{type:"reasoning",text:a.text,providerOptions:s};case"reasoning-file":{var _vT1=vT(a.data),l10=_vT1.data,c10=_vT1.mediaType;if(l10.type!=="data"&&l10.type!=="url")throw new Error("Unsupported reasoning-file data type: ".concat(l10.type));return{type:"reasoning-file",data:l10,mediaType:c10!=null?c10:a.mediaType,providerOptions:s}}case"text":return{type:"text",text:a.text,providerOptions:s};case"tool-call":return{type:"tool-call",toolCallId:a.toolCallId,toolName:a.toolName,input:a.input,providerExecuted:a.providerExecuted,providerOptions:s};case"tool-result":return{type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:Tce({output:a.output,provider:r,warnings:n,downloadedAssets:t}),providerOptions:s}}}),providerOptions:e.providerOptions};return n.length>0&&W2({warnings:n}),o10}case"tool":{var o11={role:"tool",content:e.content.filter(function(a){return a.type!=="tool-approval-response"||a.providerExecuted}).map(function(a){switch(a.type){case"tool-result":return{type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:Tce({output:a.output,provider:r,warnings:n,downloadedAssets:t}),providerOptions:a.providerOptions};case"tool-approval-response":return{type:"tool-approval-response",approvalId:a.approvalId,approved:a.approved,reason:a.reason}}}),providerOptions:e.providerOptions};return n.length>0&&W2({warnings:n}),o11}default:{var o12=i;throw new rXe({role:o12})}}}function qde(e){var t;return e.type!=="image"?e:{type:"file",data:e.image,mediaType:(t=e.mediaType)!=null?t:"image",providerOptions:e.providerOptions}}function wXe(e,t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,s,l,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator2,_step2,s10,_iterator3,_step3,l10,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator4,_step4,s11,_iterator5,_step5,l11,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){a=_step.value;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(a.role==="user"&&Array.isArray(a.content))try{for(_iterator1=a.content[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){s=_step1.value;l=qde(s);l.type==="file"&&n.push(l)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(a.role==="tool"){_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined,_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator2=a.content[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){s10=_step2.value;if(s10.type==="tool-result"&&s10.output.type==="content")try{for(_iterator3=s10.output.value[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step3=_iterator3.next()).done);_iteratorNormalCompletion2=true){l10=_step3.value;l10.type==="file"&&n.push(l10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}if(a.role==="assistant"&&Array.isArray(a.content)){_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined,_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator4=a.content[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step4=_iterator4.next()).done);_iteratorNormalCompletion5=true){s11=_step4.value;if(s11.type==="tool-result"&&s11.output.type==="content")try{for(_iterator5=s11.output.value[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step5=_iterator5.next()).done);_iteratorNormalCompletion4=true){l11=_step5.value;l11.type==="file"&&n.push(l11)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}i=n.map(function(a){var s=a.mediaType,_vT=vT(a.data),l=_vT.data;return{mediaType:s,data:l}}).filter(function(a){return a.data.type==="url"}).map(function(a){return{url:a.data.url,isUrlSupportedByModel:a.mediaType!=null&&Wle({url:a.data.url.toString(),mediaType:a.mediaType,supportedUrls:r})}});return[4,t(i)];case 1:o=_state.sent();return[2,Object.fromEntries(o.map(function(a,s){return a==null?null:[i[s].url.toString(),{data:a.data,mediaType:a.mediaType}]}).filter(function(a){return a!=null}))]}})})()}function Wde(e,t){if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};var _vT=vT(e.data),r=_vT.data,n=_vT.mediaType,i=n!=null?n:e.mediaType,o=r;if(o.type==="url"){var a=t[o.url.toString()];a&&(o={type:"data",data:a.data},a.mediaType!=null&&(i==null||!qu(i))&&(i=a.mediaType))}if(o.type==="data"&&(_instanceof(o.data,Uint8Array)||typeof o.data=="string")){var a9=ez({data:o.data,topLevelType:"image"});a9!=null&&(i=a9)}if(i==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:i,filename:e.filename,data:o,providerOptions:e.providerOptions}}function Tce(param){var e=param.output,t=param.provider,tmp=param.warnings,r=tmp===void 0?[]:tmp,n=param.downloadedAssets;return e.type!=="content"?e:{type:"content",value:e.value.map(function(i){var o;switch(i.type){case"file":{var a=Wde(i,n);if(a.type!=="file")throw new Error("Expected tool result file content to convert to file.");return a}case"file-data":return r.push({type:"deprecated",setting:'"tool-result" content of type "file-data"',message:'The "file-data" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'data\', data } instead.'}),{type:"file",data:{type:"data",data:i.data},filename:i.filename,mediaType:i.mediaType,providerOptions:i.providerOptions};case"file-url":{var a9=(o=i.mediaType)!=null?o:SXe(i.url),s='The "file-url" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'url\', url } instead.';if(!i.mediaType){var l=a9==="application/octet-stream"?"Unable to infer media type from URL. Defaulting to 'application/octet-stream'.":"Inferred media type '".concat(a9,"' from URL.");s='The "file-url" tool result content part with URL "'.concat(i.url,'" is missing a "mediaType". ').concat(l," ").concat(s)}return r.push({type:"deprecated",setting:'"tool-result" content of type "file-url"',message:s}),{type:"file",data:{type:"url",url:new URL(i.url)},mediaType:a9,providerOptions:i.providerOptions}}case"file-id":return r.push({type:"deprecated",setting:'"tool-result" content of type "file-id"',message:'The "file-id" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'reference\', reference } instead.'}),{type:"file",data:{type:"reference",reference:Ace({fileId:i.fileId,provider:t})},mediaType:"application",providerOptions:i.providerOptions};case"file-reference":return r.push({type:"deprecated",setting:'"tool-result" content of type "file-reference"',message:'The "file-reference" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'reference\', reference } instead.'}),{type:"file",data:{type:"reference",reference:i.providerReference},mediaType:"application",providerOptions:i.providerOptions};case"image-data":return r.push({type:"deprecated",setting:'"tool-result" content of type "image-data"',message:'The "image-data" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'data\', data } instead.'}),{type:"file",data:{type:"data",data:i.data},mediaType:i.mediaType,providerOptions:i.providerOptions};case"image-url":return r.push({type:"deprecated",setting:'"tool-result" content of type "image-url"',message:"The \"image-url\" type for tool result content is deprecated. Use the \"file\" type with mediaType 'image' (or a specific image/* subtype) and { type: 'url', url } instead."}),{type:"file",data:{type:"url",url:new URL(i.url)},mediaType:"image",providerOptions:i.providerOptions};case"image-file-id":return r.push({type:"deprecated",setting:'"tool-result" content of type "image-file-id"',message:'The "image-file-id" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'reference\', reference } instead.'}),{type:"file",data:{type:"reference",reference:Ace({fileId:i.fileId,provider:t})},mediaType:"image",providerOptions:i.providerOptions};case"image-file-reference":return r.push({type:"deprecated",setting:'"tool-result" content of type "image-file-reference"',message:'The "image-file-reference" type for tool result content is deprecated. Use the "file" type with mediaType and { type: \'reference\', reference } instead.'}),{type:"file",data:{type:"reference",reference:i.providerReference},mediaType:"image",providerOptions:i.providerOptions};default:return i}})}}function Ace(param){var e=param.fileId,t=param.provider;if((typeof e==="undefined"?"undefined":_type_of(e))=="object")return e;if(t==null)throw new Error("Cannot convert string fileId to provider reference without a provider ID. Use a Record<string, string> fileId or switch to the file-reference type.");return _define_property({},t,e)}var Ice={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",avif:"image/avif",heic:"image/heic",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",pdf:"application/pdf",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg"};function SXe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"application/octet-stream";var r;try{var i=(r=new URL(e).pathname.split(".").pop())==null?void 0:r.toLowerCase();if(i&&Object.hasOwn(Ice,i))return Ice[i]}catch(n){}return t}function h0(_01){return _async_to_generator(function(param){var e,t,r,n,i,_tmp,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCallId,t=param.input,r=param.output,n=param.tool,i=param.errorMode;if(!(i==="text"))return[3,1];_tmp={type:"error-text",value:xa(r)};return[3,7];case 1:if(!(i==="json"))return[3,2];_tmp1={type:"error-json",value:Pce(r)};return[3,6];case 2:if(!(n!=null&&n.toModelOutput))return[3,4];return[4,n.toModelOutput({toolCallId:e,input:t,output:r})];case 3:_tmp2=_state.sent();return[3,5];case 4:_tmp2=typeof r=="string"?{type:"text",value:r}:{type:"json",value:Pce(r)};_state.label=5;case 5:_tmp1=_tmp2;_state.label=6;case 6:_tmp=_tmp1;_state.label=7;case 7:return[2,_tmp]}})}).apply(this,arguments)}function Pce(e){return e===void 0?null:e}function Cz(param){var e=param.maxOutputTokens,t=param.temperature,r=param.topP,n=param.topK,i=param.presencePenalty,o=param.frequencyPenalty,a=param.seed,s=param.stopSequences,l=param.reasoning;if(e!=null){if(!Number.isInteger(e))throw new Qd({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new Qd({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new Qd({parameter:"temperature",value:t,message:"temperature must be a number"});if(r!=null&&typeof r!="number")throw new Qd({parameter:"topP",value:r,message:"topP must be a number"});if(n!=null&&typeof n!="number")throw new Qd({parameter:"topK",value:n,message:"topK must be a number"});if(i!=null&&typeof i!="number")throw new Qd({parameter:"presencePenalty",value:i,message:"presencePenalty must be a number"});if(o!=null&&typeof o!="number")throw new Qd({parameter:"frequencyPenalty",value:o,message:"frequencyPenalty must be a number"});if(a!=null&&!Number.isInteger(a))throw new Qd({parameter:"seed",value:a,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:r,topK:n,presencePenalty:i,frequencyPenalty:o,stopSequences:s,seed:a,reasoning:l}}function Dz(param){var e=param.toolChoice;return e==null?{type:"auto"}:typeof e=="string"?{type:e}:{type:"tool",toolName:e.toolName}}function kXe(e){return e!=null&&Object.keys(e).length>0}function Lz(_01){return _async_to_generator(function(param){var e,t,tmp,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,o,a,s,l,c,d,u,_,_tmp,l10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.tools,t=param.toolOrder,tmp=param.toolsContext,r=tmp===void 0?{}:tmp,n=param.experimental_sandbox;if(!kXe(e))return[2];i=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=CXe({tools:e,toolOrder:t})[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];_step_value=_sliced_to_array(_step.value,2),o=_step_value[0],a=_step_value[1];s=a.type;switch(s){case void 0:return[3,3];case"dynamic":return[3,3];case"function":return[3,3];case"provider":return[3,5]}return[3,6];case 3:l=EXe({tool:a,toolName:o,toolsContext:r,experimental_sandbox:n}),c=a.providerOptions,d=a.inputExamples,u=a.strict;_=i.push;_tmp={type:"function",name:o};return[4,Wu(a.inputSchema).jsonSchema];case 4:_.apply(i,[_object_spread.apply(void 0,[(_tmp.inputSchema=_state.sent(),_tmp),l!=null?{description:l}:{},d!=null?{inputExamples:d}:{},c!=null?{providerOptions:c}:{},u!=null?{strict:u}:{}])]);return[3,7];case 5:{i.push({type:"provider",name:o,id:a.id,args:a.args});return[3,7]}_state.label=6;case 6:{l10=s;throw new Error("Unsupported tool type: ".concat(l10))}_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,i]}})}).apply(this,arguments)}function CXe(param){var e=param.tools,t=param.toolOrder;if(t==null)return Object.entries(e);var r=Object.entries(e),n=r.filter(function(param){var _param=_sliced_to_array(param,1),o=_param[0];return t.includes(o)}).sort(function(param,param1){var _param=_sliced_to_array(param,1),o=_param[0],_param1=_sliced_to_array(param1,1),a=_param1[0];return t.indexOf(o)-t.indexOf(a)}),i=r.filter(function(param){var _param=_sliced_to_array(param,1),o=_param[0];return!t.includes(o)}).sort(function(param,param1){var _param=_sliced_to_array(param,1),o=_param[0],_param1=_sliced_to_array(param1,1),a=_param1[0];return o<a?-1:o>a?1:0});return _to_consumable_array(n).concat(_to_consumable_array(i))}function EXe(param){var e=param.tool,t=param.toolName,r=param.toolsContext,n=param.experimental_sandbox;return e.description===void 0?void 0:typeof e.description=="string"?e.description:e.description({context:r[t],experimental_sandbox:n})}function Vde(e){if(e!=null)return typeof e=="number"?e:e.totalMs}function Gde(e){if(!(e==null||typeof e=="number"))return e.stepMs}function TXe(e){if(!(e==null||typeof e=="number"))return e.firstChunkMs}function AXe(e){if(!(e==null||typeof e=="number"))return e.chunkMs}function IXe(e,t){var r,n;if(!(e==null||typeof e=="number"))return(n=(r=e.tools)==null?void 0:r["".concat(t,"Ms")])!=null?n:e.toolMs}var g0=f.lazy(function(){return f.union([f.null(),f.string(),f.number(),f.boolean(),f.record(f.string(),g0.optional()),f.array(g0)])}),It=f.record(f.string(),f.record(f.string(),g0.optional())),d6=f.union([f.string(),f.instanceof(Uint8Array),f.instanceof(ArrayBuffer),f.custom(e6,{message:"Must be a Buffer"})]),Fz=f.record(f.string(),f.string()),Hde=f.object({type:f.literal("text"),text:f.string(),providerOptions:It.optional()}),PXe=f.object({type:f.literal("image"),image:f.union([d6,f.instanceof(URL),Fz]),mediaType:f.string().optional(),providerOptions:It.optional()}),Zde=f.discriminatedUnion("type",[f.object({type:f.literal("data"),data:d6}),f.object({type:f.literal("url"),url:f.instanceof(URL)}),f.object({type:f.literal("reference"),reference:Fz}),f.object({type:f.literal("text"),text:f.string()})]),RXe=f.discriminatedUnion("type",[f.object({type:f.literal("data"),data:d6}),f.object({type:f.literal("url"),url:f.instanceof(URL)})]),Kde=f.object({type:f.literal("file"),data:f.union([Zde,d6,f.instanceof(URL),Fz]),filename:f.string().optional(),mediaType:f.string(),providerOptions:It.optional()}),MXe=f.object({type:f.literal("reasoning"),text:f.string(),providerOptions:It.optional()}),OXe=f.object({type:f.literal("custom"),kind:f.string().transform(function(e){return e}),providerOptions:It.optional()}),$Xe=f.object({type:f.literal("reasoning-file"),data:f.union([RXe,d6,f.instanceof(URL)]),mediaType:f.string(),providerOptions:It.optional()}),NXe=f.object({type:f.literal("tool-call"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerOptions:It.optional(),providerExecuted:f.boolean().optional()}),DXe=f.discriminatedUnion("type",[f.object({type:f.literal("text"),value:f.string(),providerOptions:It.optional()}),f.object({type:f.literal("json"),value:g0,providerOptions:It.optional()}),f.object({type:f.literal("execution-denied"),reason:f.string().optional(),providerOptions:It.optional()}),f.object({type:f.literal("error-text"),value:f.string(),providerOptions:It.optional()}),f.object({type:f.literal("error-json"),value:g0,providerOptions:It.optional()}),f.object({type:f.literal("content"),value:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),providerOptions:It.optional()}),f.object({type:f.literal("file"),data:Zde,mediaType:f.string(),filename:f.string().optional(),providerOptions:It.optional()}),f.object({type:f.literal("file-data"),data:f.string(),mediaType:f.string(),filename:f.string().optional(),providerOptions:It.optional()}),f.object({type:f.literal("file-url"),url:f.string(),mediaType:f.string().optional(),providerOptions:It.optional()}),f.object({type:f.literal("file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:It.optional()}),f.object({type:f.literal("file-reference"),providerReference:f.record(f.string(),f.string()),providerOptions:It.optional()}),f.object({type:f.literal("image-data"),data:f.string(),mediaType:f.string(),providerOptions:It.optional()}),f.object({type:f.literal("image-url"),url:f.string(),providerOptions:It.optional()}),f.object({type:f.literal("image-file-id"),fileId:f.union([f.string(),f.record(f.string(),f.string())]),providerOptions:It.optional()}),f.object({type:f.literal("image-file-reference"),providerReference:f.record(f.string(),f.string()),providerOptions:It.optional()}),f.object({type:f.literal("custom"),providerOptions:It.optional()})]))})]),Qde=f.object({type:f.literal("tool-result"),toolCallId:f.string(),toolName:f.string(),output:DXe,providerOptions:It.optional()}),LXe=f.object({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string()}),FXe=f.object({type:f.literal("tool-approval-response"),approvalId:f.string(),approved:f.boolean(),reason:f.string().optional()}),zXe=f.object({role:f.literal("system"),content:f.string(),providerOptions:It.optional()}),jXe=f.object({role:f.literal("user"),content:f.union([f.string(),f.array(f.union([Hde,PXe,Kde]))]),providerOptions:It.optional()}),UXe=f.object({role:f.literal("assistant"),content:f.union([f.string(),f.array(f.union([Hde,OXe,Kde,MXe,$Xe,NXe,Qde,LXe]))]),providerOptions:It.optional()}),BXe=f.object({role:f.literal("tool"),content:f.array(f.union([Qde,FXe])),providerOptions:It.optional()}),qXe=f.union([zXe,jXe,UXe,BXe]);function zz(_01){return _async_to_generator(function(param){var tmp,e,t,tmp1,r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:tmp=param.allowSystemInMessages,e=tmp===void 0?!1:tmp,t=param.system,tmp1=param.instructions,r=tmp1===void 0?t:tmp1,n=param.prompt,i=param.messages;if(n==null&&i==null)throw new Gl({prompt:n,message:"prompt or messages must be defined"});if(n!=null&&i!=null)throw new Gl({prompt:n,message:"prompt and messages cannot be defined at the same time"});if(typeof r!="string"&&!ks(r).every(function(a){return a.role==="system"}))throw new Gl({prompt:n,message:"instructions must be a string, SystemModelMessage, or array of SystemModelMessage"});if(n!=null&&typeof n=="string")i=[{role:"user",content:n}];else if(n!=null&&Array.isArray(n))i=n;else if(i==null)throw new Gl({prompt:n,message:"prompt or messages must be defined"});if(i.length===0)throw new Gl({prompt:n,message:"messages must not be empty"});if(!e&&i.some(function(a){return a.role==="system"}))throw new Gl({prompt:n,message:"System messages are not allowed in the prompt or messages fields. Use the instructions option instead."});return[4,ta({value:i,schema:f.array(qXe)})];case 1:o=_state.sent();if(!o.success)throw new Gl({prompt:n,message:"The messages do not match the ModelMessage[] schema.",cause:o.error});return[2,{messages:i,instructions:r}]}})}).apply(this,arguments)}function Jde(e){if(!t6.isInstance(e))return e;var t=(process==null?void 0:"production")==="production",r="https://ai-sdk.dev/unauthenticated-ai-gateway";return t?new Ze({name:"GatewayError",message:"Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ".concat(r)}):Object.assign(new Error("\x1b[1m\x1b[31mUnauthenticated request to AI Gateway.\x1b[0m\n\nTo authenticate, set the \x1b[33mAI_GATEWAY_API_KEY\x1b[0m environment variable with your API key.\n\nAlternatively, you can use a provider module instead of the AI Gateway.\n\nLearn more: \x1b[34m".concat(r,"\x1b[0m\n\n")),{name:"GatewayAuthenticationError"})}function Yde(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:hf(e.inputTokens.total,e.outputTokens.total),raw:e.raw}}function gz(){return{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}}function Xde(e,t){var r,n,i,o,a,s,l,c,d,u;return{inputTokens:hf(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:hf((r=e.inputTokenDetails)==null?void 0:r.noCacheTokens,(n=t.inputTokenDetails)==null?void 0:n.noCacheTokens),cacheReadTokens:hf((i=e.inputTokenDetails)==null?void 0:i.cacheReadTokens,(o=t.inputTokenDetails)==null?void 0:o.cacheReadTokens),cacheWriteTokens:hf((a=e.inputTokenDetails)==null?void 0:a.cacheWriteTokens,(s=t.inputTokenDetails)==null?void 0:s.cacheWriteTokens)},outputTokens:hf(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:hf((l=e.outputTokenDetails)==null?void 0:l.textTokens,(c=t.outputTokenDetails)==null?void 0:c.textTokens),reasoningTokens:hf((d=e.outputTokenDetails)==null?void 0:d.reasoningTokens,(u=t.outputTokenDetails)==null?void 0:u.reasoningTokens)},totalTokens:hf(e.totalTokens,t.totalTokens)}}function hf(e,t){return e==null&&t==null?void 0:(e!=null?e:0)+(t!=null?t:0)}function si(e,t){return e!=null&&Object.hasOwn(e,t)?e[t]:void 0}function jz(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var t=mf.apply(void 0,_to_consumable_array(e)).map(function(r){return _instanceof(r,AbortSignal)?r:AbortSignal.timeout(r)});return t.length===0?void 0:t.length===1?t[0]:AbortSignal.any(t)}function l6(){var e,t;return(t=(e=globalThis==null?void 0:globalThis.performance)==null?void 0:e.now())!=null?t:Date.now()}function go(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all(ks(e.callbacks).map(function(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,t==null?void 0:t(e.event)];case 1:_state.sent();return[3,3];case 2:r=_state.sent();return[3,3];case 3:return[2]}})})()}))];case 1:_state.sent();return[2]}})})()}function WXe(param){var e=param.error,t=param.exponentialBackoffDelay;var r=Rr.isInstance(e)?e.responseHeaders:Rr.isInstance(e.cause)?e.cause.responseHeaders:void 0;if(!r)return t;var n,i=r["retry-after-ms"];if(i){var a=parseFloat(i);Number.isNaN(a)||(n=a)}var o=r["retry-after"];if(o&&n===void 0){var a9=parseFloat(o);Number.isNaN(a9)?n=Date.parse(o)-Date.now():n=a9*1e3}return n!=null&&!Number.isNaN(n)&&0<=n&&(n<60*1e3||n<t)?n:t}var VXe=function(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.maxRetries,e=tmp===void 0?2:tmp,tmp1=_ref.initialDelayInMs,t=tmp1===void 0?2e3:tmp1,tmp2=_ref.backoffFactor,r=tmp2===void 0?2:tmp2,n=_ref.abortSignal;return Jle({maxRetries:e,initialDelayInMs:t,backoffFactor:r,abortSignal:n,shouldRetry:function(i){return _instanceof(i,Error)&&(Rr.isInstance(i)&&i.isRetryable===!0||ho.isInstance(i)&&i.isRetryable===!0)},getDelayInMs:function(param){var i=param.error,o=param.exponentialBackoffDelay;return WXe({error:i,exponentialBackoffDelay:o})},createRetryError:function(param){var i=param.message,o=param.reason,a=param.errors;return new aXe({message:i,reason:o,errors:a})}})};function Ez(param){var e=param.maxRetries,t=param.abortSignal;if(e!=null){if(!Number.isInteger(e))throw new Qd({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new Qd({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}var r=e!=null?e:2;return{maxRetries:r,retry:VXe({maxRetries:r,abortSignal:t})}}function xT(param){var e=param.abortController,t=param.label,r=param.timeoutMs;if(!(e==null||r==null))return setTimeout(function(){return e.abort(new DOMException("".concat(t," timeout of ").concat(r,"ms exceeded"),"TimeoutError"))},r)}function ch(param){var e=param.tokens,t=param.durationMs;var r=1e3*(e!=null?e:0)/(t!=null?t:0);return Number.isFinite(r)?r:0}function epe(param){var e=param.messages;var t=e.at(-1);if((t==null?void 0:t.role)!="tool")return{approvedToolApprovals:[],deniedToolApprovals:[]};var r=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;if(l.role==="assistant"&&typeof l.content!="string"){var c=l.content;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=c[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d=_step1.value;d.type==="tool-call"&&(r[d.toolCallId]=d)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=Object.create(null);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=e[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var l10=_step2.value;if(l10.role==="assistant"&&typeof l10.content!="string"){var c10=l10.content;var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=c10[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var d10=_step3.value;d10.type==="tool-approval-request"&&(n[d10.approvalId]=d10)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var i=Object.create(null);var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=t.content[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var l11=_step4.value;l11.type==="tool-result"&&(i[l11.toolCallId]=l11)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}var o=[],a=[],s=t.content.filter(function(l){return l.type==="tool-approval-response"});var _iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(var _iterator5=s[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var l12=_step5.value;var c11=n[l12.approvalId];if(c11==null)throw new wYe({approvalId:l12.approvalId});var d11=i[c11.toolCallId];if(d11!=null&&(l12.approved||d11.output.type!=="execution-denied"))continue;var u=r[c11.toolCallId];if(u==null)throw new $z({toolCallId:c11.toolCallId,approvalId:c11.approvalId});var p=_object_spread({approvalRequest:c11,approvalResponse:l12,toolCall:u},d11!=null?{existingToolResult:d11}:{});l12.approved?o.push(p):a.push(p)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}return{approvedToolApprovals:o,deniedToolApprovals:a}}function Tz(_01){return _async_to_generator(function(param){var e,t,r,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolName,t=param.context,r=param.contextSchema;if(!(r==null))return[3,1];_tmp=t;return[3,3];case 1:return[4,ur({value:t,schema:r,context:{field:"tool context",entityName:e}})];case 2:_tmp=_state.sent();_state.label=3;case 3:return[2,_tmp]}})}).apply(this,arguments)}function Uz(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,tmp,u,tmp1,p,m,h,g,x,v,y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCall,t=param.tools,r=param.toolsContext,n=param.callId,i=param.messages,o=param.abortSignal,a=param.timeout,s=param.experimental_sandbox,l=param.onPreliminaryToolResult,c=param.onToolExecutionStart,d=param.onToolExecutionEnd,tmp=param.executeToolInTelemetryContext,u=tmp===void 0?function(param){var m=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,m()];case 1:return[2,_state.sent()]}})})()}:tmp,tmp1=param.runInTracingChannelSpan,p=tmp1===void 0?function(param){var m=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,m()];case 1:return[2,_state.sent()]}})})()}:tmp1;m=e.toolName,h=e.toolCallId,g=e.input,x=si(t,m);if(!mT(x))return[2];return[4,Tz({toolName:m,context:si(r,m),contextSchema:x.contextSchema})];case 1:v=_state.sent(),y={toolCall:e,messages:i,toolContext:v},_=_object_spread({callId:n},y);return[4,p({type:"executeTool",event:_,execute:function(){return _async_to_generator(function(){var b,w,S,k,C,T,E;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,go({event:_,callbacks:c})];case 1:_state.sent();w=IXe(a,m),S=jz(o,w),k=0;_state.label=2;case 2:_state.trys.push([2,4,,6]);return[4,u(_object_spread_props(_object_spread({callId:n,toolCallId:h},y),{execute:function(){return _async_to_generator(function(){var _$C,T,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,I,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_$C=l6();_state.label=1;case 1:_state.trys.push([1,,14,15]);T=aue({tool:x,input:g,options:{toolCallId:h,messages:i,abortSignal:S,context:v,experimental_sandbox:s}});_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=2;case 2:_state.trys.push([2,7,8,13]);_iterator=_async_iterator(T);_state.label=3;case 3:return[4,_iterator.next()];case 4:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,6];_value=_step.value;I=_value;I.type==="preliminary"?l==null||l(_object_spread_props(_object_spread({},e),{type:"tool-result",output:I.output,preliminary:!0})):b=I.output;_state.label=5;case 5:_iteratorAbruptCompletion=false;return[3,3];case 6:return[3,13];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 8:_state.trys.push([8,,11,12]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,10];return[4,_iterator.return()];case 9:_state.sent();_state.label=10;case 10:return[3,12];case 11:if(_didIteratorError){throw _iteratorError}return[7];case 12:return[7];case 13:return[3,15];case 14:k=l6()-_$C;return[7];case 15:return[2]}})})()}}))];case 3:_state.sent();return[3,6];case 4:C=_state.sent();T=_object_spread({type:"tool-error",toolCallId:h,toolName:m,input:g,error:C,dynamic:x.type==="dynamic"},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{});return[4,go({event:_object_spread_props(_object_spread({},_),{toolOutput:T,toolExecutionMs:k}),callbacks:d})];case 5:return[2,(_state.sent(),{output:T,toolExecutionMs:k})];case 6:E=_object_spread({type:"tool-result",toolCallId:h,toolName:m,input:g,output:b,dynamic:x.type==="dynamic"},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{});return[4,go({event:_object_spread_props(_object_spread({},_),{toolOutput:E,toolExecutionMs:k}),callbacks:d})];case 7:return[2,(_state.sent(),{output:E,toolExecutionMs:k})]}})})()}})];case 2:return[2,_state.sent()]}})}).apply(this,arguments)}function tpe(param){var e=param.tools,t=param.activeTools;return e==null||t==null?e:Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,1),r=_param[0];return t.includes(r)}))}var Bz=/*#__PURE__*/function(){"use strict";function Bz1(param){var e=param.data,t=param.mediaType;_class_call_check(this,Bz1);var r=_instanceof(e,Uint8Array);this.base64Data=r?void 0:e,this.uint8ArrayData=r?e:void 0,this.mediaType=t}_create_class(Bz1,[{key:"base64",get:function get1(){return this.base64Data==null&&(this.base64Data=Jl(this.uint8ArrayData)),this.base64Data}},{key:"uint8Array",get:function get1(){return this.uint8ArrayData==null&&(this.uint8ArrayData=Ui(this.base64Data)),this.uint8ArrayData}}]);return Bz1}(),GXe=/*#__PURE__*/function(Bz1){"use strict";_inherits(GXe1,Bz1);function GXe1(e){_class_call_check(this,GXe1);var _this;_this=_call_super(this,GXe1,[e]),_this.type="file";return _this}return GXe1}(Bz),HXe={};hYe(HXe,{array:function(){return QXe},choice:function(){return JXe},json:function(){return YXe},object:function(){return KXe},text:function(){return _T}});function ZXe(e){var t=["ROOT"],r=-1,n=null,i=0;function o(d){return d>="0"&&d<="9"||d>="A"&&d<="F"||d>="a"&&d<="f"}function a(d,u,p){switch(d){case'"':{r=u,t.pop(),t.push(p),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{r=u,n=u,t.pop(),t.push(p),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(p),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=u,t.pop(),t.push(p),t.push("INSIDE_NUMBER");break}case"{":{r=u,t.pop(),t.push(p),t.push("INSIDE_OBJECT_START");break}case"[":{r=u,t.pop(),t.push(p),t.push("INSIDE_ARRAY_START");break}}}function s(d,u){switch(d){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{r=u,t.pop();break}}}function l(d,u){switch(d){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=u,t.pop();break}}}for(var d=0;d<e.length;d++){var u=e[d];switch(t[t.length-1]){case"ROOT":a(u,d,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{r=d,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(u){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{a(u,d,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(u,d);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),r=d;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:r=d}break}case"INSIDE_ARRAY_START":{switch(u){case"]":{r=d,t.pop();break}default:{r=d,a(u,d,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=d,t.pop();break}default:{r=d;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{a(u,d,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),u==="u"?(i=0,t.push("INSIDE_STRING_UNICODE_ESCAPE")):r=d;break}case"INSIDE_STRING_UNICODE_ESCAPE":{o(u)&&(i++,i===4&&(t.pop(),r=d));break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=d;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,d),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(u,d);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(u,d);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,d);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{var m=e.substring(n,d+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(u,d):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(u,d)):r=d;break}}}var c=e.slice(0,r+1);for(var d10=t.length-1;d10>=0;d10--)switch(t[d10]){case"INSIDE_STRING":{c+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{c+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{c+="]";break}case"INSIDE_LITERAL":{var p=e.substring(n,e.length);"true".startsWith(p)?c+="true".slice(p.length):"false".startsWith(p)?c+="false".slice(p.length):"null".startsWith(p)&&(c+="null".slice(p.length))}}return c}function p6(e){return _async_to_generator(function(){var t,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e===void 0)return[2,{value:void 0,state:"undefined-input"}];return[4,Ji({text:e})];case 1:t=_state.sent();if(!t.success)return[3,2];_tmp={value:t.value,state:"successful-parse"};return[3,4];case 2:return[4,Ji({text:ZXe(e)})];case 3:_tmp=(t=_state.sent(),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"});_state.label=4;case 4:return[2,_tmp]}})})()}var _T=function(){return{name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:function parseCompleteOutput(_01){return _async_to_generator(function(param){var e;return _ts_generator(this,function(_state){e=param.text;return[2,e]})}).apply(this,arguments)},parsePartialOutput:function parsePartialOutput(_01){return _async_to_generator(function(param){var e;return _ts_generator(this,function(_state){e=param.text;return[2,{partial:e}]})}).apply(this,arguments)},createElementStreamTransform:function createElementStreamTransform(){}}},KXe=function(param){var e=param.schema,t=param.name,r=param.description;var n=Wu(e);return{name:"object",responseFormat:Kt(n.jsonSchema).then(function(i){return _object_spread({type:"json",schema:i},t!=null&&{name:t},r!=null&&{description:r})}),parseCompleteOutput:function parseCompleteOutput(_01,_11){return _async_to_generator(function(param,o){var i,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=param.text;return[4,Ji({text:i})];case 1:a=_state.sent();if(!a.success)throw new ph({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});return[4,ta({value:a.value,schema:n})];case 2:s=_state.sent();if(!s.success)throw new ph({message:"No object generated: response did not match schema.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});return[2,s.value]}})}).apply(this,arguments)},parsePartialOutput:function parsePartialOutput(_01){return _async_to_generator(function(param){var i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=param.text;return[4,p6(i)];case 1:o=_state.sent();switch(o.state){case"failed-parse":case"undefined-input":return[2];case"repaired-parse":case"successful-parse":return[2,{partial:o.value}]}return[2]}})}).apply(this,arguments)},createElementStreamTransform:function createElementStreamTransform(){}}},QXe=function(param){var e=param.element,t=param.name,r=param.description;var n=Wu(e);return{name:"array",responseFormat:Kt(n.jsonSchema).then(function(i){var o=i.$schema,a=_object_without_properties(i,["$schema"]);return _object_spread({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1}},t!=null&&{name:t},r!=null&&{description:r})}),parseCompleteOutput:function parseCompleteOutput(_01,_11){return _async_to_generator(function(param,o){var i,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=param.text;return[4,Ji({text:i})];case 1:a=_state.sent();if(!a.success)throw new ph({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});s=a.value;if(s==null||(typeof s==="undefined"?"undefined":_type_of(s))!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new ph({message:"No object generated: response did not match schema.",cause:new Nu({value:s,cause:"response must be an object with an elements array"}),text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});l=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=s.elements[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];c=_step.value;return[4,ta({value:c,schema:n})];case 4:d=_state.sent();if(!d.success)throw new ph({message:"No object generated: response did not match schema.",cause:d.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});l.push(d.value);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,l]}})}).apply(this,arguments)},parsePartialOutput:function parsePartialOutput(_01){return _async_to_generator(function(param){var i,o,_,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=param.text;return[4,p6(i)];case 1:o=_state.sent();_=o.state;switch(_){case"failed-parse":return[3,2];case"undefined-input":return[3,2];case"repaired-parse":return[3,3];case"successful-parse":return[3,3]}return[3,12];case 2:return[2];case 3:a=o.value;if(a==null||(typeof a==="undefined"?"undefined":_type_of(a))!="object"||!("elements"in a)||!Array.isArray(a.elements))return[2];s=o.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,9,10,11]);_iterator=s[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];c=_step.value;return[4,ta({value:c,schema:n})];case 6:d=_state.sent();d.success&&l.push(d.value);_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,{partial:l}];case 12:return[2]}})}).apply(this,arguments)},createElementStreamTransform:function createElementStreamTransform(){var i=0;return new TransformStream({transform:function transform(param,a){var o=param.partialOutput;if(o!=null)for(;i<o.length;i++)a.enqueue(o[i])}})}}},JXe=function(param){var e=param.options,t=param.name,r=param.description;return{name:"choice",responseFormat:Promise.resolve(_object_spread({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1}},t!=null&&{name:t},r!=null&&{description:r})),parseCompleteOutput:function parseCompleteOutput(_01,_11){return _async_to_generator(function(param,i){var n,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=param.text;return[4,Ji({text:n})];case 1:o=_state.sent();if(!o.success)throw new ph({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:i.response,usage:i.usage,finishReason:i.finishReason});a=o.value;if(a==null||(typeof a==="undefined"?"undefined":_type_of(a))!="object"||!("result"in a)||typeof a.result!="string"||!e.includes(a.result))throw new ph({message:"No object generated: response did not match schema.",cause:new Nu({value:a,cause:"response must be an object that contains a choice value."}),text:n,response:i.response,usage:i.usage,finishReason:i.finishReason});return[2,a.result]}})}).apply(this,arguments)},parsePartialOutput:function parsePartialOutput(_01){return _async_to_generator(function(param){var n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=param.text;return[4,p6(n)];case 1:i=_state.sent();switch(i.state){case"failed-parse":case"undefined-input":return[2];case"repaired-parse":case"successful-parse":{o=i.value;if(o==null||(typeof o==="undefined"?"undefined":_type_of(o))!="object"||!("result"in o)||typeof o.result!="string")return[2];a=e.filter(function(s){return s.startsWith(o.result)});return[2,i.state==="successful-parse"?a.includes(o.result)?{partial:o.result}:void 0:a.length===1?{partial:a[0]}:void 0]}}return[2]}})}).apply(this,arguments)},createElementStreamTransform:function createElementStreamTransform(){}}},YXe=function(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=_ref.name,t=_ref.description;return{name:"json",responseFormat:Promise.resolve(_object_spread({type:"json"},e!=null&&{name:e},t!=null&&{description:t})),parseCompleteOutput:function parseCompleteOutput(_01,_11){return _async_to_generator(function(param,n){var r,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=param.text;return[4,Ji({text:r})];case 1:i=_state.sent();if(!i.success)throw new ph({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return[2,i.value]}})}).apply(this,arguments)},parsePartialOutput:function parsePartialOutput(_01){return _async_to_generator(function(param){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=param.text;return[4,p6(r)];case 1:n=_state.sent();switch(n.state){case"failed-parse":case"undefined-input":return[2];case"repaired-parse":case"successful-parse":return[2,n.value===void 0?void 0:{partial:n.value}]}return[2]}})}).apply(this,arguments)},createElementStreamTransform:function createElementStreamTransform(){}}};function rpe(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,_tmp,_tmp1,a,s,l,_tmp2,a9,s10,_$l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCall,t=param.tools,r=param.repairToolCall,n=param.refineToolInput,i=param.messages,o=param.instructions;_state.label=1;case 1:_state.trys.push([1,16,,18]);if(!(t==null))return[3,5];if(!(e.providerExecuted&&e.dynamic))return[3,4];_tmp={};return[4,npe(e)];case 2:return[4,xz.apply(void 0,[(_tmp.toolCall=_state.sent(),_tmp.refineToolInput=n,_tmp)])];case 3:return[2,_state.sent()];case 4:throw new Sz({toolName:e.toolName});case 5:_state.trys.push([5,8,,15]);_tmp1={};return[4,Rce({toolCall:e,tools:t})];case 6:return[4,xz.apply(void 0,[(_tmp1.toolCall=_state.sent(),_tmp1.refineToolInput=n,_tmp1)])];case 7:return[2,_state.sent()];case 8:a=_state.sent();if(r==null||!(Sz.isInstance(a)||bT.isInstance(a)))throw a;s=null;_state.label=9;case 9:_state.trys.push([9,11,,12]);return[4,r({toolCall:e,tools:t,inputSchema:function(param){var _$l=param.toolName;return _async_to_generator(function(){var c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:d=(c=si(t,_$l))==null?void 0:c.inputSchema;return[4,Wu(d).jsonSchema];case 1:return[2,_state.sent()]}})})()},instructions:o,system:o,messages:i,error:a})];case 10:s=_state.sent();return[3,12];case 11:l=_state.sent();throw new JYe({cause:l,originalError:a});case 12:if(s==null)throw a;_tmp2={};return[4,Rce({toolCall:s,tools:t})];case 13:return[4,xz.apply(void 0,[(_tmp2.toolCall=_state.sent(),_tmp2.refineToolInput=n,_tmp2)])];case 14:return[2,_state.sent()];case 15:return[3,18];case 16:a9=_state.sent();return[4,Ji({text:e.input})];case 17:s10=_state.sent(),_$l=s10.success?s10.value:e.input,c=si(t,e.toolName);return[2,_object_spread({type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:_$l,dynamic:!0,invalid:!0,error:a9,title:c==null?void 0:c.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata},(c==null?void 0:c.metadata)!=null?{toolMetadata:c.metadata}:{})];case 18:return[2]}})}).apply(this,arguments)}function xz(_01){return _async_to_generator(function(param){var e,t,r,_tmp,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCall,t=param.refineToolInput;r=si(t,e.toolName);if(!(r==null))return[3,1];_tmp=e;return[3,3];case 1:_tmp1=[_object_spread({},e)];_tmp2={};return[4,r(e.input)];case 2:_tmp=_object_spread_props.apply(void 0,_tmp1.concat([(_tmp2.input=_state.sent(),_tmp2)]));_state.label=3;case 3:return[2,_tmp]}})}).apply(this,arguments)}function npe(e){return _async_to_generator(function(){var t,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.input.trim()===""))return[3,1];_tmp={success:!0,value:{}};return[3,3];case 1:return[4,Ji({text:e.input})];case 2:_tmp=_state.sent();_state.label=3;case 3:t=_tmp;if(t.success===!1)throw new bT({toolName:e.toolName,toolInput:e.input,cause:t.error});return[2,{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}]}})})()}function Rce(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCall,t=param.tools;r=e.toolName,n=si(t,r);if(!(n==null))return[3,3];if(!(e.providerExecuted&&e.dynamic))return[3,2];return[4,npe(e)];case 1:return[2,_state.sent()];case 2:throw new Sz({toolName:e.toolName,availableTools:Object.keys(t)});case 3:i=Wu(n.inputSchema);if(!(e.input.trim()===""))return[3,5];return[4,ta({value:{},schema:i})];case 4:_tmp=_state.sent();return[3,7];case 5:return[4,Ji({text:e.input,schema:i})];case 6:_tmp=_state.sent();_state.label=7;case 7:o=_tmp;if(o.success===!1)throw new bT({toolName:r,toolInput:e.input,cause:o.error});return[2,n.type==="dynamic"?_object_spread_props(_object_spread({type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:o.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata},n.metadata!=null?{toolMetadata:n.metadata}:{}),{dynamic:!0,title:n.title}):_object_spread_props(_object_spread({type:"tool-call",toolCallId:e.toolCallId,toolName:r,input:o.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata},n.metadata!=null?{toolMetadata:n.metadata}:{}),{title:n.title})]}})}).apply(this,arguments)}function XXe(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&"type"in e?e.type==="data"?e.data:e.url:e}function eet(e){return e.map(function(t){return t.type==="reasoning"?_object_spread({type:"reasoning",text:t.text},t.providerMetadata!=null?{providerOptions:t.providerMetadata}:{}):_object_spread({type:"reasoning-file",data:t.file.base64,mediaType:t.file.mediaType},t.providerMetadata!=null?{providerOptions:t.providerMetadata}:{})})}function ipe(e){return e.map(function(t){if(t.type==="reasoning")return _object_spread({type:"reasoning",text:t.text},t.providerOptions!=null?{providerMetadata:t.providerOptions}:{});var r=XXe(t.data),n=_instanceof(r,ArrayBuffer)?new Uint8Array(r):_instanceof(r,URL)?r.toString():r;return _object_spread({type:"reasoning-file",file:new Bz({data:n,mediaType:t.mediaType})},t.providerOptions!=null?{providerMetadata:t.providerOptions}:{})})}function qz(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,u,_tmp,_tmp1,_tmp2,_tmp3,_tmp4,_,_tmp5,_tmp6;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.tools,t=param.toolCall,r=param.toolApproval,n=param.messages,i=param.toolsContext,o=param.runtimeContext;if(!(r!=null&&typeof r=="function"))return[3,2];return[4,r({toolCall:t,tools:e,toolsContext:i,messages:n,runtimeContext:o})];case 1:return[2,Mce.apply(void 0,[_state.sent()])];case 2:a=t.toolName,s=si(e,a),l=t.input,c=si(r,a);if(!(c!=null))return[3,7];if(!(typeof c=="function"))return[3,5];_tmp1=[l];_tmp2={toolCallId:t.toolCallId,messages:n};return[4,Tz({toolName:a,context:si(i,a),contextSchema:s==null?void 0:s.contextSchema})];case 3:return[4,c.apply(void 0,_tmp1.concat([(_tmp2.toolContext=_state.sent(),_tmp2.runtimeContext=o,_tmp2)]))];case 4:_tmp=_state.sent();return[3,6];case 5:_tmp=c;_state.label=6;case 6:u=_tmp;return[2,Mce(u)];case 7:if(!((s==null?void 0:s.needsApproval)==null))return[3,8];_tmp3={type:"not-applicable"};return[3,13];case 8:if(!(typeof s.needsApproval=="function"))return[3,11];_=s.needsApproval;_tmp5=[l];_tmp6={toolCallId:t.toolCallId,messages:n};return[4,Tz({toolName:a,context:si(i,a),contextSchema:s==null?void 0:s.contextSchema})];case 9:return[4,_.apply(s,_tmp5.concat([(_tmp6.context=_state.sent(),_tmp6)]))];case 10:_tmp4=_state.sent();return[3,12];case 11:_tmp4=s.needsApproval;_state.label=12;case 12:_tmp3=_tmp4?{type:"user-approval"}:{type:"not-applicable"};_state.label=13;case 13:return[2,_tmp3]}})}).apply(this,arguments)}function Mce(e){return e===void 0?{type:"not-applicable"}:typeof e=="string"?{type:e}:e}function pl(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return function(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.allSettled(e.map(function(r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r==null?void 0:r(t)];case 1:_state.sent();return[2]}})})()}))];case 1:_state.sent();return[2]}})})()}}var ope="ai:telemetry";function ape(){var e;return typeof process!="undefined"&&((e=process.release)==null?void 0:e.name)==="node"}var yz;function tet(){return _async_to_generator(function(){return _ts_generator(this,function(_state){if(ape())return[2,(yz==null&&(yz=Promise.resolve(Az("node:diagnostics_channel"))),yz)];return[2]})})()}function Az(e){var t;var r=globalThis.process;try{return(t=r==null?void 0:r.getBuiltinModule)==null?void 0:t.call(r,e)}catch(n){return}}function Oce(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,tet()];case 1:n=_state.sent(),i=(r=n==null?void 0:n.tracingChannel)==null?void 0:r.call(n,ope);if(!(i==null||i.hasSubscribers===!1))return[3,3];return[4,t()];case 2:return[2,_state.sent()];case 3:l=!1,c=!1,d=function(){try{o=Promise.resolve(t())}catch(u){o=Promise.reject(u)}return o=o.then(function(u){return a=u,l=!0,u},function(u){throw s=u,c=!0,u}),o};_state.label=4;case 4:_state.trys.push([4,6,,13]);return[4,i.tracePromise(d,e)];case 5:return[2,_state.sent()];case 6:u=_state.sent();if(c)throw s;if(!l)return[3,7];_tmp=a;return[3,12];case 7:if(!(o!=null))return[3,9];return[4,o];case 8:_tmp1=_state.sent();return[3,11];case 9:return[4,t()];case 10:_tmp1=_state.sent();_state.label=11;case 11:_tmp=_tmp1;_state.label=12;case 12:return[2,_tmp];case 13:return[2]}})})()}function ret(param){var e=param.message,t=param.completion;var r;if(!ape())return;var n=Az("node:diagnostics_channel"),i=Az("node:async_hooks"),o=(r=n==null?void 0:n.tracingChannel)==null?void 0:r.call(n,ope);if(o==null||o.hasSubscribers===!1||i==null){Promise.resolve(t).catch(function(){});return}var a=e,s,l=!1,c=function(u){try{u()}catch(p){}},d=function(param){var u=param.result,p=param.error;l||(l=!0,p!==void 0&&(a.error=p,c(function(){return o.error.publish(a)})),u!==void 0&&(a.result=u),c(function(){return o.asyncEnd.publish(a)}))};return c(function(){o.start.runStores(a,function(){s=new i.AsyncResource("ai.telemetry")})}),c(function(){return o.end.publish(a)}),Promise.resolve(t).then(function(u){return d({result:u})},function(u){return d({error:u})}),{run:function(u){return s==null?u():s.runInAsyncScope(u)}}}function net(){var e;return(e=globalThis.AI_SDK_TELEMETRY_INTEGRATIONS)!=null?e:[]}function r6(e,t){return Object.assign(Object.create(Object.getPrototypeOf(e)),e,t)}function iet(param){var e=param.telemetry;if((e==null?void 0:e.isEnabled)===!1)return{};var t=e==null?void 0:e.integrations,r=t!=null?ks(t):net(),n={recordInputs:e==null?void 0:e.recordInputs,recordOutputs:e==null?void 0:e.recordOutputs,functionId:e==null?void 0:e.functionId},i=function(s){var l=r.map(function(d){var u;return(u=d[s])==null?void 0:u.bind(d)}).filter(Boolean).map(function(d){return function(u){return d(r6(u,n))}}),c=pl.apply(void 0,_to_consumable_array(l));return function(d){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,c(d)];case 1:_state.sent();return[2]}})})()}},o=r.map(function(s){var l;return(l=s.executeLanguageModelCall)==null?void 0:l.bind(s)}).filter(Boolean),a=r.map(function(s){var l;return(l=s.executeTool)==null?void 0:l.bind(s)}).filter(Boolean);return{runInTracingChannelSpan:function(param){var s=param.type,l=param.event,c=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Oce({type:s,event:r6(l,n)},c)];case 1:return[2,_state.sent()]}})})()},startTracingChannelContext:function(param){var s=param.type,l=param.event,c=param.completion;return ret({message:{type:s,event:r6(l,n)},completion:c})},onStart:i("onStart"),onStepStart:i("onStepStart"),onLanguageModelCallStart:i("onLanguageModelCallStart"),onLanguageModelCallEnd:i("onLanguageModelCallEnd"),onToolExecutionStart:i("onToolExecutionStart"),onToolExecutionEnd:i("onToolExecutionEnd"),onStepEnd:pl(i("onStepEnd"),i("onStepFinish")),onObjectStepStart:i("onObjectStepStart"),onObjectStepEnd:i("onObjectStepEnd"),onEmbedStart:i("onEmbedStart"),onEmbedEnd:i("onEmbedEnd"),onRerankStart:i("onRerankStart"),onRerankEnd:i("onRerankEnd"),onEnd:i("onEnd"),onAbort:i("onAbort"),onError:i("onError"),executeLanguageModelCall:function(_01){return _async_to_generator(function(){var s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=_01.execute,l=_object_without_properties(_01,["execute"]);c=r6(l,n),d=s;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{_loop=function(){var u=_step.value;var p=d;d=function(){return u(_object_spread_props(_object_spread({},c),{execute:p}))}};for(_iterator=o[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,Oce({type:"languageModelCall",event:c},d)];case 1:return[2,_state.sent()]}})})()},executeTool:function(_01){return _async_to_generator(function(){var s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=_01.execute,l=_object_without_properties(_01,["execute"]);c=r6(l,n),d=s;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{_loop=function(){var u=_step.value;var p=d;d=function(){return u(_object_spread_props(_object_spread({},c),{execute:p}))}};for(_iterator=a[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,d()];case 1:return[2,_state.sent()]}})})()}}}function oet(e){var t=e.map(function(r){return"text"in r?r.text:""}).join("");return t.length>0?t:void 0}var Wz=/*#__PURE__*/function(){"use strict";function Wz1(param){var e=param.callId,t=param.stepNumber,r=param.provider,n=param.modelId,i=param.runtimeContext,o=param.toolsContext,a=param.content,s=param.finishReason,l=param.rawFinishReason,c=param.usage,d=param.performance,u=param.warnings,p=param.request,m=param.response,h=param.providerMetadata;_class_call_check(this,Wz1);this.callId=e,this.stepNumber=t,this.model={provider:r,modelId:n},this.runtimeContext=i,this.toolsContext=o,this.content=a,this.finishReason=s,this.rawFinishReason=l,this.usage=c,this.performance=d,this.warnings=u,this.request=p,this.response=m,this.providerMetadata=h}_create_class(Wz1,[{key:"text",get:function get1(){return this.content.filter(function(e){return e.type==="text"}).map(function(e){return e.text}).join("")}},{key:"reasoning",get:function get1(){return eet(this.content.filter(function(e){return e.type==="reasoning"||e.type==="reasoning-file"}))}},{key:"reasoningText",get:function get1(){return oet(this.reasoning)}},{key:"files",get:function get1(){return this.content.filter(function(e){return e.type==="file"}).map(function(e){return e.file})}},{key:"sources",get:function get1(){return this.content.filter(function(e){return e.type==="source"})}},{key:"toolCalls",get:function get1(){return this.content.filter(function(e){return e.type==="tool-call"})}},{key:"staticToolCalls",get:function get1(){return this.toolCalls.filter(function(e){return e.dynamic!==!0})}},{key:"dynamicToolCalls",get:function get1(){return this.toolCalls.filter(function(e){return e.dynamic===!0})}},{key:"toolResults",get:function get1(){return this.content.filter(function(e){return e.type==="tool-result"})}},{key:"staticToolResults",get:function get1(){return this.toolResults.filter(function(e){return e.dynamic!==!0})}},{key:"dynamicToolResults",get:function get1(){return this.toolResults.filter(function(e){return e.dynamic===!0})}}]);return Wz1}();function a6(param){var e=param.context,t=param.includeContext;return e==null?{}:Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,1),r=_param[0];return(t==null?void 0:t[r])===!0}))}function n6(param){var e=param.step,t=param.includeRuntimeContext,r=param.includeToolsContext;return new Wz({callId:e.callId,stepNumber:e.stepNumber,provider:e.model.provider,modelId:e.model.modelId,runtimeContext:a6({context:e.runtimeContext,includeContext:t}),toolsContext:yT({toolsContext:e.toolsContext,includeToolsContext:r}),content:e.content,finishReason:e.finishReason,rawFinishReason:e.rawFinishReason,usage:e.usage,performance:e.performance,warnings:e.warnings,request:e.request,response:e.response,providerMetadata:e.providerMetadata})}function yT(param){var e=param.toolsContext,t=param.includeToolsContext;return t==null?{}:Object.fromEntries(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];return[r,Iz({toolName:r,toolContext:n,includeToolsContext:t})]}))}function Iz(param){var e=param.toolName,t=param.toolContext,r=param.includeToolsContext;var n=r==null?void 0:r[e];return a6({context:t,includeContext:n})}function spe(param){var e=param.telemetry,t=param.includeRuntimeContext,r=param.includeToolsContext;var n=iet({telemetry:e});return _object_spread_props(_object_spread({},n),{onStart:function(i){var o;return(o=n.onStart)==null?void 0:o.call(n,_object_spread_props(_object_spread({},i),{runtimeContext:a6({context:i.runtimeContext,includeContext:t}),toolsContext:yT({toolsContext:i.toolsContext,includeToolsContext:r})}))},onStepStart:function(i){var o;return(o=n.onStepStart)==null?void 0:o.call(n,_object_spread_props(_object_spread({},i),{runtimeContext:a6({context:i.runtimeContext,includeContext:t}),steps:i.steps.map(function(a){return n6({step:a,includeRuntimeContext:t,includeToolsContext:r})}),toolsContext:yT({toolsContext:i.toolsContext,includeToolsContext:r})}))},onStepEnd:function(i){var o;return(o=n.onStepEnd)==null?void 0:o.call(n,n6({step:i,includeRuntimeContext:t,includeToolsContext:r}))},onStepFinish:function(i){var o;return(o=n.onStepEnd)==null?void 0:o.call(n,n6({step:i,includeRuntimeContext:t,includeToolsContext:r}))},onEnd:function(i){var o;return(o=n.onEnd)==null?void 0:o.call(n,function(a){return _object_spread_props(_object_spread({},i),{runtimeContext:a6({context:i.runtimeContext,includeContext:t}),steps:a,finalStep:a.at(-1),toolsContext:yT({toolsContext:i.toolsContext,includeToolsContext:r})})}(i.steps.map(function(a){return n6({step:a,includeRuntimeContext:t,includeToolsContext:r})})))},onAbort:function(i){var o;return(o=n.onAbort)==null?void 0:o.call(n,_object_spread_props(_object_spread({},i),{steps:i.steps.map(function(a){return n6({step:a,includeRuntimeContext:t,includeToolsContext:r})})}))},onToolExecutionStart:function(i){var o;return(o=n.onToolExecutionStart)==null?void 0:o.call(n,_object_spread_props(_object_spread({},i),{toolContext:Iz({toolName:i.toolCall.toolName,toolContext:i.toolContext,includeToolsContext:r})}))},onToolExecutionEnd:function(i){var o;return(o=n.onToolExecutionEnd)==null?void 0:o.call(n,_object_spread_props(_object_spread({},i),{toolContext:Iz({toolName:i.toolCall.toolName,toolContext:i.toolContext,includeToolsContext:r})}))}})}function Vz(e){return function(param){var t=param.steps;return t.length===e}}function lpe(){return function(){return!1}}function upe(_01){return _async_to_generator(function(param){var e,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.stopConditions,t=param.steps;return[4,Promise.all(e.map(function(r){return r({steps:t})}))];case 1:return[2,_state.sent().some(function(r){return r})]}})}).apply(this,arguments)}function Pz(e,t){return e==null&&t==null?void 0:(e!=null?e:0)+(t!=null?t:0)}function cpe(_01){return _async_to_generator(function(param){var e,t,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,_,s,s10,err,o,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,a9,s11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.content,t=param.tools;r=[],n=new Map,i=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,16,17,18]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,15];a=_step.value;if(!(a.type!=="source"&&!((a.type==="tool-result"||a.type==="tool-error")&&!a.providerExecuted)&&!(a.type==="text"&&a.text.length===0)))return[3,14];_=a.type;switch(_){case"text":return[3,3];case"custom":return[3,4];case"reasoning":return[3,5];case"file":return[3,6];case"reasoning-file":return[3,7];case"tool-call":return[3,8];case"tool-result":return[3,9];case"tool-error":return[3,11];case"tool-approval-request":return[3,13]}return[3,14];case 3:i.push({type:"text",text:a.text,providerOptions:a.providerMetadata});return[3,14];case 4:i.push({type:"custom",kind:a.kind,providerOptions:a.providerMetadata});return[3,14];case 5:i.push({type:"reasoning",text:a.text,providerOptions:a.providerMetadata});return[3,14];case 6:i.push({type:"file",data:a.file.base64,mediaType:a.file.mediaType,providerOptions:a.providerMetadata});return[3,14];case 7:i.push({type:"reasoning-file",data:a.file.base64,mediaType:a.file.mediaType,providerOptions:a.providerMetadata});return[3,14];case 8:n.has(a.toolCallId)||n.set(a.toolCallId,n.size),i.push({type:"tool-call",toolCallId:a.toolCallId,toolName:a.toolName,input:a.invalid&&_type_of(a.input)!="object"?{}:a.input,providerExecuted:a.providerExecuted,providerOptions:a.providerMetadata});return[3,14];case 9:return[4,h0({toolCallId:a.toolCallId,input:a.input,tool:si(t,a.toolName),output:a.output,errorMode:"none"})];case 10:s=_state.sent();i.push({type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:s,providerOptions:a.providerMetadata});return[3,14];case 11:return[4,h0({toolCallId:a.toolCallId,input:a.input,tool:si(t,a.toolName),output:a.error,errorMode:"json"})];case 12:s10=_state.sent();i.push({type:"tool-result",toolCallId:a.toolCallId,toolName:a.toolName,output:s10,providerOptions:a.providerMetadata});return[3,14];case 13:i.push(_object_spread({type:"tool-approval-request",approvalId:a.approvalId,toolCallId:a.toolCall.toolCallId,isAutomatic:a.isAutomatic},a.signature!=null?{signature:a.signature}:{}));return[3,14];case 14:_iteratorNormalCompletion=true;return[3,2];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 18:i.length>0&&r.push({role:"assistant",content:i});o=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=19;case 19:_state.trys.push([19,24,25,26]);_iterator1=e[Symbol.iterator]();_state.label=20;case 20:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,23];a9=_step1.value;if(a9.type!=="tool-approval-response"&&a9.type!=="tool-result"&&a9.type!=="tool-error")return[3,22];if(a9.type==="tool-approval-response"){o.push({type:"tool-approval-response",approvalId:a9.approvalId,approved:a9.approved,reason:a9.reason,providerExecuted:a9.providerExecuted}),a9.approved===!1&&o.push({type:"tool-result",toolCallId:a9.toolCall.toolCallId,toolName:a9.toolCall.toolName,output:{type:"execution-denied",reason:a9.reason}});return[3,22]}if(a9.providerExecuted)return[3,22];return[4,h0({toolCallId:a9.toolCallId,input:a9.input,tool:si(t,a9.toolName),output:a9.type==="tool-result"?a9.output:a9.error,errorMode:a9.type==="tool-error"?"text":"none"})];case 21:s11=_state.sent();o.push(_object_spread({type:"tool-result",toolCallId:a9.toolCallId,toolName:a9.toolName,output:s11},a9.providerMetadata!=null?{providerOptions:a9.providerMetadata}:{}));_state.label=22;case 22:_iteratorNormalCompletion1=true;return[3,20];case 23:return[3,26];case 24:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,26];case 25:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 26:return[2,(o.length>0&&r.push({role:"tool",content:aet({toolResultContent:o,toolCallOrder:n})}),r)]}})}).apply(this,arguments)}function aet(param){var e=param.toolResultContent,t=param.toolCallOrder;var r=e.filter(function(i){return i.type==="tool-result"}).map(function(i,o){return{part:i,index:o}}).sort(function(i,o){var a=t.get(i.part.toolCallId),s=t.get(o.part.toolCallId);return a==null&&s==null?i.index-o.index:a==null?1:s==null?-1:a-s||i.index-o.index}).map(function(param){var i=param.part;return i}),n=0;return e.map(function(i){return i.type==="tool-result"?r[n++]:i})}var set=new TextEncoder;function Rz(e){return e==null||(typeof e==="undefined"?"undefined":_type_of(e))!="object"?JSON.stringify(e):Array.isArray(e)?"[".concat(e.map(Rz).join(","),"]"):"{".concat(Object.keys(e).sort().map(function(n){return"".concat(JSON.stringify(n),":").concat(Rz(e[n]))}).join(","),"}")}function dpe(e){return Jl(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function ppe(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,crypto.subtle.digest("SHA-256",set.encode(Rz(e)))];case 1:t=_state.sent();return[2,dpe(new Uint8Array(t))]}})})()}var Gz=new TextEncoder;function uet(e){return Ui(e)}function fpe(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){t=typeof e=="string"?Gz.encode(e):e;return[2,crypto.subtle.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"])]})})()}function mpe(e,t,r,n){return Gz.encode(JSON.stringify(["ai-sdk-tool-approval-v1",e,t,r,n]))}function cet(e,t,r,n){return Gz.encode("".concat(e,"\n").concat(t,"\n").concat(r,"\n").concat(n))}function det(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.secret,t=param.approvalId,r=param.toolCallId,n=param.toolName,i=param.input;return[4,fpe(e)];case 1:o=_state.sent();return[4,ppe(i)];case 2:a=_state.sent(),s=mpe(t,r,n,a);return[4,crypto.subtle.sign("HMAC",o,s)];case 3:l=_state.sent();return[2,dpe(new Uint8Array(l))]}})}).apply(this,arguments)}function pet(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.secret,t=param.signature,r=param.approvalId,n=param.toolCallId,i=param.toolName,o=param.input;return[4,fpe(e)];case 1:a=_state.sent();return[4,ppe(o)];case 2:s=_state.sent(),l=uet(t),c=mpe(r,n,i,s);return[4,crypto.subtle.verify("HMAC",a,l,c)];case 3:if(_state.sent())return[2,!0];if(!r.includes("\n")&&!n.includes("\n")&&!i.includes("\n")){d=cet(r,n,i,s);return[2,crypto.subtle.verify("HMAC",a,l,d)]}return[2,!1]}})}).apply(this,arguments)}function hpe(_01){return _async_to_generator(function(param){var e,t,r,n,i;return _ts_generator(this,function(_state){e=param.secret,t=param.approvalId,r=param.toolCallId,n=param.toolName,i=param.input;if(e!=null)return[2,det({secret:e,approvalId:t,toolCallId:r,toolName:n,input:i})];return[2]})}).apply(this,arguments)}function gpe(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,m,g,h,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.approvedToolApprovals,t=param.tools,r=param.toolApproval,n=param.messages,i=param.toolsContext,o=param.runtimeContext,a=param.toolApprovalSecret;l=[],c=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];d=_step.value;u=d.toolCall,p=d.approvalRequest,m=si(t,u.toolName);if(!(a!=null))return[3,4];if(p.signature==null)throw new kce({approvalId:p.approvalId,toolCallId:u.toolCallId,reason:"missing signature"});return[4,pet({secret:a,signature:p.signature,approvalId:p.approvalId,toolCallId:u.toolCallId,toolName:u.toolName,input:u.input})];case 3:if(!_state.sent())throw new kce({approvalId:p.approvalId,toolCallId:u.toolCallId,reason:"invalid signature"});_state.label=4;case 4:if(!(mT(m)&&m.inputSchema!=null))return[3,6];return[4,ta({value:u.input,schema:Wu(m.inputSchema)})];case 5:g=_state.sent();if(!g.success)throw new bT({toolName:u.toolName,toolInput:JSON.stringify(u.input),cause:g.error});_state.label=6;case 6:return[4,qz({tools:t,toolApproval:r,toolCall:u,messages:n,toolsContext:i,runtimeContext:o})];case 7:h=_state.sent();h.type==="denied"?c.push(_object_spread_props(_object_spread({},d),{approvalResponse:_object_spread_props(_object_spread({},d.approvalResponse),{approved:!1,reason:(s=h.reason)!=null?s:d.approvalResponse.reason})})):l.push(d);_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2,{approvedToolApprovals:l,deniedToolApprovals:c}]}})}).apply(this,arguments)}var fet=mo({prefix:"aitxt",size:24}),met=mo({prefix:"call",size:24});function Hz(_01){return _async_to_generator(function(){var e,t,r,n,i,o,a,s,l,c,d,u,tmp,p,m,h,g,x,v,tmp1,y,_,b,w,S,k,tmp2,E,C,T,tmp3,I,tmp4,O,M,tmp5,R,tmp6,_ref,tmp7,$,tmp8,z,tmp9,D,L,ee,pe,N,U,G,K,me,V,ie,re,de,xe,Y,oe,tmp10,H,J,j,Q,Fe,it,pt,nt,gt,Ie,we,Oe,Pe,tt,We,Ut,Rt,Ve,Tr,_Ez,yn,Di,Rn,Uo,Ea,Nn,Ar,q,Ee;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=_01.model,t=_01.tools,r=_01.toolChoice,n=_01.instructions,i=_01.system,o=_01.prompt,a=_01.messages,s=_01.allowSystemInMessages,l=_01.maxRetries,c=_01.abortSignal,d=_01.timeout,u=_01.headers,tmp=_01.stopWhen,p=tmp===void 0?Vz(1):tmp,m=_01.experimental_sandbox,h=_01.output,g=_01.toolApproval,x=_01.experimental_toolApprovalSecret,v=_01.experimental_telemetry,tmp1=_01.telemetry,y=tmp1===void 0?v:tmp1,_=_01.providerOptions,b=_01.activeTools,w=_01.toolOrder,S=_01.prepareStep,k=_01.experimental_repairToolCall,tmp2=_01.repairToolCall,E=tmp2===void 0?k:tmp2,C=_01.experimental_refineToolInput,T=_01.experimental_download,tmp3=_01.runtimeContext,I=tmp3===void 0?{}:tmp3,tmp4=_01.toolsContext,O=tmp4===void 0?{}:tmp4,M=_01.experimental_include,tmp5=_01.include,R=tmp5===void 0?M:tmp5,tmp6=_01._internal,_ref=tmp6===void 0?{}:tmp6,tmp7=_ref.generateId,$=tmp7===void 0?fet:tmp7,tmp8=_ref.generateCallId,z=tmp8===void 0?met:tmp8,tmp9=_ref.now,D=tmp9===void 0?l6:tmp9,L=_01.onStart,ee=_01.experimental_onStart,pe=_01.onStepStart,N=_01.experimental_onStepStart,U=_01.onLanguageModelCallStart,G=_01.experimental_onLanguageModelCallStart,K=_01.onLanguageModelCallEnd,me=_01.experimental_onLanguageModelCallEnd,V=_01.onToolExecutionStart,ie=_01.onToolExecutionEnd,re=_01.experimental_onToolCallStart,de=_01.experimental_onToolCallFinish,xe=_01.onStepEnd,Y=_01.onStepFinish,oe=_01.onFinish,tmp10=_01.onEnd,H=tmp10===void 0?oe:tmp10,J=_object_without_properties(_01,["model","tools","toolChoice","instructions","system","prompt","messages","allowSystemInMessages","maxRetries","abortSignal","timeout","headers","stopWhen","experimental_sandbox","output","toolApproval","experimental_toolApprovalSecret","experimental_telemetry","telemetry","providerOptions","activeTools","toolOrder","prepareStep","experimental_repairToolCall","repairToolCall","experimental_refineToolInput","experimental_download","runtimeContext","toolsContext","experimental_include","include","_internal","onStart","experimental_onStart","onStepStart","experimental_onStepStart","onLanguageModelCallStart","experimental_onLanguageModelCallStart","onLanguageModelCallEnd","experimental_onLanguageModelCallEnd","onToolExecutionStart","onToolExecutionEnd","experimental_onToolCallStart","experimental_onToolCallFinish","onStepEnd","onStepFinish","onFinish","onEnd"]);R={requestBody:(j=R==null?void 0:R.requestBody)!=null?j:!1,requestMessages:(Q=R==null?void 0:R.requestMessages)!=null?Q:!1,responseBody:(Fe=R==null?void 0:R.responseBody)!=null?Fe:!1};pt=s6(e),nt=ks(p),gt=L!=null?L:ee,Ie=pe!=null?pe:N,we=U!=null?U:G,Oe=K!=null?K:me,Pe=V!=null?V:re,tt=ie!=null?ie:de,We=xe!=null?xe:Y,Ut=Vde(d),Rt=Gde(d),Ve=Rt!=null?new AbortController:void 0,Tr=jz(c,Ut,Ve==null?void 0:Ve.signal),_Ez=Ez({maxRetries:l,abortSignal:Tr}),yn=_Ez.maxRetries,Di=_Ez.retry,Rn=Cz(J),Uo=Bi(u!=null?u:{},"ai/".concat(jde));return[4,zz({instructions:n,system:i,prompt:o,messages:a,allowSystemInMessages:s})];case 1:Ea=_state.sent(),Nn=z(),Ar=spe({telemetry:y,includeRuntimeContext:y==null?void 0:y.includeRuntimeContext,includeToolsContext:y==null?void 0:y.includeToolsContext}),q=(it=Ar.runInTracingChannelSpan)!=null?it:function(param){var xr=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,xr()];case 1:return[2,_state.sent()]}})})()},Ee={callId:Nn,operationId:"ai.generateText",provider:pt.provider,modelId:pt.modelId,instructions:Ea.instructions,messages:Ea.messages,tools:t,toolChoice:r,activeTools:b,toolOrder:w,maxOutputTokens:Rn.maxOutputTokens,temperature:Rn.temperature,topP:Rn.topP,topK:Rn.topK,presencePenalty:Rn.presencePenalty,frequencyPenalty:Rn.frequencyPenalty,stopSequences:Rn.stopSequences,seed:Rn.seed,reasoning:Rn.reasoning,maxRetries:yn,timeout:d,headers:Uo,providerOptions:_,output:h,runtimeContext:I,toolsContext:O};return[4,q({type:"generateText",event:Ee,execute:function(){return _async_to_generator(function(){var xr,_loop,_$Yr,Bo,_epe,mu,xt,_ref,Xr,zs,mc,rr,Li,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,sn,Co,gu,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,sn1,ca,Mn,Ta,Br,Ga,qo,bn,Ii,da,Zn,_tmp,fi,fd,Kf,Qf,Jf,ue,De,at,Jt,bi,ko,js,hu,_tmp1,Yr;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,go({event:Ee,callbacks:[gt,Ar.onStart]})];case 1:_state.sent();_state.label=2;case 2:_state.trys.push([2,23,,25]);_loop=function(){var rr,Li;return _ts_generator(this,function(_state){switch(_state.label){case 0:bn.length>0&&(Tr==null||Tr.throwIfAborted());rr=xT({abortController:Ve,label:"Step",timeoutMs:Rt}),Li=bn.length;_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,q({type:"step",event:{callId:Nn,stepNumber:Li},execute:function(){return _async_to_generator(function(){var sn,Co,gu,xu,Cr,Ml,Ol,B,ae,Z,ve,be,ge,ye,Re,ze,Ue,Ge,Tt,kt,Hr,ar,Cn,On,_tmp,Fi,Us,Bs,yu,Eo,lg,ug,Yf,Xf,Hk,Pp,hc,vu,cr,io,md,hd,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,Bt,Pi,_tmp1,_tmp2,em,_u,Rp,err,gd,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,Bt1,cg,Bt2,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,Pi1,K_,Wo,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_loop,_iterator3,_step3,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,Bt3,j1,gM,Q_,TPe,xM;return _ts_generator(this,function(_state){switch(_state.label){case 0:Ge=_to_consumable_array(Bo).concat(_to_consumable_array(bn.flatMap(function(Bt){return Bt.response.messages}))),Tt=da;return[4,S==null?void 0:S({model:pt,steps:bn,stepNumber:bn.length,instructions:Ii,initialInstructions:Ea.instructions,messages:Tt,initialMessages:_$Yr,responseMessages:Ge,runtimeContext:I,toolsContext:O,experimental_sandbox:m})];case 1:kt=_state.sent(),Hr=(sn=kt==null?void 0:kt.experimental_sandbox)!=null?sn:m,ar=s6((Co=kt==null?void 0:kt.model)!=null?Co:pt),Cn=(xu=(gu=kt==null?void 0:kt.instructions)!=null?gu:kt==null?void 0:kt.system)!=null?xu:Ii;_tmp={prompt:{instructions:Cn,messages:(Cr=kt==null?void 0:kt.messages)!=null?Cr:Tt}};return[4,ar.supportedUrls];case 2:return[4,Bde.apply(void 0,[(_tmp.supportedUrls=_state.sent(),_tmp.download=T,_tmp.provider=ar.provider.split(".")[0],_tmp)])];case 3:On=_state.sent();I=(Ml=kt==null?void 0:kt.runtimeContext)!=null?Ml:I,O=(Ol=kt==null?void 0:kt.toolsContext)!=null?Ol:O;Fi=tpe({tools:t,activeTools:(B=kt==null?void 0:kt.activeTools)!=null?B:b}),Us=(ae=kt==null?void 0:kt.toolOrder)!=null?ae:w;return[4,Lz({tools:Fi,toolOrder:Us,toolsContext:O,experimental_sandbox:Hr})];case 4:Bs=_state.sent(),yu=Dz({toolChoice:(Z=kt==null?void 0:kt.toolChoice)!=null?Z:r}),Eo=(ve=kt==null?void 0:kt.messages)!=null?ve:Tt,lg=c6(_,kt==null?void 0:kt.providerOptions);return[4,go({event:{callId:Nn,provider:ar.provider,modelId:ar.modelId,stepNumber:Li,instructions:Cn,messages:Eo,tools:t,toolChoice:(be=kt==null?void 0:kt.toolChoice)!=null?be:r,activeTools:(ge=kt==null?void 0:kt.activeTools)!=null?ge:b,toolOrder:Us,steps:_to_consumable_array(bn),providerOptions:lg,output:h,runtimeContext:I,promptMessages:On,stepTools:Bs,stepToolChoice:yu,toolsContext:O},callbacks:[Ie,Ar.onStepStart]})];case 5:_state.sent();ug=_object_spread({provider:ar.provider,modelId:ar.modelId,instructions:Cn,messages:Eo,tools:Bs},ca),Yf=_object_spread({callId:Nn},ug),Xf=D();return[4,go({event:Yf,callbacks:[we,Ar.onLanguageModelCallStart]})];case 6:_state.sent();Hk=(ye=Ar.executeLanguageModelCall)!=null?ye:function(param){var Bt=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Bt()];case 1:return[2,_state.sent()]}})})()};return[4,Di(function(){return _async_to_generator(function(){var Bt,Pi,em,_u,Rp,KK,QK,JK,U1,APe;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Hk(_object_spread_props(_object_spread({},Yf),{execute:function(){return _async_to_generator(function(){var _,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=ar.doGenerate;_tmp=[_object_spread({},ca)];_tmp1={tools:Bs,toolChoice:yu};return[4,h==null?void 0:h.responseFormat];case 1:return[4,_.apply(ar,[_object_spread_props.apply(void 0,_tmp.concat([(_tmp1.responseFormat=_state.sent(),_tmp1.prompt=On,_tmp1.providerOptions=lg,_tmp1.abortSignal=Tr,_tmp1.headers=Uo,_tmp1)]))])];case 2:return[2,_state.sent()]}})})()}}))];case 1:U1=_state.sent(),APe={id:(Pi=(Bt=U1.response)==null?void 0:Bt.id)!=null?Pi:$(),timestamp:(_u=(em=U1.response)==null?void 0:em.timestamp)!=null?_u:new Date,modelId:(KK=(Rp=U1.response)==null?void 0:Rp.modelId)!=null?KK:ar.modelId,headers:(QK=U1.response)==null?void 0:QK.headers,body:(JK=U1.response)==null?void 0:JK.body};return[2,_object_spread_props(_object_spread({},U1),{response:APe})]}})})()})];case 7:Mn=_state.sent();Pp=D()-Xf,hc=Yde(Mn.usage);return[4,Promise.all(Mn.content.filter(function(Bt){return Bt.type==="tool-call"}).map(function(Bt){return rpe({toolCall:Bt,tools:t,repairToolCall:E,refineToolInput:C,instructions:Cn,messages:Eo})}))];case 8:vu=_state.sent(),cr={},io={},md=new Set,hd=Nce({content:Mn.content,toolCalls:vu,toolOutputs:[],toolApprovalRequests:[],toolApprovalResponses:[],tools:t});return[4,go({event:{callId:Nn,provider:ar.provider,modelId:ar.modelId,finishReason:Mn.finishReason.unified,usage:hc,content:hd,responseId:Mn.response.id,performance:{responseTimeMs:Pp,effectiveOutputTokensPerSecond:ch({tokens:hc.outputTokens,durationMs:Pp}),outputTokensPerSecond:void 0,inputTokensPerSecond:void 0,effectiveTotalTokensPerSecond:ch({tokens:Pz(hc.inputTokens,hc.outputTokens),durationMs:Pp}),timeToFirstOutputMs:void 0}},callbacks:[Oe,Ar.onLanguageModelCallEnd]})];case 9:_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=10;case 10:_state.trys.push([10,20,21,22]);_iterator=vu[Symbol.iterator]();_state.label=11;case 11:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,19];Bt=_step.value;if(Bt.invalid)return[3,18];Pi=si(t,Bt.toolName);if(Pi==null)return[3,18];_tmp1=Pi.onInputStart!=null;if(!_tmp1)return[3,13];return[4,Pi.onInputStart({toolCallId:Bt.toolCallId,messages:Eo,abortSignal:Tr,context:I})];case 12:_tmp1=_state.sent();_state.label=13;case 13:_tmp1;_tmp2=(Pi==null?void 0:Pi.onInputAvailable)!=null;if(!_tmp2)return[3,15];return[4,Pi.onInputAvailable({input:Bt.input,toolCallId:Bt.toolCallId,messages:Eo,abortSignal:Tr,context:I})];case 14:_tmp2=_state.sent();_state.label=15;case 15:_tmp2;return[4,qz({tools:t,toolApproval:g,toolCall:Bt,messages:Eo,toolsContext:O,runtimeContext:I})];case 16:em=_state.sent();if(em.type==="not-applicable")return[3,18];_u=$();return[4,hpe({secret:x,approvalId:_u,toolCallId:Bt.toolCallId,toolName:Bt.toolName,input:Bt.input})];case 17:Rp=_state.sent();switch(em.type){case"user-approval":{cr[Bt.toolCallId]=_object_spread({type:"tool-approval-request",approvalId:_u,toolCall:Bt},Rp!=null?{signature:Rp}:{}),md.add(Bt.toolCallId);break}case"approved":{cr[Bt.toolCallId]=_object_spread({type:"tool-approval-request",approvalId:_u,toolCall:Bt,isAutomatic:!0},Rp!=null?{signature:Rp}:{}),io[Bt.toolCallId]={type:"tool-approval-response",approvalId:_u,toolCall:Bt,approved:!0,reason:em.reason,providerExecuted:Bt.providerExecuted};break}case"denied":{cr[Bt.toolCallId]=_object_spread({type:"tool-approval-request",approvalId:_u,toolCall:Bt,isAutomatic:!0},Rp!=null?{signature:Rp}:{}),io[Bt.toolCallId]={type:"tool-approval-response",approvalId:_u,toolCall:Bt,approved:!1,reason:em.reason,providerExecuted:Bt.providerExecuted},md.add(Bt.toolCallId);break}}_state.label=18;case 18:_iteratorNormalCompletion=true;return[3,11];case 19:return[3,22];case 20:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,22];case 21:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 22:gd=vu.filter(function(Bt){return Bt.invalid&&Bt.dynamic&&!Bt.providerExecuted});Br=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=gd[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){Bt1=_step1.value;Br.push({type:"tool-error",toolCallId:Bt1.toolCallId,toolName:Bt1.toolName,input:Bt1.input,error:xa(Bt1.error),dynamic:!0})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}Ta=vu.filter(function(Bt){return!Bt.providerExecuted}),Ga=Object.values(io),qo=Ga.filter(function(Bt){return Bt.approved===!1});cg={};if(!(t!=null))return[3,24];return[4,$ce({toolCalls:Ta.filter(function(Pi){return!Pi.invalid&&!md.has(Pi.toolCallId)}),tools:t,callId:Nn,messages:Eo,abortSignal:Tr,timeout:d,experimental_sandbox:Hr,toolsContext:O,onToolExecutionStart:function(Pi){return go({event:Pi,callbacks:[Pe,Ar.onToolExecutionStart]})},onToolExecutionEnd:function(Pi){return go({event:Pi,callbacks:[tt,Ar.onToolExecutionEnd]})},executeToolInTelemetryContext:Ar.executeTool,runInTracingChannelSpan:q})];case 23:Bt2=_state.sent();_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=Bt2[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){Pi1=_step2.value;cg[Pi1.output.toolCallId]=Pi1.toolExecutionMs,Br.push(Pi1.output)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_state.label=24;case 24:K_=D()-Xf,Wo={effectiveOutputTokensPerSecond:ch({tokens:hc.outputTokens,durationMs:Pp}),outputTokensPerSecond:void 0,inputTokensPerSecond:void 0,effectiveTotalTokensPerSecond:ch({tokens:Pz(hc.inputTokens,hc.outputTokens),durationMs:Pp}),stepTimeMs:K_,responseTimeMs:Pp,toolExecutionMs:cg,timeToFirstOutputMs:void 0};_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{_loop=function(){var Bt=_step3.value;if(!Bt.providerExecuted)return"continue";var Pi=si(t,Bt.toolName);(Pi==null?void 0:Pi.type)==="provider"&&Pi.supportsDeferredResults&&(Mn.content.some(function(_u){return _u.type==="tool-result"&&_u.toolCallId===Bt.toolCallId})||Zn.set(Bt.toolCallId,{toolName:Bt.toolName}))};for(_iterator3=vu[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true)_loop()}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=Mn.content[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){Bt3=_step4.value;Bt3.type==="tool-result"&&Zn.delete(Bt3.toolCallId)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}j1=Nce({content:Mn.content,toolCalls:vu,toolOutputs:Br,toolApprovalRequests:Object.values(cr),toolApprovalResponses:Ga,tools:t});return[4,cpe({content:j1,tools:t})];case 25:gM=_state.sent(),Q_=_object_spread_props(_object_spread({},Mn.request),{body:R.requestBody?(Re=Mn.request)==null?void 0:Re.body:void 0,messages:R.requestMessages?o6(Eo):void 0}),TPe=_object_spread_props(_object_spread({},Mn.response),{messages:o6(gM),body:R.responseBody?(ze=Mn.response)==null?void 0:ze.body:void 0}),xM=new Wz({callId:Nn,stepNumber:Li,provider:ar.provider,modelId:ar.modelId,runtimeContext:I,content:j1,finishReason:Mn.finishReason.unified,rawFinishReason:Mn.finishReason.raw,usage:hc,performance:Wo,warnings:Mn.warnings,providerMetadata:Mn.providerMetadata,request:Q_,response:TPe,toolsContext:O});W2({warnings:(Ue=Mn.warnings)!=null?Ue:[],provider:ar.provider,model:ar.modelId}),bn.push(xM),Ii=Cn,da=_to_consumable_array(Eo).concat(_to_consumable_array(gM));return[4,go({event:xM,callbacks:[We,Ar.onStepEnd]})];case 26:return[2,(_state.sent(),xM)]}})})()}})];case 2:_state.sent();return[3,4];case 3:rr!=null&&clearTimeout(rr);return[7];case 4:return[2]}})};_$Yr=Ea.messages,Bo=[],_epe=epe({messages:_$Yr}),mu=_epe.approvedToolApprovals,xt=_epe.deniedToolApprovals;return[4,gpe({approvedToolApprovals:mu.filter(function(rr){return!rr.toolCall.providerExecuted}),tools:t,toolApproval:g,messages:_$Yr,toolsContext:O,runtimeContext:I,toolApprovalSecret:x})];case 3:_ref=_state.sent(),Xr=_ref.approvedToolApprovals,zs=_ref.deniedToolApprovals,mc=_to_consumable_array(xt).concat(_to_consumable_array(zs)).filter(function(rr){return rr.existingToolResult==null});if(!(mc.length>0||Xr.length>0))return[3,13];return[4,$ce({toolCalls:Xr.map(function(sn){return sn.toolCall}),tools:t,callId:Nn,messages:_$Yr,abortSignal:Tr,timeout:d,experimental_sandbox:m,toolsContext:O,onToolExecutionStart:function(sn){return go({event:sn,callbacks:[Pe,Ar.onToolExecutionStart]})},onToolExecutionEnd:function(sn){return go({event:sn,callbacks:[tt,Ar.onToolExecutionEnd]})},executeToolInTelemetryContext:Ar.executeTool,runInTracingChannelSpan:q})];case 4:rr=_state.sent(),Li=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,10,11,12]);_iterator=rr[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];sn=_step.value;Co=sn.output;return[4,h0({toolCallId:Co.toolCallId,input:Co.input,tool:si(t,Co.toolName),output:Co.type==="tool-result"?Co.output:Co.error,errorMode:Co.type==="tool-error"?"text":"none"})];case 7:gu=_state.sent();Li.push({type:"tool-result",toolCallId:Co.toolCallId,toolName:Co.toolName,output:gu});_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=mc[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){sn1=_step1.value;Li.push({type:"tool-result",toolCallId:sn1.toolCall.toolCallId,toolName:sn1.toolCall.toolName,output:_object_spread({type:"execution-denied",reason:sn1.approvalResponse.reason},sn1.toolCall.providerExecuted&&{providerOptions:{openai:{approvalId:sn1.approvalResponse.approvalId}}})})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}Bo.push({role:"tool",content:Li});_state.label=13;case 13:ca=Cz(J),Ta=[],Br=[],Ga=[],qo=[],bn=[],Ii=Ea.instructions,da=_to_consumable_array(_$Yr).concat(_to_consumable_array(Bo)),Zn=new Map;_state.label=14;case 14:return[5,_ts_values(_loop())];case 15:_state.sent();_state.label=16;case 16:_tmp=Ta.length>0&&Br.length+qo.length===Ta.length||Zn.size>0;if(!_tmp)return[3,18];return[4,upe({stopConditions:nt,steps:bn})];case 17:_tmp=!_state.sent();_state.label=18;case 18:if(_tmp)return[3,14];_state.label=19;case 19:fi=bn[bn.length-1],fd=bn.reduce(function(rr,Li){return Xde(rr,Li.usage)},{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0}),Kf=bn.flatMap(function(rr){return rr.files}),Qf=bn.flatMap(function(rr){return rr.sources}),Jf=bn.flatMap(function(rr){return rr.toolCalls}),ue=bn.flatMap(function(rr){return rr.staticToolCalls}),De=bn.flatMap(function(rr){return rr.dynamicToolCalls}),at=bn.flatMap(function(rr){return rr.toolResults}),Jt=bn.flatMap(function(rr){return rr.staticToolResults}),bi=bn.flatMap(function(rr){return rr.dynamicToolResults}),ko=bn.flatMap(function(rr){var Li;return(Li=rr.warnings)!=null?Li:[]}),js={callId:Nn,stepNumber:fi.stepNumber,model:fi.model,runtimeContext:fi.runtimeContext,finishReason:fi.finishReason,rawFinishReason:fi.rawFinishReason,usage:fd,totalUsage:fd,content:bn.flatMap(function(rr){return rr.content}),text:fi.text,reasoning:fi.reasoning,reasoningText:fi.reasoningText,files:Kf,sources:Qf,toolCalls:Jf,staticToolCalls:ue,dynamicToolCalls:De,toolResults:at,staticToolResults:Jt,dynamicToolResults:bi,responseMessages:_to_consumable_array(Bo).concat(_to_consumable_array(bn.flatMap(function(rr){return rr.response.messages}))),warnings:ko,request:fi.request,response:fi.response,providerMetadata:fi.providerMetadata,steps:bn,finalStep:fi,toolsContext:O};return[4,go({event:js,callbacks:[H,Ar.onEnd]})];case 20:_state.sent();_tmp1=fi.finishReason==="stop";if(!_tmp1)return[3,22];return[4,(h!=null?h:_T()).parseCompleteOutput({text:fi.text},{response:fi.response,usage:fi.usage,finishReason:fi.finishReason})];case 21:_tmp1=hu=_state.sent();_state.label=22;case 22:return[2,(_tmp1,new het({initialResponseMessages:Bo,steps:bn,totalUsage:fd,output:hu}))];case 23:Yr=_state.sent();return[4,(xr=Ar.onError)==null?void 0:xr.call(Ar,{callId:Nn,error:Yr})];case 24:throw _state.sent(),Jde(Yr);case 25:return[2]}})})()}})];case 2:return[2,_state.sent()]}})})()}function $ce(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.toolCalls,t=param.tools,r=param.callId,n=param.messages,i=param.abortSignal,o=param.timeout,a=param.experimental_sandbox,s=param.toolsContext,l=param.onToolExecutionStart,c=param.onToolExecutionEnd,d=param.executeToolInTelemetryContext,u=param.runInTracingChannelSpan;return[4,Promise.all(e.map(function(m){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Uz({toolCall:m,tools:t,callId:r,messages:n,abortSignal:i,timeout:o,experimental_sandbox:a,toolsContext:s,onToolExecutionStart:l,onToolExecutionEnd:c,executeToolInTelemetryContext:d,runInTracingChannelSpan:u})];case 1:return[2,_state.sent()]}})})()}))];case 1:return[2,_state.sent().filter(function(m){return m!=null})]}})}).apply(this,arguments)}var het=/*#__PURE__*/function(){"use strict";function het1(e){_class_call_check(this,het1);this.initialResponseMessages=e.initialResponseMessages,this.steps=e.steps,this._output=e.output,this.totalUsage=e.totalUsage}_create_class(het1,[{key:"finalStep",get:function get1(){return this.steps.at(-1)}},{key:"content",get:function get1(){return this.steps.flatMap(function(e){return e.content})}},{key:"text",get:function get1(){return this.finalStep.text}},{key:"files",get:function get1(){return this.steps.flatMap(function(e){return e.files})}},{key:"reasoningText",get:function get1(){return this.finalStep.reasoningText}},{key:"reasoning",get:function get1(){return ipe(this.finalStep.reasoning)}},{key:"toolCalls",get:function get1(){return this.steps.flatMap(function(e){return e.toolCalls})}},{key:"staticToolCalls",get:function get1(){return this.steps.flatMap(function(e){return e.staticToolCalls})}},{key:"dynamicToolCalls",get:function get1(){return this.steps.flatMap(function(e){return e.dynamicToolCalls})}},{key:"toolResults",get:function get1(){return this.steps.flatMap(function(e){return e.toolResults})}},{key:"staticToolResults",get:function get1(){return this.steps.flatMap(function(e){return e.staticToolResults})}},{key:"dynamicToolResults",get:function get1(){return this.steps.flatMap(function(e){return e.dynamicToolResults})}},{key:"sources",get:function get1(){return this.steps.flatMap(function(e){return e.sources})}},{key:"finishReason",get:function get1(){return this.finalStep.finishReason}},{key:"rawFinishReason",get:function get1(){return this.finalStep.rawFinishReason}},{key:"warnings",get:function get1(){return this.steps.flatMap(function(e){var t;return(t=e.warnings)!=null?t:[]})}},{key:"providerMetadata",get:function get1(){return this.finalStep.providerMetadata}},{key:"response",get:function get1(){return this.finalStep.response}},{key:"responseMessages",get:function get1(){return _to_consumable_array(this.initialResponseMessages).concat(_to_consumable_array(this.steps.flatMap(function(e){return e.response.messages})))}},{key:"request",get:function get1(){return this.finalStep.request}},{key:"usage",get:function get1(){return this.totalUsage}},{key:"output",get:function get1(){if(this._output==null)throw new gT;return this._output}}]);return het1}();function Nce(param){var e=param.content,t=param.toolCalls,r=param.toolOutputs,n=param.toolApprovalRequests,i=param.toolApprovalResponses,o=param.tools;var a=[],s=[],l=[],c=new Set(i.map(function(d){return d.toolCall.toolCallId}));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var d=_step.value;switch(d.type){case"text":case"reasoning":case"custom":case"source":a.push(d);break;case"file":case"reasoning-file":{a.push(_object_spread({type:d.type,file:new Bz({data:d.data.type==="data"?d.data.data:d.data.url.toString(),mediaType:d.mediaType})},d.providerMetadata!=null?{providerMetadata:d.providerMetadata}:{}));break}case"tool-call":{a.push(t.find(function(u){return u.toolCallId===d.toolCallId}));break}case"tool-result":{var u=t.find(function(p){return p.toolCallId===d.toolCallId});if(u==null){var p=si(o,d.toolName);if(!((p==null?void 0:p.type)==="provider"&&p.supportsDeferredResults))throw new Error("Tool call ".concat(d.toolCallId," not found."));d.isError?a.push(_object_spread({type:"tool-error",toolCallId:d.toolCallId,toolName:d.toolName,input:void 0,error:d.result,providerExecuted:!0,dynamic:d.dynamic},d.providerMetadata!=null?{providerMetadata:d.providerMetadata}:{},(p==null?void 0:p.metadata)!=null?{toolMetadata:p.metadata}:{})):a.push(_object_spread({type:"tool-result",toolCallId:d.toolCallId,toolName:d.toolName,input:void 0,output:d.result,providerExecuted:!0,dynamic:d.dynamic},d.providerMetadata!=null?{providerMetadata:d.providerMetadata}:{},(p==null?void 0:p.metadata)!=null?{toolMetadata:p.metadata}:{}));break}d.isError?a.push(_object_spread({type:"tool-error",toolCallId:d.toolCallId,toolName:d.toolName,input:u.input,error:d.result,providerExecuted:!0,dynamic:u.dynamic},d.providerMetadata!=null?{providerMetadata:d.providerMetadata}:{},u.toolMetadata!=null?{toolMetadata:u.toolMetadata}:{})):a.push(_object_spread({type:"tool-result",toolCallId:d.toolCallId,toolName:d.toolName,input:u.input,output:d.result,providerExecuted:!0,dynamic:u.dynamic},d.providerMetadata!=null?{providerMetadata:d.providerMetadata}:{},u.toolMetadata!=null?{toolMetadata:u.toolMetadata}:{}));break}case"tool-approval-request":{var u10=t.find(function(p){return p.toolCallId===d.toolCallId});if(u10==null)throw new $z({toolCallId:d.toolCallId,approvalId:d.approvalId});a.push({type:"tool-approval-request",approvalId:d.approvalId,toolCall:u10});break}}};for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d=_step1.value;c.has(d.toolCallId)?s.push(d):l.push(d)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return _to_consumable_array(a).concat(_to_consumable_array(l),_to_consumable_array(n),_to_consumable_array(i),_to_consumable_array(s))}function wT(e,t){var r=new Headers(e!=null?e:{});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];r.has(n)||r.set(n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function get(param){var e=param.status,t=param.statusText,r=param.headers,n=param.stream;return new Response(n.pipeThrough(new TextEncoderStream),{status:e!=null?e:200,statusText:t,headers:wT(r,{"content-type":"text/plain; charset=utf-8"})})}function xpe(param){var e=param.response,t=param.status,r=param.statusText,n=param.headers,i=param.stream;var o=t!=null?t:200;r!==void 0?e.writeHead(o,r,n):e.writeHead(o,n);var a=i.getReader();return function(){return _async_to_generator(function(){var _ref,_$l,c,d,u,_tmp,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,7,8,9]);_state.label=1;case 1:return[4,a.read()];case 2:_ref=_state.sent(),_$l=_ref.done,c=_ref.value;if(_$l)return[3,6];d=e.write(c),u=e.flush;typeof u=="function"&&u.call(e);_tmp=d;if(_tmp)return[3,4];return[4,new Promise(function(p){e.once("drain",p)})];case 3:_tmp=_state.sent();_state.label=4;case 4:_tmp;_state.label=5;case 5:return[3,1];case 6:return[3,9];case 7:l=_state.sent();throw l;case 8:e.end();return[7];case 9:return[2]}})})()}()}function xet(param){var e=param.response,t=param.status,r=param.statusText,n=param.headers,i=param.stream;return xpe({response:e,status:t,statusText:r,headers:Object.fromEntries(wT(n,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:i.pipeThrough(new TextEncoderStream)})}function yet(param){var e=param.stream;return e.pipeThrough(new TransformStream({transform:function transform(t,r){t.type==="text-delta"&&r.enqueue(t.text)}}))}var ype=/*#__PURE__*/function(TransformStream1){"use strict";_inherits(ype1,TransformStream1);function ype1(){_class_call_check(this,ype1);return _call_super(this,ype1,[{transform:function transform(e,t){t.enqueue("data: ".concat(JSON.stringify(e),"\n\n"))},flush:function flush(e){e.enqueue("data: [DONE]\n\n")}}])}return ype1}(TransformStream),vpe={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function vet(param){var e=param.status,t=param.statusText,r=param.headers,n=param.stream,i=param.consumeSseStream;var o=n.pipeThrough(new ype);if(i){var _o_tee=_sliced_to_array(o.tee(),2),a=_o_tee[0],s=_o_tee[1];o=a,i({stream:s})}return new Response(o.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:wT(r,vpe)})}function _et(param){var e=param.response,t=param.status,r=param.statusText,n=param.headers,i=param.stream,o=param.consumeSseStream;var a=i.pipeThrough(new ype);if(o){var _a_tee=_sliced_to_array(a.tee(),2),s=_a_tee[0],l=_a_tee[1];a=s,o({stream:l})}return xpe({response:e,status:t,statusText:r,headers:Object.fromEntries(wT(n,vpe).entries()),stream:a.pipeThrough(new TextEncoderStream)})}function bet(param){var e=param.originalMessages,t=param.responseMessageId;if(e==null)return;var r=e[e.length-1];return(r==null?void 0:r.role)==="assistant"?r.id:typeof t=="function"?t():t}var i6=f.record(f.string(),g0.optional()),por=ne(function(){return te(f.union([f.looseObject({type:f.literal("text-start"),id:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("text-delta"),id:f.string(),delta:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("text-end"),id:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("error"),errorText:f.string()}),f.looseObject({type:f.literal("tool-input-start"),toolCallId:f.string(),toolName:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional(),toolMetadata:i6.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.looseObject({type:f.literal("tool-input-delta"),toolCallId:f.string(),inputTextDelta:f.string()}),f.looseObject({type:f.literal("tool-input-available"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional(),toolMetadata:i6.optional(),dynamic:f.boolean().optional(),title:f.string().optional()}),f.looseObject({type:f.literal("tool-input-error"),toolCallId:f.string(),toolName:f.string(),input:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional(),toolMetadata:i6.optional(),dynamic:f.boolean().optional(),errorText:f.string(),title:f.string().optional()}),f.looseObject({type:f.literal("tool-approval-request"),approvalId:f.string(),toolCallId:f.string(),isAutomatic:f.boolean().optional(),signature:f.string().optional()}),f.looseObject({type:f.literal("tool-approval-response"),approvalId:f.string(),approved:f.boolean(),reason:f.string().optional(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("tool-output-available"),toolCallId:f.string(),output:f.unknown(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional(),toolMetadata:i6.optional(),dynamic:f.boolean().optional(),preliminary:f.boolean().optional()}),f.looseObject({type:f.literal("tool-output-error"),toolCallId:f.string(),errorText:f.string(),providerExecuted:f.boolean().optional(),providerMetadata:It.optional(),toolMetadata:i6.optional(),dynamic:f.boolean().optional()}),f.looseObject({type:f.literal("tool-output-denied"),toolCallId:f.string()}),f.looseObject({type:f.literal("reasoning-start"),id:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("reasoning-delta"),id:f.string(),delta:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("reasoning-end"),id:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("custom"),kind:f.string().transform(function(e){return e}),providerMetadata:It.optional()}),f.looseObject({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("file"),url:f.string(),mediaType:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.literal("reasoning-file"),url:f.string(),mediaType:f.string(),providerMetadata:It.optional()}),f.looseObject({type:f.custom(function(e){return typeof e=="string"&&e.startsWith("data-")},{message:'Type must start with "data-"'}),id:f.string().optional(),data:f.unknown(),transient:f.boolean().optional()}),f.looseObject({type:f.literal("start-step")}),f.looseObject({type:f.literal("finish-step")}),f.looseObject({type:f.literal("start"),messageId:f.string().optional(),messageMetadata:f.unknown().optional()}),f.looseObject({type:f.literal("finish"),finishReason:f.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:f.unknown().optional()}),f.looseObject({type:f.literal("abort"),reason:f.string().optional()}),f.looseObject({type:f.literal("message-metadata"),messageMetadata:f.unknown()})]))});function wet(e){return e.type.startsWith("data-")}function Jd(){return Object.create(null)}function vz(e){return e.type.startsWith("data-")}function _z(e){return e.type==="text"}function Dce(e){return e.type==="custom"}function bz(e){return e.type==="file"}function Lce(e){return e.type==="reasoning-file"}function Fce(e){return e.type==="reasoning"}function Mz(e){return e.type.startsWith("tool-")}function _pe(e){return e.type==="dynamic-tool"}function dh(e){return Mz(e)||_pe(e)}function Oz(e){return e.type.split("-").slice(1).join("-")}function hT(e){return _pe(e)?e.toolName:Oz(e)}function ket(param){var e=param.lastMessage,t=param.messageId;return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:Jd(),activeReasoningParts:Jd(),partialToolCalls:Jd()}}function Cet(param){var e=param.stream,t=param.messageMetadataSchema,r=param.dataPartSchemas,n=param.runUpdateMessageJob,i=param.onError,o=param.onToolCall,a=param.onData;return e.pipeThrough(new TransformStream({transform:function transform(s,l){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n(function(param){var c=param.state,d=param.write;return _async_to_generator(function(){var u,p,m,h,_,S,S10,S11,S12,S13,S14,S15,S16,S17,_ref,k,_tmp,S18,S19,S20,k10,S21,S22,S23,E,C,S24,k11;function g(){var S=c.message.parts,k=S.length-1;for(;k>=0&&S[k].type!=="step-start";)k--;return S.slice(k+1)}function x(){return g().filter(dh)}function v(S){var E=x().find(function(C){return C.toolCallId===S});if(E==null){var C=c.message.parts;for(var T=C.length-1;T>=0;T--){var I=C[T];if(dh(I)&&I.toolCallId===S){E=I;break}}}if(E==null)throw new m0({chunkType:"tool-invocation",chunkId:S,message:'No tool invocation found for tool call ID "'.concat(S,'".')});return E}function y(S){var E=c.message.parts.filter(dh).find(function(C){var T;return((T=C.approval)==null?void 0:T.id)===S});if(E==null)throw new m0({chunkType:"tool-approval-response",chunkId:S,message:'No tool invocation found for approval ID "'.concat(S,'".')});return E}function _10(S,k){var E;var C=k!=null?k:g().find(function(O){return Mz(O)&&O.toolCallId===S.toolCallId}),T=S,I=C;if(C!=null){C.state=S.state,I.input=T.input,I.output=T.output,I.errorText=T.errorText,I.rawInput=T.rawInput,I.preliminary=T.preliminary,S.title!==void 0&&(I.title=S.title),S.toolMetadata!==void 0&&(I.toolMetadata=S.toolMetadata),I.providerExecuted=(E=T.providerExecuted)!=null?E:C.providerExecuted;var O=T.providerMetadata;if(O!=null)if(S.state==="output-available"||S.state==="output-error"){var M=C;M.resultProviderMetadata=O}else C.callProviderMetadata=O}else c.message.parts.push(_object_spread(_object_spread_props(_object_spread({type:"tool-".concat(S.toolName),toolCallId:S.toolCallId,state:S.state,title:S.title},S.toolMetadata!==void 0?{toolMetadata:S.toolMetadata}:{}),{input:T.input,output:T.output,rawInput:T.rawInput,errorText:T.errorText,providerExecuted:T.providerExecuted,preliminary:T.preliminary}),T.providerMetadata!=null&&(S.state==="output-available"||S.state==="output-error")?{resultProviderMetadata:T.providerMetadata}:{},T.providerMetadata!=null&&!(S.state==="output-available"||S.state==="output-error")?{callProviderMetadata:T.providerMetadata}:{}))}function b(S,k){var E,C;var T=k!=null?k:g().find(function(M){return M.type==="dynamic-tool"&&M.toolCallId===S.toolCallId}),I=S,O=T;if(T!=null){T.state=S.state,O.toolName=S.toolName,O.input=I.input,O.output=I.output,O.errorText=I.errorText,O.rawInput=(E=I.rawInput)!=null?E:O.rawInput,O.preliminary=I.preliminary,S.title!==void 0&&(O.title=S.title),S.toolMetadata!==void 0&&(O.toolMetadata=S.toolMetadata),O.providerExecuted=(C=I.providerExecuted)!=null?C:T.providerExecuted;var M=I.providerMetadata;if(M!=null)if(S.state==="output-available"||S.state==="output-error"){var R=T;R.resultProviderMetadata=M}else T.callProviderMetadata=M}else c.message.parts.push(_object_spread({type:"dynamic-tool",toolName:S.toolName,toolCallId:S.toolCallId,state:S.state,input:I.input,output:I.output,errorText:I.errorText,preliminary:I.preliminary,providerExecuted:I.providerExecuted,title:S.title},S.toolMetadata!==void 0?{toolMetadata:S.toolMetadata}:{},I.providerMetadata!=null&&(S.state==="output-available"||S.state==="output-error")?{resultProviderMetadata:I.providerMetadata}:{},I.providerMetadata!=null&&!(S.state==="output-available"||S.state==="output-error")?{callProviderMetadata:I.providerMetadata}:{}))}function w(S){return _async_to_generator(function(){var k,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(S!=null))return[3,3];k=c.message.metadata!=null?c6(c.message.metadata,S):S;_tmp=t!=null;if(!_tmp)return[3,2];return[4,ur({value:k,schema:t,context:{field:"message.metadata",entityId:c.message.id}})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp,c.message.metadata=k;_state.label=3;case 3:return[2]}})})()}return _ts_generator(this,function(_state){switch(_state.label){case 0:_=s.type;switch(_){case"text-start":return[3,1];case"text-delta":return[3,2];case"text-end":return[3,3];case"custom":return[3,4];case"reasoning-start":return[3,5];case"reasoning-delta":return[3,6];case"reasoning-end":return[3,7];case"file":return[3,8];case"reasoning-file":return[3,8];case"source-url":return[3,9];case"source-document":return[3,10];case"tool-input-start":return[3,11];case"tool-input-delta":return[3,12];case"tool-input-available":return[3,14];case"tool-input-error":return[3,17];case"tool-approval-request":return[3,18];case"tool-approval-response":return[3,19];case"tool-output-denied":return[3,20];case"tool-output-available":return[3,21];case"tool-output-error":return[3,22];case"start-step":return[3,23];case"finish-step":return[3,24];case"start":return[3,25];case"finish":return[3,27];case"message-metadata":return[3,29];case"error":return[3,31]}return[3,32];case 1:{S={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};c.activeTextParts[s.id]=S,c.message.parts.push(S),d();return[3,35]}_state.label=2;case 2:{S10=c.activeTextParts[s.id];if(S10==null)throw new m0({chunkType:"text-delta",chunkId:s.id,message:'Received text-delta for missing text part with ID "'.concat(s.id,'". Ensure a "text-start" chunk is sent before any "text-delta" chunks.')});S10.text+=s.delta,S10.providerMetadata=(u=s.providerMetadata)!=null?u:S10.providerMetadata,d();return[3,35]}_state.label=3;case 3:{S11=c.activeTextParts[s.id];if(S11==null)throw new m0({chunkType:"text-end",chunkId:s.id,message:'Received text-end for missing text part with ID "'.concat(s.id,'". Ensure a "text-start" chunk is sent before any "text-end" chunks.')});S11.state="done",S11.providerMetadata=(p=s.providerMetadata)!=null?p:S11.providerMetadata,delete c.activeTextParts[s.id],d();return[3,35]}_state.label=4;case 4:{S12={type:"custom",kind:s.kind,providerMetadata:s.providerMetadata};c.message.parts.push(S12),d();return[3,35]}_state.label=5;case 5:{S13={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};c.activeReasoningParts[s.id]=S13,c.message.parts.push(S13),d();return[3,35]}_state.label=6;case 6:{S14=c.activeReasoningParts[s.id];if(S14==null)throw new m0({chunkType:"reasoning-delta",chunkId:s.id,message:'Received reasoning-delta for missing reasoning part with ID "'.concat(s.id,'". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.')});S14.text+=s.delta,S14.providerMetadata=(m=s.providerMetadata)!=null?m:S14.providerMetadata,d();return[3,35]}_state.label=7;case 7:{S15=c.activeReasoningParts[s.id];if(S15==null)throw new m0({chunkType:"reasoning-end",chunkId:s.id,message:'Received reasoning-end for missing reasoning part with ID "'.concat(s.id,'". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.')});S15.providerMetadata=(h=s.providerMetadata)!=null?h:S15.providerMetadata,S15.state="done",delete c.activeReasoningParts[s.id],d();return[3,35]}_state.label=8;case 8:{c.message.parts.push(_object_spread({type:s.type,mediaType:s.mediaType,url:s.url},s.providerMetadata!=null?{providerMetadata:s.providerMetadata}:{})),d();return[3,35]}_state.label=9;case 9:{c.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),d();return[3,35]}_state.label=10;case 10:{c.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),d();return[3,35]}_state.label=11;case 11:{S16=g().filter(Mz);c.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:S16.length,dynamic:s.dynamic,title:s.title,toolMetadata:s.toolMetadata},s.dynamic?b({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,toolMetadata:s.toolMetadata,providerMetadata:s.providerMetadata}):_10({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,toolMetadata:s.toolMetadata,providerMetadata:s.providerMetadata}),d();return[3,35]}_state.label=12;case 12:S17=c.partialToolCalls[s.toolCallId];if(S17==null)throw new m0({chunkType:"tool-input-delta",chunkId:s.toolCallId,message:'Received tool-input-delta for missing tool call with ID "'.concat(s.toolCallId,'". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.')});S17.text+=s.inputTextDelta;return[4,p6(S17.text)];case 13:_ref=_state.sent(),k=_ref.value;S17.dynamic?b({toolCallId:s.toolCallId,toolName:S17.toolName,state:"input-streaming",input:k,title:S17.title,toolMetadata:S17.toolMetadata}):_10({toolCallId:s.toolCallId,toolName:S17.toolName,state:"input-streaming",input:k,title:S17.title,toolMetadata:S17.toolMetadata}),d();return[3,35];case 14:s.dynamic?b({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title,toolMetadata:s.toolMetadata}):_10({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title,toolMetadata:s.toolMetadata}),d();_tmp=o&&!s.providerExecuted;if(!_tmp)return[3,16];return[4,o({toolCall:s})];case 15:_tmp=_state.sent();_state.label=16;case 16:_tmp;return[3,35];case 17:{S18=g().filter(dh).find(function(E){return E.toolCallId===s.toolCallId});(S18!=null?S18.type==="dynamic-tool":!!s.dynamic)?b({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,toolMetadata:s.toolMetadata}):_10({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,toolMetadata:s.toolMetadata}),d();return[3,35]}_state.label=18;case 18:{S19=v(s.toolCallId);S19.state="approval-requested",S19.approval=_object_spread({id:s.approvalId},s.isAutomatic===!0?{isAutomatic:!0}:{},s.signature!=null?{signature:s.signature}:{}),d();return[3,35]}_state.label=19;case 19:{S20=y(s.approvalId),k10=S20.approval==null?{id:s.approvalId}:S20.approval;S20.state="approval-responded",S20.approval=_object_spread({id:s.approvalId,approved:s.approved},s.reason!=null?{reason:s.reason}:{},k10.isAutomatic===!0?{isAutomatic:!0}:{},k10.signature!=null?{signature:k10.signature}:{}),s.providerExecuted!=null&&(S20.providerExecuted=s.providerExecuted),s.providerMetadata!=null&&(S20.callProviderMetadata=s.providerMetadata),d();return[3,35]}_state.label=20;case 20:{S21=v(s.toolCallId);S21.state="output-denied",d();return[3,35]}_state.label=21;case 21:{S22=v(s.toolCallId);S22.type==="dynamic-tool"?b({toolCallId:s.toolCallId,toolName:S22.toolName,state:"output-available",input:S22.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:S22.title,toolMetadata:S22.toolMetadata},S22):_10({toolCallId:s.toolCallId,toolName:Oz(S22),state:"output-available",input:S22.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,providerMetadata:s.providerMetadata,title:S22.title,toolMetadata:S22.toolMetadata},S22),d();return[3,35]}_state.label=22;case 22:{S23=v(s.toolCallId);S23.type==="dynamic-tool"?b({toolCallId:s.toolCallId,toolName:S23.toolName,state:"output-error",input:S23.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:S23.title,toolMetadata:S23.toolMetadata},S23):_10({toolCallId:s.toolCallId,toolName:Oz(S23),state:"output-error",input:S23.input,rawInput:S23.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:S23.title,toolMetadata:S23.toolMetadata},S23),d();return[3,35]}_state.label=23;case 23:{c.message.parts.push({type:"step-start"});return[3,35]}_state.label=24;case 24:{c.activeTextParts=Jd(),c.activeReasoningParts=Jd();return[3,35]}_state.label=25;case 25:s.messageId!=null&&(c.message.id=s.messageId);return[4,w(s.messageMetadata)];case 26:_state.sent(),(s.messageId!=null||s.messageMetadata!=null)&&d();return[3,35];case 27:s.finishReason!=null&&(c.finishReason=s.finishReason);return[4,w(s.messageMetadata)];case 28:_state.sent(),s.messageMetadata!=null&&d();return[3,35];case 29:return[4,w(s.messageMetadata)];case 30:_state.sent(),s.messageMetadata!=null&&d();return[3,35];case 31:{i==null||i(new Error(s.errorText));return[3,35]}_state.label=32;case 32:if(!wet(s))return[3,35];if(!((r==null?void 0:r[s.type])!=null))return[3,34];E=c.message.parts.findIndex(function(T){return"id"in T&&"data"in T&&T.id===s.id&&T.type===s.type}),C=E>=0?E:c.message.parts.length;return[4,ur({value:s.data,schema:r[s.type],context:{field:"message.parts[".concat(C,"].data"),entityName:s.type,entityId:s.id}})];case 33:_state.sent();_state.label=34;case 34:S24=s;if(S24.transient){a==null||a(S24);return[3,35]}k11=S24.id!=null?c.message.parts.find(function(E){return S24.type===E.type&&S24.id===E.id}):void 0;k11!=null?k11.data=S24.data:c.message.parts.push(S24),a==null||a(S24),d();_state.label=35;case 35:l.enqueue(s);return[2]}})})()})];case 1:_state.sent();return[2]}})})()}}))}function Eet(param){var e=param.messageId,tmp=param.originalMessages,t=tmp===void 0?[]:tmp,r=param.onStepEnd,n=param.onStepFinish,i=param.onEnd,o=param.onFinish,a=param.onError,s=param.stream;var l=t==null?void 0:t[t.length-1];(l==null?void 0:l.role)!=="assistant"?l=void 0:e=l.id;var c=!1,d=s.pipeThrough(new TransformStream({transform:function transform(y,_){if(y.type==="start"){var b=y;b.messageId==null&&e!=null&&(b.messageId=e)}y.type==="abort"&&(c=!0),_.enqueue(y)}})),u=r!=null?r:n,p=i!=null?i:o;if(p==null&&u==null)return d;var m=ket({lastMessage:l?structuredClone(l):void 0,messageId:e!=null?e:""}),h=function(y){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,y({state:m,write:function(){}})];case 1:_state.sent();return[2]}})})()},g=!1,x=function(){return _async_to_generator(function(){var y;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(g||!p)return[2];g=!0;y=m.message.id===(l==null?void 0:l.id);return[4,p({isAborted:c,isContinuation:y,responseMessage:m.message,messages:_to_consumable_array(y?t.slice(0,-1):t).concat([m.message]),finishReason:m.finishReason})];case 1:_state.sent();return[2]}})})()},v=function(){return _async_to_generator(function(){var y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!u)return[2];y=m.message.id===(l==null?void 0:l.id);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,u({isContinuation:y,responseMessage:structuredClone(m.message),messages:_to_consumable_array(y?t.slice(0,-1):t).concat([structuredClone(m.message)])})];case 2:_state.sent();return[3,4];case 3:_=_state.sent();a(_);return[3,4];case 4:return[2]}})})()};return Cet({stream:d,runUpdateMessageJob:h,onError:a}).pipeThrough(new TransformStream({transform:function transform(y,_){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=y.type==="finish-step";if(!_tmp)return[3,2];return[4,v()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp,_.enqueue(y);return[2]}})})()},cancel:function cancel(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,x()];case 1:_state.sent();return[2]}})})()},flush:function flush(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,x()];case 1:_state.sent();return[2]}})})()}}))}function Tet(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=_ref.tools,tmp=_ref.sendReasoning,r=tmp===void 0?!0:tmp,tmp1=_ref.sendSources,n=tmp1===void 0?!1:tmp1,tmp2=_ref.sendStart,i=tmp2===void 0?!0:tmp2,tmp3=_ref.sendFinish,o=tmp3===void 0?!0:tmp3,tmp4=_ref.onError,a=tmp4===void 0?function(){return"An error occurred."}:tmp4,s=_ref.messageMetadata,l=_ref.responseMessageId;var c=function(u){var p=t==null?void 0:t[u.toolName];return p==null?u.dynamic:(p==null?void 0:p.type)==="dynamic"?!0:void 0},d=e.type;switch(d){case"text-start":return _object_spread({type:"text-start",id:e.id},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{});case"text-delta":return _object_spread({type:"text-delta",id:e.id,delta:e.text},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{});case"text-end":return _object_spread({type:"text-end",id:e.id},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{});case"reasoning-start":case"reasoning-end":return r?_object_spread({type:d,id:e.id},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}):void 0;case"reasoning-delta":return r?_object_spread({type:"reasoning-delta",id:e.id,delta:e.text},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}):void 0;case"file":case"reasoning-file":return d==="reasoning-file"&&!r?void 0:_object_spread({type:e.type,mediaType:e.file.mediaType,url:"data:".concat(e.file.mediaType,";base64,").concat(e.file.base64)},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{});case"source":return n?e.sourceType==="url"?_object_spread({type:"source-url",sourceId:e.id,url:e.url,title:e.title},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}):e.sourceType==="document"?_object_spread({type:"source-document",sourceId:e.id,mediaType:e.mediaType,title:e.title,filename:e.filename},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{}):void 0:void 0;case"custom":return _object_spread({type:"custom",kind:e.kind},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{});case"tool-input-start":{var u=c(e);return _object_spread({type:"tool-input-start",toolCallId:e.id,toolName:e.toolName},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{},u!=null?{dynamic:u}:{},e.title!=null?{title:e.title}:{})}case"tool-input-delta":return{type:"tool-input-delta",toolCallId:e.id,inputTextDelta:e.delta};case"tool-call":{var u10=c(e);return e.invalid?_object_spread(_object_spread_props(_object_spread({type:"tool-input-error",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{},u10!=null?{dynamic:u10}:{}),{errorText:a(e.error)}),e.title!=null?{title:e.title}:{}):_object_spread({type:"tool-input-available",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{},u10!=null?{dynamic:u10}:{},e.title!=null?{title:e.title}:{})}case"tool-approval-request":return _object_spread({type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId},e.isAutomatic!=null?{isAutomatic:e.isAutomatic}:{},e.signature!=null?{signature:e.signature}:{});case"tool-approval-response":return _object_spread({type:"tool-approval-response",approvalId:e.approvalId,approved:e.approved},e.reason!=null?{reason:e.reason}:{},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{});case"tool-result":{var u11=c(e);return _object_spread({type:"tool-output-available",toolCallId:e.toolCallId,output:e.output===void 0?null:e.output},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{},e.preliminary!=null?{preliminary:e.preliminary}:{},u11!=null?{dynamic:u11}:{})}case"tool-error":{var u12=c(e);return _object_spread({type:"tool-output-error",toolCallId:e.toolCallId,errorText:e.providerExecuted?typeof e.error=="string"?e.error:JSON.stringify(e.error):a(e.error)},e.providerExecuted!=null?{providerExecuted:e.providerExecuted}:{},e.providerMetadata!=null?{providerMetadata:e.providerMetadata}:{},e.toolMetadata!=null?{toolMetadata:e.toolMetadata}:{},u12!=null?{dynamic:u12}:{})}case"tool-output-denied":return{type:"tool-output-denied",toolCallId:e.toolCallId};case"error":return{type:"error",errorText:a(e.error)};case"start-step":return{type:"start-step"};case"finish-step":return{type:"finish-step"};case"start":return i?_object_spread({type:"start"},s!=null?{messageMetadata:s}:{},l!=null?{messageId:l}:{}):void 0;case"finish":return o?_object_spread({type:"finish",finishReason:e.finishReason},s!=null?{messageMetadata:s}:{}):void 0;case"abort":return e;case"tool-input-end":case"raw":return;default:{var u13=d;throw new Error("Unknown chunk type: ".concat(u13))}}}function Aet(param){var e=param.stream,t=param.tools,tmp=param.sendReasoning,r=tmp===void 0?!0:tmp,tmp1=param.sendSources,n=tmp1===void 0?!1:tmp1,tmp2=param.sendStart,i=tmp2===void 0?!0:tmp2,tmp3=param.sendFinish,o=tmp3===void 0?!0:tmp3,tmp4=param.onError,a=tmp4===void 0?function(){return"An error occurred."}:tmp4,s=param.messageMetadata,l=param.originalMessages,c=param.generateMessageId,d=param.onEnd,u=param.onFinish;var p=c!=null?bet({originalMessages:l,responseMessageId:c}):void 0,m=e.pipeThrough(new TransformStream({transform:function(h,g){return _async_to_generator(function(){var x,v;return _ts_generator(this,function(_state){x=s==null?void 0:s({part:h}),v=Tet(h,{tools:t,sendReasoning:r,sendSources:n,sendStart:i,sendFinish:o,onError:a,messageMetadata:x,responseMessageId:p});v!=null&&g.enqueue(v),x!=null&&h.type!=="start"&&h.type!=="finish"&&g.enqueue({type:"message-metadata",messageMetadata:x});return[2]})})()}}));return Eet({stream:m,messageId:p!=null?p:c==null?void 0:c(),originalMessages:l,onEnd:d!=null?d:u,onError:a})}function q2(e){return Iet(e.pipeThrough(new TransformStream))}function Iet(e){return e[Symbol.asyncIterator]=function(){var t=this.getReader(),r=!1;function n(i){return _async_to_generator(function(){var o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!!r)return[3,5];r=!0;_state.label=1;case 1:_state.trys.push([1,,4,5]);_tmp=i;if(!_tmp)return[3,3];return[4,(o=t.cancel)==null?void 0:o.call(t)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[3,5];case 4:try{t.releaseLock()}catch(a){}return[7];case 5:return[2]}})})()}return{next:function next(){return _async_to_generator(function(){var _ref,i,o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r)return[2,{done:!0,value:void 0}];return[4,t.read()];case 1:_ref=_state.sent(),i=_ref.done,o=_ref.value;if(!i)return[3,3];return[4,n(!0)];case 2:_tmp=(_state.sent(),{done:!0,value:void 0});return[3,4];case 3:_tmp={done:!1,value:o};_state.label=4;case 4:return[2,_tmp]}})})()},return:function _return(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n(!0)];case 1:return[2,(_state.sent(),{done:!0,value:void 0})]}})})()},throw:function _throw(i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n(!0)];case 1:throw _state.sent(),i}})})()}}},e}function Pet(_01){return _async_to_generator(function(param){var e,t,r,_ref,_$n,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.stream,t=param.onError;r=e.getReader();_state.label=1;case 1:_state.trys.push([1,6,7,8]);_state.label=2;case 2:return[4,r.read()];case 3:_ref=_state.sent(),_$n=_ref.done;if(_$n)return[3,5];_state.label=4;case 4:return[3,2];case 5:return[3,8];case 6:n=_state.sent();t==null||t(n);return[3,8];case 7:r.releaseLock();return[7];case 8:return[2]}})}).apply(this,arguments)}function zce(){var e,t;return{promise:new Promise(function(n,i){e=n,t=i}),resolve:e,reject:t}}function Ret(){var e=[],t=null,r=!1,n=zce(),i=function(){r=!0,n.resolve(),e.forEach(function(param){var a=param.reader,s=param.onCancel;s==null||s(),a.cancel()}),e=[],t==null||t.close()},o=function(){return _async_to_generator(function(){var a,s,_ref,_$l,c,_tmp,_tmp1,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r&&e.length===0){t==null||t.close();return[2]}if(!(e.length===0))return[3,3];n=zce();return[4,n.promise];case 1:_state.sent();return[4,o()];case 2:return[2,_state.sent()];case 3:s=e[0];_state.label=4;case 4:_state.trys.push([4,11,,12]);return[4,s.reader.read()];case 5:_ref=_state.sent(),_$l=_ref.value,c=_ref.done;if(!c)return[3,9];e.shift();if(!(e.length===0&&r))return[3,6];_tmp1=t==null||t.close();return[3,8];case 6:return[4,o()];case 7:_tmp1=_state.sent();_state.label=8;case 8:_tmp=_tmp1;return[3,10];case 9:_tmp=t==null||t.enqueue(_$l);_state.label=10;case 10:_tmp;return[3,12];case 11:l=_state.sent();(a=s.onError)==null||a.call(s,l),t==null||t.error(l),e.shift(),i();return[3,12];case 12:return[2]}})})()};return{stream:new ReadableStream({start:function start(a){t=a},pull:o,cancel:function cancel(){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,a,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];_step_value=_step.value,a=_step_value.reader,s=_step_value.onCancel;s==null||s();return[4,a.cancel()];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:e=[],r=!0;return[2]}})})()}}),addStream:function(a,s){if(r)throw new Error("Cannot add inner stream: outer stream is closed");e.push(_object_spread({reader:a.getReader()},s)),n.resolve()},close:function(){r=!0,n.resolve(),e.length===0&&(t==null||t.close())},terminate:i}}function Met(param){var e=param.stream,t=param.tools,r=param.callId,n=param.messages,i=param.abortSignal,o=param.timeout,a=param.experimental_sandbox,s=param.toolsContext,l=param.toolApproval,c=param.runtimeContext,d=param.toolApprovalSecret,u=param.generateId,p=param.onToolExecutionStart,m=param.onToolExecutionEnd,h=param.executeToolInTelemetryContext,g=param.runInTracingChannelSpan;var x=[];return e.pipeThrough(new TransformStream({transform:function transform(v,y){return _async_to_generator(function(){var _,b,w,S,k;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=(y.enqueue(v),v.type);switch(_){case"tool-call":return[3,1];case"model-call-end":return[3,4]}return[3,6];case 1:if(v.invalid)return[2];b=si(t,v.toolName);if(b==null)return[2];return[4,qz({tools:t,toolCall:v,toolApproval:l,messages:n,toolsContext:s,runtimeContext:c})];case 2:w=_state.sent();if(w.type==="not-applicable"){b.execute!=null&&v.providerExecuted!==!0&&x.push(v);return[2]}S=u();return[4,hpe({secret:d,approvalId:S,toolCallId:v.toolCallId,toolName:v.toolName,input:v.input})];case 3:k=_state.sent();switch(w.type){case"user-approval":{y.enqueue(_object_spread({type:"tool-approval-request",approvalId:S,toolCall:v},k!=null?{signature:k}:{}));return[2]}case"denied":{y.enqueue(_object_spread({type:"tool-approval-request",approvalId:S,toolCall:v,isAutomatic:!0},k!=null?{signature:k}:{})),y.enqueue({type:"tool-approval-response",approvalId:S,approved:!1,toolCall:v,reason:w.reason,providerExecuted:v.providerExecuted});return[2]}case"approved":{y.enqueue(_object_spread({type:"tool-approval-request",approvalId:S,toolCall:v,isAutomatic:!0},k!=null?{signature:k}:{})),y.enqueue({type:"tool-approval-response",approvalId:S,approved:!0,toolCall:v,reason:w.reason,providerExecuted:v.providerExecuted});break}}b.execute!=null&&v.providerExecuted!==!0&&x.push(v);return[2];case 4:return[4,Promise.all(x.map(function(b){return _async_to_generator(function(){var _$w,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,Uz({toolCall:b,tools:t,callId:r,messages:n,abortSignal:i,timeout:o,experimental_sandbox:a,toolsContext:s,onToolExecutionStart:p,onToolExecutionEnd:m,executeToolInTelemetryContext:h,runInTracingChannelSpan:g,onPreliminaryToolResult:function(S){y.enqueue(S)}})];case 1:_$w=_state.sent();_$w!=null&&(y.enqueue({type:"tool-execution-end",toolCallId:_$w.output.toolCallId,toolExecutionMs:_$w.toolExecutionMs}),y.enqueue(_$w.output));return[3,3];case 2:w=_state.sent();y.enqueue({type:"error",error:w});return[3,3];case 3:return[2]}})})()}))];case 5:_state.sent();return[2];case 6:return[2]}})})()}}))}function Oet(param){var e=param.stream,t=param.tools,r=param.stepInputMessages,n=param.abortSignal,i=param.runtimeContext;if(t==null)return e;var o=Jd();return e.pipeThrough(new TransformStream({transform:function transform(a,s){return _async_to_generator(function(){var _,l,_tmp,l10,c,_tmp1,l11,c10,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=(s.enqueue(a),a.type);switch(_){case"tool-input-start":return[3,1];case"tool-input-delta":return[3,4];case"tool-call":return[3,7]}return[3,10];case 1:o[a.id]=a.toolName;l=si(t,a.toolName);_tmp=(l==null?void 0:l.onInputStart)!=null;if(!_tmp)return[3,3];return[4,l.onInputStart({toolCallId:a.id,messages:r,abortSignal:n,context:i})];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[3,10];case 4:l10=o[a.id],c=si(t,l10);_tmp1=(c==null?void 0:c.onInputDelta)!=null;if(!_tmp1)return[3,6];return[4,c.onInputDelta({inputTextDelta:a.delta,toolCallId:a.id,messages:r,abortSignal:n,context:i})];case 5:_tmp1=_state.sent();_state.label=6;case 6:_tmp1;return[3,10];case 7:l11=o[a.toolCallId],c10=si(t,l11);delete o[a.toolCallId];_tmp2=(c10==null?void 0:c10.onInputAvailable)!=null;if(!_tmp2)return[3,9];return[4,c10.onInputAvailable({input:a.input,toolCallId:a.toolCallId,messages:r,abortSignal:n,context:i})];case 8:_tmp2=_state.sent();_state.label=9;case 9:_tmp2;_state.label=10;case 10:return[2]}})})()}}))}var $et=mo({prefix:"aitxt",size:24}),Net=mo({prefix:"call",size:24});function Det(_01){return _async_to_generator(function(){var e,t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,tmp,v,y,_,b,tmp1,_ref,tmp2,w,tmp3,S,tmp4,k,E,C,T,I,O,M,R,$,z,D,_tmp,L,ee,pe,_ref1,N,U,G,K;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=_01.model,t=_01.tools,r=_01.toolOrder,n=_01.output,i=_01.toolChoice,o=_01.prompt,a=_01.system,s=_01.instructions,l=_01.messages,c=_01.allowSystemInMessages,d=_01.download,u=_01.abortSignal,p=_01.headers,m=_01.includeRawChunks,h=_01.providerOptions,g=_01.repairToolCall,x=_01.refineToolInput,tmp=_01.executeLanguageModelCallInTelemetryContext,v=tmp===void 0?function(param){var O=param.execute;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,O()];case 1:return[2,_state.sent()]}})})()}:tmp,y=_01.callId,_=_01.toolsContext,b=_01.experimental_sandbox,tmp1=_01._internal,_ref=tmp1===void 0?{}:tmp1,tmp2=_ref.generateId,w=tmp2===void 0?$et:tmp2,tmp3=_ref.generateCallId,S=tmp3===void 0?Net:tmp3,tmp4=_ref.now,k=tmp4===void 0?l6:tmp4,E=_01.onStart,C=_01.onLanguageModelCallStart,T=_01.onLanguageModelCallEnd,I=_object_without_properties(_01,["model","tools","toolOrder","output","toolChoice","prompt","system","instructions","messages","allowSystemInMessages","download","abortSignal","headers","includeRawChunks","providerOptions","repairToolCall","refineToolInput","executeLanguageModelCallInTelemetryContext","callId","toolsContext","experimental_sandbox","_internal","onStart","onLanguageModelCallStart","onLanguageModelCallEnd"]);O=s6(e),M=y!=null?y:S();return[4,zz({instructions:s,system:a,prompt:o,messages:l,allowSystemInMessages:c})];case 1:R=_state.sent();_tmp={prompt:{instructions:R.instructions,messages:R.messages}};return[4,O.supportedUrls];case 2:return[4,Bde.apply(void 0,[(_tmp.supportedUrls=_state.sent(),_tmp.download=d,_tmp.provider=O.provider.split(".")[0],_tmp)])];case 3:$=_state.sent();return[4,Lz({tools:t,toolOrder:r,toolsContext:_,experimental_sandbox:b})];case 4:z=_state.sent(),D=Dz({toolChoice:i});return[4,go({event:{promptMessages:$},callbacks:E})];case 5:_state.sent();L=_object_spread({provider:O.provider,modelId:O.modelId,instructions:R.instructions,messages:R.messages,tools:z},I),ee=_object_spread({callId:M},L);return[4,go({event:ee,callbacks:C})];case 6:_state.sent();pe=k();return[4,v(_object_spread_props(_object_spread({},ee),{execute:function(){return _async_to_generator(function(){var _,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=O.doStream;_tmp=[_object_spread({},I)];_tmp1={tools:z,toolChoice:D};return[4,n==null?void 0:n.responseFormat];case 1:return[4,_.apply(O,[_object_spread_props.apply(void 0,_tmp.concat([(_tmp1.responseFormat=_state.sent(),_tmp1.prompt=$,_tmp1.providerOptions=h,_tmp1.abortSignal=u,_tmp1.headers=p,_tmp1.includeRawChunks=m,_tmp1)]))])];case 2:return[2,_state.sent()]}})})()}}))];case 7:_ref1=_state.sent(),N=_ref1.stream,U=_ref1.response,G=_ref1.request,K=N.pipeThrough(Let({tools:t,instructions:R.instructions,messages:R.messages,repairToolCall:g,refineToolInput:x,callId:M,provider:O.provider,modelId:O.modelId,generateId:w,now:k,callStartTimestampMs:pe,onLanguageModelCallEnd:T}));return[2,{stream:q2(K),response:U,request:G}]}})})()}function Let(param){var e=param.tools,t=param.instructions,r=param.messages,n=param.repairToolCall,i=param.refineToolInput,o=param.callId,a=param.provider,s=param.modelId,l=param.generateId,c=param.now,d=param.callStartTimestampMs,u=param.onLanguageModelCallEnd;var p=new Map,m=[],h=new Map,g=new Map,x=l(),v,y,_=[];return new TransformStream({transform:function transform(b,w){return _async_to_generator(function(){var S,k,_$E,_10,_$E1,_$E2,C,T,_$E3,E,_$E4,C1,_$E5,C10,T1,_$E6;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Fet(b)){_$E=c();v==null?v=_$E-d:y!=null&&_.push(_$E-y),y=_$E}_10=b.type;switch(_10){case"text-start":return[3,1];case"text-delta":return[3,2];case"text-end":return[3,3];case"reasoning-start":return[3,4];case"reasoning-delta":return[3,5];case"reasoning-end":return[3,6];case"file":return[3,7];case"reasoning-file":return[3,7];case"finish":return[3,8];case"tool-call":return[3,10];case"tool-approval-request":return[3,14];case"tool-result":return[3,15];case"tool-input-start":return[3,16];case"stream-start":return[3,17];case"response-metadata":return[3,18]}return[3,19];case 1:B2({content:m,partIndexes:h,id:b.id,type:"text",providerMetadata:b.providerMetadata}),w.enqueue(b);return[3,20];case 2:B2({content:m,partIndexes:h,id:b.id,type:"text",textDelta:b.delta,providerMetadata:b.providerMetadata}),w.enqueue({type:"text-delta",id:b.id,text:b.delta,providerMetadata:b.providerMetadata});return[3,20];case 3:B2({content:m,partIndexes:h,id:b.id,type:"text",providerMetadata:b.providerMetadata}),h.delete(b.id),w.enqueue(b);return[3,20];case 4:B2({content:m,partIndexes:g,id:b.id,type:"reasoning",providerMetadata:b.providerMetadata}),w.enqueue(b);return[3,20];case 5:B2({content:m,partIndexes:g,id:b.id,type:"reasoning",textDelta:b.delta,providerMetadata:b.providerMetadata}),w.enqueue({type:"reasoning-delta",id:b.id,text:b.delta,providerMetadata:b.providerMetadata});return[3,20];case 6:B2({content:m,partIndexes:g,id:b.id,type:"reasoning",providerMetadata:b.providerMetadata}),g.delete(b.id),w.enqueue(b);return[3,20];case 7:{_$E1=new GXe({data:b.data.type==="data"?b.data.data:b.data.url.toString(),mediaType:b.mediaType});m.push(_object_spread({type:b.type,file:_$E1},b.providerMetadata!=null?{providerMetadata:b.providerMetadata}:{})),w.enqueue({type:b.type,file:_$E1,providerMetadata:b.providerMetadata});return[3,20]}_state.label=8;case 8:_$E2=Yde(b.usage),C=c()-d,T={responseTimeMs:C,effectiveOutputTokensPerSecond:ch({tokens:_$E2.outputTokens,durationMs:C}),outputTokensPerSecond:v==null?void 0:ch({tokens:_$E2.outputTokens,durationMs:C-v}),inputTokensPerSecond:v==null?void 0:ch({tokens:_$E2.inputTokens,durationMs:v}),effectiveTotalTokensPerSecond:ch({tokens:Pz(_$E2.inputTokens,_$E2.outputTokens),durationMs:C}),timeToFirstOutputMs:v,timeBetweenOutputChunksMs:_.length>0?zet(_):void 0};return[4,go({event:{callId:o,provider:a,modelId:s,finishReason:b.finishReason.unified,usage:_$E2,content:m,responseId:x,performance:T},callbacks:u})];case 9:_state.sent(),w.enqueue({type:"model-call-end",finishReason:b.finishReason.unified,rawFinishReason:b.finishReason.raw,usage:_$E2,providerMetadata:b.providerMetadata,performance:T});return[3,20];case 10:_state.trys.push([10,12,,13]);return[4,rpe({toolCall:b,tools:e,repairToolCall:n,refineToolInput:i,instructions:t,messages:r})];case 11:_$E3=_state.sent();if(p.set(_$E3.toolCallId,_$E3),w.enqueue(_$E3),m.push(_$E3),_$E3.invalid){_$E3.providerExecuted||w.enqueue(_object_spread({type:"tool-error",toolCallId:_$E3.toolCallId,toolName:_$E3.toolName,input:_$E3.input,error:xa(_$E3.error),dynamic:!0,title:_$E3.title},_$E3.toolMetadata!=null?{toolMetadata:_$E3.toolMetadata}:{}));return[3,20]}return[3,13];case 12:E=_state.sent();w.enqueue({type:"error",error:E});return[3,13];case 13:return[3,20];case 14:{_$E4=p.get(b.toolCallId);if(_$E4==null){w.enqueue({type:"error",error:new $z({toolCallId:b.toolCallId,approvalId:b.approvalId})});return[3,20]}C1={type:"tool-approval-request",approvalId:b.approvalId,toolCall:_$E4};w.enqueue(C1),m.push(C1);return[3,20]}_state.label=15;case 15:{_$E5=b.toolName,C10=p.get(b.toolCallId),T1=b.isError?_object_spread({type:"tool-error",toolCallId:b.toolCallId,toolName:_$E5,input:C10==null?void 0:C10.input,providerExecuted:!0,error:b.result,dynamic:b.dynamic},b.providerMetadata!=null?{providerMetadata:b.providerMetadata}:{},(C10==null?void 0:C10.toolMetadata)!=null?{toolMetadata:C10.toolMetadata}:{}):_object_spread({type:"tool-result",toolCallId:b.toolCallId,toolName:_$E5,input:C10==null?void 0:C10.input,output:b.result,providerExecuted:!0,dynamic:b.dynamic},b.providerMetadata!=null?{providerMetadata:b.providerMetadata}:{},(C10==null?void 0:C10.toolMetadata)!=null?{toolMetadata:C10.toolMetadata}:{});w.enqueue(T1),m.push(T1);return[3,20]}_state.label=16;case 16:{_$E6=si(e,b.toolName);w.enqueue(_object_spread(_object_spread_props(_object_spread({},b),{dynamic:(S=b.dynamic)!=null?S:(_$E6==null?void 0:_$E6.type)==="dynamic",title:_$E6==null?void 0:_$E6.title}),(_$E6==null?void 0:_$E6.metadata)!=null?{toolMetadata:_$E6.metadata}:{}));return[3,20]}_state.label=17;case 17:{w.enqueue({type:"model-call-start",warnings:b.warnings});return[3,20]}_state.label=18;case 18:{x=(k=b.id)!=null?k:x,w.enqueue({type:"model-call-response-metadata",id:b.id,timestamp:b.timestamp,modelId:b.modelId});return[3,20]}_state.label=19;case 19:(b.type==="custom"||b.type==="source")&&m.push(b),w.enqueue(b);return[3,20];case 20:return[2]}})})()}})}function Fet(e){return e.type==="text-delta"&&e.delta.length>0||e.type==="reasoning-delta"&&e.delta.length>0||e.type==="tool-input-delta"&&e.delta.length>0||e.type==="file"||e.type==="reasoning-file"||e.type==="tool-call"}function zet(e){var t=_to_consumable_array(e).sort(function(n,i){return n-i}),r=e.reduce(function(n,i){return n+i},0);return{min:t[0],p10:wz(t,.1),median:wz(t,.5),avg:r/e.length,p90:wz(t,.9),max:t[t.length-1]}}function wz(e,t){return e[Math.ceil(t*e.length)-1]}function B2(param){var e=param.content,t=param.partIndexes,r=param.id,n=param.type,i=param.textDelta,o=param.providerMetadata;var a=t.get(r);a==null&&(a=e.push(_object_spread({type:n,text:""},o!=null?{providerMetadata:o}:{}))-1,t.set(r,a));var s=e[a];i!=null&&(s.text+=i),o!=null&&(s.providerMetadata=o)}var jet=mo({prefix:"aitxt",size:24}),Uet=mo({prefix:"call",size:24}),Bet={file:!0,custom:!1,source:!1,"text-start":!1,"text-end":!1,"text-delta":!0,"reasoning-start":!1,"reasoning-end":!1,"reasoning-delta":!0,"reasoning-file":!0,"tool-input-start":!1,"tool-input-end":!1,"tool-input-delta":!0,"tool-approval-request":!1,"tool-approval-response":!1,"tool-call":!0,"tool-result":!1,"tool-error":!1,"tool-execution-end":!1,"model-call-start":!1,"model-call-response-metadata":!1,"model-call-end":!1,error:!1,raw:!1};function qet(e){if(!Bet[e.type])return!1;switch(e.type){case"text-delta":case"reasoning-delta":return e.text.length>0;case"tool-input-delta":return e.delta.length>0;case"file":case"reasoning-file":case"tool-call":return!0;default:return!1}}function Wet(_01){var e=_01.model,t=_01.tools,r=_01.toolChoice,n=_01.instructions,i=_01.system,o=_01.prompt,a=_01.messages,s=_01.allowSystemInMessages,l=_01.maxRetries,c=_01.abortSignal,d=_01.timeout,u=_01.headers,tmp=_01.stopWhen,p=tmp===void 0?Vz(1):tmp,m=_01.experimental_sandbox,h=_01.output,g=_01.toolApproval,x=_01.experimental_toolApprovalSecret,v=_01.experimental_telemetry,tmp1=_01.telemetry,y=tmp1===void 0?v:tmp1,_=_01.prepareStep,b=_01.providerOptions,w=_01.activeTools,S=_01.toolOrder,k=_01.experimental_repairToolCall,tmp2=_01.repairToolCall,E=tmp2===void 0?k:tmp2,C=_01.experimental_refineToolInput,T=_01.experimental_transform,I=_01.experimental_download,O=_01.includeRawChunks,M=_01.onChunk,tmp3=_01.onError,R=tmp3===void 0?function(param){var nt=param.error;console.error(nt)}:tmp3,$=_01.onFinish,tmp4=_01.onEnd,z=tmp4===void 0?$:tmp4,D=_01.onAbort,L=_01.onStepEnd,ee=_01.onStepFinish,pe=_01.onStart,N=_01.experimental_onStart,U=_01.onStepStart,G=_01.experimental_onStepStart,K=_01.onLanguageModelCallStart,me=_01.experimental_onLanguageModelCallStart,V=_01.onLanguageModelCallEnd,ie=_01.experimental_onLanguageModelCallEnd,re=_01.onToolExecutionStart,de=_01.onToolExecutionEnd,xe=_01.experimental_onToolCallStart,Y=_01.experimental_onToolCallFinish,tmp5=_01.runtimeContext,oe=tmp5===void 0?{}:tmp5,tmp6=_01.toolsContext,H=tmp6===void 0?{}:tmp6,J=_01.experimental_include,tmp7=_01.include,j=tmp7===void 0?J:tmp7,tmp8=_01._internal,_ref=tmp8===void 0?{}:tmp8,tmp9=_ref.now,Q=tmp9===void 0?l6:tmp9,tmp10=_ref.generateId,Fe=tmp10===void 0?jet:tmp10,tmp11=_ref.generateCallId,it=tmp11===void 0?Uet:tmp11,pt=_object_without_properties(_01,["model","tools","toolChoice","instructions","system","prompt","messages","allowSystemInMessages","maxRetries","abortSignal","timeout","headers","stopWhen","experimental_sandbox","output","toolApproval","experimental_toolApprovalSecret","experimental_telemetry","telemetry","prepareStep","providerOptions","activeTools","toolOrder","experimental_repairToolCall","repairToolCall","experimental_refineToolInput","experimental_transform","experimental_download","includeRawChunks","onChunk","onError","onFinish","onEnd","onAbort","onStepEnd","onStepFinish","onStart","experimental_onStart","onStepStart","experimental_onStepStart","onLanguageModelCallStart","experimental_onLanguageModelCallStart","onLanguageModelCallEnd","experimental_onLanguageModelCallEnd","onToolExecutionStart","onToolExecutionEnd","experimental_onToolCallStart","experimental_onToolCallFinish","runtimeContext","toolsContext","experimental_include","include","_internal"]);var nt,gt,Ie,we;var Oe=Vde(d),Pe=Gde(d),tt=TXe(d),We=AXe(d),Ut=Pe!=null?new AbortController:void 0,Rt=tt!=null?new AbortController:void 0,Ve=We!=null?new AbortController:void 0,Tr=pe!=null?pe:N,yn=U!=null?U:G,Di=K!=null?K:me,Rn=V!=null?V:ie,Uo=re!=null?re:xe,Ea=de!=null?de:Y,Nn=L!=null?L:ee;return new Get({model:s6(e),telemetry:y,headers:u,settings:pt,maxRetries:l,abortSignal:jz(c,Oe,Ut==null?void 0:Ut.signal,Rt==null?void 0:Rt.signal,Ve==null?void 0:Ve.signal),stepTimeoutMs:Pe,stepAbortController:Ut,firstChunkTimeoutMs:tt,firstChunkAbortController:Rt,chunkTimeoutMs:We,chunkAbortController:Ve,instructions:n,system:i,prompt:o,messages:a,allowSystemInMessages:s,experimental_sandbox:m,tools:t,toolsContext:H,runtimeContext:oe,toolChoice:r,transforms:ks(T),activeTools:w,toolOrder:S,repairToolCall:E,refineToolInput:C,stopConditions:ks(p),output:h,toolApproval:g,experimental_toolApprovalSecret:x,providerOptions:b,prepareStep:_,timeout:d,onChunk:M,onError:R,onEnd:z,onAbort:D,onStepFinish:Nn,onStart:Tr,onStepStart:yn,onLanguageModelCallStart:Di,onLanguageModelCallEnd:Rn,onToolExecutionStart:Uo,onToolExecutionEnd:Ea,now:Q,generateId:Fe,generateCallId:it,download:I,include:{requestBody:(nt=j==null?void 0:j.requestBody)!=null?nt:!1,requestMessages:(gt=j==null?void 0:j.requestMessages)!=null?gt:!1,rawChunks:(we=(Ie=j==null?void 0:j.rawChunks)!=null?Ie:O)!=null?we:!1}})}function jce(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e];case 1:_state.sent();return[3,3];case 2:t=_state.sent();return[3,3];case 3:return[2]}})})()}function Vet(e){var t,r="",n="",i,o="";function a(param){var s=param.controller,tmp=param.partialOutput,l=tmp===void 0?void 0:tmp;s.enqueue({part:{type:"text-delta",id:t,text:n,providerMetadata:i},partialOutput:l}),n=""}return new TransformStream({transform:function transform(s,l){return _async_to_generator(function(){var c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(s.type==="finish-step"&&n.length>0&&a({controller:l}),s.type!=="text-delta"&&s.type!=="text-start"&&s.type!=="text-end"){l.enqueue({part:s,partialOutput:void 0});return[2]}if(t==null)t=s.id;else if(s.id!==t){l.enqueue({part:s,partialOutput:void 0});return[2]}if(s.type==="text-start"){l.enqueue({part:s,partialOutput:void 0});return[2]}if(s.type==="text-end"){n.length>0&&a({controller:l}),l.enqueue({part:s,partialOutput:void 0});return[2]}r+=s.text,n+=s.text,i=(c=s.providerMetadata)!=null?c:i;return[4,e.parsePartialOutput({text:r})];case 1:d=_state.sent();if(d!==void 0){u=typeof d.partial=="string"?d.partial:JSON.stringify(d.partial);u!==o&&(a({controller:l,partialOutput:d.partial}),o=u)}return[2]}})})()}})}var Get=/*#__PURE__*/function(){"use strict";function Get1(param){var e=param.model,t=param.telemetry,r=param.headers,n=param.settings,i=param.maxRetries,o=param.abortSignal,a=param.stepTimeoutMs,s=param.stepAbortController,l=param.firstChunkTimeoutMs,c=param.firstChunkAbortController,d=param.chunkTimeoutMs,u=param.chunkAbortController,p=param.instructions,m=param.system,h=param.prompt,g=param.messages,x=param.allowSystemInMessages,v=param.experimental_sandbox,y=param.tools,_=param.toolChoice,b=param.transforms,w=param.activeTools,S=param.toolOrder,k=param.repairToolCall,E=param.refineToolInput,C=param.stopConditions,T=param.output,I=param.toolApproval,O=param.experimental_toolApprovalSecret,M=param.providerOptions,R=param.prepareStep,$=param.now,z=param.generateId,D=param.generateCallId,L=param.timeout,ee=param.onChunk,pe=param.onError,N=param.onEnd,U=param.onAbort,G=param.onStepFinish,K=param.onStart,me=param.onStepStart,V=param.onLanguageModelCallStart,ie=param.onLanguageModelCallEnd,re=param.onToolExecutionStart,de=param.onToolExecutionEnd,xe=param.runtimeContext,Y=param.toolsContext,oe=param.download,H=param.include;_class_call_check(this,Get1);this._totalUsage=new uh,this._finishReason=new uh,this._rawFinishReason=new uh,this._steps=new uh,this._initialResponseMessages=new uh,this.outputSpecification=T,this.tools=y;var J=spe({telemetry:t,includeRuntimeContext:t==null?void 0:t.includeRuntimeContext,includeToolsContext:t==null?void 0:t.includeToolsContext}),j,Q=[],Fe,it,pt,nt={},gt=[],Ie=[],we=[],Oe=[],Pe,tt=[],We=new Map,Ut=Jd(),Rt=Jd(),Ve,Tr=new TransformStream({transform:function transform(Ee,Mt){return _async_to_generator(function(){var xr,Yr,Bo,mu,xt,Xr,Xr1,Xr2,Xr3,Xr4,Xr5,zs;return _ts_generator(this,function(_state){switch(_state.label){case 0:Mt.enqueue(Ee);xt=Ee.part;return[4,ee==null?void 0:ee({chunk:xt})];case 1:if(!(_state.sent(),xt.type==="error"))return[3,3];Xr=Jde(xt.error);gT.isInstance(Xr)&&(Ve=Xr);return[4,pe({error:Xr})];case 2:_state.sent();_state.label=3;case 3:if((xt.type==="custom"||xt.type==="source"||xt.type==="tool-call"||xt.type==="tool-approval-request"||xt.type==="tool-approval-response"||xt.type==="tool-error")&&Q.push(xt),xt.type==="text-start"&&(Ut[xt.id]={type:"text",text:"",providerMetadata:xt.providerMetadata},Q.push(Ut[xt.id])),xt.type==="text-delta"){Xr1=Ut[xt.id];if(Xr1==null){Mt.enqueue({part:{type:"error",error:"text part ".concat(xt.id," not found")},partialOutput:void 0});return[2]}Xr1.text+=xt.text,Xr1.providerMetadata=(xr=xt.providerMetadata)!=null?xr:Xr1.providerMetadata}if(xt.type==="text-end"){Xr2=Ut[xt.id];if(Xr2==null){Mt.enqueue({part:{type:"error",error:"text part ".concat(xt.id," not found")},partialOutput:void 0});return[2]}Xr2.providerMetadata=(Yr=xt.providerMetadata)!=null?Yr:Xr2.providerMetadata,delete Ut[xt.id]}if(xt.type==="reasoning-start"&&(Rt[xt.id]={type:"reasoning",text:"",providerMetadata:xt.providerMetadata},Q.push(Rt[xt.id])),xt.type==="reasoning-delta"){Xr3=Rt[xt.id];if(Xr3==null){Mt.enqueue({part:{type:"error",error:"reasoning part ".concat(xt.id," not found")},partialOutput:void 0});return[2]}Xr3.text+=xt.text,Xr3.providerMetadata=(Bo=xt.providerMetadata)!=null?Bo:Xr3.providerMetadata}if(xt.type==="reasoning-end"){Xr4=Rt[xt.id];if(Xr4==null){Mt.enqueue({part:{type:"error",error:"reasoning part ".concat(xt.id," not found")},partialOutput:void 0});return[2]}Xr4.providerMetadata=(mu=xt.providerMetadata)!=null?mu:Xr4.providerMetadata,delete Rt[xt.id]}if(!((xt.type==="file"||xt.type==="reasoning-file")&&Q.push(_object_spread({type:xt.type,file:xt.file},xt.providerMetadata!=null?{providerMetadata:xt.providerMetadata}:{})),xt.type==="tool-result"&&!xt.preliminary&&Q.push(xt),xt.type==="start-step"&&(Q=[],Rt=Jd(),Ut=Jd(),nt=xt.request,Ie=xt.warnings),xt.type==="finish-step"))return[3,6];return[4,cpe({content:Q,tools:y})];case 4:Xr5=_state.sent(),zs=new Wz({callId:q,stepNumber:we.length,provider:e.provider,modelId:e.modelId,runtimeContext:xe,toolsContext:Y,content:Q,finishReason:xt.finishReason,rawFinishReason:xt.rawFinishReason,usage:xt.usage,performance:xt.performance,warnings:Ie,request:_object_spread_props(_object_spread({},nt),{messages:H.requestMessages?o6(gt):void 0}),response:_object_spread_props(_object_spread({},xt.response),{messages:o6(Xr5)}),providerMetadata:xt.providerMetadata});return[4,go({event:zs,callbacks:[G,J.onStepEnd]})];case 5:_state.sent(),W2({warnings:Ie,provider:e.provider,model:e.modelId}),we.push(zs),Pe=_to_consumable_array(tt).concat(_to_consumable_array(Xr5)),j.resolve();_state.label=6;case 6:xt.type==="finish"&&(pt=xt.totalUsage,Fe=xt.finishReason,it=xt.rawFinishReason);return[2]}})})()},flush:function flush(Ee){return _async_to_generator(function(){var Br,_$Mt,xr,Yr,Bo,mu,xt,Xr,zs,pd,mc,ca,Mn,Ta,Mt;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);if(we.length===0||Ve!=null){Br=o!=null&&o.aborted?o.reason:Ve!=null?Ve:new gT({message:"No output generated. Check the stream for errors."});Ar.rejectResultPromises(Br);return[2]}_$Mt=Fe!=null?Fe:"other",xr=pt!=null?pt:gz();Ar._finishReason.resolve(_$Mt),Ar._rawFinishReason.resolve(it),Ar._totalUsage.resolve(xr),Ar._steps.resolve(we);Yr=we[we.length-1],Bo=we.flatMap(function(Br){return Br.content}),mu=we.flatMap(function(Br){return Br.files}),xt=we.flatMap(function(Br){return Br.sources}),Xr=we.flatMap(function(Br){return Br.toolCalls}),zs=we.flatMap(function(Br){return Br.staticToolCalls}),pd=we.flatMap(function(Br){return Br.dynamicToolCalls}),mc=we.flatMap(function(Br){return Br.toolResults}),ca=we.flatMap(function(Br){return Br.staticToolResults}),Mn=we.flatMap(function(Br){return Br.dynamicToolResults}),Ta=we.flatMap(function(Br){var Ga;return(Ga=Br.warnings)!=null?Ga:[]});return[4,go({event:{callId:q,toolsContext:Yr.toolsContext,stepNumber:Yr.stepNumber,model:Yr.model,runtimeContext:Yr.runtimeContext,finishReason:Yr.finishReason,rawFinishReason:Yr.rawFinishReason,usage:xr,totalUsage:xr,content:Bo,text:Yr.text,reasoning:Yr.reasoning,reasoningText:Yr.reasoningText,files:mu,sources:xt,toolCalls:Xr,staticToolCalls:zs,dynamicToolCalls:pd,toolResults:mc,staticToolResults:ca,dynamicToolResults:Mn,responseMessages:_to_consumable_array(Oe).concat(_to_consumable_array(we.flatMap(function(Br){return Br.response.messages}))),warnings:Ta,request:Yr.request,response:Yr.response,providerMetadata:Yr.providerMetadata,steps:we,finalStep:Yr},callbacks:[N,J.onEnd]})];case 1:_state.sent();return[3,3];case 2:Mt=_state.sent();Ee.error(Mt);return[3,3];case 3:return[2]}})})()}}),yn=Ret();this.addStream=yn.addStream,this.closeStream=yn.close;var Di=yn.stream.getReader(),Rn=new ReadableStream({start:function start(Ee){return _async_to_generator(function(){return _ts_generator(this,function(_state){Ee.enqueue({type:"start"});return[2]})})()},pull:function pull(Ee){return _async_to_generator(function(){var _ref,_$xr,Yr,xr,_tmp;function Mt(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,go({event:_object_spread({callId:q,steps:we},(o==null?void 0:o.reason)!==void 0?{reason:o.reason}:{}),callbacks:[U,J.onAbort]})];case 1:_state.sent(),Ee.enqueue(_object_spread({type:"abort"},(o==null?void 0:o.reason)!==void 0?{reason:xa(o.reason)}:{})),Ee.close();return[2]}})})()}return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,8]);return[4,Di.read()];case 1:_ref=_state.sent(),_$xr=_ref.done,Yr=_ref.value;if(_$xr){Ee.close();return[2]}if(!(o!=null&&o.aborted))return[3,3];return[4,Mt()];case 2:_state.sent();return[2];case 3:Ee.enqueue(Yr);return[3,8];case 4:xr=_state.sent();if(!(Kl(xr)&&o!=null&&o.aborted))return[3,6];return[4,Mt()];case 5:_tmp=_state.sent();return[3,7];case 6:_tmp=Ee.error(xr);_state.label=7;case 7:_tmp;return[3,8];case 8:return[2]}})})()},cancel:function cancel(Ee){return yn.stream.cancel(Ee)}}),Uo=!0;Rn=Rn.pipeThrough(new TransformStream({transform:function transform(Ee,Mt){return _async_to_generator(function(){return _ts_generator(this,function(_state){Uo&&Mt.enqueue(Ee);return[2]})})()}}));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=b[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var Ee=_step.value;Rn=Rn.pipeThrough(Ee({tools:y,stopStream:function stopStream(){yn.terminate(),Uo=!1}}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.baseStream=Rn.pipeThrough(Vet(T!=null?T:_T())).pipeThrough(Tr);var _Ez=Ez({maxRetries:i,abortSignal:o}),Ea=_Ez.maxRetries,Nn=Cz(n),Ar=this,q=D();(function(){return _async_to_generator(function(){var Ee,Mt,xr,Yr,Bo,mu,xt,Xr,_epe,zs,pd,_ref,ca,Mn,Ta,Br,Ga,qo,bn,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,da,Ii,da1,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,Zn,_10,_tmp,err,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,Zn1;function mc(_01){return _async_to_generator(function(param){var ca,Mn,Ta,Br,Ga,qo,bn,Ii,da,Zn,fi,fd,Kf,Qf,Jf,ue,Jt,_$Li,sn,Co,gu,xu,Cr,Ml,Ol,B,ae,Z,ve,be,ge,ye,Re,_Ez,ze,_ref,Ue,Ge,Tt,kt,Hr,ar,Cn,On,Fi,Us,Bs,yu,Eo,lg,ug,Yf,Xf,Hk,Pp,hc,vu,Li;function De(){o!=null&&o.aborted||(ue=xT({abortController:c,label:"First chunk",timeoutMs:l}))}function at(){ue!=null&&(clearTimeout(ue),ue=void 0)}function bi(){Jt!=null&&clearTimeout(Jt),Jt=xT({abortController:u,label:"Chunk",timeoutMs:d})}function ko(){Jt!=null&&(clearTimeout(Jt),Jt=void 0)}function js(){Jf!=null&&clearTimeout(Jf)}function hu(){js(),at(),ko()}function rr(){o==null||o.removeEventListener("abort",rr),hu()}return _ts_generator(this,function(_state){switch(_state.label){case 0:ca=param.currentStep,Mn=param.usage;Jf=xT({abortController:s,label:"Step",timeoutMs:a});o==null||o.addEventListener("abort",rr,{once:!0});_state.label=1;case 1:_state.trys.push([1,5,,6]);j=new uh;_$Li=(Ta=J.startTracingChannelContext)==null?void 0:Ta.call(J,{type:"step",event:{callId:q,stepNumber:ca},completion:j.promise}),sn=function(cr){var io;return(io=_$Li==null?void 0:_$Li.run(cr))!=null?io:cr()},Co=we.flatMap(function(cr){return cr.response.messages}),gu=_to_consumable_array(Oe).concat(_to_consumable_array(Co)),xu=Pe!=null?Pe:_to_consumable_array(xt).concat(_to_consumable_array(Oe));return[4,R==null?void 0:R({model:e,steps:we,stepNumber:we.length,instructions:Xr,initialInstructions:Mt.instructions,messages:xu,initialMessages:xt,responseMessages:gu,toolsContext:Y,runtimeContext:xe,experimental_sandbox:v})];case 2:Cr=_state.sent(),Ml=(Br=Cr==null?void 0:Cr.experimental_sandbox)!=null?Br:v;xe=(Ga=Cr==null?void 0:Cr.runtimeContext)!=null?Ga:xe,Y=(qo=Cr==null?void 0:Cr.toolsContext)!=null?qo:Y;Ol=s6((bn=Cr==null?void 0:Cr.model)!=null?bn:e),B=tpe({tools:y,activeTools:(Ii=Cr==null?void 0:Cr.activeTools)!=null?Ii:w}),ae=(da=Cr==null?void 0:Cr.toolOrder)!=null?da:S;return[4,Lz({tools:B,toolOrder:ae,toolsContext:Y,experimental_sandbox:Ml})];case 3:Z=_state.sent(),ve=Dz({toolChoice:(Zn=Cr==null?void 0:Cr.toolChoice)!=null?Zn:_}),be=(fi=Cr==null?void 0:Cr.messages)!=null?fi:xu;tt=be;ge=(Kf=(fd=Cr==null?void 0:Cr.instructions)!=null?fd:Cr==null?void 0:Cr.system)!=null?Kf:Xr;Xr=ge;ye=c6(M,Cr==null?void 0:Cr.providerOptions),Re=$(),_Ez=Ez({maxRetries:Ea,abortSignal:o}),ze=_Ez.retry;return[4,sn(function(){return ze(function(){return _async_to_generator(function(){var cr,io;return _ts_generator(this,function(_state){return[2,Det(_object_spread({model:(cr=Cr==null?void 0:Cr.model)!=null?cr:e,tools:B,toolOrder:ae,toolChoice:(io=Cr==null?void 0:Cr.toolChoice)!=null?io:_,instructions:ge,messages:be,allowSystemInMessages:x,repairToolCall:k,refineToolInput:E,abortSignal:o,headers:r,includeRawChunks:H.rawChunks,providerOptions:ye,download:oe,output:T,callId:q,executeLanguageModelCallInTelemetryContext:J.executeLanguageModelCall,toolsContext:Y,experimental_sandbox:Ml,onLanguageModelCallStart:mf(V,J.onLanguageModelCallStart),onLanguageModelCallEnd:mf(ie,J.onLanguageModelCallEnd),onStart:function(param){var md=param.promptMessages;return _async_to_generator(function(){var hd,gd;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,go({event:{callId:q,provider:Ol.provider,modelId:Ol.modelId,stepNumber:we.length,instructions:ge,messages:be,tools:y,toolChoice:(hd=Cr==null?void 0:Cr.toolChoice)!=null?hd:_,activeTools:(gd=Cr==null?void 0:Cr.activeTools)!=null?gd:w,toolOrder:ae,steps:_to_consumable_array(we),providerOptions:ye,runtimeContext:xe,toolsContext:Y,output:T,promptMessages:md,stepTools:Z,stepToolChoice:ve},callbacks:[me,J.onStepStart]})];case 1:_state.sent();return[2]}})})()},_internal:{now:$}},Nn))]})})()})})];case 4:_ref=_state.sent(),Ue=_ref.stream,Ge=_ref.request,Tt=_ref.response;De();kt=Oet({stream:Ue,tools:y,stepInputMessages:be,abortSignal:o,runtimeContext:xe}),Hr=J.runInTracingChannelSpan==null?void 0:function(cr){return sn(function(){return J.runInTracingChannelSpan(cr)})},ar=Met({stream:kt,tools:y,callId:q,messages:be,abortSignal:o,timeout:L,experimental_sandbox:Ml,toolsContext:Y,toolApproval:I,runtimeContext:xe,toolApprovalSecret:O,generateId:z,onToolExecutionStart:mf(re,J.onToolExecutionStart),onToolExecutionEnd:mf(de,J.onToolExecutionEnd),executeToolInTelemetryContext:J.executeTool,runInTracingChannelSpan:Hr}),Cn=_object_spread_props(_object_spread({},Ge),{body:H.requestBody?Ge==null?void 0:Ge.body:void 0,messages:H.requestMessages?o6(be):void 0});gt=(Qf=Cn.messages)!=null?Qf:[];On=[],Fi=[],Us=[],yu="other",lg=!1,ug=!1,Yf=gz(),Hk=!0,Pp={responseTimeMs:0,effectiveOutputTokensPerSecond:0,outputTokensPerSecond:void 0,inputTokensPerSecond:void 0,effectiveTotalTokensPerSecond:0,timeToFirstOutputMs:void 0,timeBetweenOutputChunksMs:void 0},hc={},vu={id:z(),timestamp:new Date,modelId:e.modelId};Ar.addStream(ar.pipeThrough(new TransformStream({transform:function transform(cr,io){return _async_to_generator(function(){var md,hd,gd,cg,K_;return _ts_generator(this,function(_state){if(cr.type==="model-call-start"){Bs=cr.warnings;return[2]}Hk&&(Hk=!1,io.enqueue({type:"start-step",request:Cn,warnings:Bs!=null?Bs:[]}));cg=cr.type;switch(qet(cr)&&(ug||at(),ug=!0,bi()),cg){case"file":case"custom":case"source":case"text-start":case"text-end":case"reasoning-start":case"reasoning-end":case"reasoning-delta":case"reasoning-file":case"tool-input-start":case"tool-input-end":case"tool-input-delta":case"tool-approval-request":{io.enqueue(cr);break}case"text-delta":{cr.text.length>0&&io.enqueue(cr);break}case"tool-call":{io.enqueue(cr),On.push(cr);break}case"tool-approval-response":{io.enqueue(cr),Us.push(cr);break}case"tool-result":{io.enqueue(cr),cr.preliminary||Fi.push(cr);break}case"tool-error":{io.enqueue(cr),Fi.push(cr);break}case"tool-execution-end":{hc[cr.toolCallId]=cr.toolExecutionMs;break}case"model-call-response-metadata":{vu={id:(md=cr.id)!=null?md:vu.id,timestamp:(hd=cr.timestamp)!=null?hd:vu.timestamp,modelId:(gd=cr.modelId)!=null?gd:vu.modelId};break}case"model-call-end":{lg=!0,Yf=cr.usage,yu=cr.finishReason,Eo=cr.rawFinishReason,Xf=cr.providerMetadata,Pp=cr.performance;break}case"error":{lg=!0,io.enqueue(cr),yu="error";break}case"raw":{H.rawChunks&&io.enqueue(cr);break}default:{K_=cg;throw new Error("Unknown chunk type: ".concat(K_))}}return[2]})})()},flush:function flush(cr){return _async_to_generator(function(){var io,md,hd,gd,cg,K_,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$Wo,_tmp,Wo;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!lg&&!ug){cr.enqueue({type:"error",error:new gT({message:"No output generated. The model stream ended without a finish chunk."})}),rr(),Ar.closeStream();return[2]}io=$()-Re,md={type:"finish-step",finishReason:yu,rawFinishReason:Eo,usage:Yf,performance:_object_spread({stepTimeMs:io,toolExecutionMs:hc},Pp),providerMetadata:Xf,response:_object_spread_props(_object_spread({},vu),{headers:Tt==null?void 0:Tt.headers})};cr.enqueue(md);hd=Xde(Mn,Yf);return[4,j.promise];case 1:_state.sent();gd=On.filter(function(Wo){return Wo.providerExecuted!==!0}),cg=Fi.filter(function(Wo){return Wo.providerExecuted!==!0}),K_=Us.filter(function(Wo){return Wo.approved===!1});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{_loop=function(){var _$Wo=_step.value;if(_$Wo.providerExecuted!==!0)return"continue";var j1=si(y,_$Wo.toolName);(j1==null?void 0:j1.type)==="provider"&&j1.supportsDeferredResults&&(Fi.some(function(Q_){return(Q_.type==="tool-result"||Q_.type==="tool-error")&&Q_.toolCallId===_$Wo.toolCallId})||We.set(_$Wo.toolCallId,{toolName:_$Wo.toolName}))};for(_iterator=On[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=Fi[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_$Wo=_step1.value;(_$Wo.type==="tool-result"||_$Wo.type==="tool-error")&&We.delete(_$Wo.toolCallId)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}rr();_tmp=gd.length>0&&gd.length===cg.length+K_.length||We.size>0;if(!_tmp)return[3,3];return[4,upe({stopConditions:C,steps:we})];case 2:_tmp=!_state.sent();_state.label=3;case 3:if(!_tmp)return[3,8];_state.label=4;case 4:_state.trys.push([4,6,,7]);return[4,Bo(function(){return mc({currentStep:ca+1,usage:hd})})];case 5:_state.sent();return[3,7];case 6:Wo=_state.sent();cr.enqueue({type:"error",error:Wo}),Ar.closeStream();return[3,7];case 7:return[3,9];case 8:cr.enqueue({type:"finish",finishReason:yu,rawFinishReason:Eo,totalUsage:hd}),Ar.closeStream();_state.label=9;case 9:return[2]}})})()}})),{onError:rr,onCancel:rr});return[3,6];case 5:Li=_state.sent();throw rr(),Li;case 6:return[2]}})}).apply(this,arguments)}return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,zz({instructions:p,system:m,prompt:h,messages:g,allowSystemInMessages:x})];case 1:Mt=_state.sent(),xr={callId:q,operationId:"ai.streamText",provider:e.provider,modelId:e.modelId,instructions:Mt.instructions,messages:Mt.messages,tools:y,toolChoice:_,activeTools:w,toolOrder:S,maxOutputTokens:Nn.maxOutputTokens,temperature:Nn.temperature,topP:Nn.topP,topK:Nn.topK,presencePenalty:Nn.presencePenalty,frequencyPenalty:Nn.frequencyPenalty,stopSequences:Nn.stopSequences,seed:Nn.seed,reasoning:Nn.reasoning,maxRetries:Ea,timeout:L,headers:r,providerOptions:M,output:T,runtimeContext:xe,toolsContext:Y},Yr=(Ee=J.startTracingChannelContext)==null?void 0:Ee.call(J,{type:"streamText",event:xr,completion:Ar._totalUsage.promise.then(function(){})}),Bo=function(ca){var Mn;return(Mn=Yr==null?void 0:Yr.run(ca))!=null?Mn:ca()},mu=J.runInTracingChannelSpan==null?void 0:function(ca){return Bo(function(){return J.runInTracingChannelSpan(ca)})};return[4,go({event:xr,callbacks:[K,J.onStart]})];case 2:_state.sent();xt=Mt.messages,Xr=Mt.instructions,_epe=epe({messages:xt}),zs=_epe.approvedToolApprovals,pd=_epe.deniedToolApprovals;if(!(pd.length>0||zs.length>0))return[3,16];return[4,gpe({approvedToolApprovals:zs.filter(function(Ii){return!Ii.toolCall.providerExecuted}),tools:y,toolApproval:I,messages:xt,toolsContext:Y,runtimeContext:xe,toolApprovalSecret:O})];case 3:_ref=_state.sent(),ca=_ref.approvedToolApprovals,Mn=_ref.deniedToolApprovals,Ta=_to_consumable_array(pd.filter(function(Ii){return!Ii.toolCall.providerExecuted})).concat(_to_consumable_array(Mn)),Br=Ta.filter(function(Ii){return Ii.existingToolResult==null}),Ga=pd.filter(function(Ii){return Ii.toolCall.providerExecuted}),bn=new ReadableStream({start:function start(Ii){qo=Ii}});Ar.addStream(bn);_state.label=4;case 4:_state.trys.push([4,,15,16]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_to_consumable_array(Ta).concat(_to_consumable_array(Ga))[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){da=_step.value;qo==null||qo.enqueue({type:"tool-output-denied",toolCallId:da.toolCall.toolCallId,toolName:da.toolCall.toolName})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}Ii=[];return[4,Promise.all(ca.map(function(da){return _async_to_generator(function(){var Zn;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Uz({toolCall:da.toolCall,tools:y,callId:q,messages:xt,abortSignal:o,timeout:L,experimental_sandbox:v,toolsContext:Y,onToolExecutionStart:mf(re,J.onToolExecutionStart),onToolExecutionEnd:mf(de,J.onToolExecutionEnd),executeToolInTelemetryContext:J.executeTool,runInTracingChannelSpan:mu,onPreliminaryToolResult:function(fi){qo==null||qo.enqueue(fi)}})];case 1:Zn=_state.sent();Zn!=null&&(qo==null||qo.enqueue(Zn.output),Ii.push(Zn.output));return[2]}})})()}))];case 5:if(!(_state.sent(),Ii.length>0||Br.length>0))return[3,14];da1=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=6;case 6:_state.trys.push([6,11,12,13]);_iterator1=Ii[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,10];Zn=_step1.value;_10=da1.push;_tmp={type:"tool-result",toolCallId:Zn.toolCallId,toolName:Zn.toolName};return[4,h0({toolCallId:Zn.toolCallId,input:Zn.input,tool:si(y,Zn.toolName),output:Zn.type==="tool-result"?Zn.output:Zn.error,errorMode:Zn.type==="tool-error"?"text":"none"})];case 8:_10.apply(da1,[(_tmp.output=_state.sent(),_tmp)]);_state.label=9;case 9:_iteratorNormalCompletion1=true;return[3,7];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 13:_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=Br[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){Zn1=_step2.value;da1.push({type:"tool-result",toolCallId:Zn1.toolCall.toolCallId,toolName:Zn1.toolCall.toolName,output:{type:"execution-denied",reason:Zn1.approvalResponse.reason}})}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}Oe.push({role:"tool",content:da1});_state.label=14;case 14:return[3,16];case 15:qo==null||qo.close();return[7];case 16:Ar._initialResponseMessages.resolve(Oe);return[4,Bo(function(){return mc({currentStep:0,usage:gz()})})];case 17:_state.sent();return[2]}})})()})().catch(function(Ee){return _async_to_generator(function(){var Mt;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(Mt=J.onError)==null?void 0:Mt.call(J,{callId:q,error:Ee})];case 1:_state.sent(),Ar._initialResponseMessages.reject(Ee),jce(Ar._initialResponseMessages.promise),Ar.addStream(new ReadableStream({start:function start(xr){xr.enqueue({type:"error",error:Ee}),xr.close()}})),Ar.closeStream();return[2]}})})()})}_create_class(Get1,[{key:"steps",get:function get1(){return this.consumeStream(),this._steps.promise}},{key:"finalStep",get:function get1(){return this.steps.then(function(e){return e.at(-1)})}},{key:"content",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.content})})}},{key:"warnings",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){var r;return(r=t.warnings)!=null?r:[]})})}},{key:"providerMetadata",get:function get1(){return this.finalStep.then(function(e){return e.providerMetadata})}},{key:"text",get:function get1(){return this.finalStep.then(function(e){return e.text})}},{key:"reasoningText",get:function get1(){return this.finalStep.then(function(e){return e.reasoningText})}},{key:"reasoning",get:function get1(){return this.finalStep.then(function(e){return ipe(e.reasoning)})}},{key:"sources",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.sources})})}},{key:"files",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.files})})}},{key:"toolCalls",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.toolCalls})})}},{key:"staticToolCalls",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.staticToolCalls})})}},{key:"dynamicToolCalls",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.dynamicToolCalls})})}},{key:"toolResults",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.toolResults})})}},{key:"staticToolResults",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.staticToolResults})})}},{key:"dynamicToolResults",get:function get1(){return this.steps.then(function(e){return e.flatMap(function(t){return t.dynamicToolResults})})}},{key:"usage",get:function get1(){return this.totalUsage}},{key:"request",get:function get1(){return this.finalStep.then(function(e){return e.request})}},{key:"response",get:function get1(){return this.finalStep.then(function(e){return e.response})}},{key:"responseMessages",get:function get1(){return Promise.all([this._initialResponseMessages.promise,this.steps]).then(function(param){var _param=_sliced_to_array(param,2),e=_param[0],t=_param[1];return _to_consumable_array(e).concat(_to_consumable_array(t.flatMap(function(r){return r.response.messages})))})}},{key:"totalUsage",get:function get1(){return this.consumeStream(),this._totalUsage.promise}},{key:"finishReason",get:function get1(){return this.consumeStream(),this._finishReason.promise}},{key:"rawFinishReason",get:function get1(){return this.consumeStream(),this._rawFinishReason.promise}},{key:"teeStream",value:function teeStream(){var _this_baseStream_tee=_sliced_to_array(this.baseStream.tee(),2),e=_this_baseStream_tee[0],t=_this_baseStream_tee[1];return this.baseStream=t,e}},{key:"textStream",get:function get1(){return q2(yet({stream:this.stream}))}},{key:"stream",get:function get1(){return q2(this.teeStream().pipeThrough(new TransformStream({transform:function transform(param,t){var e=param.part;t.enqueue(e)}})))}},{key:"fullStream",get:function get1(){return this.stream}},{key:"rejectResultPromises",value:function rejectResultPromises(e){this.rejectResultPromise({delayedPromise:this._finishReason,error:e}),this.rejectResultPromise({delayedPromise:this._rawFinishReason,error:e}),this.rejectResultPromise({delayedPromise:this._totalUsage,error:e}),this.rejectResultPromise({delayedPromise:this._steps,error:e}),this.rejectResultPromise({delayedPromise:this._initialResponseMessages,error:e})}},{key:"rejectResultPromise",value:function rejectResultPromise(param){var e=param.delayedPromise,t=param.error;e.isPending()&&(e.reject(t),jce(e.promise))}},{key:"consumeStream",value:function consumeStream(e){return _async_to_generator(function(){var _this,t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,Pet({stream:this.stream,onError:function(r){var n;_this.rejectResultPromises(r),(n=e==null?void 0:e.onError)==null||n.call(e,r)}})];case 2:_state.sent();return[3,4];case 3:r=_state.sent();this.rejectResultPromises(r),(t=e==null?void 0:e.onError)==null||t.call(e,r);return[3,4];case 4:return[2]}})}).call(this)}},{key:"experimental_partialOutputStream",get:function get1(){return this.partialOutputStream}},{key:"partialOutputStream",get:function get1(){return q2(this.teeStream().pipeThrough(new TransformStream({transform:function transform(param,t){var e=param.partialOutput;e!=null&&t.enqueue(e)}})))}},{key:"elementStream",get:function get1(){var e,t,r;var n=(e=this.outputSpecification)==null?void 0:e.createElementStreamTransform();if(n==null)throw new or({functionality:"element streams in ".concat((r=(t=this.outputSpecification)==null?void 0:t.name)!=null?r:"text"," mode")});return q2(this.teeStream().pipeThrough(n))}},{key:"output",get:function get1(){var _this=this;return this.finalStep.then(function(e){var t;return((t=_this.outputSpecification)!=null?t:_T()).parseCompleteOutput({text:e.text},{response:e.response,usage:e.usage,finishReason:e.finishReason})})}},{key:"toUIMessageStream",value:function toUIMessageStream(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=_ref.originalMessages,t=_ref.generateMessageId,r=_ref.onEnd,n=_ref.onFinish,i=_ref.messageMetadata,o=_ref.sendReasoning,a=_ref.sendSources,s=_ref.sendStart,l=_ref.sendFinish,c=_ref.onError;return q2(Aet({stream:this.stream,tools:this.tools,originalMessages:e,generateMessageId:t,onEnd:r!=null?r:n,messageMetadata:i,sendReasoning:o,sendSources:a,sendStart:s,sendFinish:l,onError:c}))}},{key:"pipeUIMessageStreamToResponse",value:function pipeUIMessageStreamToResponse(e){var _11=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;var _ref=[_11],_ref1=_sliced_to_array(_ref,1),tmp=_ref1[0],_ref2=tmp===void 0?{}:tmp,t=_ref2.originalMessages,r=_ref2.generateMessageId,n=_ref2.onEnd,i=_ref2.onFinish,o=_ref2.messageMetadata,a=_ref2.sendReasoning,s=_ref2.sendSources,l=_ref2.sendFinish,c=_ref2.sendStart,d=_ref2.onError,u=_object_without_properties(_ref2,["originalMessages","generateMessageId","onEnd","onFinish","messageMetadata","sendReasoning","sendSources","sendFinish","sendStart","onError"]);return _et(_object_spread({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:r,onEnd:n!=null?n:i,messageMetadata:o,sendReasoning:a,sendSources:s,sendFinish:l,sendStart:c,onError:d})},u))}},{key:"pipeTextStreamToResponse",value:function pipeTextStreamToResponse(e,t){return xet(_object_spread({response:e,stream:this.textStream},t))}},{key:"toUIMessageStreamResponse",value:function toUIMessageStreamResponse(){var _01=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;var _ref=[_01],_ref1=_sliced_to_array(_ref,1),tmp=_ref1[0],_ref2=tmp===void 0?{}:tmp,e=_ref2.originalMessages,t=_ref2.generateMessageId,r=_ref2.onEnd,n=_ref2.onFinish,i=_ref2.messageMetadata,o=_ref2.sendReasoning,a=_ref2.sendSources,s=_ref2.sendFinish,l=_ref2.sendStart,c=_ref2.onError,d=_object_without_properties(_ref2,["originalMessages","generateMessageId","onEnd","onFinish","messageMetadata","sendReasoning","sendSources","sendFinish","sendStart","onError"]);return vet(_object_spread({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onEnd:r!=null?r:n,messageMetadata:i,sendReasoning:o,sendSources:a,sendFinish:s,sendStart:l,onError:c})},d))}},{key:"toTextStreamResponse",value:function toTextStreamResponse(e){return get(_object_spread({stream:this.textStream},e))}}]);return Get1}(),bpe=/*#__PURE__*/function(){"use strict";function bpe1(e){_class_call_check(this,bpe1);this.version="agent-v1";var t=e.onFinish,tmp=e.onEnd,r=tmp===void 0?t:tmp;this.settings=_object_spread_props(_object_spread({},e),{onEnd:r})}_create_class(bpe1,[{key:"id",get:function get1(){return this.settings.id}},{key:"tools",get:function get1(){return this.settings.tools}},{key:"prepareCall",value:function prepareCall(e){return _async_to_generator(function(){var t,r,n,i,C,_this_settings,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(this.settings.callOptionsSchema!=null&&e.options!==void 0))return[3,2];return[4,ur({value:e.options,schema:this.settings.callOptionsSchema,context:{field:"options"}})];case 1:C=_state.sent();e=_object_spread_props(_object_spread({},e),{options:C});_state.label=2;case 2:_this_settings=this.settings,o=_this_settings.onStart,a=_this_settings.experimental_onStart,s=_this_settings.onStepStart,l=_this_settings.experimental_onStepStart,c=_this_settings.onToolExecutionStart,d=_this_settings.onToolExecutionEnd,u=_this_settings.onStepEnd,p=_this_settings.onStepFinish,m=_this_settings.onFinish,h=_this_settings.onEnd,g=_object_without_properties(_this_settings,["onStart","experimental_onStart","onStepStart","experimental_onStepStart","onToolExecutionStart","onToolExecutionEnd","onStepEnd","onStepFinish","onFinish","onEnd"]),x=_object_spread(_object_spread_props(_object_spread({},g),{stopWhen:(t=this.settings.stopWhen)!=null?t:Vz(20)}),e);return[4,(n=(r=this.settings).prepareCall)==null?void 0:n.call(r,x)];case 3:v=(i=_state.sent())!=null?i:x,y=v.instructions,_=v.allowSystemInMessages,b=v.messages,w=v.prompt,S=v.runtimeContext,k=_object_without_properties(v,["instructions","allowSystemInMessages","messages","prompt","runtimeContext"]),E={instructions:y,allowSystemInMessages:_,messages:b,prompt:w};return[2,S===void 0?_object_spread({},k,E):_object_spread(_object_spread_props(_object_spread({},k),{runtimeContext:S}),E)]}})}).call(this)}},{key:"agentHeaders",value:function agentHeaders(e){var t;return Bi((t=e.headers)!=null?t:{},"ai-sdk-agent/tool-loop")}},{key:"generate",value:function generate(_01){return _async_to_generator(function(){var e,t,r,n,i,o,a,s,l,c,d,u,tmp,p,m,h,g,x,v,y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=_01.abortSignal,t=_01.timeout,r=_01.experimental_sandbox,n=_01.onStart,i=_01.experimental_onStart,o=_01.onStepStart,a=_01.experimental_onStepStart,s=_01.onToolExecutionStart,l=_01.onToolExecutionEnd,c=_01.onStepEnd,d=_01.onStepFinish,u=_01.onFinish,tmp=_01.onEnd,p=tmp===void 0?u:tmp,m=_object_without_properties(_01,["abortSignal","timeout","experimental_sandbox","onStart","experimental_onStart","onStepStart","experimental_onStepStart","onToolExecutionStart","onToolExecutionEnd","onStepEnd","onStepFinish","onFinish","onEnd"]);v=Hz;return[4,this.prepareCall(_object_spread_props(_object_spread({},m),{experimental_sandbox:r}))];case 1:y=_state.sent(),_={abortSignal:e,timeout:t,experimental_sandbox:r,onStart:pl((h=this.settings.onStart)!=null?h:this.settings.experimental_onStart,n!=null?n:i),onStepStart:pl((g=this.settings.onStepStart)!=null?g:this.settings.experimental_onStepStart,o!=null?o:a),onToolExecutionStart:pl(this.settings.onToolExecutionStart,s),onToolExecutionEnd:pl(this.settings.onToolExecutionEnd,l),onStepEnd:pl((x=this.settings.onStepEnd)!=null?x:this.settings.onStepFinish,c!=null?c:d),onEnd:pl(this.settings.onEnd,p)};return[4,v(_object_spread_props(_object_spread({},y,_),{headers:this.agentHeaders(y)}))];case 2:return[2,_state.sent()]}})}).call(this)}},{key:"stream",value:function stream(_01){return _async_to_generator(function(){var e,t,r,n,i,o,a,s,l,c,d,u,p,tmp,m,h,g,x,v,y,_,b;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=_01.abortSignal,t=_01.timeout,r=_01.experimental_sandbox,n=_01.experimental_transform,i=_01.onStart,o=_01.experimental_onStart,a=_01.onStepStart,s=_01.experimental_onStepStart,l=_01.onToolExecutionStart,c=_01.onToolExecutionEnd,d=_01.onStepEnd,u=_01.onStepFinish,p=_01.onFinish,tmp=_01.onEnd,m=tmp===void 0?p:tmp,h=_object_without_properties(_01,["abortSignal","timeout","experimental_sandbox","experimental_transform","onStart","experimental_onStart","onStepStart","experimental_onStepStart","onToolExecutionStart","onToolExecutionEnd","onStepEnd","onStepFinish","onFinish","onEnd"]);y=Wet;return[4,this.prepareCall(_object_spread_props(_object_spread({},h),{experimental_sandbox:r}))];case 1:_=_state.sent(),b={abortSignal:e,timeout:t,experimental_sandbox:r,experimental_transform:n,onStart:pl((g=this.settings.onStart)!=null?g:this.settings.experimental_onStart,i!=null?i:o),onStepStart:pl((x=this.settings.onStepStart)!=null?x:this.settings.experimental_onStepStart,a!=null?a:s),onToolExecutionStart:pl(this.settings.onToolExecutionStart,l),onToolExecutionEnd:pl(this.settings.onToolExecutionEnd,c),onStepEnd:pl((v=this.settings.onStepEnd)!=null?v:this.settings.onStepFinish,d!=null?d:u),onEnd:pl(this.settings.onEnd,m)};return[4,y(_object_spread_props(_object_spread({},_,b),{headers:this.agentHeaders(_)}))];case 2:return[2,_state.sent()]}})}).call(this)}}]);return bpe1}();function wpe(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,_,i,o,o10,i10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,a,_tmp,_tmp1,err,i11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];t!=null&&t.ignoreIncompleteToolCalls&&(e=e.map(function(n){return _object_spread_props(_object_spread({},n),{parts:n.parts.filter(function(i){return!dh(i)||i.state!=="input-streaming"&&i.state!=="input-available"})})}));_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,22,23,24]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,21];n=_step.value;_=n.role;switch(_){case"system":return[3,3];case"user":return[3,4];case"assistant":return[3,5]}return[3,19];case 3:{i=n.parts.filter(function(a){return a.type==="text"}),o=i.reduce(function(a,s){return s.providerMetadata!=null?_object_spread({},a,s.providerMetadata):a},{});r.push(_object_spread({role:"system",content:i.map(function(a){return a.text}).join("")},Object.keys(o).length>0?{providerOptions:o}:{}));return[3,20]}_state.label=4;case 4:{r.push({role:"user",content:n.parts.map(function(i){var o;if(_z(i))return _object_spread({type:"text",text:i.text},i.providerMetadata!=null?{providerOptions:i.providerMetadata}:{});if(bz(i))return _object_spread({type:"file",mediaType:i.mediaType,filename:i.filename,data:i.providerReference!=null?{type:"reference",reference:i.providerReference}:{type:"url",url:new URL(i.url)}},i.providerMetadata!=null?{providerOptions:i.providerMetadata}:{});if(vz(i))return(o=t==null?void 0:t.convertDataPart)==null?void 0:o.call(t,i)}).filter(p0)});return[3,20]}_state.label=5;case 5:if(!(n.parts!=null))return[3,18];o10=function o10(){return _async_to_generator(function(){var a,s,l,c,d,u,p,m,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g,x,v,_,_tmp,x10,x11,err,h,g10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,x12,_10,v10,_11,_tmp1,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(i10.length===0)return[2];m=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=i10[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];g=_step.value;if(!_z(g))return[3,3];m.push(_object_spread({type:"text",text:g.text},g.providerMetadata!=null?{providerOptions:g.providerMetadata}:{}));return[3,11];case 3:if(!Dce(g))return[3,4];m.push(_object_spread({type:"custom",kind:g.kind},g.providerMetadata!=null?{providerOptions:g.providerMetadata}:{}));return[3,11];case 4:if(!bz(g))return[3,5];m.push(_object_spread({type:"file",mediaType:g.mediaType,filename:g.filename,data:g.providerReference!=null?{type:"reference",reference:g.providerReference}:{type:"url",url:new URL(g.url)}},g.providerMetadata!=null?{providerOptions:g.providerMetadata}:{}));return[3,11];case 5:if(!Lce(g))return[3,6];m.push({type:"reasoning-file",data:{type:"url",url:new URL(g.url)},mediaType:g.mediaType,providerOptions:g.providerMetadata});return[3,11];case 6:if(!Fce(g))return[3,7];m.push({type:"reasoning",text:g.text,providerOptions:g.providerMetadata});return[3,11];case 7:if(!dh(g))return[3,10];x=hT(g);if(!(g.state!=="input-streaming"&&(m.push(_object_spread({type:"tool-call",toolCallId:g.toolCallId,toolName:x,input:g.state==="output-error"?(a=g.input)!=null?a:"rawInput"in g?g.rawInput:void 0:g.input,providerExecuted:g.providerExecuted},g.callProviderMetadata!=null?{providerOptions:g.callProviderMetadata}:{})),g.approval!=null&&m.push(_object_spread({type:"tool-approval-request",approvalId:g.approval.id,toolCallId:g.toolCallId,isAutomatic:g.approval.isAutomatic},g.approval.signature!=null?{signature:g.approval.signature}:{})),g.providerExecuted===!0&&g.state!=="approval-responded"&&(g.state==="output-available"||g.state==="output-error"))))return[3,9];v=(s=g.resultProviderMetadata)!=null?s:g.callProviderMetadata;_=m.push;_tmp={type:"tool-result",toolCallId:g.toolCallId,toolName:x};return[4,h0({toolCallId:g.toolCallId,input:g.input,output:g.state==="output-error"?g.errorText:g.output,tool:si(t==null?void 0:t.tools,x),errorMode:g.state==="output-error"?"json":"none"})];case 8:_.apply(m,[_object_spread.apply(void 0,[(_tmp.output=_state.sent(),_tmp),v!=null?{providerOptions:v}:{}])]);_state.label=9;case 9:return[3,11];case 10:if(vz(g)){x10=(l=t==null?void 0:t.convertDataPart)==null?void 0:l.call(t,g);x10!=null&&m.push(x10)}else{x11=g;throw new Error("Unsupported part: ".concat(x11))}_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:m.length>0&&r.push({role:"assistant",content:m});h=i10.filter(function(g){var x;return dh(g)&&(g.providerExecuted!==!0||((x=g.approval)==null?void 0:x.approved)!=null)});if(!(h.length>0))return[3,26];g10=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=16;case 16:_state.trys.push([16,23,24,25]);_iterator1=h[Symbol.iterator]();_state.label=17;case 17:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,22];x12=_step1.value;if(!(((c=x12.approval)==null?void 0:c.approved)!=null&&g10.push({type:"tool-approval-response",approvalId:x12.approval.id,approved:x12.approval.approved,reason:x12.approval.reason,providerExecuted:x12.providerExecuted}),x12.state==="approval-responded"&&((d=x12.approval)==null?void 0:d.approved)===!1&&g10.push(_object_spread({type:"tool-result",toolCallId:x12.toolCallId,toolName:hT(x12),output:{type:"execution-denied",reason:x12.approval.reason}},x12.callProviderMetadata!=null?{providerOptions:x12.callProviderMetadata}:{})),x12.providerExecuted!==!0))return[3,21];_10=x12.state;switch(_10){case"output-denied":return[3,18];case"output-error":return[3,19];case"output-available":return[3,19]}return[3,21];case 18:{g10.push(_object_spread({type:"tool-result",toolCallId:x12.toolCallId,toolName:hT(x12),output:{type:"error-text",value:(p=(u=x12.approval)==null?void 0:u.reason)!=null?p:"Tool call execution denied."}},x12.callProviderMetadata!=null?{providerOptions:x12.callProviderMetadata}:{}));return[3,21]}_state.label=19;case 19:v10=hT(x12);_11=g10.push;_tmp1={type:"tool-result",toolCallId:x12.toolCallId,toolName:v10};return[4,h0({toolCallId:x12.toolCallId,input:x12.input,output:x12.state==="output-error"?x12.errorText:x12.output,tool:si(t==null?void 0:t.tools,v10),errorMode:x12.state==="output-error"?"text":"none"})];case 20:_11.apply(g10,[_object_spread.apply(void 0,[(_tmp1.output=_state.sent(),_tmp1),x12.callProviderMetadata!=null?{providerOptions:x12.callProviderMetadata}:{}])]);return[3,21];case 21:_iteratorNormalCompletion1=true;return[3,17];case 22:return[3,25];case 23:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,25];case 24:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 25:g10.length>0&&r.push({role:"tool",content:g10});_state.label=26;case 26:i10=[];return[2]}})})()};i10=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=6;case 6:_state.trys.push([6,14,15,16]);_iterator1=n.parts[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,13];a=_step1.value;if(!(Dce(a)||_z(a)||Fce(a)||Lce(a)||bz(a)||dh(a)||vz(a)))return[3,8];_tmp=i10.push(a);return[3,11];case 8:_tmp1=a.type==="step-start";if(!_tmp1)return[3,10];return[4,o10()];case 9:_tmp1=_state.sent();_state.label=10;case 10:_tmp=_tmp1;_state.label=11;case 11:_tmp;_state.label=12;case 12:_iteratorNormalCompletion1=true;return[3,7];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 16:return[4,o10()];case 17:_state.sent();return[3,20];case 18:return[3,20];case 19:{i11=n.role;throw new iXe({originalMessage:n,message:"Unsupported role: ".concat(i11)})}_state.label=20;case 20:_iteratorNormalCompletion=true;return[3,2];case 21:return[3,24];case 22:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,24];case 23:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 24:return[2,r]}})})()}var dl=f.record(f.string(),g0.optional()),Het=f.record(f.string(),f.string()),vor=ne(function(){return te(f.array(f.object({id:f.string(),role:f.enum(["system","user","assistant"]),metadata:f.unknown().optional(),parts:f.array(f.union([f.object({type:f.literal("text"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:It.optional()}),f.object({type:f.literal("reasoning"),text:f.string(),state:f.enum(["streaming","done"]).optional(),providerMetadata:It.optional()}),f.object({type:f.literal("custom"),kind:f.string(),providerMetadata:It.optional()}),f.object({type:f.literal("source-url"),sourceId:f.string(),url:f.string(),title:f.string().optional(),providerMetadata:It.optional()}),f.object({type:f.literal("source-document"),sourceId:f.string(),mediaType:f.string(),title:f.string(),filename:f.string().optional(),providerMetadata:It.optional()}),f.object({type:f.literal("file"),mediaType:f.string(),filename:f.string().optional(),url:f.string(),providerReference:Het.optional(),providerMetadata:It.optional()}),f.object({type:f.literal("reasoning-file"),mediaType:f.string(),url:f.string(),providerMetadata:It.optional()}),f.object({type:f.literal("step-start")}),f.object({type:f.string().startsWith("data-"),id:f.string().optional(),data:f.unknown()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("input-streaming"),input:f.unknown().optional(),providerExecuted:f.boolean().optional(),callProviderMetadata:It.optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("input-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.never().optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-available"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:It.optional(),resultProviderMetadata:It.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-error"),input:f.unknown().optional(),rawInput:f.unknown().optional(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:It.optional(),resultProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()}).optional()}),f.object({type:f.literal("dynamic-tool"),toolName:f.string(),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-denied"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("input-streaming"),providerExecuted:f.boolean().optional(),callProviderMetadata:It.optional(),input:f.unknown().optional(),output:f.never().optional(),errorText:f.never().optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("input-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.never().optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("approval-requested"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.never().optional(),reason:f.never().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("approval-responded"),input:f.unknown(),providerExecuted:f.boolean().optional(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.boolean(),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-available"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.unknown(),errorText:f.never().optional(),callProviderMetadata:It.optional(),resultProviderMetadata:It.optional(),preliminary:f.boolean().optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-error"),providerExecuted:f.boolean().optional(),input:f.unknown().optional(),rawInput:f.unknown().optional(),output:f.never().optional(),errorText:f.string(),callProviderMetadata:It.optional(),resultProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.literal(!0),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()}).optional()}),f.object({type:f.string().startsWith("tool-"),toolCallId:f.string(),toolMetadata:dl.optional(),state:f.literal("output-denied"),providerExecuted:f.boolean().optional(),input:f.unknown(),output:f.never().optional(),errorText:f.never().optional(),callProviderMetadata:It.optional(),approval:f.object({id:f.string(),approved:f.literal(!1),reason:f.string().optional(),isAutomatic:f.boolean().optional(),signature:f.string().optional()})})]))}).superRefine(function(e,t){e.role!=="assistant"&&e.parts.length===0&&t.addIssue({origin:"array",code:"too_small",minimum:1,inclusive:!0,input:e.parts,path:["parts"],message:"Message must contain at least one part"})})).nonempty("Messages array must not be empty"))});var bor=mo({prefix:"call",size:24});var Sor=mo({prefix:"call",size:24});var Cor=mo({prefix:"aiobj",size:24});function Spe(e){return function(param){var t=param.url,r=param.abortSignal;return Ude({url:t,maxBytes:e==null?void 0:e.maxBytes,abortSignal:r})}}var Tor=mo({prefix:"aiobj",size:24});var Aor=Spe();var kpe=function(param){var e=param.model,t=param.middleware,r=param.modelId,n=param.providerId;var i=Nz(e);return _to_consumable_array(ks(t)).reverse().reduce(function(o,a){return Zet({model:o,middleware:a,modelId:r,providerId:n})},i)},Zet=function(param){var e=param.model,_param_middleware=param.middleware,t=_param_middleware.transformParams,r=_param_middleware.wrapGenerate,n=_param_middleware.wrapStream,i=_param_middleware.overrideProvider,o=_param_middleware.overrideModelId,a=_param_middleware.overrideSupportedUrls,s=param.modelId,l=param.providerId;var p=function p(_01){return _async_to_generator(function(param){var m,h,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=param.params,h=param.type;if(!t)return[3,2];return[4,t({params:m,type:h,model:e})];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=m;_state.label=3;case 3:return[2,_tmp]}})}).apply(this,arguments)};var c,d,u;return{specificationVersion:"v4",provider:(c=l!=null?l:i==null?void 0:i({model:e}))!=null?c:e.provider,modelId:(d=s!=null?s:o==null?void 0:o({model:e}))!=null?d:e.modelId,supportedUrls:(u=a==null?void 0:a({model:e}))!=null?u:e.supportedUrls,doGenerate:function doGenerate(m){return _async_to_generator(function(){var h,g,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,p({params:m,type:"generate"})];case 1:h=_state.sent(),g=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.doGenerate(h)];case 1:return[2,_state.sent()]}})})()};if(!r)return[3,3];return[4,r({doGenerate:g,doStream:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.doStream(h)];case 1:return[2,_state.sent()]}})})()},params:h,model:e})];case 2:_tmp=_state.sent();return[3,5];case 3:return[4,g()];case 4:_tmp=_state.sent();_state.label=5;case 5:return[2,_tmp]}})})()},doStream:function doStream(m){return _async_to_generator(function(){var h,g,x,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,p({params:m,type:"stream"})];case 1:h=_state.sent(),g=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.doGenerate(h)];case 1:return[2,_state.sent()]}})})()},x=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.doStream(h)];case 1:return[2,_state.sent()]}})})()};if(!n)return[3,3];return[4,n({doGenerate:g,doStream:x,params:h,model:e})];case 2:_tmp=_state.sent();return[3,5];case 3:return[4,x()];case 4:_tmp=_state.sent();_state.label=5;case 5:return[2,_tmp]}})})()}}};var Ket="AI_NoSuchProviderError",Qet="vercel.ai.error.".concat(Ket),Jet=Symbol.for(Qet),Yet;Yet=Jet;var Ror=mo({prefix:"call",size:24});var Mor=Spe();var he={};$l(he,{$brand:function(){return Ty},$input:function(){return B4},$output:function(){return U4},NEVER:function(){return Kg},TimePrecision:function(){return G4},ZodMiniAny:function(){return Hpe},ZodMiniArray:function(){return Ype},ZodMiniBase64:function(){return zpe},ZodMiniBase64URL:function(){return jpe},ZodMiniBigInt:function(){return x6},ZodMiniBigIntFormat:function(){return Qz},ZodMiniBoolean:function(){return g6},ZodMiniCIDRv4:function(){return Dpe},ZodMiniCIDRv6:function(){return Lpe},ZodMiniCUID:function(){return Ipe},ZodMiniCUID2:function(){return Ppe},ZodMiniCatch:function(){return vfe},ZodMiniCodec:function(){return nj},ZodMiniCustom:function(){return ij},ZodMiniCustomStringFormat:function(){return m6},ZodMiniDate:function(){return ET},ZodMiniDefault:function(){return gfe},ZodMiniDiscriminatedUnion:function(){return rfe},ZodMiniE164:function(){return Upe},ZodMiniEmail:function(){return Cpe},ZodMiniEmoji:function(){return Tpe},ZodMiniEnum:function(){return Xz},ZodMiniExactOptional:function(){return ffe},ZodMiniFile:function(){return dfe},ZodMiniFunction:function(){return Tfe},ZodMiniGUID:function(){return Epe},ZodMiniIPv4:function(){return $pe},ZodMiniIPv6:function(){return Npe},ZodMiniISODate:function(){return PT},ZodMiniISODateTime:function(){return IT},ZodMiniISODuration:function(){return MT},ZodMiniISOTime:function(){return RT},ZodMiniIntersection:function(){return nfe},ZodMiniJWT:function(){return Bpe},ZodMiniKSUID:function(){return Ope},ZodMiniLazy:function(){return Sfe},ZodMiniLiteral:function(){return cfe},ZodMiniMAC:function(){return Fpe},ZodMiniMap:function(){return sfe},ZodMiniNaN:function(){return _fe},ZodMiniNanoID:function(){return Ape},ZodMiniNever:function(){return Kpe},ZodMiniNonOptional:function(){return tj},ZodMiniNull:function(){return Vpe},ZodMiniNullable:function(){return mfe},ZodMiniNumber:function(){return h6},ZodMiniNumberFormat:function(){return H2},ZodMiniObject:function(){return TT},ZodMiniOptional:function(){return ej},ZodMiniPipe:function(){return rj},ZodMiniPrefault:function(){return xfe},ZodMiniPromise:function(){return Cfe},ZodMiniReadonly:function(){return bfe},ZodMiniRecord:function(){return AT},ZodMiniSet:function(){return lfe},ZodMiniString:function(){return G2},ZodMiniStringFormat:function(){return li},ZodMiniSuccess:function(){return yfe},ZodMiniSymbol:function(){return qpe},ZodMiniTemplateLiteral:function(){return wfe},ZodMiniTransform:function(){return pfe},ZodMiniTuple:function(){return ife},ZodMiniType:function(){return Nr},ZodMiniULID:function(){return Rpe},ZodMiniURL:function(){return Zz},ZodMiniUUID:function(){return f6},ZodMiniUndefined:function(){return Wpe},ZodMiniUnion:function(){return Yz},ZodMiniUnknown:function(){return Zpe},ZodMiniVoid:function(){return Jpe},ZodMiniXID:function(){return Mpe},ZodMiniXor:function(){return tfe},_default:function(){return urt},_function:function(){return Art},any:function(){return Ltt},array:function(){return Jz},base64:function(){return _tt},base64url:function(){return btt},bigint:function(){return Mtt},boolean:function(){return CT},catch:function(){return frt},catchall:function(){return Ktt},check:function(){return _rt},cidrv4:function(){return xtt},cidrv6:function(){return ytt},clone:function(){return Po},codec:function(){return grt},coerce:function(){return $T},config:function(){return Ri},core:function(){return ts},cuid:function(){return ctt},cuid2:function(){return dtt},custom:function(){return Efe},date:function(){return ztt},decode:function(){return YN},decodeAsync:function(){return eD},describe:function(){return Srt},discriminatedUnion:function(){return Jtt},e164:function(){return wtt},email:function(){return ett},emoji:function(){return ltt},encode:function(){return JN},encodeAsync:function(){return XN},endsWith:function(){return Hm},enum:function(){return ufe},exactOptional:function(){return srt},extend:function(){return Btt},file:function(){return ort},flattenError:function(){return Jg},float32:function(){return Att},float64:function(){return Itt},formatError:function(){return Yg},function:function(){return Art},globalRegistry:function(){return Xo},gt:function(){return Fu},gte:function(){return Mo},guid:function(){return ttt},hash:function(){return Ttt},hex:function(){return Ett},hostname:function(){return Ctt},httpUrl:function(){return stt},includes:function(){return Vm},instanceof:function(){return Crt},int:function(){return Kz},int32:function(){return Ptt},int64:function(){return Ott},intersection:function(){return Ytt},ipv4:function(){return htt},ipv6:function(){return gtt},iso:function(){return OT},json:function(){return Trt},jwt:function(){return Stt},keyof:function(){return jtt},ksuid:function(){return mtt},lazy:function(){return kfe},length:function(){return af},literal:function(){return irt},locales:function(){return jd},looseObject:function(){return Utt},looseRecord:function(){return ert},lowercase:function(){return qm},lt:function(){return Lu},lte:function(){return ya},mac:function(){return vtt},map:function(){return trt},maxLength:function(){return of},maxSize:function(){return Bd},maximum:function(){return ya},merge:function(){return Wtt},meta:function(){return krt},mime:function(){return Zm},minLength:function(){return kc},minSize:function(){return zu},minimum:function(){return Mo},multipleOf:function(){return Ud},nan:function(){return mrt},nanoid:function(){return utt},nativeEnum:function(){return nrt},negative:function(){return c2},never:function(){return Qpe},nonnegative:function(){return p2},nonoptional:function(){return drt},nonpositive:function(){return d2},normalize:function(){return Km},null:function(){return Gpe},nullable:function(){return hfe},nullish:function(){return lrt},number:function(){return kT},object:function(){return Xpe},omit:function(){return Gtt},optional:function(){return gf},overwrite:function(){return Zl},parse:function(){return zm},parseAsync:function(){return jm},partial:function(){return Htt},partialRecord:function(){return Xtt},pick:function(){return Vtt},pipe:function(){return hrt},positive:function(){return u2},prefault:function(){return crt},prettifyError:function(){return Iw},promise:function(){return vrt},property:function(){return f2},readonly:function(){return xrt},record:function(){return afe},refine:function(){return brt},regex:function(){return qd},regexes:function(){return Ro},registry:function(){return By},required:function(){return Ztt},safeDecode:function(){return rD},safeDecodeAsync:function(){return iD},safeEncode:function(){return tD},safeEncodeAsync:function(){return nD},safeExtend:function(){return qtt},safeParse:function(){return tf},safeParseAsync:function(){return Um},set:function(){return rrt},size:function(){return nf},startsWith:function(){return Gm},strictObject:function(){return y6},string:function(){return V2},stringFormat:function(){return ktt},stringbool:function(){return Ert},success:function(){return prt},superRefine:function(){return wrt},symbol:function(){return Ntt},templateLiteral:function(){return yrt},toJSONSchema:function(){return sf},toLowerCase:function(){return Jm},toUpperCase:function(){return Ym},transform:function(){return art},treeifyError:function(){return Aw},trim:function(){return Qm},tuple:function(){return ofe},uint32:function(){return Rtt},uint64:function(){return $tt},ulid:function(){return ptt},undefined:function(){return Dtt},union:function(){return efe},unknown:function(){return ST},uppercase:function(){return Wm},url:function(){return att},util:function(){return He},uuid:function(){return rtt},uuidv4:function(){return ntt},uuidv6:function(){return itt},uuidv7:function(){return ott},void:function(){return Ftt},xid:function(){return ftt},xor:function(){return Qtt}});var Nr=X("ZodMiniType",function(e,t){if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");sr.init(e,t),e.def=t,e.type=t.type,e.parse=function(r,n){return zm(e,r,n,{callee:e.parse})},e.safeParse=function(r,n){return tf(e,r,n)},e.parseAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,jm(e,r,n,{callee:e.parseAsync})]})})()},e.safeParseAsync=function(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Um(e,r,n)]})})()},e.check=function(){for(var _len=arguments.length,r=new Array(_len),_key=0;_key<_len;_key++){r[_key]=arguments[_key]}var n;return e.clone(_object_spread_props(_object_spread({},t),{checks:_to_consumable_array((n=t.checks)!=null?n:[]).concat(_to_consumable_array(r.map(function(i){return typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i})))}),{parent:!0})},e.with=e.check,e.clone=function(r,n){return Po(e,r,n)},e.brand=function(){return e},e.register=function(r,n){return r.add(e,n),e},e.apply=function(r){return r(e)}}),G2=X("ZodMiniString",function(e,t){rf.init(e,t),Nr.init(e,t)});function V2(e){return q4(G2,e)}var li=X("ZodMiniStringFormat",function(e,t){Fn.init(e,t),G2.init(e,t)}),Cpe=X("ZodMiniEmail",function(e,t){Nw.init(e,t),li.init(e,t)});function ett(e){return qy(Cpe,e)}var Epe=X("ZodMiniGUID",function(e,t){Ow.init(e,t),li.init(e,t)});function ttt(e){return n0(Epe,e)}var f6=X("ZodMiniUUID",function(e,t){$w.init(e,t),li.init(e,t)});function rtt(e){return Wy(f6,e)}function ntt(e){return Vy(f6,e)}function itt(e){return Gy(f6,e)}function ott(e){return Hy(f6,e)}var Zz=X("ZodMiniURL",function(e,t){Dw.init(e,t),li.init(e,t)});function att(e){return Bm(Zz,e)}function stt(e){return Bm(Zz,_object_spread({protocol:/^https?$/,hostname:Ro.domain},Ne(e)))}var Tpe=X("ZodMiniEmoji",function(e,t){Lw.init(e,t),li.init(e,t)});function ltt(e){return Zy(Tpe,e)}var Ape=X("ZodMiniNanoID",function(e,t){Fw.init(e,t),li.init(e,t)});function utt(e){return Ky(Ape,e)}var Ipe=X("ZodMiniCUID",function(e,t){zw.init(e,t),li.init(e,t)});function ctt(e){return Qy(Ipe,e)}var Ppe=X("ZodMiniCUID2",function(e,t){jw.init(e,t),li.init(e,t)});function dtt(e){return Jy(Ppe,e)}var Rpe=X("ZodMiniULID",function(e,t){Uw.init(e,t),li.init(e,t)});function ptt(e){return Yy(Rpe,e)}var Mpe=X("ZodMiniXID",function(e,t){Bw.init(e,t),li.init(e,t)});function ftt(e){return Xy(Mpe,e)}var Ope=X("ZodMiniKSUID",function(e,t){qw.init(e,t),li.init(e,t)});function mtt(e){return e2(Ope,e)}var $pe=X("ZodMiniIPv4",function(e,t){Zw.init(e,t),li.init(e,t)});function htt(e){return t2($pe,e)}var Npe=X("ZodMiniIPv6",function(e,t){Kw.init(e,t),li.init(e,t)});function gtt(e){return r2(Npe,e)}var Dpe=X("ZodMiniCIDRv4",function(e,t){Jw.init(e,t),li.init(e,t)});function xtt(e){return n2(Dpe,e)}var Lpe=X("ZodMiniCIDRv6",function(e,t){Yw.init(e,t),li.init(e,t)});function ytt(e){return i2(Lpe,e)}var Fpe=X("ZodMiniMAC",function(e,t){Qw.init(e,t),li.init(e,t)});function vtt(e){return V4(Fpe,e)}var zpe=X("ZodMiniBase64",function(e,t){Xw.init(e,t),li.init(e,t)});function _tt(e){return o2(zpe,e)}var jpe=X("ZodMiniBase64URL",function(e,t){e4.init(e,t),li.init(e,t)});function btt(e){return a2(jpe,e)}var Upe=X("ZodMiniE164",function(e,t){t4.init(e,t),li.init(e,t)});function wtt(e){return s2(Upe,e)}var Bpe=X("ZodMiniJWT",function(e,t){r4.init(e,t),li.init(e,t)});function Stt(e){return l2(Bpe,e)}var m6=X("ZodMiniCustomStringFormat",function(e,t){n4.init(e,t),li.init(e,t)});function ktt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Cc(m6,e,t,r)}function Ctt(e){return Cc(m6,"hostname",Ro.hostname,e)}function Ett(e){return Cc(m6,"hex",Ro.hex,e)}function Ttt(e,t){var o;var r=(o=t==null?void 0:t.enc)!=null?o:"hex",n="".concat(e,"_").concat(r),i=Ro[n];if(!i)throw new Error("Unrecognized hash format: ".concat(n));return Cc(m6,n,i,t)}var h6=X("ZodMiniNumber",function(e,t){Ly.init(e,t),Nr.init(e,t)});function kT(e){return J4(h6,e)}var H2=X("ZodMiniNumberFormat",function(e,t){i4.init(e,t),h6.init(e,t)});function Kz(e){return X4(H2,e)}function Att(e){return e3(H2,e)}function Itt(e){return t3(H2,e)}function Ptt(e){return r3(H2,e)}function Rtt(e){return n3(H2,e)}var g6=X("ZodMiniBoolean",function(e,t){e0.init(e,t),Nr.init(e,t)});function CT(e){return i3(g6,e)}var x6=X("ZodMiniBigInt",function(e,t){Fy.init(e,t),Nr.init(e,t)});function Mtt(e){return a3(x6,e)}var Qz=X("ZodMiniBigIntFormat",function(e,t){o4.init(e,t),x6.init(e,t)});function Ott(e){return l3(Qz,e)}function $tt(e){return u3(Qz,e)}var qpe=X("ZodMiniSymbol",function(e,t){a4.init(e,t),Nr.init(e,t)});function Ntt(e){return c3(qpe,e)}var Wpe=X("ZodMiniUndefined",function(e,t){s4.init(e,t),Nr.init(e,t)});function Dtt(e){return d3(Wpe,e)}var Vpe=X("ZodMiniNull",function(e,t){l4.init(e,t),Nr.init(e,t)});function Gpe(e){return p3(Vpe,e)}var Hpe=X("ZodMiniAny",function(e,t){u4.init(e,t),Nr.init(e,t)});function Ltt(){return f3(Hpe)}var Zpe=X("ZodMiniUnknown",function(e,t){c4.init(e,t),Nr.init(e,t)});function ST(){return m3(Zpe)}var Kpe=X("ZodMiniNever",function(e,t){d4.init(e,t),Nr.init(e,t)});function Qpe(e){return h3(Kpe,e)}var Jpe=X("ZodMiniVoid",function(e,t){p4.init(e,t),Nr.init(e,t)});function Ftt(e){return g3(Jpe,e)}var ET=X("ZodMiniDate",function(e,t){f4.init(e,t),Nr.init(e,t)});function ztt(e){return x3(ET,e)}var Ype=X("ZodMiniArray",function(e,t){m4.init(e,t),Nr.init(e,t)});function Jz(e,t){return new Ype(_object_spread({type:"array",element:e},Ne(t)))}function jtt(e){var t=e._zod.def.shape;return ufe(Object.keys(t))}var TT=X("ZodMiniObject",function(e,t){pE.init(e,t),Nr.init(e,t),Mr(e,"shape",function(){return t.shape})});function Xpe(e,t){var r=_object_spread({type:"object",shape:e!=null?e:{}},Ne(t));return new TT(r)}function y6(e,t){return new TT(_object_spread({type:"object",shape:e,catchall:Qpe()},Ne(t)))}function Utt(e,t){return new TT(_object_spread({type:"object",shape:e,catchall:ST()},Ne(t)))}function Btt(e,t){return ZC(e,t)}function qtt(e,t){return ZN(e,t)}function Wtt(e,t){return ZC(e,t)}function Vtt(e,t){return GN(e,t)}function Gtt(e,t){return HN(e,t)}function Htt(e,t){return KN(ej,e,t)}function Ztt(e,t){return QN(tj,e,t)}function Ktt(e,t){return e.clone(_object_spread_props(_object_spread({},e._zod.def),{catchall:t}))}var Yz=X("ZodMiniUnion",function(e,t){t0.init(e,t),Nr.init(e,t)});function efe(e,t){return new Yz(_object_spread({type:"union",options:e},Ne(t)))}var tfe=X("ZodMiniXor",function(e,t){Yz.init(e,t),h4.init(e,t)});function Qtt(e,t){return new tfe(_object_spread({type:"union",options:e,inclusive:!1},Ne(t)))}var rfe=X("ZodMiniDiscriminatedUnion",function(e,t){g4.init(e,t),Nr.init(e,t)});function Jtt(e,t,r){return new rfe(_object_spread({type:"union",options:t,discriminator:e},Ne(r)))}var nfe=X("ZodMiniIntersection",function(e,t){x4.init(e,t),Nr.init(e,t)});function Ytt(e,t){return new nfe({type:"intersection",left:e,right:t})}var ife=X("ZodMiniTuple",function(e,t){zy.init(e,t),Nr.init(e,t)});function ofe(e,t,r){var n=_instanceof(t,sr),i=n?r:t,o=n?t:null;return new ife(_object_spread({type:"tuple",items:e,rest:o},Ne(i)))}var AT=X("ZodMiniRecord",function(e,t){y4.init(e,t),Nr.init(e,t)});function afe(e,t,r){return new AT(_object_spread({type:"record",keyType:e,valueType:t},Ne(r)))}function Xtt(e,t,r){var n=Po(e);return n._zod.values=void 0,new AT(_object_spread({type:"record",keyType:n,valueType:t},Ne(r)))}function ert(e,t,r){return new AT(_object_spread({type:"record",keyType:e,valueType:t,mode:"loose"},Ne(r)))}var sfe=X("ZodMiniMap",function(e,t){v4.init(e,t),Nr.init(e,t)});function trt(e,t,r){return new sfe(_object_spread({type:"map",keyType:e,valueType:t},Ne(r)))}var lfe=X("ZodMiniSet",function(e,t){_4.init(e,t),Nr.init(e,t)});function rrt(e,t){return new lfe(_object_spread({type:"set",valueType:e},Ne(t)))}var Xz=X("ZodMiniEnum",function(e,t){b4.init(e,t),Nr.init(e,t),e.options=Object.values(t.entries)});function ufe(e,t){var r=Array.isArray(e)?Object.fromEntries(e.map(function(n){return[n,n]})):e;return new Xz(_object_spread({type:"enum",entries:r},Ne(t)))}function nrt(e,t){return new Xz(_object_spread({type:"enum",entries:e},Ne(t)))}var cfe=X("ZodMiniLiteral",function(e,t){w4.init(e,t),Nr.init(e,t)});function irt(e,t){return new cfe(_object_spread({type:"literal",values:Array.isArray(e)?e:[e]},Ne(t)))}var dfe=X("ZodMiniFile",function(e,t){S4.init(e,t),Nr.init(e,t)});function ort(e){return _3(dfe,e)}var pfe=X("ZodMiniTransform",function(e,t){k4.init(e,t),Nr.init(e,t)});function art(e){return new pfe({type:"transform",transform:e})}var ej=X("ZodMiniOptional",function(e,t){jy.init(e,t),Nr.init(e,t)});function gf(e){return new ej({type:"optional",innerType:e})}var ffe=X("ZodMiniExactOptional",function(e,t){C4.init(e,t),Nr.init(e,t)});function srt(e){return new ffe({type:"optional",innerType:e})}var mfe=X("ZodMiniNullable",function(e,t){E4.init(e,t),Nr.init(e,t)});function hfe(e){return new mfe({type:"nullable",innerType:e})}function lrt(e){return gf(hfe(e))}var gfe=X("ZodMiniDefault",function(e,t){T4.init(e,t),Nr.init(e,t)});function urt(e,t){return new gfe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Py(t)}})}var xfe=X("ZodMiniPrefault",function(e,t){A4.init(e,t),Nr.init(e,t)});function crt(e,t){return new xfe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Py(t)}})}var tj=X("ZodMiniNonOptional",function(e,t){I4.init(e,t),Nr.init(e,t)});function drt(e,t){return new tj(_object_spread({type:"nonoptional",innerType:e},Ne(t)))}var yfe=X("ZodMiniSuccess",function(e,t){P4.init(e,t),Nr.init(e,t)});function prt(e){return new yfe({type:"success",innerType:e})}var vfe=X("ZodMiniCatch",function(e,t){R4.init(e,t),Nr.init(e,t)});function frt(e,t){return new vfe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:function(){return t}})}var _fe=X("ZodMiniNaN",function(e,t){M4.init(e,t),Nr.init(e,t)});function mrt(e){return v3(_fe,e)}var rj=X("ZodMiniPipe",function(e,t){O4.init(e,t),Nr.init(e,t)});function hrt(e,t){return new rj({type:"pipe",in:e,out:t})}var nj=X("ZodMiniCodec",function(e,t){rj.init(e,t),r0.init(e,t)});function grt(e,t,r){return new nj({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var bfe=X("ZodMiniReadonly",function(e,t){$4.init(e,t),Nr.init(e,t)});function xrt(e){return new bfe({type:"readonly",innerType:e})}var wfe=X("ZodMiniTemplateLiteral",function(e,t){N4.init(e,t),Nr.init(e,t)});function yrt(e,t){return new wfe(_object_spread({type:"template_literal",parts:e},Ne(t)))}var Sfe=X("ZodMiniLazy",function(e,t){F4.init(e,t),Nr.init(e,t)});function kfe(e){return new Sfe({type:"lazy",getter:e})}var Cfe=X("ZodMiniPromise",function(e,t){L4.init(e,t),Nr.init(e,t)});function vrt(e){return new Cfe({type:"promise",innerType:e})}var ij=X("ZodMiniCustom",function(e,t){z4.init(e,t),Nr.init(e,t)});function _rt(e,t){var r=new qn(_object_spread({check:"custom"},Ne(t)));return r._zod.check=e,r}function Efe(e,t){return b3(ij,e!=null?e:function(){return!0},t)}function brt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w3(ij,e,t)}function wrt(e){return S3(e)}var Srt=k3,krt=C3;function Crt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=Efe(function(n){return _instanceof(n,e)},t);return r._zod.bag.Class=e,r._zod.check=function(n){var i;_instanceof(n.value,e)||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:_to_consumable_array((i=r._zod.def.path)!=null?i:[])})},r}var Ert=function(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return E3.apply(void 0,[{Codec:nj,Boolean:g6,String:G2}].concat(_to_consumable_array(e)))};function Trt(){var e=kfe(function(){return efe([V2(),kT(),CT(),Gpe(),Jz(e),afe(V2(),e)])});return e}var Tfe=X("ZodMiniFunction",function(e,t){D4.init(e,t),Nr.init(e,t)});function Art(e){var t,r;return new Tfe({type:"function",input:Array.isArray(e==null?void 0:e.input)?ofe(e==null?void 0:e.input):(t=e==null?void 0:e.input)!=null?t:Jz(ST()),output:(r=e==null?void 0:e.output)!=null?r:ST()})}var OT={};$l(OT,{ZodMiniISODate:function(){return PT},ZodMiniISODateTime:function(){return IT},ZodMiniISODuration:function(){return MT},ZodMiniISOTime:function(){return RT},date:function(){return Prt},datetime:function(){return Irt},duration:function(){return Mrt},time:function(){return Rrt}});var IT=X("ZodMiniISODateTime",function(e,t){Ww.init(e,t),li.init(e,t)});function Irt(e){return H4(IT,e)}var PT=X("ZodMiniISODate",function(e,t){Vw.init(e,t),li.init(e,t)});function Prt(e){return Z4(PT,e)}var RT=X("ZodMiniISOTime",function(e,t){Gw.init(e,t),li.init(e,t)});function Rrt(e){return K4(RT,e)}var MT=X("ZodMiniISODuration",function(e,t){Hw.init(e,t),li.init(e,t)});function Mrt(e){return Q4(MT,e)}var $T={};$l($T,{bigint:function(){return Drt},boolean:function(){return Nrt},date:function(){return Lrt},number:function(){return $rt},string:function(){return Ort}});function Ort(e){return W4(G2,e)}function $rt(e){return Y4(h6,e)}function Nrt(e){return o3(g6,e)}function Drt(e){return s3(x6,e)}function Lrt(e){return y3(ET,e)}var NT=nr(ln(),1),ra="/",is="/.agents",y0=".agents",aj="".concat(is,"/nutstore-sync"),zrt="".concat(y0,"/nutstore-sync"),sj="".concat(zrt,"/tmp"),ba="/".concat(sj),Yl="".concat(aj,"/builtin-skills");var Cs="/.config/nutstore-sync",fh="".concat(Cs,"/settings.json"),x0="/vault",oj="/tmp";function Ife(e){var t=NT.posix.normalize(e);if(t===x0||t.startsWith("".concat(x0,"/")))return t.slice(x0.length)||"/";if(t===oj||t.startsWith("".concat(oj,"/"))){var r=t.slice(oj.length);return"".concat(ba).concat(r)}return t}function Pfe(e){var t=NT.posix.normalize(e);if(NT.posix.isAbsolute(t)||t==="."||t===".."||t.startsWith("../")||t.endsWith("/..")||t.includes("\0"))throw new Error("Invalid Obsidian config directory: '".concat(e,"'"));return"/".concat(t.replace(/^\/+|\/+$/g,""))}var mh=".agents/nutstore-sync/mcp.json",lj="".concat(aj,"/mcp.json"),Rfe="mcp__",jrt=/^[a-z0-9][a-z0-9_-]*$/i,Urt=he.object({type:he.literal("http"),url:he.string(),headers:he.optional(he.record(he.string(),he.string())),enabled:he.optional(he.boolean())}),Brt=he.discriminatedUnion("type",[Urt]),qrt=he.object({mcpServers:he.optional(he.record(he.string(),Brt))});function uj(e){return jrt.test(e)}function Mfe(e,t){return"".concat(Rfe).concat(e,"__").concat(t)}function Ofe(e){return e.startsWith(Rfe)}function Wrt(e){return e.issues.map(function(t){return"".concat(t.path.length>0?t.path.join("."):"(root)",": ").concat(t.message)}).join("; ")}function $fe(e){var i;var t;try{t=JSON.parse(e)}catch(o){throw new Error("Invalid JSON: ".concat(_instanceof(o,Error)?o.message:String(o)),{cause:o})}var r=qrt.safeParse(t);if(!r.success)throw new Error("Invalid MCP servers: ".concat(Wrt(r.error)));var n=(i=r.data.mcpServers)!=null?i:{};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.keys(n)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _$o=_step.value;if(!uj(_$o))throw new Error("Invalid MCP server name '".concat(_$o,"': use letters, numbers, hyphens and underscores only."))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}function Nfe(e){return"".concat(JSON.stringify({mcpServers:e},null,2),"\n")}function v6(e){return e.enabled!==!1}var Dfe="---\nname: long-term-memory\ndescription: 读取和维护 Agent 与用户跨聊天会话形成的长期记忆,使当前交互能够延续过去的重要经历、知识和上下文,而不是每次从零开始。用于记住、回忆、纠正或忘记过去的信息,以及当前交互与既往经历、讨论、决定、目标、偏好、约定、未完成事项或其他历史上下文明显相关的情况。\n---\n\n# 长期记忆\n\n长期记忆用于长期保存未来可能值得回忆的过去,使 Agent 跨聊天会话持续继承过去的经历、背景、决定与未完成事项,而不是每次从零开始。\n\n判断一件事是否值得记住:\n\n> 如果未来某个交互不知道这件事,是否会丢失有意义的上下文——导致重复提问、重复决定、误解用户,或无法延续之前的进展?\n\n不要因为一件事曾经出现过就记住它,也不要求它必须永久稳定才值得记住。值得记住的内容既可以是持续有效的知识,也可以是一次重要经历、某项决定、事情的发展过程,或尚未结束的上下文。\n\n## 存储布局\n\n长期记忆存放在两个地方:\n\n```\n.agents/nutstore-sync/memory/\n├── archive/ # 权威记忆:每日一个 Markdown 文件\n│ └── <YYYY>/<YYYY-MM-DD>.md\n└── catalog/ # 检索目录:每年一个 TSV,可重建\n └── <YYYY>.tsv\n```\n\n在 bash 文件系统中务必使用以下完整路径,不要构造其他变体:\n\n- `/.agents/nutstore-sync/memory/archive/<YYYY>/<YYYY-MM-DD>.md`\n- `/.agents/nutstore-sync/memory/catalog/<YYYY>.tsv`\n\n向用户提及记忆文件时,使用知识库相对路径 `.agents/nutstore-sync/memory/...`,不要带开头的 `/`。\n\n## 权威性\n\n- **每日记忆文件是唯一权威数据源**。文件名 `<YYYY-MM-DD>.md` 就是日期,也是稳定 ID;文件完整路径完全由日期唯一推导,一旦写入就永不重命名、永不移动、永不因任何分类而重组。\n- **`catalog/` 是派生检索目录**。它只把每日文件 frontmatter 中的 `date` 与 `index` 原样集中复制。目录可删除、可重建,但绝不反向写回每日记忆文件。\n- 记忆文件都是普通 Markdown,用户可以随时阅读、修改或删除。\n\n## 文件格式\n\n每日一个 Markdown 文件:\n\n```markdown\n---\ndate: <YYYY-MM-DD>\nindex: '检索摘要:覆盖当天记录的所有主题与关键内容'\n---\n\n## <YYYY-MM-DD>\n\n- <一条记忆条目>\n- <另一条记忆条目>\n```\n\n### index 的硬性约束\n\n- 只能占一行,必须用单引号或双引号包裹;\n- 禁止包含制表符或换行(否则会破坏 `catalog/<YYYY>.tsv` 的列结构);\n- 只写正文中真实存在的信息,不虚构;\n- 不得为了简短而漏掉当天任何一个独立主题;\n- 不复制整篇正文;\n- 避免「进行了讨论」「确定了方案」「记录了问题」这类没有区分度的套话。\n\n### index 应该写什么\n\n`index` 是给未来未知查询做全文匹配的检索摘要,不是标签列表。合格摘要应当包含:\n\n- 人名、项目名、对象名、专有名词;\n- 关键决定及其对象,关键数字、日期、状态;\n- 遗留的问题、待办事项;\n- 用户使用过的、以后的查询可能重新出现的具体说法。\n\n未来查询未必使用总结出来的规范术语,大多使用具体名称或关键短语,因此摘要要保留这些可检索文本。\n\n## 写入与冻结规则\n\n- **当天文件**:正文只允许追加;`index` 可随新条目反复重新生成(覆盖旧的 `index`),但绝不删除或改写已有正文。\n- **历史文件**:本地日期跨日后,正文与 `index` 一同冻结;之后普通维护不得修改历史文件。\n- 历史文件就是最终储存地,不需要再次搬移归档。真正随时间变化的是检索入口(catalog),不是文件位置。\n- 「纠正」和「忘记」是用户的专门请求,不受冻结规则限制(见「修正与遗忘」)。\n\n## 年度检索目录(catalog)\n\n`catalog/<YYYY>.tsv` 每年一个纯文本文件,一行对应一个记忆日:\n\n```text\n<YYYY-MM-DD><TAB><index>\n```\n\n- 一行中的 `index` 必须与该日文件 frontmatter 的 `index` 完全一致,**不做二次总结**。\n- 生成时机:某个自然日结束、该日文件被冻结后,把该日的 `date + index` 追加进对应年份的 TSV。\n- 若跨日时没有运行,下次使用记忆功能时补做;先读取已存在的日期行,只补缺失的行,避免重复。\n\n## 检索流程\n\n检索始终由近及远、按顺序展开:\n\n1. **当前会话上下文**:先使用会话已经带上的内容。\n2. **最近 30 天(插件注入)**:插件把最近窗口内每天的文件位置与 `index` 直接带进上下文;若检索目标落在窗口内,直接读取当天文件。\n3. **全部历史目录**:从用户描述中提取 1–3 个区分度最高的名称、对象或关键短语(专有名称、具体对象、关键动作、数字/日期),扫描年度目录:\n\n```bash\ngrep -HniE '检索词a|检索词b|检索词c' /.agents/nutstore-sync/memory/catalog/*.tsv\n```\n\n候选行过多时,再做交集过滤:\n\n```bash\ngrep -HniE '检索词a|检索词b' /.agents/nutstore-sync/memory/catalog/*.tsv | grep -iE '检索词c|检索词d'\n```\n\n4. **读取原文**:由命中行日期推导路径,读取当日完整记忆:\n\n```bash\ngrep -n '' /.agents/nutstore-sync/memory/archive/<YYYY>/<YYYY-MM-DD>.md\n```\n\n需要更多背景时才读整个文件,不要无谓地把全部档案读入上下文。\n\n## 未命中时的降级\n\n`catalog` 不保证能命中所有自然语言提问(用户措辞可能不同)。未命中时按序降级:\n\n1. 扫描全部归档文件的原始 frontmatter `index` 行:\n\n```bash\ngrep -RnE '^index:.*(检索词a|检索词b)' /.agents/nutstore-sync/memory/archive\n```\n\n2. 仍未命中,才扫描正文——全库扫描是最后的恢复路径,低频、昂贵,不是日常检索手段:\n\n```bash\ngrep -RniE '检索词a|检索词b|检索词c' /.agents/nutstore-sync/memory/archive\n```\n\n一旦上层找到正确文件,立即把对应日期行补齐/重建到 `catalog/<YYYY>.tsv`,让下次命中走正常索引路径。\n\n## 重建 catalog\n\n以下情况必须重建受影响年份的 TSV:\n\n- 目录文件丢失或缺失日期行;\n- 用户改动、删除或移动了历史记忆文件;\n- 目录行的内容与文件 `index` 不一致;\n- 检索结果指向不存在的文件;\n- 执行过「修正与遗忘」之后。\n\n重建只从日文件复制而来,不需要理解正文:\n\n1. `find /.agents/nutstore-sync/memory/archive/<YYYY> -name '*.md'`,列出该年份全部文件;\n2. 逐个读取 frontmatter,取 `date:` 与 `index:` 两行;\n3. 拼成 `<date><TAB><index>`,重写 `catalog/<YYYY>.tsv`。\n\n## 修正与遗忘\n\n- **纠正**:尽量在历史文件外修正——在今天文件中追加一条更正记忆,用今天 `index` 记下被纠正的主题与新的正确信息;召回时更新近的更正优先。\n- **忘记**:用户明确要求删除或遗忘目标记忆时,才允许删除或编辑对应历史内容;之后必须重建受影响年份的目录。\n\n## 约束\n\n- 只用 bash 工具集(find、grep、read/append、mv、mkdir)操作普通文本;不引入数据库、embedding、向量检索、搜索服务、知识图谱——这些都不是这个环境里的需求。\n- 永远用日期文本或标题定位,不用行号(行号会漂移)。\n- 记忆文件一旦写入就永不移动、永不重写;需要更正时按「修正与遗忘」处理。\n- catalog 永远可重建,archive 永远不可覆盖。\n\n综上:索引必须来自真实文件,检索链只能由近向远,降级路径不能成为常规路径。\n";var wa="master",Grt="explorer",Hrt="memory",Zrt=["You are the AI agent (ChatBox) built into the Nutstore Sync Obsidian plugin, which synchronizes an Obsidian vault with Nutstore over WebDAV.","You may receive workspace context in <AdditionalContext> XML blocks prepended to user messages.","Each block contains only the workspace fields that changed since the previous message (a delta).","For changed fields, the value is the complete current state — for example, if openFiles shrinks, files no longer in the list have been closed. Silently update your understanding of the workspace; do not mention or quote the XML structure itself.","When workspace context includes skills, each entry contains a skill name, description, and path. If the current task matches one, use bash to read the complete SKILL.md at that path before following its instructions. An explicit user request for a named available skill must also load it first.","Treat every Skill path as an opaque absolute path: copy it exactly from workspace context and never construct, normalize, or substitute a different path from the Skill name.","Paths under /.agents/skills are user-defined Vault Skills; paths under /.agents/nutstore-sync/builtin-skills are bundled built-in Skills. These namespaces are distinct and are not interchangeable.","Hidden dot-folders are internal; do not expose their paths or contents unless the user explicitly asks about them. Never guess or fabricate credentials.","Long-term memory is handled exclusively by the memory subagent when that task type is available. When the request needs cross-session history, or needs to preserve, correct, or forget memory, dispatch a bounded memory task with the relevant facts, retrieval target, and expected result. If it is unavailable, say long-term memory is disabled rather than accessing its files. Do not read, search, or modify .agents/nutstore-sync/memory yourself."].join("\n"),Krt=["You are a read-only explorer subagent investigating an Obsidian vault.","You operate in an isolated context and cannot see the caller conversation; your only input is the task prompt.","Gather evidence with available read-only vault tools. You cannot edit, create, or delete files.","Base every conclusion on tool output and cite the file paths or commands that support it.","When citing vault files, use their vault-relative path (for example notes/idea.md), matching the path the user sees inside the vault.","Hidden dot-folders are internal; do not expose their paths or contents unless the task explicitly asks to inspect them.","If evidence is insufficient or conflicting, say so explicitly rather than guessing.","Return a concise, grounded final answer. Do not ask questions — make reasonable assumptions and note any limitations."].join("\n"),Qrt=["You are the long-term memory subagent for an Obsidian vault.","You operate in an isolated context and receive only a task prompt from the main conversational agent. Carry out only the retrieval or maintenance scope explicitly delegated in that prompt; do not infer additional user intent or perform unrelated vault work.","Use the memory protocol below as the authority for storage, retrieval, correction, and forgetting. Keep your final answer concise: state the result, relevant memory facts or changes, and any source paths needed by the caller. Do not expose hidden internal paths to the user unless the delegated task explicitly requires it.","<memory-protocol>",Dfe.trim(),"</memory-protocol>"].join("\n");function Jrt(param,t){var e=param.fullAccess;return{id:wa,description:"Main conversational assistant with full vault access.",systemPrompt:Zrt,tools:["bash","apply_patch","view_image","todowrite","update_session_title"].concat(_to_consumable_array(t?["task"]:[])),permissionMode:e?"full":"ask",dispatchable:!1}}function Yrt(e,t){return{id:Grt,description:"Read-only subagent for exploring the vault and answering questions about its contents without modifying files.",systemPrompt:Krt,tools:["bash","view_image"].concat(_to_consumable_array(t?["task"]:[])),permissionMode:"readonly",dispatchable:e}}function Xrt(param){var e=param.fullAccess,t=param.subagents;var r;return{id:Hrt,description:"Specialized agent for delegated cross-session memory retrieval and maintenance.",systemPrompt:Qrt,tools:["bash"],permissionMode:e?"full":"ask",dispatchable:((r=t==null?void 0:t.memory)==null?void 0:r.enabled)===!0}}function DT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{fullAccess:!1};var i,o,a,s;var t=((o=(i=e.subagents)==null?void 0:i.explorer)==null?void 0:o.enabled)===!0,r=((s=(a=e.subagents)==null?void 0:a.memory)==null?void 0:s.enabled)===!0,n=t||r;return[Jrt(e,n),Yrt(t,n),Xrt(e)]}function Lfe(e,t){return DT(t).find(function(r){return r.id===e})}function LT(e){return DT(e).filter(function(t){return t.dispatchable})}function Ffe(e,t){var r=new Set(t.tools);return Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,1),n=_param[0];return r.has(n)||Ofe(n)}))}function cj(){return["<virtual-filesystem>","".concat(ra," is the Obsidian vault base filesystem; relative paths resolve here."),"".concat(is," is a hidden dot-folder containing user Skills and plugin data. Inspect it only when the task or a loaded Skill requires it."),"".concat(Yl," contains bundled Skills and is read-only; use the exact paths supplied by workspace context."),"".concat(ba," is for temporary, scratch, debug, and intermediate files."),"".concat(fh," is a virtual live settings file for configuration-capable tools; it contains whitelist fields only, never credentials."),"Use relative paths for vault files and absolute virtual paths for mounted or internal paths.","When replying, cite vault files by their vault-relative path (for example notes/idea.md); describe internal paths without exposing them unless asked.","This is a routing map, not an instruction to enumerate or scan every mount. Read the smallest relevant scope and stop when evidence is sufficient.","</virtual-filesystem>"].join("\n")}var jfe=2,dj=3,pj=20*1024,Ufe="chat_meta",Bfe="chat_index",qfe=["You are now acting as the compression engine for an Obsidian note-taking assistant. Condense the conversation ABOVE into a structured checkpoint that lets another model resume the work with no loss of essential context.",'Output EXACTLY the Markdown structure below: keep every section, in order. Use terse bullets, not prose paragraphs. Write "(none)" for an empty section — never drop a section.',"","## User Goals","- [the user's original and evolving goals; quote verbatim where the exact wording matters]","","## Vault Context","- [vault structure, folders, tags, naming and linking conventions, and any skills in use]","","## Vault Files Touched","- [exact vault-relative path (for example notes/idea.md): why it matters, key changes or snippets]","","## Issues and Resolutions","- [problems or ambiguities encountered and how they were resolved, plus related user feedback]","","## Pending Requests","- [explicitly requested work not yet completed]","","## Current Work","- [precisely what was in progress at this checkpoint]","","## Next Step",'- [the single next action, directly in line with the most recent request, or "(none)"]',"","## Critical Context","- [decisions and their rationale, constraints, user preferences, open questions, and data needed to continue]","","Rules:","- Write concise prose in the same language as the conversation. Use vault-relative paths for vault files, and preserve exact note names, tags, links, error strings, identifiers, and numeric values.","- Treat hidden dot-folders, including plugin data and the Obsidian config folder, as internal files. Do not include their paths or contents in the checkpoint unless the user explicitly asked about them.","- Capture user feedback and explicit instructions faithfully, especially corrections.","- Do NOT mention this summarization request or that the context was compacted.","- Output only the checkpoint text: do not call any tool or take any other action.","- If the conversation already contains a <ConversationSummary> block, it is a PRIOR checkpoint. Do not copy it forward verbatim: preserve still-true facts, drop stale ones, and merge newer information into a single consolidated summary under the same structure."].join("\n"),Wfe="This is an automatically generated checkpoint condensing an earlier span of the conversation to free up context. Treat the captured context as established background and build on it without restating it. Continue the task directly from the messages that follow, without acknowledging this checkpoint.";function ent(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.vault.adapter.read("AGENTS.md")];case 1:return[2,_state.sent().trim()||void 0];case 2:t=_state.sent();return[2];case 3:return[2]}})})()}function FT(e,t,r,n){return _async_to_generator(function(){var i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=Lfe(t,n);if(!i)throw new Error("Unknown agent type: ".concat(t));return[4,ent(e)];case 1:o=_state.sent();return[2,rnt(i,r,o)]}})})()}function zfe(){return["Use tools only when they are needed to answer or act.","Start with the smallest relevant scope and broaden only when evidence is insufficient.","Base answers on tool results, cite key file paths or outputs, and stop when evidence is sufficient."].join(" ")}function tnt(){return["Use todowrite to create and maintain a structured todo list when the work involves more than three steps, needs planning, or the user explicitly asks for task tracking.","Do not use todowrite for single-step tasks, pure information questions, or work that can be completed with one command.","Todo statuses are pending, in_progress, completed, and cancelled. Priorities are high, medium, and low.","Update todos as work progresses: keep exactly one todo in_progress when possible, mark items completed immediately after completion, and do not batch-complete todos at the end."].join(" ")}function rnt(e,t,r){var n=r!=null&&r.trim()?"<vault-instructions>\n".concat(r.trim(),"\n</vault-instructions>"):void 0;return e.id===wa?[t,e.systemPrompt,cj(),zfe(),tnt(),n].filter(Boolean).join("\n\n"):[e.systemPrompt,cj(),zfe(),"When you finish, return a concise final answer. If the task fails, explain the failure clearly."].filter(Boolean).join("\n\n")}function nnt(e){return{type:"data-model-file",data:{file:e}}}function int(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return;var t=e;if(t.type==="text")return _object_spread({type:"text",text:typeof t.text=="string"?t.text:""},t.providerOptions?{providerMetadata:t.providerOptions}:{});if(t.type==="reasoning")return _object_spread({type:"reasoning",text:typeof t.text=="string"?t.text:"",state:"done"},t.providerOptions?{providerMetadata:t.providerOptions}:{});if(t.type==="file")return nnt(e);if(t.type==="tool-call"){var r=e;return _object_spread({type:"dynamic-tool",toolName:r.toolName,toolCallId:r.toolCallId,state:"input-available",input:r.input},t.providerExecuted===!0?{providerExecuted:!0}:{},t.providerOptions?{callProviderMetadata:t.providerOptions}:{})}if(t.type==="custom"&&typeof t.kind=="string")return _object_spread({type:"custom",kind:t.kind},t.providerOptions?{providerMetadata:t.providerOptions}:{})}function Gfe(e){return typeof e.content=="string"?[{type:"text",text:e.content}]:Array.isArray(e.content)?_to_consumable_array(e.content):[]}function _6(e,t){var n,i,o;var r=Gfe(e).map(int).filter(function(a){return!!a});return(n=t.workspaceContextDelta)!=null&&n.length&&r.unshift({type:"data-workspace-context",data:{deltas:t.workspaceContextDelta}}),(i=t.userContext)!=null&&i.length&&r.unshift({type:"data-user-context",data:{items:t.userContext}}),(o=t.todos)!=null&&o.length&&r.push({type:"data-todos",data:{items:t.todos}}),{id:t.id,role:e.role==="tool"?"assistant":e.role,metadata:_object_spread({createdAt:t.createdAt},t.meta?{llm:t.meta}:{},t.isError?{status:"error"}:{}),parts:r}}function ont(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return e;var t=e;return(t.type==="text"||t.type==="error-text")&&typeof t.value=="string"||t.type==="json"||t.type==="error-json"?t.value:e}function Vfe(e,t,r,n){var a,s;var i=ont(e.output),o={type:"dynamic-tool",toolName:typeof e.toolName=="string"?e.toolName:(a=r==null?void 0:r.toolName)!=null?a:"unknown-tool",toolCallId:t,input:r&&"input"in r?r.input:void 0};return n?_object_spread_props(_object_spread({},o),{state:"output-error",errorText:typeof i=="string"?i:(s=JSON.stringify(i))!=null?s:String(i)}):_object_spread_props(_object_spread({},o),{state:"output-available",output:i})}function Hfe(e,t,r){var s,l,c;var n=Gfe(t.message),i=[],o=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var d=_step.value;if(!d||(typeof d==="undefined"?"undefined":_type_of(d))!="object")return"continue";var u=d;if(u.type!=="tool-result"||typeof u.toolCallId!="string")return"continue";var p=void 0;for(var m=e.length-1;m>=0;m-=1){var h=e[m],g=h.parts.findIndex(function(v){return v.type==="dynamic-tool"&&v.toolCallId===u.toolCallId});if(g<0)continue;var x=h.parts[g];if(x.type==="dynamic-tool"){h.parts[g]=Vfe(u,u.toolCallId,x,Boolean(t.isError)),p=h;break}}p?i.includes(p)||i.push(p):o.push(Vfe(u,u.toolCallId,void 0,Boolean(t.isError)))};for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(o.length){var d={id:t.id,role:"assistant",metadata:_object_spread({createdAt:t.createdAt},t.isError?{status:"error"}:{}),parts:o};e.push(d),i.push(d)}var a=i[i.length-1];a&&((s=t.todos)!=null&&s.length&&a.parts.push({type:"data-todos",data:{items:t.todos.map(function(d){return _object_spread({},d)})}}),(l=t.reversibleOps)!=null&&l.length&&(r[a.id]=_to_consumable_array((c=r[a.id])!=null?c:[]).concat(_to_consumable_array(t.reversibleOps))))}function v0(e){return e.parts.filter(function(t){return t.type==="text"}).map(function(t){return t.text}).join("\n")}function b6(e){var t=!1;return e.timeline=e.timeline.filter(function(r){if(r.role!=="assistant")return!0;var n=r.parts.filter(function(i){if(i.type!=="dynamic-tool")return!0;var o=i.state==="output-available"||i.state==="output-error"||i.state==="output-denied";return o||(t=!0),o});return n.length!==r.parts.length&&(r.parts=n),!r.parts.length||!v0(r).trim()&&r.parts.every(function(i){return i.type==="step-start"})?(t=!0,!1):!0}),t}function Zfe(e){return e.parts.flatMap(function(t){return t.type==="data-workspace-context"?t.data.deltas:[]})}function w6(e){return e.parts.flatMap(function(t){return t.type==="data-user-context"?t.data.items:[]})}function ant(e){for(var t=e.length-1;t>=0;t-=1)if(e[t].parts.some(function(r){return r.type==="data-context-checkpoint"}))return t;return-1}function Yd(e){var t=ant(e);if(t<0)return e;var r=e[t],n=r.parts.find(function(s){return s.type==="data-context-checkpoint"});if((n==null?void 0:n.type)!=="data-context-checkpoint")return e;if(n.data.mode==="reset")return e.slice(t+1);if(n.data.summarizedThroughMessageId){var s=Yd(e.slice(0,t)),l=s.findIndex(function(c){return c.id===n.data.summarizedThroughMessageId});if(l<0){var c=n.data.retainedMessageIds,d=c?c.flatMap(function(u){var p=s.find(function(m){return m.id===u});return p?[p]:[]}):s;return[r].concat(_to_consumable_array(d),_to_consumable_array(e.slice(t+1)))}return[r].concat(_to_consumable_array(s.slice(l+1)),_to_consumable_array(e.slice(t+1)))}if(n.data.preservedTurnCount===void 0)return e.slice(t);var i=Yd(e.slice(0,t)),o=n.data.preservedTurnCount,a=i.length;for(var s10=i.length-1;s10>=0;s10-=1){var l10=i[s10];if(!(l10.role!=="user"||l10.parts.some(function(c){return c.type==="data-context-checkpoint"}))&&(o-=1,a=s10,o===0))break}return[r].concat(_to_consumable_array(i.slice(a)),_to_consumable_array(e.slice(t+1)))}function Z2(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,wpe(e,{tools:t,convertDataPart:function convertDataPart(r){if(r.type==="data-workspace-context")return{type:"text",text:"<AdditionalContext>".concat(JSON.stringify(Object.fromEntries(r.data.deltas.map(function(n){return[n.key,n.content]}))),"</AdditionalContext>")};if(r.type==="data-context-checkpoint")return r.data.mode==="reset"||!r.data.summary?void 0:{type:"text",text:"<ConversationSummary>\n".concat(Wfe,"\n\n").concat(r.data.summary,"\n</ConversationSummary>")};if(r.type==="data-system-notification")return{type:"text",text:"<SystemNotification>".concat(JSON.stringify(r.data),"</SystemNotification>")};if(r.type==="data-model-file")return r.data.file}})]})})()}function Kfe(e){var _e_timeline;var t=e.pendingInputs.splice(0);return(_e_timeline=e.timeline).push.apply(_e_timeline,_to_consumable_array(t)),t.length>0}function zT(e){if(e.id===wa&&e.pendingInputs.length>0)throw new Error("Master agent pendingInputs must remain empty")}function jT(_01,_11,_21){return _async_to_generator(function(e,t,r){var n;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:Yd(e.timeline);return[4,Promise.all(n.map(function(o){return _async_to_generator(function(){var a,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Z2([o],t)];case 1:a=_state.sent();if(o.role!=="user"||a.length===0)return[2,a];s=a[0],l=w6(o),c=l.length?r.dedupeUserContextItems(l):[];return[4,r.buildMessagePartsFromUserContext(c)];case 2:d=_state.sent();if(!d.length)return[2,a];u=Array.isArray(s.content)?s.content:[];return[2,[_object_spread_props(_object_spread({},s),{content:_to_consumable_array(d).concat(_to_consumable_array(u))})]]}})})()}))];case 1:return[2,_state.sent().flat()]}})}).apply(this,arguments)}function UT(e){return{id:wa,type:wa,status:"idle",createdAt:e,timeline:[],pendingInputs:[],operations:{},toolTimings:{},subagents:{}}}var snt="image/png";function Qfe(e){return typeof e=="string"&&e.trim()?e.trim():snt}function lnt(e){if(typeof e!="string")return!1;var t=e.toLowerCase();return t==="image"||t.startsWith("image/")}function S6(e,t){return _object_spread({type:"file",data:e,mediaType:Qfe(t==null?void 0:t.mediaType)},t!=null&&t.filename?{filename:t.filename}:{},t!=null&&t.providerOptions?{providerOptions:t.providerOptions}:{})}function fj(e){var t=e;return(t==null?void 0:t.type)==="file"&&lnt(t.mediaType)}function k6(e){if(fj(e)){if(typeof e.data=="string")return e.data.trim()||void 0;if(_instanceof(e.data,URL))return e.data.toString()}}function Jfe(e){return typeof e.content=="string"?e.content:e.content.filter(function(t){return t.type==="text"}).map(function(t){var r;return(r=t.text)!=null?r:""}).join("\n")}function Yfe(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return e;var t=e,r=t.role;if(r==="assistant"){var n=Array.isArray(t.content)?t.content:[],i=Array.isArray(t.tool_calls)?t.tool_calls:[],o=n.map(function(s){var c;var l=s;if(l.type==="image_url"&&l.image_url){var d=l.image_url;return S6(d.url)}return l.type==="unknown"?{type:"text",text:JSON.stringify(l.value)}:{type:"text",text:(c=l.text)!=null?c:""}}),a=i.map(function(s){var u;var l=s,c=(u=l.function)!=null?u:{},d={};try{d=JSON.parse(c.arguments||"{}")}catch(p){}return{type:"tool-call",toolCallId:l.id,toolName:c.name,input:d}});return{role:"assistant",content:_to_consumable_array(o).concat(_to_consumable_array(a))}}if(r==="tool"){var i10=(Array.isArray(t.content)?t.content:[]).filter(function(o){return o.type==="text"}).map(function(o){return o.text}).join("\n");return{role:"tool",content:[{type:"tool-result",toolCallId:t.tool_call_id,toolName:t.name,output:{type:"text",value:i10}}]}}return r==="user"?{role:"user",content:(Array.isArray(t.content)?t.content:[]).map(function(o){var s;var a=o;if(a.type==="image_url"&&a.image_url){var l=a.image_url;return S6(l.url)}return a.type==="unknown"?{type:"text",text:JSON.stringify(a.value)}:{type:"text",text:(s=a.text)!=null?s:""}})}:e}function Xfe(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return!1;var t=e;return t.role==="assistant"&&"tool_calls"in t||t.role==="tool"&&"tool_call_id"in t}function unt(e){if(typeof e=="string")return e;var t=!1,r=e.map(function(n){return n.type==="image"?(t=!0,S6(n.image,{mediaType:Qfe(n.mediaType),providerOptions:n.providerOptions})):n});return t?r:e}function eme(e){if(e.role!=="user")return e;var t=unt(e.content);return t===e.content?e:_object_spread_props(_object_spread({},e),{content:t})}function tme(e){return e.role!=="user"||typeof e.content=="string"?!1:e.content.some(function(t){return t.type==="image"})}function Xd(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.subagents.master.timeline[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(t.role!=="user")continue;var r=v0(t).trim();if(r)return r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return P.t("chatbox.newChat")}var cnt=je("<div>");function K2(e){var t,r,n=0;return ki(function(){var i=e.markdown,o=e.streaming,a=e.renderMarkdown,s=++n;if(r==null||r(),r=void 0,!!t&&(t.replaceChildren(),!!i)){if(!a){t.textContent=i;return}Promise.resolve(a(t,i,{streaming:o})).then(function(l){if(s!==n){typeof l=="function"&&l();return}r=typeof l=="function"?l:void 0})}}),po(function(){n+=1,r==null||r(),r=void 0,t==null||t.replaceChildren()}),function(){var i=cnt(),o=t;return typeof o=="function"?Wl(o,i):t=i,yt(function(){return tn(i,["ns-fta2d2 ns-chatbox-markdown markdown-rendered",e.compact?"ns-kyafck":"ns-b20o94",e.details?"ns-chatbox-markdown--details":""].join(" "))}),i}()}var dnt=je('<div class="ns-04l5dc"><div class="ns-dhtutq">'),pnt=je('<img class="ns-qri26j"alt>');function fnt(e){return e.type==="text"}function rme(e){return function(){var t=dnt(),r=t.firstChild;return _e(r,Se(In,{get each(){return e.block.parts},children:function(n){return Se(Vg,{get children(){return[Se(nl,{get when(){return fnt(n)?n:void 0},children:function(i){return Se(K2,{get markdown(){var o;return(o=i().text)!=null?o:""},get renderMarkdown(){return e.renderMarkdown},get streaming(){return e.streaming}})}}),Se(nl,{get when(){return k6(n)},children:function(i){return function(){var o=pnt();return yt(function(){return Dt(o,"src",i())}),o}()}})]}})}})),t}()}var mnt=je('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><polyline points="20 6 9 17 4 12">'),hnt=je('<button class="ns-5i2opv"type=button>'),gnt=je('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><rect x=9 y=9 width=13 height=13 rx=2 ry=2></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1">');function nme(e){var _Yt=_sliced_to_array(Yt(!1),2),t=_Yt[0],r=_Yt[1],n;function i(){navigator.clipboard.writeText(e.getText()).then(function(){r(!0),n!==void 0&&window.clearTimeout(n),n=window.setTimeout(function(){return r(!1)},2e3)})}return po(function(){n!==void 0&&window.clearTimeout(n)}),function(){var o=hnt();return o.$$click=i,_e(o,Se(Ct,{get when(){return t()},get fallback(){return gnt()},get children(){return mnt()}})),yt(function(){return Dt(o,"title",t()?Te("chatbox.ui.states.copied"):Te("chatbox.ui.actions.copy"))}),o}()}Kr(["click"]);var xnt=je('<details class="ns-h5v1oh group"><summary class="ns-jebbvh"><div class="ns-w0y20q"><span class="ns-on28ur">'),ynt=je('<div class="ns-5hlfxp">'),vnt=je('<div class="ns-6n41jg"><span class="ns-8hz4yq"role=img><span aria-hidden=true></span></span><div class="ns-oe1az9">');function mj(e){return function(){var t=xnt(),r=t.firstChild,n=r.firstChild,i=n.firstChild;return t.addEventListener("toggle",function(o){var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o.currentTarget.open)}),_e(r,function(){return e.summary},n),_e(n,function(){return e.headerActions},i),_e(t,function(){return e.children},null),yt(function(){return t.open=e.open}),t}()}function _0(e){return Se(mj,{get summary(){return function(){var t=vnt(),r=t.firstChild,n=r.firstChild,i=r.nextSibling;return _e(i,function(){return e.title}),yt(function(o){var a=e.iconLabel,s=e.iconLabel,l="ns-tiwzfw ".concat(e.iconClass);return a!==o.e&&Dt(r,"title",o.e=a),s!==o.t&&Dt(r,"aria-label",o.t=s),l!==o.a&&tn(n,o.a=l),o},{e:void 0,t:void 0,a:void 0}),t}()},get headerActions(){return e.headerActions},get open(){return e.open},get onOpenChange(){return e.onOpenChange},get children(){var t=ynt();return _e(t,function(){return e.children}),t}})}var _nt=je('<pre class="ns-a4nrzo">');function ime(e){return Se(_0,{get title(){return Te("chatbox.ui.labels.reasoning")},iconClass:"ns-aloqse",get children(){var t=_nt();return _e(t,function(){var r;return(r=e.part.text)!=null?r:""}),t}})}function ome(e){return Se(_0,{get title(){return Te("chatbox.ui.labels.systemNotification")},iconClass:"ns-c0itin",get children(){return Se(K2,{get markdown(){return WC(e.block.notification)},get renderMarkdown(){return e.renderMarkdown},compact:!0,details:!0})}})}function Q2(e,t){var r;if(e)return Hg(((r=e.finishedAt)!=null?r:t)-e.startedAt)}function b0(e){switch(e.state){case"output-available":return hj();case"output-error":return gj();case"output-denied":return qT(Te("chatbox.ui.states.toolDenied"));case"approval-requested":return WT(Te("chatbox.ui.states.toolWaitingApproval"));case"approval-responded":return e.approval.approved?BT():qT(Te("chatbox.ui.states.toolDenied"));default:return BT()}}function BT(){return{label:Te("chatbox.ui.states.running"),iconClass:"ns-77x40l"}}function WT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"ns-vnk9kc";return{label:e,iconClass:"".concat(t," text-[var(--color-yellow)]")}}function hj(){return{label:Te("chatbox.ui.states.completed"),iconClass:"ns-xs396e"}}function gj(){return{label:Te("chatbox.ui.states.failed"),iconClass:"ns-2dbsjl"}}function qT(e){return{label:e,iconClass:"ns-3vx8gz"}}var yh=nr(p$(),1);var Gn=Uint8Array,Xl=Uint16Array,Aj=Int32Array,VT=new Gn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),GT=new Gn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),wj=new Gn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pme=function pme1(e,t){for(var r=new Xl(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Aj(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},fme=pme(VT,2),mme=fme.b,Sj=fme.r;mme[28]=258,Sj[258]=28;var hme=pme(GT,0),bnt=hme.b,ame=hme.r,kj=new Xl(32768);for($n=0;$n<32768;++$n)xf=($n&43690)>>1|($n&21845)<<1,xf=(xf&52428)>>2|(xf&13107)<<2,xf=(xf&61680)>>4|(xf&3855)<<4,kj[$n]=((xf&65280)>>8|(xf&255)<<8)>>1;var xf,$n,tp=function tp1(e,t,r){for(var n=e.length,i=0,o=new Xl(t);i<n;++i)e[i]&&++o[e[i]-1];var a=new Xl(t);for(i=1;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;var s;if(r){s=new Xl(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],d=t-e[i],u=a[e[i]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)s[kj[u]>>l]=c}else for(s=new Xl(n),i=0;i<n;++i)e[i]&&(s[i]=kj[a[e[i]-1]++]>>15-e[i]);return s},gh=new Gn(288);for($n=0;$n<144;++$n)gh[$n]=8;var $n;for($n=144;$n<256;++$n)gh[$n]=9;var $n;for($n=256;$n<280;++$n)gh[$n]=7;var $n;for($n=280;$n<288;++$n)gh[$n]=8;var $n,T6=new Gn(32);for($n=0;$n<32;++$n)T6[$n]=5;var $n,wnt=tp(gh,9,0),Snt=tp(gh,9,1),knt=tp(T6,5,0),Cnt=tp(T6,5,1),xj=function xj1(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},$c=function $c1(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},yj=function yj1(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},HT=function HT1(e){return(e+7)/8|0},hh=function hh1(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Gn(e.subarray(t,r))};var Ent=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],na=function na1(e,t,r){var n=new Error(t||Ent[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,na),!r)throw n;return n},Ij=function Ij1(e,t,r,n){var i=e.length,o=n?n.length:0;if(!i||t.f&&!t.l)return r||new Gn(0);var a=!r,s=a||t.i!=2,l=t.i;a&&(r=new Gn(i*3));var c=function c(Y){var oe=r.length;if(Y>oe){var H=new Gn(Math.max(oe*2,Y));H.set(r),r=H}},d=t.f||0,u=t.p||0,p=t.b||0,m=t.l,h=t.d,g=t.m,x=t.n,v=i*8;do{if(!m){d=$c(e,u,1);var y=$c(e,u+1,3);if(u+=3,y)if(y==1)m=Snt,h=Cnt,g=9,x=5;else if(y==2){var S=$c(e,u,31)+257,k=$c(e,u+10,15)+4,E=S+$c(e,u+5,31)+1;u+=14;for(var C=new Gn(E),T=new Gn(19),I=0;I<k;++I)T[wj[I]]=$c(e,u+I*3,7);u+=k*3;for(var O=xj(T),M=(1<<O)-1,R=tp(T,O,1),I=0;I<E;){var $=R[$c(e,u,M)];u+=$&15;var _=$>>4;if(_<16)C[I++]=_;else{var z=0,D=0;for(_==16?(D=3+$c(e,u,3),u+=2,z=C[I-1]):_==17?(D=3+$c(e,u,7),u+=3):_==18&&(D=11+$c(e,u,127),u+=7);D--;)C[I++]=z}}var L=C.subarray(0,S),ee=C.subarray(S);g=xj(L),x=xj(ee),m=tp(L,g,1),h=tp(ee,x,1)}else na(1);else{var _=HT(u)+4,b=e[_-4]|e[_-3]<<8,w=_+b;if(w>i){l&&na(0);break}s&&c(p+b),r.set(e.subarray(_,w),p),t.b=p+=b,t.p=u=w*8,t.f=d;continue}if(u>v){l&&na(0);break}}s&&c(p+131072);for(var pe=(1<<g)-1,N=(1<<x)-1,U=u;;U=u){var z=m[yj(e,u)&pe],G=z>>4;if(u+=z&15,u>v){l&&na(0);break}if(z||na(2),G<256)r[p++]=G;else if(G==256){U=u,m=null;break}else{var K=G-254;if(G>264){var I=G-257,me=VT[I];K=$c(e,u,(1<<me)-1)+mme[I],u+=me}var V=h[yj(e,u)&N],ie=V>>4;V||na(3),u+=V&15;var ee=bnt[ie];if(ie>3){var me=GT[ie];ee+=yj(e,u)&(1<<me)-1,u+=me}if(u>v){l&&na(0);break}s&&c(p+131072);var re=p+K;if(p<ee){var de=o-ee,xe=Math.min(ee,re);for(de+p<0&&na(3);p<xe;++p)r[p]=n[de+p]}for(;p<re;++p)r[p]=r[p-ee]}}t.l=m,t.p=U,t.b=p,t.f=d,m&&(d=1,t.m=g,t.d=h,t.n=x)}while(!d);return p!=r.length&&a?hh(r,0,p):r.subarray(0,p)},yf=function yf1(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},C6=function C61(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},vj=function vj1(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return{t:xme,l:0};if(i==1){var a=new Gn(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort(function(w,S){return w.f-S.f}),r.push({s:-1,f:25001});var s=r[0],l=r[1],c=0,d=1,u=2;for(r[0]={s:-1,f:s.f+l.f,l:s,r:l};d!=i-1;)s=r[r[c].f<r[u].f?c++:u++],l=r[c!=d&&r[c].f<r[u].f?c++:u++],r[d++]={s:-1,f:s.f+l.f,l:s,r:l};for(var p=o[0].s,n=1;n<i;++n)o[n].s>p&&(p=o[n].s);var m=new Xl(p+1),h=Cj(r[d-1],m,0);if(h>t){var n=0,g=0,x=h-t,v=1<<x;for(o.sort(function(S,k){return m[k.s]-m[S.s]||S.f-k.f});n<i;++n){var y=o[n].s;if(m[y]>t)g+=v-(1<<h-m[y]),m[y]=t;else break}for(g>>=x;g>0;){var _=o[n].s;m[_]<t?g-=1<<t-m[_]++-1:++n}for(;n>=0&&g;--n){var b=o[n].s;m[b]==t&&(--m[b],++g)}h=t}return{t:new Gn(m),l:h}},Cj=function Cj1(e,t,r){return e.s==-1?Math.max(Cj(e.l,t,r+1),Cj(e.r,t,r+1)):t[e.s]=r},sme=function sme1(e){for(var t=e.length;t&&!e[--t];);for(var r=new Xl(++t),n=0,i=e[0],o=1,a=function a(l){r[n++]=l},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return{c:r.subarray(0,n),n:t}},E6=function E61(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},gme=function gme1(e,t,r){var n=r.length,i=HT(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<n;++o)e[i+o+4]=r[o];return(i+4+n)*8},lme=function lme1(e,t,r,n,i,o,a,s,l,c,d){yf(t,d++,r),++i[256];for(var u=vj(i,15),p=u.t,m=u.l,h=vj(o,15),g=h.t,x=h.l,v=sme(p),y=v.c,_=v.n,b=sme(g),w=b.c,S=b.n,k=new Xl(19),E=0;E<y.length;++E)++k[y[E]&31];for(var E=0;E<w.length;++E)++k[w[E]&31];for(var C=vj(k,7),T=C.t,I=C.l,O=19;O>4&&!T[wj[O-1]];--O);var M=c+5<<3,R=E6(i,gh)+E6(o,T6)+a,$=E6(i,p)+E6(o,g)+a+14+3*O+E6(k,T)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&M<=R&&M<=$)return gme(t,d,e.subarray(l,l+c));var z,D,L,ee;if(yf(t,d,1+($<R)),d+=2,$<R){z=tp(p,m,0),D=p,L=tp(g,x,0),ee=g;var pe=tp(T,I,0);yf(t,d,_-257),yf(t,d+5,S-1),yf(t,d+10,O-4),d+=14;for(var E=0;E<O;++E)yf(t,d+3*E,T[wj[E]]);d+=3*O;for(var N=[y,w],U=0;U<2;++U)for(var G=N[U],E=0;E<G.length;++E){var K=G[E]&31;yf(t,d,pe[K]),d+=T[K],K>15&&(yf(t,d,G[E]>>5&127),d+=G[E]>>12)}}else z=wnt,D=gh,L=knt,ee=T6;for(var E=0;E<s;++E){var me=n[E];if(me>255){var K=me>>18&31;C6(t,d,z[K+257]),d+=D[K+257],K>7&&(yf(t,d,me>>23&31),d+=VT[K]);var V=me&31;C6(t,d,L[V]),d+=ee[V],V>3&&(C6(t,d,me>>5&8191),d+=GT[V])}else C6(t,d,z[me]),d+=D[me]}return C6(t,d,z[256]),d+D[256]},Tnt=new Aj([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xme=new Gn(0),Ant=function Ant1(e,t,r,n,i,o){var a=o.z||e.length,s=new Gn(n+a+5*(1+Math.ceil(a/7e3))+i),l=s.subarray(n,s.length-i),c=o.l,d=(o.r||0)&7;if(t){d&&(l[0]=o.r>>3);for(var u=Tnt[t-1],p=u>>13,m=u&8191,h=(1<<r)-1,g=o.p||new Xl(32768),x=o.h||new Xl(h+1),v=Math.ceil(r/3),y=2*v,_=function _(J){return(e[J]^e[J+1]<<v^e[J+2]<<y)&h},b=new Aj(25e3),w=new Xl(288),S=new Xl(32),k=0,E=0,C=o.i||0,T=0,I=o.w||0,O=0;C+2<a;++C){var M=_(C),R=C&32767,$=x[M];if(g[R]=$,x[M]=R,I<=C){var z=a-C;if((k>7e3||T>24576)&&(z>423||!c)){d=lme(e,l,0,b,w,S,E,T,O,C-O,d),T=k=E=0,O=C;for(var D=0;D<286;++D)w[D]=0;for(var D=0;D<30;++D)S[D]=0}var L=2,ee=0,pe=m,N=R-$&32767;if(z>2&&M==_(C-N))for(var U=Math.min(p,z)-1,G=Math.min(32767,C),K=Math.min(258,z);N<=G&&--pe&&R!=$;){if(e[C+L]==e[C+L-N]){for(var me=0;me<K&&e[C+me]==e[C+me-N];++me);if(me>L){if(L=me,ee=N,me>U)break;for(var V=Math.min(N,me-2),ie=0,D=0;D<V;++D){var re=C-N+D&32767,de=g[re],xe=re-de&32767;xe>ie&&(ie=xe,$=re)}}}R=$,$=g[R],N+=R-$&32767}if(ee){b[T++]=0x10000000|Sj[L]<<18|ame[ee];var Y=Sj[L]&31,oe=ame[ee]&31;E+=VT[Y]+GT[oe],++w[257+Y],++S[oe],I=C+L,++k}else b[T++]=e[C],++w[e[C]]}}for(C=Math.max(C,I);C<a;++C)b[T++]=e[C],++w[e[C]];d=lme(e,l,c,b,w,S,E,T,O,C-O,d),c||(o.r=d&7|l[d/8|0]<<3,d-=7,o.h=x,o.p=g,o.i=C,o.w=I)}else{for(var C=o.w||0;C<a+c;C+=65535){var H=C+65535;H>=a&&(l[d/8|0]=c,H=a),d=gme(l,d+1,e.subarray(C,H))}o.i=a}return hh(s,0,n+HT(d)+i)},Int=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-0x12477ce0)^r>>>1;e[t]=r}return e}(),yme=function yme1(){var e=-1;return{p:function p(t){for(var r=e,n=0;n<t.length;++n)r=Int[r&255^t[n]]^r>>>8;e=r},d:function d(){return~e}}};var vme=function vme1(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),a=new Gn(o.length+e.length);a.set(o),a.set(e,o.length),e=a,i.w=o.length}return Ant(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},_me=function _me1(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r};var ep=function ep1(e,t){return e[t]|e[t+1]<<8},Nc=function Nc1(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},_j=function _j1(e,t){return Nc(e,t)+Nc(e,t+4)*0x100000000},$o=function $o1(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Pnt=function Pnt1(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&$o(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},bme=function bme1(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&na(6,"invalid gzip data");var t=e[3],r=10;t&4&&(r+=(e[10]|e[11]<<8)+2);for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(t&2)},Rnt=function Rnt1(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Mnt=function Mnt1(e){return 10+(e.filename?e.filename.length+1:0)};function J2(e,t){return vme(e,t||{},0,0)}var bj=function(){function e(t,r){typeof t=="function"&&(r=t,t={}),this.ondata=r;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Gn(32768),this.p=new Gn(0),n&&this.o.set(n)}return e.prototype.e=function(t){if(this.ondata||na(5),this.d&&na(4),!this.p.length)this.p=t;else if(t.length){var r=new Gn(this.p.length+t.length);r.set(this.p),r.set(t,this.p.length),this.p=r}},e.prototype.c=function(t){this.s.i=+(this.d=t||!1);var r=this.s.b,n=Ij(this.p,this.s,this.o);this.ondata(hh(n,r,this.s.b),this.d),this.o=hh(n,this.s.b-32768),this.s.b=this.o.length,this.p=hh(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(t,r){this.e(t),this.c(r)},e}();function Y2(e,t){return Ij(e,{i:2},t&&t.out,t&&t.dictionary)}function wme(e,t){t||(t={});var r=yme(),n=e.length;r.p(e);var i=vme(e,t,Mnt(t),8),o=i.length;return Pnt(i,t),$o(i,o-8,r.d()),$o(i,o-4,n),i}var Sme=function(){function e(t,r){this.v=1,this.r=0,bj.call(this,t,r)}return e.prototype.push=function(t,r){if(bj.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?bme(n):4;if(i>n.length){if(!r)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}bj.prototype.c.call(this,r),this.s.f&&!this.s.l&&!r&&(this.v=HT(this.s.p)+9,this.s={i:0},this.o=new Gn(0),this.push(new Gn(0),r))},e}();function kme(e,t){var r=bme(e);return r+8>e.length&&na(6,"invalid gzip data"),Ij(e.subarray(r,-8),{i:2},t&&t.out||new Gn(Rnt(e)),t&&t.dictionary)}var Cme=function Cme1(e,t,r,n){for(var i in e){var o=e[i],a=t+i,s=n;Array.isArray(o)&&(s=_me(n,o[1]),o=o[0]),_instanceof(o,Gn)?r[a]=[o,s]:(r[a+="/"]=[new Gn(0),s],Cme(o,a,r,n))}},ume=typeof TextEncoder!="undefined"&&new TextEncoder,Ej=typeof TextDecoder!="undefined"&&new TextDecoder,Ont=0;try{Ej.decode(xme,{stream:!0}),Ont=1}catch(e){}var $nt=function $nt1(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:hh(e,r-1)};i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function cme(e,t){if(t){for(var r=new Gn(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(ume)return ume.encode(e);for(var i=e.length,o=new Gn(e.length+(e.length>>1)),a=0,s=function s(d){o[a++]=d},n=0;n<i;++n){if(a+5>o.length){var l=new Gn(a+8+(i-n<<1));l.set(o),o=l}var c=e.charCodeAt(n);c<128||t?s(c):c<2048?(s(192|c>>6),s(128|c&63)):c>55295&&c<57344?(c=65536+(c&1023<<10)|e.charCodeAt(++n)&1023,s(240|c>>18),s(128|c>>12&63),s(128|c>>6&63),s(128|c&63)):(s(224|c>>12),s(128|c>>6&63),s(128|c&63))}return hh(o,0,a)}function Nnt(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(Ej)return Ej.decode(e);var i=$nt(e),o=i.s,r=i.r;return r.length&&na(8),o}}var Dnt=function Dnt1(e,t){return t+30+ep(e,t+26)+ep(e,t+28)},Lnt=function Lnt1(e,t,r){var n=ep(e,t+28),i=Nnt(e.subarray(t+46,t+46+n),!(ep(e,t+8)&2048)),o=t+46+n,a=Nc(e,t+20),s=r&&a==0xffffffff?Fnt(e,o):[a,Nc(e,t+24),Nc(e,t+42)],l=s[0],c=s[1],d=s[2];return[ep(e,t+10),l,c,i,o+ep(e,t+30)+ep(e,t+32),d]},Fnt=function Fnt1(e,t){for(;ep(e,t)!=1;t+=4+ep(e,t+2));return[_j(e,t+12),_j(e,t+4),_j(e,t+20)]},Tj=function Tj1(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&na(9),t+=n+4}return t},dme=function dme1(e,t,r,n,i,o,a,s){var l=n.length,c=r.extra,d=s&&s.length,u=Tj(c);$o(e,t,a!=null?0x2014b50:0x4034b50),t+=4,a!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(o<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var p=new Date(r.mtime==null?Date.now():r.mtime),m=p.getFullYear()-1980;if((m<0||m>119)&&na(10),$o(e,t,m<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),t+=4,o!=-1&&($o(e,t,r.crc),$o(e,t+4,o<0?-o-2:o),$o(e,t+8,r.size)),$o(e,t+12,l),$o(e,t+14,u),t+=16,a!=null&&($o(e,t,d),$o(e,t+6,r.attrs),$o(e,t+10,a),t+=14),e.set(n,t),t+=l,u)for(var h in c){var g=c[h],x=g.length;$o(e,t,+h),$o(e,t+2,x),e.set(g,t+4),t+=4+x}return d&&(e.set(s,t),t+=d),t},znt=function znt1(e,t,r,n,i){$o(e,t,0x6054b50),$o(e,t+8,r),$o(e,t+10,r),$o(e,t+12,n),$o(e,t+16,i)};function Eme(e,t){t||(t={});var r={},n=[];Cme(e,"",r,t);var i=0,o=0;for(var a in r){var s=r[a],l=s[0],c=s[1],d=c.level==0?0:8,u=cme(a),p=u.length,m=c.comment,h=m&&cme(m),g=h&&h.length,x=Tj(c.extra);p>65535&&na(11);var v=d?J2(l,c):l,y=v.length,_=yme();_.p(l),n.push(_me(c,{size:l.length,crc:_.d(),c:v,f:u,m:h,u:p!=a.length||h&&m.length!=g,o:i,compression:d})),i+=30+p+x+y,o+=76+2*(p+x)+(g||0)+y}for(var b=new Gn(o+22),w=i,S=o-i,k=0;k<n.length;++k){var u=n[k];dme(b,u.o,u,u.f,u.u,u.c.length);var E=30+u.f.length+Tj(u.extra);b.set(u.c,u.o+E),dme(b,i,u,u.f,u.u,u.c.length,u.o,u.m),i+=16+E+(u.m?u.m.length:0)}return znt(b,i,n.length,S,w),b}function Pj(e,t){for(var r={},n=e.length-22;Nc(e,n)!=0x6054b50;--n)(!n||e.length-n>65558)&&na(13);var i=ep(e,n+8);if(!i)return{};var o=Nc(e,n+16),a=o==0xffffffff||i==65535;if(a){var s=Nc(e,n-12);a=Nc(e,s)==0x6064b50,a&&(i=Nc(e,s+32),o=Nc(e,s+48))}for(var l=t&&t.filter,c=0;c<i;++c){var d=Lnt(e,o,a),u=d[0],p=d[1],m=d[2],h=d[3],g=d[4],x=d[5],v=Dnt(e,x);o=g,(!l||l({name:h,size:p,originalSize:m,compression:u}))&&(u?u==8?r[h]=Y2(e.subarray(v,v+p),{out:new Gn(m)}):na(14,"unknown compression type "+u):r[h]=hh(e,v,v+p))}return r}function Rj(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Tme(e){var t=typeof e=="string"?new TextEncoder().encode(e):_instanceof(e,Uint8Array)?e:new Uint8Array(e),r=J2(t,{level:9});return{compress:"deflate",blob:new Blob([Rj(r)],{type:"application/octet-stream"})}}function X2(e){var t;return((t=e.contentCompressed)==null?void 0:t.compress)==="deflate"&&_instanceof(e.contentCompressed.blob,Blob)}function xh(e){return _async_to_generator(function(){var r,n,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!X2(e))return[3,2];return[4,e.contentCompressed.blob.arrayBuffer()];case 1:r=_state.sent(),n=Y2(new Uint8Array(r));return[2,Rj(n)];case 2:t=hb(e.contentBase64||"");return[2,Rj(t)]}})})()}var Mj=2;function ZT(e){return{line:e,text:"",segments:[],changed:!1}}function Ame(e,t,r){if(!t)return;e.text+=t,e.changed||(e.changed=r);var n=e.segments.at(-1);(n==null?void 0:n.changed)===r?n.text+=t:e.segments.push({text:t,changed:r})}function jnt(e,t){var r=new yh.diff_match_patch,n=r.diff_main(e,t);r.diff_cleanupSemantic(n);var i=[],o=[],a=[],s=1,l=1,c=ZT(s),d=ZT(l),u=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;c.changed||(c.changed=v);var y=c;return s+=1,c=ZT(s),y},p=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;d.changed||(d.changed=v);var y=d;return l+=1,d=ZT(l),y},m=function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;i.push({kind:"remove",oldLine:v.line,text:v.text,segments:v.segments})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var v10=_step1.value;i.push({kind:"add",newLine:v10.line,text:v10.text,segments:v10.segments})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}o.length=0,a.length=0},h=function(){var v=u(),y=p();if(!v.changed&&!y.changed&&v.text===y.text){m(),i.push({kind:"context",oldLine:v.line,newLine:y.line,text:v.text});return}o.push(v),a.push(y)};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),v=_step_value[0],y=_step_value[1];var _=y.split("\n");for(var b=0;b<_.length;b+=1){var w=_[b];v!==yh.diff_match_patch.DIFF_INSERT&&Ame(c,w,v===yh.diff_match_patch.DIFF_DELETE),v!==yh.diff_match_patch.DIFF_DELETE&&Ame(d,w,v===yh.diff_match_patch.DIFF_INSERT),b!==_.length-1&&(v===yh.diff_match_patch.DIFF_EQUAL?h():v===yh.diff_match_patch.DIFF_DELETE?o.push(u(!0)):a.push(p(!0)))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var g=e&&!e.endsWith("\n")?u():void 0,x=t&&!t.endsWith("\n")?p():void 0;return g&&x&&!g.changed&&!x.changed&&g.text===x.text?(m(),i.push({kind:"context",oldLine:g.line,newLine:x.line,text:g.text})):(g&&o.push(g),x&&a.push(x),m()),i}function Unt(e){var t=e.map(function(o,a){return o.kind==="context"?void 0:a}).filter(function(o){return o!==void 0});if(!t.length)return[];var r=[0],n=[0];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;r.push(r[r.length-1]+(o.kind==="add"?0:1)),n.push(n[n.length-1]+(o.kind==="remove"?0:1))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var i=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=t[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o10=_step1.value;var a=i.at(-1);a&&o10-a[a.length-1]-1<=Mj*2?a.push(o10):i.push([o10])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return i.map(function(o){var a=Math.max(0,o[0]-Mj),s=Math.min(e.length,o[o.length-1]+Mj+1),l=e.slice(a,s);return{oldStart:r[a]+1,oldCount:r[s]-r[a],newStart:n[a]+1,newCount:n[s]-n[a],lines:l}})}function Oj(e,t){return e===t?[]:Unt(jnt(e,t))}function KT(e){return _async_to_generator(function(){var i,o,t,_,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=Uint8Array.bind;return[4,xh(e)];case 1:t=new(_.apply(Uint8Array,[void 0,_state.sent()]));if(t.includes(0))return[2];r=new TextDecoder().decode(t);return[2,((o=(i=r.match(/\uFFFD/g))==null?void 0:i.length)!=null?o:0)>Math.max(1,r.length/100)?void 0:r]}})})()}function Ime(e){return _async_to_generator(function(){var n,n10,_ref,t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.operation==="create"))return[3,2];if(!e.after)return[2];if(e.after.kind==="dir")return[2,{vaultPath:e.vaultPath,operation:e.operation}];return[4,KT(e.after)];case 1:n=_state.sent();return[2,n===void 0?{vaultPath:e.vaultPath,operation:e.operation,binary:!0}:{vaultPath:e.vaultPath,operation:e.operation,hunks:Oj("",n)}];case 2:if(!(e.operation==="delete"))return[3,4];if(e.before.kind==="dir")return[2,{vaultPath:e.vaultPath,operation:e.operation}];return[4,KT(e.before)];case 3:n10=_state.sent();return[2,n10===void 0?{vaultPath:e.vaultPath,operation:e.operation,binary:!0}:{vaultPath:e.vaultPath,operation:e.operation,hunks:Oj(n10,"")}];case 4:if(!e.after)return[2];return[4,Promise.all([KT(e.before),KT(e.after)])];case 5:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),t=_ref[0],r=_ref[1];return[2,t===void 0||r===void 0?{vaultPath:e.vaultPath,operation:e.operation,binary:!0}:{vaultPath:e.vaultPath,operation:e.operation,hunks:Oj(t,r)}]}})})()}var Bnt=je("<span style=-webkit-box-decoration-break:clone;box-decoration-break:clone>"),qnt=je('<div><span class="ns-p6srk2"></span><span class="ns-xt0bs2">'),Wnt=je('<div class="ns-a6wn17"><div class="ns-7j3lhe">@@ -<!>,<!> +<!>,<!> @@'),Vnt=je('<div class="ns-6n41jg"><span class="ns-8hz4yq"role=img><span class="ns-z4hpk7"aria-hidden=true></span></span><button type=button class="ns-a0esit">'),Gnt=je('<span class="ns-6ugsk2"><span class="ns-1nn94m">+</span> <span class="ns-jmz8eu">-'),Hnt=je('<div class="ns-jl01t7">'),Znt=je('<div class="ns-lblvpg">'),Knt=je('<div class="ns-6g4h0b"><div class="ns-drtgip">'),Qnt={create:"chatbox.ui.fileChanges.create",update:"chatbox.ui.fileChanges.update",delete:"chatbox.ui.fileChanges.delete"};function Jnt(e){var n;var t=0,r=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=((n=e.hunks)!=null?n:[])[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var i=_step.value;try{for(var _iterator1=i.lines[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var o=_step1.value;o.kind==="add"?t+=1:o.kind==="remove"&&(r+=1)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return{added:t,removed:r}}function Ynt(e){return e==="add"?"ns-tdjgx5":e==="remove"?"ns-g4hgs9":""}function Xnt(e,t){if(e.changed)return t==="add"?"ns-imravm":"ns-xikds2"}function eit(e){return function(){var t=Bnt();return _e(t,function(){return e.segment.text}),yt(function(){return tn(t,Xnt(e.segment,e.lineKind))}),t}()}function tit(e){return function(){var t=qnt(),r=t.firstChild,n=r.nextSibling;return _e(r,function(){var i=Qn(function(){return e.line.kind==="remove"});return function(){var o,a;return i()?(o=e.line.oldLine)!=null?o:"":(a=e.line.newLine)!=null?a:""}}()),_e(n,function(){var i=Qn(function(){return e.line.kind==="add"});return function(){return i()?"+":e.line.kind==="remove"?"-":" "}}(),null),_e(n,Se(Ct,{get when(){return e.line.segments},get fallback(){return e.line.text},get children(){return Se(In,{get each(){return e.line.segments},children:function(i){return Se(eit,{segment:i,get lineKind(){return e.line.kind}})}})}}),null),yt(function(){return tn(t,"ns-ln3h7m ".concat(Ynt(e.line.kind)))}),t}()}function rit(e){return function(){var t=Wnt(),r=t.firstChild,n=r.firstChild,i=n.nextSibling,o=i.nextSibling,a=o.nextSibling,s=a.nextSibling,l=s.nextSibling,c=l.nextSibling,d=c.nextSibling,u=d.nextSibling;return _e(r,function(){return e.hunk.oldStart},i),_e(r,function(){return e.hunk.oldCount},a),_e(r,function(){return e.hunk.newStart},l),_e(r,function(){return e.hunk.newCount},d),_e(t,Se(In,{get each(){return e.hunk.lines},children:function(p){return Se(tit,{line:p})}}),null),t}()}function nit(e){var t=function(){return Te(Qnt[e.diff.operation])},r=function(){var n,i,o,a,s,l;return(l=(o=(i=(n=e.diff.hunks)==null?void 0:n[0])==null?void 0:i.lines.find(function(c){return c.kind==="add"}))==null?void 0:o.newLine)!=null?l:(s=(a=e.diff.hunks)==null?void 0:a[0])==null?void 0:s.newStart};return function(){var n=Vnt(),i=n.firstChild,o=i.nextSibling;return o.$$click=function(a){var s;a.stopPropagation(),(s=e.onOpenFile)==null||s.call(e,e.diff.vaultPath,r())},_e(o,function(){return e.diff.vaultPath}),yt(function(a){var s=t(),l=t();return s!==a.e&&Dt(i,"title",a.e=s),l!==a.t&&Dt(i,"aria-label",a.t=l),a},{e:void 0,t:void 0}),n}()}function iit(e){var t=function(){return Jnt(e.diff)};return Se(Ct,{get when(){return e.diff.hunks},get children(){var r=Gnt(),n=r.firstChild,i=n.firstChild,o=n.nextSibling,a=o.nextSibling,s=a.firstChild;return _e(n,function(){return t().added},null),_e(a,function(){return t().removed},null),r}})}function oit(e){var _Une=_sliced_to_array(Une(function(){return e.change},Ime),1),t=_Une[0],_Yt=_sliced_to_array(Yt(!1),2),r=_Yt[0],n=_Yt[1];return Se(Ct,{get when(){return t()},keyed:!0,children:function(i){return Se(mj,{get summary(){return Se(nit,{diff:i,get onOpenFile(){return e.onOpenFile}})},get headerActions(){return Se(iit,{diff:i})},get open(){return r()},onOpenChange:n,get children(){return[Se(Ct,{get when(){return i.binary},get children(){var o=Hnt();return _e(o,function(){return Te("chatbox.ui.fileChanges.binary")}),o}}),function(){var o=Znt();return _e(o,Se(In,{get each(){return i.hunks},children:function(a){return Se(rit,{hunk:a})}})),o}()]}})}})}function Pme(e){return Se(Ct,{get when(){var t;return(t=e.changes)==null?void 0:t.length},get children(){var t10=Knt(),r=t10.firstChild;return _e(r,Se(In,{get each(){return e.changes},children:function(n){return Se(oit,{change:n,get onOpenFile(){return e.onOpenFile}})}})),t10}})}Kr(["click"]);var ait=je('<span class="ns-pc7g1v">'),sit=je('<div class="ns-z21cr3"><ul class="ns-60wy7s">'),lit=je('<div class="ns-m0ecpv"><div class="ns-uf7h8l"><span class="ns-8hz4yq"role=img><span aria-hidden=true></span></span><div class="ns-oe1az9">'),uit=je('<span class="ns-5tnh3d"> \xb7 '),cit=je('<li class="ns-bue2p9"><span aria-hidden=true></span><span>');function dit(e){switch(e){case"completed":return"ns-7ubpf5";case"in_progress":return"ns-khesmp";case"cancelled":return"ns-8vos1l";case"pending":default:return"ns-qdwyoz"}}function Rme(e){var t=function(){var i;return(i=e.block.todos)!=null?i:[]},r=function(){return t().length===0},n=function(){return b0(e.block.toolCall)};return function(){var i=lit(),o=i.firstChild,a=o.firstChild,s=a.firstChild,l=a.nextSibling;return _e(l,function(){var c=Qn(function(){return!!r()});return function(){return c()?Te("chatbox.ui.states.todoEmpty"):Te("chatbox.ui.labels.todoList")}}(),null),_e(l,Se(Ct,{get when(){return Q2(e.block.timing,e.now)},children:function(c){return function(){var d=uit(),u=d.firstChild;return _e(d,c,null),d}()}}),null),_e(o,Se(Ct,{get when(){return!r()},get children(){var c=ait();return _e(c,function(){return t().length}),c}}),null),_e(i,Se(Ct,{get when(){return!r()},get children(){var c10=sit(),d=c10.firstChild;return _e(d,Se(In,{get each(){return t()},children:function(u){return function(){var p=cit(),m=p.firstChild,h=m.nextSibling;return _e(h,function(){return u.content}),yt(function(g){var x="ns-v5sg90 ".concat(dit(u.status)),v=["ns-3lt9e4",u.status==="cancelled"?"ns-o3ixch":"ns-kmbhfq"].join(" ");return x!==g.e&&tn(m,g.e=x),v!==g.t&&tn(h,g.t=v),g},{e:void 0,t:void 0}),p}()}})),c10}}),null),yt(function(c){var d=n().label,u=n().label,p="ns-tiwzfw ".concat(n().iconClass);return d!==c.e&&Dt(a,"title",c.e=d),u!==c.t&&Dt(a,"aria-label",c.t=u),p!==c.a&&tn(s,c.a=p),c},{e:void 0,t:void 0,a:void 0}),i}()}var pit=je('<span class="ns-5tnh3d">(<!>)'),fit=je("<span>Image (<!>)"),mit=je('<div class="ns-nlctve"aria-label="Loading image preview"role=status>'),hit=je('<div class="ns-h4o4zj">Image preview unavailable.'),git=je('<img class="ns-s6igd2">'),xit=je('<button type=button class="ns-tnipgx"><span class="ns-9jf9al">'),yit=je('<span class="ns-5tnh3d"> \xb7 '),vit=je("<span>");function _it(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object"||Array.isArray(e))return;var t=e.taskId;return typeof t=="string"?t:void 0}function Mme(e){var t=function(){var r=e.block.toolCall;if(r.toolName!=="view_image"||r.state!=="output-available")return;var n=r.output;if(!n||(typeof n==="undefined"?"undefined":_type_of(n))!="object"||Array.isArray(n))return;var i=n.path,o=n.mediaType;return typeof i=="string"&&typeof o=="string"?{path:i,mediaType:o}:void 0};return Se(Vg,{get fallback(){return Se(kit,{get block(){return e.block},get now(){return e.now},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown}})},get children(){return[Se(nl,{get when(){return Qn(function(){return e.block.toolCall.toolName==="todowrite"})()&&e.block.todos},get children(){return Se(Rme,{get block(){return e.block},get now(){return e.now}})}}),Se(nl,{get when(){return t()},children:function(r){return Se(bit,{get path(){return r().path},get mediaType(){return r().mediaType},get onResolveDataUrl(){return e.onResolveResourceDataUrl},get visual(){return b0(e.block.toolCall)}})}}),Se(nl,{get when(){return e.block.toolCall.toolName==="task"},get children(){return Se(wit,{get block(){return e.block},get now(){return e.now},get getSubagent(){return e.getSubagent},get onOpenSubagent(){return e.onOpenSubagent},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown}})}}),Se(nl,{get when(){return e.block.toolCall.toolName==="bash"||e.block.toolCall.toolName==="apply_patch"},get children(){return Se(Sit,{get block(){return e.block},get now(){return e.now},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown}})}})]}})}function bit(e){var _Yt=_sliced_to_array(Yt(),2),t=_Yt[0],r=_Yt[1],_Yt1=_sliced_to_array(Yt(!1),2),n=_Yt1[0],i=_Yt1[1],_Yt2=_sliced_to_array(Yt(),2),o=_Yt2[0],a=_Yt2[1],_Yt3=_sliced_to_array(Yt(!1),2),s=_Yt3[0],l=_Yt3[1],_Yt4=_sliced_to_array(Yt(!1),2),c=_Yt4[0],d=_Yt4[1];function u(){return _async_to_generator(function(){var m;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(!c()&&(d(!0),!!e.onResolveDataUrl)))return[3,5];l(!0);_state.label=1;case 1:_state.trys.push([1,3,4,5]);return[4,e.onResolveDataUrl(e.path,e.mediaType)];case 2:a.apply(void 0,[_state.sent()]);return[3,5];case 3:m=_state.sent();a(void 0);return[3,5];case 4:l(!1);return[7];case 5:return[2]}})})()}function p(m){i(m),m&&u()}return Se(_0,{get title(){return function(){var m=fit(),h=m.firstChild,g=h.nextSibling,x=g.nextSibling;return _e(m,function(){return e.path},g),_e(m,Se(Ct,{get when(){return t()},get children(){var v=pit(),y=v.firstChild,_=y.nextSibling,b=_.nextSibling;return _e(v,t,_),v}}),null),m}()},get iconClass(){return e.visual.iconClass},get iconLabel(){return e.visual.label},get open(){return n()},onOpenChange:p,get children(){return Se(Ct,{get when(){return o()},get fallback(){return Se(Ct,{get when(){return s()},get fallback(){return hit()},get children(){return mit()}})},children:function(m){return function(){var h=git();return h.addEventListener("load",function(g){var x=g.currentTarget;r("".concat(x.naturalWidth,"x").concat(x.naturalHeight))}),yt(function(g){var x=m(),v=e.path;return x!==g.e&&Dt(h,"src",g.e=x),v!==g.t&&Dt(h,"alt",g.t=v),g},{e:void 0,t:void 0}),h}()}})}})}function $j(e){return[Se(_0,{get title(){return e.title},get iconClass(){return e.iconClass},get iconLabel(){return e.iconLabel},get headerActions(){return e.headerActions},get children(){return Se(K2,{get markdown(){return qC(e.params,e.result)},get renderMarkdown(){return e.renderMarkdown},compact:!0,details:!0})}}),Se(Pme,{get changes(){return e.fileChanges},get onOpenFile(){return e.onOpenFileChange}})]}function wit(e){var t=function(){return e.block.toolCall},r=function(){return t().state==="output-available"?_it(t().output):void 0},n=function(){var l;var s=(l=t().input)==null?void 0:l.subagent_type;return typeof s=="string"?s:"unknown"},i=function(){var l;var s=r();return s?(l=e.getSubagent)==null?void 0:l.call(e,s):void 0},o=function(){var s=i();return s?Cit(s.status):b0(t())},a=function(){var c,d;var s=i();if(!s)return Q2(e.block.timing,e.now);var l=s.status==="queued"?s.createdAt:(c=s.startedAt)!=null?c:s.createdAt;return Hg(((d=s.finishedAt)!=null?d:e.now)-l)};return Se($j,{get title(){return Se(Nj,{get title(){return"task \xb7 ".concat(n())},get duration(){return a()}})},get iconClass(){return o().iconClass},get iconLabel(){return o().label},get params(){return t().input},get result(){return Sy(t())},get fileChanges(){return e.block.fileChanges},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown},get headerActions(){return function(){var s=xit();return s.$$click=function(l){var d;l.stopPropagation(),l.preventDefault();var c=r();c&&((d=e.onOpenSubagent)==null||d.call(e,c))},yt(function(l){var c=!r(),d=Te("chatbox.ui.dialogs.subagentTimeline.title"),u=Te("chatbox.ui.dialogs.subagentTimeline.title");return c!==l.e&&(s.disabled=l.e=c),d!==l.t&&Dt(s,"title",l.t=d),u!==l.a&&Dt(s,"aria-label",l.a=u),l},{e:void 0,t:void 0,a:void 0}),s}()}})}function Sit(e){var t=function(){return b0(e.block.toolCall)},r=function(){return MN(e.block.toolCall)!==void 0};return Se($j,{get title(){return Se(Nj,{get title(){return ON(e.block.toolCall)},get duration(){return Q2(e.block.timing,e.now)}})},get iconClass(){return t().iconClass},get iconLabel(){return t().label},get params(){return Qn(function(){return!!r()})()?void 0:e.block.toolCall.input},get result(){return Sy(e.block.toolCall)},get fileChanges(){return e.block.fileChanges},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown}})}function kit(e){var t=function(){return b0(e.block.toolCall)};return Se($j,{get title(){return Se(Nj,{get title(){return ON(e.block.toolCall)},get duration(){return Q2(e.block.timing,e.now)}})},get iconClass(){return t().iconClass},get iconLabel(){return t().label},get params(){return e.block.toolCall.input},get result(){return Sy(e.block.toolCall)},get fileChanges(){return e.block.fileChanges},get onOpenFileChange(){return e.onOpenFileChange},get renderMarkdown(){return e.renderMarkdown}})}function Nj(e){return function(){var t=vit();return _e(t,function(){return e.title},null),_e(t,Se(Ct,{get when(){return e.duration},get children(){var r=yit(),n=r.firstChild;return _e(r,function(){return e.duration},null),r}}),null),t}()}function Cit(e){switch(e){case"queued":return WT(Te("chatbox.ui.states.taskQueued"),"ns-hldi2o");case"running":return BT();case"idle":return WT(Te("chatbox.ui.states.taskWaiting"),"ns-vnk9kc");case"completed":return hj();case"failed":return gj();case"cancelled":return qT(Te("chatbox.ui.states.cancelled"))}}Kr(["click"]);var Eit=je('<div class="ns-84isv3"><div class="ns-11y3ky"><span aria-hidden=true></span><span></span></div><span>'),Tit=je('<div class="ns-6g4h0b">'),Ait=je('<button class="ns-44nj4x"type=button><span class="ns-ykhriv"aria-hidden=true>'),Iit=je('<button class="ns-s6v73g"type=button><span class="ns-s6iwrj"aria-hidden=true>'),Pit=je('<button class="ns-s6v73g"type=button><span class="ns-byyn4m"aria-hidden=true>'),Rit=je('<div class="ns-93a7im">'),Mit=je('<div class="ns-musgft"><div class="ns-s3r24k">'),Oit=je('<div><div class="ns-drtgip">');function $it(e){return e.parts.filter(function(t){return t.type==="text"}).map(function(t){return t.text}).join("\n").trim()}function Nit(e){var t=e.todos;if(e.toolCall.toolName==="todowrite"&&t){var r=["".concat(Te("chatbox.ui.labels.todoList"),":"),""];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.status==="completed"?"x":n.status==="cancelled"?"-":" ";r.push("- [".concat(i,"] ").concat(n.content))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.length===0&&r.push("- ".concat(Te("chatbox.ui.states.todoEmpty"))),r.join("\n")}return["".concat(Te("chatbox.ui.labels.toolCall"),": ").concat(e.toolCall.toolName),"",qC(e.toolCall.input,Sy(e.toolCall))].join("\n")}function Dit(e){return"".concat(Te("chatbox.ui.labels.systemNotification"),":\n\n").concat(WC(e.notification))}function Lit(e){var t=function(){return e.block.kind==="content"?e.block:void 0},r=function(){return e.block.kind==="reasoning"?e.block:void 0},n=function(){return e.block.kind==="tool-call"?e.block:void 0},i=function(){return e.block.kind==="system-notification"?e.block:void 0};return Se(Vg,{get children(){return[Se(nl,{get when(){return t()},children:function(o){return Se(rme,{get block(){return o()},get renderMarkdown(){return e.renderMarkdown},get streaming(){return e.streaming}})}}),Se(nl,{get when(){return r()},children:function(o){return Se(ime,{get part(){return o().part}})}}),Se(nl,{get when(){return n()},children:function(o){return Se(Mme,{get block(){return o()},get now(){return e.now},get getSubagent(){return e.getSubagent},get onOpenSubagent(){return e.onOpenSubagent},get onOpenFileChange(){return e.onOpenFileChange},get onResolveResourceDataUrl(){return e.onResolveResourceDataUrl},get renderMarkdown(){return e.renderMarkdown}})}}),Se(nl,{get when(){return i()},children:function(o){return Se(ome,{get block(){return o()},get renderMarkdown(){return e.renderMarkdown}})}})]}})}function QT(e){var t=function(){var a,s,l,c,d,u,p,m,h;return kie((l=(s=(a=e.item.message.metadata)==null?void 0:a.llm)==null?void 0:s.usage)==null?void 0:l.inputTokens,(u=(d=(c=e.item.message.metadata)==null?void 0:c.llm)==null?void 0:d.usage)==null?void 0:u.outputTokens,(h=(m=(p=e.item.message.metadata)==null?void 0:p.llm)==null?void 0:m.usage)==null?void 0:h.totalTokens)},r=function(){return e.item.displayBlocks.length>0&&e.item.displayBlocks.every(function(a){return a.kind==="system-notification"})},n=function(){var a,s;return e.item.message.role==="assistant"?((s=(a=e.item.message.metadata)==null?void 0:a.llm)==null?void 0:s.modelName)||"Assistant":e.item.message.role==="user"?"User":"Tool"},i=function(){if(e.item.message.role==="assistant")return"ns-7wjzuj";if(e.item.message.role==="user")return"ns-fggf6b"},o=function(){return e.item.displayBlocks.map(function(a){return a.kind==="content"?$it(a):a.kind==="tool-call"?Nit(a):a.kind==="system-notification"?Dit(a):""}).filter(Boolean).join("\n\n")};return function(){var a=Oit(),s=a.firstChild;return _e(a,Se(Ct,{get when(){return Qn(function(){return!!e.item.showHeader})()&&!r()},get children(){var l=Eit(),c=l.firstChild,d=c.firstChild,u=d.nextSibling,p=c.nextSibling;return _e(u,n),_e(p,function(){return BC(e.item.createdAt)}),yt(function(){return tn(d,"ns-tswl4v ".concat(i()))}),l}}),s),_e(s,Se(In,{get each(){return e.item.displayBlocks},children:function(l){return Se(Lit,{block:l,get now(){return e.now},get renderMarkdown(){return e.renderMarkdown},get streaming(){return e.streaming},get getSubagent(){return e.getSubagent},get onOpenSubagent(){return e.onOpenSubagent},get onOpenFileChange(){return e.onOpenFileChange},get onResolveResourceDataUrl(){return e.onResolveResourceDataUrl}})}})),_e(a,Se(Ct,{get when(){return Qn(function(){return e.item.message.role==="user"})()&&e.item.message.parts.some(function(l){return l.type==="data-user-context"})},get children(){var l10=Tit();return _e(l10,Se(Gg,{get items(){return e.item.message.parts.flatMap(function(c){return c.type==="data-user-context"?c.data.items:[]})}})),l10}}),null),_e(a,Se(Ct,{get when(){return Qn(function(){return!r()})()&&(e.item.message.role==="assistant"||e.item.message.role==="user")},get children(){var l11=Mit(),c10=l11.firstChild;return _e(c10,Se(nme,{getText:o}),null),_e(c10,Se(Ct,{get when(){return e.onDeleteMessage},get children(){var d10=Ait();return d10.$$click=function(){var u;return(u=e.onDeleteMessage)==null?void 0:u.call(e,e.item.message.id)},yt(function(){return Dt(d10,"title",Te("chatbox.ui.actions.deleteMessage"))}),d10}}),null),_e(c10,Se(Ct,{get when(){return Qn(function(){return e.item.message.role==="user"})()&&e.onRecallMessage},get children(){var d11=Iit();return d11.$$click=function(){var u;(u=e.onRecallMessage)==null||u.call(e,e.item.message.id)},yt(function(){return Dt(d11,"title",Te("chatbox.ui.actions.recallMessage"))}),d11}}),null),_e(c10,Se(Ct,{get when(){return Qn(function(){return e.item.message.role==="assistant"})()&&e.onRegenerateMessage},get children(){var d12=Pit();return d12.$$click=function(){var u;return(u=e.onRegenerateMessage)==null?void 0:u.call(e,e.item.message.id)},yt(function(){return Dt(d12,"title",Te("chatbox.ui.actions.regenerateMessage"))}),d12}}),null),_e(l11,Se(Ct,{get when(){return Qn(function(){return e.item.message.role==="assistant"})()&&t()},get children(){var d13=Rit();return _e(d13,t),d13}}),null),l11}}),null),yt(function(){var l;return tn(a,((l=e.item.message.metadata)==null?void 0:l.status)==="error"?"ns-c4k5dt":void 0)}),a}()}Kr(["click"]);var Fit=je('<div><div class="ns-qh7xmq"><div class="ns-brd5lx"><div class="ns-yxsdt0"> / </div><button class="ns-c1sspd"type=button></button></div><div class="ns-svpl49"></div><select class="ns-yt5d6y"><option value></option></select><div class="ns-svpl49"></div><select class="ns-yt5d6y"><option value>'),Ome=je("<option>");function $me(e){var t=function(){return e.providers.find(function(r){return r.id===e.selectedProviderId})};return Se(Ld,{get mount(){return e.mountEl},get children(){var r=Fit(),n=r.firstChild,i=n.firstChild,o=i.firstChild,a=o.firstChild,s=o.nextSibling,l=i.nextSibling,c=l.nextSibling,d=c.firstChild,u=c.nextSibling,p=u.nextSibling,m=p.firstChild;return r.$$pointerdown=function(h){h.target===h.currentTarget&&e.onClose()},_e(o,function(){return Te("chatbox.ui.labels.provider")},a),_e(o,function(){return Te("chatbox.ui.labels.model")},null),s.$$click=function(){return e.onClose()},_e(s,function(){return Te("chatbox.ui.actions.close")}),_e(l,function(){return Te("chatbox.ui.labels.provider")}),c.addEventListener("change",function(h){return e.onSelectProvider(h.currentTarget.value)}),_e(d,function(){return Te("chatbox.ui.states.noProvider")}),_e(c,Se(In,{get each(){return e.providers},children:function(h){return function(){var g=Ome();return _e(g,function(){return h.name}),yt(function(){return g.value=h.id}),g}()}}),null),_e(u,function(){return Te("chatbox.ui.labels.model")}),p.addEventListener("change",function(h){e.onSelectModel(h.currentTarget.value),e.onClose()}),_e(m,function(){return Te("chatbox.ui.states.noModel")}),_e(p,Se(In,{get each(){var h;return((h=t())==null?void 0:h.models)||[]},children:function(h){return function(){var g=Ome();return _e(g,function(){return h.name}),yt(function(){return g.value=h.id}),g}()}}),null),yt(function(h){var v;var g=["ns-g81v24",e.contained?"ns-3u29x8":"ns-dxjyt5"].join(" "),x=!((v=t())!=null&&v.models.length);return g!==h.e&&tn(r,h.e=g),x!==h.t&&(p.disabled=h.t=x),h},{e:void 0,t:void 0}),yt(function(){return c.value=e.selectedProviderId||""}),yt(function(){return p.value=e.selectedModelId||""}),r}})}Kr(["pointerdown","click"]);var zit=je('<div class="ns-3grsf5 chatbox-resizer"role=separator aria-orientation=horizontal><div class=chatbox-resizer-line>');function Nme(e){var _Yt=_sliced_to_array(Yt(!1),2),t=_Yt[0],r=_Yt[1],n=0,i,o;function a(){o==null||o(),o=void 0,r(!1),i==null||i.body.classList.remove("chatbox-resize-active"),i=void 0}function s(l){var h,g,x;if(l.button!==0)return;l.preventDefault(),a(),(h=e.onResizeStart)==null||h.call(e);var c=e.onResize,d=e.onResizeEnd,u=(x=(g=l.currentTarget)==null?void 0:g.ownerDocument)!=null?x:document;i=u,n=l.clientY,r(!0),u.body.classList.add("chatbox-resize-active");var p=function(v){c(n-v.clientY)},m=function(){d==null||d(),a()};u.addEventListener("pointermove",p),u.addEventListener("pointerup",m),u.addEventListener("pointercancel",m),o=function(){u.removeEventListener("pointermove",p),u.removeEventListener("pointerup",m),u.removeEventListener("pointercancel",m)}}return po(function(){return a()}),function(){var l=zit();return l.$$dblclick=function(){var c;return(c=e.onDblClick)==null?void 0:c.call(e)},l.$$pointerdown=s,yt(function(){return l.classList.toggle("is-resizing",!!t())}),l}()}Kr(["pointerdown","dblclick"]);var jit=je('<div class="ns-qrv371"><div class="ns-meooh5"></div><div class="ns-ypxrbp">'),Uit=je("<div>"),Bit=je('<div class="ns-c969nw">');function Dme(e){return Se(Ct,{get when(){return e.pending.length>0},get children(){var t=jit(),r=t.firstChild,n=r.nextSibling;return _e(r,function(){return Te("chatbox.ui.labels.queuedSubmissions")}),_e(n,Se(In,{get each(){return e.pending},children:function(i){return function(){var o=Bit();return _e(o,Se(Ct,{get when(){return i.userContext.length>0},get children(){return Se(Gg,{get items(){return i.userContext}})}}),null),_e(o,Se(Ct,{get when(){return i.text.trim().length>0},get children(){var a=Uit();return _e(a,function(){return i.text}),a}}),null),o}()}})),t}})}var qit=je('<button class="ns-9y0ynp"type=button>'),Wit=je('<div class="ns-ugpi7x"><div class="ns-da6ymq"><div class="ns-hcrmdh"><svg class="ns-o2vtej"viewBox="0 0 24 24"fill=none aria-hidden=true><circle cx=12 cy=12 r=9 stroke=currentColor stroke-width=3 stroke-linecap=round stroke-dasharray="42 16"></circle></svg><div class="ns-iazz9d">');function Lme(e){var t=function(){return Eie(e.runState)},r=function(){return e.runState==="thinking"||e.runState==="waiting_for_tools"};return Se(Ct,{get when(){return t()},get children(){var n=Wit(),i=n.firstChild,o=i.firstChild,a=o.firstChild,s=a.nextSibling;return _e(s,t),_e(i,Se(Ct,{get when(){return Qn(function(){return!!r()})()&&e.onStop},get children(){var l=qit();return l.$$click=function(){var c;return(c=e.onStop)==null?void 0:c.call(e)},_e(l,function(){return Te("chatbox.ui.actions.stopRun")}),l}}),null),n}})}Kr(["click"]);var Fme=require("obsidian");var Vit=je('<div class="ns-l217rp">'),Git=je('<span class="ns-948ahm">\xb7 '),Hit=je('<div role=button tabindex=0><div class="ns-dtgo1q"><div class="ns-cy25at"><div class="ns-gpmt5n"></div><div class="ns-0pmd2y"></div></div><div class="ns-9y0ynp"><div class="ns-1k8tso">');function zme(e){var t=function(){return e.onSelect(e.session.id)};return function(){var r=Hit(),n=r.firstChild,i=n.firstChild,o=i.firstChild,a=o.nextSibling,s=i.nextSibling,l=s.firstChild;return r.$$keydown=function(c){(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),t())},r.$$click=t,_e(r,Se(Ct,{get when(){return e.isActive},get children(){return Vit()}}),n),_e(o,function(){return e.session.title}),_e(a,function(){return BC(e.session.createdAt)},null),_e(a,Se(Ct,{get when(){return e.isRunning},get children(){var c=Git(),d=c.firstChild;return _e(c,function(){return Te("chatbox.ui.history.sessionRunning")},null),c}}),null),l.$$click=function(c){c.preventDefault(),c.stopPropagation();var d=e.session.id,u=e.onExport,p=e.onDelete,m=new Fme.Menu;m.addItem(function(h){return h.setTitle(Te("chatbox.ui.actions.exportAsMarkdown")).setIcon("download").onClick(function(){return u(d)})}),m.addItem(function(h){h.setTitle(Te("chatbox.ui.actions.deleteSession")).setIcon("trash").setWarning(!0).onClick(function(){return p(d)})}),m.showAtMouseEvent(c)},yt(function(c){var d=["ns-dvl1qg group",e.isActive?"ns-t7x7wu":"ns-q92eyf"].join(" "),u=Te("chatbox.ui.history.sessionActions");return d!==c.e&&tn(r,c.e=d),u!==c.t&&Dt(l,"aria-label",c.t=u),c},{e:void 0,t:void 0}),r}()}Kr(["click","keydown"]);var Zit=je("<div>"),Kit=je('<div><div class="ns-t0xfgz"><div class="ns-6bctfi"></div></div><div class="ns-sfpc8e"><div class="ns-yn86eh"></div><button type=button></button></div><div class="ns-kny5ae"><div class="ns-drtgip">');function jme(e){var t=function(){return new Set(_to_consumable_array(e.activeSessionId&&e.activeSessionIsRunning?[e.activeSessionId]:[]).concat(_to_consumable_array(e.otherBusySessionIds)))};return Se(Ld,{get mount(){return e.mountEl},get children(){return[function(){var r=Zit();return r.$$pointerdown=function(){return e.onClose()},yt(function(){return tn(r,["ns-x4b0ih",e.contained?"ns-3u29x8":"ns-dxjyt5",e.open?"ns-h6cmdc":"ns-31l5o1"].join(" "))}),r}(),function(){var r=Kit(),n=r.firstChild,i=n.nextSibling,o=i.firstChild,a=o.nextSibling,s=i.nextSibling,l=s.firstChild;return _e(o,function(){return Te("chatbox.ui.history.title")}),a.$$click=function(){e.onNewSession(),e.onClose()},_e(a,function(){return Te("chatbox.newChat")}),_e(l,Se(In,{get each(){return e.sessions},children:function(c){return Se(zme,{session:c,get isActive(){return c.id===e.activeSessionId},get isRunning(){return t().has(c.id)},onSelect:function(d){e.onSwitchSession(d),e.onClose()},onExport:function(d){e.onExportSession(d),e.onClose()},onDelete:function(d){e.onDelete(d),e.onClose()}})}})),yt(function(c){var d=["ns-vif635",e.contained?"ns-3u29x8":"ns-dxjyt5",e.open?"ns-n92s1a":"ns-pil9c3"].join(" "),u=e.open?void 0:{transform:"translateY(100%)"};return d!==c.e&&tn(r,c.e=d),c.t=FC(r,u,c.t),c},{e:void 0,t:void 0}),r}()]}})}Kr(["pointerdown","click"]);var Qit=je('<div class="ns-32qch5">'),Jit=je('<div><div class="ns-1a9t14"><div class="ns-rdpwxy"><div class="ns-vj6zo6"><div class="ns-qdqq5i"> \xb7 </div><div class="ns-83x5yn"> \xb7 </div></div><button type=button></button></div><div class="ns-5vw4gn"><div class="ns-dcbm2s">');function Ume(e){return Se(Ct,{get when(){return e.agent},children:function(t){return Se(Ld,{get mount(){return e.mountEl},get children(){var r=Jit(),n=r.firstChild,i=n.firstChild,o=i.firstChild,a=o.firstChild,s=a.firstChild,l=a.nextSibling,c=l.firstChild,d=o.nextSibling,u=i.nextSibling,p=u.firstChild;return r.$$pointerdown=function(m){m.target===m.currentTarget&&e.onClose()},_e(a,function(){return Te("chatbox.ui.dialogs.subagentTimeline.title")},s),_e(a,function(){return t().type},null),_e(l,function(){return t().id},c),_e(l,function(){return t().status},null),tie(d,"click",e.onClose,!0),_e(d,function(){return Te("chatbox.ui.actions.close")}),_e(p,Se(In,{get each(){return t().timeline},children:function(m){return Se(QT,{item:m,get now(){return e.now},get renderMarkdown(){return e.renderMarkdown},get getSubagent(){return e.getSubagent},get onOpenSubagent(){return e.onSelectAgent},get onOpenFileChange(){return e.onOpenFileChange}})}}),null),_e(p,Se(Ct,{get when(){return t().timeline.length===0},get children(){var m=Qit();return _e(m,function(){return Te("chatbox.ui.states.noSubagentMessages")}),m}}),null),yt(function(){return tn(r,["ns-g81v24",e.contained?"ns-3u29x8":"ns-dxjyt5"].join(" "))}),r}})}})}Kr(["pointerdown","click"]);function Yit(e){var t=e.trim();for(var r=0;r<3;r+=1)try{var n=decodeURIComponent(t);if(n===t)break;t=n}catch(n){break}return t}function Dj(e){var i,o;return((o=(i=Yit(e).replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0])==null?void 0:i.trim())!=null?o:"").replace(/^\/+/,"").replace(/\/+$/,"").trim()||null}function Lj(e,t){if(typeof e=="string"){var n=Dj(e);n&&t.add(n);return}if(Array.isArray(e)){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n10=_step.value;Lj(n10,t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return}if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return;var r=e;for(var _i1=0,_iter=["path","file","files"];_i1<_iter.length;_i1++){var n11=_iter[_i1];n11 in r&&Lj(r[n11],t)}}function Xit(e,t){var r=e.trim();if(r){if(r.startsWith("{")||r.startsWith("["))try{Lj(JSON.parse(r),t);return}catch(n){}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.split(/\r?\n/)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.trim();if(!i||i.startsWith("#")||i.startsWith("http"))continue;if(i.startsWith("obsidian://open?"))try{var s=new URL(i).searchParams.get("file");if(s){var l=Dj(s);l&&t.add(l)}continue}catch(a){}var o=Dj(i);o&&t.add(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}function eot(e){var n;var t=new Set,r=e.dataTransfer;if(!r)return[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Array.from(r.types)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i!=="Files"&&Xit((n=r.getData(i))!=null?n:"",t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Array.from(t)}function Bme(e){var n,i;var t=eot(e);if(t.length>0)return{paths:t,files:[]};var r=Array.from((i=(n=e.dataTransfer)==null?void 0:n.files)!=null?i:[]);return{paths:[],files:r}}function A6(e){var r;var t=(r=e.dataTransfer)==null?void 0:r.items;if(!t)return!1;for(var n=0;n<t.length;n+=1){var i=t[n];if(i.kind==="file"||i.kind==="string")return!0}return!1}var rot=je('<div class="ns-kvkwd1 chatbox-file-drop-overlay"><div class="ns-hgnuji">'),not=je('<button class="ns-ozfcnm"type=button><span class="ns-ek9jj6">'),iot=je('<div class="ns-dhtutq">'),oot=je('<div><input type=file accept=image/*,.txt,.md,.markdown class="ns-eakdl5"><div class="ns-9o4iwl"><div class="ns-x5325f"><button class="ns-v948r7"type=button><span class="ns-pgfesy"></span></button><div class="ns-opn5x8"></div></div><div class="ns-8ojbwc"><div class="ns-ayyg78"></div><div class="ns-5bqrm0 chatbox-input-pane chatbox-input-pane--resizable"><div class=chatbox-context-header></div><textarea class="ns-khiab4 chatbox-input"></textarea><div class="ns-ucebuu"><div class="ns-dvqxvb"><button class="ns-pte5qj"type=button><span class="ns-4gohxq"></span></button><button class="ns-pte5qj"type=button><span class="ns-byavil"></span></button><button class="ns-8rpyvu"type=button><span class="ns-0az6jr"></span></button></div><button class="ns-c37hfb mod-cta"type=button>'),aot=je('<button class="ns-esto1v"type=button><div class="ns-idm853">'),sot=je('<div class="ns-7vlxxz">'),qme="nutstore-sync.chatbox.input-height",lot="nutstore-sync.chatbox.desktop-input-height",Wme=184,uot=144,cot=128,dot=104,pot=72,fot=64,mot=200,hot=120,got=10,xot=.6,yot=.45,Vme=768,Gme=640;var vot=new Set(["txt","md","markdown"]);function _ot(e){var r;return((r=e.split(".").pop())==null?void 0:r.trim().toLowerCase())||""}function bot(e){var t=_ot(e.name);if(vot.has(t))return!0;var r=e.type.toLowerCase();return r==="text/plain"||r==="text/markdown"}function wot(e){return e.type.startsWith("image/")||bot(e)}function Sot(e){var _Yt=_sliced_to_array(Yt(""),2),t=_Yt[0],r=_Yt[1],_Yt1=_sliced_to_array(Yt(!1),2),n=_Yt1[0],i=_Yt1[1],_Yt2=_sliced_to_array(Yt(!1),2),o=_Yt2[0],a=_Yt2[1],_Yt3=_sliced_to_array(Yt(),2),s=_Yt3[0],l=_Yt3[1],_Yt4=_sliced_to_array(Yt(!1),2),c=_Yt4[0],d=_Yt4[1],_Yt5=_sliced_to_array(Yt(),2),u=_Yt5[0],p=_Yt5[1],_Yt6=_sliced_to_array(Yt(),2),m=_Yt6[0],h=_Yt6[1],_Yt7=_sliced_to_array(Yt(),2),g=_Yt7[0],x=_Yt7[1],_Yt8=_sliced_to_array(Yt(),2),v=_Yt8[0],y=_Yt8[1],_Yt9=_sliced_to_array(Yt(!1),2),_=_Yt9[0],b=_Yt9[1],_Yt10=_sliced_to_array(Yt(),2),w=_Yt10[0],S=_Yt10[1],_Yt11=_sliced_to_array(Yt(0),2),k=_Yt11[0],E=_Yt11[1],_Yt12=_sliced_to_array(Yt(),2),C=_Yt12[0],T=_Yt12[1],_Yt13=_sliced_to_array(Yt(!0),2),I=_Yt13[0],O=_Yt13[1],_Yt14=_sliced_to_array(Yt(!1),2),M=_Yt14[0],R=_Yt14[1],_Yt15=_sliced_to_array(Yt(Date.now()),2),$=_Yt15[0],z=_Yt15[1],D,L,ee,pe,N,U,G,K=Wme,me=0;ki(function(){if(!(Object.values(e.agentsById).some(function(Jt){return Jt.status==="queued"||Jt.status==="running"||Jt.status==="idle"})||e.timeline.some(function(Jt){return Jt.displayBlocks.some(function(bi){return bi.kind==="tool-call"&&!!bi.timing&&bi.timing.finishedAt===void 0})})))return;var De=ie();z(Date.now());var at=De.setInterval(function(){return z(Date.now())},1e3);po(function(){return De.clearInterval(at)})});function V(){var ue,De,at;return(at=(De=(ue=ee==null?void 0:ee.ownerDocument)!=null?ue:pe==null?void 0:pe.ownerDocument)!=null?De:L==null?void 0:L.ownerDocument)!=null?at:document}function ie(){var ue;return(ue=V().defaultView)!=null?ue:window}function re(){var ue=k()||(D==null?void 0:D.clientWidth)||0;return ue>0?ue<=Vme:ie().innerWidth<=Vme}function de(){var ue=k()||(D==null?void 0:D.clientWidth)||0;return ue>0?ue<Gme:ie().innerWidth<Gme}function xe(){return re()?uot:Wme}function Y(){return re()?dot:cot}function oe(){return re()?fot:pot}function H(){return re()?hot:mot}function J(){return re()?yot:xot}function j(){var ue=V().activeElement;_instanceof(ue,HTMLElement)&&ue.blur(),U==null||U.blur()}function Q(){j(),ie().requestAnimationFrame(function(){b(!0)})}var Fe=function(){return e.runState!=="idle"},it=Bn(function(){var ue;if(Fe())for(var De=e.timeline.length-1;De>=0;De-=1){var at=(ue=e.timeline[De])==null?void 0:ue.message;if((at==null?void 0:at.role)==="assistant")return at.id}}),pt=function(){return jC(e.usage)},nt=function(){var ue=e.contextWindow;if(!ue||ue<=0)return 0;var De=pt();return De<=0?0:Math.min(1,Math.max(0,De/ue))},gt=function(){var ue=e.contextWindow;if(!ue)return;var De=Math.round(nt()*100),at=pt();return Te("chatbox.ui.tooltips.contextUsage",{used:De,total:ue,usedTokens:at})};function Ie(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:48;return L?L.scrollHeight-L.scrollTop-L.clientHeight<=ue:!0}var we=function(){var ue=e.timeline.at(-1);if(!ue)return"empty";var De=ue.message.parts.filter(function(Jt){return Jt.type==="text"}).reduce(function(Jt,bi){return Jt+bi.text.length},0),at=ue.displayBlocks.map(function(Jt){return Jt.kind==="content"?"c:".concat(Jt.parts.length):Jt.kind==="reasoning"?"r:".concat(Jt.part.text.length):Jt.kind==="tool-call"?"tc:".concat(Jt.toolCall.toolCallId,":").concat(Jt.toolCall.state):"sn:".concat(JSON.stringify(Jt.notification))}).join("|");return"".concat(ue.message.id,":").concat(De,":").concat(at,":").concat(ue.message.role)},Oe=function(){return e.providers.find(function(ue){return ue.id===e.selectedProviderId})},Pe=function(){var De,at;var ue=k()>=486&&!!D;return{mountEl:ue?D:(at=(De=D==null?void 0:D.ownerDocument)==null?void 0:De.body)!=null?at:V().body,contained:ue,hostEl:D}},tt=function(){var ue=s();return ue?e.agentsById[ue]:void 0},We=function(){var ue=Oe(),De=ue==null?void 0:ue.models.find(function(at){return at.id===e.selectedModelId});return[ue==null?void 0:ue.name,De==null?void 0:De.name].filter(Boolean).join("/")||Te("chatbox.ui.states.noModel")};function Ut(){try{var ue=ie().localStorage.getItem(qme);if(ue){var Jt=Number(ue);return Number.isFinite(Jt)?Jt:void 0}var De=ie().localStorage.getItem(lot);if(!De)return;var at=Number(De);return Number.isFinite(at)?at:void 0}catch(ue){return}}function Rt(ue){try{ie().localStorage.setItem(qme,String(Math.round(ue)))}catch(De){}}function Ve(){if(!pe||!U)return 0;var ue=pe.getBoundingClientRect().height,De=U.getBoundingClientRect().height;return Math.max(0,Math.round(ue-De))}function Tr(){var bi;var ue=Math.floor(ie().innerHeight*J()),De=(bi=ee==null?void 0:ee.getBoundingClientRect().height)!=null?bi:0;if(De<=0)return Math.max(Y(),ue);var at=Math.floor(De-H()-got),Jt=Math.min(at,ue);return Math.max(oe(),Jt)}function yn(ue){var De=Tr(),at=Math.min(Y(),De);return Math.round(Math.min(Math.max(ue,at),De))}function Di(ue){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var at=yn(ue);return T(at),De&&Rt(at),at}function Rn(){var ue=C();if(typeof ue!="number")return;var De=Ve();return"".concat(Math.max(oe(),ue-De),"px")}function Uo(){Di(K,!0)}function Ea(){var ue;me=(ue=C())!=null?ue:yn(K)}function Nn(ue){Di(me+ue)}function Ar(){var ue=C();typeof ue=="number"&&Rt(ue)}function q(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"smooth";ie().requestAnimationFrame(function(){L&&(L.scrollTo({top:L.scrollHeight,behavior:ue}),O(!0))})}function Ee(ue){return _async_to_generator(function(){var De,_$at,at;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!wot(ue)){new Hme.Notice(Te("chatbox.errors.unsupportedAttachmentType",{name:ue.name}));return[2]}if(!ue.type.startsWith("image/"))return[3,5];De=v7("image",ue.name);e.onAddUserContext(De);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,y7(ue,{mimeType:ue.type||"image/png",name:ue.name,size:ue.size})];case 2:_$at=_state.sent();e.onResolvePendingContextItem(De.id,_$at);return[3,4];case 3:at=_state.sent();throw e.onResolvePendingContextItem(De.id,null),at;case 4:return[2];case 5:e.onAddUserContext(WJ(ue,{mimeType:ue.type||"text/plain",filename:ue.name,size:ue.size}));return[2]}})})()}function Mt(ue){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all(ue.map(function(De){return Ee(De)}))];case 1:_state.sent();return[2]}})})()}function xr(){N==null||N.click()}function Yr(){R(!1)}function Bo(ue){A6(ue)&&(ue.preventDefault(),R(!0))}function mu(ue){A6(ue)&&(ue.preventDefault(),ue.dataTransfer&&(ue.dataTransfer.dropEffect="copy"),R(!0))}function xt(ue){if(!A6(ue)||!D)return;var De=D.getBoundingClientRect(),at=ue.clientX,Jt=ue.clientY;at>=De.left&&at<De.right&&Jt>=De.top&&Jt<De.bottom||(ue.preventDefault(),R(!1))}function Xr(ue){return _async_to_generator(function(){var _Bme,De,at,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,Jt,err,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!A6(ue))return[2];ue.preventDefault(),ue.stopPropagation();_Bme=Bme(ue),De=_Bme.paths,at=_Bme.files;if(!(Yr(),De.length>0))return[3,9];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=De[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];Jt=_step.value;return[4,e.onDropContextItem(Jt)];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2];case 9:_tmp=at.length>0;if(!_tmp)return[3,11];return[4,Mt(at)];case 10:_tmp=_state.sent();_state.label=11;case 11:_tmp;return[2]}})})()}qne(function(){var ue;(ue=e.onModalHostChange)==null||ue.call(e,D),po(function(){var De;return(De=e.onModalHostChange)==null?void 0:De.call(e,void 0)})}),ki(MC(function(){return[e.activeSessionId,e.timeline.length,e.pending.length,e.runState]},function(param){var _param=_sliced_to_array(param,1),ue=_param[0];var De=G!==ue?"auto":"smooth",at=G!==ue||I();G=ue==null?void 0:ue.toString(),at&&q(De)})),ki(MC(function(){return[e.activeSessionId,we()]},function(param,De){var _param=_sliced_to_array(param,1),ue=_param[0];var at=De==null?void 0:De[0];ue!==at||!I()||q("auto")})),ki(function(){if(!L)return;var ue=function(){O(Ie())};ue(),L.addEventListener("scroll",ue,{passive:!0}),po(function(){return L==null?void 0:L.removeEventListener("scroll",ue)})}),ki(function(){var ue=s();ue&&!e.agentsById[ue]&&l(void 0)}),ki(MC(function(){return[e.activeSessionId,e.draft.text]},function(){r(e.draft.text)})),ki(function(){var De;if(!U)return;K=Math.round((De=pe==null?void 0:pe.getBoundingClientRect().height)!=null?De:0)||xe();var ue=Ut();Di(ue!=null?ue:K)}),ki(function(){if(!D)return;var ue=new ResizeObserver(function(De){var at=De[0];at&&E(at.contentRect.width)});ue.observe(D),po(function(){return ue.disconnect()})}),ki(function(){if(!D)return;var ue=D,De=function(ko){return Bo(ko)},at=function(ko){return mu(ko)},Jt=function(ko){return xt(ko)},bi=function(ko){Xr(ko)};ue.addEventListener("dragenter",De,!0),ue.addEventListener("dragover",at,!0),ue.addEventListener("dragleave",Jt,!0),ue.addEventListener("drop",bi,!0),po(function(){ue.removeEventListener("dragenter",De,!0),ue.removeEventListener("dragover",at,!0),ue.removeEventListener("dragleave",Jt,!0),ue.removeEventListener("drop",bi,!0)})}),ki(function(){if(!D||!e.onCaptureActiveContext)return;var ue=D,De=function(){var at;return(at=e.onCaptureActiveContext)==null?void 0:at.call(e)};ue.addEventListener("pointerdown",De,!0),po(function(){ue.removeEventListener("pointerdown",De,!0)})}),ki(function(){var ue=ie(),De=function(){var at=C();if(typeof at!="number")return;var Jt=yn(at);Jt!==at&&Di(Jt,!0)};ue.addEventListener("resize",De),po(function(){return ue.removeEventListener("resize",De)})}),ki(function(){if(!pe||!U)return;var ue=new ResizeObserver(function(){var De=C();if(typeof De!="number")return;var at=yn(De);at!==De&&Di(at,!0)});ue.observe(pe),ue.observe(U),po(function(){return ue.disconnect()})});function zs(){return _async_to_generator(function(){var ue,De,at,Jt;return _ts_generator(this,function(_state){switch(_state.label){case 0:ue=t().trim(),De=e.draft.userContext.length>0||e.activeContextItems.length>0;if(!ue&&!De||!e.canSend)return[2];at=t();r(""),e.onUpdateInputDraft(""),q("auto");_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.onSendMessage(ue,e.activeContextItems)];case 2:_state.sent()||(r(at),e.onUpdateInputDraft(at));return[3,4];case 3:Jt=_state.sent();throw r(at),e.onUpdateInputDraft(at),Jt;case 4:return[2]}})})()}function pd(){return _async_to_generator(function(){var ue,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:ue=u();_tmp=ue;if(!_tmp)return[3,2];p(void 0);return[4,e.onDeleteSession(ue)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()}function mc(ue){if(!e.onDeleteMessage)return;var De=e.timeline.find(function(at){return at.message.id===ue});De&&h(De)}function ca(ue){if(!e.onRegenerateMessage)return;var De=e.timeline.find(function(at){return at.message.id===ue});De&&x(De)}function Mn(ue){if(!e.onRecallMessage)return;var De=e.timeline.find(function(at){return at.message.id===ue});De&&(S(void 0),y(De))}function Ta(ue,De){return _async_to_generator(function(){var bi,at,Jt;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(bi=e.onRecallMessage)==null?void 0:bi.call(e,ue.message.id,De)];case 1:at=_state.sent();if((at==null?void 0:at.text)!==void 0){r(at.text),e.onUpdateInputDraft(at.text);return[2]}Jt=ue.message.parts.filter(function(ko){return ko.type==="text"}).map(function(ko){return ko.text}).join("\n");r(Jt),e.onUpdateInputDraft(Jt);return[2]}})})()}function Br(){return _async_to_generator(function(){var ue,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:ue=v();_tmp=ue;if(!_tmp)return[3,2];S(void 0),y(void 0);return[4,Ta(ue)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()}function Ga(){var De;var ue=g();ue&&(x(void 0),(De=e.onRegenerateMessage)==null||De.call(e,ue.message.id))}function qo(){var De;var ue=m();ue&&(h(void 0),(De=e.onDeleteMessage)==null||De.call(e,ue.message.id))}function bn(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:b(!1);return[4,e.onCompressContext()];case 1:_state.sent();return[2]}})})()}var Ii=function(){var ue=m();if(!ue)return"";switch(ue.message.role){case"user":return Te("chatbox.ui.dialogs.deleteMessage.userConfirm");default:return Te("chatbox.ui.dialogs.deleteMessage.assistantConfirm")}},da=function(){var ue;return Boolean(m()&&((ue=e.onRecallHasReversibleOps)==null?void 0:ue.call(e,m().message.id)))},Zn=function(){var ue=v();return ue&&e.onRecallHasReversibleOps?e.onRecallHasReversibleOps(ue.message.id):!1};function fi(){return _async_to_generator(function(){var ue,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:ue=v();_tmp=ue;if(!_tmp)return[3,2];S(void 0),y(void 0);return[4,Ta(ue,{restoreFiles:!0})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()}var fd=function(){if(w()==="only"){Br();return}S("only")},Kf=function(){if(w()==="restore"){fi();return}S("restore")},Qf=function(){return w()==="only"?Te("chatbox.ui.dialogs.recall.onlySecondTitle"):Te("chatbox.ui.dialogs.recall.onlyConfirm")},Jf=function(){return w()==="restore"?Te("chatbox.ui.dialogs.recall.restoreSecondTitle"):Te("chatbox.ui.dialogs.recall.restoreConfirm")};return function(){var ue=oot(),De=ue.firstChild,at=De.nextSibling,Jt=at.firstChild,bi=Jt.firstChild,ko=bi.nextSibling,js=Jt.nextSibling,hu=js.firstChild,rr=hu.nextSibling,Li=rr.firstChild,sn=Li.nextSibling,Co=sn.nextSibling,gu=Co.firstChild,xu=gu.firstChild,Cr=xu.nextSibling,Ml=Cr.nextSibling,Ol=gu.nextSibling,B=D;typeof B=="function"?Wl(B,ue):D=ue,De.addEventListener("change",function(ye){var ze;var Re=Array.from((ze=ye.currentTarget.files)!=null?ze:[]);Re.length&&(Mt(Re),ye.currentTarget.value="")});var ae=N;typeof ae=="function"?Wl(ae,De):N=De,_e(ue,Se(Ct,{get when(){return M()},get children(){var ye=rot(),Re=ye.firstChild;return _e(Re,function(){return Te("chatbox.ui.states.dragFilePrompt")}),ye}}),at),bi.$$click=function(){a(function(ye){return!ye}),d(!1)},_e(ko,function(){return e.title||Te("chatbox.newChat")}),_e(Jt,Se(Ct,{get when(){return de()},get fallback(){return function(){var ye=aot(),Re=ye.firstChild;return ye.$$click=function(){d(!0),a(!1)},_e(Re,We),ye}()},get children(){var ye1=not();return ye1.$$click=function(){d(!0),a(!1)},yt(function(Re){var ze="".concat(Te("chatbox.ui.labels.provider")," / ").concat(Te("chatbox.ui.labels.model")),Ue="".concat(Te("chatbox.ui.labels.provider")," / ").concat(Te("chatbox.ui.labels.model"));return ze!==Re.e&&Dt(ye1,"aria-label",Re.e=ze),Ue!==Re.t&&Dt(ye1,"title",Re.t=Ue),Re},{e:void 0,t:void 0}),ye1}}),null);var Z=ee;typeof Z=="function"?Wl(Z,js):ee=js;var ve=L;typeof ve=="function"?Wl(ve,hu):L=hu,_e(hu,Se(Ct,{get when(){return e.timeline.length>0||e.pending.length>0||Fe()},get fallback(){return function(){var ye=sot();return _e(ye,function(){var Re=Qn(function(){return!!e.loading});return function(){return Re()?Te("chatbox.ui.states.loading"):Te("chatbox.ui.states.empty")}}()),ye}()},get children(){var ye2=iot();return _e(ye2,Se(In,{get each(){return e.timeline},children:function(Re){return Se(QT,{item:Re,get now(){return $()},get renderMarkdown(){return e.renderMarkdown},get streaming(){return Re.message.id===it()},onDeleteMessage:mc,onRegenerateMessage:ca,onRecallMessage:Mn,getSubagent:function(ze){return e.agentsById[ze]},onOpenSubagent:l,get onOpenFileChange(){return e.onOpenFileChange},get onResolveResourceDataUrl(){return e.onResolveResourceDataUrl}})}}),null),_e(ye2,Se(Lme,{get runState(){return e.runState},get onStop(){return e.onStopActiveRun}}),null),_e(ye2,Se(Dme,{get pending(){return e.pending}}),null),ye2}})),_e(js,Se(Nme,{onResizeStart:Ea,onResize:Nn,onResizeEnd:Ar,onDblClick:Uo}),rr);var be=pe;typeof be=="function"?Wl(be,rr):pe=rr,_e(Li,Se(Ct,{get when(){return e.activeContextItems.length>0},get children(){return Se(Gg,{get items(){return e.activeContextItems}})}}),null),_e(Li,Se(Ct,{get when(){return e.draft.userContext.length>0},get children(){return Se(Gg,{get items(){return e.draft.userContext},get onRemove(){return e.onRemoveUserContext}})}}),null),sn.$$keydown=function(ye){Sie(ye,n())&&(ye.preventDefault(),zs())},sn.addEventListener("compositionend",function(){return i(!1)}),sn.addEventListener("compositionstart",function(){return i(!0)}),sn.addEventListener("paste",function(ye){var ze,Ue;var Re=Array.from((Ue=(ze=ye.clipboardData)==null?void 0:ze.items)!=null?Ue:[]).filter(function(Ge){return Ge.kind==="file"&&Ge.type.startsWith("image/")}).map(function(Ge){return Ge.getAsFile()}).filter(function(Ge){return!!Ge});Re.length&&(ye.preventDefault(),Mt(Re))}),sn.$$input=function(ye){var Re=ye.currentTarget.value;r(Re),e.onUpdateInputDraft(Re)};var ge=U;return typeof ge=="function"?Wl(ge,sn):U=sn,xu.$$click=xr,Cr.$$click=Q,_e(gu,Se(wie,{get servers(){return e.mcpServers},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},get onToggle(){return e.onToggleSessionMcpServer}}),Ml),Ml.$$click=function(){return e.onNewSession()},Ol.$$click=function(){return void zs()},_e(Ol,Se(Ct,{get when(){return e.contextWindow},get children(){return Se(bie,{get used(){return pt()},get total(){return e.contextWindow},size:16,stroke:3,get title(){return gt()}})}}),null),_e(Ol,function(){return Te("chatbox.ui.actions.send")},null),_e(ue,Se(jme,{get open(){return o()},get sessions(){return e.sessionHistory},get activeSessionId(){return e.activeSessionId},get activeSessionIsRunning(){return e.runState!=="idle"||Object.values(e.agentsById).some(function(ye){return ye.status==="running"||ye.status==="queued"})},get otherBusySessionIds(){return e.otherBusySessionIds},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onClose:function(){return a(!1)},get onNewSession(){return e.onNewSession},get onSwitchSession(){return e.onSwitchSession},onExportSession:function(ye){return void e.onExportSession(ye,Pe())},onDelete:function(ye){return p(ye)}}),null),_e(ue,Se(Ct,{get when(){return c()},get children(){return Se($me,{get providers(){return e.providers},get selectedProviderId(){return e.selectedProviderId},get selectedModelId(){return e.selectedModelId},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},get onSelectProvider(){return e.onSelectProvider},get onSelectModel(){return e.onSelectModel},onClose:function(){return d(!1)}})}}),null),_e(ue,Se(Ume,{get agent(){return tt()},get now(){return $()},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},get renderMarkdown(){return e.renderMarkdown},getSubagent:function(ye){return e.agentsById[ye]},onSelectAgent:l,get onOpenFileChange(){return e.onOpenFileChange},onClose:function(){return l(void 0)}}),null),_e(ue,Se(Ct,{get when(){return u()},get children(){return Se(wy,{get title(){return Te("chatbox.ui.dialogs.deleteSession.title")},get message(){return Te("chatbox.ui.dialogs.deleteSession.message")},get confirmLabel(){return Te("chatbox.ui.dialogs.deleteSession.confirm")},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onCancel:function(){return p(void 0)},onConfirm:function(){return void pd()}})}}),null),_e(ue,Se(Ct,{get when(){return m()},get children(){return Se(wy,{get title(){return Te("chatbox.ui.dialogs.deleteMessage.title")},get message(){return"".concat(Ii()).concat(da()?"\n\n".concat(Te("chatbox.ui.dialogs.deleteMessage.toolRestoreWarning")):"")},get confirmLabel(){return Te("chatbox.ui.dialogs.deleteMessage.confirm")},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onCancel:function(){return h(void 0)},onConfirm:qo})}}),null),_e(ue,Se(Ct,{get when(){return _()},get children(){return Se(wy,{get title(){return Te("chatbox.ui.dialogs.compressContext.title")},get message(){return Te("chatbox.ui.dialogs.compressContext.message")},get confirmLabel(){return Te("chatbox.ui.dialogs.compressContext.confirm")},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onCancel:function(){return b(!1)},onConfirm:function(){return void bn()}})}}),null),_e(ue,Se(Ct,{get when(){return g()},get children(){return Se(wy,{get title(){return Te("chatbox.ui.dialogs.regenerate.title")},get message(){return Te("chatbox.ui.dialogs.regenerate.message")},get confirmLabel(){return Te("chatbox.ui.dialogs.regenerate.confirm")},get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onCancel:function(){return x(void 0)},onConfirm:Ga})}}),null),_e(ue,Se(Ct,{get when(){return v()},get children(){return Se(wy,{get title(){return Te("chatbox.ui.dialogs.recall.title")},get message(){return Te("chatbox.ui.dialogs.recall.message")},get confirmLabel(){return Qf()},get confirmClass(){return w()==="only"?"mod-warning":void 0},get secondaryConfirmLabel(){return Qn(function(){return!!Zn()})()?Jf():void 0},get secondaryConfirmClass(){return w()==="restore"?"mod-warning":void 0},actionsLayout:"vertical",cancelPlacement:"end",get mountEl(){return Pe().mountEl},get contained(){return Pe().contained},onCancel:function(){S(void 0),y(void 0)},onConfirm:fd,onSecondaryConfirm:Kf})}}),null),yt(function(ye){var Re="ns-tdwup9 ".concat(M()?"chatbox-file-drag-active":""),ze=Te("chatbox.ui.history.title"),Ue=Te("chatbox.ui.history.title"),Ge=function(){var Eo=Rn();return Eo?{height:Eo}:void 0}(),Tt=Te("chatbox.ui.placeholders.input"),kt=Te("chatbox.ui.actions.selectFile"),Hr=Te("chatbox.ui.actions.selectFile"),ar=Te("chatbox.ui.actions.compressContext"),Cn=Te("chatbox.ui.actions.compressContext"),On=!e.canCompress,Fi=Te("chatbox.newChat"),Us=Te("chatbox.newChat"),Bs=!t().trim()&&!e.draft.userContext.length&&!e.activeContextItems.length||!e.canSend,yu=gt();return Re!==ye.e&&tn(ue,ye.e=Re),ze!==ye.t&&Dt(bi,"aria-label",ye.t=ze),Ue!==ye.a&&Dt(bi,"title",ye.a=Ue),ye.o=FC(sn,Ge,ye.o),Tt!==ye.i&&Dt(sn,"placeholder",ye.i=Tt),kt!==ye.n&&Dt(xu,"title",ye.n=kt),Hr!==ye.s&&Dt(xu,"aria-label",ye.s=Hr),ar!==ye.h&&Dt(Cr,"title",ye.h=ar),Cn!==ye.r&&Dt(Cr,"aria-label",ye.r=Cn),On!==ye.d&&(Cr.disabled=ye.d=On),Fi!==ye.l&&Dt(Ml,"title",ye.l=Fi),Us!==ye.u&&Dt(Ml,"aria-label",ye.u=Us),Bs!==ye.c&&(Ol.disabled=ye.c=Bs),yu!==ye.w&&Dt(Ol,"title",ye.w=yu),ye},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0}),yt(function(){return sn.value=t()}),ue}()}var Zme=Sot;Kr(["click","input","keydown"]);function Kme(e,t){return by(Zme,e,t)}function Qme(e,t,r){var n=new Array(e);return new Proxy(n,{get:function get1(i,o,a){if(typeof o=="string"){var s=o.charCodeAt(0);if(s>=48&&s<=57){var l=+o;if(Number.isInteger(l)&&l>=0&&l<e){var c=i[l];if(!c){var d=t[l*2];c=i[l]={index:l,key:r(l),start:d,size:t[l*2+1],end:d+t[l*2+1],lane:0}}return c}}if(o==="length")return e}return Reflect.get(i,o,a)}})}function w0(e,t,r){var s;var n=(s=r.initialDeps)!=null?s:[],i,o=!0;function a(){var l;var d=0,u=e();if(!(u.length!==n.length||u.some(function(h,g){return n[g]!==h})))return i;n=u;var m=0;return i=t.apply(void 0,_to_consumable_array(u)),r!=null&&r.onChange&&!(o&&r.skipInitialOnChange)&&r.onChange(i),o=!1,i}return a.updateDeps=function(l){n=l},a}function Fj(e,t){if(e===void 0)throw new Error("Unexpected undefined".concat(t?": ".concat(t):""));return e}var Jme=function(e,t){return Math.abs(e-t)<1.01},Yme=function(e,t,r){var n;return Object.assign(function(){var _this=this;for(var _len=arguments.length,i=new Array(_len),_key=0;_key<_len;_key++){i[_key]=arguments[_key]}e.clearTimeout(n),n=e.setTimeout(function(){return t.apply(_this,i)},r)},{cancel:function(){e.clearTimeout(n)}})};var I6,zj=function(){if(I6!==void 0)return I6;if(typeof navigator=="undefined")return I6=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return I6=!0;var e=navigator.maxTouchPoints;return I6=navigator.platform==="MacIntel"&&e!==void 0&&e>0};var Xme=function(e){var t=e.offsetWidth,r=e.offsetHeight;return{width:t,height:r}},kot=function(e){return e},Cot=function(e){var t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(n);for(var o=0;o<n;o++)i[o]=t+o;return i},ehe=function(e,t){var r=e.scrollElement;if(!r)return;var n=e.targetWindow;if(!n)return;var i=function(a){var s=a.width,l=a.height;t({width:Math.round(s),height:Math.round(l)})};if(i(Xme(r)),!n.ResizeObserver)return function(){};var o=new n.ResizeObserver(function(a){var s=function(){var l=a[0];if(l!=null&&l.borderBoxSize){var c=l.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(Xme(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(r,{box:"border-box"}),function(){o.unobserve(r)}},JT={passive:!0};var Eot=typeof window=="undefined"?!0:"onscrollend"in window,Tot=function(e,t,r){var n=e.scrollElement;if(!n)return;var i=e.targetWindow;if(!i)return;var o=e.options.useScrollendEvent&&Eot,a=0,s=o?null:Yme(i,function(){return t(a,!1)},e.options.isScrollingResetDelay),l=function(u){return function(){a=r(n),s==null||s(),t(a,u)}},c=l(!0),d=l(!1);return n.addEventListener("scroll",c,JT),o&&n.addEventListener("scrollend",d,JT),function(){n.removeEventListener("scroll",c),o&&n.removeEventListener("scrollend",d),s==null||s.cancel()}},the=function(e,t){return Tot(e,t,function(r){var _e_options=e.options,n=_e_options.horizontal,i=_e_options.isRtl;return n?r.scrollLeft*(i&&-1||1):r.scrollTop})};var Aot=function(e,t,r){var n;if(r.options.useCachedMeasurements){var i=r.indexFromElement(e),o=r.options.getItemKey(i);return(n=r.itemSizeCache.get(o))!=null?n:r.options.estimateSize(i)}if(t!=null&&t.borderBoxSize){var i10=t.borderBoxSize[0];if(i10)return Math.round(i10[r.options.horizontal?"inlineSize":"blockSize"])}if(!t){var i11=r.indexFromElement(e),o10=r.options.getItemKey(i11),a=r.itemSizeCache.get(o10);if(a!==void 0)return a}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Iot=function(e,param,n){var tmp=param.adjustments,t=tmp===void 0?0:tmp,r=param.behavior;var i,o;var _obj;(o=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,(_obj={},_define_property(_obj,n.options.horizontal?"left":"top",e+t),_define_property(_obj,"behavior",r),_obj))};var rhe=Iot,YT=/*#__PURE__*/function(){"use strict";function YT1(t){var _this=this;var _this1=this;_class_call_check(this,YT1);this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=function(){var o;var r,n,i;return(o=(i=(n=(r=_this.targetWindow)==null?void 0:r.performance)==null?void 0:n.now)==null?void 0:i.call(n))!=null?o:Date.now()},this.observer=function(){var r=null,n=function(){return r||(!_this.targetWindow||!_this.targetWindow.ResizeObserver?null:r=new _this.targetWindow.ResizeObserver(function(i){i.forEach(function(o){var a=function(){var s=o.target,l=_this.indexFromElement(s);if(!s.isConnected){_this.observer.unobserve(s);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_this.elementsCache[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),c=_step_value[0],d=_step_value[1];if(d===s){_this.elementsCache.delete(c);break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return}_this.isIndexInRange(l)&&_this.shouldMeasureDuringScroll(l)&&_this.resizeItem(l,_this.options.measureElement(s,o,_this))};_this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}))};return{disconnect:function(){var i;(i=n())==null||i.disconnect(),r=null},observe:function(i){var o;return(o=n())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:function(i){var o;return(o=n())==null?void 0:o.unobserve(i)}}}(),this.range=null,this.setOptions=function(r){var p,m,h;var n,i;var o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:kot,rangeExtractor:Cot,onChange:function(){},measureElement:Aot,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(var g in r){var x=r[g];x!==void 0&&(o[g]=x)}var a=_this.options,s=null,l=null,c=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&_this.scrollElement!==null){var g10=a.count,x10=o.count,v=_this.getMeasurements(),y=g10>0?(p=(n=v[0])==null?void 0:n.key)!=null?p:a.getItemKey(0):null,_=g10>0?(m=(i=v[g10-1])==null?void 0:i.key)!=null?m:a.getItemKey(g10-1):null;if(x10!==g10||g10>0&&x10>0&&(o.getItemKey(0)!==y||o.getItemKey(x10-1)!==_)){c=!0;var S=g10>0?(h=_this.getVirtualItemForOffset(_this.getScrollOffset()))!=null?h:v[0]:null;S&&(s=[S.key,_this.getScrollOffset()-S.start]);var k=o.followOnAppend===!0?"auto":o.followOnAppend||null;k&&x10>g10&&_this.isAtEnd(a.scrollEndThreshold)&&(g10===0||o.getItemKey(x10-1)!==_)&&(l=k)}}_this.options=o,c&&(_this.pendingMin=0,_this.itemSizeCacheVersion++);var d=!1,u=0;if(s&&_this.scrollOffset!==null){var _s1=_sliced_to_array(s,2),g11=_s1[0],x11=_s1[1],v10=_this.getMeasurements(),_this_options=_this.options,y10=_this_options.count,_10=_this_options.getItemKey,b=0;for(;b<y10&&_10(b)!==g11;)b++;if(b<y10){var w=v10[b];if(w){var S10=Math.max(0,w.start+x11);S10!==_this.scrollOffset&&(u=S10-_this.scrollOffset,_this.scrollOffset=S10,d=!0)}}}(d||l)&&(_this.pendingScrollAnchor=[d?s[0]:null,d?s[1]:0,l,u])},this.notify=function(r){var n,i;(i=(n=_this.options).onChange)==null||i.call(n,_this,r)},this.maybeNotify=w0(function(){return _this.calculateRange(),[_this.isScrolling,_this.range?_this.range.startIndex:null,_this.range?_this.range.endIndex:null]},function(r){_this.notify(r)},{key:!1,debug:function(){return _this.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){_this.unsubs.filter(Boolean).forEach(function(r){return r()}),_this.unsubs=[],_this.observer.disconnect(),_this.rafId!=null&&_this.targetWindow&&(_this.targetWindow.cancelAnimationFrame(_this.rafId),_this.rafId=null),_this.scrollState=null,_this.isScrolling=!1,_this.scrollDirection=null,_this._iosDeferredAdjustment=0,_this._iosTouching=!1,_this._iosJustTouchEnded=!1,_this.scrollElement=null,_this.targetWindow=null},this._didMount=function(){return function(){_this.cleanup()}},this._willUpdate=function(){var o;var r;var n=_this.options.enabled?_this.options.getScrollElement():null;if(_this.scrollElement!==n){if(_this.cleanup(),!n){_this.maybeNotify();return}if(_this.scrollElement=n,_this.scrollElement&&"ownerDocument"in _this.scrollElement?_this.targetWindow=_this.scrollElement.ownerDocument.defaultView:_this.targetWindow=(o=(r=_this.scrollElement)==null?void 0:r.window)!=null?o:null,_this.elementsCache.forEach(function(a){_this.observer.observe(a)}),_this.unsubs.push(_this.options.observeElementRect(_this,function(a){_this.scrollRect=a,_this.maybeNotify()})),_this.unsubs.push(_this.options.observeElementOffset(_this,function(a,s){if(s&&_this._intendedScrollOffset===null&&a===_this.scrollOffset)return;_this._intendedScrollOffset!==null&&Math.abs(a-_this._intendedScrollOffset)<1.5&&(a=_this._intendedScrollOffset),_this._intendedScrollOffset=null,_this.scrollAdjustments=0;var l=_this.getScrollOffset();_this.scrollDirection=s?l===a?_this.scrollDirection:l<a?"forward":"backward":null,_this.scrollOffset=a,_this.isScrolling=s,_this._flushIosDeferredIfReady(),_this.scrollState&&_this.scheduleScrollReconcile(),_this.maybeNotify()})),"addEventListener"in _this.scrollElement){var a=_this.scrollElement,s=function(){_this._iosTouching=!0,_this._iosJustTouchEnded=!1,_this._iosTouchEndTimerId!==null&&_this.targetWindow!=null&&(_this.targetWindow.clearTimeout(_this._iosTouchEndTimerId),_this._iosTouchEndTimerId=null)},l=function(){_this._iosTouching=!1,!(!zj()||_this.targetWindow==null)&&(_this._iosJustTouchEnded=!0,_this._iosTouchEndTimerId=_this.targetWindow.setTimeout(function(){_this._iosJustTouchEnded=!1,_this._iosTouchEndTimerId=null,_this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",s,JT),a.addEventListener("touchend",l,JT),_this.unsubs.push(function(){a.removeEventListener("touchstart",s),a.removeEventListener("touchend",l),_this._iosTouchEndTimerId!==null&&_this.targetWindow!=null&&(_this.targetWindow.clearTimeout(_this._iosTouchEndTimerId),_this._iosTouchEndTimerId=null)})}_this._scrollToOffset(_this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}var i=_this.pendingScrollAnchor;if(_this.pendingScrollAnchor=null,i&&_this.scrollElement&&_this.options.enabled){var _i1=_sliced_to_array(i,4),a9=_i1[0],s10=_i1[1],l10=_i1[2],c=_i1[3];a9!==null&&!l10&&(zj()&&(_this.isScrolling||_this._iosTouching||_this._iosJustTouchEnded)?c!==0&&(_this._iosDeferredAdjustment+=c):_this._scrollToOffset(_this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l10&&_this.scrollToEnd({behavior:l10})}},this._flushIosDeferredIfReady=function(){if(_this._iosDeferredAdjustment===0||_this.isScrolling||_this._iosTouching||_this._iosJustTouchEnded)return;var r=_this.getScrollOffset(),n=_this.getMaxScrollOffset();if(r<0||r>n)return;if(_this._iosDeferredAdjustment<0&&r>=n-1){_this._iosDeferredAdjustment=0;return}var i=_this._iosDeferredAdjustment;_this._iosDeferredAdjustment=0,_this._scrollToOffset(r,{adjustments:_this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=function(){var r;return _this.options.enabled?(_this.scrollRect=(r=_this.scrollRect)!=null?r:_this.options.initialRect,_this.scrollRect[_this.options.horizontal?"width":"height"]):(_this.scrollRect=null,0)},this.getScrollOffset=function(){var r;return _this.options.enabled?(_this.scrollOffset=(r=_this.scrollOffset)!=null?r:typeof _this.options.initialOffset=="function"?_this.options.initialOffset():_this.options.initialOffset,_this.scrollOffset):(_this.scrollOffset=null,0)},this.getMeasurementOptions=w0(function(){return[_this.options.count,_this.options.paddingStart,_this.options.scrollMargin,_this.options.getItemKey,_this.options.enabled,_this.options.lanes,_this.options.laneAssignmentMode,_this.options.gap]},function(r,n,i,o,a,s,l,c){return _this.prevLanes!==void 0&&_this.prevLanes!==s&&(_this.lanesChangedFlag=!0),_this.prevLanes=s,_this.pendingMin=null,{count:r,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:a,lanes:s,laneAssignmentMode:l,gap:c}},{key:!1}),this.isIndexInRange=function(r){return r>=0&&r<_this.options.count},this.getMeasurements=w0(function(){return[_this.getMeasurementOptions(),_this.itemSizeCacheVersion]},function(param,d){var r=param.count,n=param.paddingStart,i=param.scrollMargin,o=param.getItemKey,a=param.enabled,s=param.lanes,l=param.laneAssignmentMode,c=param.gap;var v;var u=_this.itemSizeCache;if(!a)return _this.measurementsCache=[],_this.itemSizeCache.clear(),_this.laneAssignments.clear(),[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(_this.laneAssignments.size>r)try{for(var _iterator=_this.laneAssignments.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var y=_step.value;y>=r&&_this.laneAssignments.delete(y)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_this.lanesChangedFlag&&(_this.lanesChangedFlag=!1,_this.lanesSettling=!0,_this.measurementsCache=[],_this.itemSizeCache.clear(),_this.laneAssignments.clear(),_this.pendingMin=null),_this.measurementsCache.length===0&&!_this.lanesSettling&&(_this.measurementsCache=_this.options.initialMeasurementsCache,_this.measurementsCache.forEach(function(y){_this.itemSizeCache.set(y.key,y.size)}));var p=_this.lanesSettling?0:(v=_this.pendingMin)!=null?v:0;if(_this.pendingMin=null,_this.lanesSettling&&_this.measurementsCache.length===r&&(_this.lanesSettling=!1),s===1){var y10=r*2,_=_this._flatMeasurements;if(!_||_.length<y10){var S=new Float64Array(y10);_&&p>0&&S.set(_.subarray(0,p*2)),_=S,_this._flatMeasurements=_}var b;if(p===0)b=n+i;else{var S10=p-1;b=_[S10*2]+_[S10*2+1]+c}for(var S11=p;S11<r;S11++){var k=o(S11),E=u.get(k),C=typeof E=="number"?E:_this.options.estimateSize(S11);_[S11*2]=b,_[S11*2+1]=C,b+=C+c}var w=Qme(r,_,o);return _this.measurementsCache=w,w}var m=_this.measurementsCache.slice(0,p),h=new Array(s).fill(void 0),g=new Float64Array(s),x=0;for(var y11=0;y11<p;y11++){var _10=m[y11];_10&&(h[_10.lane]===void 0&&x++,h[_10.lane]=y11,g[_10.lane]=_10.end)}for(var y12=p;y12<r;y12++){var _11=o(y12),b10=_this.laneAssignments.get(y12),w10=void 0,S12=void 0,k10=l==="estimate"||u.has(_11);if(b10!==void 0&&_this.options.lanes>1){w10=b10;var I=h[w10],O=I!==void 0?m[I]:void 0;S12=O?O.end+c:n+i}else if(x===s){var I1=0,O1=g[0],M=h[0];for(var R=1;R<s;R++){var $=g[R];($<O1||$===O1&&h[R]<M)&&(I1=R,O1=$,M=h[R])}w10=I1,S12=O1+c,k10&&_this.laneAssignments.set(y12,w10)}else w10=y12%_this.options.lanes,S12=n+i,k10&&_this.laneAssignments.set(y12,w10);var E1=u.get(_11),C1=typeof E1=="number"?E1:_this.options.estimateSize(y12),T=S12+C1;m[y12]={index:y12,start:S12,size:C1,end:T,key:_11,lane:w10},h[w10]===void 0&&x++,h[w10]=y12,g[w10]=T}return _this.measurementsCache=m,m},{key:!1,debug:function(){return _this.options.debug}}),this.calculateRange=w0(function(){return[_this.getMeasurements(),_this.getSize(),_this.getScrollOffset(),_this.options.lanes]},function(r,n,i,o){return r.length===0||n===0?(_this.range=null,null):(_this.range=Rot(r,n,i,o,o===1&&_this._flatMeasurements!=null?_this._flatMeasurements:null),_this.range)},{key:!1,debug:function(){return _this.options.debug}}),this.getVirtualIndexes=w0(function(){var r=null,n=null,i=_this.calculateRange();return i&&(r=i.startIndex,n=i.endIndex),_this.maybeNotify.updateDeps([_this.isScrolling,r,n]),[_this.options.rangeExtractor,_this.options.overscan,_this.options.count,r,n]},function(r,n,i,o,a){return o===null||a===null?[]:r({startIndex:o,endIndex:a,overscan:n,count:i})},{key:!1,debug:function(){return _this.options.debug}}),this.indexFromElement=function(r){var n=_this.options.indexAttribute,i=r.getAttribute(n);return i?parseInt(i,10):(console.warn("Missing attribute name '".concat(n,"={index}' on measured element.")),-1)},this.shouldMeasureDuringScroll=function(r){var o;var n;if(!_this.scrollState||_this.scrollState.behavior!=="smooth")return!0;var i=(o=_this.scrollState.index)!=null?o:(n=_this.getVirtualItemForOffset(_this.scrollState.lastTargetOffset))==null?void 0:n.index;if(i!==void 0&&_this.range){var a=Math.max(_this.options.overscan,Math.ceil((_this.range.endIndex-_this.range.startIndex)/2)),s=Math.max(0,i-a),l=Math.min(_this.options.count-1,i+a);return r>=s&&r<=l}return!0},this.measureElement=function(r){if(!r){_this.elementsCache.forEach(function(a,s){a.isConnected||(_this.observer.unobserve(a),_this.elementsCache.delete(s))});return}var n=_this.indexFromElement(r);if(!_this.isIndexInRange(n))return;var i=_this.options.getItemKey(n),o=_this.elementsCache.get(i);o!==r&&(o&&_this.observer.unobserve(o),_this.observer.observe(r),_this.elementsCache.set(i,r)),(!_this.isScrolling||_this.scrollState)&&_this.shouldMeasureDuringScroll(n)&&_this.resizeItem(n,_this.options.measureElement(r,void 0,_this))},this.resizeItem=function(r,n){var p,m;var i,o;if(!_this.isIndexInRange(r))return;var a,s,l,c=_this._flatMeasurements;if(_this.options.lanes===1&&c!==null)l=_this.options.getItemKey(r),s=c[r*2],a=c[r*2+1];else{var h=_this.measurementsCache[r];if(!h)return;l=h.key,s=h.start,a=h.size}var d=(p=_this.itemSizeCache.get(l))!=null?p:a,u=n-d;if(u!==0){var h10=_this.options.anchorTo==="end"&&((i=_this.scrollState)==null?void 0:i.behavior)!=="smooth"&&_this.getVirtualDistanceFromEnd()<=_this.options.scrollEndThreshold,g=h10?_this.getTotalSize():0,x=_this.getScrollOffset()+_this.scrollAdjustments,y=!_this.itemSizeCache.has(l)?s<x:s+d<=x&&_this.scrollDirection!=="backward",_=((o=_this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(_this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?_this.shouldAdjustScrollPositionOnItemSizeChange((m=_this.measurementsCache[r])!=null?m:{index:r,key:l,start:s,size:a,end:s+a,lane:0},u,_this):y);(_this.pendingMin===null||r<_this.pendingMin)&&(_this.pendingMin=r),_this.itemSizeCache.set(l,n),_this.itemSizeCacheVersion++;var b=!1;h10?b=_this.applyScrollAdjustment(_this.getTotalSize()-g):_&&(b=_this.applyScrollAdjustment(u)),_this.notify(b)}},this.getVirtualItems=w0(function(){return[_this.getVirtualIndexes(),_this.getMeasurements()]},function(r,n){var i=[];for(var o=0,a=r.length;o<a;o++){var s=r[o],l=n[s];i.push(l)}return i},{key:!1,debug:function(){return _this.options.debug}}),this.getVirtualItemForOffset=function(r){var n=_this.getMeasurements();if(n.length===0)return;var i=_this._flatMeasurements,o=_this.options.lanes===1&&i!=null,a=nhe(0,n.length-1,o?function(s){return i[s*2]}:function(s){return Fj(n[s]).start},r);return Fj(n[a])},this.getMaxScrollOffset=function(){if(!_this.scrollElement)return 0;if("scrollHeight"in _this.scrollElement)return _this.options.horizontal?_this.scrollElement.scrollWidth-_this.scrollElement.clientWidth:_this.scrollElement.scrollHeight-_this.scrollElement.clientHeight;{var r=_this.scrollElement.document.documentElement;return _this.options.horizontal?r.scrollWidth-_this.scrollElement.innerWidth:r.scrollHeight-_this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=function(){return Math.max(_this.getTotalSize()-_this.getSize()-_this.getScrollOffset(),0)},this.getDistanceFromEnd=function(){return Math.max(_this.getMaxScrollOffset()-_this.getScrollOffset(),0)},this.isAtEnd=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_this1.options.scrollEndThreshold;return _this1.getDistanceFromEnd()<=r},this.getOffsetForAlignment=function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(!_this1.scrollElement)return 0;var o=_this1.getSize(),a=_this1.getScrollOffset();n==="auto"&&(n=r>=a+o?"end":"start"),n==="center"?r+=(i-o)/2:n==="end"&&(r-=o);var s=_this1.getMaxScrollOffset();return Math.max(Math.min(s,r),0)},this.getOffsetForIndex=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";r=Math.max(0,Math.min(r,_this1.options.count-1));var i=_this1.getSize(),o=_this1.getScrollOffset(),a=_this1.measurementsCache[r];if(!a)return;if(n==="auto")if(a.end>=o+i-_this1.options.scrollPaddingEnd)n="end";else if(a.start<=o+_this1.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&r===_this1.options.count-1)return[_this1.getMaxScrollOffset(),n];var s=n==="end"?a.end+_this1.options.scrollPaddingEnd:a.start-_this1.options.scrollPaddingStart;return[_this1.getOffsetForAlignment(s,n,a.size),n]},this.scrollToOffset=function(r){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.align,n=tmp===void 0?"start":tmp,tmp1=_ref.behavior,i=tmp1===void 0?"auto":tmp1;_this1._iosDeferredAdjustment=0;var o=_this1.getOffsetForAlignment(r,n),a=_this1.now();_this1.scrollState={index:null,align:n,behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},_this1._scrollToOffset(o,{adjustments:void 0,behavior:i}),_this1.scheduleScrollReconcile()},this.scrollToIndex=function(r){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.align,n=tmp===void 0?"auto":tmp,tmp1=_ref.behavior,i=tmp1===void 0?"auto":tmp1;_this1._iosDeferredAdjustment=0,r=Math.max(0,Math.min(r,_this1.options.count-1));var o=_this1.getOffsetForIndex(r,n);if(!o)return;var _o1=_sliced_to_array(o,2),a=_o1[0],s=_o1[1],l=_this1.now();_this1.scrollState={index:r,align:s,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},_this1._scrollToOffset(a,{adjustments:void 0,behavior:i}),_this1.scheduleScrollReconcile()},this.scrollBy=function(r){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.behavior,n=tmp===void 0?"auto":tmp;var i=_this1.getScrollOffset()+r,o=_this1.now();_this1.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},_this1._scrollToOffset(i,{adjustments:void 0,behavior:n}),_this1.scheduleScrollReconcile()},this.scrollToEnd=function(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.behavior,r=tmp===void 0?"auto":tmp;if(_this1.options.count>0){_this1.scrollToIndex(_this1.options.count-1,{align:"end",behavior:r});return}_this1.scrollToOffset(Math.max(_this1.getTotalSize()-_this1.getSize(),0),{behavior:r})},this.getTotalSize=function(){var o;var r;var n=_this.getMeasurements(),i;if(n.length===0)i=_this.options.paddingStart;else if(_this.options.lanes===1){var a=n.length-1,s=_this._flatMeasurements;s!=null?i=s[a*2]+s[a*2+1]:i=(o=(r=n[a])==null?void 0:r.end)!=null?o:0}else{var _Math;var a9=Array(_this.options.lanes).fill(null),s10=n.length-1;for(;s10>=0&&a9.some(function(l){return l===null});){var l=n[s10];a9[l.lane]===null&&(a9[l.lane]=l.end),s10--}i=(_Math=Math).max.apply(_Math,_to_consumable_array(a9.filter(function(l){return l!==null})))}return Math.max(i-_this.options.scrollMargin+_this.options.paddingEnd,0)},this.takeSnapshot=function(){var r=[];if(_this.itemSizeCache.size===0)return r;var n=_this.getMeasurements();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i&&_this.itemSizeCache.has(i.key)&&r.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r},this._scrollToOffset=function(r,param){var n=param.adjustments,i=param.behavior;_this._intendedScrollOffset=r+(n!=null?n:0),_this.options.scrollToFn(r,{behavior:i,adjustments:n},_this)},this.measure=function(){_this.pendingMin=null,_this.itemSizeCache.clear(),_this.laneAssignments.clear(),_this.itemSizeCacheVersion++,_this.notify(!1)},this.setOptions(t)}_create_class(YT1,[{key:"applyScrollAdjustment",value:function applyScrollAdjustment(t,r){return t===0?!1:zj()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}},{key:"scheduleScrollReconcile",value:function scheduleScrollReconcile(){var _this=this;if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(function(){_this.rafId=null,_this.reconcileScroll()}))}},{key:"reconcileScroll",value:function reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;var r=5e3;if(this.now()-this.scrollState.startedAt>r){this.scrollState=null;return}var n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=n?n[0]:this.scrollState.lastTargetOffset,o=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&Jme(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){var s=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>s;this.scrollState.lastTargetOffset=i,c||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}]);return YT1}(),nhe=function(e,t,r,n){for(;e<=t;){var i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else if(o>n)t=i-1;else return i}return e>0?e-1:0};function Pot(e,t,r){var n=0;for(;n<=t;){var i=(n+t)/2|0,o=e[i*2];if(o<r)n=i+1;else if(o>r)t=i-1;else return i}return n>0?n-1:0}function Rot(e,t,r,n,i){var o=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:o};if(n===1&&i!==null){var c=Pot(i,o,r),d=c,u=r+t;for(;d<o&&i[d*2]+i[d*2+1]<u;)d++;return{startIndex:c,endIndex:d}}var s=nhe(0,o,function(c){return e[c].start},r),l=s;if(n===1)for(;l<o&&e[l].end<r+t;)l++;else if(n>1){var c10=Array(n).fill(0);for(;l<o&&c10.some(function(u){return u<r+t});){var u10=e[l];c10[u10.lane]=u10.end,l++}var d10=Array(n).fill(r+t);for(;s>=0&&d10.some(function(u){return u>=r});){var u11=e[s];d10[u11.lane]=u11.start,s--}s=Math.max(0,s-s%n),l=Math.min(o,l+(n-1-l%n))}return{startIndex:s,endIndex:l}}var Mot=je('<div class="ns-3lgd1b">'),Oot=je('<span class="ns-vd4vg6">'),$ot=je('<div class="ns-hs6ink"><div class="ns-3hn50l"><select class="ns-6lt3g3"><option value=__all__></option></select><input type=text class="ns-7zaes8"></div><div class="ns-mfijbf"><div class="ns-f7txae"><input type=checkbox></div><div class="ns-jk6hax"></div><div class="ns-jk6hax"></div><div class="ns-jk6hax"></div></div><div class="ns-d1sczy"><span>'),Not=je("<option> (<!>)"),Dot=je('<div class="ns-tgdvp2"><div style=position:relative;width:100%>'),Lot=je('<div class="ns-44fnwu"style=position:absolute;top:0;left:0;width:100%><div class="ns-960t6q"><input type=checkbox></div><div class="ns-8tdcjd"></div><div class="ns-8tdcjd"></div><div class="ns-8tdcjd">'),ihe="__all__",Fot=95,zot=/[/\\.,\s_-]/,jot=function(){return Fot};function XT(e,t){if(!t)return 0;if(e.length<t.length)return-1;var r=e.indexOf(t);if(r!==-1)return 1e4-r+(r===0?500:0);var n=[],i=0;for(var l=0;l<t.length;l++){var c=e.indexOf(t[l],i);if(c===-1)return-1;n.push(c),i=c+1}var o=1e3;n[0]===0&&(o+=500);var a=0,s=0;for(var l10=1;l10<n.length;l10++){var c10=n[l10]-n[l10-1]-1;if(c10>0){a+=c10;for(var d=n[l10-1]+1;d<n[l10];d++)zot.test(e[d])&&s++}}return o-=a,o-=s*30,o-=n[0],o}function ohe(e){return e.filter(function(t){return t!=null}).map(function(t){return{index:t.index,start:t.start,end:t.end}})}function jj(e){var _Yt=_sliced_to_array(Yt(ihe),2),t=_Yt[0],r=_Yt[1],_Yt1=_sliced_to_array(Yt(""),2),n=_Yt1[0],i=_Yt1[1],o,a=Bn(function(){return e.items.map(function(S){return{action:S.action,local:S.localPath.toLowerCase(),remote:S.remotePath.toLowerCase()}})}),s=Bn(function(){var T;var S=n().trim().toLowerCase(),k=new Map,E=0,C=a();for(var I=0;I<C.length;I++){var O=C[I];(S.length===0?0:Math.max(XT(O.local,S),XT(O.remote,S)))!==-1&&(k.set(O.action,((T=k.get(O.action))!=null?T:0)+1),E++)}return{list:_to_consumable_array(k.entries()),total:E}}),l=Bn(function(){var S=n().trim().toLowerCase(),k=t(),E=a(),C=[];for(var T=0;T<E.length;T++){if(k!==ihe&&E[T].action!==k)continue;var I=S.length===0?0:Math.max(XT(E[T].local,S),XT(E[T].remote,S));I!==-1&&C.push({item:e.items[T],originalIndex:T,score:I})}return S.length>0&&C.sort(function(T,I){return I.score-T.score||T.originalIndex-I.originalIndex}),C}),c=function(){return l()},d=function(){return c().length>0&&c().every(function(S){return S.item.checked})},u=function(){return c().some(function(S){return S.item.checked})&&!d()},p=function(){return e.items.length},m=function(){return o!=null?o:null},_Yt2=_sliced_to_array(Yt([]),2),h=_Yt2[0],g=_Yt2[1],x={count:0,getScrollElement:m,estimateSize:jot,observeElementRect:function observeElementRect(S,k){var E=S.options.getScrollElement();return E&&k({width:E.clientWidth||E.getBoundingClientRect().width,height:E.clientHeight||E.getBoundingClientRect().height}),ehe(S,k)},observeElementOffset:the,scrollToFn:rhe,onChange:function onChange(S){g(ohe(S.getVirtualItems()))},overscan:8},v=new YT(x);ki(function(){var S=l().length;x.count!==S&&(x=_object_spread_props(_object_spread({},x),{count:S}),v.setOptions(x),v._willUpdate(),g(ohe(v.getVirtualItems())))});var y=new Map,_Yt3=_sliced_to_array(Yt(0),2),_=_Yt3[0],b=_Yt3[1],w=function(S,k){y.set(S,k),b(function(E){return E+1})};return ki(function(){if(_(),y.size>0){var S=_to_consumable_array(y);y.clear(),window.setTimeout(function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=S[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),k=_step_value[0],E=_step_value[1];E.isConnected&&v.resizeItem(k,E.offsetHeight)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}},8)}}),ki(function(){t(),n(),v.scrollToOffset(0)}),function(){var S=$ot(),k=S.firstChild,E=k.firstChild,C=E.firstChild,T=E.nextSibling,I=k.nextSibling,O=I.firstChild,M=O.firstChild,R=O.nextSibling,$=R.nextSibling,z=$.nextSibling,D=I.nextSibling,L=D.firstChild;return E.addEventListener("change",function(ee){return r(ee.currentTarget.value)}),_e(C,function(){return Te("taskSelectionVirtualList.filter.all",{count:s().total})}),_e(E,Se(In,{get each(){return s().list},children:function(ee){return function(){var pe=Not(),N=pe.firstChild,U=N.nextSibling,G=U.nextSibling;return _e(pe,function(){return ee[0]},N),_e(pe,function(){return ee[1]},U),yt(function(){return pe.value=ee[0]}),pe}()}}),null),T.$$input=function(ee){return i(ee.currentTarget.value)},M.addEventListener("change",function(){return e.onToggleMany(c().map(function(ee){return ee.originalIndex}),!d())}),M.$$click=function(ee){return ee.stopPropagation()},Wl(function(ee){ki(function(){ee.indeterminate=u()})},M),_e(R,function(){return Te("taskSelectionVirtualList.labels.action")}),_e($,function(){return Te("taskSelectionVirtualList.labels.localPath")}),_e(z,function(){return Te("taskSelectionVirtualList.labels.remotePath")}),_e(S,Se(Ct,{get when(){return l().length===0},get fallback(){return function(){var ee=Dot(),pe=ee.firstChild,N=o;return typeof N=="function"?Wl(N,ee):o=ee,_e(pe,Se(In,{get each(){return h()},children:function(U){if(!U)return null;var G=l()[U.index];return G?function(){var K=Lot(),me=K.firstChild,V=me.firstChild,ie=me.nextSibling,re=ie.nextSibling,de=re.nextSibling;return K.$$click=function(){return e.onToggle(G.originalIndex,!G.item.checked)},Wl(function(xe){w(U.index,xe)},K),V.addEventListener("change",function(xe){return e.onToggle(G.originalIndex,xe.currentTarget.checked)}),V.$$click=function(xe){return xe.stopPropagation()},_e(ie,function(){return G.item.action}),_e(re,function(){return G.item.localPath}),_e(de,function(){return G.item.remotePath}),yt(function(xe){return TN(K,"transform","translateY(".concat(U.start,"px)"))}),yt(function(){return V.checked=G.item.checked}),K}():null}})),yt(function(U){return TN(pe,"height","".concat(v.getTotalSize(),"px"))}),ee}()},get children(){var ee=Mot();return _e(ee,function(){return Te("taskSelectionVirtualList.filter.empty")}),ee}}),D),_e(L,function(){return Te("taskSelectionVirtualList.footer.totalItems",{count:p()})}),_e(D,Se(Ct,{get when(){return l().length!==p()},get children(){var ee1=Oot();return _e(ee1,function(){return Te("taskSelectionVirtualList.footer.filtered",{count:l().length})}),ee1}}),null),yt(function(){return Dt(T,"placeholder",Te("taskSelectionVirtualList.filter.searchPlaceholder"))}),yt(function(){return E.value=t()}),yt(function(){return T.value=n()}),yt(function(){return M.checked=d()}),S}()}Kr(["input","click"]);function ahe(e,t){return by(jj,e,t)}var phe=require("obsidian"),fhe=nr(ln(),1);var uhe=require("obsidian");var Uot=je('<div class="ns-u7wbm6"><div class="ns-xrtzdp"></div><span class="ns-cknj1q">');function Bot(e){return function(){var t=Uot(),r=t.firstChild,n=r.nextSibling;return _e(n,function(){return e.name}),t}()}var she=Bot;var qot=je('<div class="ns-38e97e"><div class="ns-wkgsyz"></div><span class="ns-cknj1q">');function Wot(e){return function(){var t=qot(),r=t.firstChild,n=r.nextSibling;return t.$$click=function(){return e.onClick(e.path)},_e(n,function(){return e.name}),t}()}var lhe=Wot;Kr(["click"]);function che(){var _Yt=_sliced_to_array(Yt(0),2),e=_Yt[0],t=_Yt[1];return{refresh:function refresh(){t(function(r){return r+1})},FileList:function FileList(r){var _Yt=_sliced_to_array(Yt([]),2),n=_Yt[0],i=_Yt[1],o=function(){return n().sort(function(s,l){return s.isDir===l.isDir?s.basename.localeCompare(l.basename,["zh"]):s.isDir&&!l.isDir?-1:1})};function a(){return _async_to_generator(function(){var _$s,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,r.fs.ls(r.path)];case 1:_$s=_state.sent();i(_$s);return[3,3];case 2:s=_state.sent();_instanceof(s,Error)&&new uhe.Notice(s.message);return[3,3];case 3:return[2]}})})()}return ki(function(){if(e()===0){a();return}t(0)}),Se(In,{get each(){return o()},children:function(s){return Se(Ct,{get when(){return s.isDir},get fallback(){return Se(she,{get name(){return s.basename}})},get children(){return Se(lhe,{get name(){return s.basename},get path(){return s.path},onClick:function(){return r.onClick(s)}})}})}})}}}var Vot=je('<div><div class="ns-wkgsyz"></div><input type=text class="ns-ed1e2c"autofocus><button></button><button>');function Got(e){var _Yt=_sliced_to_array(Yt(""),2),t=_Yt[0],r=_Yt[1],n=function(){return"ns-s9cq05 ".concat(e.class)};return function(){var i=Vot(),o=i.firstChild,a=o.nextSibling,s=a.nextSibling,l=s.nextSibling;return a.$$input=function(c){return r(c.target.value)},s.$$click=function(){return e.onConfirm(t())},_e(s,function(){return Te("webdavExplorer.actions.confirm")}),l.$$click=function(){return e.onCancel()},_e(l,function(){return Te("webdavExplorer.actions.cancel")}),yt(function(){return tn(i,n())}),yt(function(){return a.value=t()}),i}()}var dhe=Got;Kr(["input","click"]);var Hot=je('<div class="ns-lmheiq">'),Zot=je('<div class="ns-gqtfj9"><div class="ns-vg542y"><span>:</span><span class="ns-7o90oq"></span></div><div class="ns-r50qrp"><button></button><a class="ns-rzwn4f"></a><div class="ns-ed1e2c"></div><button></button><button>');function Kot(e){var _Yt=_sliced_to_array(Yt(["/"]),2),t=_Yt[0],r=_Yt[1],_Yt1=_sliced_to_array(Yt(!1),2),n=_Yt1[0],i=_Yt1[1],o=function(){return t().at(-1)};function a(c){r(function(d){return _to_consumable_array(d).concat([c])})}function s(){r(function(c){return c.length>1?c.slice(0,c.length-1):c})}var l=function(){var c=che();return function(){var d=Hot();return _e(d,Se(Ct,{get when(){return n()},get children(){return Se(dhe,{class:"ns-6q42pa",onCancel:function(){return i(!1)},onConfirm:function(u){var m;var p=fhe.default.join((m=o())!=null?m:"/",u);Promise.resolve(e.fs.mkdirs(p)).then(function(){i(!1),c.refresh()}).catch(function(h){_instanceof(h,Error)&&new phe.Notice(h.message)})}})}}),null),_e(d,Se(c.FileList,{get fs(){return e.fs},get path(){var u;return(u=o())!=null?u:""},onClick:function(u){return a(u.path)}}),null),d}()};return function(){var c=Zot(),d=c.firstChild,u=d.firstChild,p=u.firstChild,m=u.nextSibling,h=d.nextSibling,g=h.firstChild,x=g.nextSibling,v=x.nextSibling,y=v.nextSibling,_=y.nextSibling;return _e(c,Se(l,{}),d),_e(u,function(){return Te("webdavExplorer.labels.currentPath")},p),_e(m,function(){var b;return(b=o())!=null?b:"/"}),g.$$click=s,_e(g,function(){return Te("webdavExplorer.actions.goBack")}),x.$$click=function(){return i(!0)},_e(x,function(){return Te("webdavExplorer.actions.newFolder")}),y.$$click=function(){return e.onClose()},_e(y,function(){return Te("webdavExplorer.actions.cancel")}),_.$$click=function(){var b;return e.onConfirm((b=o())!=null?b:"/")},_e(_,function(){return Te("webdavExplorer.actions.confirm")}),c}()}var mhe=Kot;Kr(["click"]);function hhe(e,t){return by(mhe,e,t)}var P6=/*#__PURE__*/function(_eA_Modal){"use strict";_inherits(P61,_eA_Modal);function P61(r,n){_class_call_check(this,P61);var _this;_this=_call_super(this,P61,[r]);_this.tasks=n;A(_this,"result",!1);A(_this,"selectedTasks",[]);A(_this,"listController");A(_this,"resolveOpen");_this.selectedTasks=Array.from({length:n.length},function(){return!0});return _this}_create_class(P61,[{key:"onOpen",value:function onOpen(){var _this=this;this.setTitle(P.t("taskList.title"));var _this1=this,r=_this1.contentEl;r.empty();var n=r.createDiv({cls:"ns-ur0uqk"}),i=function(){},o=function(){var c;(c=_this.listController)==null||c.update({items:_this.buildListItems(),onToggle:a,onToggleMany:s}),i()},a=function(c,d){_this.selectedTasks[c]=d,o()},s=function(c,d){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;_this.selectedTasks[u]=d}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o()};this.listController=ahe(n,{items:this.buildListItems(),onToggle:a,onToggleMany:s});var l=r.createDiv({cls:"ns-842365"});new eA.Setting(l).addButton(function(c){i=function(){c.setButtonText(P.t("taskList.continue",{count:_this.selectedTasks.filter(Boolean).length}))},i(),c.setCta().onClick(function(){_this.result=!0,_this.close()})}).addButton(function(c){c.setButtonText(P.t("taskList.cancel")).onClick(function(){_this.result=!1,_this.close()})})}},{key:"openAndWait",value:function openAndWait(){var _this=this;return new Promise(function(r){_this.resolveOpen=r,_get(_get_prototype_of(P61.prototype),"open",_this).call(_this)})}},{key:"onClose",value:function onClose(){var _this=this;var n,i;(n=this.listController)==null||n.destroy(),this.listController=void 0;var r=this.tasks.filter(function(o,a){return _this.selectedTasks[a]});(i=this.resolveOpen)==null||i.call(this,{confirm:this.result,tasks:r}),this.resolveOpen=void 0,this.contentEl.empty()}},{key:"buildListItems",value:function buildListItems(){var _this=this;return this.tasks.map(function(r,n){return{id:"".concat(n,"-").concat(r.localPath,"-").concat(r.remotePath),action:Yp(r),localPath:r.localPath,remotePath:r.remotePath,checked:_this.selectedTasks[n]}})}}]);return P61}(eA.Modal);var vhe=nr(ln(),1);var ghe={caseSensitive:!1};function _he(e){var t=e.length;for(;t>0&&e[t-1]===" ";){var r=0;for(var n=t-2;n>=0&&e[n]==="\\";n-=1)r+=1;if(r%2===1)break;t-=1}return e.slice(0,t)}function ev(e){return _he(e.expr).trimEnd()===""}function Qot(e){return e.caseSensitive?"u":"ui"}function Jot(e){var r=vhe.default.normalize(e).replace(/^\.+\//,"").replace(/^\/+/,""),n=r.endsWith("/"),i=n?r.slice(0,-1):r,o=i?i.split("/").filter(Boolean):[];return{normalized:o.join("/"),segments:o,isDirPath:n}}var Yot=/[\\^$.*+?()[\]{}|]/,Xot={alnum:"A-Za-z0-9",alpha:"A-Za-z",blank:" \\t",cntrl:"\\x00-\\x1f\\x7f",digit:"0-9",graph:"\\x21-\\x7e",lower:"a-z",print:"\\x20-\\x7e",punct:"\\x21-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7e",space:" \\t-\\r",upper:"A-Z",xdigit:"A-Fa-f0-9"};function xhe(e){return Yot.test(e)?"\\".concat(e):e}function eat(e,t){var r=t+1;for((e[r]==="!"||e[r]==="^")&&(r+=1),e[r]==="]"&&(r+=1);r<e.length;r+=1)if(e[r]==="\\")r+=1;else if(e[r]==="["&&e[r+1]===":"){var n=e.indexOf(":]",r+2);n!==-1&&(r=n+1)}else if(e[r]==="]")return r;return-1}function tat(e,t,r){var n=t+1,i=!1;(e[n]==="!"||e[n]==="^")&&(i=!0,n+=1);var o="";for(e[n]==="]"&&(o+="\\]",n+=1);n<r;n+=1){var a=e[n];if(a==="["&&e[n+1]===":"){var s=e.indexOf(":]",n+2),l=e.slice(n+2,s),c=Xot[l];if(s!==-1&&s<r&&c){o+=c,n=s+1;continue}}if(a==="\\"&&n+1<r)n+=1,e[n]!=="/"&&(o+="\\".concat(e[n]));else{if(a==="/")continue;a==="["||a==="^"?o+="\\".concat(a):o+=a}}return i?"[^/".concat(o,"]"):o===""?"(?!)":"[".concat(o,"]")}function yhe(e,t){var r="";for(var n=0;n<e.length;n+=1){var i=e[n];if(i==="\\"){n+1<e.length?(n+=1,r+=xhe(e[n])):r+="\\\\";continue}if(i==="["){var o=eat(e,n);o===-1?r+="\\[":(r+=tat(e,n,o),n=o);continue}if(i==="?"){r+="[^/]";continue}if(i==="*"){var o10=n;for(;e[o10+1]==="*";)o10+=1;o10>n&&(n===0||e[n-1]==="/")&&(o10===e.length-1||e[o10+1]==="/")?e[o10+1]==="/"?(r+="(?:[^/]+/)*",o10+=1):r+=".*":r+="[^/]*",n=o10;continue}r+=xhe(i)}return new RegExp("^".concat(r,"$"),Qot(t))}var Vu=/*#__PURE__*/function(){"use strict";function Vu1(t,r){_class_call_check(this,Vu1);this.expr=t;this.options=r;A(this,"re");A(this,"isRooted");A(this,"isDirOnly");A(this,"hasSlash");A(this,"patternBody");A(this,"pathRegex");A(this,"segmentRegex");var n=_he(t);this.isRooted=n.startsWith("/"),this.isDirOnly=n.endsWith("/"),this.patternBody=n.slice(this.isRooted?1:0,this.isDirOnly?-1:void 0),this.hasSlash=this.patternBody.includes("/"),this.patternBody!==""?this.isRooted||this.hasSlash?(this.pathRegex=yhe(this.patternBody,r),this.re=this.pathRegex):(this.segmentRegex=yhe(this.patternBody,r),this.re=this.segmentRegex):this.re=/^$/}_create_class(Vu1,[{key:"test",value:function test(t){var _this=this;var o,a,s,l;if(this.patternBody==="")return!1;var _Jot=Jot(t),r=_Jot.normalized,n=_Jot.segments,i=_Jot.isDirPath;return this.isDirOnly?i?this.isRooted||this.hasSlash?(a=(o=this.pathRegex)==null?void 0:o.test(r))!=null?a:!1:n.some(function(c){var d;return(d=_this.segmentRegex)==null?void 0:d.test(c)}):!1:this.isRooted||this.hasSlash?(l=(s=this.pathRegex)==null?void 0:s.test(r))!=null?l:!1:n.some(function(c){var d;return(d=_this.segmentRegex)==null?void 0:d.test(c)})}}]);return Vu1}();function bhe(e){var t;return typeof e=="string"?Ko(ghe):(t=e.options)!=null?t:Ko(ghe)}var whe=nr(ln(),1);function tv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.filter(function(t){return t.disabled!==!0&&!ev(t)}).map(function(t){return{match:new Vu(t.expr,t.options),type:t.type}})}function She(e){var o,a;var t=e!=null?e:{};if(Array.isArray(t.rules))return{rules:_to_consumable_array(t.rules),migrated:!1};var r=Array.isArray(t.exclusionRules)||Array.isArray(t.inclusionRules),n=((o=t.exclusionRules)!=null?o:[]).map(function(s){return _object_spread_props(_object_spread({},s),{type:"exclude"})}),i=((a=t.inclusionRules)!=null?a:[]).map(function(s){return _object_spread_props(_object_spread({},s),{type:"include"})});return{rules:_to_consumable_array(n).concat(_to_consumable_array(i)),migrated:r}}function rat(e){var r=whe.default.normalize(e).replace(/^\.+\//,"").replace(/^\/+/,""),n=r.endsWith("/")?r.slice(0,-1):r;return n?n.split("/").filter(Boolean):[]}function rv(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var n=rat(e);for(var i=1;i<=n.length;i+=1){var o=i<n.length||r,a=n.slice(0,i).join("/"),s=o?"".concat(a,"/"):a,l=void 0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;c.match.test(s)&&(l=c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(o){if((l==null?void 0:l.type)==="exclude")return!1;continue}return l?l.type==="include":!0}return!0}var vf=nr(ln(),1),tA="ObsidianNutstoreSync.SyncCache.v1",rA="plugins/nutstore-sync/cache";function Uj(e,t){return Che((0,vf.join)(e,t,rA,tA))}function khe(e,t){return Che((0,vf.dirname)(Uj(e,t)))}function R6(e){return(0,vf.normalize)((0,vf.join)(e,rA,tA))}function nA(e,t){return(0,vf.normalize)(e)===R6(t)}function Che(e){var t=(0,vf.normalize)(e);return t.startsWith("/")?t:"/".concat(t)}var Ehe=["plugins/**/node_modules","plugins/**/.git","plugins/**/.pnpm-store","plugins/nutstore-sync/data.local.json","".concat(rA,"/").concat(tA),"workspace","workspace.json"];function Bj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"exclude";return{expr:e,options:{caseSensitive:!0},type:t}}function The(e){return Ehe.map(function(t){return Bj("".concat(e,"/").concat(t))})}function nat(e){return Ehe.flatMap(function(t){return[Bj("".concat(e,"/").concat(t)),Bj("".concat(e,"/").concat(t,"/**"))]})}function Ahe(e,t,r){return t!=="all"?!1:rv(R6(e),tv(r.rules))}function M6(e,t){var r="".concat(e,"/"),n;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i.disabled===!0||ev(i)||new Vu(i.expr,i.options).test(r)&&(n=i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return(n==null?void 0:n.type)==="exclude"?n:void 0}function O6(e,t,r){var _n;var n=_to_consumable_array(r.rules);return t==="none"?n.push({expr:e,options:{caseSensitive:!1},type:"exclude"}):t==="bookmarks"&&(n.push({expr:"/".concat(e),options:{caseSensitive:!1},type:"include"}),n.push({expr:"".concat(e,"/**"),options:{caseSensitive:!1},type:"exclude"}),n.push({expr:"".concat(e,"/bookmarks.json"),options:{caseSensitive:!1},type:"include"})),(_n=n).push.apply(_n,_to_consumable_array(nat(e))),{rules:n,configDir:e,configDirSyncMode:t}}function nv(e,t){var r="".concat(t,"/plugins/nutstore-sync");return e===r||e.startsWith("".concat(r,"/"))}function Ihe(e){var n;var t=e.app.vault.configDir,r=(n=e.settings.configDirSyncMode)!=null?n:"none";return O6(t,r,e.settings.filterRules)}var $6=require("obsidian");function Phe(e,t){return _async_to_generator(function(){var r,n,i,_n,_r1,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,l,c;function o(a){return a=(0,$6.normalizePath)(a),!i.some(function(s){return s.test(a)})}return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=[t],i=The(e.configDir).map(function(a){return new Vu(a.expr,a.options)});_state.label=1;case 1:if(!(n.length>0))return[3,4];a=n.splice(0);return[4,Promise.all(a.map(function(l){return _async_to_generator(function(){var c,d,x,u,p,m,h,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=(0,$6.normalizePath)(l);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.adapter.list(c)];case 2:d=_state.sent();return[3,4];case 3:x=_state.sent();throw Me.error("Failed to list folder, aborting traversal:",c,x),new Error("Local scan failed: cannot list folder '".concat(c,"'. Sync aborted to avoid propagating an incomplete scan as deletions. Fix the folder (permissions/locks, e.g. another sync client holding it) or exclude it via filter rules."),{cause:x});case 4:u=d.files,p=d.folders,m=u.map(function(x){return(0,$6.normalizePath)(x)}),h=p.map(function(x){return(0,$6.normalizePath)(x)}).filter(o);_tmp={};return[4,Promise.all(_to_consumable_array(m).concat(_to_consumable_array(h)).map(function(x){return Ya(e,x)}))];case 5:return[2,(_tmp.contents=_state.sent().filter(function(x){return x!==void 0}),_tmp.folders=h,_tmp)]}})})()}))];case 2:s=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=s[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_step.value,l=_step_value.contents,c=_step_value.folders;(_n=n).push.apply(_n,_to_consumable_array(c)),(_r1=r).push.apply(_r1,_to_consumable_array(l))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=3;case 3:return[3,1];case 4:return[2,r]}})})()}var Rhe=nr(ln(),1);function qj(e){return e==="/"||e==="."||e===""}function N6(e,t){var r=new Set(t),n=new Map(e.map(function(o){return[o.path,o]})),i=new Map(_to_consumable_array(r).filter(function(o){return o.isDir}).map(function(o){return[o.path,o]}));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,o=_step_value.path;for(;o=(0,Rhe.dirname)(o),!qj(o);){if(i.has(o))continue;var a=n.get(o);!a||!a.isDir||(i.set(o,a),r.add(a))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return _to_consumable_array(r)}var iA=/*#__PURE__*/function(){"use strict";function iA1(t){_class_call_check(this,iA1);this.options=t}_create_class(iA1,[{key:"walk",value:function walk(){return _async_to_generator(function(){var _this,l,c,t,r,n,i,o,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;t=this.options.filterRules?void 0:this.options.settings,r=(c=this.options.filterRules)!=null?c:t?O6(this.options.vault.configDir,(l=t.configDirSyncMode)!=null?l:"none",t.filterRules):void 0,n=tv(r==null?void 0:r.rules);return[4,Phe(this.options.vault,this.options.vault.getRoot().path)];case 1:i=_state.sent(),o=i.filter(function(d){return!nA(d.path,_this.options.vault.configDir)&&rv(d.path,n,d.isDir)}),a=N6(i,o),s=new Set(a.map(function(d){return d.path}));return[2,i.map(function(d){return{stat:d,ignored:!s.has(d.path)}})]}})}).call(this)}}]);return iA1}();var yv=nr(ln(),1);var Mhe=nr(ln(),1);function Xi(e){return e.startsWith("/")||(e="/".concat(e)),e.endsWith("/")||(e="".concat(e,"/")),(0,Mhe.normalize)(e)}function D6(e,t){return gb({vaultName:e,remoteBaseDir:Xi(t)})}function oA(e,t,r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp={remoteEndpoint:t};return[4,Cte(new TextEncoder().encode(e))];case 1:return[2,gb.apply(void 0,[(_tmp.accountHash=_state.sent(),_tmp.remoteBaseDir=xm(r),_tmp)])]}})})()}var Wj=nr(ln(),1);function Dc(e,t){return e=(0,Wj.normalize)(e),t=(0,Wj.normalize)(t),e.endsWith("/")||(e+="/"),t.endsWith("/")||(t+="/"),t===e?!1:t.startsWith(e)}var Ohe=/^[a-z][a-z\d+\-.]*:\/\//i,iat=/^[a-z][a-z\d+\-.]*:/i,oat=/[\t\r\n]/,aat=/^(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?::\d{1,5})?(?:[/?#].*)?$/i,vh=/*#__PURE__*/function(Error1){"use strict";_inherits(vh1,Error1);function vh1(r){_class_call_check(this,vh1);var _this;_this=_call_super(this,vh1,[r]);_this.reason=r;_this.name="NutstoreBaseUrlValidationError";return _this}return vh1}(_wrap_native_super(Error));function sat(e){return e.replace(/\/+$/,"")}function lat(e){return Ohe.test(e)?e:aat.test(e)?"https://".concat(e):e}function Vj(e){var t=e.trim();if(oat.test(t))throw new vh("invalidFormat");var r=lat(t);if(r===t&&iat.test(t)&&!Ohe.test(t))throw new vh("invalidFormat");var n;try{n=new URL(r)}catch(i){throw new vh("invalidFormat")}if(!["http:","https:"].includes(n.protocol))throw new vh("unsupportedProtocol");return n.search="",n.hash="",sat(n.toString())}function $he(e){var t;if(e.loginMode!=="manual"||!((t=e.nutstoreEnterpriseBaseUrl)!=null&&t.trim()))return null;try{return Vj(e.nutstoreEnterpriseBaseUrl)}catch(r){return null}}function rp(e){var t=$he(e);return t?"".concat(t,"/dav"):bJ}function aA(e){var t=$he(e);return t?"".concat(t,"/nsdav"):_J}var Cpr=new Error("timeout while waiting for mutex to become available"),Epr=new Error("mutex already locked"),uat=new Error("request for lock canceled"),cat=function cat1(e,t,r,n){function i(o){return _instanceof(o,r)?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(u){a(u)}}function l(d){try{c(n.throw(d))}catch(u){a(u)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})},Gj=/*#__PURE__*/function(){"use strict";function Gj1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uat;_class_call_check(this,Gj1);this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}_create_class(Gj1,[{key:"acquire",value:function acquire(){var _this=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(t<=0)throw new Error("invalid weight ".concat(t,": must be positive"));return new Promise(function(n,i){var o={resolve:n,reject:i,weight:t,priority:r},a=Nhe(_this._queue,function(s){return r<=s.priority});a===-1&&t<=_this._value?_this._dispatchItem(o):_this._queue.splice(a+1,0,o)})}},{key:"runExclusive",value:function runExclusive(t){return cat(this,arguments,void 0,function(r){var n,i,_ref,o,a;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:1,i=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:0;return[4,this.acquire(n,i)];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),o=_ref[0],a=_ref[1];_state.label=2;case 2:_state.trys.push([2,,4,5]);return[4,r(o)];case 3:return[2,_state.sent()];case 4:a();return[7];case 5:return[2]}})})}},{key:"waitForUnlock",value:function waitForUnlock(){var _this=this;var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(t<=0)throw new Error("invalid weight ".concat(t,": must be positive"));return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(function(n){_this._weightedWaiters[t-1]||(_this._weightedWaiters[t-1]=[]),dat(_this._weightedWaiters[t-1],{resolve:n,priority:r})})}},{key:"isLocked",value:function isLocked(){return this._value<=0}},{key:"getValue",value:function getValue(){return this._value}},{key:"setValue",value:function setValue(t){this._value=t,this._dispatchQueue()}},{key:"release",value:function release(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(t<=0)throw new Error("invalid weight ".concat(t,": must be positive"));this._value+=t,this._dispatchQueue()}},{key:"cancel",value:function cancel(){var _this=this;this._queue.forEach(function(t){return t.reject(_this._cancelError)}),this._queue=[]}},{key:"_dispatchQueue",value:function _dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}},{key:"_dispatchItem",value:function _dispatchItem(t){var r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}},{key:"_newReleaser",value:function _newReleaser(t){var _this=this;var r=!1;return function(){r||(r=!0,_this.release(t))}}},{key:"_drainUnlockWaiters",value:function _drainUnlockWaiters(){if(this._queue.length===0)for(var t=this._value;t>0;t--){var r=this._weightedWaiters[t-1];r&&(r.forEach(function(n){return n.resolve()}),this._weightedWaiters[t-1]=[])}else{var t10=this._queue[0].priority;for(var r10=this._value;r10>0;r10--){var n=this._weightedWaiters[r10-1];if(!n)continue;var i=n.findIndex(function(o){return o.priority<=t10});(i===-1?n:n.splice(0,i)).forEach(function(o){return o.resolve()})}}}},{key:"_couldLockImmediately",value:function _couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priority<r)&&t<=this._value}}]);return Gj1}();function dat(e,t){var r=Nhe(e,function(n){return t.priority<=n.priority});e.splice(r+1,0,t)}function Nhe(e,t){for(var r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}var pat=function pat1(e,t,r,n){function i(o){return _instanceof(o,r)?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(u){a(u)}}function l(d){try{c(n.throw(d))}catch(u){a(u)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})},iv=/*#__PURE__*/function(){"use strict";function iv1(t){_class_call_check(this,iv1);this._semaphore=new Gj(1,t)}_create_class(iv1,[{key:"acquire",value:function acquire(){return pat(this,arguments,void 0,function(){var t,_ref,r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:0;return[4,this._semaphore.acquire(1,t)];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),r=_ref[1];return[2,r]}})})}},{key:"runExclusive",value:function runExclusive(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._semaphore.runExclusive(function(){return t()},1,r)}},{key:"isLocked",value:function isLocked(){return this._semaphore.isLocked()}},{key:"waitForUnlock",value:function waitForUnlock(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this._semaphore.waitForUnlock(1,t)}},{key:"release",value:function release(){this._semaphore.isLocked()&&this._semaphore.release()}},{key:"cancel",value:function cancel(){return this._semaphore.cancel()}}]);return iv1}();var gv=nr(ln(),1);var Dhe=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",fat=Dhe+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",mat="["+Dhe+"]["+fat+"]*",hat=new RegExp("^"+mat+"$");function sA(e,t){var r=[],n=t.exec(e);for(;n;){var i=[];i.startIndex=t.lastIndex-n[0].length;var o=n.length;for(var a=0;a<o;a++)i.push(n[a]);r.push(i),n=t.exec(e)}return r}var Hj=function Hj1(e){var t=hat.exec(e);return!(t===null||typeof t=="undefined")};function Lhe(e){return typeof e!="undefined"}var L6=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],lA=["__proto__","constructor","prototype"];var gat={allowBooleanAttributes:!1,unpairedTags:[]};function Bhe(e,t){t=Object.assign({},gat,t);var r=[],n=!1,i=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(var o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=zhe(e,o),o.err)return o}else if(e[o]==="<"){var a=o;if(o++,e[o]==="!"){o=jhe(e,o);continue}else{var s=!1;e[o]==="/"&&(s=!0,o++);var l="";for(;o<e.length&&e[o]!==">"&&e[o]!==" "&&e[o]!==" "&&e[o]!=="\n"&&e[o]!=="\r";o++)l+=e[o];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),o--),!kat(l)){var u=void 0;return l.trim().length===0?u="Invalid space after '<'.":u="Tag '"+l+"' is an invalid name.",xo("InvalidTag",u,Es(e,o))}var c=vat(e,o);if(c===!1)return xo("InvalidAttr","Attributes for '"+l+"' have open quote.",Es(e,o));var d=c.value;if(o=c.index,d[d.length-1]==="/"){var u10=o-d.length;d=d.substring(0,d.length-1);var p=Uhe(d,t);if(p===!0)n=!0;else return xo(p.err.code,p.err.msg,Es(e,u10+p.err.line))}else if(s)if(c.tagClosed){if(d.trim().length>0)return xo("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Es(e,a));if(r.length===0)return xo("InvalidTag","Closing tag '"+l+"' has not been opened.",Es(e,a));{var u11=r.pop();if(l!==u11.tagName){var p10=Es(e,u11.tagStartPos);return xo("InvalidTag","Expected closing tag '"+u11.tagName+"' (opened in line "+p10.line+", col "+p10.col+") instead of closing tag '"+l+"'.",Es(e,a))}r.length==0&&(i=!0)}}else return xo("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Es(e,o));else{var u12=Uhe(d,t);if(u12!==!0)return xo(u12.err.code,u12.err.msg,Es(e,o-d.length+u12.err.line));if(i===!0)return xo("InvalidXml","Multiple possible root nodes found.",Es(e,o));t.unpairedTags.indexOf(l)!==-1||r.push({tagName:l,tagStartPos:a}),n=!0}for(o++;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="!"){o++,o=jhe(e,o);continue}else if(e[o+1]==="?"){if(o=zhe(e,++o),o.err)return o}else break;else if(e[o]==="&"){var u13=wat(e,o);if(u13==-1)return xo("InvalidChar","char '&' is not expected.",Es(e,o));o=u13}else if(i===!0&&!Fhe(e[o]))return xo("InvalidXml","Extra text at the end",Es(e,o));e[o]==="<"&&o--}}else{if(Fhe(e[o]))continue;return xo("InvalidChar","char '"+e[o]+"' is not expected.",Es(e,o))}if(n){if(r.length==1)return xo("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Es(e,r[0].tagStartPos));if(r.length>0)return xo("InvalidXml","Invalid '"+JSON.stringify(r.map(function(o){return o.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return xo("InvalidXml","Start tag expected.",1);return!0}function Fhe(e){return e===" "||e===" "||e==="\n"||e==="\r"}function zhe(e,t){var r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){var n=e.substr(r,t-r);if(t>5&&n==="xml")return xo("InvalidXml","XML declaration allowed only at the start of the document.",Es(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function jhe(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){var r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var xat='"',yat="'";function vat(e,t){var r="",n="",i=!1;for(;t<e.length;t++){if(e[t]===xat||e[t]===yat)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){i=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:i}}var _at=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Uhe(e,t){var r=sA(e,_at),n={};for(var i=0;i<r.length;i++){if(r[i][1].length===0)return xo("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",F6(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return xo("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",F6(r[i]));if(r[i][3]===void 0&&!t.allowBooleanAttributes)return xo("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",F6(r[i]));var o=r[i][2];if(!Sat(o))return xo("InvalidAttr","Attribute '"+o+"' is an invalid name.",F6(r[i]));if(!Object.prototype.hasOwnProperty.call(n,o))n[o]=1;else return xo("InvalidAttr","Attribute '"+o+"' is repeated.",F6(r[i]))}return!0}function bat(e,t){var r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function wat(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,bat(e,t);var r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function xo(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Sat(e){return Hj(e)}function kat(e){return Hj(e)}function Es(e,t){var r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function F6(e){return e.startIndex+e[1].length}var Zj={cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",euro:"€",dollar:"$",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"\xa5",cedil:"\xb8"};var z6={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Kj={nbsp:"\xa0",copy:"\xa9",reg:"\xae",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"\xab",raquo:"\xbb",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"\xb6",sect:"\xa7",deg:"\xb0",frac12:"\xbd",frac14:"\xbc",frac34:"\xbe"};var ov=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),Cat=new Set("!?\\\\/[]$%{}^&*()<>|+");function qhe(e){if(e[0]==="#")throw new Error("[EntityReplacer] Invalid character '#' in entity name: \"".concat(e,'"'));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(Cat.has(t))throw new Error("[EntityReplacer] Invalid character '".concat(t,"' in entity name: \"").concat(e,'"'))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e}function j6(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var t=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var r=_step.value;if(r)try{for(var _iterator1=Object.keys(r)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var n=_step1.value;var i=r[n];if(typeof i=="string")t[n]=i;else if(i&&(typeof i==="undefined"?"undefined":_type_of(i))=="object"&&i.val!==void 0){var o=i.val;typeof o=="string"&&(t[n]=o)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return t}var S0="external",uA="base",Qj="all";function Eat(e){return!e||e===S0?new Set([S0]):e===Qj?new Set([Qj]):e===uA?new Set([uA]):Array.isArray(e)?new Set(e):new Set([S0])}var fl=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Tat=new Set([9,10,13]);function Aat(e){var o,a;if(!e)return{xmlVersion:1,onLevel:fl.allow,nullLevel:fl.remove};var t=e.xmlVersion===1.1?1.1:1,r=(o=fl[e.onNCR])!=null?o:fl.allow,n=(a=fl[e.nullNCR])!=null?a:fl.remove,i=Math.max(n,fl.remove);return{xmlVersion:t,onLevel:r,nullLevel:i}}var av=/*#__PURE__*/function(){"use strict";function av1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,av1);var n,i;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:function(o){return o},this._limitTiers=Eat((n=this._limit.applyLimitsTo)!=null?n:S0),this._numericAllowed=(i=t.numericAllowed)!=null?i:!0,this._baseMap=j6(z6,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);var r=Aat(t.ncr);this._ncrXmlVersion=r.xmlVersion,this._ncrOnLevel=r.onLevel,this._ncrNullLevel=r.nullLevel,this._onExternalEntity=typeof t.onExternalEntity=="function"?t.onExternalEntity:null,this._onInputEntity=typeof t.onInputEntity=="function"?t.onInputEntity:null}_create_class(av1,[{key:"_applyRegistrationHook",value:function _applyRegistrationHook(t,r,n,i){if(!t)return!0;var o=t(r,n);if(o===ov.BLOCK)return!1;if(o===ov.THROW)throw new Error("[EntityDecoder] Registration of ".concat(i,' entity "&').concat(r,';" was rejected by hook'));return!0}},{key:"setExternalEntities",value:function setExternalEntities(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t)try{for(var _iterator=Object.keys(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;qhe(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!this._onExternalEntity){this._externalMap=j6(t);return}var r=j6(t),n=Object.create(null);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries(r)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step1.value,2),i10=_step_value[0],o=_step_value[1];this._applyRegistrationHook(this._onExternalEntity,i10,o,"external")&&(n[i10]=o)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}this._externalMap=n}},{key:"addExternalEntity",value:function addExternalEntity(t,r){qhe(t),typeof r=="string"&&r.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,t,r,"external")&&(this._externalMap[t]=r)}},{key:"addInputEntities",value:function addInputEntities(t){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=j6(t);return}var r=j6(t),n=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(r)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];this._applyRegistrationHook(this._onInputEntity,i,o,"input")&&(n[i]=o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this._inputMap=n}},{key:"reset",value:function reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}},{key:"setXmlVersion",value:function setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}},{key:"decode",value:function decode(t){if(typeof t!="string"||t.length===0||t.indexOf("&")===-1)return t;var r=t,n=[],i=t.length,o=0,a=0,s=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,c=s||l;for(;a<i;){if(t.charCodeAt(a)!==38){a++;continue}var u=a+1;for(;u<i&&t.charCodeAt(u)!==59&&u-a<=32;)u++;if(u>=i||t.charCodeAt(u)!==59){a++;continue}var p=t.slice(a+1,u);if(p.length===0){a++;continue}var m=void 0,h=void 0;if(this._removeSet.has(p))m="",h===void 0&&(h=S0);else if(this._leaveSet.has(p)){a++;continue}else if(p.charCodeAt(0)===35){var g=this._resolveNCR(p);if(g===void 0){a++;continue}m=g,h=uA}else{var g10=this._resolveName(p);m=g10==null?void 0:g10.value,h=g10==null?void 0:g10.tier}if(m===void 0){a++;continue}if(a>o&&n.push(t.slice(o,a)),n.push(m),o=u+1,a=o,c&&this._tierCounts(h)){if(s&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error("[EntityReplacer] Entity expansion count limit exceeded: ".concat(this._totalExpansions," > ").concat(this._maxTotalExpansions));if(l){var g11=m.length-(p.length+2);if(g11>0&&(this._expandedLength+=g11,this._expandedLength>this._maxExpandedLength))throw new Error("[EntityReplacer] Expanded content length limit exceeded: ".concat(this._expandedLength," > ").concat(this._maxExpandedLength))}}}o<i&&n.push(t.slice(o));var d=n.length===0?t:n.join("");return this._postCheck(d,r)}},{key:"_tierCounts",value:function _tierCounts(t){return this._limitTiers.has(Qj)?!0:this._limitTiers.has(t)}},{key:"_resolveName",value:function _resolveName(t){if(t in this._inputMap)return{value:this._inputMap[t],tier:S0};if(t in this._externalMap)return{value:this._externalMap[t],tier:S0};if(t in this._baseMap)return{value:this._baseMap[t],tier:uA}}},{key:"_classifyNCR",value:function _classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!Tat.has(t)?fl.remove:-1}},{key:"_applyNCRAction",value:function _applyNCRAction(t,r,n){switch(t){case fl.allow:return String.fromCodePoint(n);case fl.remove:return"";case fl.leave:return;case fl.throw:throw new Error("[EntityDecoder] Prohibited numeric character reference &".concat(r,"; (U+").concat(n.toString(16).toUpperCase().padStart(4,"0"),")"));default:return String.fromCodePoint(n)}}},{key:"_resolveNCR",value:function _resolveNCR(t){var r=t.charCodeAt(1),n;if(r===120||r===88?n=parseInt(t.slice(2),16):n=parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;var i=this._classifyNCR(n);if(!this._numericAllowed&&i<fl.remove)return;var o=i===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(o,t,n)}}]);return av1}();var Whe=function(e){return L6.includes(e)?"__"+e:e},Iat={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:function tagValueProcessor(e,t){return t},attributeValueProcessor:function attributeValueProcessor(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function updateTag(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Whe};function Pat(e,t){if(typeof e!="string")return;var r=e.toLowerCase();if(L6.some(function(n){return r===n.toLowerCase()}))throw new Error("[SECURITY] Invalid ".concat(t,': "').concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'));if(lA.some(function(n){return r===n.toLowerCase()}))throw new Error("[SECURITY] Invalid ".concat(t,': "').concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'))}function Vhe(e,t){var r,n,i,o,a,s,l,c;return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,(r=e.maxEntitySize)!=null?r:1e4),maxExpansionDepth:Math.max(1,(n=e.maxExpansionDepth)!=null?n:1e4),maxTotalExpansions:Math.max(1,(i=e.maxTotalExpansions)!=null?i:1/0),maxExpandedLength:Math.max(1,(o=e.maxExpandedLength)!=null?o:1e5),maxEntityCount:Math.max(1,(a=e.maxEntityCount)!=null?a:1e3),allowedTags:(s=e.allowedTags)!=null?s:null,tagFilter:(l=e.tagFilter)!=null?l:null,appliesTo:(c=e.appliesTo)!=null?c:"all"}:Vhe(!0)}var Ghe=function Ghe1(e){var t=Object.assign({},Iat,e),r=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,n=_step_value.value,i=_step_value.name;n&&Pat(n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.onDangerousProperty===null&&(t.onDangerousProperty=Whe),t.processEntities=Vhe(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(function(n){return typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n})),t};var k0;typeof Symbol!="function"?k0="@@xmlMetadata":k0=Symbol("XML Node Metadata");var ml=/*#__PURE__*/function(){"use strict";function ml1(t){_class_call_check(this,ml1);this.tagname=t,this.child=[],this[":@"]=Object.create(null)}_create_class(ml1,[{key:"add",value:function add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push(_define_property({},t,r))}},{key:"addChild",value:function addChild(t,r){var _obj;t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push((_obj={},_define_property(_obj,t.tagname,t.child),_define_property(_obj,":@",t[":@"]),_obj)):this.child.push(_define_property({},t.tagname,t.child)),this.addStartIndex(r)}},{key:"addStartIndex",value:function addStartIndex(t){t!==void 0&&(this.child[this.child.length-1][k0]={startIndex:t})}},{key:"addEndIndex",value:function addEndIndex(t){var r=this.child[this.child.length-1];r!==void 0&&r[k0]!==void 0&&r[k0].endIndex===void 0&&(r[k0].endIndex=t)}}],[{key:"getMetaDataSymbol",value:function getMetaDataSymbol(){return k0}}]);return ml1}();var Hhe=":A-Za-z_\xc0-\xd6\xd8-\xf6\xf8-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�",Rat=Hhe+"\\-\\.\\d\xb7̀-ͯ‿-⁀",Zhe=":A-Za-z_\xc0-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF",Mat=Zhe+"\\-\\.\\d\xb7̀-ͯ҇‿-⁀",Jj=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";var n=e.replace(":",""),i=t.replace(":",""),o="[".concat(n,"][").concat(i,"]*");return{name:new RegExp("^[".concat(e,"][").concat(t,"]*$"),r),ncName:new RegExp("^".concat(o,"$"),r),qName:new RegExp("^".concat(o,"(?::").concat(o,")?$"),r),nmToken:new RegExp("^[".concat(t,"]+$"),r),nmTokens:new RegExp("^[".concat(t,"]+(?:\\s+[").concat(t,"]+)*$"),r)}},Oat=Jj(Hhe,Rat),$at=Jj(Zhe,Mat,"u"),Khe=":A-Za-z_",Nat=Khe+"\\-\\.\\d",Dat=Jj(Khe,Nat),Lat=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"1.0",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return t?Dat:e==="1.1"?$at:Oat};var Yj=function(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.xmlVersion,t=tmp===void 0?"1.0":tmp,tmp1=_ref.asciiOnly,r=tmp1===void 0?!1:tmp1;return Lat(t,r).qName.test(e)};var B6=/*#__PURE__*/function(){"use strict";function B61(t,r){_class_call_check(this,B61);this.suppressValidationErr=!t,this.options=t,this.xmlVersion=r||1}_create_class(B61,[{key:"setXmlVersion",value:function setXmlVersion(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.xmlVersion=t}},{key:"readDocType",value:function readDocType(t,r){var n=Object.create(null),i=0;if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;var o=1,a=!1,s=!1,l=null,c="";for(;r<t.length;r++){if(l!==null){t[r]===l&&(l=null),c+=t[r];continue}if(!a&&!s&&(t[r]==='"'||t[r]==="'")){l=t[r],c+=t[r];continue}if(t[r]==="<"&&!s){if(a&&C0(t,"!ENTITY",r)){r+=7;var d=void 0,u=void 0;var ref;if(ref=_sliced_to_array(this.readEntityExp(t,r+1,this.suppressValidationErr),3),d=ref[0],u=ref[1],r=ref[2],ref,u.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&i>=this.options.maxEntityCount)throw new Error("Entity count (".concat(i+1,") exceeds maximum allowed (").concat(this.options.maxEntityCount,")"));n[d]=u,i++}}else if(a&&C0(t,"!ELEMENT",r)){r+=8;var _this_readElementExp=this.readElementExp(t,r+1),d10=_this_readElementExp.index;r=d10}else if(a&&C0(t,"!ATTLIST",r))r+=8;else if(a&&C0(t,"!NOTATION",r)){r+=9;var _this_readNotationExp=this.readNotationExp(t,r+1,this.suppressValidationErr),d11=_this_readNotationExp.index;r=d11}else if(C0(t,"!--",r))s=!0;else throw new Error("Invalid DOCTYPE");o++,c=""}else if(t[r]===">"){if(s?t[r-1]==="-"&&t[r-2]==="-"&&(s=!1,o--):o--,o===0)break}else t[r]==="["?a=!0:c+=t[r]}if(l!==null||o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:r}}},{key:"readEntityExp",value:function readEntityExp(t,r){r=hl(t,r);var n=r;for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)r++;var i=t.substring(n,r);if(U6(i,{xmlVersion:this.xmlVersion}),r=hl(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}var o="";var ref;if(ref=_sliced_to_array(this.readIdentifierVal(t,r,"entity"),2),r=ref[0],o=ref[1],ref,this.options.enabled!==!1&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error('Entity "'.concat(i,'" size (').concat(o.length,") exceeds maximum allowed size (").concat(this.options.maxEntitySize,")"));return r--,[i,o,r]}},{key:"readNotationExp",value:function readNotationExp(t,r){r=hl(t,r);var n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);!this.suppressValidationErr&&U6(i,{xmlVersion:this.xmlVersion}),r=hl(t,r);var o=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error('Expected SYSTEM or PUBLIC, found "'.concat(o,'"'));r+=o.length,r=hl(t,r);var a=null,s=null;var ref,ref1,ref2;if(o==="PUBLIC")ref=_sliced_to_array(this.readIdentifierVal(t,r,"publicIdentifier"),2),r=ref[0],a=ref[1],ref,r=hl(t,r),(t[r]==='"'||t[r]==="'")&&(ref1=_sliced_to_array(this.readIdentifierVal(t,r,"systemIdentifier"),2),r=ref1[0],s=ref1[1],ref1);else if(o==="SYSTEM"&&(ref2=_sliced_to_array(this.readIdentifierVal(t,r,"systemIdentifier"),2),r=ref2[0],s=ref2[1],ref2,!this.suppressValidationErr&&!s))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:a,systemIdentifier:s,index:--r}}},{key:"readIdentifierVal",value:function readIdentifierVal(t,r,n){var i="",o=t[r];if(o!=='"'&&o!=="'")throw new Error('Expected quoted string, found "'.concat(o,'"'));r++;var a=r;for(;r<t.length&&t[r]!==o;)r++;if(i=t.substring(a,r),t[r]!==o)throw new Error("Unterminated ".concat(n," value"));return r++,[r,i]}},{key:"readElementExp",value:function readElementExp(t,r){r=hl(t,r);var n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);if(!this.suppressValidationErr&&!Yj(i,{xmlVersion:this.xmlVersion}))throw new Error('Invalid element name: "'.concat(i,'"'));r=hl(t,r);var o="";if(t[r]==="E"&&C0(t,"MPTY",r))r+=4;else if(t[r]==="A"&&C0(t,"NY",r))r+=2;else if(t[r]==="("){r++;var a=r;for(;r<t.length&&t[r]!==")";)r++;if(o=t.substring(a,r),t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'.concat(t[r],'"'));return{elementName:i,contentModel:o.trim(),index:r}}},{key:"readAttlistExp",value:function readAttlistExp(t,r){r=hl(t,r);var n=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;var i=t.substring(n,r);for(U6(i,{xmlVersion:this.xmlVersion}),r=hl(t,r),n=r;r<t.length&&!/\s/.test(t[r]);)r++;var o=t.substring(n,r);if(!U6(o,{xmlVersion:this.xmlVersion}))throw new Error('Invalid attribute name: "'.concat(o,'"'));r=hl(t,r);var a="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(a="NOTATION",r+=8,r=hl(t,r),t[r]!=="(")throw new Error("Expected '(', found \"".concat(t[r],'"'));r++;var l=[];for(;r<t.length&&t[r]!==")";){var c=r;for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)r++;var d=t.substring(c,r);if(d=d.trim(),!U6(d,{xmlVersion:this.xmlVersion}))throw new Error('Invalid notation name: "'.concat(d,'"'));l.push(d),t[r]==="|"&&(r++,r=hl(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,a+=" ("+l.join("|")+")"}else{var l10=r;for(;r<t.length&&!/\s/.test(t[r]);)r++;a+=t.substring(l10,r);var c10=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!c10.includes(a.toUpperCase()))throw new Error('Invalid attribute type: "'.concat(a,'"'))}r=hl(t,r);var s="";var ref;return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(s="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(s="#IMPLIED",r+=7):(ref=_sliced_to_array(this.readIdentifierVal(t,r,"ATTLIST"),2),r=ref[0],s=ref[1],ref),{elementName:i,attributeName:o,attributeType:a,defaultValue:s,index:r}}}]);return B61}(),hl=function(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function C0(e,t,r){for(var n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function U6(e,t){if(Yj(e,{xmlVersion:t}))return e;throw new Error("Invalid entity name ".concat(e))}var Fat=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],cA=255,dA=new Map,Qhe=65535,Jhe=1632,sv=Jhe,zat=Qhe-Jhe+1,pA=new Uint8Array(zat).fill(cA);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Fat[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var e=_step.value;for(var t=0;t<10;t++){var r=e+t;r<=Qhe?pA[r-sv]=t:dA.set(r,t)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var Yhe=48,Xhe=57,ege=45,fA=new Set([8722,65293,65123]);function jat(e){if(typeof e!="string")return e;var t=e.length;if(t===0)return e;var r=-1;for(var i=0;i<t;i++){var o=e.charCodeAt(i);if(!(o>=Yhe&&o<=Xhe||o===ege)){if(o<sv){if(fA.has(o)){r=i;break}continue}if(o>=55296&&o<=56319){if(i+1<t){var a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){var s=65536+(o-55296<<10)+(a-56320);if(dA.has(s)){r=i;break}}}continue}if(pA[o-sv]!==cA||fA.has(o)){r=i;break}}}if(r===-1)return e;var n=[];r>0&&n.push(e.slice(0,r));for(var i10=r;i10<t;i10++){var o10=e.charCodeAt(i10);if(o10>=Yhe&&o10<=Xhe||o10===ege){n.push(e[i10]);continue}if(o10<sv){n.push(fA.has(o10)?"-":e[i10]);continue}if(o10>=55296&&o10<=56319){if(i10+1<t){var s10=e.charCodeAt(i10+1);if(s10>=56320&&s10<=57343){var l=65536+(o10-55296<<10)+(s10-56320),c=dA.get(l);if(c!==void 0){n.push(String.fromCharCode(c+48)),i10++;continue}}}n.push(e[i10]);continue}if(fA.has(o10)){n.push("-");continue}var a9=pA[o10-sv];n.push(a9!==cA?String.fromCharCode(a9+48):e[i10])}return n.join("")}var tge=jat;var Uat=/^[-+]?0x[a-fA-F0-9]+$/,Bat=/^0b[01]+$/,qat=/^0o[0-7]+$/,Wat=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Vat={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function eU(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t=Object.assign({},Vat,t),!e||typeof e!="string")return e;var r=e.trim();if(r.length===0)return e;if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(r==="0"||t.unicode&&(r=tge(r),r==="0"))return 0;if(t.hex&&Uat.test(r))return Xj(r,16);if(t.binary&&Bat.test(r))return Xj(r,2);if(t.octal&&qat.test(r))return Xj(r,8);if(isFinite(r)){if(r.includes("e")||r.includes("E"))return Hat(e,r,t);{var n=Wat.exec(r);if(n){var i=n[1]||"",o=n[2],a=Zat(n[3]),s=i?e[o.length+1]===".":e[o.length]===".";if(!t.leadingZeros&&(o.length>1||o.length===1&&!s))return e;{var l=Number(r),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return t.eNotation?l:e;if(r.indexOf(".")!==-1)return c==="0"||c===a||c==="".concat(i).concat(a)?l:e;var d=o?a:r;return o?d===c||i+d===c?l:e:d===c||d===i+c?l:e}}else return e}}else return Kat(e,Number(r),t)}var Gat=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Hat(e,t,r){if(!r.eNotation)return e;var n=t.match(Gat);if(n){var i=n[1]||"",o=n[3].indexOf("e")===-1?"E":"e",a=n[2],s=i?e[a.length+1]===o:e[a.length]===o;return a.length>1&&s?e:a.length===1&&(n[3].startsWith(".".concat(o))||n[3][0]===o)?Number(t):a.length>0?r.leadingZeros&&!s?(t=(n[1]||"")+n[3],Number(t)):e:Number(t)}else return e}function Zat(e){if(e&&e.indexOf(".")!==-1){var t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e=e.slice(0,t),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1)),e}return e}function Xj(e,t){var r=e.trim();if((t===2||t===8)&&(e=r.substring(2)),parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Kat(e,t,r){var n=t===1/0;switch(r.infinity.toLowerCase()){case"null":return null;case"infinity":return t;case"string":return n?"Infinity":"-Infinity";case"original":default:return e}}function tU(e){return typeof e=="function"?e:Array.isArray(e)?function(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(typeof r=="string"&&t===r||_instanceof(r,RegExp)&&r.test(t))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}:function(){return!1}}var E0=/*#__PURE__*/function(){"use strict";function E01(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;_class_call_check(this,E01);this.pattern=t,this.separator=r.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(function(i){return i.type==="deep-wildcard"}),this._hasAttributeCondition=this.segments.some(function(i){return i.attrName!==void 0}),this._hasPositionSelector=this.segments.some(function(i){return i.position!==void 0})}_create_class(E01,[{key:"_parse",value:function _parse(t){var r=[],n=0,i="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(r.push(this._parseSegment(i.trim())),i=""),r.push({type:"deep-wildcard"}),n+=2):(i.trim()&&r.push(this._parseSegment(i.trim())),i="",n++):(i+=t[n],n++);return i.trim()&&r.push(this._parseSegment(i.trim())),r}},{key:"_parseSegment",value:function _parseSegment(t){var r={type:"tag"},n=null,i=t,o=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(i=o[1]+o[3],o[2])){var d=o[2].slice(1,-1);d&&(n=d)}var a,s=i;if(i.includes("::")){var d10=i.indexOf("::");if(a=i.substring(0,d10).trim(),s=i.substring(d10+2).trim(),!a)throw new Error("Invalid namespace in pattern: ".concat(t))}var l,c=null;if(s.includes(":")){var d11=s.lastIndexOf(":"),u=s.substring(0,d11).trim(),p=s.substring(d11+1).trim();["first","last","odd","even"].includes(p)||/^nth\(\d+\)$/.test(p)?(l=u,c=p):l=s}else l=s;if(!l)throw new Error("Invalid segment pattern: ".concat(t));if(r.tag=l,a&&(r.namespace=a),n)if(n.includes("=")){var d12=n.indexOf("=");r.attrName=n.substring(0,d12).trim(),r.attrValue=n.substring(d12+1).trim()}else r.attrName=n.trim();if(c){var d13=c.match(/^nth\((\d+)\)$/);d13?(r.position="nth",r.positionValue=parseInt(d13[1],10)):r.position=c}return r}},{key:"length",get:function get1(){return this.segments.length}},{key:"hasDeepWildcard",value:function hasDeepWildcard(){return this._hasDeepWildcard}},{key:"hasAttributeCondition",value:function hasAttributeCondition(){return this._hasAttributeCondition}},{key:"hasPositionSelector",value:function hasPositionSelector(){return this._hasPositionSelector}},{key:"toString",value:function toString(){return this.pattern}}]);return E01}();var lv=/*#__PURE__*/function(){"use strict";function lv1(){_class_call_check(this,lv1);this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}_create_class(lv1,[{key:"add",value:function add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard()){var o=t.segments[t.segments.length-1];if(o&&o.type!=="deep-wildcard"&&o.tag!=="*"){var a=o.tag;this._deepByTerminalTag.has(a)||this._deepByTerminalTag.set(a,[]),this._deepByTerminalTag.get(a).push(t)}else this._deepWildcards.push(t);return this}var r=t.length,n=t.segments[t.segments.length-1],i=n==null?void 0:n.tag;if(!i||i==="*")this._wildcardByDepth.has(r)||this._wildcardByDepth.set(r,[]),this._wildcardByDepth.get(r).push(t);else{var o10="".concat(r,":").concat(i);this._byDepthAndTag.has(o10)||this._byDepthAndTag.set(o10,[]),this._byDepthAndTag.get(o10).push(t)}return this}},{key:"addAll",value:function addAll(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;this.add(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this}},{key:"has",value:function has(t){return this._patterns.has(t.pattern)}},{key:"size",get:function get1(){return this._patterns.size}},{key:"seal",value:function seal(){return this._sealed=!0,this}},{key:"isSealed",get:function get1(){return this._sealed}},{key:"matchesAny",value:function matchesAny(t){return this.findMatch(t)!==null}},{key:"findMatch",value:function findMatch(t){var r=t.getDepth(),n=t.getCurrentTag(),i="".concat(r,":").concat(n),o=this._byDepthAndTag.get(i);if(o){for(var l=0;l<o.length;l++)if(t.matches(o[l]))return o[l]}var a=this._wildcardByDepth.get(r);if(a){for(var l10=0;l10<a.length;l10++)if(t.matches(a[l10]))return a[l10]}var s=this._deepByTerminalTag.get(n);if(s){for(var l11=0;l11<s.length;l11++)if(t.matches(s[l11]))return s[l11]}for(var l12=0;l12<this._deepWildcards.length;l12++)if(t.matches(this._deepWildcards[l12]))return this._deepWildcards[l12];return null}}]);return lv1}();var rU=/*#__PURE__*/function(){"use strict";function rU1(t){_class_call_check(this,rU1);this._matcher=t}_create_class(rU1,[{key:"separator",get:function get1(){return this._matcher.separator}},{key:"getCurrentTag",value:function getCurrentTag(){var t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}},{key:"getCurrentNamespace",value:function getCurrentNamespace(){var t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}},{key:"getAttrValue",value:function getAttrValue(t){var n;var r=this._matcher.path;if(r.length!==0)return(n=r[r.length-1].values)==null?void 0:n[t]}},{key:"hasAttr",value:function hasAttr(t){var r=this._matcher.path;if(r.length===0)return!1;var n=r[r.length-1];return n.values!==void 0&&t in n.values}},{key:"getAnyParentAttr",value:function getAnyParentAttr(t){return this._matcher.getAnyParentAttr(t)}},{key:"hasAnyParentAttr",value:function hasAnyParentAttr(t){return this._matcher.hasAnyParentAttr(t)}},{key:"getPosition",value:function getPosition(){var r;var t=this._matcher.path;return t.length===0?-1:(r=t[t.length-1].position)!=null?r:0}},{key:"getCounter",value:function getCounter(){var r;var t=this._matcher.path;return t.length===0?-1:(r=t[t.length-1].counter)!=null?r:0}},{key:"getIndex",value:function getIndex(){return this.getPosition()}},{key:"getDepth",value:function getDepth(){return this._matcher.path.length}},{key:"toString",value:function toString(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return this._matcher.toString(t,r)}},{key:"toArray",value:function toArray(){return this._matcher.path.map(function(t){return t.tag})}},{key:"matches",value:function matches(t){return this._matcher.matches(t)}},{key:"matchesAny",value:function matchesAny(t){return t.matchesAny(this._matcher)}}]);return rU1}(),uv=/*#__PURE__*/function(){"use strict";function uv1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,uv1);this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new rU(this),this._keptAttrs=[]}_create_class(uv1,[{key:"push",value:function push(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);var o=this.path.length,a=this.siblingStacks[o];a||(a={counts:new Map,total:0},this.siblingStacks[o]=a);var s=n?"".concat(n,":").concat(t):t,l=a.counts.get(s)||0,c=a.total;a.counts.set(s,l+1),a.total++;var d={tag:t,position:c,counter:l};n!=null&&(d.namespace=n),r!=null&&(d.values=r),this.path.push(d);var u=this.path.length,p=i!==null?i.keep:null;if(p!=null&&p.length>0&&r)for(var m=0;m<p.length;m++){var h=p[m];r[h]!==void 0&&this._keptAttrs.push({depth:u,name:h,value:r[h]})}}},{key:"pop",value:function pop(){if(this.path.length===0)return;this._pathStringCache=null;var t=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);var r=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=r;)this._keptAttrs.pop();return t}},{key:"updateCurrent",value:function updateCurrent(t){if(this.path.length>0){var r=this.path[this.path.length-1];t!=null&&(r.values=t)}}},{key:"getCurrentTag",value:function getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}},{key:"getCurrentNamespace",value:function getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}},{key:"getAttrValue",value:function getAttrValue(t){var r;if(this.path.length!==0)return(r=this.path[this.path.length-1].values)==null?void 0:r[t]}},{key:"hasAttr",value:function hasAttr(t){if(this.path.length===0)return!1;var r=this.path[this.path.length-1];return r.values!==void 0&&t in r.values}},{key:"getAnyParentAttr",value:function getAnyParentAttr(t){var r=this._keptAttrs;for(var n=r.length-1;n>=0;n--)if(r[n].name===t)return r[n].value}},{key:"hasAnyParentAttr",value:function hasAnyParentAttr(t){var r=this._keptAttrs;for(var n=r.length-1;n>=0;n--)if(r[n].name===t)return!0;return!1}},{key:"getPosition",value:function getPosition(){var t;return this.path.length===0?-1:(t=this.path[this.path.length-1].position)!=null?t:0}},{key:"getCounter",value:function getCounter(){var t;return this.path.length===0?-1:(t=this.path[this.path.length-1].counter)!=null?t:0}},{key:"getIndex",value:function getIndex(){return this.getPosition()}},{key:"getDepth",value:function getDepth(){return this.path.length}},{key:"toString",value:function toString(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;var n=t||this.separator;if(n===this.separator&&r===!0){if(this._pathStringCache!==null)return this._pathStringCache;var o=this.path.map(function(a){return a.namespace?"".concat(a.namespace,":").concat(a.tag):a.tag}).join(n);return this._pathStringCache=o,o}return this.path.map(function(o){return r&&o.namespace?"".concat(o.namespace,":").concat(o.tag):o.tag}).join(n)}},{key:"toArray",value:function toArray(){return this.path.map(function(t){return t.tag})}},{key:"reset",value:function reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}},{key:"matches",value:function matches(t){var r=t.segments;return r.length===0?!1:t.hasDeepWildcard()?this._matchWithDeepWildcard(r):this._matchSimple(r)}},{key:"_matchSimple",value:function _matchSimple(t){if(this.path.length!==t.length)return!1;for(var r=0;r<t.length;r++)if(!this._matchSegment(t[r],this.path[r],r===this.path.length-1))return!1;return!0}},{key:"_matchWithDeepWildcard",value:function _matchWithDeepWildcard(t){var r=this.path.length-1,n=t.length-1;for(;n>=0&&r>=0;){var i=t[n];if(i.type==="deep-wildcard"){if(n--,n<0)return!0;var o=t[n],a=!1;for(var s=r;s>=0;s--)if(this._matchSegment(o,this.path[s],s===this.path.length-1)){r=s-1,n--,a=!0;break}if(!a)return!1}else{if(!this._matchSegment(i,this.path[r],r===this.path.length-1))return!1;r--,n--}}return n<0}},{key:"_matchSegment",value:function _matchSegment(t,r,n){var i;if(t.tag!=="*"&&t.tag!==r.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==r.namespace||t.attrName!==void 0&&(!n||!r.values||!(t.attrName in r.values)||t.attrValue!==void 0&&String(r.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!n)return!1;var o=(i=r.counter)!=null?i:0;if(t.position==="first"&&o!==0)return!1;if(t.position==="odd"&&o%2!==1)return!1;if(t.position==="even"&&o%2!==0)return!1;if(t.position==="nth"&&o!==t.positionValue)return!1}return!0}},{key:"matchesAny",value:function matchesAny(t){return t.matchesAny(this)}},{key:"snapshot",value:function snapshot(){return{path:this.path.map(function(t){return _object_spread({},t)}),siblingStacks:this.siblingStacks.map(function(t){return t&&{counts:new Map(t.counts),total:t.total}}),keptAttrs:this._keptAttrs.map(function(t){return _object_spread({},t)})}}},{key:"restore",value:function restore(t){this._pathStringCache=null,this.path=t.path.map(function(r){return _object_spread({},r)}),this.siblingStacks=t.siblingStacks.map(function(r){return r&&{counts:new Map(r.counts),total:r.total}}),this._keptAttrs=(t.keptAttrs||[]).map(function(r){return _object_spread({},r)})}},{key:"readOnly",value:function readOnly(){return this._view}}]);return uv1}();var Qat=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI — can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI — can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. <script or <script)",pattern:/(?:�*3[Cc];?|�*60;?|<)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial — catches common j or j for "j")',pattern:/(?:�*6[Aa];?|�*106;?)\s*(?:�*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() — IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= — can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" — can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes — embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag — can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],cv=Qat;var Jat=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content — can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword — used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword — used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration — defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection — can redefine namespaces to confuse parsers",pattern:/\bxmlns(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection — can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],dv=Jat;var Yat=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: — classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG — can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" — can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." — sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= — filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],nU=Yat;var Xat=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ — unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT — most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE — destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE — destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO — data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM — data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET — data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ — MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:'Classic string tautology: \' OR \'1\'=\'1 or " OR "1"="1"',pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function — used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA — reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],q6=Xat;var est=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ — climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ — climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 — truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} — can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r — can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? — can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags — can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],iU=est;var tst=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ — catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) — guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ — ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern — triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} — repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} — denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches — polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],oU=tst;var eu="[\"'\\s]*:",rst=[{id:"nosql-where-operator",description:"$where — executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp("\\$where".concat(eu),"i")},{id:"nosql-ne-operator",description:'$ne — "not equal" operator used to bypass equality checks',pattern:new RegExp("\\$ne".concat(eu),"i")},{id:"nosql-gt-operator",description:'$gt — "greater than" used to bypass password/value checks',pattern:new RegExp("\\$gte?".concat(eu),"i")},{id:"nosql-lt-operator",description:'$lt / $lte — "less than" bypass variants',pattern:new RegExp("\\$lte?".concat(eu),"i")},{id:"nosql-regex-operator",description:"$regex — can be used to extract data character by character (blind injection)",pattern:new RegExp("\\$regex".concat(eu),"i")},{id:"nosql-or-operator",description:"$or — logical OR; used to create always-true conditions",pattern:new RegExp("\\$or".concat(eu,"\\s*\\["),"i")},{id:"nosql-and-operator",description:"$and — logical AND operator injection",pattern:new RegExp("\\$and".concat(eu,"\\s*\\["),"i")},{id:"nosql-nor-operator",description:"$nor — logical NOR operator injection",pattern:new RegExp("\\$nor".concat(eu,"\\s*\\["),"i")},{id:"nosql-exists-operator",description:"$exists — can enumerate fields to determine schema",pattern:new RegExp("\\$exists".concat(eu),"i")},{id:"nosql-in-operator",description:"$in — matches any value in a list; can enumerate values",pattern:new RegExp("\\$in".concat(eu,"\\s*\\["),"i")},{id:"nosql-expr-operator",description:"$expr — allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp("\\$expr".concat(eu),"i")},{id:"nosql-function-operator",description:"$function — executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp("\\$function".concat(eu),"i")},{id:"nosql-accumulator-operator",description:"$accumulator — custom aggregation with arbitrary JS execution",pattern:new RegExp("\\$accumulator".concat(eu),"i")},{id:"nosql-proto-pollution",description:"__proto__ — prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype — alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] — bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],aU=rst;var nst=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A — decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} — data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} — Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} — Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} — JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> — Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 — can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ — can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],sU=nst;var ist=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],ost=_to_consumable_array(q6).concat(_to_consumable_array(ist)),lU=ost;cv.label="HTML";dv.label="XML";nU.label="SVG";q6.label="SQL";lU.label="SQL-STRICT";iU.label="SHELL";oU.label="REDOS";aU.label="NOSQL";sU.label="LOG";var Ofr=Object.freeze({HTML:cv,XML:dv,SVG:nU,SQL:q6,"SQL-STRICT":lU,SHELL:iU,REDOS:oU,NOSQL:aU,LOG:sU});function ast(e){if(typeof e!="string")throw new TypeError("is-unsafe: first argument must be a string, got ".concat(typeof e==="undefined"?"undefined":_type_of(e)))}function sst(e){if(!_instanceof(e,RegExp)){if(Array.isArray(e)){if(e.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(e[0])){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(!Array.isArray(t)||t.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return}throw new TypeError("is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ".concat(typeof e==="undefined"?"undefined":_type_of(e)))}}function lst(e){return _instanceof(e,RegExp)?{lists:null,regex:e}:Array.isArray(e[0])?{lists:e,regex:null}:{lists:[e],regex:null}}function ust(e,t){var n;var r=(n=t.label)!=null?n:"CUSTOM";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.pattern.test(e))return{context:r,id:i.id,description:i.description,pattern:i.pattern}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return null}function rge(e,t){ast(e),sst(t);var _lst=lst(t),r=_lst.lists,n=_lst.regex;if(n)return n.test(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(ust(e,i)!==null)return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function cst(e,t){if(!e)return{};var r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return{};var n={};for(var i in r)if(i.startsWith(t.attributeNamePrefix)){var o=i.substring(t.attributeNamePrefix.length);n[o]=r[i]}else n[i]=r[i];return n}function dst(e){if(!e||typeof e!="string")return;var t=e.indexOf(":");if(t!==-1&&t>0){var r=e.substring(0,t);if(r!=="xmlns")return r}}var W6=function W61(t,r){"use strict";_class_call_check(this,W61);this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=gst,this.parseTextData=pst,this.resolveNameSpace=fst,this.buildAttributesMap=hst,this.isItStopNode=_st,this.replaceEntitiesValue=yst,this.readStopNodeData=Sst,this.saveTextToParentTag=vst,this.addChild=xst,this.ignoreAttributesFn=tU(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;var n=_object_spread({},z6);this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(_type_of(this.options.htmlEntities)=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n=_object_spread({},Kj,Zj)),this.entityDecoder=new av({namedEntities:_object_spread({},n,r),numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:function(o,a){return rge(a,[cv,dv])?ov.BLOCK:ov.ALLOW}})),this.matcher=new uv,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new lv;var i=this.options.stopNodes;if(i&&i.length>0){for(var o=0;o<i.length;o++){var a=i[o];typeof a=="string"?this.stopNodeExpressionsSet.add(new E0(a)):_instanceof(a,E0)&&this.stopNodeExpressionsSet.add(a)}this.stopNodeExpressionsSet.seal()}};function pst(e,t,r,n,i,o,a){var s=this.options;if(e!==void 0&&(s.trimValues&&!n&&(e=e.trim()),e.length>0)){a||(e=this.replaceEntitiesValue(e,t,r));var l=s.jPath?r.toString():r,c=s.tagValueProcessor(t,e,l,i,o);return c==null?e:(typeof c==="undefined"?"undefined":_type_of(c))!=(typeof e==="undefined"?"undefined":_type_of(e))||c!==e?c:s.trimValues||e.trim()===e?dU(e,s.parseTagValue,s.numberParseOptions):e}}function fst(e){if(this.options.removeNSPrefix){var t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var mst=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function hst(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;var i=this.options;if(n===!0||i.ignoreAttributes!==!0&&typeof e=="string"){var o=sA(e,mst),a=o.length,s={},l=new Array(a),c=!1,d={};for(var m=0;m<a;m++){var h=this.resolveNameSpace(o[m][1]),g=o[m][4];if(h.length&&g!==void 0){var x=g;i.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x,r,this.readonlyMatcher),l[m]=x,d[h]=x,c=!0}}c&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&t.updateCurrent&&t.updateCurrent(d);var u=i.jPath?t.toString():this.readonlyMatcher,p=!1;for(var m10=0;m10<a;m10++){var h10=this.resolveNameSpace(o[m10][1]);if(this.ignoreAttributesFn(h10,u))continue;var g10=i.attributeNamePrefix+h10;if(h10.length)if(i.transformAttributeName&&(g10=i.transformAttributeName(g10)),g10=nge(g10,i),o[m10][4]!==void 0){var x10=l[m10],v=i.attributeValueProcessor(h10,x10,u);v==null?s[g10]=x10:(typeof v==="undefined"?"undefined":_type_of(v))!=(typeof x10==="undefined"?"undefined":_type_of(x10))||v!==x10?s[g10]=v:s[g10]=dU(x10,i.parseAttributeValue,i.numberParseOptions),p=!0}else i.allowBooleanAttributes&&(s[g10]=!0,p=!0)}if(!p)return;if(i.attributesGroupName&&!i.preserveOrder){var m11={};return m11[i.attributesGroupName]=s,m11}return s}}var gst=function gst1(e){e=e.replace(/\r\n?/g,"\n");var t=new ml("!xml"),r=t,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;var i=this.options,o=new B6(i.processEntities),a=e.length;for(var s=0;s<a;s++)if(e[s]==="<"){var c=e.charCodeAt(s+1);if(c===47){var d=pv(e,">",s,"Closing Tag is not closed."),u=e.substring(s+2,d).trim();if(i.removeNSPrefix){var m=u.indexOf(":");m!==-1&&(u=u.substr(m+1))}u=uU(i.transformTagName,u,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));var p=this.matcher.getCurrentTag();if(u&&i.unpairedTagsSet.has(u))throw new Error("Unpaired tag can not be used as closing tag: </".concat(u,">"));p&&i.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop()||t,i.captureMetaData&&r&&r.addEndIndex(d+1),n="",s=d}else if(c===63){var d10=cU(e,s,!1,"?>");if(!d10)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var u10=this.buildAttributesMap(d10.tagExp,this.matcher,d10.tagName,!0);if(u10){var p10=u10[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p10)||1),o.setXmlVersion(Number(p10)||1)}if(!(i.ignoreDeclaration&&d10.tagName==="?xml"||i.ignorePiTags)){var p11=new ml(d10.tagName);p11.add(i.textNodeName,""),d10.tagName!==d10.tagExp&&d10.attrExpPresent&&i.ignoreAttributes!==!0&&(p11[":@"]=u10),this.addChild(r,p11,this.readonlyMatcher,s),i.captureMetaData&&r.addEndIndex(d10.closeIndex+2)}s=d10.closeIndex+1}else if(c===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){var d11=pv(e,"-->",s+4,"Comment is not closed.");if(i.commentPropName){var u11=e.substring(s+4,d11-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[_define_property({},i.textNodeName,u11)])}s=d11}else if(c===33&&e.charCodeAt(s+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;var d12=o.readDocType(e,s);this.entityDecoder.addInputEntities(d12.entities),s=d12.i}else if(c===33&&e.charCodeAt(s+2)===91){var d13=pv(e,"]]>",s,"CDATA is not closed.")-2,u12=e.substring(s+9,d13);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);var p12=this.parseTextData(u12,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);p12==null&&(p12=""),i.cdataPropName?r.add(i.cdataPropName,[_define_property({},i.textNodeName,u12)]):r.add(i.textNodeName,p12),s=d13+2}else{var d14=cU(e,s,i.removeNSPrefix);if(!d14){var S=e.substring(Math.max(0,s-50),Math.min(a,s+50));throw new Error("readTagExp returned undefined at position ".concat(s,'. Context: "').concat(S,'"'))}var u13=d14.tagName,p13=d14.rawTagName,m10=d14.tagExp,h=d14.attrExpPresent,g=d14.closeIndex;var ref;if(ref=uU(i.transformTagName,u13,m10,i),u13=ref.tagName,m10=ref.tagExp,ref,i.strictReservedNames&&(u13===i.commentPropName||u13===i.cdataPropName||u13===i.textNodeName||u13===i.attributesGroupName))throw new Error("Invalid tag name: ".concat(u13));r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));var x=r;x&&i.unpairedTagsSet.has(x.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());var v=!1;m10.length>0&&m10.lastIndexOf("/")===m10.length-1&&(v=!0,u13[u13.length-1]==="/"?(u13=u13.substr(0,u13.length-1),m10=u13):m10=m10.substr(0,m10.length-1),h=u13!==m10);var y=null,_={},b=void 0;b=dst(p13),u13!==t.tagname&&this.matcher.push(u13,{},b),u13!==m10&&h&&(y=this.buildAttributesMap(m10,this.matcher,u13),y&&(_=cst(y,i))),u13!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());var w=s;if(this.isCurrentNodeStopNode){var S10="";if(v)s=d14.closeIndex;else if(i.unpairedTagsSet.has(u13))s=d14.closeIndex;else{var E=this.readStopNodeData(e,p13,g+1);if(!E)throw new Error("Unexpected end of ".concat(p13));s=E.i,S10=E.tagContent}var k=new ml(u13);y&&(k[":@"]=y),k.add(i.textNodeName,S10),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,k,this.readonlyMatcher,w),i.captureMetaData&&r.addEndIndex(s+1)}else{if(v){var ref1;ref1=uU(i.transformTagName,u13,m10,i),u13=ref1.tagName,m10=ref1.tagExp,ref1;var S11=new ml(u13);y&&(S11[":@"]=y),this.addChild(r,S11,this.readonlyMatcher,w),i.captureMetaData&&r.addEndIndex(g+1),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(u13)){var S12=new ml(u13);y&&(S12[":@"]=y),this.addChild(r,S12,this.readonlyMatcher,w),i.captureMetaData&&r.addEndIndex(d14.closeIndex+1),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=d14.closeIndex;continue}else{var S13=new ml(u13);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),y&&(S13[":@"]=y),this.addChild(r,S13,this.readonlyMatcher,w),r=S13}n="",s=g}}}else n+=e[s];return t.child};function xst(e,t,r,n){this.options.captureMetaData||(n=void 0);var i=this.options.jPath?r.toString():r,o=this.options.updateTag(t.tagname,i,t[":@"]);o===!1||(typeof o=="string"&&(t.tagname=o),e.addChild(t,n))}function yst(e,t,r){var n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){var i=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,i)))return e}if(n.tagFilter){var i10=this.options.jPath?r.toString():r;if(!n.tagFilter(t,i10))return e}return this.entityDecoder.decode(e)}function vst(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function _st(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function bst(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">";var n=0,i=e.length,o=r.charCodeAt(0),a=r.length>1?r.charCodeAt(1):-1,s="",l=t;for(var c=t;c<i;c++){var d=e.charCodeAt(c);if(n)d===n&&(n=0);else if(d===34||d===39)n=d;else if(d===o)if(a!==-1){if(e.charCodeAt(c+1)===a)return s+=e.substring(l,c),{data:s,index:c}}else return s+=e.substring(l,c),{data:s,index:c};else d===9&&!n&&(s+=e.substring(l,c)+" ",l=c+1)}}function pv(e,t,r,n){var i=e.indexOf(t,r);if(i===-1)throw new Error(n);return i+t.length-1}function wst(e,t,r,n){var i=e.indexOf(t,r);if(i===-1)throw new Error(n);return i}function cU(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">";var i=bst(e,t+1,n);if(!i)return;var o=i.data,a=i.index,s=o.search(/\s/),l=o,c=!0;s!==-1&&(l=o.substring(0,s),o=o.substring(s+1).trimStart());var d=l;if(r){var u=l.indexOf(":");u!==-1&&(l=l.substr(u+1),c=l!==i.data.substr(u+1))}return{tagName:l,tagExp:o,closeIndex:a,attrExpPresent:c,rawTagName:d}}function Sst(e,t,r){var n=r,i=1,o=e.length;for(;r<o;r++)if(e[r]==="<"){var a=e.charCodeAt(r+1);if(a===47){var s=wst(e,">",r,"".concat(t," is not closed"));if(e.substring(r+2,s).trim()===t&&(i--,i===0))return{tagContent:e.substring(n,r),i:s};r=s}else if(a===63)r=pv(e,"?>",r+1,"StopNode is not closed.");else if(a===33&&e.charCodeAt(r+2)===45&&e.charCodeAt(r+3)===45)r=pv(e,"-->",r+3,"StopNode is not closed.");else if(a===33&&e.charCodeAt(r+2)===91)r=pv(e,"]]>",r,"StopNode is not closed.")-2;else{var s10=cU(e,r,!1);s10&&((s10&&s10.tagName)===t&&s10.tagExp[s10.tagExp.length-1]!=="/"&&i++,r=s10.closeIndex)}}}function dU(e,t,r){if(t&&typeof e=="string"){var n=e.trim();return n==="true"?!0:n==="false"?!1:eU(e,r)}else return Lhe(e)?e:""}function uU(e,t,r,n){if(e){var i=e(t);r===t&&(r=i),t=i}return t=nge(t,n),{tagName:t,tagExp:r}}function nge(e,t){if(lA.includes(e))throw new Error('[SECURITY] Invalid name: "'.concat(e,'" is a reserved JavaScript keyword that could cause prototype pollution'));return L6.includes(e)?t.onDangerousProperty(e):e}var pU=ml.getMetaDataSymbol();function kst(e,t){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return{};if(!t)return e;var r={};for(var n in e)if(n.startsWith(t)){var i=n.substring(t.length);r[i]=e[n]}else r[n]=e[n];return r}function fU(e,t,r,n){return ige(e,t,r,n)}function ige(e,t,r,n){var i,o={};for(var a=0;a<e.length;a++){var s=e[a],l=Cst(s);if(l!==void 0&&l!==t.textNodeName){var c=kst(s[":@"]||{},t.attributeNamePrefix);r.push(l,c)}if(l===t.textNodeName)i===void 0?i=s[l]:i+=""+s[l];else{if(l===void 0)continue;if(s[l]){var c10=ige(s[l],t,r,n),d=Tst(c10,t);if(Object.keys(c10).length===0&&t.alwaysCreateTextNode&&(c10[t.textNodeName]=""),s[":@"]?Est(c10,s[":@"],n,t):Object.keys(c10).length===1&&c10[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c10=c10[t.textNodeName]:Object.keys(c10).length===0&&(t.alwaysCreateTextNode?c10[t.textNodeName]="":c10=""),s[pU]!==void 0&&(typeof c10==="undefined"?"undefined":_type_of(c10))=="object"&&c10!==null&&(c10[pU]=s[pU]),o[l]!==void 0&&Object.prototype.hasOwnProperty.call(o,l))Array.isArray(o[l])||(o[l]=[o[l]]),o[l].push(c10);else{var u=t.jPath?n.toString():n;t.isArray(l,u,d)?o[l]=[c10]:o[l]=c10}l!==void 0&&l!==t.textNodeName&&r.pop()}}}return typeof i=="string"?i.length>0&&(o[t.textNodeName]=i):i!==void 0&&(o[t.textNodeName]=i),o}function Cst(e){var t=Object.keys(e);for(var r=0;r<t.length;r++){var n=t[r];if(n!==":@")return n}}function Est(e,t,r,n){if(t){var i=Object.keys(t),o=i.length;for(var a=0;a<o;a++){var s=i[a],l=s.startsWith(n.attributeNamePrefix)?s.substring(n.attributeNamePrefix.length):s,c=n.jPath?r.toString()+"."+l:r;n.isArray(s,c,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function Tst(e,t){var r=t.textNodeName,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}var np=/*#__PURE__*/function(){"use strict";function np1(t){_class_call_check(this,np1);this.externalEntities={},this.options=Ghe(t)}_create_class(np1,[{key:"parse",value:function parse(t,r){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});var o=Bhe(t,r);if(o!==!0)throw Error("".concat(o.err.msg,":").concat(o.err.line,":").concat(o.err.col))}var n=new W6(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||i===void 0?i:fU(i,this.options,n.matcher,n.readonlyMatcher)}},{key:"addEntity",value:function addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}}],[{key:"getMetaDataSymbol",value:function getMetaDataSymbol(){return ml.getMetaDataSymbol()}}]);return np1}();var fv=function fv1(){return fv=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},fv.apply(this,arguments)},Ast="~",Ist="~~";function mU(e,t){for(var r={},n={},i=e.split(Ist),o=!1,a=0;i.length>a;a++){for(var s=i[a].split(Ast),l=0;l<s.length;l+=2){var c=s[l],d=s[l+1],u="&"+c+";";r[u]=d,o&&(r["&"+c]=d),n[d]=u}o=!0}return t?{entities:fv(fv({},r),t.entities),characters:fv(fv({},n),t.characters)}:{entities:r,characters:n}}var mA={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},T0={};T0.xml=mU("lt~<~gt~>~quot~\"~apos~'~amp~&");T0.html4=mU("apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~\xa0~iexcl~\xa1~cent~\xa2~pound~\xa3~curren~\xa4~yen~\xa5~brvbar~\xa6~sect~\xa7~uml~\xa8~copy~\xa9~ordf~\xaa~laquo~\xab~not~\xac~shy~\xad~reg~\xae~macr~\xaf~deg~\xb0~plusmn~\xb1~sup2~\xb2~sup3~\xb3~acute~\xb4~micro~\xb5~para~\xb6~middot~\xb7~cedil~\xb8~sup1~\xb9~ordm~\xba~raquo~\xbb~frac14~\xbc~frac12~\xbd~frac34~\xbe~iquest~\xbf~Agrave~\xc0~Aacute~\xc1~Acirc~\xc2~Atilde~\xc3~Auml~\xc4~Aring~\xc5~AElig~\xc6~Ccedil~\xc7~Egrave~\xc8~Eacute~\xc9~Ecirc~\xca~Euml~\xcb~Igrave~\xcc~Iacute~\xcd~Icirc~\xce~Iuml~\xcf~ETH~\xd0~Ntilde~\xd1~Ograve~\xd2~Oacute~\xd3~Ocirc~\xd4~Otilde~\xd5~Ouml~\xd6~times~\xd7~Oslash~\xd8~Ugrave~\xd9~Uacute~\xda~Ucirc~\xdb~Uuml~\xdc~Yacute~\xdd~THORN~\xde~szlig~\xdf~agrave~\xe0~aacute~\xe1~acirc~\xe2~atilde~\xe3~auml~\xe4~aring~\xe5~aelig~\xe6~ccedil~\xe7~egrave~\xe8~eacute~\xe9~ecirc~\xea~euml~\xeb~igrave~\xec~iacute~\xed~icirc~\xee~iuml~\xef~eth~\xf0~ntilde~\xf1~ograve~\xf2~oacute~\xf3~ocirc~\xf4~otilde~\xf5~ouml~\xf6~divide~\xf7~oslash~\xf8~ugrave~\xf9~uacute~\xfa~ucirc~\xfb~uuml~\xfc~yacute~\xfd~thorn~\xfe~yuml~\xff~quot~\"~amp~&~lt~<~gt~>");T0.html5=mU('Abreve~Ă~Acy~А~Afr~\uD835\uDD04~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~\uD835\uDD38~ApplyFunction~~Ascr~\uD835\uDC9C~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~\uD835\uDD05~Bopf~\uD835\uDD39~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~\xb8~CenterDot~\xb7~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~\uD835\uDC9E~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~\uD835\uDD07~DiacriticalAcute~\xb4~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~\uD835\uDD3B~Dot~\xa8~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~\xa8~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~\uD835\uDC9F~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~\uD835\uDD08~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~\uD835\uDD3C~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~\uD835\uDD09~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~\uD835\uDD3D~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~\uD835\uDD0A~Gg~⋙~Gopf~\uD835\uDD3E~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~\uD835\uDCA2~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~\uD835\uDD40~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~\uD835\uDD0D~Jopf~\uD835\uDD41~Jscr~\uD835\uDCA5~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~\uD835\uDD0E~Kopf~\uD835\uDD42~Kscr~\uD835\uDCA6~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~\uD835\uDD0F~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~\uD835\uDD43~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~\uD835\uDD10~MinusPlus~∓~Mopf~\uD835\uDD44~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~\uD835\uDD11~NoBreak~~NonBreakingSpace~\xa0~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~\uD835\uDCA9~Ocy~О~Odblac~Ő~Ofr~\uD835\uDD12~Omacr~Ō~Oopf~\uD835\uDD46~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~\uD835\uDCAA~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~\uD835\uDD13~PlusMinus~\xb1~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~\uD835\uDCAB~Qfr~\uD835\uDD14~Qopf~ℚ~Qscr~\uD835\uDCAC~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~\uD835\uDD16~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~\uD835\uDD4A~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~\uD835\uDCAE~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~\uD835\uDD17~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~\uD835\uDD4B~TripleDot~⃛~Tscr~\uD835\uDCAF~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~\uD835\uDD18~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~\uD835\uDD4C~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~\uD835\uDCB0~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~\uD835\uDD19~Vopf~\uD835\uDD4D~Vscr~\uD835\uDCB1~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~\uD835\uDD1A~Wopf~\uD835\uDD4E~Wscr~\uD835\uDCB2~Xfr~\uD835\uDD1B~Xopf~\uD835\uDD4F~Xscr~\uD835\uDCB3~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~\uD835\uDD1C~Yopf~\uD835\uDD50~Yscr~\uD835\uDCB4~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~\uD835\uDCB5~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~\uD835\uDD1E~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~\xc5~angzarr~⍼~aogon~ą~aopf~\uD835\uDD52~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~\uD835\uDCB6~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~\uD835\uDD1F~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~\uD835\uDD53~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~\uD835\uDCB7~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~\xb7~cfr~\uD835\uDD20~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~\xae~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~\uD835\uDD54~coprod~∐~copysr~℗~cross~✗~cscr~\uD835\uDCB8~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~\uD835\uDD21~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~\xa8~digamma~ϝ~disin~⋲~div~\xf7~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~\uD835\uDD55~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~\uD835\uDCB9~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~\uD835\uDD22~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~\uD835\uDD56~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~\uD835\uDD23~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~\uD835\uDD57~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~\uD835\uDCBB~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~\uD835\uDD24~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~\uD835\uDD58~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~\xbd~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~\uD835\uDD25~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~\uD835\uDD59~horbar~―~hscr~\uD835\uDCBD~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~\uD835\uDD26~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~\uD835\uDD5A~iprod~⨼~iscr~\uD835\uDCBE~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~\uD835\uDD27~jmath~ȷ~jopf~\uD835\uDD5B~jscr~\uD835\uDCBF~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~\uD835\uDD28~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~\uD835\uDD5C~kscr~\uD835\uDCC0~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~\uD835\uDD29~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~\uD835\uDD5D~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~\uD835\uDCC1~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~\uD835\uDD2A~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~\uD835\uDD5E~mp~∓~mscr~\uD835\uDCC2~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~\uD835\uDD2B~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~\uD835\uDD5F~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~\uD835\uDCC3~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~\uD835\uDD2C~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~\uD835\uDD60~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~\uD835\uDD2D~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~\xb1~pointint~⨕~popf~\uD835\uDD61~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~\uD835\uDCC5~puncsp~ ~qfr~\uD835\uDD2E~qint~⨌~qopf~\uD835\uDD62~qprime~⁗~qscr~\uD835\uDCC6~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~\uD835\uDD2F~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~\uD835\uDD63~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~\uD835\uDCC7~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~\uD835\uDD30~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~\uD835\uDD64~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~\uD835\uDCC8~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~\xaf~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~\uD835\uDD31~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~\uD835\uDD65~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~\uD835\uDCC9~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~\uD835\uDD32~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~\uD835\uDD66~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~\uD835\uDCCA~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~\uD835\uDD33~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~\uD835\uDD67~vprop~∝~vrtri~⊳~vscr~\uD835\uDCCB~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~\uD835\uDD34~wopf~\uD835\uDD68~wp~℘~wr~≀~wreath~≀~wscr~\uD835\uDCCC~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~\uD835\uDD35~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~\uD835\uDD69~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~\uD835\uDCCD~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~\uD835\uDD36~yicy~ї~yopf~\uD835\uDD6A~yscr~\uD835\uDCCE~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~\uD835\uDD37~zhcy~ж~zigrarr~⇝~zopf~\uD835\uDD6B~zscr~\uD835\uDCCF~~AMP~&~COPY~\xa9~GT~>~LT~<~QUOT~"~REG~\xae',T0.html4);var oge={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var age=String.fromCodePoint||function(e){return String.fromCharCode(Math.floor((e-65536)/1024)+55296,(e-65536)%1024+56320)},Pst=String.prototype.codePointAt?function Pst1(e,t){return e.codePointAt(t)}:function(e,t){return(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536};var mv=function mv1(){return mv=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},mv.apply(this,arguments)},Rst=mv(mv({},T0),{all:T0.html5});var Mst={scope:"body",level:"all"},hU=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,gU=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,sge={xml:{strict:hU,attribute:gU,body:mA.xml},html4:{strict:hU,attribute:gU,body:mA.html4},html5:{strict:hU,attribute:gU,body:mA.html5}},Ost=mv(mv({},sge),{all:sge.html5}),lge=String.fromCharCode,$st=lge(65533);function Nst(e,t,r,n){var i=e,o=e[e.length-1];if(r&&o==="=")i=e;else if(n&&o!==";")i=e;else{var a=t[e];if(a)i=a;else if(e[0]==="&"&&e[1]==="#"){var s=e[2],l=s=="x"||s=="X"?parseInt(e.substr(3),16):parseInt(e.substr(2));i=l>=1114111?$st:l>65535?age(l):lge(oge[l]||l)}}return i}function uge(e,t){var r=t===void 0?Mst:t,n=r.level,i=n===void 0?"all":n,o=r.scope,a=o===void 0?i==="xml"?"strict":"body":o;if(!e)return"";var s=Ost[i][a],l=Rst[i].entities,c=a==="attribute",d=a==="strict";return e.replace(s,function(u){return Nst(u,l,c,d)})}var T0e=nr(E0e(),1),_h=new T0e.default({maxConcurrent:1,minTime:200});function kA(e,t){return"".concat(aA(e),"/").concat(t)}var A0e=_h.wrap(function(param){var e=param.folderName,t=param.cursor,r=param.settings,n=param.token;return _async_to_generator(function(){var l,i,o,s,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c10;return _ts_generator(this,function(_state){switch(_state.label){case 0:i='<?xml version="1.0" encoding="utf-8"?>\n <s:delta xmlns:s="http://ns.jianguoyun.com">\n <s:folderName>'.concat(e,"</s:folderName>\n <s:cursor>").concat(t!=null?t:"","</s:cursor>\n </s:delta>");return[4,Su({url:kA(r,"delta"),method:"POST",headers:{Authorization:"Basic ".concat(n),"Content-Type":"application/xml"},body:i})];case 1:o=_state.sent(),s=new np({attributeNamePrefix:"",removeNSPrefix:!0,numberParseOptions:{eNotation:!1,hex:!0,leadingZeros:!0},processEntities:!1}).parse(o.text);if(lo((l=s==null?void 0:s.response)==null?void 0:l.cursor)||(s.response.cursor=s.response.cursor.toString()),s.response.delta){c=s.response.delta.entry;Array.isArray(c)||(s.response.delta.entry=[c])}else s.response.delta={entry:[]};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=s.response.delta.entry[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){c10=_step.value;c10.path=uge(c10.path)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,s]}})})()});var CA=_h.wrap(function(param){var e=param.folderName,t=param.settings,r=param.token;return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:n='<?xml version="1.0" encoding="utf-8"?>\n <s:delta xmlns:s="http://ns.jianguoyun.com">\n <s:folderName>'.concat(e,"</s:folderName>\n </s:delta>"),i={Authorization:"Basic ".concat(r),"Content-Type":"application/xml"};return[4,Su({url:kA(t,"latestDeltaCursor"),method:"POST",headers:i,body:n})];case 1:o=_state.sent();return[2,new np({attributeNamePrefix:"",removeNSPrefix:!0,parseTagValue:!1,numberParseOptions:{eNotation:!1,hex:!0,leadingZeros:!0},processEntities:!1}).parse(o.text)]}})})()});var EA=nr(ln(),1);var I0e="Invalid response: 503 Service Unavailable";function Lc(e){return _instanceof(e,Error)?e.message===I0e:e===I0e}function I0(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,new Promise(function(t){return window.setTimeout(t,e)})];case 1:_state.sent();return[2]}})})()}function Hst(e){var t=e.match(/<([^>]+)>;\s*rel="next"/);return t?t[1]:null}function Zst(e,t){var a;var r=t.propstat.prop,n=!lo((a=r.resourcetype)==null?void 0:a.collection),i=decodeURIComponent(t.href),o=e==="/"?i:(0,EA.join)("/",i.replace(e,""));return{filename:o,basename:(0,EA.basename)(o),lastmod:r.getlastmodified||"",size:r.getcontentlength?parseInt(r.getcontentlength,10):0,type:n?"directory":"file",etag:null,mime:r.getcontenttype}}function TA(e,t,r){return _async_to_generator(function(){var n,i,o,a,_n,_$s,c,d,u,p,m,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=[],i=rp(e),o=new URL(i).pathname;r=r.split("/").map(encodeURIComponent).join("/"),r.startsWith("/")||(r="/"+r);a="".concat(i).concat(r);_state.label=1;case 1:_state.trys.push([1,3,,6]);return[4,Su({url:a,method:"PROPFIND",headers:{Authorization:"Basic ".concat(t),"Content-Type":"application/xml",Depth:"1"},body:'<?xml version="1.0" encoding="utf-8"?>\n <propfind xmlns="DAV:">\n <prop>\n <displayname/>\n <resourcetype/>\n <getlastmodified/>\n <getcontentlength/>\n <getcontenttype/>\n </prop>\n </propfind>'})];case 2:_$s=_state.sent(),c=new np({attributeNamePrefix:"",removeNSPrefix:!0,parseTagValue:!1,numberParseOptions:{eNotation:!1,hex:!0,leadingZeros:!0},processEntities:!1}).parse(_$s.text),d=Array.isArray(c.multistatus.response)?c.multistatus.response:[c.multistatus.response];(_n=n).push.apply(_n,_to_consumable_array(d.slice(1).map(JO(Zst,o))));u=_$s.headers.link||_$s.headers.Link;if(!u)return[3,7];p=Hst(u);if(!p)return[3,7];m=new URL(p);m.pathname=decodeURI(m.pathname),a=m.toString();return[3,6];case 3:s=_state.sent();if(!Lc(s))return[3,5];Me.error("503 error, retrying...");return[4,I0(6e4)];case 4:_state.sent();return[3,6];case 5:throw s;case 6:return[3,1];case 7:return[2,n]}})})()}var P0e=nr(ln(),1);function V6(e){return e=(0,P0e.normalize)(e),e.startsWith("/")&&(e=e.slice(1)),e.split("/")[0]}var M0e=nr(ln(),1);function R0e(e){return Xi(e).slice(0,-1)}function IU(e,t){if(!(0,M0e.isAbsolute)(e))return!0;var r=R0e(e),n=R0e(t);return r===n||r.startsWith("".concat(n,"/"))}function AA(e,t){var r,n;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=((r=e.queue)!=null?r:[])[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(!IU(i,t))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries((n=e.nodes)!=null?n:{})[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step1.value,2),i10=_step_value[0],o=_step_value[1];if(!IU(i10,t))return!1;var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=o[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var a=_step2.value;if(!IU(a.path,t))return!1}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!0}var Kst=_h.wrap(TA),PU=new Map;function Qst(e){return PU.has(e)||PU.set(e,new iv),PU.get(e)}function Jst(_01){return _async_to_generator(function(e){var t,r,n,i,o,a,s;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{};_state.label=1;case 1:(r=t.throwIfCancelled)==null||r.call(t);_state.label=2;case 2:_state.trys.push([2,4,,11]);return[4,e()];case 3:return[2,_state.sent()];case 4:o=_state.sent();a=_instanceof(o,Error)||typeof o=="string"?o:new Error(String(o));if(!Lc(a))return[3,9];(n=t.onRetry)==null||n.call(t);s=0;_state.label=5;case 5:if(!(s<3e4))return[3,8];(i=t.throwIfCancelled)==null||i.call(t);return[4,I0(500)];case 6:_state.sent();_state.label=7;case 7:s+=500;return[3,5];case 8:return[3,10];case 9:throw o;case 10:return[3,11];case 11:return[3,1];case 12:return[2]}})}).apply(this,arguments)}var IA=/*#__PURE__*/function(){"use strict";function IA1(t){_class_call_check(this,IA1);A(this,"token");A(this,"remoteBaseDir");A(this,"kvKey");A(this,"saveInterval");A(this,"settings");A(this,"onProgress");A(this,"throwIfCancelled");A(this,"rootCursor","");A(this,"queue",[]);A(this,"nodes",{});A(this,"processedCount",0);A(this,"discoveredCount",0);A(this,"processedChanges",0);this.settings=t.settings,this.token=t.token,this.remoteBaseDir=t.remoteBaseDir,this.kvKey=t.kvKey,this.saveInterval=Math.max(t.saveInterval||1,1),this.onProgress=t.onProgress,this.throwIfCancelled=t.throwIfCancelled}_create_class(IA1,[{key:"normalizeDirPath",value:function normalizeDirPath(t){return Xi(t)}},{key:"normalizeForComparison",value:function normalizeForComparison(t){var r=(0,gv.normalize)(t);return r.endsWith("/")&&r.length>1&&(r=r.slice(0,-1)),r}},{key:"emitProgress",value:function emitProgress(t,r){var n;(n=this.onProgress)==null||n.call(this,{phase:t,currentPath:r,processedDirectories:this.processedCount,queuedDirectories:this.queue.length,discoveredItems:this.discoveredCount,processedChanges:this.processedChanges})}},{key:"checkCancelled",value:function checkCancelled(){var t;(t=this.throwIfCancelled)==null||t.call(this)}},{key:"executeWithRetry",value:function executeWithRetry(t,r){var _this=this;return Jst(t,{throwIfCancelled:this.throwIfCancelled,onRetry:function(){return _this.emitProgress("retrying",r)}})}},{key:"lock",get:function get1(){return Qst(this.kvKey)}},{key:"cursor",get:function get1(){return this.rootCursor}},{key:"traverse",value:function traverse(){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.lock.runExclusive(function(){return _async_to_generator(function(){var _this,_ref,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.checkCancelled();return[4,this.loadState()];case 1:if(!(_state.sent(),this.queue.length===0&&Object.keys(this.nodes).length>0))return[3,3];return[4,this.incrementalScan()];case 2:_state.sent();return[3,7];case 3:if(!(this.queue.length===0))return[3,5];return[4,this.executeWithRetry(function(){return CA({token:_this.token,settings:_this.settings,folderName:V6(_this.remoteBaseDir)})})];case 4:_ref=_state.sent(),r=_ref.response;this.rootCursor=r.cursor,this.queue=[this.remoteBaseDir];_state.label=5;case 5:return[4,this.bfsTraverse()];case 6:_state.sent();_state.label=7;case 7:return[4,this.saveState()];case 8:return[2,(_state.sent(),this.emitProgress("complete"),this.getAllFromCache())]}})}).call(_this)})];case 1:return[2,_state.sent()]}})}).call(this)}},{key:"bfsTraverse",value:function bfsTraverse(){return _async_to_generator(function(){var _this,_this1,_loop,t,r,_ref,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_loop=function(){var o,a,s,_s1,_r1,_$l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,c10,_tmp,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this1.checkCancelled();o=_this1.queue[0];_this1.emitProgress("scanning",o);a=_this1.normalizeDirPath(o),s=[];_state.label=1;case 1:_state.trys.push([1,7,,9]);_$l=_this1.nodes[a];if(!_$l)return[3,2];(_s1=s).push.apply(_s1,_to_consumable_array(_$l));return[3,4];case 2:return[4,_this1.executeWithRetry(function(){return Kst(_this.settings,_this.token,o)},o)];case 3:c=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;u=zx(d);s.push(u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_this1.discoveredCount+=s.length;_state.label=4;case 4:(_r1=r).push.apply(_r1,_to_consumable_array(s));_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=s[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){c10=_step1.value;c10.isDir&&_this1.queue.push(c10.path)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_this1.nodes[a]=s,_this1.queue.shift(),_this1.processedCount++,_this1.emitProgress("scanning",o);_tmp=_this1.processedCount%_this1.saveInterval===0;if(!_tmp)return[3,6];return[4,_this1.saveState()];case 5:_tmp=_state.sent();_state.label=6;case 6:_tmp;return[3,9];case 7:l=_state.sent();Me.error("Error processing ".concat(o),l);return[4,_this1.saveState()];case 8:throw _state.sent(),l;case 9:return[2]}})};t=this.rootCursor,r=[];_state.label=2;case 2:if(!(this.queue.length>0))return[3,5];_this1=this;return[5,_ts_values(_loop())];case 3:_state.sent();_state.label=4;case 4:return[3,2];case 5:return[4,this.executeWithRetry(function(){return CA({token:_this.token,settings:_this.settings,folderName:V6(_this.remoteBaseDir)})})];case 6:_ref=_state.sent(),n=_ref.response,i=n.cursor;if(!(t&&t!==i))return[3,8];Me.info("Changes detected during traversal, applying delta");return[4,this.applyDeltaDuringTraversal(t)];case 7:o=_state.sent();if(this.rootCursor=o,this.queue.length>0){Me.info("Reset detected during delta apply, performing full re-scan");return[3,9]}return[2,this.getAllFromCache()];case 8:return[2,(this.rootCursor=i,r)];case 9:return[3,1];case 10:return[2]}})}).call(this)}},{key:"fetchAllDelta",value:function fetchAllDelta(t){return _wrap_async_generator(function(){var _this,r,_ref,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;r=t;_state.label=1;case 1:return[4,_await_async_generator(this.executeWithRetry(function(){return A0e({token:_this.token,settings:_this.settings,folderName:V6(_this.remoteBaseDir),cursor:r})}))];case 2:_ref=_state.sent(),n=_ref.response;if(!n.reset)return[3,4];return[4,{entries:[],cursor:n.cursor,reset:!0,hasMore:!1}];case 3:_state.sent();return[2];case 4:r=n.cursor;return[4,{entries:n.delta.entry,cursor:r,reset:!1,hasMore:n.hasMore}];case 5:if(_state.sent(),!n.hasMore)return[3,7];_state.label=6;case 6:return[3,1];case 7:return[2]}})}).call(this)}},{key:"applyDeltaDuringTraversal",value:function applyDeltaDuringTraversal(t){return _async_to_generator(function(){var _this,r,n,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,i,o,a,_ref,s,_tmp,_tmp1,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;r=t,n=0;_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=1;case 1:_state.trys.push([1,11,12,17]);_iterator=_async_iterator(this.fetchAllDelta(t));_state.label=2;case 2:return[4,_iterator.next()];case 3:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,10];_value=_step.value;i=_value.entries,o=_value.cursor,a=_value.reset;if(!(this.checkCancelled(),a))return[3,5];Me.warn("Delta reset during traversal, clearing cache and will trigger full re-scan"),this.nodes={},this.queue=[this.remoteBaseDir],this.processedCount=0;return[4,this.executeWithRetry(function(){return CA({token:_this.token,settings:_this.settings,folderName:V6(_this.remoteBaseDir)})})];case 4:_ref=_state.sent(),s=_ref.response;return[2,s.cursor];case 5:_tmp=i.length>0;if(!_tmp)return[3,8];n+=this.applyDeltaEntries(i);_tmp1=n>=this.saveInterval;if(!_tmp1)return[3,7];return[4,this.saveState()];case 6:_tmp1=(_state.sent(),n=0);_state.label=7;case 7:_tmp=_tmp1;_state.label=8;case 8:_tmp,r=o;_state.label=9;case 9:_iteratorAbruptCompletion=false;return[3,2];case 10:return[3,17];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 12:_state.trys.push([12,,15,16]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,14];return[4,_iterator.return()];case 13:_state.sent();_state.label=14;case 14:return[3,16];case 15:if(_didIteratorError){throw _iteratorError}return[7];case 16:return[7];case 17:return[4,this.saveState()];case 18:return[2,(_state.sent(),r)]}})}).call(this)}},{key:"incrementalScan",value:function incrementalScan(){return _async_to_generator(function(){var t,r,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,n,i,o,a,_tmp,_tmp1,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=!1,r=0;_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=1;case 1:_state.trys.push([1,12,13,18]);_iterator=_async_iterator(this.fetchAllDelta(this.rootCursor));_state.label=2;case 2:return[4,_iterator.next()];case 3:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,11];_value=_step.value;n=_value;this.checkCancelled();i=n.entries,o=n.cursor,a=n.reset;if(!(this.rootCursor=o,a))return[3,5];Me.info("Delta reset, performing full scan"),this.queue=[this.remoteBaseDir],this.nodes={},this.processedCount=0;return[4,this.bfsTraverse()];case 4:return[2,_state.sent()];case 5:if(!(i.length>0))return[3,8];t=!0,r+=this.applyDeltaEntries(i);_tmp1=r>=this.saveInterval;if(!_tmp1)return[3,7];return[4,this.saveState()];case 6:_tmp1=(_state.sent(),r=0);_state.label=7;case 7:_tmp=_tmp1;return[3,9];case 8:_tmp=this.emitProgress("incremental");_state.label=9;case 9:_tmp;_state.label=10;case 10:_iteratorAbruptCompletion=false;return[3,2];case 11:return[3,18];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 13:_state.trys.push([13,,16,17]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,15];return[4,_iterator.return()];case 14:_state.sent();_state.label=15;case 15:return[3,17];case 16:if(_didIteratorError){throw _iteratorError}return[7];case 17:return[7];case 18:return[4,this.saveState()];case 19:return[2,(_state.sent(),t||Me.info("No changes detected, returning from cache"),this.getAllFromCache())]}})}).call(this)}},{key:"applyDeltaToNodes",value:function applyDeltaToNodes(t){var _this=this;var r=this.remoteBaseDir.endsWith("/")?this.remoteBaseDir:this.remoteBaseDir+"/",n=_to_consumable_array(t).sort(function(i,o){return i.path.length-o.path.length});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _this1,_loop=function(){var i=_step.value;var o=_this1.normalizeDirPath(_this1.remoteBaseDir),a=_this1.normalizeDirPath(i.path),s=a===o,l=i.path.startsWith(r);if(!(!s&&!l))if(i.isDir)if(i.isDeleted){var c=(0,gv.dirname)(i.path);if(c){var d=_this1.normalizeDirPath(c),u=_this1.nodes[d];if(u){var p=_this1.normalizeForComparison(i.path);_this1.nodes[d]=u.filter(function(m){return _this.normalizeForComparison(m.path)!==p})}}for(var d10 in _this1.nodes)(d10===a||d10.startsWith(a))&&delete _this1.nodes[d10]}else{var c10=(0,gv.dirname)(i.path);if(c10){var d11=_this1.normalizeDirPath(c10),u10=_this1.nodes[d11];if(u10){var p10={path:i.path,basename:i.path.split("/").pop()||"",isDir:!0,isDeleted:!1,mtime:i.modified?new Date(i.modified).getTime():void 0},m=_this1.normalizeForComparison(i.path);_this1.nodes[d11]=_to_consumable_array(u10.filter(function(h){return _this.normalizeForComparison(h.path)!==m})).concat([p10])}}_this1.nodes[a]||(_this1.nodes[a]=[])}else{var c11=(0,gv.dirname)(i.path);if(c11){var d12=_this1.normalizeDirPath(c11);if(i.isDeleted){var u11=_this1.nodes[d12];if(u11){var p11=_this1.normalizeForComparison(i.path);_this1.nodes[d12]=u11.filter(function(m){return _this.normalizeForComparison(m.path)!==p11})}}else{var u12=_this1.nodes[d12];if(u12){var p12={path:i.path,basename:i.path.split("/").pop()||"",isDir:!1,isDeleted:!1,mtime:new Date(i.modified).getTime(),size:i.size},m10=_this1.normalizeForComparison(i.path);_this1.nodes[d12]=_to_consumable_array(u12.filter(function(h){return _this.normalizeForComparison(h.path)!==m10})).concat([p12])}}}}};for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_this1=this,_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"getAllFromCache",value:function getAllFromCache(){var _t1;var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(this.nodes)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;(_t1=t).push.apply(_t1,_to_consumable_array(r))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}},{key:"countDiscoveredItems",value:function countDiscoveredItems(){return Object.values(this.nodes).reduce(function(t,r){return t+r.length},0)}},{key:"applyDeltaEntries",value:function applyDeltaEntries(t){return this.applyDeltaToNodes(t),this.processedChanges+=t.length,this.discoveredCount=this.countDiscoveredItems(),this.emitProgress("incremental"),t.length}},{key:"loadState",value:function loadState(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Eu.get(this.kvKey)];case 1:t=_state.sent();if(!t)return[3,4];if(!!AA(t,this.remoteBaseDir))return[3,3];Me.warn("Discarding incompatible traversal cache for current remote directory");return[4,Eu.unset(this.kvKey)];case 2:_state.sent(),this.rootCursor="",this.queue=[],this.nodes={};return[2];case 3:this.rootCursor=t.rootCursor||"",this.queue=t.queue||[],this.nodes=t.nodes||{},this.processedCount=Object.keys(this.nodes).length,this.discoveredCount=this.countDiscoveredItems();_state.label=4;case 4:return[2]}})}).call(this)}},{key:"saveState",value:function saveState(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Eu.set(this.kvKey,{rootCursor:this.rootCursor,queue:this.queue,nodes:this.nodes})];case 1:_state.sent();return[2]}})}).call(this)}},{key:"clearCache",value:function clearCache(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Eu.unset(this.kvKey)];case 1:_state.sent(),this.rootCursor="",this.queue=[],this.nodes={},this.processedCount=0,this.discoveredCount=0,this.processedChanges=0;return[2]}})}).call(this)}},{key:"isCacheValid",value:function isCacheValid(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Eu.get(this.kvKey)];case 1:t=_state.sent();return[2,t?t.queue.length===0:!1]}})}).call(this)}}]);return IA1}();var xv=/*#__PURE__*/function(){"use strict";function xv1(t){_class_call_check(this,xv1);this.options=t}_create_class(xv1,[{key:"walk",value:function walk(){return _async_to_generator(function(){var _this,m,h,r,_,_tmp,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g,x,v,o,a,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_=IA.bind;_tmp={settings:this.options.settings,token:this.options.token,remoteBaseDir:this.options.remoteBaseDir};return[4,oA(this.options.remoteAccountId,rp(this.options.settings),this.options.remoteBaseDir)];case 1:return[4,(new(_.apply(IA,[void 0,(_tmp.kvKey=_state.sent(),_tmp.saveInterval=1,_tmp.onProgress=this.options.onTraversalProgress,_tmp.throwIfCancelled=this.options.throwIfCancelled,_tmp)]))).traverse()];case 2:r=_state.sent();if(r.length===0)return[2,[]];n=O0e(Xi(this.options.remoteBaseDir)),i=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){g=_step.value;x=O0e((0,yv.isAbsolute)(g.path)?g.path:(0,yv.join)(n,g.path));if(!Dc(n,x))continue;v=x.slice(n==="/"?1:n.length).replace(/^\/+/,"");i.has(v)||i.set(v,_object_spread_props(_object_spread({},g),{path:v}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o=_to_consumable_array(i.values()),a=this.options.filterRules?void 0:this.options.settings,s=(h=this.options.filterRules)!=null?h:a?O6(this.options.vault.configDir,(m=a.configDirSyncMode)!=null?m:"none",a.filterRules):void 0,l=tv(s==null?void 0:s.rules),c=o.filter(function(g){return!nA(g.path,_this.options.vault.configDir)&&rv(g.path,l,g.isDir)}),d=N6(o,c),u=new Set(d.map(function(g){return g.path}));return[2,o.map(function(g){return{stat:g,ignored:!u.has(g.path)}})]}})}).call(this)}}]);return xv1}();function O0e(e){var t=(0,yv.normalize)(e);return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}var BA=nr(ln(),1);var PA=/*#__PURE__*/function(){"use strict";function PA1(){_class_call_check(this,PA1);this.keyToValue=new Map,this.valueToKey=new Map}_create_class(PA1,[{key:"set",value:function set1(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}},{key:"getByKey",value:function getByKey(t){return this.keyToValue.get(t)}},{key:"getByValue",value:function getByValue(t){return this.valueToKey.get(t)}},{key:"clear",value:function clear(){this.keyToValue.clear(),this.valueToKey.clear()}}]);return PA1}();var vv=/*#__PURE__*/function(){"use strict";function vv1(t){_class_call_check(this,vv1);this.generateIdentifier=t,this.kv=new PA}_create_class(vv1,[{key:"register",value:function register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}},{key:"clear",value:function clear(){this.kv.clear()}},{key:"getIdentifier",value:function getIdentifier(t){return this.kv.getByValue(t)}},{key:"getValue",value:function getValue(t){return this.kv.getByKey(t)}}]);return vv1}();var RA=/*#__PURE__*/function(vv1){"use strict";_inherits(RA1,vv1);function RA1(){_class_call_check(this,RA1);var _this;_this=_call_super(this,RA1,[function(t){return t.name}]),_this.classToAllowedProps=new Map;return _this}_create_class(RA1,[{key:"register",value:function register(t,r){(typeof r==="undefined"?"undefined":_type_of(r))=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),_get(_get_prototype_of(RA1.prototype),"register",this).call(this,t,r.identifier)):_get(_get_prototype_of(RA1.prototype),"register",this).call(this,t,r)}},{key:"getAllowedProps",value:function getAllowedProps(t){return this.classToAllowedProps.get(t)}}]);return RA1}(vv);function Yst(e){if("values"in Object)return Object.values(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function $0e(e,t){var r=Yst(e);if("find"in r)return r.find(t);var n=r;for(var i=0;i<n.length;i++){var o=n[i];if(t(o))return o}}function P0(e,t){Object.entries(e).forEach(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];return t(n,r)})}function _v(e,t){return e.indexOf(t)!==-1}function RU(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}}var MA=/*#__PURE__*/function(){"use strict";function MA1(){_class_call_check(this,MA1);this.transfomers={}}_create_class(MA1,[{key:"register",value:function register(t){this.transfomers[t.name]=t}},{key:"findApplicable",value:function findApplicable(t){return $0e(this.transfomers,function(r){return r.isApplicable(t)})}},{key:"findByName",value:function findByName(t){return this.transfomers[t]}}]);return MA1}();var Xst=function(e){return Object.prototype.toString.call(e).slice(8,-1)},MU=function(e){return typeof e=="undefined"},elt=function(e){return e===null},R0=function(e){return(typeof e==="undefined"?"undefined":_type_of(e))!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},OA=function(e){return R0(e)&&Object.keys(e).length===0},Fc=function(e){return Array.isArray(e)},tlt=function(e){return typeof e=="string"},rlt=function(e){return typeof e=="number"&&!isNaN(e)},nlt=function(e){return typeof e=="boolean"},N0e=function(e){return _instanceof(e,RegExp)},bh=function(e){return _instanceof(e,Map)},wh=function(e){return _instanceof(e,Set)},OU=function(e){return Xst(e)==="Symbol"},D0e=function(e){return _instanceof(e,Date)&&!isNaN(e.valueOf())},$A=function(e){return _instanceof(e,Error)},$U=function(e){return typeof e=="number"&&isNaN(e)},L0e=function(e){return nlt(e)||elt(e)||MU(e)||rlt(e)||tlt(e)||OU(e)},F0e=function(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="bigint"},z0e=function(e){return e===1/0||e===-1/0},j0e=function(e){return ArrayBuffer.isView(e)&&!_instanceof(e,DataView)},U0e=function(e){return _instanceof(e,URL)};var NA=function(e){return e.replace(/\\/g,"\\\\").replace(/\./g,"\\.")},DA=function(e){return e.map(String).map(NA).join(".")},bv=function(e,t){var r=[],n="";for(var o=0;o<e.length;o++){var a=e.charAt(o);if(!t&&a==="\\"){var c=e.charAt(o+1);if(c==="\\"){n+="\\",o++;continue}else if(c!==".")throw Error("invalid path")}if(a==="\\"&&e.charAt(o+1)==="."){n+=".",o++;continue}if(a==="."){r.push(n),n="";continue}n+=a}var i=n;return r.push(i),r};function ap(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var B0e=[ap(MU,"undefined",function(){return null},function(){}),ap(F0e,"bigint",function(e){return e.toString()},function(e){return typeof BigInt!="undefined"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)}),ap(D0e,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),ap($A,"Error",function(e,t){var r={name:e.name,message:e.message};return"cause"in e&&(r.cause=e.cause),t.allowedErrorProps.forEach(function(n){r[n]=e[n]}),r},function(e,t){var r=new Error(e.message,{cause:e.cause});return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(function(n){r[n]=e[n]}),r}),ap(N0e,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),ap(wh,"set",function(e){return _to_consumable_array(e.values())},function(e){return new Set(e)}),ap(bh,"map",function(e){return _to_consumable_array(e.entries())},function(e){return new Map(e)}),ap(function(e){return $U(e)||z0e(e)},"number",function(e){return $U(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),ap(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),ap(U0e,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function LA(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var q0e=LA(function(e,t){return OU(e)?!!t.symbolRegistry.getIdentifier(e):!1},function(e,t){return["symbol",t.symbolRegistry.getIdentifier(e)]},function(e){return e.description},function(e,t,r){var n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),ilt=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),W0e=LA(j0e,function(e){return["typed-array",e.constructor.name]},function(e){return _to_consumable_array(e)},function(e,t){var r=ilt[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function NU(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var V0e=LA(NU,function(e,t){return["class",t.classRegistry.getIdentifier(e.constructor)]},function(e,t){var r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return _object_spread({},e);var n={};return r.forEach(function(i){n[i]=e[i]}),n},function(e,t,r){var n=r.classRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown class '".concat(t[1],"' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564"));return Object.assign(Object.create(n.prototype),e)}),G0e=LA(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){return["custom",t.customTransformerRegistry.findApplicable(e).name]},function(e,t){return t.customTransformerRegistry.findApplicable(e).serialize(e)},function(e,t,r){var n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),olt=[V0e,q0e,G0e,W0e],DU=function(e,t){var r=RU(olt,function(i){return i.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};var n=RU(B0e,function(i){return i.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation}},H0e={};B0e.forEach(function(e){H0e[e.annotation]=e});var Z0e=function(e,t,r){if(Fc(t))switch(t[0]){case"symbol":return q0e.untransform(e,t,r);case"class":return V0e.untransform(e,t,r);case"custom":return G0e.untransform(e,t,r);case"typed-array":return W0e.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{var n=H0e[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}};var wv=function(e,t){if(t>e.size)throw new Error("index out of bounds");var r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function K0e(e){if(_v(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(_v(e,"prototype"))throw new Error("prototype is not allowed as a property");if(_v(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Q0e=function(e,t){K0e(t);for(var r=0;r<t.length;r++){var n=t[r];if(wh(e))e=wv(e,+n);else if(bh(e)){var i=+n,o=+t[++r]==0?"key":"value",a=wv(e,i);switch(o){case"key":e=a;break;case"value":e=e.get(a);break}}else e=e[n]}return e},FA=function(e,t,r){if(K0e(t),t.length===0)return r(e);var n=e;for(var o=0;o<t.length-1;o++){var a=t[o];if(Fc(n)){var s=+a;n=n[s]}else if(R0(n))n=n[a];else if(wh(n)){var s10=+a;n=wv(n,s10)}else if(bh(n)){if(o===t.length-2)break;var l=+a,c=+t[++o]==0?"key":"value",d=wv(n,l);switch(c){case"key":n=d;break;case"value":n=n.get(d);break}}}var i=t[t.length-1];if(Fc(n)?n[+i]=r(n[+i]):R0(n)&&(n[i]=r(n[i])),wh(n)){var o10=wv(n,+i),a9=r(o10);o10!==a9&&(n.delete(o10),n.add(a9))}if(bh(n)){var o11=+t[t.length-2],a10=wv(n,o11);switch(+i==0?"key":"value"){case"key":{var l10=r(a10);n.set(l10,n.get(a10)),l10!==a10&&n.delete(a10);break}case"value":{n.set(a10,r(n.get(a10)));break}}}return e};var J0e=function(e){return e<1};function LU(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];if(!e)return;var i=J0e(r);if(!Fc(e)){P0(e,function(s,l){return LU(s,t,r,_to_consumable_array(n).concat(_to_consumable_array(bv(l,i))))});return}var _e1=_sliced_to_array(e,2),o=_e1[0],a=_e1[1];a&&P0(a,function(s,l){LU(s,t,r,_to_consumable_array(n).concat(_to_consumable_array(bv(l,i))))}),t(o,n)}function Y0e(e,t,r,n){return LU(t,function(i,o){e=FA(e,o,function(a){return Z0e(a,i,n)})},r),e}function X0e(e,t,r){var n=J0e(r);function i(o,a){var s=Q0e(e,bv(a,n));o.map(function(l){return bv(l,n)}).forEach(function(l){e=FA(e,l,function(){return s})})}if(Fc(t)){var _t1=_sliced_to_array(t,2),o=_t1[0],a=_t1[1];o.forEach(function(s){e=FA(e,bv(s,n),function(){return e})}),a&&P0(a,i)}else P0(t,i);return e}var alt=function(e,t){return R0(e)||Fc(e)||bh(e)||wh(e)||$A(e)||NU(e,t)};function slt(e,t,r){var n=r.get(e);n?n.push(t):r.set(e,[t])}function e1e(e,t){var r={},n;return e.forEach(function(i){if(i.length<=1)return;t||(i=i.map(function(s){return s.map(String)}).sort(function(s,l){return s.length-l.length}));var _i1=_to_array(i),o=_i1[0],a=_i1.slice(1);o.length===0?n=a.map(DA):r[DA(o)]=a.map(DA)}),n?OA(r)?[n]:[n,r]:OA(r)?void 0:r}var FU=function(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:new Map;var m;var s=L0e(e);if(!s){slt(e,i,t);var h=a.get(e);if(h)return n?{transformedValue:null}:h}if(!alt(e,r)){var h10=DU(e,r),g=h10?{transformedValue:h10.value,annotations:[h10.type]}:{transformedValue:e};return s||a.set(e,g),g}if(_v(o,e))return{transformedValue:null};var l=DU(e,r),c=(m=l==null?void 0:l.value)!=null?m:e,d=Fc(c)?[]:{},u={};P0(c,function(h,g){if(g==="__proto__"||g==="constructor"||g==="prototype")throw new Error("Detected property ".concat(g,". This is a prototype pollution risk, please remove it from your object."));var x=FU(h,t,r,n,_to_consumable_array(i).concat([g]),_to_consumable_array(o).concat([e]),a);d[g]=x.transformedValue,Fc(x.annotations)?u[NA(g)]=x.annotations:R0(x.annotations)&&P0(x.annotations,function(v,y){u[NA(g)+"."+y]=v})});var p=OA(u)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,u]:u};return s||a.set(e,p),p};function zA(e){return Object.prototype.toString.call(e).slice(8,-1)}function jA(e){return zA(e)==="Array"}function zU(e){if(zA(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function llt(e,t,r,n,i){var o=({}).propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=r),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function UA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(jA(e))return e.map(function(i){return UA(i,t)});if(!zU(e))return e;var r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return _to_consumable_array(r).concat(_to_consumable_array(n)).reduce(function(i,o){if(o==="__proto__"||jA(t.props)&&!t.props.includes(o))return i;var a=e[o],s=UA(a,t);return llt(i,o,s,e,t.nonenumerable),i},{})}var rn=/*#__PURE__*/function(){"use strict";function rn1(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},tmp=_ref.dedupe,t=tmp===void 0?!1:tmp;_class_call_check(this,rn1);this.classRegistry=new RA,this.symbolRegistry=new vv(function(r){var n;return(n=r.description)!=null?n:""}),this.customTransformerRegistry=new MA,this.allowedErrorProps=[],this.dedupe=t}_create_class(rn1,[{key:"serialize",value:function serialize(t){var r=new Map,n=FU(t,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta=_object_spread_props(_object_spread({},i.meta),{values:n.annotations}));var o=e1e(r,this.dedupe);return o&&(i.meta=_object_spread_props(_object_spread({},i.meta),{referentialEqualities:o})),i.meta&&(i.meta.v=1),i}},{key:"deserialize",value:function deserialize(t,r){var a,s;var n=t.json,i=t.meta,o=r!=null&&r.inPlace?n:UA(n);return i!=null&&i.values&&(o=Y0e(o,i.values,(a=i.v)!=null?a:0,this)),i!=null&&i.referentialEqualities&&(o=X0e(o,i.referentialEqualities,(s=i.v)!=null?s:0)),o}},{key:"stringify",value:function stringify(t){return JSON.stringify(this.serialize(t))}},{key:"parse",value:function parse(t){return this.deserialize(JSON.parse(t),{inPlace:!0})}},{key:"registerClass",value:function registerClass(t,r){this.classRegistry.register(t,r)}},{key:"registerSymbol",value:function registerSymbol(t,r){this.symbolRegistry.register(t,r)}},{key:"registerCustom",value:function registerCustom(t,r){this.customTransformerRegistry.register(_object_spread({name:r},t))}},{key:"allowErrorProps",value:function allowErrorProps(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}var _this_allowedErrorProps;(_this_allowedErrorProps=this.allowedErrorProps).push.apply(_this_allowedErrorProps,_to_consumable_array(t))}}]);return rn1}();rn.defaultInstance=new rn;rn.serialize=rn.defaultInstance.serialize.bind(rn.defaultInstance);rn.deserialize=rn.defaultInstance.deserialize.bind(rn.defaultInstance);rn.stringify=rn.defaultInstance.stringify.bind(rn.defaultInstance);rn.parse=rn.defaultInstance.parse.bind(rn.defaultInstance);rn.registerClass=rn.defaultInstance.registerClass.bind(rn.defaultInstance);rn.registerSymbol=rn.defaultInstance.registerSymbol.bind(rn.defaultInstance);rn.registerCustom=rn.defaultInstance.registerCustom.bind(rn.defaultInstance);rn.allowErrorProps=rn.defaultInstance.allowErrorProps.bind(rn.defaultInstance);var jU=rn;var kgr=rn.serialize,Cgr=rn.deserialize,Egr=rn.stringify,Tgr=rn.parse,Agr=rn.registerClass,Igr=rn.registerCustom,Pgr=rn.registerSymbol,Rgr=rn.allowErrorProps;function t1e(e){return e.buffer.byteLength===e.byteLength&&e.byteOffset===0?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}var G6=/*#__PURE__*/function(Pr1){"use strict";_inherits(G61,Pr1);function G61(r){_class_call_check(this,G61);var _this;_this=_call_super(this,G61);_this.plugin=r;return _this}_create_class(G61,[{key:"restoreRemoteTraversalCacheIfMissing",value:function restoreRemoteTraversalCacheIfMissing(){return _async_to_generator(function(){var r,n,_$i,o,a,s,c,d,_tmp,_tmp1,i;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:Me;if(!this.remoteTraversalCacheEnabled)return[2,!1];_state.label=1;case 1:_state.trys.push([1,12,,13]);return[4,this.getKVKey()];case 2:_$i=_state.sent();return[4,Eu.get(_$i)];case 3:o=_state.sent();if(((n=o==null?void 0:o.queue)==null?void 0:n.length)===0)return[2,!1];return[4,this.plugin.webDAVService.createWebDAVClient()];case 4:a=_state.sent(),s=this.remoteCacheFilePath;return[4,a.exists(s).catch(function(){return!1})];case 5:if(!_state.sent())return[2,!1];return[4,a.getFileContents(s,{format:"binary"})];case 6:c=_state.sent(),d=this.decodeStorage(c);if(!d.traverseWebDAVCache)return[3,10];if(!(d.remoteBaseDir&&Xi(d.remoteBaseDir)!==Xi(this.plugin.remoteBaseDir)||!AA(d.traverseWebDAVCache,this.plugin.remoteBaseDir)))return[3,7];_tmp1=(r.warn("Skipping remote traversal cache restore: cache belongs to a different remote directory"),!1);return[3,9];case 7:return[4,Eu.set(_$i,d.traverseWebDAVCache)];case 8:_tmp1=(_state.sent(),r.info("Restored remote traversal cache"),!0);_state.label=9;case 9:_tmp=_tmp1;return[3,11];case 10:_tmp=!1;_state.label=11;case 11:return[2,_tmp];case 12:i=_state.sent();return[2,(r.error("Error restoring remote traversal cache:",i),!1)];case 13:return[2]}})}).apply(this,arguments)}},{key:"saveRemoteTraversalCache",value:function saveRemoteTraversalCache(){return _async_to_generator(function(){var r,n,_$i,_,o,a,s,l,p,d,_tmp,i;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:Me,n=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:function(){return!1};if(!this.remoteTraversalCacheEnabled)return[2,!1];_state.label=1;case 1:_state.trys.push([1,13,,14]);if(n())return[2,!1];_=Eu.get;return[4,this.getKVKey()];case 2:return[4,_.apply(Eu,[_state.sent()])];case 3:_$i=_state.sent();if(!_$i||_$i.queue.length>0)return[2,!1];o=this.withoutRemoteSyncCacheFile(_$i),a=Qa(o.nodes);return[4,this.getKVKey()];case 4:s=_state.sent();return[4,this.plugin.webDAVService.createWebDAVClient()];case 5:l=_state.sent();if(n())return[2,!1];return[4,l.exists(this.remoteCacheFilePath).catch(function(){return!1})];case 6:if(!_state.sent())return[3,8];return[4,r$.get(s)];case 7:p=_state.sent();if((p==null?void 0:p.nodesHash)===a)return[2,(r.debug("Skipping remote cache upload: content unchanged"),!1)];_state.label=8;case 8:d=this.encodeStorage({traverseWebDAVCache:o,exportedAt:new Date().toISOString(),remoteBaseDir:Xi(this.plugin.remoteBaseDir)});_tmp=n();if(_tmp)return[3,10];return[4,l.createDirectory(this.remoteCacheDirPath,{recursive:!0})];case 9:_tmp=(_state.sent(),n());_state.label=10;case 10:if(_tmp)return[2,!1];return[4,l.putFileContents(this.remoteCacheFilePath,t1e(d),{overwrite:!0})];case 11:if(!_state.sent())throw new Error("Remote traversal cache upload failed");return[4,r$.set(s,{nodesHash:a})];case 12:return[2,(_state.sent(),r.info("Saved remote traversal cache"),!0)];case 13:i=_state.sent();return[2,(r.error("Error saving remote traversal cache:",i),!1)];case 14:return[2]}})}).apply(this,arguments)}},{key:"encodeStorage",value:function encodeStorage(r){var n=jU.stringify(r);if(!n)throw new Error("Cache data serialization failed");return J2(new TextEncoder().encode(n),{level:9})}},{key:"decodeStorage",value:function decodeStorage(r){if(!r||r.byteLength===0)throw new Error("Cache file is empty");var n=Y2(new Uint8Array(r));if(!n.length)throw new Error("Inflate failed or resulted in empty content");var i=new TextDecoder().decode(n);if(!i.trim())throw new Error("Cache file content is invalid or empty");var o=jU.parse(i);if(!o)throw new Error("Invalid cache file format");return o}},{key:"getKVKey",value:function getKVKey(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.getRemoteAccountId()];case 1:return[2,oA.apply(void 0,[_state.sent(),rp(this.plugin.settings),this.plugin.remoteBaseDir])]}})}).call(this)}},{key:"withoutRemoteSyncCacheFile",value:function withoutRemoteSyncCacheFile(r){var n=(0,BA.normalize)(this.remoteCacheFilePath),i=(0,BA.normalize)(R6(this.plugin.app.vault.configDir)),o={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(r.nodes)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];o[a]=s.filter(function(l){var c=(0,BA.normalize)(l.path);return c!==n&&c!==i})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{rootCursor:r.rootCursor,queue:_to_consumable_array(r.queue),nodes:o}}},{key:"remoteCacheFilePath",get:function get1(){return Uj(this.plugin.remoteBaseDir,this.plugin.app.vault.configDir)}},{key:"remoteTraversalCacheEnabled",get:function get1(){var r;return Ahe(this.plugin.app.vault.configDir,(r=this.plugin.settings.configDirSyncMode)!=null?r:"none",this.plugin.settings.filterRules)}},{key:"remoteCacheDirPath",get:function get1(){return khe(this.plugin.remoteBaseDir,this.plugin.app.vault.configDir)}}]);return G61}(Pr);var iI=require("obsidian");var r1e=new Ln,qA=function(){return r1e.asObservable()},n1e=function(e){return r1e.next(e)};var i1e=new Ln,o1e=function(){return i1e.asObservable()},a1e=function(e){return i1e.next(e)};(function(e,t){var r={_0x23ddb8:477,_0x3008bd:359,_0x453fb5:"Pcer",_0x4bbdca:457,_0x21faea:"xoTm",_0xda0204:673,_0x3fa171:192,_0x3ba160:"$Bws",_0x322c63:13,_0x500af1:261,_0x2086ae:"7qM$",_0x51ef33:34,_0x17971e:322,_0x4d47f6:"Ofr8",_0x5846af:118,_0x27f55c:57,_0x57db6e:680,_0x2bf50d:1062,_0x2ed94e:1047,_0x48472f:1444,_0x58b24:164,_0xcddce5:307,_0x5d7d62:352,_0x2f6dca:"!qKa",_0x22aeb6:788,_0x4b3802:135,_0x3e5a4f:44,_0x4a4d90:"IQMa"},n={_0x1d7237:228};function i(u,p,m,h,g){return st(h-n._0x1d7237,g)}var o=e();function a(u,p,m,h,g){return st(u- -166,p)}function s(u,p,m,h,g){return st(u- -675,p)}function l(u,p,m,h,g){return st(p-713,u)}function c(u,p,m,h,g){return st(p- -683,h)}for(;[];)try{var d=-parseInt(c(-r._0x23ddb8,-r._0x3008bd,157,r._0x453fb5,-281))/1+parseInt(c(r._0x4bbdca,-65,-422,r._0x21faea,-188))/2+parseInt(c(r._0xda0204,r._0x3fa171,530,r._0x3ba160,26))/3*(parseInt(c(10,-r._0x322c63,-260,"U*q1",-r._0x500af1))/4)+-parseInt(c(439,55,239,r._0x2086ae,-r._0x51ef33))/5*(-parseInt(a(r._0x17971e,r._0x4d47f6,-r._0x5846af,-r._0x27f55c,r._0x57db6e))/6)+-parseInt(i(r._0x2bf50d,1802,r._0x2ed94e,r._0x48472f,"$L(L"))/7+-parseInt(c(394,189,r._0x58b24,"Um*0",r._0xcddce5))/8*(-parseInt(c(419,r._0x5d7d62,250,r._0x2f6dca,r._0x22aeb6))/9)+-parseInt(c(-r._0x4b3802,r._0x3e5a4f,r._0x23ddb8,r._0x4a4d90,255))/10;if(d===t)break;o.push(o.shift())}catch(u){o.push(o.shift())}})(WA,149817);var ult=Object[qe(-343,221,37,-344,"esI(")+"e"],qU=Object[$e(1312,1249,1018,"esI(",1043)+qe(-143,-511,0,156,"m6ks")+$e(1799,1800,1281,"esI(",1647)],clt=Object[Xe("m6ks",705,875,1160,561)+$e(1014,1821,1918,"yAeH",1429)+Le(1345,"0u@s",1276,1543,1381)+qe(68,-351,24,3,"XmPh")+Le(414,"6Q[!",627,874,873)],dlt=Object[Xe("Ofr8",986,669,614,1062)+qe(1230,1052,874,421,"!qKa")+Xe(")mU*",1213,1299,771,1778)+$e(948,892,1436,"8F&P",996)];function Le(e,t,r,n,i){return st(r-415,t)}var plt=Object[$e(1101,477,449,"U*q1",923)+Le(1647,"dltk",1303,1541,1252)+$e(1779,2015,1884,"srHh",1762)],flt=Object[Le(502,"!qKa",973,1480,696)+Le(1193,"!qKa",1522,1131,1587)][ut("$Bws",462,1251,762,840)+Le(977,"%qo8",728,325,963)+Le(475,"dltk",914,631,1231)],mlt=function(e,t,r){return t in e?qU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},u1e={};u1e[ut("!qKa",764,1241,1209,973)+"ts"]={};var hlt=function(e,t){return function(){return t||e((t=u1e)[Le(1045,"Um*0",1232,826,1474)+"ts"],t),t[ut("KBpi",841,483,749,916)+"ts"]}};function ut(e,t,r,n,i){var o={_0x25013:429};return st(i-o._0x25013,e)}function st(e,t){var r=WA();return st=function(n,i){n=n-158;var o=r[n];if(st.RPozBK===void 0){var a=function a(u){for(var p="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",m="",h="",g=0,x,v,y=0;v=u.charAt(y++);~v&&(x=g%4?x*64+v:v,g++%4)?m+=String.fromCharCode(255&x>>(-2*g&6)):0)v=p.indexOf(v);for(var _=0,b=m.length;_<b;_++)h+="%"+("00"+m.charCodeAt(_).toString(16)).slice(-2);return decodeURIComponent(h)},s=function s(u,p){var m=[],h=0,g,x="";u=a(u);var v;for(v=0;v<256;v++)m[v]=v;for(v=0;v<256;v++)h=(h+m[v]+p.charCodeAt(v%p.length))%256,g=m[v],m[v]=m[h],m[h]=g;v=0,h=0;for(var y=0;y<u.length;y++)v=(v+1)%256,h=(h+m[v])%256,g=m[v],m[v]=m[h],m[h]=g,x+=String.fromCharCode(u.charCodeAt(y)^m[(m[v]+m[h])%256]);return x};st.gLtBMz=s,e=arguments,st.RPozBK=!![]}var l=r[0],c=n+l,d=e[c];return d?o=d:(st.tWGERx===void 0&&(st.tWGERx=!![]),o=st.gLtBMz(o,i),e[c]=o),o},st(e,t)}function qe(e,t,r,n,i){var o={_0x4b9dc3:337};return st(r- -o._0x4b9dc3,i)}var glt=function(e,t,r,n){var d=function d(g,x,v,y,_){return Le(g-467,v,x-c._0x2fefdf,y-311,_-c._0x12e16e)};var u=function u(g,x,v,y,_){return Le(g-l._0x434db7,g,x-294,y-283,_-l._0x188021)};var p=function p(g,x,v,y,_){return qe(g-s._0x447665,x-356,g-127,y-s._0x33789c,y)};var m=function m(g,x,v,y,_){return qe(g-289,x-161,_-207,y-a._0x599a38,y)};var h=function h(g,x,v,y,_){return Xe(v,x-o._0xc3818d,g-o._0xfbdd0c,y-85,_-1)};var i={_0x5b4d35:1753,_0x3a4f77:"gCWj",_0x10aa14:1887,_0x2542d6:1480,_0x1e29f4:1910,_0x233902:1399,_0x3f9775:973,_0x3a4be4:1623,_0x17f9d4:1034,_0xdbb39e:"0u@s",_0x4e69df:1186,_0x45361f:1476,_0x2dd4e7:"Ofr8",_0x5c01ea:1797,_0x2a19a6:222,_0x18466c:"*(#r",_0x1c2933:57,_0x4d4a4e:2503,_0x36c52b:1979},o={_0xc3818d:59,_0xfbdd0c:269},a={_0x599a38:326},s={_0x447665:421,_0x33789c:278},l={_0x434db7:286,_0x188021:184},c={_0x2fefdf:542,_0x12e16e:283};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))==d(2124,i._0x5b4d35,i._0x3a4f77,i._0x10aa14,i._0x2542d6)+"t"||(typeof t==="undefined"?"undefined":_type_of(t))==d(i._0x1e29f4,i._0x233902,"(gQD",i._0x3f9775,i._0x3a4be4)+d(i._0x17f9d4,1291,i._0xdbb39e,945,i._0x4e69df))try{var _loop=function(){var g=_step.value;!flt[d(1251,i._0x45361f,i._0x2dd4e7,1363,i._0x5c01ea)](e,g)&&g!==r&&qU(e,g,{get:function(){return t[g]},enumerable:!(n=clt(t,g))||n[p(264,i._0x2a19a6,-75,i._0x18466c,-i._0x1c2933)+d(i._0x4d4a4e,2022,"pTZ^",1508,i._0x36c52b)]})};for(var _iterator=dlt(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},VA=function(e,t,r){return r=e!=null?ult(plt(e)):{},glt(t||!e||!e[$e(1294,939,1186,"CSrr",1073)+$e(1864,1267,1534,"ITq[",1696)]?qU(r,Le(919,"%qo8",1077,1403,1198)+"lt",{value:e,enumerable:!0}):r,e)},Sv=function(e,t,r){return mlt(e,(typeof t==="undefined"?"undefined":_type_of(t))!=Xe("PS7$",1462,1510,1372,1677)+"l"?t+"":t,r)},ru=function(e,t,r){return new Promise(function(n,i){var g=function g(k,E,C,T,I){return qe(k-h._0x2ea37e,E-h._0x5363ca,k-1102,T-h._0x43bc0d,E)};var x=function x(k,E,C,T,I){return $e(k-137,E-420,C-m._0xb9e4,k,I- -348)};var b=function b(k,E,C,T,I){return Le(k-s._0x552760,k,I- -1391,T-s._0x4d0046,I-s._0x585daa)};var w=function w(k,E,C,T,I){return $e(k-108,E-a._0x52b289,C-76,T,k- -a._0x3ab51d)};var S=function S(k,E,C,T,I){return ut(E,E-480,C-331,T-324,C- -762)};var o={_0x3a5956:1313,_0x320b7c:1041,_0xa49d73:1281,_0x14a091:1334},a={_0x52b289:227,_0x3ab51d:1113},s={_0x552760:65,_0x4d0046:396,_0x585daa:445},l={_0x51d05c:2216,_0x5d70b7:1812,_0x4a4c4b:2372,_0x567fed:"Zjkg",_0x549cd6:"78]e",_0x47f56d:1149},c={_0x57facb:616},d={_0xe3e51:974},u={_0x43a4d0:37,_0x34f3f4:644,_0x50bce4:"8F&P",_0x1fa042:1140,_0x3eb967:1381,_0x2f8463:"Ofr8",_0x53f734:815,_0x858cfd:321,_0x2eaf90:693,_0x44e216:207,_0x1da358:371,_0xc535a9:274,_0x416028:1553,_0x17ae5b:"U*q1",_0x168176:376,_0x5522ad:599,_0x1efa05:"78]e",_0x52ddad:957,_0x4d7904:504,_0x3d1a2d:70,_0x45297f:73,_0x22e4fe:"uHEn",_0x3313e6:1146,_0x180060:1022,_0x54b1c7:605,_0x279c70:131,_0x41f179:367,_0x277c2a:457,_0x1d0817:231,_0x269b2a:452,_0x35ce0e:232,_0x2c7c12:664,_0x43cb05:10,_0x104bba:425,_0x3b4bc7:197,_0x37d30a:715,_0x58b8da:1809,_0x1ee9b2:1242,_0x2106ac:1216,_0x19fa1a:997,_0x1d27d5:"KBpi",_0x1b23d0:1209,_0x3cd19e:1560,_0x58b77f:616,_0x373ec3:430,_0x48c63f:629,_0x1db41a:"6Q[!",_0x2967fd:250,_0x3207e7:163,_0x9b1ec3:497,_0x2e6359:329,_0x3b8234:4,_0x309b1d:1031,_0x38e524:801,_0x1547c2:523,_0x52bed5:1025,_0x1c62d3:510,_0x21b541:888,_0x5627a9:"m6ks",_0x3e25f3:658,_0xaa07e1:267,_0x572a50:781,_0x2e3ada:1194,_0x38f557:958,_0xe548b6:1226,_0x594644:"xoTm",_0x2fe1e7:1425,_0x3958d9:1407,_0xddf4a0:1568,_0x4558c3:"7*o4",_0x51e62d:1507,_0xa8ba6b:772,_0x589509:493,_0x502e71:444,_0x240343:1034,_0x17f8bf:759,_0x5e1dcd:"q4^g",_0x21cb3e:670,_0x5e25e4:"HBqf"},p={_0xd39708:202},m={_0xb9e4:459},h={_0x2ea37e:342,_0x5363ca:364,_0x43bc0d:477};var v=function(k){var C=function C(R,$,z,D,L){return st(z-p._0xd39708,D)};var T=function T(R,$,z,D,L){return st(L-529,z)};var I=function I(R,$,z,D,L){return st(R- -E._0x3492ee,L)};var O=function O(R,$,z,D,L){return st(L- -422,z)};var M=function M(R,$,z,D,L){return st(R- -848,L)};var E={_0x3492ee:92};if(M(234,-u._0x43a4d0,u._0x34f3f4,-149,u._0x50bce4)===T(900,u._0x1fa042,"%wVn",1321,1026))try{_(r[C(u._0x3eb967,721,893,u._0x2f8463,529)](k))}catch(R){i(R)}else{if((typeof _0x4dbf45==="undefined"?"undefined":_type_of(_0x4dbf45))==T(u._0x53f734,324,"$Bws",u._0x858cfd,u._0x2eaf90)+M(28,-u._0x44e216,-u._0x1da358,-u._0xc535a9,"KBpi")||!_0x33eca7[T(2004,u._0x416028,"z(fp",1127,1626)+C(570,1268,860,u._0x17ae5b,u._0x168176)+C(452,268,u._0x5522ad,u._0x1efa05,u._0x52ddad)])throw new _0x98f92a(M(-u._0x4d7904,-u._0x3d1a2d,-u._0x45297f,-952,u._0x22e4fe)+O(u._0x3313e6,u._0x180060,"HBqf",u._0x54b1c7,746)+M(347,549,-u._0x279c70,35,"G13@")+I(u._0x41f179,u._0x277c2a,804,u._0x1d0817,"$Bws")+O(1165,u._0x269b2a,"q4^g",u._0x35ce0e,u._0x2c7c12)+O(-u._0x43cb05,-u._0x104bba,"gCWj",45,-5)+I(233,-222,u._0x3b4bc7,u._0x37d30a,"uHEn")+T(u._0x58b8da,u._0x1ee9b2,"$Bws",u._0x2106ac,1520)+M(-668,-u._0x19fa1a,-964,-723,u._0x1d27d5)+T(1307,u._0x1b23d0,"!qKa",1089,u._0x3cd19e)+M(-442,-u._0x58b77f,-u._0x373ec3,-u._0x48c63f,u._0x1db41a)+I(u._0x2967fd,u._0x3207e7,148,263,"esI(")+M(352,u._0x9b1ec3,u._0x2e6359,u._0x3b8234,"PS7$")+T(u._0x309b1d,u._0x38e524,"%qo8",427,893)+T(769,u._0x1547c2,"XmPh",846,u._0x52bed5)+C(1114,u._0x1c62d3,u._0x21b541,u._0x5627a9,u._0x3e25f3)+M(-u._0xaa07e1,-702,-682,87,"dltk")+I(u._0x572a50,1061,u._0x2e3ada,u._0x38f557,"Um*0")+T(u._0xe548b6,1509,u._0x594644,u._0x2fe1e7,u._0x3958d9)+C(1443,u._0xddf4a0,1369,u._0x4558c3,u._0x51e62d)+C(u._0xa8ba6b,96,u._0x589509,"G13@",825));_0x516f0b=_0x42fe8c[O(295,460,"7qM$",399,u._0x502e71)+I(502,u._0x240343,764,u._0x17f8bf,"q4^g")+O(-16,590,u._0x5e1dcd,u._0x21cb3e,513)][T(1880,1618,u._0x5e25e4,1090,1445)](_0x554d4a)}},y=function(k){var E=function E(O,M,R,$,z){return st(R-d._0xe3e51,z)};var C=function C(O,M,R,$,z){return st(R-537,O)};var T=function T(O,M,R,$,z){return st(O-c._0x57facb,M)};var I=function I(O,M,R,$,z){return st(z-374,M)};try{_(r[E(1840,l._0x51d05c,l._0x5d70b7,1902,"8F&P")](k))}catch(O){E(l._0x4a4c4b,2157,1925,2442,l._0x567fed)!==C(l._0x549cd6,916,888,447,492)?i(O):_0x2f3c36(_0x3f4311[T(1328,"XSQ8",1021,l._0x47f56d,1732)](_0x23df29))}},_=function(k){return k[b("8x(^",92,-244,-318,-410)]?n(k[w(-18,-339,-3,"8F&P",211)]):Promise[w(227,144,524,"HKLe",166)+"ve"](k[b("6Q[!",-77,323,162,-80)])[b("wepR",-618,-220,-887,-654)](v,y)};_((r=r[g(o._0x3a5956,"G13@",1632,o._0x320b7c,1818)](e,t))[x("8F&P",o._0xa49d73,1848,1719,o._0x14a091)]())})},GA=hlt(function(e){"use strict";var C=function C(ie,re,de,xe,Y){return ut(ie,re-98,de-456,xe-E._0x5216d3,xe- -148)};var z=function z(ie){var re={_0x346c36:618,_0x328485:328,_0x35d1f9:214,_0xad2e7d:434},de={_0x350e8c:443};function xe(it,pt,nt,gt,Ie){return L(it-403,gt,nt-k._0x39b8e2,gt-301,Ie-k._0x58d38b)}var Y=ie[j(-w._0x5afcae,-w._0xacd883,w._0x1687a0,3,"9PX[")+"h"];if(Y%4>0)throw new Error(j(w._0x31cc39,357,8,240,"7qM$")+H(w._0x175f97,w._0x58b1ce,1646,w._0x218b24,2015)+Q(794,w._0x247ef1,w._0x214015,w._0x286135,274)+H(w._0x4c71cf,"XSQ8",890,w._0x300d73,w._0x44281b)+j(284,-w._0x4f9538,w._0x17b841,-w._0x8f8880,"$Bws")+H(844,"m6ks",w._0x5bdf26,808,1251)+xe(w._0x25b52e,64,547,w._0xa327f8,445)+xe(w._0x5d19d0,w._0x17bebd,761,w._0x4f006b,729)+Q(-121,-w._0x353086,"G13@",41,-53)+"4");var oe=ie[xe(w._0x4bf2ff,w._0x145126,1365,"IQMa",1668)+"Of"]("=");oe===-1&&(oe=Y);function H(it,pt,nt,gt,Ie){return C(pt,pt-222,nt-347,Ie-616,Ie-436)}var J=oe===Y?0:4-oe%4;function j(it,pt,nt,gt,Ie){return N(it-373,Ie,nt- -987,gt-248,Ie-de._0x350e8c)}function Q(it,pt,nt,gt,Ie){return L(it-S._0x369616,nt,gt-S._0x79b9ad,gt-S._0x23261,Ie-20)}function Fe(it,pt,nt,gt,Ie){return K(pt- -re._0x346c36,Ie,nt-re._0x328485,gt-re._0x35d1f9,Ie-re._0xad2e7d)}return[oe,J]};var D=function D(ie){var re=z(ie),de=re[0],xe=re[1];return(de+xe)*3/4-xe};var L=function L(ie,re,de,xe,Y){return Le(ie-b._0x571803,re,de- -916,xe-500,Y-115)};var ee=function ee(ie,re,de){var xe={_0x4a1393:325},Y={_0xc98b0:5,_0x747357:391,_0x5b633b:212},oe={_0x5a0476:303,_0x5974e1:111,_0x2d14fb:29},H={_0x56750b:302},J={_0x56fcc7:491,_0x4148d2:171};function j(Ie,we,Oe,Pe,tt){return K(we-552,Ie,Oe-J._0x56fcc7,Pe-J._0x4148d2,tt-197)}function Q(Ie,we,Oe,Pe,tt){return K(Oe-11,Ie,Oe-463,Pe-H._0x56750b,tt-427)}function Fe(Ie,we,Oe,Pe,tt){return N(Ie-oe._0x5a0476,Pe,we- -1094,Pe-oe._0x5974e1,tt-oe._0x2d14fb)}function it(Ie,we,Oe,Pe,tt){return K(tt-Y._0xc98b0,Oe,Oe-460,Pe-Y._0x747357,tt-Y._0x5b633b)}function pt(Ie,we,Oe,Pe,tt){return L(Ie-357,tt,Ie-1094,Pe-xe._0x4a1393,tt-404)}if(Fe(-_._0x55cb6a,-573,-577,"m6ks",-793)!==it(_._0x475dfc,_._0x23051c,_._0xef0fc6,_._0x4e9c4b,_._0x583c25)){_0x56bad9(this,Fe(123,_._0x9d945d,_._0x22934d,_._0x1f3da8,_._0x46eb03)+"rl"),_0x447068(this,it(_._0x4688d4,_._0x3d61b8,_._0x36f89b,_._0x348cf3,_._0x3707ac)+"er");var nt,gt;this[Fe(205,-27,252,"nGaz",93)+"rl"]=_0x4bcbf6((nt=_0x30e8d5[Q("KBpi",582,239,70,652)+"rl"])!=null?nt:_0x490688),this[Q(_._0xbfd919,_._0x9c4b03,_._0x8bd54d,_._0x365526,_._0xe971b8)+"er"]=(gt=_0x312736[j("7*o4",_._0x3079d9,_._0x315574,_._0xef49c9,164)+"er"])!=null?gt:_0x1cd3c4}else return(re+de)*3/4-de};var pe=function pe(ie){function re(gt,Ie,we,Oe,Pe){return C(Ie,Ie-182,we-y._0x562ba3,Oe- -y._0x3e2abe,Pe-y._0x137cbc)}function de(gt,Ie,we,Oe,Pe){return L(gt-225,Oe,Pe-217,Oe-v._0x327a48,Pe-441)}function xe(gt,Ie,we,Oe,Pe){return L(gt-x._0x3d82a8,Pe,gt-x._0x2a325f,Oe-x._0x514130,Pe-453)}function Y(gt,Ie,we,Oe,Pe){return me(gt- -386,Pe,we-g._0x4808c9,Oe-g._0x56828d,Pe-g._0x9100)}var oe,H=z(ie),J=H[0],j=H[1],Q=new O(ee(ie,J,j)),Fe=0,it=j>0?J-4:J,pt;function nt(gt,Ie,we,Oe,Pe){return N(gt-498,Pe,we-279,Oe-109,Pe-h._0x75b3bd)}for(pt=0;pt<it;pt+=4)oe=I[ie[nt(1322,m._0x5b3bd1,1007,m._0x3edc3f,"Mu^3")+re(1027,"KBpi",472,m._0x42306a,676)](pt)]<<18|I[ie[re(-m._0x385553,m._0x8b0415,-332,m._0x5f4e6d,-413)+Y(1290,m._0x93afd0,1696,1103,m._0x12db70)](pt+1)]<<12|I[ie[xe(500,179,m._0x3b097b,481,m._0x36eda9)+nt(1087,m._0x4007fe,m._0xab8beb,m._0x4b4f85,m._0x100ad2)](pt+2)]<<6|I[ie[re(-268,m._0x375a29,281,-m._0xb70bea,m._0x1b9301)+re(912,m._0x273a81,1065,m._0x659f57,m._0x57ffab)](pt+3)],Q[Fe++]=oe>>16&255,Q[Fe++]=oe>>8&255,Q[Fe++]=oe&255;return j===2&&(oe=I[ie[xe(120,292,490,m._0x3addae,m._0x43fedb)+xe(m._0x1e0e63,348,424,m._0x382c88,m._0x51682c)](pt)]<<2|I[ie[xe(662,610,946,m._0x9fbf3e,"EgFM")+nt(m._0x6dce34,m._0x40e7a1,617,388,"6Q[!")](pt+1)]>>4,Q[Fe++]=oe&255),j===1&&(oe=I[ie[re(m._0xbda8a2,"XSQ8",m._0x1edd65,594,961)+Y(m._0x40c7d6,1128,m._0x7524ab,m._0x54af0a,m._0x4addb6)](pt)]<<10|I[ie[nt(691,m._0x2ece78,547,m._0x739f1e,"%wVn")+de(993,m._0x262ba2,m._0x6a4e05,m._0x18bfe9,m._0x259060)](pt+1)]<<4|I[ie[de(976,1223,m._0xae3edd,m._0x4b019e,m._0x67613b)+re(-m._0x664701,m._0x1d6ee6,361,m._0x456070,-m._0x212175)](pt+2)]>>2,Q[Fe++]=oe>>8&255,Q[Fe++]=oe&255),Q};var N=function N(ie,re,de,xe,Y){return qe(ie-p._0x350ef1,re-p._0x2b06d1,de-p._0x616adb,xe-276,re)};var U=function U(ie){return T[ie>>18&63]+T[ie>>12&63]+T[ie>>6&63]+T[ie&63]};var G=function G(ie,re,de){var xe={_0x55c06b:936},Y={_0x11585b:273,_0x387630:390,_0x3a9743:355},oe={_0x47d2c9:1622,_0x78bbd3:112,_0x1d7821:239,_0x11fecc:450};function H(Ie,we,Oe,Pe,tt){return me(tt- -u._0x49b1a3,Pe,Oe-122,Pe-421,tt-478)}function J(Ie,we,Oe,Pe,tt){return me(Ie- -oe._0x47d2c9,tt,Oe-oe._0x78bbd3,Pe-oe._0x1d7821,tt-oe._0x11fecc)}function j(Ie,we,Oe,Pe,tt){return N(Ie-Y._0x11585b,Oe,Ie-666,Pe-Y._0x387630,tt-Y._0x3a9743)}function Q(Ie,we,Oe,Pe,tt){return N(Ie-286,tt,Pe- -xe._0x55c06b,Pe-98,tt-25)}function Fe(Ie,we,Oe,Pe,tt){return C(Ie,we-108,Oe-d._0x4e2615,Oe- -d._0x58f33c,tt-d._0x5661ba)}if(H(c._0xda7639,-c._0x358373,c._0x3759b1,"0u@s",c._0x162817)!==H(c._0x17160f,c._0x1c79f0,34,c._0x153c4a,c._0x1b11a0)){for(var it,pt=[],nt=re;nt<de;nt+=3)it=(ie[nt]<<16&0xff0000)+(ie[nt+1]<<8&65280)+(ie[nt+2]&255),pt[Fe(c._0x341057,-c._0x1f8dd7,70,-c._0x5d2fc3,-160)](U(it));return pt[H(c._0x45e994,c._0x499b66,c._0x3811e8,c._0x56c7ac,609)]("")}else{var gt={};return gt[j(1571,1910,c._0x2473fc,1526,c._0x157935)+J(-452,-c._0x2c266e,-769,-c._0x5be87c,"Ofr8")+J(142,c._0x54c95d,c._0x4e6a0d,-c._0x1ffcb8,c._0x3358e5)]=_0x4fe8b7[j(1830,c._0x16a27d,c._0x442054,1665,c._0x4ff2ad)+j(1775,c._0x24052f,c._0x2b3cf8,c._0x4d1ce6,1944)+"en"],this[H(498,c._0x239bb8,c._0x169d4a,"6Q[!",c._0x1c1e2e)+Q(-572,-289,251,-229,"78]e")](j(c._0x33d184,c._0x2373cd,c._0x5888bf,604,1200)+H(-c._0x195e00,-c._0x59f088,-c._0x208b6c,c._0x5ec7c9,c._0x5ebdec)+J(400,c._0x1db4b1,c._0x4d4f8c,573,c._0x5d74be)+"h",gt)}};var K=function K(ie,re,de,xe,Y){return Xe(re,re-236,ie- -l._0x204335,xe-476,Y-489)};var me=function me(ie,re,de,xe,Y){return Xe(re,re-395,ie-535,xe-27,Y-s._0x11b379)};var V=function V(ie){var re={_0x5de3b0:203,_0x8e1f4f:200};function de(gt,Ie,we,Oe,Pe){return C(gt,Ie-497,we-a._0x3d82ae,we- -1039,Pe-a._0x43438b)}function xe(gt,Ie,we,Oe,Pe){return L(gt-re._0x5de3b0,gt,Oe-1065,Oe-re._0x8e1f4f,Pe-182)}function Y(gt,Ie,we,Oe,Pe){return C(we,Ie-384,we-o._0x55d85a,Oe- -o._0x295b25,Pe-o._0x58e15b)}function oe(gt,Ie,we,Oe,Pe){return N(gt-i._0x5e503c,we,Pe- -407,Oe-491,Pe-i._0x282ae3)}function H(gt,Ie,we,Oe,Pe){return me(we- -n._0x179f83,Ie,we-n._0x54076b,Oe-n._0x59fbbd,Pe-n._0x218ddf)}if(H(983,r._0x57943e,r._0x20505a,r._0x18e9cb,953)===H(569,"8F&P",676,r._0x59a10b,298))_0x1177ff(_0x2bd973);else{for(var J,j=ie[H(r._0x1581e8,"yAeH",1290,r._0x4cb46f,829)+"h"],Q=j%3,Fe=[],it=16383,pt=0,nt=j-Q;pt<nt;pt+=it)Fe[H(1531,r._0x37101a,r._0x9a8d1a,612,503)](G(ie,pt,pt+it>nt?nt:pt+it));return Q===1?(J=ie[j-1],Fe[H(1474,"dltk",r._0x37f541,r._0x546cb1,r._0x5144ba)](T[J>>2]+T[J<<4&63]+"==")):Q===2&&(J=(ie[j-2]<<8)+ie[j-1],Fe[Y(-375,21,r._0x220ce6,-r._0x30f2ca,-r._0x48ddfc)](T[J>>10]+T[J>>4&63]+T[J<<2&63]+"=")),Fe[H(968,"Um*0",1110,r._0x524950,r._0x364190)]("")}};var t={_0x34bb77:"pTZ^",_0x2d669f:330,_0x53fccc:405,_0x45a357:"(3#Z",_0x40b2b7:588,_0x27105b:"HBqf",_0x142c16:1273,_0x1ab103:1562,_0x296352:291,_0x59c42e:")mU*",_0x58d10f:601,_0x3d93e1:543,_0x27fa09:688,_0x513a14:503,_0x53d526:236,_0x117127:710,_0xee44a6:"q4^g",_0x34c0c3:23,_0x1d3e60:266,_0x186fc6:459,_0x54c49a:706,_0x1b9d20:207,_0x1f2410:1170,_0x144b9f:848,_0x55c943:1259,_0x19239e:1039,_0x14af6a:1162,_0x2ca6b5:1164,_0x1a6017:1122,_0x63f5df:1168,_0x50a62b:598,_0x666c9d:1001,_0x4769d8:"PS7$",_0x2d3521:1815,_0x29ed94:"EgFM",_0x15f88f:1967,_0x2080af:"ITq[",_0x276bb0:1573,_0x235cad:1603,_0x26714b:1548,_0xf6d8ea:1299,_0x1f9fc0:1410,_0x4536f3:1978,_0x57a643:"xoTm",_0x3e5d04:2202,_0x1d7b45:2287,_0x238857:1915,_0x246bf5:1544,_0x29e7c9:"m6ks",_0x337ea7:342,_0x4e6464:939,_0x313f20:917,_0x5c29f5:736,_0x563ecf:700,_0x58f63b:619,_0xb54cac:"G13@",_0x2ca1b8:947,_0x431c29:574,_0x17614e:251,_0x5894f5:628,_0x218ee2:135,_0x2a383a:588,_0x2e2e9f:131,_0x3d8821:1073,_0x2f56af:989,_0x18c46d:1037,_0x2f04ca:677,_0x5bc6d9:"uHEn"},r={_0x57943e:"(gQD",_0x20505a:954,_0x18e9cb:875,_0x59a10b:470,_0x1581e8:1141,_0x4cb46f:1080,_0x37101a:"7qM$",_0x9a8d1a:1023,_0x37f541:1278,_0x546cb1:1779,_0x5144ba:1756,_0x220ce6:"IQMa",_0x30f2ca:241,_0x48ddfc:571,_0x524950:1262,_0x364190:1005},n={_0x179f83:664,_0x54076b:139,_0x59fbbd:283,_0x218ddf:120},i={_0x5e503c:154,_0x282ae3:127},o={_0x55d85a:201,_0x295b25:991,_0x58e15b:44},a={_0x3d82ae:36,_0x43438b:40},s={_0x11b379:157},l={_0x204335:521},c={_0xda7639:490,_0x358373:37,_0x3759b1:263,_0x162817:449,_0x17160f:608,_0x1c79f0:24,_0x153c4a:"q4^g",_0x1b11a0:508,_0x341057:"z(fp",_0x1f8dd7:98,_0x5d2fc3:401,_0x45e994:549,_0x499b66:1047,_0x3811e8:641,_0x56c7ac:"XSQ8",_0x2473fc:"z(fp",_0x157935:1602,_0x2c266e:975,_0x5be87c:95,_0x54c95d:232,_0x4e6a0d:529,_0x1ffcb8:123,_0x3358e5:"Um*0",_0x16a27d:2194,_0x442054:"HKLe",_0x4ff2ad:1367,_0x24052f:1680,_0x2b3cf8:"uHEn",_0x4d1ce6:2277,_0x239bb8:983,_0x169d4a:299,_0x1c1e2e:639,_0x33d184:1106,_0x2373cd:777,_0x5888bf:"7*o4",_0x195e00:29,_0x59f088:247,_0x208b6c:57,_0x5ec7c9:"$Bws",_0x5ebdec:237,_0x1db4b1:688,_0x4d4f8c:192,_0x5d74be:"CSrr"},d={_0x4e2615:110,_0x58f33c:1071,_0x5661ba:217},u={_0x49b1a3:919},p={_0x350ef1:69,_0x2b06d1:311,_0x616adb:445},m={_0x5b3bd1:1404,_0x3edc3f:1320,_0x42306a:511,_0x385553:233,_0x8b0415:"G13@",_0x5f4e6d:70,_0x93afd0:1610,_0x12db70:"%qo8",_0x3b097b:461,_0x36eda9:"*LQ]",_0x4007fe:1284,_0xab8beb:1403,_0x4b4f85:1579,_0x100ad2:"xoTm",_0x375a29:"Ofr8",_0xb70bea:247,_0x1b9301:280,_0x273a81:"yAeH",_0x659f57:776,_0x57ffab:949,_0x3addae:63,_0x43fedb:"Pcer",_0x1e0e63:340,_0x382c88:319,_0x51682c:"U*q1",_0x9fbf3e:1046,_0x6dce34:549,_0x40e7a1:326,_0xbda8a2:383,_0x1edd65:540,_0x40c7d6:1453,_0x7524ab:925,_0x54af0a:1281,_0x4addb6:"$Bws",_0x2ece78:478,_0x739f1e:497,_0x262ba2:374,_0x6a4e05:413,_0x18bfe9:"$L(L",_0x259060:508,_0xae3edd:843,_0x4b019e:"!qKa",_0x67613b:841,_0x664701:450,_0x1d6ee6:"!qKa",_0x456070:41,_0x212175:148},h={_0x75b3bd:465},g={_0x4808c9:139,_0x56828d:280,_0x9100:382},x={_0x3d82a8:203,_0x2a325f:86,_0x514130:290},v={_0x327a48:316},y={_0x562ba3:440,_0x3e2abe:711,_0x137cbc:284},_={_0x55cb6a:619,_0x475dfc:324,_0x23051c:44,_0xef0fc6:"ITq[",_0x4e9c4b:413,_0x583c25:69,_0x9d945d:234,_0x22934d:647,_0x1f3da8:"Um*0",_0x46eb03:737,_0x4688d4:660,_0x3d61b8:566,_0x36f89b:"0u@s",_0x348cf3:817,_0x3707ac:541,_0xbfd919:"0u@s",_0x9c4b03:592,_0x8bd54d:547,_0x365526:424,_0xe971b8:728,_0x3079d9:663,_0x315574:661,_0xef49c9:624},b={_0x571803:54},w={_0x5afcae:238,_0xacd883:91,_0x1687a0:47,_0x31cc39:399,_0x175f97:1719,_0x58b1ce:"srHh",_0x218b24:1893,_0x247ef1:100,_0x214015:"m6ks",_0x286135:612,_0x4c71cf:608,_0x300d73:1006,_0x44281b:1072,_0x4f9538:354,_0x17b841:19,_0x8f8880:227,_0x5bdf26:1387,_0x25b52e:563,_0xa327f8:"yAeH",_0x5d19d0:880,_0x17bebd:625,_0x4f006b:"z(fp",_0x353086:98,_0x4bf2ff:1020,_0x145126:1042},S={_0x369616:474,_0x79b9ad:314,_0x23261:390},k={_0x39b8e2:690,_0x58d38b:142},E={_0x5216d3:480};e[L(398,t._0x34bb77,t._0x2d669f,t._0x53fccc,686)+L(-148,t._0x45a357,-162,-t._0x40b2b7,-208)]=D,e[C(t._0x27105b,t._0x142c16,t._0x1ab103,1227,1295)+L(t._0x296352,t._0x59c42e,t._0x58d10f,t._0x3d93e1,t._0x27fa09)+"y"]=pe,e[L(-412,"Pcer",-214,-t._0x513a14,-t._0x53d526)+N(1301,"esI(",1149,t._0x117127,1593)+L(458,t._0xee44a6,376,717,t._0x34c0c3)]=V;var T=[],I=[],O=(typeof Uint8Array==="undefined"?"undefined":_type_of(Uint8Array))!=C("yAeH",t._0x1d3e60,t._0x186fc6,t._0x54c49a,t._0x1b9d20)+C("xoTm",1037,t._0x1f2410,719,t._0x144b9f)?Uint8Array:Array,M=C("Mu^3",t._0x55c943,t._0x19239e,t._0x14af6a,t._0x2ca6b5)+me(t._0x1a6017,"U*q1",t._0x63f5df,t._0x50a62b,t._0x666c9d)+me(2061,t._0x4769d8,2529,t._0x2d3521,2581)+me(1543,t._0x29ed94,1440,t._0x15f88f,1407)+me(1132,t._0x2080af,t._0x276bb0,1162,896)+me(t._0x235cad,"HBqf",t._0x26714b,t._0xf6d8ea,t._0x1f9fc0)+me(t._0x4536f3,t._0x57a643,t._0x3e5d04,t._0x1d7b45,t._0x238857)+me(1212,"q4^g",908,954,t._0x246bf5)+K(632,t._0x29e7c9,t._0x337ea7,683,t._0x4e6464)+C("q4^g",t._0x313f20,t._0x5c29f5,566,173)+K(535,"Mu^3",708,t._0x563ecf,440)+L(t._0x58f63b,t._0xb54cac,550,t._0x2ca1b8,t._0x431c29)+L(614,"Um*0",t._0x17614e,t._0x5894f5,t._0x218ee2);for(R=0,$=M[C("6Q[!",807,317,t._0x2a383a,t._0x2e2e9f)+"h"];R<$;++R)T[R]=M[R],I[M[me(t._0x3d8821,"nGaz",t._0x2f56af,808,t._0x18c46d)+N(t._0x2f04ca,t._0x5bc6d9,t._0x2a383a,374,758)](R)]=R;var R,$;I[45]=62,I[95]=63}),xlt=VA(GA()),Na=[];for(var e=0;e<256;++e)Na[ut("%wVn",432,1470,1196,949)]((e+256)[qe(273,756,289,209,"nGaz")+Le(1543,"EgFM",1419,1254,1867)](16)[$e(1679,2329,1436,"8F&P",1818)](1));function ylt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var r={_0x4f8303:606,_0x126890:475,_0x5cef6e:"PS7$",_0xa8fc83:651,_0x51c949:452,_0x3f8fba:61,_0x3e0868:164},n={_0x2c0cc6:472,_0x28f207:960},i={_0x46d29f:235,_0x454f8f:117};function o(s,l,c,d,u){return Le(s-343,u,d- -1209,d-i._0x46d29f,u-i._0x454f8f)}function a(s,l,c,d,u){return Xe(d,l-n._0x2c0cc6,c- -n._0x28f207,d-332,u-79)}return(Na[e[t+0]]+Na[e[t+1]]+Na[e[t+2]]+Na[e[t+3]]+"-"+Na[e[t+4]]+Na[e[t+5]]+"-"+Na[e[t+6]]+Na[e[t+7]]+"-"+Na[e[t+8]]+Na[e[t+9]]+"-"+Na[e[t+10]]+Na[e[t+11]]+Na[e[t+12]]+Na[e[t+13]]+Na[e[t+14]]+Na[e[t+15]])[a(r._0x4f8303,674,r._0x126890,r._0x5cef6e,r._0xa8fc83)+o(-r._0x51c949,r._0x3f8fba,r._0x3e0868,42,"*LQ]")+"e"]()}var UU,vlt=new Uint8Array(16);function _lt(){var e={_0x4c88a2:682,_0x598a0c:810,_0x21160f:93,_0x2ccaf5:1035,_0x49df9b:1279,_0x5d4faa:1198,_0x58d009:1309,_0x3333fc:"dltk",_0x1e90d4:452,_0x4b366d:"Pcer",_0x4953fb:736,_0x34b5c8:"q4^g",_0x4bd65b:495,_0xe1ded6:1460,_0x266f4b:1509,_0xee2667:1581,_0xcf2bc6:451,_0xe7fb55:1140,_0x40dc21:792,_0x489ca2:"IQMa",_0x4711e7:275,_0x54793d:408,_0x4a6682:705,_0x12455b:681,_0x3f0be7:534,_0x2a217b:1083,_0x30c738:"srHh",_0x2d1d2e:"7qM$",_0x4a673f:904,_0x3cce3d:"*LQ]",_0x268787:905,_0x7e0399:716,_0x5309a7:877,_0x5d1574:96,_0x3237f6:"H9LI",_0x2cadb1:1306,_0x10bab5:998,_0x597dbc:854,_0x2cd7bd:1034,_0x2bde02:413,_0x2a600:362,_0x186a37:379,_0x325f0d:92,_0x3c5176:863,_0x9b0cd4:"9PX[",_0x489589:564,_0x3143d3:346,_0x339905:389,_0x586c2b:852,_0x334093:"8x(^",_0x1635aa:557,_0x293741:683,_0xa48df2:903,_0x550e32:"KBpi",_0x347f92:704,_0x1a55e7:340,_0x88bd6c:509,_0x3f053e:1008,_0x1ac678:886,_0x1c9019:836,_0xbb7877:"IQMa",_0x858833:864,_0x40d86e:1273,_0x3271a3:172,_0x5ad543:"esI(",_0x3a88d3:38,_0x26b083:99,_0x3b9e52:49,_0x21bc96:1450,_0x2c3e74:1165,_0x313dfe:843,_0x542964:"PS7$",_0x4ce98b:1063,_0x3d4667:763,_0x72658c:"%wVn",_0x1764ec:"G13@",_0x3b8e5a:6,_0xf0412f:925,_0x40b4ad:701,_0x1cafbc:1517,_0x5c595e:741,_0x1a0830:"(gQD",_0x2a6af6:1116,_0xe4e9c0:")mU*",_0x59617a:950,_0x45d9f7:1130,_0x30655c:1351,_0x55c641:"wepR",_0x305ddd:415,_0x546507:366,_0x4bb733:88,_0x8a34a6:802,_0x2cf917:1653,_0x4415e0:1552,_0x24350f:"(gQD",_0x1c6b50:"9PX[",_0x4ec83f:168,_0x13e1b6:1503,_0x124f57:1905,_0x2e2b71:1507,_0x181036:867,_0x40c689:376,_0x84a94:781,_0x688ef:"78]e",_0x4cd8e6:512,_0x27eef1:358,_0x1649d4:505,_0x279009:"wepR",_0x4b96c2:343,_0x59e189:539,_0x5e47b9:551,_0x3e0223:"srHh",_0x1648e4:159,_0x45cfd2:385,_0x584d98:455,_0x33fbea:266,_0x388c70:1405,_0x26228b:1315,_0xd3e7ed:1686,_0x3cbeab:1536,_0x46591f:1383},t={_0x1b52c1:196,_0x90b42c:207,_0x3bf103:780},r={_0x2ceda7:35,_0x43f55c:128,_0x976066:404},n={_0x13553c:502,_0xad233f:89},i={_0x301b54:228,_0x10687b:494};function o(y,_,b,w,S){return $e(y-367,_-93,b-408,_,w- -939)}if(!UU)if(o(e._0x4c88a2,"8F&P",1056,817,e._0x598a0c)!==o(-20,"(3#Z",-e._0x21160f,-42,-64)){if((typeof crypto==="undefined"?"undefined":_type_of(crypto))==v(775,"8x(^",e._0x2ccaf5,e._0x49df9b,e._0x5d4faa)+x(e._0x58d009,993,1918,1441,e._0x3333fc)||!crypto[g(e._0x1e90d4,e._0x4b366d,926,e._0x4953fb,164)+v(243,e._0x34b5c8,330,e._0x4bd65b,182)+x(e._0xe1ded6,e._0x266f4b,e._0xee2667,1109,"$Bws")])throw new Error(g(810,"0u@s",e._0xcf2bc6,e._0xe7fb55,e._0x40dc21)+o(81,e._0x489ca2,121,e._0x4711e7,290)+v(e._0x54793d,"esI(",213,e._0x4a6682,e._0x12455b)+g(e._0x3f0be7,"Ofr8",309,1068,760)+g(e._0x2a217b,e._0x30c738,1077,1423,1347)+g(662,e._0x2d1d2e,213,186,1108)+o(e._0x4a673f,e._0x3cce3d,e._0x268787,e._0x7e0399,e._0x5309a7)+v(e._0x5d1574,e._0x3237f6,-249,-57,382)+h(e._0x2cadb1,817,1098,775,"Zjkg")+h(e._0x10bab5,e._0x597dbc,e._0x2cd7bd,e._0x2bde02,e._0x30c738)+h(-e._0x2a600,157,e._0x186a37,e._0x325f0d,"srHh")+v(e._0x3c5176,"KBpi",784,1003,617)+g(294,e._0x9b0cd4,375,355,e._0x489589)+h(e._0x3143d3,e._0x339905,e._0x586c2b,350,e._0x334093)+h(563,e._0x1635aa,591,757,"8F&P")+o(415,"HBqf",e._0x293741,e._0xa48df2,661)+v(773,e._0x550e32,1105,e._0x347f92,768)+v(788,"m6ks",e._0x1a55e7,e._0x88bd6c,280)+g(1116,"G13@",e._0x3f053e,1396,e._0x1ac678)+g(e._0x1c9019,e._0xbb7877,649,611,376)+x(e._0x858833,688,e._0x40d86e,1192,"HKLe"));UU=crypto[o(-e._0x3271a3,e._0x5ad543,-e._0x3a88d3,-e._0x26b083,e._0x3b9e52)+x(e._0x21bc96,683,1374,e._0x2c3e74,"H9LI")+g(e._0x313dfe,e._0x542964,1233,1299,379)][h(e._0x4ce98b,e._0x3d4667,1029,986,e._0x72658c)](crypto)}else{var a,s=_0x14e3df(_0x192bce),l=s[0],c=s[1],d=new _0x2038dc(_0x54df03(_0x543806,l,c)),u=0,p=c>0?l-4:l,m;for(m=0;m<p;m+=4)a=_0x5cbfca[_0x471dfa[g(413,e._0x1764ec,-e._0x3b8e5a,e._0xf0412f,e._0x40b4ad)+h(873,983,e._0x1cafbc,e._0x5c595e,e._0x1a0830)](m)]<<18|_0x596dd8[_0x2e0d67[x(901,e._0x2a6af6,965,1052,e._0xe4e9c0)+x(e._0x59617a,e._0x45d9f7,1254,e._0x30655c,e._0x55c641)](m+1)]<<12|_0x10014f[_0x2740b1[h(e._0x305ddd,e._0x546507,e._0x4bb733,-71,"H9LI")+v(441,"$L(L",-57,e._0x8a34a6,850)](m+2)]<<6|_0x341009[_0x1ba0bb[x(2081,e._0x2cf917,1815,e._0x4415e0,e._0x24350f)+h(-335,200,539,181,"Mu^3")](m+3)],d[u++]=a>>16&255,d[u++]=a>>8&255,d[u++]=a&255;return c===2&&(a=_0x245967[_0xfbdfcd[x(1610,1511,1274,1106,e._0x1c6b50)+v(658,"nGaz",834,1132,e._0x4ec83f)](m)]<<2|_0x2baa28[_0x1d4c28[x(1262,e._0x13e1b6,e._0x124f57,e._0x2e2b71,"HBqf")+h(765,e._0x181036,e._0x40c689,e._0x84a94,e._0x688ef)](m+1)]>>4,d[u++]=a&255),c===1&&(a=_0x2fec7f[_0x4a37b5[o(e._0x4cd8e6,"$Bws",-e._0x27eef1,-12,e._0x1649d4)+v(626,e._0x279009,1030,e._0x4b96c2,e._0x59e189)](m)]<<10|_0x53e44a[_0xeb0ead[o(-e._0x5e47b9,e._0x3e0223,41,-97,-e._0x1648e4)+h(376,e._0x45cfd2,e._0x584d98,e._0x33fbea,"z(fp")](m+1)]<<4|_0x2004fd[_0x494627[x(e._0x388c70,e._0x26228b,e._0xd3e7ed,e._0x3cbeab,"8x(^")+x(1279,1622,1255,e._0x46591f,"nGaz")](m+2)]>>2,d[u++]=a>>8&255,d[u++]=a&255),d}function h(y,_,b,w,S){return ut(S,_-i._0x301b54,b-93,w-58,_- -i._0x10687b)}function g(y,_,b,w,S){return Le(y-50,_,y- -n._0x13553c,w-n._0xad233f,S-149)}function x(y,_,b,w,S){return Xe(S,_-186,w-r._0x2ceda7,w-r._0x43f55c,S-r._0x976066)}function v(y,_,b,w,S){return ut(_,_-t._0x1b52c1,b-454,w-t._0x90b42c,y- -t._0x3bf103)}return UU(vlt)}function $e(e,t,r,n,i){var o={_0x62f4f3:625};return st(i-o._0x62f4f3,n)}var blt=(typeof crypto==="undefined"?"undefined":_type_of(crypto))!=$e(1176,1153,1147,"U*q1",1263)+$e(830,1587,571,"*LQ]",1083)&&crypto[$e(1258,2163,1437,"7*o4",1643)+qe(-406,586,100,-408,"XmPh")]&&crypto[Xe("XmPh",1533,1495,1264,1388)+qe(653,471,619,462,"yAeH")][Le(993,"dltk",1173,1312,720)](crypto),s1e={randomUUID:blt};function wlt(e,t,r){var n={_0x560e4e:287,_0x10e365:167,_0x2cc829:309,_0x420844:724,_0x48d6cb:110,_0x453b81:"G13@",_0x2ee0bb:45,_0x5b0f18:1092,_0x2414e5:337,_0x1519df:306,_0x36a3d9:301,_0x1a4382:"CSrr",_0x387883:212,_0x1dafc5:"IQMa",_0x247096:329,_0x3cab22:"7qM$",_0x2b0080:183,_0x53ffda:346,_0x434520:47,_0x1420a7:171,_0x46c3e3:"(gQD",_0x1a999d:694,_0x126bf2:163,_0x1a8ba6:685,_0x5dd197:196,_0x514436:2,_0x3ed9ef:640,_0x2f7a98:576,_0x45eb43:"z(fp",_0x47d406:88,_0x5700a3:276,_0x40473a:119,_0xf02a10:"KBpi",_0x3e09f6:417,_0x3189a8:680,_0x29a9fa:616,_0x54cbdd:"U*q1",_0x4e1525:89,_0x15919b:870,_0x2bb0dd:351,_0x456cee:591,_0x4606e1:287,_0xc4b998:1036,_0x3c2657:"IQMa",_0x290a50:74,_0x2ede2b:430,_0x17c7fd:160,_0x1db113:18,_0x22d352:6,_0x36f188:453,_0x48dca8:502,_0x557a42:"HBqf",_0xdd800a:220,_0x5e830e:459,_0x1be27e:696,_0x40da62:240,_0x372bd8:"$L(L"},i={_0x4e8ec4:222,_0xb9a47c:1311},o={_0x41e1b6:77,_0x42a652:367,_0x5eb515:390},a={_0x11ade3:221,_0x10048d:400,_0x419ff3:319,_0x4fbf3e:1274},s={_0x1d02c1:76},l={_0x26ae6e:488,_0x26ec60:762},c,d,u;if(s1e[m(-n._0x560e4e,-472,n._0x10e365,"pTZ^",-178)+m(-n._0x2cc829,-541,-n._0x420844,"dltk",-151)]&&!t&&!e)return s1e[x(621,"!qKa",-n._0x48d6cb,265,193)+v(108,531,-66,n._0x453b81,n._0x2ee0bb)]();function p(y,_,b,w,S){return ut(S,_-l._0x26ae6e,b-220,w-82,y- -l._0x26ec60)}e=e||{};function m(y,_,b,w,S){return ut(w,_-s._0x1d02c1,b-414,w-195,y- -939)}var h=(u=(d=e[m(642,n._0x5b0f18,940,"(3#Z",n._0x2414e5)+"m"])!=null?d:(c=e[p(n._0x1519df,n._0x36a3d9,13,270,n._0x1a4382)])==null?void 0:c[g(-n._0x387883,n._0x1dafc5,10,-n._0x247096,-679)](e))!=null?u:_lt();function g(y,_,b,w,S){return ut(_,_-a._0x11ade3,b-a._0x10048d,w-a._0x419ff3,y- -a._0x4fbf3e)}function x(y,_,b,w,S){return qe(y-52,_-o._0x41e1b6,w-o._0x42a652,w-o._0x5eb515,_)}function v(y,_,b,w,S){return ut(w,_-i._0x4e8ec4,b-53,w-447,y- -i._0xb9a47c)}if(h[m(618,791,305,n._0x3cab22,n._0x2b0080)+"h"]<16)throw new Error(g(34,"KBpi",-351,408,257)+m(n._0x53ffda,n._0x434520,n._0x1420a7,n._0x46c3e3,n._0x1a999d)+m(548,n._0x126bf2,n._0x1a8ba6,"%wVn",455)+v(n._0x5dd197,-259,-247,"7*o4",-n._0x514436)+p(132,200,n._0x3ed9ef,n._0x2f7a98,n._0x45eb43)+p(-n._0x47d406,-336,n._0x5700a3,n._0x40473a,n._0x45eb43)+g(-475,n._0xf02a10,-735,-917,44));if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,t){if(r=r||0,r<0||r+16>t[p(-47,204,n._0x3e09f6,407,"$L(L")+"h"])throw new RangeError(m(n._0x3189a8,463,n._0x29a9fa,"8x(^",671)+g(-596,n._0x54cbdd,-494,-n._0x4e1525,-n._0x15919b)+g(328,"G13@",n._0x2bb0dd,-192,n._0x456cee)+" "+r+":"+(r+15)+(p(811,n._0x4606e1,n._0xc4b998,1323,n._0x3c2657)+p(-n._0x290a50,n._0x2ede2b,-n._0x17c7fd,-n._0x1db113,"%wVn")+m(n._0x22d352,-n._0x36f188,-n._0x48dca8,n._0x557a42,-n._0xdd800a)+x(1078,"U*q1",n._0x5e830e,n._0x1be27e,n._0x40da62)+m(394,259,-27,n._0x372bd8,-140)));for(var y=0;y<16;++y)t[r+y]=h[y];return t}return ylt(h)}var Slt=wlt,klt=Xe("q4^g",1441,1021,736,1393)+$e(1808,1681,1258,"z(fp",1483)+Le(1273,"7qM$",923,1374,428)+ut("$Bws",907,772,1455,1282)+qe(230,-376,127,-126,"$Bws")+Xe("$L(L",1523,1424,1263,1604)+$e(1511,1766,1973,"*LQ]",1653)+$e(1731,2003,1909,"0%4x",1700),Ygr=ut("$L(L",606,954,1164,804)+Le(580,"IQMa",945,629,1436)+ut("PS7$",600,564,528,979)+$e(764,1075,854,"wepR",914)+Le(91,"(3#Z",611,1051,208)+Xe("(3#Z",116,600,697,264)+$e(2010,1586,1571,"$Bws",1638)+Le(445,"z(fp",573,160,1103),Xgr=Le(661,"esI(",1095,650,1570)+ut("yAeH",1236,1521,1560,1466)+ut("XSQ8",941,799,551,785)+ut("wepR",914,999,1867,1417)+Xe("Ofr8",1357,840,357,377)+Xe("$L(L",388,823,1241,1096)+qe(-424,306,-98,-333,"(gQD")+ut("%wVn",1980,1956,1250,1621),Clt=qe(902,399,633,542,"*(#r")+$e(2208,1668,1762,"Zjkg",1725)+Le(429,"Pcer",671,926,654)+ut("(3#Z",1854,1926,1683,1564)+qe(275,-175,68,138,"EgFM")+Xe(")mU*",1141,991,1446,975)+"84",Elt=Xe("H9LI",1489,1358,1579,1583)+qe(-18,678,188,297,"uHEn")+Xe("HKLe",1651,1268,1133,1435)+Le(488,"!qKa",635,348,1053)+$e(1430,1300,2070,"xoTm",1553)+Le(1295,"HBqf",1166,794,721)+ut("7*o4",827,934,1671,1213)+$e(1354,1166,1242,"G13@",1210)+Le(561,"78]e",765,256,1198)+$e(1388,2124,1344,"%wVn",1592)+Le(1710,"PS7$",1574,1142,1395)+Xe("U*q1",949,1310,1816,1206)+ut("0%4x",743,824,456,836)+Le(1236,"gCWj",1210,883,1147)+ut("XmPh",632,198,159,653)+$e(1345,1176,493,"(3#Z",846)+Xe("7qM$",1096,1401,1509,1643)+$e(1224,811,681,"8x(^",1172)+$e(991,934,1432,")mU*",1127)+Xe("Mu^3",564,845,1021,538)+$e(1783,1629,2064,"esI(",1848)+$e(1120,1089,965,"KBpi",1104)+Le(2063,"wepR",1579,1853,1369)+Le(1450,"8F&P",1124,690,1005)+Xe("dltk",1380,1314,830,1740)+$e(1670,1813,1924,"nGaz",1391)+qe(387,417,-2,354,"Zjkg")+ut("G13@",1049,738,549,999)+Le(956,"Zjkg",599,585,551)+Le(424,"uHEn",924,1332,497)+Xe("z(fp",1282,860,749,1243)+qe(384,416,449,751,"ITq[")+ut("G13@",1034,1032,977,828)+$e(1135,1029,1461,")mU*",1531)+ut("srHh",1389,1282,1448,998)+Xe("(gQD",1592,1100,1128,811)+qe(188,-243,32,-461,"ITq[")+ut("H9LI",1076,595,406,626)+Le(1352,"0%4x",1110,730,974)+Le(1115,"PS7$",1272,894,997)+$e(1762,1664,1573,"7qM$",1658)+$e(865,912,1233,"xoTm",1088)+Le(1478,"$L(L",1564,1843,1735)+ut("HKLe",1046,724,788,837)+Le(1101,"pTZ^",1587,1915,1764)+qe(487,210,298,761,"!qKa")+$e(1916,1060,1025,"0u@s",1382)+Le(798,"H9LI",1024,591,1026)+ut("q4^g",1616,784,815,1126)+Le(1408,"esI(",1531,1341,1807)+Xe("PS7$",781,944,1469,734)+qe(654,244,493,178,"%wVn")+Xe("Ofr8",1075,1461,1875,1801)+$e(1446,1486,1062,"Pcer",1335)+qe(479,-344,-9,-144,"dltk")+$e(572,1285,553,"xoTm",928)+qe(444,467,237,222,"6Q[!")+qe(199,412,441,620,"*LQ]")+qe(498,334,568,693,"gCWj")+$e(1043,686,612,"Zjkg",1065)+qe(-118,401,413,487,"wepR")+$e(787,1761,1391,"nGaz",1253)+Xe("U*q1",1453,1062,585,1019)+$e(1070,1023,1403,"XmPh",1292)+$e(1330,1346,999,"IQMa",1414)+Xe("XmPh",1142,1386,1858,1024)+qe(-118,-92,379,327,"uHEn")+Le(91,"%wVn",588,138,376)+qe(825,1098,608,447,"9PX[")+qe(13,349,-26,-270,"0%4x")+ut("Zjkg",1538,868,1605,1168)+Le(1543,"pTZ^",1348,1853,1594)+Le(1089,"78]e",1234,1260,1009)+ut("yAeH",1868,2067,1114,1617)+Xe("$Bws",818,513,159,505)+ut("Ofr8",1470,1463,1293,1534)+Xe("0u@s",766,1292,858,763)+qe(176,848,417,158,"srHh")+qe(-183,302,-174,-675,"srHh")+Le(973,"0%4x",1026,1202,594)+ut("7qM$",939,1139,1135,955)+ut("PS7$",849,1007,1090,600)+$e(970,1860,1921,"PS7$",1495)+$e(1754,1496,1794,"6Q[!",1567)+Xe("srHh",1260,912,1228,585)+ut("yAeH",671,940,1214,796)+Le(1709,"srHh",1255,1274,1492)+$e(1271,1402,967,"XmPh",1212)+ut("xoTm",943,713,1429,932)+$e(2188,2163,2102,"ITq[",1782)+$e(1532,1478,722,"!qKa",1059)+Le(1890,"m6ks",1369,872,1456)+qe(1282,1316,854,1156,"Zjkg")+$e(1604,1827,1440,"$L(L",1492)+ut(")mU*",384,1153,490,735)+ut("(gQD",2140,1788,2036,1606)+Le(1039,"!qKa",682,1209,236)+qe(432,-51,370,804,"78]e")+qe(501,700,661,691,"xoTm")+$e(2132,1323,1957,"%wVn",1800)+$e(1492,1964,1853,"7qM$",1755)+$e(752,1083,1664,"$Bws",1278)+ut("Um*0",1966,1769,1222,1549)+ut("6Q[!",638,402,439,919)+$e(2070,1860,1402,"dltk",1688)+Le(322,"%qo8",593,1033,445)+$e(1425,1682,2118,"%qo8",1637)+qe(223,1031,510,690,"%wVn")+$e(1324,1463,1401,"uHEn",1129)+$e(1513,1027,1701,"*LQ]",1239)+qe(-96,173,364,76,"7qM$")+$e(1244,1904,1917,"8x(^",1489)+$e(728,984,1455,"dltk",1052)+Xe("CSrr",882,501,811,970)+Le(889,"srHh",843,1234,1194)+$e(833,731,883,"Um*0",1138)+qe(880,343,722,1117,"CSrr")+Le(574,"78]e",929,739,874)+ut("IQMa",921,649,1184,1166)+Xe("78]e",1223,1326,1802,1795)+qe(437,300,226,518,"XmPh")+qe(738,719,588,488,"H9LI")+$e(1411,1587,1010,"Um*0",1509)+qe(419,-2,72,-21,"$L(L")+Le(810,"HBqf",946,894,1481)+qe(696,903,846,1124,"wepR")+$e(1341,1865,1796,"uHEn",1698)+qe(634,87,437,269,"xoTm")+qe(278,323,-6,292,"Mu^3")+Xe("EgFM",1347,1549,1748,2081)+$e(711,1387,1380,"Mu^3",1013)+ut("xoTm",466,1283,785,884)+qe(776,331,522,944,"wepR")+Le(799,"dltk",689,925,256)+Le(1307,"%wVn",896,411,1298)+$e(424,1368,591,"HKLe",852)+$e(701,721,987,"U*q1",943)+Xe("gCWj",753,1283,921,1733)+qe(-151,177,352,26,"CSrr")+Le(1099,"pTZ^",1395,913,894)+Xe("CSrr",848,1323,1447,1668)+$e(1524,1659,979,"(3#Z",1473)+Le(765,"(3#Z",724,874,285)+qe(302,-78,256,63,"CSrr")+Xe("Pcer",1026,704,627,997)+qe(787,1367,881,625,"U*q1")+qe(-418,-342,-132,-386,"wepR")+Le(1756,"Zjkg",1414,1241,1835)+qe(362,-120,-8,-463,"!qKa")+Xe(")mU*",1059,1502,982,1556)+Le(1215,"srHh",1560,1948,1283)+Le(2086,"CSrr",1627,1837,1119)+$e(919,778,648,"6Q[!",816)+Xe("9PX[",1129,895,1054,898)+qe(231,-283,-119,-204,"Ofr8")+$e(1154,1309,765,"0%4x",1259)+Le(738,"esI(",1034,756,786)+Xe("uHEn",1614,1442,1207,1947)+Xe("8x(^",1669,1368,1185,1601)+ut("yAeH",840,393,393,824)+qe(-362,-426,-60,-555,"0u@s")+Le(2042,"7*o4",1513,1721,1259)+Xe("78]e",1542,1521,1435,2029)+Le(1490,"dltk",1039,740,1269)+qe(-55,282,191,61,"78]e")+qe(49,16,-152,-440,"G13@")+Xe("%qo8",1692,1536,1633,1482)+Le(733,"78]e",1047,674,526)+Le(955,"(gQD",974,676,1206)+qe(425,277,107,242,"9PX[")+Le(582,"wepR",1078,1199,757)+Le(1363,"8F&P",922,939,1128)+$e(1046,859,542,"6Q[!",1057)+qe(129,892,625,788,"Pcer")+ut("6Q[!",563,869,762,622)+$e(1380,1577,1187,"HBqf",1415)+qe(1186,915,678,1143,"z(fp")+Le(1086,"Pcer",844,505,965)+$e(1198,905,973,"xoTm",926)+qe(46,-33,-161,315,"7*o4")+$e(1013,965,1385,"7*o4",1298)+qe(387,841,406,255,"EgFM")+ut("8F&P",755,839,878,939)+Le(1256,"*LQ]",1465,1634,1674)+$e(1686,1172,1e3,"nGaz",1232)+ut("(gQD",1734,1534,1124,1363)+$e(653,907,1038,"78]e",930)+ut("ITq[",199,718,141,639)+$e(1588,1104,1464,"0u@s",1086)+ut("*(#r",331,910,462,686)+$e(1831,1393,1095,")mU*",1538)+qe(702,1209,782,1308,"gCWj")+$e(1436,1242,803,"(gQD",991)+Le(1297,"Mu^3",1387,1525,1405)+ut("0%4x",1018,784,947,724)+$e(2230,1667,2194,"uHEn",1697)+Xe("IQMa",1513,1449,1297,923)+Xe("srHh",579,943,1201,1018)+Xe("8F&P",1259,811,1051,972)+qe(-70,183,-105,-448,"(3#Z")+($e(890,1562,1255,"Mu^3",1372)+$e(1312,1092,726,"m6ks",1039)+qe(-162,610,359,811,"7*o4")+Xe("8F&P",507,830,610,740)+ut(")mU*",1607,1012,1551,1142)+Xe("wepR",1156,1409,1666,1752)+Xe("srHh",39,506,354,665)+$e(1227,1651,1229,"78]e",1147)+Xe("yAeH",854,1345,1083,1073)+Le(277,"7*o4",712,185,290)+qe(460,156,548,179,"XSQ8")+$e(924,1130,681,"Mu^3",863)+Le(280,"XmPh",587,401,664)+$e(2030,1643,1396,"gCWj",1646)+Le(1605,"$Bws",1400,1301,1104)+Xe("HBqf",1555,1193,1139,1544)+$e(1810,1605,1905,"7*o4",1488)+qe(491,437,-27,277,"U*q1")+$e(564,1275,1237,"IQMa",1055)+Xe("8F&P",834,1207,841,912)+qe(374,-273,-130,388,"%wVn")+$e(1475,2122,1365,"$Bws",1632)+ut("0u@s",889,1764,1684,1353)+qe(305,607,505,887,"9PX[")+Xe("HKLe",1114,1481,1739,1174)+ut("ITq[",660,972,717,1114)+$e(1383,1844,1403,"*(#r",1668)+Xe("EgFM",828,542,808,600)+Xe("!qKa",884,1250,1731,1023)+qe(185,144,671,944,")mU*")+Le(1622,"9PX[",1225,1597,1006)+Le(777,"KBpi",883,715,1180)+$e(1224,1931,1974,"$L(L",1679)+Xe("HKLe",1522,1317,1021,1420)+Xe("0u@s",1016,619,556,984)+$e(1912,1709,1294,"8F&P",1568)+$e(1598,1838,1252,"m6ks",1719)+qe(623,-247,123,220,"7qM$")+Xe("XmPh",1826,1334,1739,1746)+Xe("!qKa",1700,1475,1788,1950)+ut("7qM$",1319,834,1173,946)+ut("KBpi",431,582,366,719)+Le(1431,"0%4x",1092,810,809)+qe(1183,1007,809,675,"*(#r")+qe(250,264,83,574,"EgFM")+ut("XSQ8",183,240,650,673)+ut("HKLe",1806,1386,1090,1331)+Le(828,"*(#r",861,791,1083)+Le(1233,"dltk",1609,2135,1911)+Xe("7*o4",781,1053,1443,1584)+Xe("esI(",1367,925,615,455)+Le(1271,"0%4x",1031,1288,941)+qe(449,434,772,297,"(3#Z")+Xe("HKLe",1163,1233,1343,980)+qe(224,475,-16,-360,"Ofr8")+$e(1060,1517,827,"xoTm",1148)+$e(1407,1489,1473,"gCWj",1413)+ut("*LQ]",768,1151,1794,1275)+qe(578,-263,215,364,"8F&P")+Xe("(gQD",1387,1500,1386,1962)+$e(1018,1379,1065,"Ofr8",1262)+qe(425,-127,11,69,"XmPh")+Xe("q4^g",610,1004,1104,1100)+Le(622,"srHh",939,1386,947)+ut("%wVn",1152,1363,1174,1046)+Le(786,"XmPh",677,1144,714)+Le(1606,"dltk",1363,1323,867)+$e(935,1408,1736,"m6ks",1396)+Le(947,"KBpi",975,1448,1461)+qe(-285,-468,-45,-66,"xoTm")+Le(999,"KBpi",624,1137,817)+$e(2057,2158,1766,"(gQD",1651)+$e(1343,1712,1209,"yAeH",1635)+ut("XmPh",1679,1677,1741,1378)+Le(1766,"gCWj",1529,1009,995)+Xe("7qM$",1059,831,1038,934)+qe(329,-333,145,396,"XSQ8")+$e(540,1100,830,"*(#r",1064)+ut("G13@",1727,1054,1209,1365)+Le(1615,"Pcer",1090,610,641)+qe(649,840,663,936,"7*o4")+qe(-202,-369,-23,-334,"xoTm")+ut("U*q1",1503,1501,1561,1556)+ut("Zjkg",2012,1342,2066,1569)+qe(373,1200,690,1199,"ITq[")+ut("xoTm",1327,1033,935,1408)+Xe("$L(L",1730,1362,1231,1517)+$e(1386,2029,1640,"7qM$",1772)+Xe("pTZ^",1945,1546,1541,1242)+Xe("xoTm",537,719,288,333)+Le(716,"srHh",877,1262,688)+ut("(3#Z",373,684,786,752)+qe(-28,547,148,-2,"Zjkg")+Le(1562,"XSQ8",1636,1752,1127)+Xe(")mU*",883,680,301,1199)+ut("(3#Z",2085,1193,1515,1603)+ut("IQMa",1719,1255,1523,1249)+Le(1472,")mU*",990,1167,654)+$e(1376,737,1465,"KBpi",1222)+Le(1066,"7*o4",1316,1617,1339)+Le(907,"HBqf",1252,1451,1613)+Le(1038,"EgFM",1538,1492,1335)+ut("CSrr",551,1488,651,1054)+Xe("9PX[",1246,780,1185,882)+qe(262,1186,702,1115,"XmPh")+Le(1463,"dltk",1367,1626,1628)+$e(685,1494,1270,"7qM$",1143)+Le(529,"XmPh",629,300,185)+Le(1672,"PS7$",1481,1696,1431)+$e(957,1456,1037,"dltk",997)+Xe("esI(",793,796,786,1313)+qe(591,615,602,874,"HBqf")+$e(1669,1218,1215,"Ofr8",1237)+Le(2082,"gCWj",1575,1321,1405)+Le(550,"0%4x",956,447,1217)+Le(1819,"%qo8",1457,1349,1281)+qe(454,848,537,538,"G13@")+ut("dltk",1595,1213,792,1189)+Xe("uHEn",1075,1140,685,1156)+qe(889,118,443,610,"ITq[")+ut("0%4x",1168,1111,673,1076)+Le(919,"9PX[",1333,1311,1600)+Xe("(gQD",1486,1124,1510,1324)+ut("CSrr",1510,1400,1148,1356)+$e(1926,1936,1332,"8F&P",1850)+ut("7*o4",789,736,1104,665)+qe(-191,630,114,-54,"m6ks")+Xe("H9LI",222,751,836,432)+Le(611,"Mu^3",960,736,682)+Le(1229,"%qo8",1544,1628,1200)+qe(673,1296,821,950,"z(fp")+$e(596,946,308,"Um*0",820)),Tlt=Xe("Ofr8",913,1350,836,1200)+$e(1628,941,764,"8F&P",1196)+ut("$L(L",1908,1323,1587,1384)+Xe("esI(",1312,1428,1500,1542)+$e(1678,1256,1687,"HBqf",1791),Alt=VA(GA()),Ilt=globalThis[Xe("dltk",1526,1548,1835,1406)+"o"],kv=Ilt[$e(1029,1946,997,"Mu^3",1480)+"e"];function c1e(){var e={_0x281663:1234,_0x616524:1292,_0x2b7234:413,_0x31a2bb:"m6ks",_0x5d1206:117,_0x4ea878:1057,_0x1f4a14:1014},t={_0x57b6f0:35};return ru(this,null,function(){var n,i,o;function r(l,c,d,u,p){return st(l-659,u)}function a(l,c,d,u,p){return st(l-t._0x57b6f0,c)}function s(l,c,d,u,p){return st(u-687,p)}return _ts_generator(this,function(_state){switch(_state.label){case 0:n=Elt[a(e._0x281663,"nGaz",e._0x616524,975,819)]();return[4,Plt(Clt,n)];case 1:i=_state.sent(),o=new TextDecoder()[a(e._0x2b7234,e._0x31a2bb,e._0x5d1206,105,-32)+"e"](i);return[2,JSON[s(e._0x4ea878,786,1477,e._0x1f4a14,"!qKa")](o)]}})})}function Plt(e,t){var r={_0x1efc0e:336,_0x39efd1:384,_0x308dc1:"Um*0",_0x309257:511,_0x2cde5d:"HBqf",_0xdd2436:393,_0x55f868:200,_0x1582c2:959,_0x338558:559,_0x2d1281:"esI(",_0x1e4b40:113,_0x4e03fe:178,_0x1f688f:616,_0xf0935c:1384,_0x145e0c:1199,_0x4c19fb:1692,_0xf7dcd6:920,_0x520085:532,_0x3ea7ee:1320,_0x18af45:1053,_0x4fb402:1111,_0x25c13e:1373,_0x2d4fdb:"%qo8",_0x2fbbd4:135,_0x59595e:177,_0x3fbb15:318,_0x1ecb23:791,_0x533685:571,_0x2911e4:1022,_0x514677:779,_0x1e90bf:918,_0x48149d:"%qo8"},n={_0x399d26:189};return ru(this,null,function(){var i,s,u,p,m,h,g;function o(x,v,y,_,b){return st(x-n._0x399d26,_)}function a(x,v,y,_,b){return st(_-776,v)}function l(x,v,y,_,b){return st(b-i._0x417a3c,y)}function c(x,v,y,_,b){return st(v- -695,x)}function d(x,v,y,_,b){return st(v- -450,y)}return _ts_generator(this,function(_state){switch(_state.label){case 0:i={_0x417a3c:597};s={};s[d(r._0x1efc0e,r._0x39efd1,r._0x308dc1,226,r._0x309257)]=d(280,201,r._0x2cde5d,r._0xdd2436,r._0x55f868)+"CM";u=new TextEncoder;return[4,kv[o(r._0x1582c2,1485,1221,"z(fp",r._0x338558)+c(r._0x2d1281,-r._0x1e4b40,-r._0x4e03fe,-136,-r._0x1f688f)](a(r._0xf0935c,"gCWj",1549,r._0x145e0c,r._0x4c19fb),u[o(r._0xf7dcd6,754,r._0x520085,"8x(^",r._0x3ea7ee)+"e"](e),s,!1,[l(r._0x18af45,1682,"!qKa",r._0x4fb402,r._0x25c13e)+"pt"])];case 1:p=_state.sent(),m=(0,Alt[c(r._0x2d4fdb,-305,r._0x2fbbd4,-511,53)+d(-r._0x59595e,r._0x3fbb15,"0%4x",341,458)+"y"])(t),h=m[l(877,1383,"yAeH",885,979)](12),g={name:o(r._0x1ecb23,975,878,"HKLe",1128)+"CM",iv:m[o(r._0x533685,931,283,"yAeH",r._0x2911e4)](0,12)};return[2,kv[o(r._0x514677,r._0x1e90bf,255,r._0x48149d,777)+"pt"](g,p,h)]}})})}var Rlt=VA(GA()),Mlt=Le(549,"%qo8",871,585,1098)+$e(1294,1127,1008,"IQMa",1313)+Xe("Ofr8",581,728,777,1086)+$e(1122,760,956,"HKLe",1179)+ut("(3#Z",980,1194,1527,1151)+"-",Olt=Le(1443,"Ofr8",1506,1339,1217)+ut("CSrr",1140,924,123,621)+qe(122,-142,212,-126,"XmPh")+$e(865,978,1160,"6Q[!",974)+$e(1411,1235,812,"ITq[",1203);function WA(){var e=["WQJdGHWPWQtdGSk5wWdcQ8oJdCoJ","AbuEwCkX","lCoeW5BdV8ki","e1nhWOlcQq","c8oHW5BcKNS","suS+W63dSG","WOeXCcj5","yulcMSkvWO0","WPShW7K2WQG","W5pcJwbYW4C","WO7cUZaWga","WO7dPqNdOmoj","v8o6W7/cNsK","W4ldQfPAW64","setcJSoija","WRJdTatdVmke","WRBcOmkvWRqO","xdZcJmkQ","WOVdRIZdUmoA","Eb8OWPpdVq","W6DeWOxdVa","WPBdQJ/dVSox","W7H7W6hcQq","WOxdJs1+sW","W5bBWPaLlq","W7ZcHGH5W7O","imoqhSoZiq","W6ddGKhdTI4","sSokW750gq","WRxdKs3dGq","Cmkaumo3W7m","WOhdTmo7mNm","AmoHWQ9N","CCo6WRLR","W78FWR9SW4m","W67cJLNcMre","Drqnr8kX","WPiVeJ1v","W4m6wJ0h","W5eAtq","rW8VW4e5","BLRdMCk3WPW","WQJcSxzQW6W","WO7cRXSQsW","WRuqCsq5","E8koWPFdUCkv","WPHiWRVdJKm","W71eW5dcIXe","iSoNWPJcGCk1","WQhcJ3ddLH0","qrOjWQddHq","W40IcKdcJq","W4vHWQuFxG","C8kQfH4r","WP8WEHP+","vgHOW6up","WPjiWQSdcq","rKJdHCk8","WOi7W6S","sWxdOSk3tq","W7BcQLhdG0m","WPRdICoWk2m","b1PAWRpcRq","WOpcO0r6bG","uHux","WR1nW4hdUmoo","nqzjbmk5","WOVcMCk9WQmV","W4iwDd8z","WO9mW5pdNJG","W7ObW7XGcW","DSkXeL0N","W63cJvH+","draJW41T","tHCLWQ7cRa","iSoviHan","WOuJW5ayW50","yJNdTmk0xq","Ag16W5qE","lZjRW4v1","W60aW7DBqq","WRWgFa1r","W6qgWPzfW6K","l8oyuCoVjW","pYD8W6fs","lcGXW7LL","W4vJWRSm","W4uOW7X3hq","WORcUKf5W58","WOrjWQddKvW","W7RcNeLPW5y","W6mnWOjmW64","W7rQWRSwDq","WR7cNN/dHrW","wvRdH8kbWQq","WRpdIupdH0m","W5T8W63cLXm","WOj6W5xdHda","zCk2h0mG","W4hcMCo8gmo6","pa09WQ7cPa","W4ZcMgyQW6m","nSozpSo6","tuyeWQtdUW","zIZdNSk1sW","W4GdWO7dSCoB","srGlWRhcIG","WRFdMdFdO8o/","WOldG8osi2a","CmoKENmj","amoznSoAgq","WQOsW6zfW7m","W7NcIYxdHuC","W4DSWQ8qzW","r19BWOxcNG","WOZcUCk8WRqB","lvnRWOFdHW","DLLGW7ldSW","WQzgW5NdSta","CCkvqmoYW7G","WPejW7aVW44","e8oJW7lcMNy","kYmkbmkH","mK8BWRlcNG","WOBdGCope2a","es1SW6qe","W4pdG1j/W54","W7ulWODBW4S","W5BcISkUWRKb","WO7cNqFdReC","W7b7W63cVH0","AmoWhv4o","WPpcVr8Yba","ACoWgvqx","WPVcLKrm","i8opwCk1CW","WP3dN8orjNS","E8kyr8oEW7G","W7FdTCooW6v6","zvLpW6hdPq","WPRdPMX5fG","oCoJBtyE","W6pdR24UW5C","W47dPf5PW5K","WQtcVxi","W50eW7vlCq","W63cM2r0W6i","BmoWWOBdHSkD","WPJcMhFcGKi","CmkasW","W4tdKCoW","dSoBWQFcM8k/","WQxdQSoXcLS","r8kjWORdVCk3","BxfSW5ix","W4m2WQ9TWQG","W50xWQ7cRCoo","W47dNwm","W6vYW7dcVHa","ECo7W7jOAW","W5FdTCooW6zW","WONcRfaXvG","qh/dOSoNWOu","WOxdVYNdOmoB","sLpcLCom","WOhdI8ktmwe","W5/dQhDTW7C","AxOiW63dMq","WQJdUSopW7yY","WRBdHtpdKmoj","a8oJW6/cM0W","EmkpWPZdN8kv","EmkGumkPW64","W6mxWO4gW6W","ySo9WRnZva","WOFcRM9/W6m","W7FcPfP0W6u","W4LjWOqAvW","W4xcNSokhmoX","WOjyWQ3cKKK","cXzxW4js","eubBW63cKSkIFSk1lSorWRxdHmoE","yCk7cKmc","WRa7W6vDlW","W40eW78","fGu1W6Lk","E1yDWRRdHW","e8oNW6ZcKNG","W44NyHvD","WOC+qXZdMq","WQbzW7JcJHm","E8kvv8oAW6q","WPy0uwWR","buSaWOlcOG","DshdN8k1Da","WOpdLMXGBq","W5OgtSo4mG","W7P6W7ydja","p8oXp8opyq","Ahb7W4m7","CmkcWP/dPW","WOJdQJFdQ8og","nSoqn8onna","W4RdPvLI","DCkoW5NcOmoC","j8oigmoZpq","WRJcNSonkwa","jCkXW5RcQ0G","WRxcJx85sG","Ew1SW4rQ","chm+WQ7dUq","WOJcIqv3jG","WPtdIfHvrG","x03dSmkaWPm","WQNcUgr9W7O","WRLiWQRcNei","WOHlW4FdKWq","W4KZtGW","W5WnW6DCzW","W7WOWQBcL8oE","WRBdMCoNW5rv","WPZcVCk7WQmN","eGGPW6nT","t1bEWOtcOG","W4BcHCohcG","W6WBW4TlnG","W7SaW7O+W7i","W6DeWPLvra","WQSnWQ1gW58","W7WpWPFcTCoE","rIa2W6SI","z0WGW7ZdTq","WQWcW6v3BG","W74cWPigW6S","xuNcNCotaq","lCkoqSo+W7G","BmoAWP9kza","W7ddOmkaW615","WR/cIevGW5W","uMxcMCoxkW","WQJcPvJdRgK","W6VdOmknW5zM","W5FdH05afW","W7bYW7BcSGC","WP1xWPRdNxO","DZ46zmoL","iSoTW7lcINW","W6KoWQr9","W6OoWQP7W54","fCobWQRcV0W","WP8GytfQ","WQBcR2hdTJO","jCouemoUea","W7ihW6vhtG","WQ7dVdBdOG","W5/dHKnoW6q","FgTVW7JdUa","ACktfSo1jW","Cmkaxmo/W7K","fSovW63cM2S","WQNcVepdHq","eSoTW7i","W5ddRa/dHCo/","W6dcTmopW6q/","W7lcKuy","W7yEWQ5oW58","W6ZdUCojW7zS","sM1JW7RcTW","W6yhW7PLlW","WOvDWQRdKKS","W6VcLuz/W7O","WQhcMqiQaG","W4RcHCou","W5Tac8kjjG","W4pcOLf+W64","WRZcSgnWWO8","W7OYW61wpa","WQVcRfBdN0u","W5y7WQvGW5G","tvO2WRJcRa","aLOoW5/dSq","Fb8rx8k1","mfnhWQVdGq","W4vjW4TTda","W6f3W7DbzG","WQFcShrhW4q","f3reW7/cHW","raLUW48v","BtGHWQpdIq","zH/dM8kLwG","x0pcKmoe","CfGXWRtcJq","WQuvW7awW4y","tYyVC8kn","WPxdII19sa","BvzQW7pdPa","zvzPW6pdSW","cSoUWQ/cQYS","b0LQW6/dVW","W6SBWRi","W5arx8o8na","wfpcK8omaa","W7BcM04WW4q","WPpdPI3dPmks","Fbumsmk8","eGeYW693","W48kW7vABG","CNbbW77dUa","jfP7W7ddUG","C8o5W71zfG","lCkxa8k0W7C","W4n+WRqxEa","wJJcGSkcWP4","lfn3WRVdJW","W5WutSoulW","cqFcVSkRWPS","s14VWQNdSq","AgP3WOKV","Amkow8o1","u07cMmoelG","W5WKvb7dLq","tbeaWRldNG","iK5QWR/dTW","jCoLWOFcGmkE","WRRcPL7dG0u","W5X/WO3dTMu","W7FdOmofW6y","WO1zW5/dRgq","WOBcRrSHaW","zmkerSo4W74","yWnTW6bL","W4WnW5LAsW","W5dcUt4ddq","W6rRW7D0na","dbzCW7rz","W40aW7zcrq","W5nCW4ldVsS","FNz+W5qE","WRnoW5/dH2G","kSomjSoQbG","aCo/WPJcICkq","WQJcR8k3WRml","W7uFWQvOW58","W5hcJNDwESkwvCkF","ufzeW53dKG","W4rlW7DEfG","CZvZW5ic","W5WAWQ5aW5O","yMVdMmk9WRK","WRnJWP/dGd4","tdZcHG","W4BdU8ooW7z6","B39O","W6L/W6bajW","WOhdOtRdVSol","W6ddHSofW7nQ","W7OFW7CFDG","WQ3cOvxdGW","uaHAW5pdMq","Dq03W6tcGq3dLCk7rSkAtqC","WOeLuMym","WRVcPLtdLa","W6NcLvPOW7a","ASoyWQW1AG","W7lcV0T4W7K","W5GaW7jHuW","W6vEvSoYDW","W4/cVL5TcG","W5hdVfP6u8kJWP89W7FcJu7cMmkY","vJZcHG","W4iVW4ddSmo+","hrTkW55f","yHddMCk/sa","W4i6tGtdGW","yvzPW6ldTa","W6rRW7DOkG","W5BdT8k9WQeS","WPaWD01O","iSoOFsep","WPCNw3Kk","WRldLh/dL8ou","BaD9WQS","CwP2W5yX","fSoUW5RcHhe","WRKXWO5wWOy","mSkLWQ7cOCkK","dCo8WQ3cOmkg","WOJcGx4V","W6ldVCogW7S","DdtcI8kYxq","W4WrW6DAuq","bv4OWRpdTW","CeTkW68z","n8kkW5NdS8ku","mLzQWP3dJa","iuPSWRhdKa","bmoXW7/cJha","WP3dKSoolxO","WOLfW5ddKW","zv/dGmkHW6y","pMPxW6hdKG","W6ddTGX6W6m","wSk5WQhdHmok","W6qgWObBW60","uaustCkD","W4OCW7K","W7DZW7ZcRG","ymozWRTbwa","seSDW6G","WPS3Caj/","saaAWQxdMq","W5/dQmo3W6H/t8kEWQ7cSvCwhG8","omkFWPBdTCke","yYxdImk/xa","W7WCW7Tb","W5XfW6BdVMu","W4VcH8kmbSoQ","zmkhWPddVCke","WPpcVb0Rbq","W6VcMK8","AwtdICk9WQ0","iSoSzZCj","WPLNfLVcNcS0WPahW7LjW73cHG","W5OfuCozAW","WP81W5nSAa","EftdQmkRWR0","WQRdUmomW68Y","W5ebf8oPoq","WOxdVwj2sW","W5OKW7rCrq","wCkTWOZdUmkf","utZcNW","iSo7WP3cImkV","WOpdJgHZwG","WRZdRConW7zC","WQ7cR357W4O","WOqGuwe","fKn5W7eMzv3dKq","mu9GWQddTG","BNfX","W7/dQc8OWPS","WRzvWQXMW58","fHfkW4Wp","WPpdTshcV8kc","edKNWO/dIW","WOHmWRZdMx8","Dx9SW6KQ","W6GDWQPHzq","ys/dGSkKwq","DrpdImoPda","jmo+WO7cLa","mfL9WQy","frHrWPfe","WPWGCWPL","WQlcTgD3W50","WQNcNNz+WPC","W7RcKwLUW6e","W4ZcHKq","crzs","qYrXW5C1","ySkfWP3dU8kh","W484rba","qSoeW6fjwa","mCoSbSoAja","afaWW6VdMG","kmk0mquT","W7WBW75whG","W5m0W7X9W5K","WOtdM25GvW","W7BcUgnEW6e","W7W+sqZdGW","W4q0ta7dMq","dmoxW4NcT10","WOneW5hdKG","W5rJW48KW5y","WQqSW4BcP8kD","W4NcQmo1gCoR","W4VdUvf4W64","w3pcMCoqnW","W5pdNSona8kM","WRzsW7ZcSXi","WRLKW5WeW7y","W6SwW7SkFq","W71vWRGgwq","W4zpWRqeEW","d1TlWQdcUa","kaBdVmkfvW","W7mAW7X7nG","W60ME8kqdW","W78hWOXAWQC","WODOWOldLXW","irBcH8o/W6q","WPyoqWrD","WRldNIxdGa","CeH+W4OO","W6hcILpdUIC","rMhcH8kQW7e","n8kkfCo/iW","WQX+WOBdSb0","FMOXW4W0","duPDWPxdRa","W6bWW6/cMZK","WR/cSCkPWQGi","WObvWONdUei","imo4EJS","W6b/W7xcQba","W7BcKe1AW6e","W7vwW6ZcTqy","WPWGyWPO","WOy/W4OyW7O","W7DHW5bqna","WPldL2n1aa","DamNwCkN","Emo7WQ9cuG","W55lWQlcHhO","WPSXr0Gk","W5NcIL12va","A1KOWQhcQq","k0fkhCoGtw0TWPtdRMZcOW","rWebWQZdNW","W5SzWQ7cQmo4","W7/cNuT6W6e","WO9vWR/dK1G","WOLwWR4BeCkGWQvxWRFcI8olBW","pHCPW6i","W71rWP14WOa","W4ruW4NcU0u","WP7cNN7dKaq","tfOTWQNdVq","rZVcR8kyW64","BNzaW5iY","fmo3W7xcMJO","WOVdPeresG","W4NdVfbYW7q","zmo9WR56","W6BdVmobW7bC","WPepW69psG","WQ/dQCkEWOqc","WQbhW5ZdPYi","WRK4sem7","WQyWu3WB","W5a9qmoecG","W5vnW5xcUI0","WRdcN3ddLeu","WQqFz2G2","W59uWQNdRdC","WO3dH8oilxS","W4zrW4RcIq","lri+W6Ln","d8orWR/dLmkQ","tfrRW5e4","jSk8c1Cf","WPxdJIhdP1O","WORcNwJcL1G","W5WeW6Pc","WPddI356","faTIW5lcVG","nCoGW5RdLmkA","WQ18W6lcHdi","emknxSoYoG","WRe3utTm","WP3cOIBdTr8","W6v7W7JcRXy","CSoNWR3cH8kO","W4y+vq","ASkIjIqd","ymkMb2yP","nf13WQhdKa","r8kKWQRdIG","WRFcQf3dIa","j1rKWQddTG","ycxdN8kFtW","W6VcKvH3W7q","WR/cKNjH","i1LXWOddLa","BMPTW48Z","gHy4W7S0","bmoqW7NcJ2W","CCkvu8oVW6m","W7ZcJfH0W6C","W7qxAmoWDG","WOxcJaO0aG","WRKnWRDpW70","W6tdPmoqW65M","nmoaW5dcT1O","WOZdGSoDmJK","tXyeWRddIq","W4WMW7FcUdi","W6OByrhdOG","WQ3dJhNdH8o3","j8oKFtTg","WOVcHmovjCkQ","W7GqWRLBW7S","W6NcHKDVW7O","W4VdGLPnWQG","WQDQWOldQ2e","WONdOWhcICkM","W6ymWPvDW4i","bCosWQ7cN3G","W6mnWOjA","uu/cJ8oeyG","W7imWOHm","W6r/W6a","WPeMvKWm","CCoUcmokoa","W4pcOmoUWRfW","WQWXWRBcVbW","deThWPhcOa","jmoLgSoxjW","W5fvWPTwW74","WOZcTCkSWRCQ","BvrRW7lcVa","W6pdPSopW69D","n11vbG","WPpcVa42hG","W6KxWPNcRSoz","B8oRWQvUvG","WOWoCbO","aL5DWOtcMq","W7RcM0X+","W6BdP8ovW5PL","WOWZjZjd","dmoSW4JcH1q","nCoBBcep","p8kJBJys","Af7dICkGWRa","e8oTW64","WR3dLttdH8kb","W5a6WO4FBq","W4y1tqtdUW","crzlW5vy","yKJdTCkGWRO","WP9+W6tdUuu","WPFdOZddR8ox","mmo4WOy","WOdcT8k4","W6npWO0","WQxdIGRcOCo1","W7OpWP7dRSoz","e8oqiCo4cW","WQ/dVmoTm3y","WPZdG8oinN0","FgNcHCoScG","W79WW74","W7G7W45LAG","W5FcNSocb8oQ","vZ94WPuW","WOKWW45evW","W6JdSCotW7f+","W6/dGbFdS8oD","W4JdTwb/W78","vbziWPuE","W5BcJe50Fq","W5SAWOlcGMenWROhW4K1WRCF","WOS0zcj6","W5WDw8opaW","W5iZW6Dcuq","W6nRW7dcUvy","W7OfW7zhoa","DSofWPbrqq","W5HcWOGLiG","sK7cR8ovma","yLRdH8k3","AvBcHmodcq","WOD4WPRdTw4","uHuaWRhdHq","dKXXWPpcVW","D8oaW4FcJmoP","m8oSzt8","BHHuW48Z","W43cVuSOW6C","W6zXW6RcQt8","W5CgW7vgxG","W7zGW6Dbia","W5bKWRO","AbVdNSk9W6K","W64zWPRcPa","W6vRW7DhlG","W60sW7fdoa","fhXbWOZcVa","lmoZWO0","uXSa","qb5YW6KV","A1nKWQFdGq","WOZcRrSRba","W4NcRCocb8o6","r8kBlrWK","W5BcUSkTW6L8","kvThW60z","qLaYWQ4","uuS+WOhdRa","esCPW6H6","eHPvW55f","W61QW6Xjea","BNzlW4K2","l1LR","W5f+WRWbyq","Af7dJmkZWRW","WQ/cV0pdHHK","WR7dG2ddImkm","W442AcddIa","W6z8WQngkq","tSoRW63cHYW","WRxcUwFdM3u","WPVcIevlW7S","WRC2W7T3n187zG","W7z9W6zwbq","rqihWRBdJW","WRlcKsa1ba","W5/cU1i","mw5HWOVdVa","END5W58","tJrOW5af","WO3cSmkUWQmn","WPNcUhL8W4a","WPaXyrn4","W5JcPYmMaCoSW7y","W4aLvHNdNG","kmktg8oVpa","W6KvWRH7W6e","tuKUBSkX","ycxdN8kIwq","eCoYWPNcMmk5","eSoitHOO","W7C+W7zciG","WOLyW5hdLYu","W5eaW75A","jCoYWPZcJSk0","WOa9aMql","tHSz","EW04W5qh","WQJcOG4VaW","W5eCr1ZdNW","mSoIBsO","W7apWOLgW7O","Cf15W7FdPq","WPdcGKhdJ1O","n1LX","WPBdN2D3Fa","W4WrW7rhsG","CJpdJSkIzW","gWaJW6bS","d8ozW5dcGSkl","W57dUe1YW7q","W5DxW5ZcRaC","dvmWW6pcNG","F0/dMmk7WQC","xfCPWQ/dQq","WRBcOCo/WQy8","WPNdSdCywG","WPBdQIRdO8oE","W4iIgN9i","W4ypcSkmCG","wtBcNmkSW4e","W6vQWRNcUXq","eXHxW5Hn","W57dUf5VW68","xruJWRVcSq","W6v2W5PJjq","W6aoWQ5oW5K","stCbWRJdMG","WRJcRxzSW5O","yCk9mwPxyINdIh7cL8oGWOLS","WPSQCqy","xmk/hfih","W7VdGIxdL8kz","W7mnWOvgW6W","W4FcGSocaCoC","W7SsW6Tf","aSoTW7JcMW","FhjQW4mU","pxDSWOyY","gCo+FGaC","W6pdI2VdPJZdQvRcTW","W5OoWPddTCoM","WOlcT2f5W4m","WOpdKMr3qa","tx06WRpdUW","W7pcGgyHW7O","W6tdH1jxW4m","WOZcOqWDaa","WO0Hr0Gm","W75fxCoXnW","WQxdNSoZW41r","WRZcLgxcGHS","WPpcQaxdG0W","sSkrk2Tq","tf1TWQm","WR5lW4ddTCkBhvmIemorshu","cCoPgmoPjW","W6XQW6zLmG","WOTAW4tdMJG","CsFcQSo+W6S","y8oMWQrN","WQOKEWDK","ECoIW7Hpqq","WPtdVf4WW6a","W5OBwCopoq","k1rIW7VcSq","BSoHWP9Xsq","nCoJAJWc","vNlcSSomiq","W7SuWRtcUmoF","rZPZW5a2","WPRcKCkR","cvjEWO7cVG","tYhcNCkHAG","i8oAa8o5ia","W69NW6b7lq","WQ5PW6lcHJu","W5abW6m","W73cKuTPW6W","bfPyWOJcRW","WPhcNZhdP8kS","WP3dLSoxlq","AZ0+hSk3","ELhdHCkDWRa","WOCHugaq","W4ZdRLn+","W5dcHb5WgW","W4VcVwv3W6a","uXGUF8kF","W6RdUCoqW656","qIj3W4TK","fmo1EYa1","uSk9fgGX","W7exW7bjcW","tXalWPtdNG","W4OrW64bqa","p8oifmoDiq","mXfeW4ib","fbvpW5ru","eLPiWPpcQq","WOioW48aW70","DsNdHCk3fG","WP0ADGXV","WP0AD04m","y1/dJ8ktWR0","W4vCWOxcMta","ECk7WOVdSCkr","wWSNW7LR","WOpdPJ/dTq","W6tcRYy3W50","WQ/dHXaUWQddGSouyItcSCoBca","W4xcTCotbSo9","W5BcImoQb8oU","WOBdTI3dQCks","W6aAWOpcTCod","WQlcJMldIG","AdddMSkIsW","WOVcTSkSWR4Q","W5SJeYyD","erW2W6nT","WPBdUZZdQa","c8kUW57cPSki","ySoxwwa2","WOddT8kLWQiH","W7FcLuv+","WPWGDHfY","WRBdIL18sG","WOzeWQZdO0e","z0PRW7FdQa","W7ucWOHkW60","WOldL2n2","z8oJWQvSuG","WQhdKKiHAq","ymkyrSo+W5O","WOOQzW","rbenWRRdJG","gGuRW6K","qbPYW4Cc","WR7dGGpdHCkA","vmk9nuCf","W6j2W6VcSGi","WOSXDbD+","h8oEgmogjG","W7hdVCopW6XS","W6dcSSoXaSon","y8krqSoeW7C","W5/dQvLPW78","a01lWOdcUa","WRZdIbtdTmkD","WOVdTh5hfG","q2L4W5xdKq","WQ/cVgfXW4W","W6fLWRmbCq","WOdcVCk3WQu","Bee7q8k1","FNfXW4G4","DmkRrGHu","W4Wawmojla","W4dcRf1IW64","WQZdI8oOdvG","wHabWPBcQq","WQ/cQgddVfq","eePDWOK","wIhcNmk2W60","W6NdSCooW6vR","WRFcRqHXba","W4akWP56W6O","W4yIFrVdNG","WRxcNMxdSaK","rKazWOFcNG","W4fpWQ/cKc0","W6OaW7PwaG","WPBdKCoxFhi","FfRdMmkHWQW","taSkW6H1A8kZ","fqGZW6LS","W67cPSoxW7zk","lIWNWPDQW4xdJ2ldMMNdRG","WOndWQRdMa","W5OWwW","W4DeW5VdGNW","WRHmWQhdMeu","W40kW7q","W743ECo5bq","W5WEWPpdOCod","WQNcPKpdMwO","hZW+WR8R","z1zIWRxdNW","cvzkWOJcQG","WPVcLwFdGWq","BSo7WQv3wq","CCkoWO3dVCkj","hWeO","kCosBtyq","t0KF","W5CQDbz/","WOlcPdhdG8oc","neL2WRO","W68BWQD6W44","xchcKCk/W50","Axy/W4SO","B3TVW4O8","hGSVW6i","WRxcIWa1hW","WOJdVH7dOCoD","W7OkWOv2W6m","vrOkWQy","lZSDW5ro","WO/cRCoGWP86","kmoplSoUia","W7ndWOLpWQG","WOaJW5OuW6S","dXCbWRhdJW","W4RdGw5SW6m","cCoJW6/cLG","WR3cQ8k9WOG9","ALFdHCk9WRS","WRJdMchdLSkQ","zmk3efu","WRVcLNJdLHS","W4xcM8oagmkM","mSoiaCoVAq","xdBcQCk6W50","eSo2WRZcMhG","kdBcMSo/wq","i8o4Esmj","xHFcISkKW6W","W5qYW7zlcW","W4JcJ8onfmoR","W5DmWQGhxq","WQvyW6tcHwm","W5xdLtxdHSow","WO/dISojiwC","W44JtqtdRW","lmoZWO3cRmkO","nCkYD8obW7e","W6NdPevVW48","W4K9vWZdNG","W7xdJmocW6uS","WP3dKSkCjNe","AuJdNSkxWRS","xSk5huyZ","B8o+na","WOvjWQRdVv4","WQLmWQDDW6G","W6j0W5/cHse","qHuwWObL","W4ldNCkrmSoj","CSkXpeGx","sIFcGmoGW40","vmojWO9Qrq","j8oYW5BcH0a","rLaS","W64HWQdcOSoL","lSonWOG0sW","EYpcPSkEW74","AIldVCkidq","dH4hWRtdHa","ESk+WQZdL8kL","W4dcQu8VhG","WQZcShfH","xedcJ8oefW","WOVcQSk7WQGa","WO3cTmkMWRqG","f1LoWR7dGW","xgaYWQq","WRFdMspdU8kc","CNP6W6CP","zmkFWOVdT8kp","W4VdUt9EAq","WPlcGrWSgq","WRtcIx7dJYO","WOu0WOKxWQC","W6jbW4vVea","WOWgcSo0ea","W7FcGavpW6W","WRdcGexdHMy","zSoPWR1IAa","A1ldJmkR","WRBcRvxdRfq","WQFdHsRdLmoF","WPPdW6FdMMe","q8ovw8o6W78","W5f+WPGhzG","WO3cT8kRWRq","W6eiWQNcS8oy","WPf7WQ1hya","shiNW5rP","w0S6WRtdQW","bCogWRlcRmk2","WQRcVvhdG1q","W6jrW7nrja","W6JdGCo1W4TB","AxT7WOH9","WO5XW50mW6S","przmW51s","W5SLqX3dMa","n8orW7lcKxW","E2XWW4SF","W7mrWQviW7S","WObCWOddTxO","W6KnW4BcPSob","WRJdVHKyuG","WOC9DMyv","W4FcHCohfG","W546W7zBrG","WQlcT3a","cmoHW73cINa","xSkZW4dcRCkM","BKTzW44U","WP/cRmk7WROw","uuxcMCoGnG","BCkAWRddICkf","W5CrW7jEvW","w3ldVSk1WR8","zgTXWOGZ","WPaWqwyA","e3beWPlcTa","WOvoW5hdTYu","W7fRW7nijW","WPlcQqeMba","W5SJW7Guca","tdVcT8k7W4y","oJviW4jL","WP03yrO","eGWpWRRcMW","s1C6WRldNq","Av3dMmk3WRO","W7xcUGHRW4W","Ev8HqSoS","WQldHs7cISkh","W5LrWQrCW7K","WQ7dGdddI8kB","W63cGfHOWQ8","W4WNWO5AW74","W6pcGNNdRd8","WRBdLtpdL8ki"];return WA=function WA1(){return e},WA()}function $lt(e,t){var r={_0x29805a:702,_0x2ac9db:"U*q1",_0x201b4f:710,_0x10f302:237,_0x58fc3d:"XmPh",_0x158e9b:2410,_0x4b6bb1:2107,_0x1c48c4:1055,_0x327b8a:"*LQ]",_0x344f84:1040,_0x3966a8:306,_0x1d6e9f:163,_0x3066ac:"G13@",_0x351e57:1095,_0x11f3cc:675,_0x6a412e:621,_0x2ac121:220,_0x37ce54:409,_0x4586d7:1111,_0x5324ca:"!qKa",_0x32eb48:207,_0x18288b:673,_0x1bae7d:"Mu^3",_0x24078c:1222,_0x5a83a1:"CSrr",_0x2dd2df:634,_0x12d0d0:779,_0x2736ad:92,_0x517f8e:234,_0xc83907:667,_0x325c4b:994,_0x38c9a4:616,_0x541c03:992,_0x17f92e:"PS7$",_0x431888:982,_0x34eb22:501,_0x19e3d7:"H9LI",_0x255301:38,_0x24feeb:62,_0x58102a:977,_0x1f64e9:1358,_0x71d84d:4,_0x137eac:155,_0x88c11:")mU*"},n={_0x1eb16f:183},i={_0x514dcf:215};return ru(this,null,function(){var o,s,c,u,m,h;function a(x,v,y,_,b){return st(y-885,x)}function l(x,v,y,_,b){return st(x- -315,v)}function d(x,v,y,_,b){return st(v-i._0x514dcf,b)}function p(x,v,y,_,b){return st(y- -o._0x1298a1,b)}function g(x,v,y,_,b){return st(x-n._0x1eb16f,b)}return _ts_generator(this,function(_state){switch(_state.label){case 0:o={_0x1298a1:660};s=new TextEncoder;e=e[l(r._0x29805a,r._0x2ac9db,619,r._0x201b4f,r._0x10f302)+"ce"](Mlt,""),e=e[a("Ofr8",1595,1185,1610,1460)+"ce"](Olt,""),e=e[a(r._0x58fc3d,r._0x158e9b,r._0x4b6bb1,2333,2638)+"ce"](/\n/g,"");c={};c[g(1247,1390,1210,r._0x1c48c4,r._0x327b8a)]=d(r._0x344f84,776,r._0x3966a8,331,"*LQ]")+p(954,820,525,r._0x1d6e9f,r._0x3066ac),c[g(r._0x351e57,r._0x11f3cc,1038,r._0x6a412e,"XmPh")]=p(-r._0x2ac121,-84,-r._0x37ce54,-374,"Pcer")+"56";u={};u[g(1005,1523,r._0x4586d7,776,r._0x5324ca)]=p(-487,-95,-r._0x32eb48,-r._0x18288b,r._0x1bae7d)+d(1212,816,r._0x24078c,958,r._0x5a83a1);return[4,kv[d(500,r._0x2dd2df,r._0x12d0d0,948,"EgFM")+l(223,"EgFM",-147,-r._0x2736ad,r._0x517f8e)](d(r._0xc83907,r._0x325c4b,r._0x38c9a4,r._0x541c03,r._0x17f92e),(0,Rlt[d(896,r._0x431888,557,r._0x34eb22,"Zjkg")+l(-74,r._0x19e3d7,r._0x255301,186,r._0x24feeb)+"y"])(e),c,!1,[d(505,r._0x58102a,1485,r._0x1f64e9,r._0x1bae7d)+"pt"])];case 1:m=_state.sent(),h=u;return[2,kv[l(r._0x71d84d,"HKLe",294,-363,-419)+"pt"](h,m,s[p(74,75,r._0x137eac,3,r._0x88c11)+"e"](t))]}})})}function WU(e){var t={_0x3a783c:"$L(L",_0x381214:698,_0x1f92fc:1047,_0x536572:1295,_0x566f86:1785,_0x26581e:952,_0xe69c58:546,_0x140814:848,_0xfee3aa:659,_0x1c5f98:697,_0x599eff:456,_0x4a358a:213,_0x43abfb:1409,_0x55fef3:1142,_0x46ba2d:"0%4x",_0x1835e9:867,_0x2d59c3:855,_0x165268:1217,_0x22e5ce:"pTZ^",_0x5e6280:485,_0x45d03b:76,_0x2e0504:576,_0x3bbc1b:1336,_0x374ef9:1370,_0x3ef9a2:"8F&P",_0x28f14d:920,_0x3c075d:571,_0x198605:1566,_0x2bdff9:2027,_0x5217b6:1765,_0x5d975d:1076,_0x59ab69:1011,_0xbd9a13:896,_0x2d686e:170,_0x408a18:662,_0x570c3b:897,_0x47fc7b:"8x(^",_0x3a5b82:1311,_0x586060:632,_0x29c445:461,_0x32d36a:730,_0x2709d6:1050,_0x7c0fbe:1292,_0x2f0e16:1467,_0x4031e4:"$L(L",_0x498cbd:838,_0x41457a:854,_0x370ab0:639,_0x1c9743:453,_0x411f42:1326,_0x507b68:1016,_0x43f93b:1135,_0x46a811:1327,_0x4979c7:"q4^g",_0x152b73:1339,_0x532f0f:"H9LI",_0x112f69:349,_0x1f5f0f:637,_0x5e6be8:"Ofr8",_0x393877:393,_0x41d4c6:"Pcer",_0x50b3f4:"$L(L",_0x317fcc:308,_0x37d140:587,_0x38bc9e:921},r={_0x2a4990:143};return ru(this,arguments,function(param){var n,i,d,u,p,m,h;function o(u,p,m,h,g){return st(g- -i._0x2a69c0,u)}function a(u,p,m,h,g){return st(g-408,h)}function s(u,p,m,h,g){return st(p-445,u)}function l(u,p,m,h,g){return st(m-r._0x2a4990,p)}function c(u,p,m,h,g){return st(m-340,u)}return _ts_generator(this,function(_state){switch(_state.label){case 0:n=param.app;i={_0x2a69c0:870};if(!(s(t._0x3a783c,t._0x381214,262,167,t._0x1f92fc)!==s("78]e",1631,1974,1204,2034)))return[3,1];d={};return[2,(d[s("CSrr",t._0x536572,t._0x566f86,t._0x26581e,1678)+c("G13@",140,t._0xe69c58,t._0x140814,569)+"pe"]=o("78]e",t._0xfee3aa,t._0x1c5f98,t._0x599eff,t._0x4a358a)+a(826,t._0x43abfb,t._0x55fef3,"PS7$",919)+c(t._0x46ba2d,t._0x1835e9,t._0x2d59c3,587,t._0x165268)+"n",this[o(t._0x22e5ce,-t._0x5e6280,-881,-t._0x45d03b,-t._0x2e0504)+"er"](""+this[l(t._0x3bbc1b,"uHEn",t._0x374ef9,1795,1668)+"rl"]+_0x27615d,{method:a(1358,537,1320,t._0x3ef9a2,t._0x28f14d),headers:d,body:_0x155b52[l(t._0x3c075d,"7*o4",526,743,315)+s("CSrr",t._0x198605,2027,t._0x2bdff9,t._0x5217b6)](_0x2d4696)}))];case 1:return[4,c1e()];case 2:u=_state.sent()[s("z(fp",t._0x5d975d,t._0x59ab69,799,t._0xbd9a13)+a(t._0x2d686e,1183,1093,"m6ks",t._0x408a18)+a(1731,t._0x570c3b,810,t._0x47fc7b,t._0x3a5b82)+"ey"],p={timestamp:Math[s("Um*0",t._0x586060,t._0x29c445,t._0x32d36a,691)](Date[a(t._0x2709d6,t._0x7c0fbe,t._0x2f0e16,t._0x4031e4,1102)]()/1e3),ticket:Slt(),app:n};return[4,$lt(u,JSON[l(t._0x498cbd,"%qo8",t._0x41457a,t._0x370ab0,t._0x1c9743)+c("$Bws",t._0x411f42,t._0x507b68,1188,t._0x43f93b)](p))];case 3:m=_state.sent(),h=(0,xlt[a(t._0x46a811,t._0x5d975d,948,t._0x4979c7,t._0x152b73)+o(t._0x532f0f,-432,-t._0x112f69,-654,-t._0x1f5f0f)+o(t._0x5e6be8,t._0x393877,265,696,349)])(new Uint8Array(m));return[2,klt+"/"+n+(l(860,t._0x41d4c6,791,289,750)+c(t._0x50b3f4,t._0x317fcc,713,t._0x37d140,t._0x38bc9e))+encodeURIComponent(h)];case 4:return[2]}})})}function Xe(e,t,r,n,i){var o={_0x2673e8:339};return st(r-o._0x2673e8,e)}var Nlt=VA(GA());function Dlt(e){var t={_0x3a268e:88,_0x2993d6:69,_0x41f13d:"8x(^",_0x321e32:138,_0x53c29a:499,_0x22c606:301,_0x19970a:444,_0x1c5e0a:371,_0x5a3b2a:130},r={_0x381f05:133,_0x3c489f:241},n={_0x311118:427,_0x5330db:430},i={_0x38990c:306,_0x296fa1:271,_0x4497d9:284};function o(c,d,u,p,m){return $e(c-i._0x38990c,d-i._0x296fa1,u-i._0x4497d9,u,d- -313)}function a(c,d,u,p,m){return qe(c-348,d-n._0x311118,c- -n._0x5330db,p-208,u)}function s(c,d,u,p,m){return Xe(c,d-r._0x381f05,p- -1155,p-295,m-r._0x3c489f)}var l=4-e[s("G13@",-94,-t._0x3a268e,46,-t._0x2993d6)+"h"]%4;if(l<4)for(var c=0;c<l;c++)e+="=";return e[s(t._0x41f13d,t._0x321e32,t._0x53c29a,t._0x22c606,535)+"ce"](/-/g,"+")[s("!qKa",-t._0x19970a,-t._0x1c5e0a,-279,t._0x5a3b2a)+"ce"](/_/g,"/")}function Llt(e,t){var r={_0x1f402f:"z(fp",_0xff9a01:1987,_0x3b74d5:1509,_0x3ec228:831,_0x2e6053:1302,_0x494464:1290,_0x33c14d:814,_0x27ba67:"$L(L",_0x1744c6:1220,_0x33084c:917,_0x10995b:1843,_0x4f18f2:1517,_0x34356d:2031,_0x31f569:1442,_0x595205:1728,_0x3d9a80:1459,_0x1e524a:1648,_0x24d3c1:587,_0x7a63a2:"IQMa",_0x34f294:585,_0xa3b86c:"!qKa",_0x44d648:1330,_0x1ab844:914,_0x3ddba5:"IQMa",_0x3d53cd:1193,_0x4569f3:1043,_0x446595:"q4^g",_0xbb8d39:1002,_0x512e43:1115,_0x54dc90:833,_0x27ef09:1235,_0x422597:533,_0x514dd3:776,_0x5a43c1:"EgFM",_0x23f2b8:1675,_0xe4178f:1840,_0x458605:"*LQ]",_0x4a1723:913,_0x310973:1061,_0x4a3111:1202,_0x4263c4:"7*o4",_0x6720ab:2007,_0xceae30:2280,_0x19cc4e:1396,_0x4d4466:"*LQ]",_0x1cd887:"yAeH",_0x3420c3:421,_0x540327:566,_0x120450:486,_0x4d08b8:1025,_0x5611b8:"CSrr",_0x3f9691:1120,_0x37c15b:934,_0x1492df:824,_0x1791f6:559,_0x15cf5a:892,_0x9812b:"$L(L",_0x6aaca9:1247,_0x30d0a3:1734,_0x3f867d:937,_0x2c520d:553,_0x2f4d3b:430,_0x19de53:690,_0x31e3af:1372,_0x415b2c:1203,_0x280bba:1631,_0xed1b37:1216,_0x174b2a:377,_0xf95c79:346,_0x2675c9:179,_0x2b7823:353,_0x4a862a:720,_0x285b05:1123,_0x187815:1261,_0x2a3a6e:1047,_0x59ab43:1151,_0x59f924:266,_0x210644:"8x(^",_0x2ba0aa:183,_0x38f41a:105,_0x3310fb:1471,_0x4b3961:"%qo8",_0x24dfae:1846,_0x2f8f11:1709,_0x1e2778:"XSQ8",_0x20f12e:1183,_0x2c4206:1668,_0x2e2033:915,_0x23aad4:714,_0x1f8fb2:111,_0x21f127:88,_0x132661:384,_0x30bf86:696,_0x4f261c:1810,_0xd59cee:1459,_0x14d3f5:1169,_0x379cbf:1291,_0x58d2d9:702,_0x304838:252,_0x745de1:"Ofr8",_0x1efd6d:363,_0x21bc34:13,_0x59ca44:"HKLe",_0x5e9fe6:451,_0x255952:"uHEn",_0x2572d8:1167,_0x76d419:698,_0x14b9ea:1165,_0x86a925:"z(fp",_0x327243:657,_0x3a73fb:1526,_0x2fb42f:1493,_0x3cf36d:"esI("};return ru(this,null,function(){var n,i,d,u,p,h,g,m,h10,g10,x,v,y;function o(h,g,x,v,y){return st(h-201,y)}function a(h,g,x,v,y){return st(v- -381,g)}function s(h,g,x,v,y){return st(v-i._0xa13f2,h)}function l(h,g,x,v,y){return st(v-n._0xe061bb,x)}function c(h,g,x,v,y){return st(g-922,x)}return _ts_generator(this,function(_state){switch(_state.label){case 0:n={_0xe061bb:560},i={_0xa13f2:397};if(!(l(1784,1599,r._0x1f402f,1446,1867)===s("(gQD",r._0xff9a01,1585,1598,r._0x3b74d5)))return[3,1];if(_0x1769d0[o(r._0x3ec228,r._0x2e6053,r._0x494464,r._0x33c14d,r._0x27ba67)+l(1104,r._0x1744c6,"$Bws",r._0x33084c,960)]&&!_0x17d70d&&!_0x19812e)return[2,_0x669a7d[c(r._0x10995b,r._0x4f18f2,"gCWj",r._0x34356d,r._0x31f569)+c(r._0x595205,1551,"KBpi",r._0x3d9a80,r._0x1e524a)]()];_0x183485=_0x351680||{};h=(p=(u=_0x325d50[o(r._0x24d3c1,89,752,789,r._0x7a63a2)+"m"])!=null?u:(d=_0x1285ee[o(r._0x34f294,458,103,386,r._0xa3b86c)])==null?void 0:d[l(r._0x44d648,r._0x1ab844,r._0x3ddba5,r._0x3d53cd,r._0x4569f3)](_0x28058c))!=null?p:_0x1551be();if(h[s(r._0x446595,r._0xbb8d39,r._0x512e43,r._0x54dc90,r._0x27ef09)+"h"]<16)throw new _0x1147a7(o(880,r._0x422597,r._0x514dd3,1056,r._0x5a43c1)+c(r._0x23f2b8,1914,"*(#r",1602,r._0xe4178f)+s(r._0x458605,1569,r._0x4a1723,r._0x310973,r._0x4a3111)+s(r._0x4263c4,r._0x6720ab,1692,1475,981)+l(r._0xceae30,r._0x19cc4e,r._0x4d4466,1764,1997)+s(r._0x1cd887,r._0x3420c3,554,r._0x540327,r._0x120450)+a(r._0x4d08b8,r._0x5611b8,r._0x3f9691,712,r._0x37c15b));if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,_0x11321d){if(_0x541020=_0x224512||0,_0x13c518<0||_0x30c340+16>_0x315fe5[o(487,r._0x1492df,r._0x1791f6,r._0x15cf5a,r._0x9812b)+"h"])throw new _0x2b7243(o(r._0x6aaca9,945,r._0x30d0a3,r._0x3f867d,"*LQ]")+a(-20,"HKLe",r._0x2c520d,r._0x2f4d3b,722)+l(r._0x19de53,r._0x31e3af,"H9LI",r._0x415b2c,r._0x280bba)+" "+_0x27022d+":"+(_0xbd6dee+15)+(s("$Bws",1541,r._0xed1b37,1133,1462)+a(-r._0x174b2a,"G13@",-r._0xf95c79,-r._0x2675c9,-r._0x2b7823)+c(r._0x4a862a,1195,"(3#Z",977,r._0x285b05)+o(r._0x187815,r._0x2a3a6e,r._0x59ab43,908,"!qKa")+a(-r._0x59f924,r._0x210644,-317,r._0x2ba0aa,-r._0x38f41a)));for(g=0;g<16;++g)_0x56c46d[_0x37e6dd+g]=h[g];return[2,_0x4a25bd]}return[2,_0x115ea0(h)];case 1:m={};m[c(r._0x3310fb,1549,r._0x4b3961,1043,r._0x24dfae)]=o(1403,r._0x2f8f11,1925,1591,r._0x1e2778)+"CM";h10=new TextEncoder;return[4,kv[l(1463,1178,"gCWj",1217,r._0x20f12e)+c(r._0x2c4206,1504,"esI(",1556,1777)](s("$Bws",1225,r._0x2e2033,r._0x23aad4,337),h10[a(r._0x1f8fb2,"IQMa",-r._0x21f127,r._0x132661,r._0x30bf86)+"e"](e),m,!1,[c(r._0x4f261c,1355,"%wVn",1592,1110)+"pt"])];case 2:g10=_state.sent(),x=(0,Nlt[c(r._0xd59cee,r._0x14d3f5,"Pcer",r._0x379cbf,r._0x58d2d9)+a(-r._0x304838,r._0x745de1,r._0x1efd6d,r._0x21bc34,37)+"y"])(Dlt(t)),v=x[l(945,736,r._0x59ca44,1158,1129)](12),y={name:a(r._0x5e9fe6,r._0x255952,r._0x2572d8,r._0x76d419,r._0x14b9ea)+"CM",iv:x[a(526,r._0x86a925,1171,r._0x327243,475)](0,12)};return[2,kv[o(1024,1419,r._0x3a73fb,r._0x2fb42f,r._0x3cf36d)+"pt"](y,g10,v)];case 3:return[2]}})})}function d1e(e){var t={_0x5690d8:1193,_0x304485:1618},r={_0x161f52:550};return ru(this,arguments,function(param){var n,i,o,a;function s(l,c,d,u,p){return st(p-r._0x161f52,d)}return _ts_generator(this,function(_state){switch(_state.label){case 0:n=param.app,i=param.s;return[4,c1e()];case 1:o=_state.sent()[n];return[4,Llt(o,i)];case 2:a=_state.sent();return[2,new TextDecoder()[s(t._0x5690d8,t._0x304485,"$L(L",1770,1383)+"e"](a)]}})})}var BU=/*#__PURE__*/function(Error1){"use strict";_inherits(BU1,Error1);function BU1(e,t){_class_call_check(this,BU1);var _this;var l=function l(m,h,g,x,v){return Le(m-s._0xba3a15,g,v-227,x-243,v-s._0x28691d)};var c=function c(m,h,g,x,v){return Le(m-a._0x332dc0,x,h-a._0x1cdb1d,x-74,v-277)};var d=function d(m,h,g,x,v){return $e(m-o._0xe4b4df,h-204,g-383,v,g- -o._0x21378a)};var u=function u(m,h,g,x,v){return Xe(m,h-i._0x54fa04,x-650,x-i._0x310541,v-i._0x1f9502)};var p=function p(m,h,g,x,v){return Xe(m,h-n._0x38f3bf,h- -176,x-36,v-n._0x382942)};var r={_0x304028:"pTZ^",_0xdbf482:1582,_0x383c3f:1228,_0x18628e:1991,_0x3799a4:1570,_0x884c7c:1626,_0x58ac0e:"KBpi",_0x8320ab:1723,_0x1efeff:"9PX[",_0x5ec1cd:559,_0xa2a335:"wepR",_0x449400:1633,_0x7a60ab:1040,_0x575cf7:1523,_0x5185d4:1485,_0x1a1235:1316,_0x1ed147:1303,_0x4ec899:"(3#Z",_0x57cb41:1615,_0x57c36b:1274,_0x57f90d:1831,_0x48934c:1591,_0x3e1660:1757,_0x30950f:532,_0x403617:215,_0x11a6bf:"esI(",_0x56811a:1828,_0x2676fc:1317,_0x473bce:1281,_0x22098e:1326,_0x450847:2514,_0x5db898:2041,_0x80dda6:1422,_0x30e020:"!qKa",_0xe1ddda:834,_0x30614f:"IQMa",_0x256abd:1138,_0x3624af:985,_0x47b195:895,_0x1c2f80:413,_0x1b4617:"q4^g",_0x3ca04e:"PS7$",_0x23b72f:1572,_0x588812:1484,_0x5da9de:1595,_0x4b69b6:"Zjkg",_0x1da5ed:804,_0x1ae0bf:562,_0x23c32a:420,_0x4dca82:738,_0xad9f78:1035,_0x4eef98:625,_0x4721d4:158},n={_0x38f3bf:289,_0x382942:88},i={_0x54fa04:367,_0x310541:21,_0x1f9502:419},o={_0xe4b4df:491,_0x21378a:1576},a={_0x332dc0:316,_0x1cdb1d:423},s={_0xba3a15:287,_0x28691d:232};_this=_call_super(this,BU1,[e]);Sv(_this,u(r._0x304028,1969,r._0xdbf482,1532,r._0x383c3f)+"s"),Sv(_this,u("9PX[",2258,1862,r._0x18628e,r._0x3799a4));Sv(_this,l(2209,r._0x884c7c,r._0x58ac0e,1425,r._0x8320ab)+u("nGaz",1491,1691,1244,810)),Sv(_this,p(r._0x1efeff,352,15,r._0x5ec1cd,308)),_this[u(r._0xa2a335,r._0x449400,r._0x7a60ab,r._0x575cf7,r._0x5185d4)]=p("xoTm",r._0x1a1235,1682,1201,r._0x1ed147)+u(r._0x4ec899,r._0x57cb41,r._0x57c36b,1689,2147)+l(r._0x57f90d,r._0x48934c,"Ofr8",1344,r._0x3e1660)+d(r._0x30950f,457,30,r._0x403617,"CSrr")+"or",_this[u(r._0x11a6bf,1582,1994,r._0x56811a,2259)+"s"]=t[l(r._0x2676fc,r._0x473bce,r._0x1efeff,r._0x22098e,1252)+"s"],_this[u("0u@s",1828,r._0x450847,r._0x5db898,1832)]=t[c(1574,r._0x80dda6,1832,r._0x30e020,915)],_this[l(r._0xe1ddda,976,r._0x30614f,r._0x256abd,r._0x3624af)+d(-r._0x47b195,-r._0x1c2f80,-769,-1260,r._0x1b4617)]=t[u(r._0x3ca04e,r._0x23b72f,r._0x588812,r._0x5da9de,1363)+p(r._0x4b69b6,r._0x1da5ed,r._0x1ae0bf,427,r._0x23c32a)],_this[d(-r._0x4dca82,-r._0xad9f78,-r._0x4eef98,-394,"wepR")]=t[d(220,r._0x4721d4,-253,121,r._0x30614f)];return _this}return BU1}(_wrap_native_super(Error));function Flt(e){var t={_0x2f7cee:994,_0xca498e:"$Bws",_0x59ed4d:574},r={_0x351d30:274,_0x3a67c8:754};function n(i,o,a,s,l){return ut(s,o-3,a-r._0x351d30,s-378,l- -r._0x3a67c8)}return e[n(t._0x2f7cee,360,978,t._0xca498e,t._0x59ed4d)+"ce"](/\/+$/,"")}function l1e(e){var t={_0x566905:162,_0xa5dd:145,_0xe88a07:"Pcer",_0x44a18f:54,_0x18a5f3:899,_0x3744a4:"Pcer",_0x3088d2:447,_0xf548e:1186,_0x5460e4:1333,_0x18b353:601,_0x20e220:1103,_0x18a2f6:754,_0x401b2c:1597,_0x596373:70,_0x186e6b:264,_0x56dace:708,_0x547974:"wepR",_0x4948ce:311,_0x843366:34,_0x2264c6:326,_0x3404d5:54,_0x472ff1:"uHEn",_0x13877b:"Pcer",_0x4157a2:81,_0x1cd0f6:326,_0x25c986:766,_0x258a8f:1459,_0x40c48e:449,_0x1c1970:929,_0x4dca42:"%qo8",_0x12e120:1036,_0x56f89a:1034,_0x5f04a0:576,_0x32c83e:1015,_0x20be0b:202,_0x382133:179,_0x4cbf2c:530,_0x55f197:"*LQ]",_0x4f975f:885,_0x230fdf:692,_0x5bd367:162,_0x4336d7:176,_0x281849:118,_0x259e18:297,_0x300e7c:560,_0x17157e:757,_0x30b065:905,_0x148be3:"(gQD",_0x5907cb:1155,_0x46d704:657},r={_0x1c9de1:64};return ru(this,null,function(){var n,_,c,d,u,p,m,h,g,x,v,y;function i(_,b,w,S,k){return st(w- -n._0xf73a12,k)}function o(_,b,w,S,k){return st(b- -727,k)}function a(_,b,w,S,k){return st(b-483,w)}function s(_,b,w,S,k){return st(S- -569,_)}function l(_,b,w,S,k){return st(k- -r._0x1c9de1,_)}return _ts_generator(this,function(_state){switch(_state.label){case 0:n={_0xf73a12:96};if(!(o(t._0x566905,-368,-171,-t._0xa5dd,t._0xe88a07)===o(-5,t._0x44a18f,147,-24,"%qo8")))return[3,2];return[4,e[a(549,t._0x18a5f3,t._0x3744a4,1367,t._0x3088d2)]()];case 1:_=_state.sent();try{if(a(834,t._0xf548e,"%wVn",t._0x5460e4,793)!==o(760,360,t._0x18b353,-160,"CSrr"))return[2,JSON[l("gCWj",t._0x20e220,t._0x18a2f6,t._0x401b2c,1151)](_)];for(d=_0x339fa3[i(-87,364,t._0x596373,t._0x186e6b,"HKLe")+"h"],u=d%3,p=[],m=16383,h=0,g=d-u;h<g;h+=m)p[a(602,t._0x56dace,t._0x547974,t._0x4948ce,1196)](_0x53ebec(_0x570d0f,h,h+m>g?g:h+m));return[2,(u===1?(c=_0x12fe1e[d-1],p[o(-t._0x843366,-t._0x2264c6,-338,-t._0x3404d5,t._0x472ff1)](_0x415304[c>>2]+_0x4f96fc[c<<4&63]+"==")):u===2&&(c=(_0x1b888e[d-2]<<8)+_0x392b5c[d-1],p[s(t._0x13877b,t._0x4157a2,361,t._0x1cd0f6,480)](_0xa5d07d[c>>10]+_0x3f4f27[c>>4&63]+_0x46bce8[c<<2&63]+"=")),p[a(827,t._0x25c986,"pTZ^",1242,940)](""))]}catch(b){throw new BU(l("gCWj",t._0x258a8f,819,t._0x40c48e,t._0x1c1970)+l(t._0x4dca42,460,t._0x12e120,t._0x56f89a,t._0x5f04a0)+a(667,t._0x32c83e,"Pcer",978,t._0x56f89a)+s("G13@",-334,-t._0x20be0b,t._0x382133,t._0x4cbf2c)+l(t._0x55f197,376,t._0x4f975f,1032,666)+o(-t._0x230fdf,-t._0x5bd367,-t._0x4336d7,-t._0x281849,"nGaz")+i(t._0x259e18,117,144,564,"EgFM")+l("Zjkg",-337,t._0x300e7c,263,130)+"s "+e[i(t._0x17157e,t._0x30b065,565,830,"CSrr")+"s"],{status:e[l(t._0x148be3,587,162,t._0x5907cb,t._0x46d704)+"s"],body:_})}return[3,3];case 2:x={_0x4ee36d:177,_0x6139c5:150,_0xd00abf:35,_0x4df002:97,_0x1a3994:1076,_0x1c9e61:1185,_0x54b023:909,_0xb4a74d:40,_0x12de84:328,_0x1b0b19:315,_0x5883c8:20,_0x53aa2a:"ITq[",_0x25bf8c:39,_0x548dd8:"$Bws",_0x57fec1:438,_0xbb822:198,_0x2b1e9d:354,_0x411f8e:97,_0x59c922:225,_0x208d1b:454,_0x3ab1b6:507,_0x221b41:141,_0xf9c0d8:63,_0x384530:489},v={_0x382d15:317},y={_0x2f8c22:413,_0x15e7f1:364,_0xaf0949:564};return[2,_0x32a22d(this,null,function(){var _,b,w,S;function k(O,M,R,$,z){return l(M,M-y._0x2f8c22,R-y._0x15e7f1,$-472,R-y._0xaf0949)}function E(O,M,R,$,z){return l(R,M-416,R-232,$-w._0x28cb9b,$- -814)}function C(O,M,R,$,z){return i(O-v._0x382d15,M-187,M-677,$-35,O)}function T(O,M,R,$,z){return l(M,M-b._0x38a736,R-244,$-82,O- -b._0xf1c9c4)}function I(O,M,R,$,z){return a(O-_._0x1a595b,M- -_._0x489662,z,$-_._0x43704b,z-_._0x3d649b)}return _ts_generator(this,function(_state){_={_0x1a595b:9,_0x489662:1318,_0x43704b:472,_0x3d649b:397},b={_0x38a736:20,_0xf1c9c4:556},w={_0x28cb9b:421},S={};S[T(x._0x4ee36d,"z(fp",-x._0x6139c5,-x._0xd00abf,-x._0x4df002)+C("$Bws",x._0x1a3994,x._0x1c9e61,1294,x._0x54b023)+T(x._0xb4a74d,"Pcer",x._0x12de84,x._0x1b0b19,252)]=_0x4d5784[I(-x._0x5883c8,201,658,397,x._0x53aa2a)+T(x._0x25bf8c,x._0x548dd8,235,294,x._0x57fec1)+"en"];return[2,this[I(x._0xbb822,x._0x2b1e9d,493,-x._0x411f8e,x._0x548dd8)+T(-216,"$Bws",-x._0x59c922,-x._0x208d1b,-744)](T(-357,"XSQ8",-x._0x3ab1b6,-792,-349)+I(-677,-232,-218,-343,"Zjkg")+I(-x._0x221b41,-x._0xf9c0d8,-529,-x._0x384530,"srHh")+"h",S)]})})];case 3:return[2]}})})}var p1e=/*#__PURE__*/function(){"use strict";function p1e1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,p1e1);var s=function s(h,g,x,v,y){return $e(h-439,g-14,x-a._0x5ed5b4,y,h-a._0xe408c2)};var l=function l(h,g,x,v,y){return Le(h-345,v,x- -215,v-190,y-o._0x5bbc16)};var c=function c(h,g,x,v,y){return Xe(h,g-i._0x41a152,g-310,v-360,y-30)};var p=function p(h,g,x,v,y){return qe(h-n._0x41551a,g-113,g-n._0x446fdc,v-n._0x4be2ea,x)};var m=function m(h,g,x,v,y){return Le(h-185,y,g- -r._0x4c659c,v-r._0x26cbbc,y-364)};var t={_0x4a142f:244,_0x46fd9d:118,_0x3a9258:510,_0xa34012:252,_0x17ae3b:"U*q1",_0x597e4f:2295,_0x46e733:985,_0x597df5:615,_0x29530a:1196,_0x4ceede:427,_0x46b189:405,_0x13631c:85,_0x29e111:"8F&P"},r={_0x4c659c:1175,_0x26cbbc:219},n={_0x41551a:18,_0x446fdc:773,_0x4be2ea:52},i={_0x41a152:87},o={_0x5bbc16:488},a={_0x5ed5b4:223,_0xe408c2:63};Sv(this,m(632,460,311,612,"Um*0")+"rl");Sv(this,m(t._0x4a142f,-t._0x46fd9d,-t._0x3a9258,t._0xa34012,t._0x17ae3b)+"er");var d,u;this[s(1868,1957,1979,t._0x597e4f,"Ofr8")+"rl"]=Flt((d=e[c("EgFM",828,t._0x46e733,t._0x597df5,t._0x29530a)+"rl"])!=null?d:Tlt),this[m(t._0x4ceede,309,-60,474,"6Q[!")+"er"]=(u=e[m(-99,t._0x46b189,-t._0x13631c,190,t._0x29e111)+"er"])!=null?u:fetch}_create_class(p1e1,[{key:ut("(3#Z",1069,1192,1226,1255)+ut("7*o4",817,1104,822,975)+Xe("0u@s",1051,1259,1545,796)+qe(243,-9,383,399,"gCWj")+qe(1094,912,876,1288,"9PX["),value:function value(e){var t={_0x3a6b24:680,_0x5f5813:"8x(^",_0x598551:500,_0x34a175:753,_0x64e8f8:2141,_0x4306fb:")mU*",_0x2743c9:1256,_0x3ca77a:1367,_0x5de9ed:1412,_0x303631:950,_0x3edb26:390,_0x16aae6:141,_0x20e16f:564,_0x4dbb7b:294,_0x491d90:535,_0x2f9c51:713,_0x4c7fd1:649,_0x42228b:"Pcer",_0x374316:399,_0x9b5867:633,_0x5cff9f:405,_0x12d57e:1835,_0x2c04ce:1132,_0x2d8aa1:"!qKa",_0x237f5a:1609,_0x3813cc:1118,_0x5642c0:"8x(^"};return ru(this,null,function(){var r,n,i,d;function o(u,p,m,h,g){return st(g-882,h)}function a(u,p,m,h,g){return st(m-i._0x485013,g)}function s(u,p,m,h,g){return st(h- -n._0x5a2c84,m)}function l(u,p,m,h,g){return st(h-39,m)}function c(u,p,m,h,g){return st(m-r._0x4396ea,g)}return _ts_generator(this,function(_state){r={_0x4396ea:121},n={_0x5a2c84:505},i={_0x485013:714};if(l(t._0x3a6b24,712,t._0x5f5813,351,t._0x598551)===l(t._0x34a175,1381,"!qKa",1083,1436)){d={};return[2,(d[a(1700,t._0x64e8f8,1675,1254,t._0x4306fb)+l(486,1189,"XSQ8",1002,955)]=e[o(1405,1567,t._0x2743c9,"%wVn",1623)+c(t._0x3ca77a,1262,890,t._0x5de9ed,t._0x4306fb)],this[c(1388,1393,1004,t._0x303631,"wepR")+s(131,t._0x3edb26,"$L(L",t._0x16aae6,t._0x20e16f)](s(243,-741,"pTZ^",-230,t._0x4dbb7b)+s(t._0x491d90,240,"0u@s",442,t._0x2f9c51)+l(851,t._0x4c7fd1,t._0x42228b,t._0x374316,435)+s(t._0x9b5867,684,"$L(L",t._0x5cff9f,182),d))]}else return[2,(_0x51174b[_0x54ba37[_0x26cf63+0]]+_0x48df25[_0x23c2a7[_0x126d89+1]]+_0x16ad01[_0x32baeb[_0x15bffc+2]]+_0xa7a042[_0x35f801[_0x229ee0+3]]+"-"+_0x5c2537[_0x3eabea[_0x358656+4]]+_0x1acef4[_0x45c128[_0x2b989d+5]]+"-"+_0xcdde14[_0x34fac2[_0x10c64b+6]]+_0x28aa99[_0x35cfa2[_0x53e3c5+7]]+"-"+_0x579781[_0x45a7a1[_0x26ca4e+8]]+_0x2274c0[_0x5231b5[_0xdb9ae6+9]]+"-"+_0x57521e[_0x8bf657[_0x5dff57+10]]+_0x5bbe0c[_0x28b1e2[_0xc2f17f+11]]+_0x99180b[_0x586b2d[_0x376325+12]]+_0x3d95ae[_0x3ac120[_0x2cec27+13]]+_0x3ec44e[_0x4602a3[_0x5927b0+14]]+_0x4e0ea2[_0x206588[_0xef6603+15]])[c(1315,t._0x12d57e,1302,t._0x2c04ce,t._0x2d8aa1)+c(t._0x237f5a,1591,t._0x3813cc,968,t._0x5642c0)+"e"]()];return[2]})})}},{key:ut("%wVn",1261,718,1317,827)+$e(1515,1341,1607,"IQMa",1213)+qe(-159,532,149,607,"!qKa")+Xe("Pcer",1266,1490,1433,2021)+"l",value:function value(e){var t={_0x4fc1dc:1204,_0x41f81f:694,_0xa872f8:614,_0xb1c74d:1059,_0x397f16:867,_0xbf4dab:"Pcer",_0x274320:551,_0x179f17:288,_0x133959:"EgFM",_0x361ada:1007,_0x3b0fe3:"8F&P",_0x29e947:141,_0x1d4372:495,_0x7796e8:1195,_0x2acad2:1608,_0x376e7b:296,_0x1b04ed:408,_0xb7ce27:693,_0x2e5c0f:1162,_0x25c09c:"U*q1",_0x4caac2:94,_0x4380ba:658,_0xe5a656:707,_0x22c0eb:270,_0x37758b:"U*q1",_0x511682:191,_0x543b0a:65,_0x5b11ae:440,_0x359be2:901,_0x365636:1085},r={_0x2c9a77:265,_0x446414:137,_0x8afdd0:268},n={_0x22ef2c:179,_0x16f571:266},i={_0x22a3df:184,_0x188700:96},o={_0x342245:544,_0xd2c170:1};function a(p,m,h,g,x){return Xe(m,m-179,p- -o._0x342245,g-163,x-o._0xd2c170)}function s(p,m,h,g,x){return Xe(x,m-93,m- -650,g-i._0x22a3df,x-i._0x188700)}function l(p,m,h,g,x){return qe(p-n._0x22ef2c,m-n._0x16f571,h-877,g-77,g)}var c=new URL(e[u(t._0x4fc1dc,1467,1157,"nGaz",1525)+s(262,t._0x41f81f,t._0xa872f8,t._0xb1c74d,"XmPh")+s(60,453,893,t._0x397f16,"dltk")]);function d(p,m,h,g,x){return Le(p-334,p,h- -1369,g-449,x-38)}function u(p,m,h,g,x){return Xe(g,m-r._0x2c9a77,x-r._0x446414,g-r._0x8afdd0,x-172)}return e[d(t._0xbf4dab,-371,-t._0x274320,-67,-t._0x179f17)+a(974,t._0x133959,1138,t._0x361ada,1333)]&&c[a(322,t._0x3b0fe3,-173,-t._0x29e947,t._0x1d4372)+u(1354,t._0x7796e8,1514,"xoTm",t._0x2acad2)+"ms"][d("Pcer",-t._0x376e7b,-252,-t._0x1b04ed,176)](l(1447,1141,1409,"H9LI",1447)+u(t._0xb7ce27,1084,t._0x2e5c0f,"esI(",1204),e[d(t._0x25c09c,-t._0x4caac2,-283,-102,-470)+l(1281,t._0x4380ba,1185,"78]e",t._0xe5a656)]),c[a(t._0x22c0eb,t._0x37758b,-t._0x511682,-t._0x543b0a,t._0x5b11ae)+l(t._0x359be2,1429,1148,t._0x3b0fe3,t._0x365636)]()}},{key:$e(1225,2261,1524,"HBqf",1731)+Le(964,"$L(L",1087,1343,682)+$e(1119,1459,1153,"q4^g",1060),value:function value(e){var t={_0x238c43:934,_0x391200:"$Bws",_0x575779:214,_0x320f9e:681,_0x3f1ba0:"7qM$",_0x558385:240,_0x7b44c4:561,_0x5733ee:607,_0x147b8b:656,_0x4f7b43:314,_0x59db64:"esI(",_0x54bae6:"%wVn",_0x1d7cd5:804,_0x830529:759,_0x31bf2b:664,_0x243fd0:1064,_0x3547fd:506,_0x175a59:1061,_0x46c695:741,_0x29e35c:815,_0x2e7e9b:1332,_0x1d18a3:1654,_0x4b8ad2:1424,_0x332c23:1370,_0x1fbd01:267,_0x3668fd:"ITq[",_0x104dbf:169,_0x35ee00:1159,_0x29a7e3:733,_0x40a630:"%qo8",_0x13aaa6:410,_0x11170d:56,_0xf41386:512,_0x2ad2c0:1765,_0x6b2cdb:1382,_0x38d42f:1542,_0x46a4d7:1389,_0x3a35b4:621,_0x10ac44:1105,_0x4e44eb:61,_0x3074bc:"yAeH",_0xfb4355:1535,_0x2c0b4a:668,_0x47dd2d:1062,_0x1dd9cf:1019,_0x3b8972:1327,_0x301956:1110,_0x4a1001:"XSQ8",_0x530b61:1411,_0x34cd25:220,_0x1887dc:"7*o4",_0x3a132e:1063,_0x422874:635,_0x5a9aae:254,_0x817a:223,_0x2efc45:"xoTm",_0x587540:288,_0x72535e:528,_0x4ea8f7:39,_0x58a99d:1524,_0x4305f0:1302,_0x2fcfc3:902,_0x1a9a76:"uHEn",_0x25bd8f:1394,_0x10fd50:1263,_0x290954:2025,_0x322859:"7qM$"},r={_0x331255:359},n={_0xad3d43:978};return ru(this,null,function(){var i,o,u,m,h,p;function a(m,h,g,x,v){return st(x-o._0x36a04b,m)}function s(m,h,g,x,v){return st(m-557,v)}function l(m,h,g,x,v){return st(x- -n._0xad3d43,h)}function c(m,h,g,x,v){return st(x- -r._0x331255,v)}function d(m,h,g,x,v){return st(h- -i._0x6946fb,x)}return _ts_generator(this,function(_state){switch(_state.label){case 0:i={_0x6946fb:2},o={_0x36a04b:271};if(!(d(t._0x238c43,1088,1262,t._0x391200,1371)!==d(198,t._0x575779,t._0x320f9e,t._0x3f1ba0,t._0x558385)))return[3,3];u={};u[l(-351,"EgFM",-t._0x7b44c4,-129,-t._0x5733ee)+a("%qo8",192,614,t._0x147b8b,575)+"e"]=e[c(516,-t._0x4f7b43,368,114,t._0x59db64)+a(t._0x54bae6,t._0x1d7cd5,t._0x830529,t._0x31bf2b,t._0x243fd0)],u[l(-346,"m6ks",-491,-273,-t._0x3547fd)+a(")mU*",t._0x175a59,1115,1253,t._0x46c695)]=e[c(t._0x29e35c,258,230,754,"$Bws")+s(t._0x2e7e9b,t._0x1d18a3,t._0x4b8ad2,t._0x332c23,"Ofr8")];return[4,this[d(564,t._0x1fbd01,404,t._0x3668fd,-t._0x104dbf)+c(662,t._0x35ee00,453,t._0x29a7e3,t._0x40a630)](l(t._0x13aaa6,"m6ks",416,-t._0x11170d,-t._0xf41386)+s(t._0x2ad2c0,t._0x6b2cdb,t._0x38d42f,t._0x46a4d7,"8x(^")+d(255,t._0x3a35b4,t._0x10ac44,"H9LI",480)+c(-277,539,-t._0x4e44eb,18,t._0x3074bc)+"n",u)];case 1:m=_state.sent();return[4,l1e(m)];case 2:h=_state.sent();p={};if(p.ok=!0,p[a("esI(",833,1411,1110,t._0xfb4355)+"s"]=200,p[a("H9LI",t._0x2c0b4a,1506,1004,t._0x47dd2d)]=h,m[a("esI(",t._0x1dd9cf,t._0x3b8972,t._0x301956,922)+"s"]===200)return[2,p];if(m[d(564,984,1451,t._0x4a1001,t._0x530b61)+"s"]===202||m[c(273,-176,-105,t._0x34cd25,t._0x1887dc)+"s"]===400||m[c(1051,t._0x3a132e,493,t._0x422874,"q4^g")+"s"]===403)return[2,{ok:!1,status:m[c(-t._0x5a9aae,157,-137,-146,"6Q[!")+"s"],error:h}];throw this[l(t._0x817a,t._0x2efc45,-401,-t._0x587540,193)+c(-14,422,-t._0x72535e,-t._0x4ea8f7,"G13@")+s(1125,t._0x58a99d,t._0x4305f0,t._0x2fcfc3,t._0x1a9a76)+a("esI(",t._0x25bd8f,928,1103,1577)](m[s(1641,t._0x10fd50,t._0x290954,2121,t._0x322859)+"s"],h);case 3:return[2,_0x559cd0[_0x2dd62b>>18&63]+_0x62371f[_0xa3da6b>>12&63]+_0x180cbb[_0x375894>>6&63]+_0x193ab2[_0x2bfbf6&63]];case 4:return[2]}})})}},{key:Xe("8x(^",1240,1166,948,1077)+Xe("nGaz",912,543,701,124)+Xe("!qKa",1050,760,750,499)+ut("Pcer",580,582,645,707)+Le(344,"srHh",585,399,766),value:function value(e){var t={_0x521541:"z(fp",_0x4bc22d:479,_0x44f539:351,_0x1b075a:94,_0x25bdcb:193,_0x465713:265,_0x1a967e:48,_0x17c13d:260,_0x201849:343,_0x10fe57:"Ofr8",_0x27acd0:429,_0x2869c2:935,_0x1ac1cb:"xoTm",_0x525867:239,_0x13b089:441,_0x2eb4dd:507,_0x12411c:233,_0x48bf89:"wepR"},r={_0x59a741:963},n={_0x286d6c:730};return ru(this,null,function(){var i,a;function o(u,p,m,h,g){return st(h- -847,p)}function s(u,p,m,h,g){return st(m- -n._0x286d6c,h)}function l(u,p,m,h,g){return st(m- -r._0x59a741,g)}function c(u,p,m,h,g){return st(u- -686,m)}function d(u,p,m,h,g){return st(u-i._0x1128b3,g)}return _ts_generator(this,function(_state){i={_0x1128b3:476};a={};return[2,(a[o(362,t._0x521541,-t._0x4bc22d,-70,-564)+l(-62,t._0x44f539,-163,-t._0x1b075a,"esI(")+"e"]=e[c(-t._0x25bdcb,-37,"XSQ8",t._0x465713,-t._0x1a967e)+o(t._0x17c13d,"Um*0",-175,-191,-192)],this[s(-t._0x201849,-426,-459,t._0x10fe57,-113)+s(-739,-175,-504,"XmPh",-t._0x27acd0)](d(1279,899,t._0x2869c2,867,t._0x1ac1cb)+o(-t._0x525867,t._0x10fe57,394,-54,-t._0x13b089)+c(-286,-726,"EgFM",-t._0x2eb4dd,t._0x12411c)+l(182,-297,132,565,t._0x48bf89)+"el",a))]})})}},{key:ut("(gQD",1588,988,1073,1273)+qe(309,-139,-147,-604,"H9LI")+"en",value:function value(e){var t={_0x195347:"8x(^",_0x1f9f40:897,_0x5e7542:846,_0x54ed22:715,_0x32b450:10,_0x575b8d:606,_0x5b0295:"H9LI",_0xc413f3:194,_0x1850e7:410,_0x78f1e:115,_0x337123:224,_0x4e1e2f:"8F&P",_0x2fcacc:803,_0xa9fcd6:132,_0x15f6a7:292,_0x330c29:1002,_0x5f55c0:"*(#r",_0x402598:930,_0x19cacc:"HBqf",_0x46ec40:1386,_0xb503a8:779,_0x1d35ac:834,_0x563156:1219};return ru(this,null,function(){var r,s;function n(c,d,u,p,m){return st(m-66,u)}function i(c,d,u,p,m){return st(m- -305,c)}function o(c,d,u,p,m){return st(p- -427,u)}function a(c,d,u,p,m){return st(p-r._0x2f77a3,c)}function l(c,d,u,p,m){return st(u-800,m)}return _ts_generator(this,function(_state){r={_0x2f77a3:54};s={};s[n(205,560,t._0x195347,t._0x1f9f40,434)+i("0u@s",206,t._0x5e7542,365,t._0x54ed22)+n(511,-t._0x32b450,"!qKa",541,295)]=e[l(1179,t._0x575b8d,1042,1564,"wepR")+i(t._0x5b0295,-t._0xc413f3,335,-t._0x1850e7,-t._0x78f1e)+"en"];return[2,this[n(1119,t._0x337123,t._0x4e1e2f,305,702)+n(t._0x2fcacc,-203,"XmPh",t._0xa9fcd6,t._0x15f6a7)](o(281,t._0x330c29,t._0x5f55c0,605,t._0x402598)+a(t._0x19cacc,787,t._0x46ec40,1142,t._0xb503a8)+n(t._0x1d35ac,843,"%qo8",t._0x563156,1091)+"h",s)]})})}},{key:qe(-499,-485,3,85,"U*q1")+Le(1044,"9PX[",1065,1231,686)+qe(67,401,-38,353,"gCWj")+$e(1139,1234,1495,"(gQD",1123)+"ts",value:function value(){var e={_0x35c9a4:981,_0xaafbae:1469,_0x216664:339,_0x4a6acd:565,_0x19266d:"ITq[",_0x1fe3bd:1485,_0x563b28:733,_0x4f234a:"Um*0",_0x3dea71:"m6ks",_0x849e3f:29,_0x3c7824:754,_0x18e72c:680,_0x21a5bb:1267,_0x14406b:1599,_0x11b36a:1762,_0xc262bd:1336,_0x14d31c:1099,_0x34f2c3:"%qo8",_0xa7c3bf:"EgFM",_0x55ebdf:544,_0x37aac2:359,_0x32fff0:1558,_0x3849cc:"XSQ8",_0x4d485a:1424,_0x490303:"7qM$",_0x54e19d:392,_0x8d8bd6:575,_0x596dfe:368,_0x146ac1:1588,_0x1c6973:1551,_0x2bbf3d:1355,_0x1dc831:698,_0x2509bc:1422,_0x2317cf:"7*o4",_0x4f815f:1048,_0x5e5ac1:1385,_0x1b2b55:756,_0xd75011:1206,_0x1ff5ce:1219,_0x16b125:1128,_0x3e9f6e:1351,_0x1bc263:"uHEn",_0x1e76c2:1550,_0xa38da7:"8x(^",_0x2e5a98:760,_0x4f98dd:663,_0x327d4b:"G13@",_0x50a931:1171,_0x38dedd:1120,_0x422401:273,_0x4a44d4:1211,_0xdae89e:1042,_0x84d3bb:393,_0x58d553:88,_0x2424c9:1462,_0x45296a:1091,_0xeb5042:"!qKa",_0x27b4c2:806,_0x382f2d:293,_0x390b08:377,_0x7303ae:"z(fp",_0x427d86:602,_0x3ceafa:458},t={_0x66e7d:287},r={_0x42e66b:437},n={_0x27fbb3:78,_0x3b2c5a:417,_0x3d3437:461},i={_0x3b1297:45,_0x1e43ad:302};function o(u,p,m,h,g){return Xe(m,p-52,g-i._0x3b1297,h-479,g-i._0x1e43ad)}var a={};a[d("nGaz",1259,1020,e._0x35c9a4,e._0xaafbae)+"s"]=this[o(e._0x216664,1036,"xoTm",257,e._0x4a6acd)+"rl"]+(o(1953,1835,e._0x19266d,1581,e._0x1fe3bd)+o(e._0x563b28,764,e._0x4f234a,689,1090));function s(u,p,m,h,g){return ut(u,p-n._0x27fbb3,m-n._0x3b2c5a,h-n._0x3d3437,p- -719)}a[l(e._0x3dea71,210,-14,-e._0x849e3f,-353)+c(e._0x3c7824,e._0x18e72c,1164,e._0x21a5bb,"G13@")]=this[c(e._0x14406b,e._0x11b36a,e._0xc262bd,e._0x14d31c,e._0x34f2c3)+"rl"]+(l(e._0xa7c3bf,e._0x55ebdf,92,619,e._0x37aac2)+o(e._0x32fff0,1210,e._0x3849cc,938,e._0x4d485a)+l(e._0x490303,e._0x54e19d,e._0x8d8bd6,729,e._0x596dfe));function l(u,p,m,h,g){return Xe(u,p-64,h- -527,h-467,g-2)}a[d(e._0x19266d,1486,e._0x146ac1,e._0x1c6973,e._0x2bbf3d)+o(e._0x1dc831,e._0x2509bc,"z(fp",1184,1028)+d(e._0x2317cf,e._0x4f815f,e._0x5e5ac1,893,1683)+"ns"]=this[o(e._0x1b2b55,1643,"0%4x",e._0xd75011,e._0x1ff5ce)+"rl"]+(o(e._0x16b125,e._0x3e9f6e,e._0x1bc263,e._0x1e76c2,1200)+d(e._0xa38da7,544,934,e._0x2e5a98,e._0x4f98dd)+o(697,821,e._0x327d4b,1409,e._0x50a931)+d(e._0x327d4b,e._0x38dedd,1577,1838,1429));function c(u,p,m,h,g){return Le(u-350,g,u-108,h-442,g-r._0x42e66b)}function d(u,p,m,h,g){return qe(u-5,p-445,m-1073,h-t._0x66e7d,u)}return a[o(951,e._0x422401,"KBpi",961,618)+c(1248,e._0x4a44d4,e._0xdae89e,1703,"$L(L")+l("CSrr",-40,-e._0x84d3bb,e._0x58d553,-268)+c(1265,1680,e._0x2424c9,855,e._0x3849cc)+o(e._0x45296a,885,e._0xeb5042,1040,e._0x27b4c2)]=this[s("z(fp",e._0x382f2d,705,e._0x390b08,745)+"rl"]+s(e._0x7303ae,e._0x427d86,832,e._0x3ceafa,178),a}},{key:ut("78]e",1162,1472,959,1121)+$e(1557,857,622,"Um*0",1114),value:function value(e,t){var r={_0x3f4eb7:1023,_0x3ed2ef:1203,_0x3108d9:748,_0x33043d:1370,_0x16ac4f:256,_0x1ac134:710,_0x3a6e69:975,_0x5f0497:371,_0x483208:"XmPh",_0x5294cc:595,_0x4c74ca:"!qKa",_0x648060:926,_0xc19ca4:894,_0x43dffa:"HKLe",_0x375715:987,_0x2fa917:555,_0x328ab6:167,_0x39dda8:959,_0x5ab79a:")mU*",_0x55f0f3:1134,_0x3bdbdd:196,_0x4eae56:572,_0x1d48c9:99,_0x14b793:372,_0x4e31c8:945,_0x3d5ec6:671,_0x413643:654,_0x4be6f:543,_0x48bf82:"78]e",_0x201ecf:254,_0x5d3a91:757},n={_0x30c3c6:175},i={_0x3ef29c:317},o={_0x1b1c02:138};return ru(this,null,function(){var u;function a(p,m,h,g,x){return st(g- -114,p)}function s(p,m,h,g,x){return st(m-o._0x1b1c02,h)}function l(p,m,h,g,x){return st(m- -i._0x3ef29c,h)}function c(p,m,h,g,x){return st(x- -n._0x30c3c6,m)}function d(p,m,h,g,x){return st(h- -161,m)}return _ts_generator(this,function(_state){if(d(r._0x3f4eb7,"wepR",813,605,956)===d(r._0x3ed2ef,"*(#r",994,r._0x3108d9,r._0x33043d))return[2,_0x4019be[d(r._0x16ac4f,"%qo8",r._0x1ac134,908,r._0x3a6e69)](_0x243798)];u={};return[2,(u[l(r._0x5f0497,-106,r._0x483208,332,-521)+s(r._0x5294cc,1111,r._0x4c74ca,r._0x648060,823)+"pe"]=c(r._0xc19ca4,r._0x43dffa,r._0x375715,1285,1023)+a("XSQ8",r._0x2fa917,489,r._0x328ab6,523)+s(1197,r._0x39dda8,r._0x5ab79a,1043,r._0x55f0f3)+"n",this[l(r._0x3bdbdd,r._0x4eae56,"yAeH",r._0x1d48c9,r._0x39dda8)+"er"](""+this[l(r._0x14b793,888,r._0x483208,883,r._0x4e31c8)+"rl"]+e,{method:s(420,r._0x3d5ec6,"yAeH",r._0x413643,451),headers:u,body:JSON[d(956,"Ofr8",r._0x4be6f,232,652)+d(-66,r._0x48bf82,r._0x201ecf,234,r._0x5d3a91)](t)}))]})})}},{key:Xe("8x(^",926,901,447,1173)+Le(394,"0u@s",730,708,389),value:function value(e,t){var r={_0x390b57:13,_0x57a74b:"%wVn",_0xc3d485:496,_0x290a00:415,_0x43b1b0:73,_0x26585c:178,_0x785538:669,_0xfb27d1:403,_0xdd9ad0:403,_0xa76066:122,_0x25a819:18,_0x48b68b:552,_0x449810:318,_0x45d0a3:"z(fp",_0x41baea:60,_0x1b3e57:"XmPh",_0x15e63c:397,_0x2dc5fc:130,_0x2dd304:265,_0x84b0a1:454,_0x5c3ea8:"XmPh"},n={_0x107388:673};return ru(this,null,function(){var i,_$d,u;function o(d,u,p,m,h){return st(p- -201,h)}function a(d,u,p,m,h){return st(p- -551,u)}function s(d,u,p,m,h){return st(u- -901,h)}function l(d,u,p,m,h){return st(h- -n._0x107388,m)}function c(d,u,p,m,h){return st(h- -i._0x1a596a,m)}return _ts_generator(this,function(_state){switch(_state.label){case 0:i={_0x1a596a:909};if(!(a(r._0x390b57,r._0x57a74b,273,648,62)===l(-661,-505,-811,"%wVn",-r._0xc3d485)))return[3,1];try{_0x44f653(_0x18b156[l(r._0x290a00,682,r._0x43b1b0,")mU*",r._0x26585c)](_0xc35a5a))}catch(d){_0x30dfcb(d)}return[3,4];case 1:return[4,this[l(-r._0x785538,-693,-657,"Um*0",-r._0xfb27d1)+o(r._0xdd9ad0,-r._0xa76066,r._0x25a819,488,"HKLe")](e,t)];case 2:_$d=_state.sent();return[4,l1e(_$d)];case 3:u=_state.sent();if(!_$d.ok)throw this[c(-r._0x48b68b,-458,-r._0x449810,r._0x45d0a3,-64)+s(-r._0x41baea,-359,-437,-855,r._0x1b3e57)+l(r._0x15e63c,r._0x2dc5fc,632,"%qo8",r._0x2dd304)+c(-r._0x84b0a1,-245,-535,r._0x5c3ea8,-318)](_$d[c(-456,-600,-547,"Ofr8",-554)+"s"],u);return[2,u];case 4:return[2]}})})}},{key:ut("*(#r",1478,1387,1264,1338)+Xe("nGaz",282,782,1309,1266)+qe(34,18,-176,-657,"Mu^3")+Xe("Ofr8",1613,1219,783,924),value:function value(e,t){var r={_0x2e1866:412,_0x400d35:"$L(L",_0x49c64a:102,_0x503221:501,_0x197a11:"XmPh",_0x2daa6b:164,_0x479cad:184,_0x3a8f3b:45,_0x234d61:"G13@",_0x8ec9db:"uHEn",_0xec543c:278,_0x190ecc:431,_0x4058f9:565,_0x385a59:86,_0x3dcbed:178,_0x2285b0:223,_0x1af3a1:311,_0x1e680f:"$L(L",_0x476936:553,_0x3fd7b3:64,_0x3de14c:"EgFM",_0x381da:430,_0x592c52:528,_0x395522:600,_0x5f469c:241,_0x1aa235:738,_0x3b73a7:780,_0x194841:567,_0x58c9b6:836,_0x532af1:1439,_0x3c2787:1214,_0x3addb7:1209,_0x5f2665:608,_0x3f043b:"(gQD",_0x18b847:743,_0x1f2226:188,_0x38f3e8:153,_0x6ffb82:259,_0x1c605:"(3#Z",_0x428188:216,_0x4dc5a6:751,_0x57cc52:"7qM$",_0x325821:996},n={_0x1381d7:254,_0x4a3250:1250,_0x24d15b:148},i={_0x54f05b:110,_0xf7af86:80},o={_0x22d412:422},a={_0x3cc78e:128,_0x4ff51b:493};function s(p,m,h,g,x){return Le(p-402,p,g- -613,g-44,x-1)}if(t&&(typeof t==="undefined"?"undefined":_type_of(t))==d(-r._0x2e1866,-663,-862,-504,r._0x400d35)+"t"&&d(-229,300,r._0x49c64a,-r._0x503221,r._0x197a11)in t&&d(-350,-r._0x2daa6b,-r._0x479cad,-r._0x3a8f3b,r._0x234d61)+"ge"in t){var p=t;return new BU(s(r._0x8ec9db,766,461,307,r._0xec543c)+u(r._0x190ecc,r._0x4058f9,r._0x385a59,r._0x197a11,619)+d(r._0x3dcbed,264,r._0x2285b0,r._0x1af3a1,r._0x1e680f)+c(-1074,-r._0x476936,"HKLe",-460,-r._0x3fd7b3)+s(r._0x3de14c,r._0x381da,97,r._0x592c52,r._0x503221)+"s "+e+": "+p[d(-r._0x395522,-r._0x5f469c,-404,-r._0x1aa235,"xoTm")]+" "+p[s("*LQ]",r._0x3b73a7,r._0x194841,r._0x58c9b6,477)+"ge"],{status:e,code:p[l("H9LI",r._0x532af1,r._0x3c2787,r._0x3addb7,1515)],retriable:p[d(-777,-1076,-r._0x5f2665,-750,")mU*")+s(r._0x3f043b,290,520,585,r._0x18b847)],body:t})}function l(p,m,h,g,x){return qe(p-a._0x3cc78e,m-a._0x4ff51b,h-1172,g-179,p)}function c(p,m,h,g,x){return qe(p-o._0x22d412,m-256,m- -484,g-93,h)}function d(p,m,h,g,x){return qe(p-402,m-i._0x54f05b,p- -626,g-i._0xf7af86,x)}function u(p,m,h,g,x){return Le(p-n._0x1381d7,g,h- -n._0x4a3250,g-n._0x24d15b,x-61)}return new BU(s("78]e",830,160,489,870)+c(r._0x1f2226,-r._0x49c64a,"8F&P",203,r._0x38f3e8)+u(-756,43,-r._0x6ffb82,r._0x1c605,-r._0x428188)+u(170,-405,-280,"IQMa",-r._0x4dc5a6)+s(r._0x57cc52,879,449,886,r._0x325821)+"s "+e,{status:e,body:t})}}]);return p1e1}();var Ts=require("obsidian");var HA=require("obsidian");var H6=/*#__PURE__*/function(_HA_Modal){"use strict";_inherits(H61,_HA_Modal);function H61(r,n){_class_call_check(this,H61);var _this;_this=_call_super(this,H61,[r]);A(_this,"onConfirm");_this.onConfirm=n;return _this}_create_class(H61,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.createEl("h2",{text:P.t("settings.logout.confirmTitle")}),r.createEl("p",{text:P.t("settings.logout.confirmMessage")}),new HA.Setting(r).addButton(function(n){return n.setButtonText(P.t("settings.logout.cancel")).onClick(function(){return _this.close()})}).addButton(function(n){n.buttonEl.addClass("mod-warning"),n.setButtonText(P.t("settings.logout.confirm")).onClick(function(){_this.close(),_this.onConfirm()})})}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty()}}]);return H61}(HA.Modal);var M0=require("obsidian");var Z6=/*#__PURE__*/function(_M0_Modal){"use strict";_inherits(Z61,_M0_Modal);function Z61(r){_class_call_check(this,Z61);var _this;_this=_call_super(this,Z61,[r.app]);_this.plugin=r;return _this}_create_class(Z61,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl,n=this.plugin.settings.nutstoreEnterpriseBaseUrl;r.createEl("h2",{text:P.t("settings.enterpriseBaseUrl.modalTitle")}),new M0.Setting(r).setName(P.t("settings.enterpriseBaseUrl.name")).setDesc(P.t("settings.enterpriseBaseUrl.desc")).addText(function(i){i.setPlaceholder(P.t("settings.enterpriseBaseUrl.placeholder")).setValue(n).onChange(function(o){n=o}),i.inputEl.addEventListener("keydown",function(o){o.key==="Enter"&&(o.preventDefault(),_this.save(n))})}),new M0.Setting(r).addButton(function(i){return i.setCta().setButtonText(P.t("settings.filters.save")).onClick(function(){_this.save(n)})}).addButton(function(i){return i.setButtonText(P.t("settings.filters.cancel")).onClick(function(){return _this.close()})})}},{key:"save",value:function save(r){return _async_to_generator(function(){var i,o,n,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r.trim();if(!!n)return[3,3];this.plugin.settings.nutstoreEnterpriseBaseUrl="";return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[4,(i=this.plugin.settingTab)==null?void 0:i.rerenderIfVisible()];case 2:_state.sent(),this.close();return[2];case 3:_state.trys.push([3,6,,7]);this.plugin.settings.nutstoreEnterpriseBaseUrl=Vj(n);return[4,this.plugin.settingsService.saveSettings()];case 4:_state.sent();return[4,(o=this.plugin.settingTab)==null?void 0:o.rerenderIfVisible()];case 5:_state.sent(),this.close();return[3,7];case 6:a=_state.sent();s=_instanceof(a,vh)?P.t("settings.enterpriseBaseUrl.errors.".concat(a.reason)):P.t("settings.enterpriseBaseUrl.errors.invalidFormat");new M0.Notice(P.t("settings.enterpriseBaseUrl.invalidWithReason",{reason:s}));return[3,7];case 7:return[2]}})}).call(this)}},{key:"onClose",value:function onClose(){this.contentEl.empty()}}]);return Z61}(M0.Modal);var nu=function nu1(t,r,n,i){"use strict";_class_call_check(this,nu1);this.app=t;this.plugin=r;this.settings=n;this.containerEl=i};var K6=/*#__PURE__*/function(nu1){"use strict";_inherits(K61,nu1);function K61(){_class_call_check(this,K61);var _this;_this=_call_super(this,K61,arguments);A(_this,"updateOAuthUrlTimer",null);return _this}_create_class(K61,[{key:"display",value:function display(){return _async_to_generator(function(){var _this,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.containerEl.empty(),new Ts.Setting(this.containerEl).setName(P.t("settings.sections.account")).setHeading(),new Ts.Setting(this.containerEl).setName(P.t("settings.loginMode.name")).addDropdown(function(r){return r.addOption("manual",P.t("settings.loginMode.manual")).addOption("sso",P.t("settings.loginMode.sso")).setValue(_this.plugin.settings.loginMode).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.loginMode=n==="manual"?"manual":"sso";return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent(),this.display();return[2]}})}).call(_this)})});if(!this.settings.isSSO)return[3,2];return[4,this.displaySSOLoginSettings()];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=this.displayManualLoginSettings();_state.label=3;case 3:_tmp;return[2]}})}).call(this)}},{key:"hide",value:function hide(){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.updateOAuthUrlTimer!==null&&(window.clearInterval(this.updateOAuthUrlTimer),this.updateOAuthUrlTimer=null);return[2]})}).call(this)}},{key:"displayManualLoginSettings",value:function displayManualLoginSettings(){var _this=this;var r=new Ts.Setting(this.containerEl);Er(r.descEl,"ns-dvqxvb");var n=r.descEl.createEl("a",{href:"https://help.jianguoyun.com/?p=2064",cls:"ns-rzwn4f settings-helper-badge",text:P.t("settings.help.name")});n.target="_blank",r.descEl.createEl("a",{href:"#",cls:"ns-rzwn4f settings-helper-badge",text:P.t("settings.enterpriseBaseUrl.name")}).addEventListener("click",function(o){o.preventDefault(),new Z6(_this.plugin).open()}),new Ts.Setting(this.containerEl).setName(P.t("settings.account.name")).setDesc(P.t("settings.account.desc")).addText(function(o){return o.setPlaceholder(P.t("settings.account.placeholder")).setValue(_this.plugin.settings.account).onChange(function(a){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.account=a;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new Ts.Setting(this.containerEl).setName(P.t("settings.credential.name")).setDesc(P.t("settings.credential.desc")).addText(function(o){o.setPlaceholder(P.t("settings.credential.placeholder")).setValue(_this.plugin.settings.credential).onChange(function(a){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.credential=a;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)}),o.inputEl.type="password"}),this.displayCheckConnection()}},{key:"displaySSOLoginSettings",value:function displaySSOLoginSettings(){return _async_to_generator(function(){var _this,r,n,i,_$i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;r=this.plugin.settings.oauthResponseText.length>0;if(!r)return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.plugin.getDecryptedOAuthInfo()];case 2:n=_state.sent();return[3,4];case 3:i=_state.sent();Me.error(i),r=!1;return[3,4];case 4:if(r&&n!=null&&n.username){_$i=new Ts.Setting(this.containerEl).setName(P.t("settings.ssoStatus.loggedIn")).setDesc(n.username).addButton(function(o){o.buttonEl.addClass("mod-warning"),o.setButtonText(P.t("settings.ssoStatus.logout")).onClick(function(){new H6(_this.app,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.oauthResponseText="";return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent(),new Ts.Notice(P.t("settings.ssoStatus.logoutSuccess")),this.display();return[2]}})}).call(_this)}).open()})});Er(_$i.descEl,"ns-2l63vd","ns-idm853"),Er(_$i.infoEl,"ns-2l63vd"),this.displayCheckConnection()}else new Ts.Setting(this.containerEl).setName(P.t("settings.ssoStatus.notLoggedIn")).addButton(function(i){return _async_to_generator(function(){var _this,a,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;i.setButtonText(P.t("settings.login.name"));o=createEl("a");o.target="_blank",(a=i.buttonEl.parentElement)==null||a.appendChild(o),o.appendChild(i.buttonEl);return[4,WU({app:"obsidian"})];case 1:o.href=_state.sent(),this.updateOAuthUrlTimer=window.setInterval(function(){(function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!document.contains(o))return[3,2];return[4,WU({app:"obsidian"})];case 1:_tmp=o.href=_state.sent();return[3,3];case 2:_tmp=(window.clearInterval(this.updateOAuthUrlTimer),this.updateOAuthUrlTimer=null);_state.label=3;case 3:return[2,_tmp]}})}).call(_this)})()},60*1e3);return[2]}})}).call(_this)});return[2]}})}).call(this)}},{key:"displayCheckConnection",value:function displayCheckConnection(){var _this=this;new Ts.Setting(this.containerEl).setName(P.t("settings.checkConnection.name")).setDesc(P.t("settings.checkConnection.desc")).addButton(function(r){r.setButtonText(P.t("settings.checkConnection.name")).onClick(function(n){return _async_to_generator(function(){var i,_ref,o,a,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=n.target;Er(i,"connection-button","loading","ns-fx8a6s","ns-b8p3m5"),Dn(i,"success","error"),i.textContent=P.t("settings.checkConnection.name");_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.plugin.webDAVService.checkWebDAVConnection()];case 2:_ref=_state.sent(),o=_ref.success,a=_ref.error;Dn(i,"loading","ns-fx8a6s","ns-b8p3m5"),o?(Er(i,"success"),i.textContent=P.t("settings.checkConnection.successButton"),new Ts.Notice(P.t("settings.checkConnection.success"))):a&&Lc(a)?(Er(i,"error"),i.textContent=P.t("sync.error.requestsTooFrequent"),new Ts.Notice(P.t("sync.error.requestsTooFrequent"))):(Er(i,"error"),i.textContent=P.t("settings.checkConnection.failureButton"),new Ts.Notice(P.t("settings.checkConnection.failure")));return[3,4];case 3:o10=_state.sent();Dn(i,"loading","ns-fx8a6s","ns-b8p3m5"),Er(i,"error"),i.textContent=P.t("settings.checkConnection.failureButton"),new Ts.Notice(P.t("settings.checkConnection.failure"));return[3,4];case 4:return[2]}})}).call(_this)})})}}]);return K61}(nu);var jc=require("obsidian");var f1e=he.enum(["text","image","audio","video","pdf","file"]),zlt=he.object({input:he.number(),output:he.number(),cache_read:he.optional(he.number()),cache_write:he.optional(he.number()),context_over_200k:he.optional(he.object({input:he.number(),output:he.number(),cache_read:he.optional(he.number()),cache_write:he.optional(he.number())})),input_audio:he.optional(he.number()),output_audio:he.optional(he.number()),reasoning:he.optional(he.number())}),jlt=he.object({context:he.number(),input:he.optional(he.number()),output:he.number()}),Ult=he.object({npm:he.optional(he.string()),api:he.optional(he.string()),shape:he.optional(he.string())}),m1e=he.object({id:he.string(),name:he.string(),family:he.optional(he.string()),attachment:he.boolean(),reasoning:he.boolean(),tool_call:he.boolean(),structured_output:he.optional(he.boolean()),temperature:he.optional(he.boolean()),knowledge:he.optional(he.string()),release_date:he.string(),last_updated:he.string(),modalities:he.object({input:he.array(f1e),output:he.array(f1e)}),open_weights:he.boolean(),cost:he.optional(zlt),limit:jlt,interleaved:he.optional(he.union([he.boolean(),he.object({field:he.string()})])),provider:he.optional(Ult),status:he.optional(he.enum(["alpha","beta","deprecated"])),experimental:he.optional(he.record(he.string(),he.unknown()))}),Blt=he.partial(m1e),qlt=he.record(he.string(),m1e),Wlt=he.record(he.string(),Blt),h1e=he.object({id:he.string(),env:he.array(he.string()),npm:he.string(),api:he.optional(he.string()),name:he.string(),doc:he.string(),models:qlt}),VU=he.record(he.string(),h1e),g1e=he.extend(h1e,{apiKey:he.string(),allowBrowserCors:he.optional(he.boolean())}),Vlt=he.extend(he.partial(g1e),{models:he.optional(Wlt)}),w0r=he.record(he.string(),g1e),x1e=he.record(he.string(),Vlt);var y1e={"xiaomi-token-plan-cn":{id:"xiaomi-token-plan-cn",env:["XIAOMI_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://token-plan-cn.xiaomimimo.com/v1",name:"Xiaomi Token Plan (China)",doc:"https://platform.xiaomimimo.com/#/docs",models:{"mimo-v2.5-tts":{id:"mimo-v2.5-tts",name:"MiMo-V2.5-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts-voiceclone":{id:"mimo-v2.5-tts-voiceclone",name:"MiMo-V2.5-TTS-VoiceClone",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2-tts":{id:"mimo-v2-tts",name:"MiMo-V2-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts-voicedesign":{id:"mimo-v2.5-tts-voicedesign",name:"MiMo-V2.5-TTS-VoiceDesign",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2-pro":{id:"mimo-v2-pro",name:"MiMo-V2-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","audio","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}}}},"siliconflow-cn":{id:"siliconflow-cn",env:["SILICONFLOW_CN_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.siliconflow.cn/v1",name:"SiliconFlow (China)",doc:"https://cloud.siliconflow.com/models",models:{"baidu/ERNIE-4.5-300B-A47B":{id:"baidu/ERNIE-4.5-300B-A47B",name:"baidu/ERNIE-4.5-300B-A47B",family:"ernie",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-02",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.28,output:1.1},limit:{context:131e3,output:131e3}},"stepfun-ai/Step-3.5-Flash":{id:"stepfun-ai/Step-3.5-Flash",name:"stepfun-ai/Step-3.5-Flash",family:"step",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.1,output:.3},limit:{context:262e3,output:262e3}},"deepseek-ai/DeepSeek-V4-Flash":{id:"deepseek-ai/DeepSeek-V4-Flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.003},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"deepseek-ai/DeepSeek-V3.1-Terminus",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-29",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:1},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-OCR":{id:"deepseek-ai/DeepSeek-OCR",name:"deepseek-ai/DeepSeek-OCR",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-10-20",last_updated:"2025-10-20",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"deepseek-ai/DeepSeek-R1":{id:"deepseek-ai/DeepSeek-R1",name:"deepseek-ai/DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-05-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:2.18},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V3.2":{id:"deepseek-ai/DeepSeek-V3.2",name:"deepseek-ai/DeepSeek-V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-03",last_updated:"2025-12-03",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:.42},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"deepseek-ai/DeepSeek-V4-Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.74,output:3.48,cache_read:.145},limit:{context:1049e3,output:393e3}},"deepseek-ai/DeepSeek-V3":{id:"deepseek-ai/DeepSeek-V3",name:"deepseek-ai/DeepSeek-V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-12-26",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:164e3,output:164e3}},"inclusionAI/Ling-flash-2.0":{id:"inclusionAI/Ling-flash-2.0",name:"inclusionAI/Ling-flash-2.0",family:"ling",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:1049e3,output:262e3},interleaved:{field:"reasoning_content"}},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"zai-org/GLM-4.5-Air",family:"glm-air",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.86},limit:{context:131e3,output:131e3}},"Qwen/Qwen3.5-27B":{id:"Qwen/Qwen3.5-27B",name:"Qwen/Qwen3.5-27B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-25",last_updated:"2026-02-25",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.26,output:2.09},limit:{context:262144,output:65536}},"Qwen/Qwen3-8B":{id:"Qwen/Qwen3-8B",name:"Qwen/Qwen3-8B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.06,output:.06},limit:{context:131e3,output:131e3}},"Qwen/Qwen3-14B":{id:"Qwen/Qwen3-14B",name:"Qwen/Qwen3-14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.07,output:.28},limit:{context:131e3,output:131e3}},"Qwen/Qwen3.5-4B":{id:"Qwen/Qwen3.5-4B",name:"Qwen/Qwen3.5-4B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen/Qwen3.5-9B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.22,output:1.74},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-122B-A10B":{id:"Qwen/Qwen3.5-122B-A10B",name:"Qwen/Qwen3.5-122B-A10B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-26",last_updated:"2026-02-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.29,output:2.32},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-397B-A17B":{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen/Qwen3.5-397B-A17B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.29,output:1.74},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-35B-A3B":{id:"Qwen/Qwen3.5-35B-A3B",name:"Qwen/Qwen3.5-35B-A3B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-25",last_updated:"2026-02-25",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.23,output:1.86},limit:{context:262144,output:65536}},"Qwen/Qwen3-32B":{id:"Qwen/Qwen3-32B",name:"Qwen/Qwen3-32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"Qwen/Qwen3-235B-A22B-Thinking-2507":{id:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen/Qwen3-235B-A22B-Thinking-2507",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.13,output:.6},limit:{context:262e3,output:262e3}},"Qwen/Qwen3.6-35B-A3B":{id:"Qwen/Qwen3.6-35B-A3B",name:"Qwen/Qwen3.6-35B-A3B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.23,output:1.86},limit:{context:262144,output:65536}},"Qwen/Qwen3-VL-30B-A3B-Instruct":{id:"Qwen/Qwen3-VL-30B-A3B-Instruct",name:"Qwen/Qwen3-VL-30B-A3B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-05",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.29,output:1},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-235B-A22B-Thinking":{id:"Qwen/Qwen3-VL-235B-A22B-Thinking",name:"Qwen/Qwen3-VL-235B-A22B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-04",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.45,output:3.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-8B-Instruct":{id:"Qwen/Qwen3-VL-8B-Instruct",name:"Qwen/Qwen3-VL-8B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-15",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.18,output:.68},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-32B-Instruct":{id:"Qwen/Qwen3-VL-32B-Instruct",name:"Qwen/Qwen3-VL-32B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-21",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:.6},limit:{context:262e3,output:262e3}},"Qwen/Qwen2.5-72B-Instruct":{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen/Qwen2.5-72B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.59,output:.59},limit:{context:33e3,output:4e3}},"Qwen/Qwen2.5-7B-Instruct":{id:"Qwen/Qwen2.5-7B-Instruct",name:"Qwen/Qwen2.5-7B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.05},limit:{context:33e3,output:4e3}},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen/Qwen3-Coder-480B-A35B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-31",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-235B-A22B-Instruct":{id:"Qwen/Qwen3-VL-235B-A22B-Instruct",name:"Qwen/Qwen3-VL-235B-A22B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-04",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{id:"Qwen/Qwen3-Coder-30B-A3B-Instruct",name:"Qwen/Qwen3-Coder-30B-A3B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-01",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.07,output:.28},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-32B-Thinking":{id:"Qwen/Qwen3-VL-32B-Thinking",name:"Qwen/Qwen3-VL-32B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-21",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-30B-A3B-Thinking":{id:"Qwen/Qwen3-VL-30B-A3B-Thinking",name:"Qwen/Qwen3-VL-30B-A3B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-11",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.29,output:1},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-30B-A3B-Instruct-2507":{id:"Qwen/Qwen3-30B-A3B-Instruct-2507",name:"Qwen/Qwen3-30B-A3B-Instruct-2507",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.09,output:.3},limit:{context:262e3,output:262e3}},"ByteDance-Seed/Seed-OSS-36B-Instruct":{id:"ByteDance-Seed/Seed-OSS-36B-Instruct",name:"ByteDance-Seed/Seed-OSS-36B-Instruct",family:"seed",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-04",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.21,output:.57},limit:{context:262e3,output:262e3}},"Pro/deepseek-ai/DeepSeek-V3":{id:"Pro/deepseek-ai/DeepSeek-V3",name:"Pro/deepseek-ai/DeepSeek-V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-12-26",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:164e3,output:164e3}},"Pro/deepseek-ai/DeepSeek-V3.1-Terminus":{id:"Pro/deepseek-ai/DeepSeek-V3.1-Terminus",name:"Pro/deepseek-ai/DeepSeek-V3.1-Terminus",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-29",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:1},limit:{context:164e3,output:164e3}},"Pro/deepseek-ai/DeepSeek-R1":{id:"Pro/deepseek-ai/DeepSeek-R1",name:"Pro/deepseek-ai/DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-05-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:2.18},limit:{context:164e3,output:164e3}},"Pro/deepseek-ai/DeepSeek-V3.2":{id:"Pro/deepseek-ai/DeepSeek-V3.2",name:"Pro/deepseek-ai/DeepSeek-V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-03",last_updated:"2025-12-03",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:.42},limit:{context:164e3,output:164e3}},"Pro/zai-org/GLM-5.1":{id:"Pro/zai-org/GLM-5.1",name:"Pro/zai-org/GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-08",last_updated:"2026-04-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:205e3,output:205e3},interleaved:{field:"reasoning_content"}},"Pro/zai-org/GLM-5":{id:"Pro/zai-org/GLM-5",name:"Pro/zai-org/GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3.2},limit:{context:205e3,output:205e3},interleaved:{field:"reasoning_content"}},"Pro/MiniMaxAI/MiniMax-M2.5":{id:"Pro/MiniMaxAI/MiniMax-M2.5",name:"Pro/MiniMaxAI/MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-13",last_updated:"2026-02-13",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.22},limit:{context:192e3,output:131e3},interleaved:{field:"reasoning_content"}},"Pro/moonshotai/Kimi-K2.5":{id:"Pro/moonshotai/Kimi-K2.5",name:"Pro/moonshotai/Kimi-K2.5",family:"kimi",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.45,output:2.25,cache_read:.07},limit:{context:262e3,output:262e3},interleaved:{field:"reasoning_content"}},"Pro/moonshotai/Kimi-K2.6":{id:"Pro/moonshotai/Kimi-K2.6",name:"Pro/moonshotai/Kimi-K2.6",family:"kimi",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262e3,output:262e3},interleaved:{field:"reasoning_content"}},"tencent/Hunyuan-A13B-Instruct":{id:"tencent/Hunyuan-A13B-Instruct",name:"tencent/Hunyuan-A13B-Instruct",family:"hunyuan",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-06-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"PaddlePaddle/PaddleOCR-VL-1.5":{id:"PaddlePaddle/PaddleOCR-VL-1.5",name:"PaddlePaddle/PaddleOCR-VL-1.5",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2026-01-29",last_updated:"2026-01-29",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:16384,output:16384}}}},groq:{id:"groq",env:["GROQ_API_KEY"],npm:"@ai-sdk/groq",name:"Groq",doc:"https://console.groq.com/docs/models",models:{"whisper-large-v3":{id:"whisper-large-v3",name:"Whisper",family:"whisper",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2023-09-01",last_updated:"2025-09-05",modalities:{input:["audio"],output:["text"]},open_weights:!0,limit:{context:0,output:0}},"whisper-large-v3-turbo":{id:"whisper-large-v3-turbo",name:"Whisper Large V3 Turbo",family:"whisper",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-10-01",last_updated:"2024-10-01",modalities:{input:["audio"],output:["text"]},open_weights:!0,limit:{context:0,output:0}},"llama-3.1-8b-instant":{id:"llama-3.1-8b-instant",name:"Llama 3.1 8B",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.08},limit:{context:131072,output:131072}},"allam-2-7b":{id:"allam-2-7b",name:"ALLaM-2-7b",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-01-23",last_updated:"2025-01-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:4096,output:4096}},"llama-3.3-70b-versatile":{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2024-12-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.59,output:.79},limit:{context:131072,output:32768}},"qwen/qwen3.8-27b":{id:"qwen/qwen3.8-27b",name:"Qwen3.8 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.8,output:4},limit:{context:131042,output:16384}},"qwen/qwen3.6-27b":{id:"qwen/qwen3.6-27b",name:"Qwen3.6 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:3,cache_read:.3},limit:{context:131072,output:16384}},"groq/compound":{id:"groq/compound",name:"Compound",family:"groq",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-09-04",last_updated:"2025-09-04",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:131072,output:8192}},"groq/compound-mini":{id:"groq/compound-mini",name:"Compound Mini",family:"groq",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-09-04",last_updated:"2025-09-04",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:131072,output:8192}},"meta-llama/llama-prompt-guard-2-86m":{id:"meta-llama/llama-prompt-guard-2-86m",name:"Prompt Guard 2 86M",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-05-29",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.04,output:.04},limit:{context:512,output:512},status:"beta"},"meta-llama/llama-prompt-guard-2-22m":{id:"meta-llama/llama-prompt-guard-2-22m",name:"Llama Prompt Guard 2 22M",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-05-29",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.03,output:.03},limit:{context:512,output:512},status:"beta"},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-09-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.3,cache_read:.0375},limit:{context:131072,output:65536}},"openai/gpt-oss-safeguard-20b":{id:"openai/gpt-oss-safeguard-20b",name:"Safety GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-29",last_updated:"2026-06-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.3},limit:{context:131072,output:65536},status:"beta"},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-10-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.15,output:.6,cache_read:.075},limit:{context:131072,output:65536}},"canopylabs/orpheus-v1-english":{id:"canopylabs/orpheus-v1-english",name:"Canopy Labs Orpheus V1 English",family:"canopylabs",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-12-19",last_updated:"2025-12-19",modalities:{input:["text"],output:["audio"]},open_weights:!1,limit:{context:4e3,output:5e4},status:"beta"},"canopylabs/orpheus-arabic-saudi":{id:"canopylabs/orpheus-arabic-saudi",name:"Canopy Labs Orpheus Arabic Saudi",family:"canopylabs",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-12-16",last_updated:"2025-12-16",modalities:{input:["text"],output:["audio"]},open_weights:!1,limit:{context:4e3,output:5e4},status:"beta"}}},"alibaba-cn":{id:"alibaba-cn",env:["DASHSCOPE_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://dashscope.aliyuncs.com/compatible-mode/v1",name:"Alibaba (China)",doc:"https://www.alibabacloud.com/help/en/model-studio/models",models:{"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-05-21",last_updated:"2026-05-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2.5,output:7.5,cache_read:.5,cache_write:3.125},limit:{context:1e6,output:65536}},"qwen2-5-72b-instruct":{id:"qwen2-5-72b-instruct",name:"Qwen2.5 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.574,output:1.721},limit:{context:131072,output:8192}},"deepseek-r1-distill-qwen-7b":{id:"deepseek-r1-distill-qwen-7b",name:"DeepSeek R1 Distill Qwen 7B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.072,output:.144},limit:{context:32768,output:16384}},"qwen3-next-80b-a3b-thinking":{id:"qwen3-next-80b-a3b-thinking",name:"Qwen3-Next 80B-A3B (Thinking)",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:1.434},limit:{context:131072,output:32768}},"deepseek-v3":{id:"deepseek-v3",name:"DeepSeek V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2024-12-01",last_updated:"2024-12-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.287,output:1.147},limit:{context:65536,output:8192}},"qwen2-5-omni-7b":{id:"qwen2-5-omni-7b",name:"Qwen2.5-Omni 7B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-12",last_updated:"2024-12",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!0,cost:{input:.087,output:.345,input_audio:5.448},limit:{context:32768,output:2048}},"qwen-mt-turbo":{id:"qwen-mt-turbo",name:"Qwen-MT Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-01",last_updated:"2025-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.101,output:.28},limit:{context:16384,output:8192}},"deepseek-v3-1":{id:"deepseek-v3-1",name:"DeepSeek V3.1",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.574,output:1.721},limit:{context:131072,output:65536}},"qwen-deep-research":{id:"qwen-deep-research",name:"Qwen Deep Research",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01",last_updated:"2024-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:7.742,output:23.367},limit:{context:1e6,output:32768}},"qwen-vl-max":{id:"qwen-vl-max",name:"Qwen-VL Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-04-08",last_updated:"2025-08-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.23,output:.574},limit:{context:131072,output:8192}},"qwen3-next-80b-a3b-instruct":{id:"qwen3-next-80b-a3b-instruct",name:"Qwen3-Next 80B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:.574},limit:{context:131072,output:32768}},"qwen3-coder-flash":{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.144,output:.574},limit:{context:1e6,output:65536}},"qwen3-14b":{id:"qwen3-14b",name:"Qwen3 14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:.574,reasoning:1.434},limit:{context:131072,output:8192}},"qwen-max":{id:"qwen-max",name:"Qwen Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-04-03",last_updated:"2025-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.345,output:1.377},limit:{context:131072,output:8192}},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,cache_write:.625,context_over_200k:{input:2,output:6,cache_read:.2,cache_write:2.5}},limit:{context:1e6,output:65536}},"moonshot-kimi-k2-instruct":{id:"moonshot-kimi-k2-instruct",name:"Moonshot Kimi K2 Instruct",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.574,output:2.294},limit:{context:131072,output:8192}},"qwen-vl-plus":{id:"qwen-vl-plus",name:"Qwen-VL Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01-25",last_updated:"2025-08-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.115,output:.287},limit:{context:131072,output:8192}},"qwen-omni-turbo-realtime":{id:"qwen-omni-turbo-realtime",name:"Qwen-Omni Turbo Realtime",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-05-08",last_updated:"2025-05-08",modalities:{input:["text","image","audio"],output:["text","audio"]},open_weights:!1,cost:{input:.23,output:.918,input_audio:3.584,output_audio:7.168},limit:{context:32768,output:2048}},"kimi-k2.6":{id:"kimi-k2.6",name:"Moonshot Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.929,output:3.858},limit:{context:262144,output:16384},interleaved:{field:"reasoning_content"}},"qwen-flash":{id:"qwen-flash",name:"Qwen Flash",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.022,output:.216},limit:{context:1e6,output:32768}},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.1,output:3.851,cache_read:.275,cache_write:0},limit:{context:1e6,output:128e3},interleaved:{field:"reasoning_content"}},"qwen-turbo":{id:"qwen-turbo",name:"Qwen Turbo",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-11-01",last_updated:"2025-07-15",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.044,output:.087,reasoning:.431},limit:{context:1e6,output:16384}},"qwen3-vl-30b-a3b":{id:"qwen3-vl-30b-a3b",name:"Qwen3-VL 30B-A3B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.108,output:.431,reasoning:1.076},limit:{context:131072,output:32768}},"qwen-vl-ocr":{id:"qwen-vl-ocr",name:"Qwen-VL OCR",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2024-10-28",last_updated:"2025-04-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.717,output:.717},limit:{context:34096,output:4096}},"tongyi-intent-detect-v3":{id:"tongyi-intent-detect-v3",name:"Tongyi Intent Detect V3",family:"yi",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2024-01",last_updated:"2024-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.058,output:.144},limit:{context:8192,output:1024}},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"kimi-k2-thinking":{id:"kimi-k2-thinking",name:"Moonshot Kimi K2 Thinking",family:"kimi-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.574,output:2.294},limit:{context:262144,output:16384},interleaved:{field:"reasoning_content"}},"qwen3-32b":{id:"qwen3-32b",name:"Qwen3 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.287,output:1.147,reasoning:2.868},limit:{context:131072,output:16384}},"qwq-plus":{id:"qwq-plus",name:"QwQ Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-03-05",last_updated:"2025-03-05",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.23,output:.574},limit:{context:131072,output:8192}},"qwen3.5-flash":{id:"qwen3.5-flash",name:"Qwen3.5 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.172,output:1.72,reasoning:1.72},limit:{context:1e6,output:65536}},"qwen3-vl-plus":{id:"qwen3-vl-plus",name:"Qwen3-VL Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.143353,output:1.433525,reasoning:4.300576},limit:{context:262144,output:32768}},"deepseek-v3-2-exp":{id:"deepseek-v3-2-exp",name:"DeepSeek V3.2 Exp",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.287,output:.431},limit:{context:131072,output:65536}},"qwen2-5-7b-instruct":{id:"qwen2-5-7b-instruct",name:"Qwen2.5 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.072,output:.144},limit:{context:131072,output:8192}},"qwen3-coder-30b-a3b-instruct":{id:"qwen3-coder-30b-a3b-instruct",name:"Qwen3-Coder 30B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.216,output:.861},limit:{context:262144,output:65536}},"qwen2-5-math-7b-instruct":{id:"qwen2-5-math-7b-instruct",name:"Qwen2.5-Math 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:.287},limit:{context:4096,output:3072}},"qwen3.5-397b-a17b":{id:"qwen3.5-397b-a17b",name:"Qwen3.5 397B-A17B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.172,output:1.032,reasoning:1.032},limit:{context:262144,output:65536}},"qwq-32b":{id:"qwq-32b",name:"QwQ 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-12",last_updated:"2024-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.287,output:.861},limit:{context:131072,output:8192}},"deepseek-r1":{id:"deepseek-r1",name:"DeepSeek R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.574,output:2.294},limit:{context:131072,output:16384}},"qwen3-asr-flash":{id:"qwen3-asr-flash",name:"Qwen3-ASR Flash",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-04",release_date:"2025-09-08",last_updated:"2025-09-08",modalities:{input:["audio"],output:["text"]},open_weights:!1,cost:{input:.032,output:.032},limit:{context:53248,output:4096}},"qwen3-omni-flash":{id:"qwen3-omni-flash",name:"Qwen3-Omni Flash",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:.058,output:.23,input_audio:3.584,output_audio:7.168},limit:{context:65536,output:16384}},"deepseek-r1-distill-qwen-1-5b":{id:"deepseek-r1-distill-qwen-1-5b",name:"DeepSeek R1 Distill Qwen 1.5B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:32768,output:16384}},"qwen3.7-flash":{id:"qwen3.7-flash",name:"Qwen3.7 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.02962,output:.1185,cache_read:.002962,cache_write:.03703},limit:{context:1e6,input:991e3,output:65536}},"qwen2-5-vl-72b-instruct":{id:"qwen2-5-vl-72b-instruct",name:"Qwen2.5-VL 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:2.294,output:6.881},limit:{context:131072,output:8192}},"deepseek-r1-0528":{id:"deepseek-r1-0528",name:"DeepSeek R1 0528",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-05-28",last_updated:"2025-05-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.574,output:2.294},limit:{context:131072,output:16384}},"deepseek-r1-distill-qwen-32b":{id:"deepseek-r1-distill-qwen-32b",name:"DeepSeek R1 Distill Qwen 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.287,output:.861},limit:{context:32768,output:16384}},"qwen3-max":{id:"qwen3-max",name:"Qwen3 Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.861,output:3.441},limit:{context:262144,output:65536}},"qwen2-5-coder-32b-instruct":{id:"qwen2-5-coder-32b-instruct",name:"Qwen2.5-Coder 32B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-11",last_updated:"2024-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.287,output:.861},limit:{context:131072,output:8192}},"deepseek-r1-distill-llama-70b":{id:"deepseek-r1-distill-llama-70b",name:"DeepSeek R1 Distill Llama 70B",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.287,output:.861},limit:{context:32768,output:16384}},"qwen2-5-math-72b-instruct":{id:"qwen2-5-math-72b-instruct",name:"Qwen2.5-Math 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.574,output:1.721},limit:{context:4096,output:3072}},"qwen-plus":{id:"qwen-plus",name:"Qwen Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01-25",last_updated:"2025-09-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.115,output:.287,cache_read:.012,cache_write:.144,reasoning:1.147},limit:{context:1e6,output:32768}},"MiniMax-M2.5":{id:"MiniMax-M2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"qwen3-omni-flash-realtime":{id:"qwen3-omni-flash-realtime",name:"Qwen3-Omni Flash Realtime",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image","audio"],output:["text","audio"]},open_weights:!1,cost:{input:.23,output:.918,input_audio:3.584,output_audio:7.168},limit:{context:65536,output:16384}},"qwen2-5-vl-7b-instruct":{id:"qwen2-5-vl-7b-instruct",name:"Qwen2.5-VL 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.287,output:.717},limit:{context:131072,output:8192}},"qwen3.6-flash":{id:"qwen3.6-flash",name:"Qwen3.6 Flash",family:"qwen3.6",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.1875,output:1.125,cache_write:.234375},limit:{context:1e6,output:65536}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.11875,output:.40073,cache_read:.01187,cache_write:.14844},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"qwen2-5-14b-instruct":{id:"qwen2-5-14b-instruct",name:"Qwen2.5 14B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:.431},limit:{context:131072,output:8192}},"qwen-math-turbo":{id:"qwen-math-turbo",name:"Qwen Math Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09-19",last_updated:"2024-09-19",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.287,output:.861},limit:{context:4096,output:3072}},"qwen-plus-character":{id:"qwen-plus-character",name:"Qwen Plus Character",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01",last_updated:"2024-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.115,output:.287},limit:{context:32768,output:4096}},"qwen3.6-max-preview":{id:"qwen3.6-max-preview",name:"Qwen3.6 Max Preview",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-20",last_updated:"2026-04-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.32,output:7.9,cache_read:.132},limit:{context:245800,output:65536}},"glm-5":{id:"glm-5",name:"GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.573,output:2.58},limit:{context:202752,output:16384},interleaved:{field:"reasoning_content"}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-03",last_updated:"2026-08-03",modalities:{input:["text","image","video","pdf"],output:["text"]},open_weights:!1,cost:{input:1.77744,output:5.33231,cache_read:.22218,cache_write:2.22179},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"kimi-k2.5":{id:"kimi-k2.5",name:"Moonshot Kimi K2.5",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.574,output:2.411},limit:{context:262144,output:32768},interleaved:{field:"reasoning_content"}},"qwen3-8b":{id:"qwen3-8b",name:"Qwen3 8B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.072,output:.287,reasoning:.717},limit:{context:131072,output:8192}},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-14",last_updated:"2026-04-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.825,output:3.301,cache_read:.17},limit:{context:202752,output:128e3},interleaved:{field:"reasoning_content"}},"qwen3-235b-a22b":{id:"qwen3-235b-a22b",name:"Qwen3 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.287,output:1.147,reasoning:2.868},limit:{context:131072,output:16384}},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-06-02",last_updated:"2026-06-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,cache_write:.625},limit:{context:1e6,output:64e3}},"qwen-omni-turbo":{id:"qwen-omni-turbo",name:"Qwen-Omni Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-01-19",last_updated:"2025-03-26",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:.058,output:.23,input_audio:3.584,output_audio:7.168},limit:{context:32768,output:2048}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.003625},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"qwen3-coder-480b-a35b-instruct":{id:"qwen3-coder-480b-a35b-instruct",name:"Qwen3-Coder 480B-A35B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.861,output:3.441},limit:{context:262144,output:65536}},"qwen2-5-32b-instruct":{id:"qwen2-5-32b-instruct",name:"Qwen2.5 32B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.287,output:.861},limit:{context:131072,output:8192}},"qwen2-5-coder-7b-instruct":{id:"qwen2-5-coder-7b-instruct",name:"Qwen2.5-Coder 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-11",last_updated:"2024-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.144,output:.287},limit:{context:131072,output:8192}},"qwen-long":{id:"qwen-long",name:"Qwen Long",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-01-25",last_updated:"2025-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.072,output:.287},limit:{context:1e7,output:8192}},"deepseek-r1-distill-llama-8b":{id:"deepseek-r1-distill-llama-8b",name:"DeepSeek R1 Distill Llama 8B",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:32768,output:16384}},"deepseek-r1-distill-qwen-14b":{id:"deepseek-r1-distill-qwen-14b",name:"DeepSeek R1 Distill Qwen 14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.144,output:.431},limit:{context:32768,output:16384}},"qwen3-vl-235b-a22b":{id:"qwen3-vl-235b-a22b",name:"Qwen3-VL 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.286705,output:1.14682,reasoning:2.867051},limit:{context:131072,output:32768}},"qwen3.5-plus":{id:"qwen3.5-plus",name:"Qwen3.5 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.573,output:3.44,reasoning:3.44},limit:{context:1e6,output:65536}},"qwen-math-plus":{id:"qwen-math-plus",name:"Qwen Math Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-08-16",last_updated:"2024-09-19",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.574,output:1.721},limit:{context:4096,output:3072}},"qwen-doc-turbo":{id:"qwen-doc-turbo",name:"Qwen Doc Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01",last_updated:"2024-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.087,output:.144},limit:{context:131072,output:8192}},"qwen-mt-plus":{id:"qwen-mt-plus",name:"Qwen-MT Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-01",last_updated:"2025-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.259,output:.775},limit:{context:16384,output:8192}},"qvq-max":{id:"qvq-max",name:"QVQ Max",family:"qvq",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-03-25",last_updated:"2025-03-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.147,output:4.588},limit:{context:131072,output:8192}},"MiniMax/MiniMax-M2.7":{id:"MiniMax/MiniMax-M2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}},"siliconflow/deepseek-r1-0528":{id:"siliconflow/deepseek-r1-0528",name:"siliconflow/deepseek-r1-0528",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-05-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:2.18},limit:{context:163840,output:32768}},"siliconflow/deepseek-v3.2":{id:"siliconflow/deepseek-v3.2",name:"siliconflow/deepseek-v3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-03",last_updated:"2025-12-03",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:.42},limit:{context:163840,output:65536}},"siliconflow/deepseek-v3.1-terminus":{id:"siliconflow/deepseek-v3.1-terminus",name:"siliconflow/deepseek-v3.1-terminus",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-29",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:1},limit:{context:163840,output:65536}},"siliconflow/deepseek-v3-0324":{id:"siliconflow/deepseek-v3-0324",name:"siliconflow/deepseek-v3-0324",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-12-26",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:163840,output:163840}},"kimi/kimi-k2.5":{id:"kimi/kimi-k2.5",name:"kimi/kimi-k2.5",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.6,output:3,cache_read:.1},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"qwen3-coder-plus":{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:5},limit:{context:1048576,output:65536}}}},"xiaomi-token-plan-ams":{id:"xiaomi-token-plan-ams",env:["XIAOMI_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://token-plan-ams.xiaomimimo.com/v1",name:"Xiaomi Token Plan (Europe)",doc:"https://platform.xiaomimimo.com/#/docs",models:{"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","audio","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2-pro":{id:"mimo-v2-pro",name:"MiMo-V2-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2.5-tts-voicedesign":{id:"mimo-v2.5-tts-voicedesign",name:"MiMo-V2.5-TTS-VoiceDesign",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2-tts":{id:"mimo-v2-tts",name:"MiMo-V2-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts-voiceclone":{id:"mimo-v2.5-tts-voiceclone",name:"MiMo-V2.5-TTS-VoiceClone",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts":{id:"mimo-v2.5-tts",name:"MiMo-V2.5-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}}}},xiaomi:{id:"xiaomi",env:["XIAOMI_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.xiaomimimo.com/v1",name:"Xiaomi",doc:"https://platform.xiaomimimo.com/#/docs",models:{"mimo-v2.5-pro-ultraspeed":{id:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-06-08",last_updated:"2026-06-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.305,output:2.61,cache_read:.0108},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"},status:"beta"},"mimo-v2-flash":{id:"mimo-v2-flash",name:"MiMo-V2-Flash",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12-01",release_date:"2025-12-16",last_updated:"2026-06-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:262144,output:65536},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2-pro":{id:"mimo-v2-pro",name:"MiMo-V2-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-03-18",last_updated:"2026-06-24",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.435,output:.87,cache_read:.0036},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2-omni":{id:"mimo-v2-omni",name:"MiMo-V2-Omni",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-03-18",last_updated:"2026-06-24",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:262144,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-06-24",modalities:{input:["text","image","audio","video"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-06-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.0036},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}}}},huggingface:{id:"huggingface",env:["HF_TOKEN"],npm:"@ai-sdk/openai-compatible",api:"https://router.huggingface.co/v1",name:"Hugging Face",doc:"https://huggingface.co/docs/inference-providers",models:{"stepfun-ai/Step-3.7-Flash":{id:"stepfun-ai/Step-3.7-Flash",name:"Step 3.7 Flash",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2026-03-01",release_date:"2026-05-29",last_updated:"2026-05-29",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.2,output:1.15},limit:{context:262144,output:256e3}},"stepfun-ai/Step-3.5-Flash":{id:"stepfun-ai/Step-3.5-Flash",name:"Step 3.5 Flash",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-01-29",last_updated:"2026-02-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3},limit:{context:262144,output:256e3}},"deepseek-ai/DeepSeek-V3":{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek-V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-12-26",last_updated:"2024-12-26",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.4,output:1.3},limit:{context:64e3,output:8192}},"deepseek-ai/DeepSeek-V4-Flash":{id:"deepseek-ai/DeepSeek-V4-Flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28},limit:{context:1048576,output:384e3}},"deepseek-ai/DeepSeek-V3-0324":{id:"deepseek-ai/DeepSeek-V3-0324",name:"DeepSeek V3 0324",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-03-24",last_updated:"2025-03-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.27,output:1.12},limit:{context:163840,output:163840}},"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp":{id:"deepseek-ai/DeepSeek-V4-Flash-Vision-Exp",name:"DeepSeek V4 Flash Vision Exp",family:"deepseek-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-21",last_updated:"2026-08-21",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.44,output:1.32},limit:{context:1048576,output:384e3}},"deepseek-ai/DeepSeek-V4-Flash-0731":{id:"deepseek-ai/DeepSeek-V4-Flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28},limit:{context:1048576,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/DeepSeek-V3.1":{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek-V3.1",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-21",last_updated:"2025-08-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.27,output:1},limit:{context:131072,output:8192}},"deepseek-ai/DeepSeek-R1-0528":{id:"deepseek-ai/DeepSeek-R1-0528",name:"DeepSeek-R1-0528",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-05",release_date:"2025-05-28",last_updated:"2025-05-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:3,output:5},limit:{context:163840,output:163840}},"deepseek-ai/DeepSeek-V4-Pro-0813":{id:"deepseek-ai/DeepSeek-V4-Pro-0813",name:"DeepSeek V4 Pro 0813",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.32,output:3.96},limit:{context:1e6,output:384e3}},"deepseek-ai/DeepSeek-R1":{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-07",release_date:"2025-01-20",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.5},limit:{context:64e3,output:32768}},"deepseek-ai/DeepSeek-V3.2":{id:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek-V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-07",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.28,output:.4},limit:{context:163840,output:65536}},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.003625},limit:{context:1048576,output:393216},interleaved:{field:"reasoning_content"}},"google/gemma-4-31B-it":{id:"google/gemma-4-31B-it",name:"Gemma 4 31B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.14,output:.4},limit:{context:262144,output:32768}},"google/gemma-4-26B-A4B-it":{id:"google/gemma-4-26B-A4B-it",name:"Gemma 4 26B A4B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.13,output:.4},limit:{context:262144,output:32768}},"zai-org/GLM-4.6V-Flash":{id:"zai-org/GLM-4.6V-Flash",name:"GLM-4.6V-Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:.9},limit:{context:131072,output:32768}},"zai-org/GLM-5.1":{id:"zai-org/GLM-5.1",name:"GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-04-03",last_updated:"2026-04-03",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3.2,cache_read:.2},limit:{context:202752,output:131072},interleaved:{field:"reasoning_content"}},"zai-org/GLM-4.5V":{id:"zai-org/GLM-4.5V",name:"GLM-4.5V",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-08-11",last_updated:"2025-08-11",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:1.8},limit:{context:65536,output:16384}},"zai-org/GLM-4.5":{id:"zai-org/GLM-4.5",name:"GLM-4.5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2},limit:{context:131072,output:98304}},"zai-org/GLM-5.3":{id:"zai-org/GLM-5.3",name:"GLM-5.3",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4},limit:{context:1048576,output:131072}},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"GLM-4.5-Air",family:"glm-air",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.13,output:.85},limit:{context:131072,output:98304}},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4},limit:{context:262144,output:131072}},"zai-org/GLM-4.7-Flash":{id:"zai-org/GLM-4.7-Flash",name:"GLM-4.7-Flash",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-08-08",last_updated:"2025-08-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:2e5,output:128e3},interleaved:{field:"reasoning_content"}},"zai-org/GLM-4.7":{id:"zai-org/GLM-4.7",name:"GLM-4.7",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-12-22",last_updated:"2025-12-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2,cache_read:.11},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"zai-org/GLM-5":{id:"zai-org/GLM-5",name:"GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3.2,cache_read:.2},limit:{context:202752,output:131072},interleaved:{field:"reasoning_content"}},"zai-org/GLM-4.6":{id:"zai-org/GLM-4.6",name:"GLM-4.6",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-30",last_updated:"2025-09-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.55,output:2.2},limit:{context:204800,output:131072}},"zai-org/GLM-5.3-Flash":{id:"zai-org/GLM-5.3-Flash",name:"GLM-5.3-Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.5},limit:{context:1048576,output:131072}},"thinkingmachines/Inkling-Small":{id:"thinkingmachines/Inkling-Small",name:"Inkling Small",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-07-30",last_updated:"2026-07-30",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.5,output:1.2},limit:{context:524288,output:1048576}},"thinkingmachines/Inkling":{id:"thinkingmachines/Inkling",name:"Inkling",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:1,output:4.05},limit:{context:1048576,output:1048576}},"Qwen/Qwen3.8-27B":{id:"Qwen/Qwen3.8-27B",name:"Qwen3.8 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.4,output:3},limit:{context:262144,output:32768}},"Qwen/Qwen3.5-27B":{id:"Qwen/Qwen3.5-27B",name:"Qwen3.5 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:2.4},limit:{context:262144,output:65536}},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{id:"Qwen/Qwen3-Coder-30B-A3B-Instruct",name:"Qwen3-Coder 30B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.07,output:.26},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.17,output:.25},limit:{context:262144,output:65536}},"Qwen/Qwen3-Coder-Next":{id:"Qwen/Qwen3-Coder-Next",name:"Qwen3-Coder-Next",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-03",last_updated:"2026-02-03",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:1.5},limit:{context:262144,output:65536}},"Qwen/Qwen3-30B-A3B":{id:"Qwen/Qwen3-30B-A3B",name:"Qwen3 30B A3B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-28",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.12,output:.5},limit:{context:40960,output:16384}},"Qwen/Qwen3-235B-A22B":{id:"Qwen/Qwen3-235B-A22B",name:"Qwen3 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.8},limit:{context:40960,output:16384}},"Qwen/Qwen3.5-122B-A10B":{id:"Qwen/Qwen3.5-122B-A10B",name:"Qwen3.5 122B-A10B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.4,output:3.2},limit:{context:262144,output:65536}},"Qwen/Qwen3.8-2.4T-A95B":{id:"Qwen/Qwen3.8-2.4T-A95B",name:"Qwen3.8 2.4T A95B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2.5,output:6.25},limit:{context:262144,output:131072}},"Qwen/Qwen3-235B-A22B-Instruct-2507":{id:"Qwen/Qwen3-235B-A22B-Instruct-2507",name:"Qwen3 235B-A22B Instruct 2507",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-21",last_updated:"2025-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.855,output:2.565},limit:{context:262144,output:16384}},"Qwen/Qwen3-VL-235B-A22B-Instruct":{id:"Qwen/Qwen3-VL-235B-A22B-Instruct",name:"Qwen3 VL 235B A22B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.5},limit:{context:131072,output:32768}},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3-Coder-480B-A35B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2,output:2},limit:{context:262144,output:66536}},"Qwen/Qwen3-Next-80B-A3B-Instruct":{id:"Qwen/Qwen3-Next-80B-A3B-Instruct",name:"Qwen3-Next-80B-A3B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-11",last_updated:"2025-09-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.25,output:1},limit:{context:262144,output:66536}},"Qwen/Qwen3.5-397B-A17B":{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5-397B-A17B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-01",last_updated:"2026-02-01",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:3.6},limit:{context:262144,output:32768},interleaved:{field:"reasoning_content"}},"Qwen/Qwen3.5-35B-A3B":{id:"Qwen/Qwen3.5-35B-A3B",name:"Qwen3.5 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.25,output:2},limit:{context:262144,output:65536}},"Qwen/Qwen3-32B":{id:"Qwen/Qwen3-32B",name:"Qwen3 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.29,output:.59},limit:{context:131072,output:16384}},"Qwen/Qwen3-235B-A22B-Thinking-2507":{id:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen3-235B-A22B-Thinking-2507",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-25",last_updated:"2025-07-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:3},limit:{context:262144,output:131072}},"Qwen/Qwen3.6-27B":{id:"Qwen/Qwen3.6-27B",name:"Qwen3.6 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.47,output:3.19},limit:{context:262144,output:65536}},"Qwen/Qwen3.6-35B-A3B":{id:"Qwen/Qwen3.6-35B-A3B",name:"Qwen3.6 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.95},limit:{context:262144,output:65536}},"Qwen/Qwen3-VL-235B-A22B-Thinking":{id:"Qwen/Qwen3-VL-235B-A22B-Thinking",name:"Qwen3 VL 235B A22B Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.98,output:3.95},limit:{context:131072,output:32768}},"Qwen/Qwen3-Embedding-8B":{id:"Qwen/Qwen3-Embedding-8B",name:"Qwen 3 Embedding 8B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-12",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.01,output:0},limit:{context:32e3,output:4096}},"Qwen/Qwen3-Next-80B-A3B-Thinking":{id:"Qwen/Qwen3-Next-80B-A3B-Thinking",name:"Qwen3-Next-80B-A3B-Thinking",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-11",last_updated:"2025-09-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:2},limit:{context:262144,output:131072}},"Qwen/Qwen3-Embedding-4B":{id:"Qwen/Qwen3-Embedding-4B",name:"Qwen 3 Embedding 4B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-12",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.01,output:0},limit:{context:32e3,output:2048}},"Qwen/Qwen2.5-Coder-32B-Instruct":{id:"Qwen/Qwen2.5-Coder-32B-Instruct",name:"Qwen2.5-Coder-32B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-11-12",last_updated:"2024-11-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.06,output:.2},limit:{context:131072,output:8192}},"MiniMaxAI/MiniMax-M2":{id:"MiniMaxAI/MiniMax-M2",name:"MiniMax-M2",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:204800,output:131072}},"MiniMaxAI/MiniMax-M2.1":{id:"MiniMaxAI/MiniMax-M2.1",name:"MiniMax-M2.1",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-10",release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"MiniMaxAI/MiniMax-M2.5":{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"MiniMaxAI/MiniMax-M3":{id:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-01",last_updated:"2026-06-01",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:524288,output:512e3}},"MiniMaxAI/MiniMax-M2.7":{id:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"meta-llama/Llama-3.1-8B-Instruct":{id:"meta-llama/Llama-3.1-8B-Instruct",name:"Llama-3.1-8B-Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.06,output:.06},limit:{context:131072,output:4096}},"meta-llama/Llama-3.3-70B-Instruct":{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama-3.3-70B-Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2024-12-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.59,output:.79},limit:{context:131072,output:4096}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.5},limit:{context:131072,output:32768}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.25,output:.69},limit:{context:131072,output:32768}},"moonshotai/Kimi-K2-Thinking":{id:"moonshotai/Kimi-K2-Thinking",name:"Kimi-K2-Thinking",family:"kimi-thinking",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.5,cache_read:.15},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"moonshotai/Kimi-K2-Instruct-0905":{id:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi-K2-Instruct-0905",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-10",release_date:"2025-09-04",last_updated:"2025-09-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3},limit:{context:262144,output:16384}},"moonshotai/Kimi-K2-Instruct":{id:"moonshotai/Kimi-K2-Instruct",name:"Kimi-K2-Instruct",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-10",release_date:"2025-07-14",last_updated:"2025-07-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3},limit:{context:131072,output:16384}},"moonshotai/Kimi-K2.5":{id:"moonshotai/Kimi-K2.5",name:"Kimi-K2.5",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-01-01",last_updated:"2026-01-01",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.6,output:3,cache_read:.1},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"moonshotai/Kimi-K2.7-Code":{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4},limit:{context:262144,output:262144}},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"Kimi-K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-20",last_updated:"2026-04-20",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"moonshotai/Kimi-K3":{id:"moonshotai/Kimi-K3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:3,output:15},limit:{context:1e6,output:131072}},"tencent/Hy3":{id:"tencent/Hy3",name:"Hy3",family:"Hy",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-06",last_updated:"2026-07-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.58},limit:{context:262144,input:192e3,output:128e3}},"XiaomiMiMo/MiMo-V2.5-Pro":{id:"XiaomiMiMo/MiMo-V2.5-Pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3},limit:{context:1048576,output:131072}},"XiaomiMiMo/MiMo-V2.5":{id:"XiaomiMiMo/MiMo-V2.5",name:"MiMo-V2.5",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.4,output:2},limit:{context:262144,output:131072}},"XiaomiMiMo/MiMo-V2-Flash":{id:"XiaomiMiMo/MiMo-V2-Flash",name:"MiMo-V2-Flash",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2025-12-16",last_updated:"2025-12-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3},limit:{context:262144,output:4096}}}},minimax:{id:"minimax",env:["MINIMAX_API_KEY"],npm:"@ai-sdk/anthropic",api:"https://api.minimax.io/anthropic/v1",name:"MiniMax (minimax.io)",doc:"https://platform.minimax.io/docs/guides/quickstart",models:{"MiniMax-M2":{id:"MiniMax-M2",name:"MiniMax-M2",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:204800,output:131072}},"MiniMax-M2.1":{id:"MiniMax-M2.1",name:"MiniMax-M2.1",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.5":{id:"MiniMax-M2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.5-highspeed":{id:"MiniMax-M2.5-highspeed",name:"MiniMax-M2.5-highspeed",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-13",last_updated:"2026-02-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.4,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M3":{id:"MiniMax-M3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-06-01",last_updated:"2026-06-25",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06,context_over_200k:{input:.6,output:2.4,cache_read:.12}},limit:{context:1048576,output:512e3}},"MiniMax-M2.7-highspeed":{id:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.4,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.7":{id:"MiniMax-M2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}}}},alibaba:{id:"alibaba",env:["DASHSCOPE_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",name:"Alibaba",doc:"https://www.alibabacloud.com/help/en/model-studio/models",models:{"qwen3.7-max":{id:"qwen3.7-max",name:"Qwen3.7 Max",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-05-21",last_updated:"2026-05-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2.5,output:7.5,cache_read:.5,cache_write:3.125},limit:{context:1e6,output:65536}},"qwen2-5-72b-instruct":{id:"qwen2-5-72b-instruct",name:"Qwen2.5 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:5.6},limit:{context:131072,output:8192}},"deepseek-v4-flash-0731":{id:"deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.4,cache_read:.04},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"qwen3-coder-plus":{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:5},limit:{context:1048576,output:65536}},"qwen3-next-80b-a3b-thinking":{id:"qwen3-next-80b-a3b-thinking",name:"Qwen3-Next 80B-A3B (Thinking)",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:6},limit:{context:131072,output:32768}},"qwen2-5-omni-7b":{id:"qwen2-5-omni-7b",name:"Qwen2.5-Omni 7B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-12",last_updated:"2024-12",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!0,cost:{input:.1,output:.4,input_audio:6.76},limit:{context:32768,output:2048}},"qwen-mt-turbo":{id:"qwen-mt-turbo",name:"Qwen-MT Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-01",last_updated:"2025-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.16,output:.49},limit:{context:16384,output:8192}},"qwen-vl-max":{id:"qwen-vl-max",name:"Qwen-VL Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-04-08",last_updated:"2025-08-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.8,output:3.2},limit:{context:131072,output:8192}},"qwen3-next-80b-a3b-instruct":{id:"qwen3-next-80b-a3b-instruct",name:"Qwen3-Next 80B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:2},limit:{context:131072,output:32768}},"qwen3-coder-flash":{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.5},limit:{context:1e6,output:65536}},"qwen3-14b":{id:"qwen3-14b",name:"Qwen3 14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.35,output:1.4,reasoning:4.2},limit:{context:131072,output:8192}},"qwen-max":{id:"qwen-max",name:"Qwen Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-04-03",last_updated:"2025-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.6,output:6.4},limit:{context:32768,output:8192}},"qwen3.6-plus":{id:"qwen3.6-plus",name:"Qwen3.6 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,cache_write:.625,context_over_200k:{input:2,output:6,cache_read:.2,cache_write:2.5}},limit:{context:1e6,output:65536}},"qwen-vl-plus":{id:"qwen-vl-plus",name:"Qwen-VL Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01-25",last_updated:"2025-08-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.21,output:.63},limit:{context:131072,output:8192}},"qwen-omni-turbo-realtime":{id:"qwen-omni-turbo-realtime",name:"Qwen-Omni Turbo Realtime",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-05-08",last_updated:"2025-05-08",modalities:{input:["text","image","audio"],output:["text","audio"]},open_weights:!1,cost:{input:.27,output:1.07,input_audio:4.44,output_audio:8.89},limit:{context:32768,output:2048}},"qwen3.5-27b":{id:"qwen3.5-27b",name:"Qwen3.5 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.3,output:2.4},limit:{context:262144,output:65536}},"qwen3.5-35b-a3b":{id:"qwen3.5-35b-a3b",name:"Qwen3.5 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.25,output:2},limit:{context:262144,output:65536}},"qwen-flash":{id:"qwen-flash",name:"Qwen Flash",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.4},limit:{context:1e6,output:32768}},"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.28,cache_write:0},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"qwen-turbo":{id:"qwen-turbo",name:"Qwen Turbo",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-11-01",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.2,reasoning:.5},limit:{context:1e6,output:16384}},"qwen3-livetranslate-flash-realtime":{id:"qwen3-livetranslate-flash-realtime",name:"Qwen3-LiveTranslate Flash Realtime",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-09-22",last_updated:"2025-09-22",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:10,output:10,input_audio:10,output_audio:38},limit:{context:53248,output:4096}},"qwen3-vl-30b-a3b":{id:"qwen3-vl-30b-a3b",name:"Qwen3-VL 30B-A3B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:.8,reasoning:2.4},limit:{context:131072,output:32768}},"qwen-vl-ocr":{id:"qwen-vl-ocr",name:"Qwen-VL OCR",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2024-10-28",last_updated:"2025-04-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.72,output:.72},limit:{context:34096,output:4096}},"qwen3-32b":{id:"qwen3-32b",name:"Qwen3 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.8,reasoning:8.4},limit:{context:131072,output:16384}},"qwq-plus":{id:"qwq-plus",name:"QwQ Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-03-05",last_updated:"2025-03-05",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.8,output:2.4},limit:{context:131072,output:8192}},"qwen3-vl-plus":{id:"qwen3-vl-plus",name:"Qwen3-VL Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.6,reasoning:4.8},limit:{context:262144,output:32768}},"qwen2-5-7b-instruct":{id:"qwen2-5-7b-instruct",name:"Qwen2.5 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.175,output:.7},limit:{context:131072,output:8192}},"qwen3-coder-30b-a3b-instruct":{id:"qwen3-coder-30b-a3b-instruct",name:"Qwen3-Coder 30B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.45,output:2.25},limit:{context:262144,output:65536}},"qwen3.5-397b-a17b":{id:"qwen3.5-397b-a17b",name:"Qwen3.5 397B-A17B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-15",last_updated:"2026-02-15",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.6,output:3.6},limit:{context:262144,output:65536}},"qwen3.6-27b":{id:"qwen3.6-27b",name:"Qwen3.6 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.6,output:3.6},limit:{context:262144,output:65536}},"qwen3-asr-flash":{id:"qwen3-asr-flash",name:"Qwen3-ASR Flash",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-04",release_date:"2025-09-08",last_updated:"2025-09-08",modalities:{input:["audio"],output:["text"]},open_weights:!1,cost:{input:.035,output:.035},limit:{context:53248,output:4096}},"qwen3-omni-flash":{id:"qwen3-omni-flash",name:"Qwen3-Omni Flash",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:.43,output:1.66,input_audio:3.81,output_audio:15.11},limit:{context:65536,output:16384}},"qwen2-5-vl-72b-instruct":{id:"qwen2-5-vl-72b-instruct",name:"Qwen2.5-VL 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:2.8,output:8.4},limit:{context:131072,output:8192}},"qwen3.6-35b-a3b":{id:"qwen3.6-35b-a3b",name:"Qwen3.6 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.248,output:1.485},limit:{context:262144,output:65536}},"qwen3-max":{id:"qwen3-max",name:"Qwen3 Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.2,output:6},limit:{context:262144,output:65536}},"qwen-plus":{id:"qwen-plus",name:"Qwen Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01-25",last_updated:"2025-09-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.4,output:1.2,reasoning:4},limit:{context:1e6,output:32768}},"qwen3.5-122b-a10b":{id:"qwen3.5-122b-a10b",name:"Qwen3.5 122B-A10B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:.4,output:3.2},limit:{context:262144,output:65536}},"qwen3-omni-flash-realtime":{id:"qwen3-omni-flash-realtime",name:"Qwen3-Omni Flash Realtime",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:.52,output:1.99,input_audio:4.57,output_audio:18.13},limit:{context:65536,output:16384}},"qwen2-5-vl-7b-instruct":{id:"qwen2-5-vl-7b-instruct",name:"Qwen2.5-VL 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.35,output:1.05},limit:{context:131072,output:8192}},"qwen3.6-flash":{id:"qwen3.6-flash",name:"Qwen3.6 Flash",family:"qwen3.6",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.1875,output:1.125,cache_write:.234375},limit:{context:1e6,output:65536}},"qwen3.8-flash":{id:"qwen3.8-flash",name:"Qwen3.8 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.15,output:.47,cache_read:.016,cache_write:.2},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"qwen2-5-14b-instruct":{id:"qwen2-5-14b-instruct",name:"Qwen2.5 14B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.35,output:1.4},limit:{context:131072,output:8192}},"qwen3.6-max-preview":{id:"qwen3.6-max-preview",name:"Qwen3.6 Max Preview",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-20",last_updated:"2026-04-20",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.3,output:7.8,cache_read:.13,cache_write:1.625},limit:{context:262144,output:65536}},"qwen-plus-character-ja":{id:"qwen-plus-character-ja",name:"Qwen Plus Character (Japanese)",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01",last_updated:"2024-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:1.4},limit:{context:8192,output:512}},"qwen3.8-max":{id:"qwen3.8-max",name:"Qwen3.8 Max",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-03",last_updated:"2026-08-03",modalities:{input:["text","image","video","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.25,cache_write:2.5},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"qwen3-8b":{id:"qwen3-8b",name:"Qwen3 8B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.18,output:.7,reasoning:2.1},limit:{context:131072,output:8192}},"qwen3-235b-a22b":{id:"qwen3-235b-a22b",name:"Qwen3 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.8,reasoning:8.4},limit:{context:131072,output:16384}},"qwen3.7-plus":{id:"qwen3.7-plus",name:"Qwen3.7 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-06-02",last_updated:"2026-06-04",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,cache_write:.625,context_over_200k:{input:2,output:6,cache_read:.2,cache_write:2.5}},limit:{context:1e6,output:65536}},"qwen-omni-turbo":{id:"qwen-omni-turbo",name:"Qwen-Omni Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-01-19",last_updated:"2025-03-26",modalities:{input:["text","image","audio","video"],output:["text","audio"]},open_weights:!1,cost:{input:.07,output:.27,input_audio:4.44,output_audio:8.89},limit:{context:32768,output:2048}},"qwen3-coder-480b-a35b-instruct":{id:"qwen3-coder-480b-a35b-instruct",name:"Qwen3-Coder 480B-A35B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.5,output:7.5},limit:{context:262144,output:65536}},"qwen2-5-32b-instruct":{id:"qwen2-5-32b-instruct",name:"Qwen2.5 32B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-09",last_updated:"2024-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.8},limit:{context:131072,output:8192}},"qwen3-vl-235b-a22b":{id:"qwen3-vl-235b-a22b",name:"Qwen3-VL 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.8,reasoning:8.4},limit:{context:131072,output:32768}},"qwen3.5-plus":{id:"qwen3.5-plus",name:"Qwen3.5 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.4,output:2.4,reasoning:2.4},limit:{context:1e6,output:65536}},"qwen-mt-plus":{id:"qwen-mt-plus",name:"Qwen-MT Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-01",last_updated:"2025-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2.46,output:7.37},limit:{context:16384,output:8192}},"qvq-max":{id:"qvq-max",name:"QVQ Max",family:"qvq",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-03-25",last_updated:"2025-03-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.2,output:4.8},limit:{context:131072,output:8192}}}},nvidia:{id:"nvidia",env:["NVIDIA_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://integrate.api.nvidia.com/v1",name:"Nvidia",doc:"https://docs.api.nvidia.com/nim/",models:{"qwen/qwen3-next-80b-a3b-instruct":{id:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen3-Next-80B-A3B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2024-12-01",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:262144,output:16384}},"qwen/qwen3.5-397b-a17b":{id:"qwen/qwen3.5-397b-a17b",name:"Qwen3.5-397B-A17B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-01",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:8192}},"qwen/qwen3.5-122b-a10b":{id:"qwen/qwen3.5-122b-a10b",name:"Qwen3.5 122B-A10B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:65536}},"qwen/qwen-image":{id:"qwen/qwen-image",name:"Qwen Image",family:"qwen",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["image"]},open_weights:!1,cost:{input:0,output:0},limit:{context:0,output:0}},"qwen/qwen3-coder-480b-a35b-instruct":{id:"qwen/qwen3-coder-480b-a35b-instruct",name:"Qwen3 Coder 480B A35B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:262144,output:66536}},"qwen/qwen-image-edit":{id:"qwen/qwen-image-edit",name:"Qwen Image Edit",family:"qwen",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-08-19",last_updated:"2025-08-19",modalities:{input:["text","image"],output:["image"]},open_weights:!1,cost:{input:0,output:0},limit:{context:0,output:0}},"qwen/qwen2.5-coder-32b-instruct":{id:"qwen/qwen2.5-coder-32b-instruct",name:"Qwen2.5 Coder 32b Instruct",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-11-06",last_updated:"2024-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"stepfun-ai/step-3.7-flash":{id:"stepfun-ai/step-3.7-flash",name:"Step 3.7 Flash",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:16384}},"stepfun-ai/step-3.5-flash":{id:"stepfun-ai/step-3.5-flash",name:"Step 3.5 Flash",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-02",last_updated:"2026-02-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:16384}},"deepseek-ai/deepseek-v4-pro-0813":{id:"deepseek-ai/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/deepseek-v4-flash-0731":{id:"deepseek-ai/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/deepseek-v4-flash":{id:"deepseek-ai/deepseek-v4-flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:1048576,output:393216},interleaved:{field:"reasoning_content"}},"deepseek-ai/deepseek-v4-pro":{id:"deepseek-ai/deepseek-v4-pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.003625},limit:{context:1048576,output:393216},interleaved:{field:"reasoning_content"}},"poolside/laguna-xs-2.1":{id:"poolside/laguna-xs-2.1",name:"Laguna XS 2.1",family:"laguna",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-02",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:16384}},"mistralai/mistral-large-3-675b-instruct-2512":{id:"mistralai/mistral-large-3-675b-instruct-2512",name:"Mistral Large 3 675B Instruct 2512",family:"mistral-large",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:262144}},"mistralai/mistral-nemotron":{id:"mistralai/mistral-nemotron",name:"mistral-nemotron",family:"nemotron",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-06-11",last_updated:"2025-06-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"mistralai/mixtral-8x22b-instruct":{id:"mistralai/mixtral-8x22b-instruct",name:"Mistral: Mixtral 8x22B Instruct",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2024-04-17",last_updated:"2024-04-17",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:65536,output:13108}},"mistralai/ministral-14b-instruct-2512":{id:"mistralai/ministral-14b-instruct-2512",name:"Ministral 3 14B Instruct 2512",family:"ministral",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:16384}},"mistralai/mistral-small-4-119b-2603":{id:"mistralai/mistral-small-4-119b-2603",name:"mistral-small-4-119b-2603",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-16",last_updated:"2026-03-16",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"mistralai/mixtral-8x7b-instruct":{id:"mistralai/mixtral-8x7b-instruct",name:"Mistral: Mixtral 8x7B Instruct",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2023-12-10",last_updated:"2026-03-15",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:16384}},"mistralai/mistral-medium-3.5-128b":{id:"mistralai/mistral-medium-3.5-128b",name:"Mistral Medium 3.5",family:"mistral-medium",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-29",last_updated:"2026-04-29",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:32768}},"mistralai/mistral-7b-instruct-v0.3":{id:"mistralai/mistral-7b-instruct-v0.3",name:"Mistral-7B-Instruct-v0.3",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-01",last_updated:"2025-04-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:65536,output:65536}},"mistralai/mistral-medium-3-instruct":{id:"mistralai/mistral-medium-3-instruct",name:"Mistral Medium 3",family:"mistral-medium",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,release_date:"2025-09-25",last_updated:"2025-09-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:131072,input:131072,output:32768}},"mistralai/magistral-small-2506":{id:"mistralai/magistral-small-2506",name:"Magistral Small 2506",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,release_date:"2025-09-25",last_updated:"2025-09-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:32768,input:32768,output:32768}},"nvidia/streampetr":{id:"nvidia/streampetr",name:"streampetr",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/llama-3.3-nemotron-super-49b-v1.5":{id:"nvidia/llama-3.3-nemotron-super-49b-v1.5",name:"Llama 3.3 Nemotron Super 49B v1.5",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-07-25",last_updated:"2025-07-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:65536}},"nvidia/usdcode":{id:"nvidia/usdcode",name:"usdcode",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2026-01-01",last_updated:"2026-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning":{id:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",name:"Nemotron 3 Nano Omni",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-28",last_updated:"2026-04-28",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:65536}},"nvidia/cosmos-transfer1-7b":{id:"nvidia/cosmos-transfer1-7b",name:"cosmos-transfer1-7b",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-06-13",last_updated:"2025-06-30",modalities:{input:["text","image","video"],output:["video"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/nemotron-voicechat":{id:"nvidia/nemotron-voicechat",name:"nemotron-voicechat",family:"nemotron",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2026-03-16",last_updated:"2026-03-16",modalities:{input:["text","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/studiovoice":{id:"nvidia/studiovoice",name:"studiovoice",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-10-03",last_updated:"2025-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/nemotron-3-content-safety":{id:"nvidia/nemotron-3-content-safety",name:"nemotron-3-content-safety",family:"nemotron",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/cosmos-transfer2_5-2b":{id:"nvidia/cosmos-transfer2_5-2b",name:"cosmos-transfer2.5-2b",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-02-26",last_updated:"2026-02-26",modalities:{input:["text","image","video"],output:["video"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/bevformer":{id:"nvidia/bevformer",name:"bevformer",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-03-18",last_updated:"2025-07-20",modalities:{input:["video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/llama-3.1-nemotron-nano-vl-8b-v1":{id:"nvidia/llama-3.1-nemotron-nano-vl-8b-v1",name:"Llama 3.1 Nemotron Nano VL 8B v1",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-04-10",last_updated:"2025-04-10",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:16384}},"nvidia/magpie-tts-zeroshot":{id:"nvidia/magpie-tts-zeroshot",name:"magpie-tts-zeroshot",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-05-22",last_updated:"2025-06-12",modalities:{input:["text","audio"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/nemotron-nano-12b-v2-vl":{id:"nvidia/nemotron-nano-12b-v2-vl",name:"Nemotron Nano 12B v2 VL",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-10-28",last_updated:"2025-10-28",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:128e3}},"nvidia/sparsedrive":{id:"nvidia/sparsedrive",name:"sparsedrive",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-03-18",last_updated:"2025-07-20",modalities:{input:["video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/llama-nemotron-embed-vl-1b-v2":{id:"nvidia/llama-nemotron-embed-vl-1b-v2",name:"llama-nemotron-embed-vl-1b-v2",family:"nemotron",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-02-10",last_updated:"2026-02-10",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:2048}},"nvidia/synthetic-video-detector":{id:"nvidia/synthetic-video-detector",name:"synthetic-video-detector",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/nemotron-3-super-120b-a12b":{id:"nvidia/nemotron-3-super-120b-a12b",name:"Nemotron 3 Super",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2026-03-11",last_updated:"2026-03-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.8},limit:{context:262144,output:262144}},"nvidia/llama-nemotron-rerank-vl-1b-v2":{id:"nvidia/llama-nemotron-rerank-vl-1b-v2",name:"llama-nemotron-rerank-vl-1b-v2",family:"nemotron",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-03-31",last_updated:"2026-03-31",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/usdvalidate":{id:"nvidia/usdvalidate",name:"usdvalidate",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2024-07-24",last_updated:"2025-01-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/active-speaker-detection":{id:"nvidia/active-speaker-detection",name:"Active Speaker Detection",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/llama-3.1-nemotron-ultra-253b-v1":{id:"nvidia/llama-3.1-nemotron-ultra-253b-v1",name:"Llama 3.1 Nemotron Ultra 253B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-04-07",last_updated:"2025-04-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:16384}},"nvidia/llama-3_2-nemoretriever-300m-embed-v1":{id:"nvidia/llama-3_2-nemoretriever-300m-embed-v1",name:"llama-3_2-nemoretriever-300m-embed-v1",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-07-24",last_updated:"2025-07-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:2048}},"nvidia/nv-embedcode-7b-v1":{id:"nvidia/nv-embedcode-7b-v1",name:"nv-embedcode-7b-v1",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-03-17",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:2048}},"nvidia/llama-3.1-nemotron-safety-guard-8b-v3":{id:"nvidia/llama-3.1-nemotron-safety-guard-8b-v3",name:"llama-3.1-nemotron-safety-guard-8b-v3",family:"nemotron",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-10-28",last_updated:"2025-10-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/nemotron-mini-4b-instruct":{id:"nvidia/nemotron-mini-4b-instruct",name:"nemotron-mini-4b-instruct",family:"nemotron",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2024-08-21",last_updated:"2024-08-26",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/cosmos-predict1-5b":{id:"nvidia/cosmos-predict1-5b",name:"cosmos-predict1-5b",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-03-18",last_updated:"2025-03-18",modalities:{input:["text","image","video"],output:["video"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"nvidia/nemotron-content-safety-reasoning-4b":{id:"nvidia/nemotron-content-safety-reasoning-4b",name:"nemotron-content-safety-reasoning-4b",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!1,temperature:!1,release_date:"2026-01-22",last_updated:"2026-01-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/riva-translate-4b-instruct-v1.1":{id:"nvidia/riva-translate-4b-instruct-v1.1",name:"riva-translate-4b-instruct-v1_1",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-12-12",last_updated:"2025-12-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/nvidia-nemotron-nano-9b-v2":{id:"nvidia/nvidia-nemotron-nano-9b-v2",name:"nvidia-nemotron-nano-9b-v2",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-09",release_date:"2025-08-18",last_updated:"2025-08-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:131072}},"nvidia/gliner-pii":{id:"nvidia/gliner-pii",name:"gliner-pii",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/llama-3.1-nemotron-nano-8b-v1":{id:"nvidia/llama-3.1-nemotron-nano-8b-v1",name:"Llama 3.1 Nemotron Nano 8B v1",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-03-18",last_updated:"2025-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:16384}},"nvidia/nv-embed-v1":{id:"nvidia/nv-embed-v1",name:"nv-embed-v1",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2024-06-07",last_updated:"2025-07-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:2048}},"nvidia/rerank-qa-mistral-4b":{id:"nvidia/rerank-qa-mistral-4b",name:"rerank-qa-mistral-4b",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2024-03-17",last_updated:"2025-01-17",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:2.5,cache_read:.15},limit:{context:1e6,output:65536}},"nvidia/nemotron-3.5-lightning-30b-a3b":{id:"nvidia/nemotron-3.5-lightning-30b-a3b",name:"Nemotron 3.5 Lightning 30B A3B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-11",last_updated:"2026-08-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:262144}},"nvidia/llama-3.3-nemotron-super-49b-v1":{id:"nvidia/llama-3.3-nemotron-super-49b-v1",name:"Llama 3.3 Nemotron Super 49B v1",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-04-07",last_updated:"2025-04-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:65536}},"nvidia/nemotron-3-nano-30b-a3b":{id:"nvidia/nemotron-3-nano-30b-a3b",name:"nemotron-3-nano-30b-a3b",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-09",release_date:"2024-12",last_updated:"2024-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:131072}},"nvidia/llama-3.1-nemotron-70b-instruct":{id:"nvidia/llama-3.1-nemotron-70b-instruct",name:"Llama 3.1 Nemotron 70B Instruct",family:"nemotron",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-04-15",last_updated:"2025-04-15",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/cosmos-reason2-8b":{id:"nvidia/cosmos-reason2-8b",name:"Cosmos Reason2 8B",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:16384}},"google/gemma-3-4b-it":{id:"google/gemma-3-4b-it",name:"Gemma 3 4B IT",family:"gemma",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-03-12",last_updated:"2025-03-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:16384}},"google/gemma-3n-e2b-it":{id:"google/gemma-3n-e2b-it",name:"Gemma 3n E2b It",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06",release_date:"2025-06-12",last_updated:"2025-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"google/google-paligemma":{id:"google/google-paligemma",name:"paligemma",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-05-14",last_updated:"2024-08-26",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"google/gemma-2-2b-it":{id:"google/gemma-2-2b-it",name:"Gemma 2 2b It",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-07-16",last_updated:"2024-07-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"google/gemma-4-31b-it":{id:"google/gemma-4-31b-it",name:"Gemma-4-31B-IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:16384}},"google/gemma-3n-e4b-it":{id:"google/gemma-3n-e4b-it",name:"Gemma 3n E4b It",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06",release_date:"2025-06-03",last_updated:"2025-06-03",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"google/gemma-3-12b-it":{id:"google/gemma-3-12b-it",name:"Gemma 3 12B IT",family:"gemma",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-03-12",last_updated:"2025-03-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:16384}},"thinkingmachines/inkling":{id:"thinkingmachines/inkling",name:"Inkling",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1048576,output:16384}},"meta/llama-3.1-8b-instruct":{id:"meta/llama-3.1-8b-instruct",name:"Llama 3.1 8B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:16e3,output:4096}},"meta/llama-guard-4-12b":{id:"meta/llama-guard-4-12b",name:"Llama Guard 4 12B",family:"llama",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2025-04-05",last_updated:"2026-04-30",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:16384}},"meta/llama-3.2-90b-vision-instruct":{id:"meta/llama-3.2-90b-vision-instruct",name:"Llama-3.2-90B-Vision-Instruct",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"meta/llama-3.2-3b-instruct":{id:"meta/llama-3.2-3b-instruct",name:"Llama 3.2 3B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2024-09-18",last_updated:"2024-09-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:32768,output:32e3}},"meta/llama-3.2-1b-instruct":{id:"meta/llama-3.2-1b-instruct",name:"Llama 3.2 1b Instruct",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-09-18",last_updated:"2024-09-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"meta/esmfold":{id:"meta/esmfold",name:"esmfold",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-03-15",last_updated:"2025-06-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"meta/llama-4-maverick-17b-128e-instruct":{id:"meta/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick 17b 128e Instruct",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-02",release_date:"2025-04-01",last_updated:"2025-04-01",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"meta/muse-glimmer-30b":{id:"meta/muse-glimmer-30b",name:"Muse Glimmer 30B",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-01-04",release_date:"2026-08-10",last_updated:"2026-08-10",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:131072},interleaved:{field:"reasoning_content"}},"meta/esm2-650m":{id:"meta/esm2-650m",name:"esm2-650m",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-08-29",last_updated:"2025-03-10",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"meta/llama-3.2-11b-vision-instruct":{id:"meta/llama-3.2-11b-vision-instruct",name:"Llama 3.2 11b Vision Instruct",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-09-18",last_updated:"2024-09-18",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"meta/llama-3.1-70b-instruct":{id:"meta/llama-3.1-70b-instruct",name:"Llama 3.1 70b Instruct",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-07-16",last_updated:"2024-07-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"meta/llama-3.3-70b-instruct":{id:"meta/llama-3.3-70b-instruct",name:"Llama 3.3 70b Instruct",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-11-26",last_updated:"2024-11-26",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:4096}},"bytedance/seed-oss-36b-instruct":{id:"bytedance/seed-oss-36b-instruct",name:"ByteDance-Seed/Seed-OSS-36B-Instruct",family:"seed",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-04",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:262e3,output:262e3}},"sarvamai/sarvam-m":{id:"sarvamai/sarvam-m",name:"sarvam-m",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-07-25",last_updated:"2025-07-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"microsoft/phi-4-multimodal-instruct":{id:"microsoft/phi-4-multimodal-instruct",name:"Phi 4 Multimodal",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,release_date:"2025-07-26",last_updated:"2025-07-26",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:128e3,input:128e3,output:16384}},"microsoft/phi-4-mini-instruct":{id:"microsoft/phi-4-mini-instruct",name:"Phi-4-Mini",family:"phi",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2024-12-01",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:8192}},"minimaxai/minimax-m2.7":{id:"minimaxai/minimax-m2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-04-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:204800,output:131072}},"minimaxai/minimax-m3":{id:"minimaxai/minimax-m3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-06-01",last_updated:"2026-06-01",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:16384}},"baai/bge-m3":{id:"baai/bge-m3",name:"BGE M3",family:"bge",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2024-01-30",last_updated:"2026-04-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:1024}},"abacusai/dracarys-llama-3.1-70b-instruct":{id:"abacusai/dracarys-llama-3.1-70b-instruct",name:"dracarys-llama-3.1-70b-instruct",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2024-09-11",last_updated:"2025-05-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:131072,output:32768}},"openai/whisper-large-v3":{id:"openai/whisper-large-v3",name:"Whisper Large v3",family:"whisper",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2023-09",release_date:"2023-09-01",last_updated:"2025-09-05",modalities:{input:["audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:0,output:4096}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT-OSS-120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08",release_date:"2025-08-04",last_updated:"2025-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"moonshotai/kimi-k2.6":{id:"moonshotai/kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"},status:"deprecated"},"moonshotai/kimi-k2-instruct-0905":{id:"moonshotai/kimi-k2-instruct-0905",name:"Kimi K2 0905",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-10",release_date:"2025-09-05",last_updated:"2025-09-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:262144},status:"deprecated"},"moonshotai/kimi-k3":{id:"moonshotai/kimi-k3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"upstage/solar-10.7b-instruct":{id:"upstage/solar-10.7b-instruct",name:"solar-10.7b-instruct",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2024-06-05",last_updated:"2025-04-10",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"z-ai/glm-5.2":{id:"z-ai/glm-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"black-forest-labs/flux_1-kontext-dev":{id:"black-forest-labs/flux_1-kontext-dev",name:"FLUX.1-Kontext-dev",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-08-12",last_updated:"2025-08-12",modalities:{input:["text","image"],output:["image"]},open_weights:!0,cost:{input:0,output:0},limit:{context:40960,output:40960}},"black-forest-labs/flux_1-schnell":{id:"black-forest-labs/flux_1-schnell",name:"FLUX.1-schnell",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!1,knowledge:"2024-07",release_date:"2024-08-01",last_updated:"2026-02-04",modalities:{input:["text"],output:["image"]},open_weights:!0,cost:{input:0,output:0},limit:{context:77,input:77,output:0}},"black-forest-labs/flux_2-klein-4b":{id:"black-forest-labs/flux_2-klein-4b",name:"FLUX.2 Klein 4B",family:"flux",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2025-06",release_date:"2026-01-14",last_updated:"2026-01-31",modalities:{input:["image","text"],output:["image"]},open_weights:!0,cost:{input:0,output:0},limit:{context:40960,output:40960}},"black-forest-labs/flux.1-dev":{id:"black-forest-labs/flux.1-dev",name:"FLUX.1-dev",family:"flux",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2024-08",release_date:"2024-08-01",last_updated:"2025-09-05",modalities:{input:["text"],output:["image"]},open_weights:!1,cost:{input:0,output:0},limit:{context:4096,output:0}}}},anthropic:{id:"anthropic",env:["ANTHROPIC_API_KEY"],npm:"@ai-sdk/anthropic",name:"Anthropic",doc:"https://docs.anthropic.com/en/docs/about-claude/models",models:{"claude-sonnet-4-6":{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-02-17",last_updated:"2026-03-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75},limit:{context:1e6,output:128e3}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-05",release_date:"2026-07-24",last_updated:"2026-07-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3},experimental:{modes:{fast:{cost:{input:10,output:50,cache_read:1,cache_write:12.5},provider:{body:{speed:"fast"},headers:{"anthropic-beta":"fast-mode-2026-02-01"}}}}}},"claude-opus-4-5":{id:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2025-11-24",last_updated:"2025-11-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:2e5,output:64e3}},"claude-fable-5-1":{id:"claude-fable-5-1",name:"Claude Fable 5.1",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-06",release_date:"2026-09-01",last_updated:"2026-09-01",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:.25,cache_write:12.5},limit:{context:1e6,output:128e3}},"claude-opus-4-6":{id:"claude-opus-4-6",name:"Claude Opus 4.6",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05-31",release_date:"2026-02-04",last_updated:"2026-03-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3}},"claude-sonnet-4-5-20250929":{id:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-07-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75},limit:{context:1e6,output:64e3}},"claude-opus-4-7":{id:"claude-opus-4-7",name:"Claude Opus 4.7",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-04-14",last_updated:"2026-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3}},"claude-haiku-4-5-20251001":{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",family:"claude-haiku",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-02-28",release_date:"2025-10-15",last_updated:"2025-10-15",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:5,cache_read:.1,cache_write:1.25},limit:{context:2e5,output:64e3}},"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-06-07",last_updated:"2026-06-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5},limit:{context:1e6,output:128e3}},"claude-haiku-4-5":{id:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",family:"claude-haiku",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-02-28",release_date:"2025-10-15",last_updated:"2025-10-15",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:5,cache_read:.1,cache_write:1.25},limit:{context:2e5,output:64e3}},"claude-sonnet-4-5":{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-07-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75},limit:{context:1e6,output:64e3}},"claude-opus-4-8":{id:"claude-opus-4-8",name:"Claude Opus 4.8",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3},experimental:{modes:{fast:{cost:{input:10,output:50,cache_read:1,cache_write:12.5},provider:{body:{speed:"fast"},headers:{"anthropic-beta":"fast-mode-2026-02-01"}}}}}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-29",last_updated:"2026-06-30",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5},limit:{context:1e6,output:128e3}},"claude-opus-4-5-20251101":{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2025-11-24",last_updated:"2025-11-01",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:2e5,output:64e3}}}},google:{id:"google",env:["GOOGLE_API_KEY","GOOGLE_GENERATIVE_AI_API_KEY","GEMINI_API_KEY"],npm:"@ai-sdk/google",name:"Google",doc:"https://ai.google.dev/gemini-api/docs/models",models:{"gemma-4-26b-a4b-it":{id:"gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,limit:{context:262144,output:32768}},"gemini-3.1-pro-preview-customtools":{id:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-19",last_updated:"2026-02-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,context_over_200k:{input:4,output:18,cache_read:.4}},limit:{context:1048576,output:65536}},"gemini-3.1-flash-lite-image":{id:"gemini-3.1-flash-lite-image",name:"Nano Banana 2 Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-06-30",last_updated:"2026-06-30",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:.25,output:30},limit:{context:65536,output:65536}},"lyria-3-clip-preview":{id:"lyria-3-clip-preview",name:"Lyria 3 Clip Preview",family:"lyria",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-03-25",last_updated:"2026-03-25",modalities:{input:["text","image"],output:["text","audio"]},open_weights:!1,cost:{input:0,output:0},limit:{context:1048576,output:65536}},"gemini-2.5-flash-image":{id:"gemini-2.5-flash-image",name:"Nano Banana",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2024-06",release_date:"2025-08-26",last_updated:"2025-08-26",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:.3,output:30,cache_read:.075},limit:{context:32768,output:32768}},"deep-research-max-preview-04-2026":{id:"deep-research-max-preview-04-2026",name:"Deep Research Max Preview (Apr-21-2026)",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video","audio","pdf"],output:["text","image"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,context_over_200k:{input:4,output:18,cache_read:.4}},limit:{context:131072,output:65536}},"gemini-3-pro-image":{id:"gemini-3-pro-image",name:"Nano Banana Pro",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:2,output:120},limit:{context:131072,output:32768}},"gemini-3.1-pro-preview":{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-19",last_updated:"2026-02-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,context_over_200k:{input:4,output:18,cache_read:.4}},limit:{context:1048576,output:65536}},"deep-research-preview-04-2026":{id:"deep-research-preview-04-2026",name:"Deep Research Preview (Apr-21-2026)",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video","audio","pdf"],output:["text","image"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,context_over_200k:{input:4,output:18,cache_read:.4}},limit:{context:131072,output:65536}},"gemini-2.5-flash-lite":{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4,cache_read:.01,input_audio:.3},limit:{context:1048576,output:65536}},"gemini-2.5-computer-use-preview-10-2025":{id:"gemini-2.5-computer-use-preview-10-2025",name:"Gemini 2.5 Computer Use Preview 10-2025",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-10-07",last_updated:"2025-10-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,context_over_200k:{input:2.5,output:15}},limit:{context:131072,output:65536}},"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,input_audio:.75},limit:{context:1048576,output:65536}},"gemini-3.1-flash-lite":{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-07",last_updated:"2026-05-07",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.25,output:1.5,cache_read:.025,input_audio:.5},limit:{context:1048576,output:65536}},"gemini-3.1-flash-live-preview":{id:"gemini-3.1-flash-live-preview",name:"Gemini 3.1 Flash Live Preview",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-03-26",last_updated:"2026-03-26",modalities:{input:["text","image","video","audio"],output:["text","audio"]},open_weights:!1,cost:{input:.75,output:4.5,input_audio:3,output_audio:12},limit:{context:131072,output:65536}},"gemini-2.5-pro-preview-tts":{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro Preview TTS",family:"gemini-flash",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2025-05-01",last_updated:"2025-05-01",modalities:{input:["text"],output:["audio"]},open_weights:!1,cost:{input:1,output:20},limit:{context:8192,output:16384}},"gemini-3.5-flash":{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-19",last_updated:"2026-05-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:1.5,output:9,cache_read:.15,input_audio:1.5},limit:{context:1048576,output:65536}},"veo-3.1-generate-preview":{id:"veo-3.1-generate-preview",name:"Veo 3.1",family:"veo",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-10-15",last_updated:"2026-01",modalities:{input:["text","image"],output:["video"]},open_weights:!1,limit:{context:480,output:8192},status:"beta"},"gemini-3.1-flash-lite-preview":{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.25,output:1.5,cache_read:.025,input_audio:.5},limit:{context:1048576,output:65536},status:"deprecated"},"veo-3.1-fast-generate-preview":{id:"veo-3.1-fast-generate-preview",name:"Veo 3.1 fast",family:"veo",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-10-15",last_updated:"2026-01-01",modalities:{input:["text","image","video"],output:["video"]},open_weights:!1,limit:{context:480,output:8192}},"gemini-2.5-flash-preview-tts":{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash Preview TTS",family:"gemini-flash",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2025-05-01",last_updated:"2025-05-01",modalities:{input:["text"],output:["audio"]},open_weights:!1,cost:{input:.5,output:10},limit:{context:8192,output:16384}},"gemini-embedding-001":{id:"gemini-embedding-001",name:"Gemini Embedding 001",family:"gemini",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2025-05",release_date:"2025-05-20",last_updated:"2025-05-20",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.15,output:0},limit:{context:2048,output:1}},"gemini-3.1-flash-image":{id:"gemini-3.1-flash-image",name:"Nano Banana 2",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image","video","pdf"],output:["text","image"]},open_weights:!1,cost:{input:.5,output:60},limit:{context:65536,output:65536}},"gemini-3.5-flash-lite":{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03},limit:{context:1048576,output:65536}},"gemini-3-pro-image-preview":{id:"gemini-3-pro-image-preview",name:"Nano Banana Pro",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2025-11-20",last_updated:"2025-11-20",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:2,output:120},limit:{context:131072,output:32768}},"gemini-3.1-flash-tts-preview":{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS Preview",family:"gemini-flash",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-04-15",last_updated:"2026-04-15",modalities:{input:["text"],output:["audio"]},open_weights:!1,cost:{input:1,output:20},limit:{context:8192,output:16384}},"veo-3.1-lite-generate-preview":{id:"veo-3.1-lite-generate-preview",name:"Veo 3.1 lite",family:"veo",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-03-31",last_updated:"2026-03-31",modalities:{input:["text","image"],output:["video"]},open_weights:!1,limit:{context:480,output:8192}},"gemini-flash-lite-latest":{id:"gemini-flash-lite-latest",name:"Gemini Flash-Lite Latest",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03},limit:{context:1048576,output:65536}},"gemma-4-31b-it":{id:"gemma-4-31b-it",name:"Gemma 4 31B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,limit:{context:262144,output:32768}},"gemini-embedding-2":{id:"gemini-embedding-2",name:"Gemini Embedding 2",family:"gemini",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2025-11",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:0,input_audio:6.5},limit:{context:8192,output:1}},"gemini-3-flash-preview":{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,input_audio:1},limit:{context:1048576,output:65536}},"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-09-02",last_updated:"2026-09-02",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,input_audio:.75},limit:{context:1048576,output:65536}},"gemini-3.5-live-translate-preview":{id:"gemini-3.5-live-translate-preview",name:"Gemini 3.5 Live Translate Preview",family:"gemini-pro",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-06-09",last_updated:"2026-06-09",modalities:{input:["audio"],output:["audio","text"]},open_weights:!1,cost:{input:3.5,output:21,input_audio:3.5,output_audio:21},limit:{context:16384,output:32768}},"lyria-3-pro-preview":{id:"lyria-3-pro-preview",name:"Lyria 3 Pro Preview",family:"lyria",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-03-25",last_updated:"2026-03-25",modalities:{input:["text","image"],output:["text","audio"]},open_weights:!1,cost:{input:0,output:0},limit:{context:1048576,output:65536}},"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-08-13",last_updated:"2026-08-13",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,input_audio:.75},limit:{context:1048576,output:65536}},"gemini-2.5-pro":{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125,context_over_200k:{input:2.5,output:15,cache_read:.25}},limit:{context:1048576,output:65536}},"gemini-flash-latest":{id:"gemini-flash-latest",name:"Gemini Flash Latest",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-08-13",last_updated:"2026-08-13",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,input_audio:.75},limit:{context:1048576,output:65536}},"gemini-3.1-flash-image-preview":{id:"gemini-3.1-flash-image-preview",name:"Nano Banana 2",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-02-26",last_updated:"2026-02-26",modalities:{input:["text","image","pdf"],output:["text","image"]},open_weights:!1,cost:{input:.5,output:60},limit:{context:65536,output:65536}},"gemini-omni-flash-preview":{id:"gemini-omni-flash-preview",name:"Gemini Omni Flash Preview",family:"gemini",attachment:!0,reasoning:!0,tool_call:!1,temperature:!0,release_date:"2026-06-30",last_updated:"2026-06-30",modalities:{input:["text","image","video"],output:["video"]},open_weights:!1,cost:{input:1.5,output:17.5},limit:{context:131072,output:65536}},"gemini-2.5-flash":{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03,input_audio:1},limit:{context:1048576,output:65536}}}},zhipuai:{id:"zhipuai",env:["ZHIPU_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://open.bigmodel.cn/api/paas/v4",name:"Zhipu AI",doc:"https://docs.z.ai/guides/overview/pricing",models:{"glm-5.2":{id:"glm-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"glm-5.3-flash":{id:"glm-5.3-flash",name:"GLM-5.3-Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video","pdf"],output:["text"]},open_weights:!0,cost:{input:.075,output:.25,cache_read:.015,cache_write:0},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"glm-5":{id:"glm-5",name:"GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3.2,cache_read:.2,cache_write:0},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}},"glm-5.1":{id:"glm-5.1",name:"GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-27",last_updated:"2026-03-27",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:2e5,output:131072},interleaved:{field:"reasoning_content"}},"glm-5.3":{id:"glm-5.3",name:"GLM-5.3",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:1e6,output:131072},interleaved:{field:"reasoning_content"}},"glm-5v-turbo":{id:"glm-5v-turbo",name:"GLM-5V-Turbo",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-04-01",last_updated:"2026-04-01",modalities:{input:["text","image","video","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:22,cache_read:1.2,cache_write:0},limit:{context:2e5,output:131072},interleaved:{field:"reasoning_content"}},"glm-4.7-flash":{id:"glm-4.7-flash",name:"GLM-4.7-Flash",family:"glm-flash",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0,cache_write:0},limit:{context:2e5,output:131072}},"glm-4.7-flashx":{id:"glm-4.7-flashx",name:"GLM-4.7-FlashX",family:"glm-flash",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.07,output:.4,cache_read:.01,cache_write:0},limit:{context:2e5,output:131072}},"glm-4.5v":{id:"glm-4.5v",name:"GLM-4.5V",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-08-11",last_updated:"2025-08-11",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.6,output:1.8},limit:{context:64e3,output:16384}},"glm-4.5":{id:"glm-4.5",name:"GLM-4.5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2,cache_read:.11,cache_write:0},limit:{context:131072,output:98304}},"glm-4.5-flash":{id:"glm-4.5-flash",name:"GLM-4.5-Flash",family:"glm-flash",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0,cache_write:0},limit:{context:131072,output:98304}},"glm-4.6v":{id:"glm-4.6v",name:"GLM-4.6V",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:.9},limit:{context:128e3,output:32768}},"glm-4.6":{id:"glm-4.6",name:"GLM-4.6",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-30",last_updated:"2025-09-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2,cache_read:.11,cache_write:0},limit:{context:204800,output:131072}},"glm-4.5-air":{id:"glm-4.5-air",name:"GLM-4.5-Air",family:"glm-air",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:1.1,cache_read:.03,cache_write:0},limit:{context:131072,output:98304}},"glm-4.7":{id:"glm-4.7",name:"GLM-4.7",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-12-22",last_updated:"2025-12-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2,cache_read:.11,cache_write:0},limit:{context:204800,output:131072},interleaved:{field:"reasoning_content"}}}},azure:{id:"azure",env:["AZURE_RESOURCE_NAME","AZURE_API_KEY"],npm:"@ai-sdk/azure",name:"Azure",doc:"https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models",models:{"claude-sonnet-4-6":{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-02-17",last_updated:"2026-03-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75},limit:{context:1e6,output:64e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.05,output:.4,cache_read:.01},limit:{context:4e5,input:272e3,output:128e3}},"mistral-small-2503":{id:"mistral-small-2503",name:"Mistral Small 3.1",family:"mistral-small",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-09",release_date:"2025-03-01",last_updated:"2025-03-01",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.1,output:.3},limit:{context:128e3,output:32768}},"grok-4-1-fast-non-reasoning":{id:"grok-4-1-fast-non-reasoning",name:"Grok 4.1 Fast (Non-Reasoning)",family:"grok",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2025-06-27",last_updated:"2025-06-27",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:.5,cache_read:.05},limit:{context:128e3,input:128e3,output:8192}},"ministral-3b":{id:"ministral-3b",name:"Ministral 3B",family:"ministral",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-03",release_date:"2024-10-22",last_updated:"2024-10-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.04,output:.04},limit:{context:128e3,output:8192}},"gpt-4.1-nano":{id:"gpt-4.1-nano",name:"GPT-4.1 nano",family:"gpt-nano",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4,cache_read:.025},limit:{context:1047576,output:32768},status:"deprecated"},"gpt-3.5-turbo-1106":{id:"gpt-3.5-turbo-1106",name:"GPT-3.5 Turbo 1106",family:"gpt",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2021-08",release_date:"2023-11-06",last_updated:"2023-11-06",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1,output:2},limit:{context:16384,output:16384},status:"deprecated"},"gpt-5-codex":{id:"gpt-5-codex",name:"GPT-5-Codex",family:"gpt-codex",attachment:!1,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-09-15",last_updated:"2025-09-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.13},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5-pro":{id:"gpt-5-pro",name:"GPT-5 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-10-06",last_updated:"2025-10-06",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:15,output:120},limit:{context:4e5,output:272e3}},"phi-4-mini-reasoning":{id:"phi-4-mini-reasoning",name:"Phi-4-mini-reasoning",family:"phi",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.3},limit:{context:128e3,output:4096}},"codex-mini":{id:"codex-mini",name:"Codex Mini",family:"gpt-codex-mini",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-04",release_date:"2025-05-16",last_updated:"2025-05-16",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.5,output:6,cache_read:.375},limit:{context:2e5,output:1e5},status:"deprecated"},"gpt-5.1-codex-mini":{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",family:"gpt-codex",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-14",last_updated:"2025-11-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.25,output:2,cache_read:.025},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.1-codex":{id:"gpt-5.1-codex",name:"GPT-5.1 Codex",family:"gpt-codex",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-14",last_updated:"2025-11-14",modalities:{input:["text","image","audio"],output:["text","image","audio"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",family:"gpt-sol",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:4,output:20,cache_read:.5,cache_write:6.25,context_over_200k:{input:10,output:45,cache_read:1,cache_write:12.5}},limit:{context:105e4,input:922e3,output:128e3}},"phi-4-reasoning-plus":{id:"phi-4-reasoning-plus",name:"Phi-4-reasoning-plus",family:"phi",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.125,output:.5},limit:{context:32e3,output:4096}},"claude-opus-5":{id:"claude-opus-5",name:"Claude Opus 5",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-05",release_date:"2026-07-24",last_updated:"2026-07-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4},limit:{context:262144,output:262144},interleaved:!0,provider:{npm:"@ai-sdk/openai-compatible",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models",shape:"completions"}},"cohere-command-a":{id:"cohere-command-a",name:"Command A",family:"command-a",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-06-01",release_date:"2025-03-13",last_updated:"2025-03-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2.5,output:10},limit:{context:131072,output:8192}},"gpt-5.2-codex":{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",family:"gpt-codex",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-01-14",last_updated:"2026-01-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"llama-4-maverick-17b-128e-instruct-fp8":{id:"llama-4-maverick-17b-128e-instruct-fp8",name:"Llama 4 Maverick 17B 128E Instruct FP8",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-08",release_date:"2025-04-05",last_updated:"2025-04-05",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.25,output:1},limit:{context:1e6,output:16384}},"cohere-embed-v3-english":{id:"cohere-embed-v3-english",name:"Embed v3 English",family:"cohere-embed",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2023-11-07",last_updated:"2023-11-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:0},limit:{context:512,output:1024}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",family:"gpt-astra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-04-30",release_date:"2026-09-04",last_updated:"2026-09-04",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5,context_over_200k:{input:20,output:75,cache_read:2,cache_write:25}},limit:{context:105e4,input:922e3,output:128e3}},"claude-opus-4-5":{id:"claude-opus-4-5",name:"Claude Opus 4.5",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-11-24",last_updated:"2025-08-01",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:2e5,output:64e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek-V4-Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.19,output:.51},limit:{context:1e6,output:384e3},provider:{npm:"@ai-sdk/openai-compatible",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models",shape:"completions"}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.19},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"},provider:{npm:"@ai-sdk/openai-compatible",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models",shape:"completions"}},"cohere-embed-v-4-0":{id:"cohere-embed-v-4-0",name:"Embed v4",family:"cohere-embed",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-04-15",last_updated:"2025-04-15",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.12,output:0},limit:{context:128e3,output:1536}},"phi-4":{id:"phi-4",name:"Phi-4",family:"phi",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.125,output:.5},limit:{context:128e3,output:4096}},"gpt-4.1-mini":{id:"gpt-4.1-mini",name:"GPT-4.1 mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.4,output:1.6,cache_read:.1},limit:{context:1047576,output:32768},status:"deprecated"},"gpt-3.5-turbo-0125":{id:"gpt-3.5-turbo-0125",name:"GPT-3.5 Turbo 0125",family:"gpt",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2021-08",release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:1.5},limit:{context:16384,output:16384},status:"deprecated"},"phi-4-multimodal":{id:"phi-4-multimodal",name:"Phi-4-multimodal",family:"phi",attachment:!0,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:.08,output:.32,input_audio:4},limit:{context:128e3,output:4096}},"phi-4-mini":{id:"phi-4-mini",name:"Phi-4-mini",family:"phi",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.3},limit:{context:128e3,output:4096}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:15,cache_read:.25,context_over_200k:{input:5,output:22.5,cache_read:.5}},limit:{context:105e4,input:922e3,output:128e3}},"gpt-4-turbo":{id:"gpt-4-turbo",name:"GPT-4 Turbo",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:10,output:30},limit:{context:128e3,output:4096},status:"deprecated"},"grok-4-1-fast-reasoning":{id:"grok-4-1-fast-reasoning",name:"Grok 4.1 Fast (Reasoning)",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-06-27",last_updated:"2025-06-27",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:.5,cache_read:.05},limit:{context:128e3,input:128e3,output:8192}},"claude-fable-5-1":{id:"claude-fable-5-1",name:"Claude Fable 5.1",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-06",release_date:"2026-09-01",last_updated:"2026-09-01",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:.25,cache_write:12.5},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-14",last_updated:"2025-11-14",modalities:{input:["text","image","audio"],output:["text","image","audio"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.1-codex-max":{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,output:128e3}},"claude-opus-4-6":{id:"claude-opus-4-6",name:"Claude Opus 4.6",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-05-31",release_date:"2026-02-05",last_updated:"2026-07-17",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25,context_over_200k:{input:10,output:37.5,cache_read:1,cache_write:12.5}},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"deepseek-r1":{id:"deepseek-r1",name:"DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2024-07",release_date:"2025-01-20",last_updated:"2025-01-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.35,output:5.4},limit:{context:163840,output:163840},status:"deprecated"},o1:{id:"o1",name:"o1",family:"o",attachment:!1,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2023-09",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:15,output:60,cache_read:7.5},limit:{context:2e5,output:1e5},status:"deprecated"},"gpt-4o":{id:"gpt-4o",name:"GPT-4o",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-08-06",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384},status:"deprecated"},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",family:"gpt-luna",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.2,cache_read:.02,cache_write:.25,context_over_200k:{input:.4,output:1.8,cache_read:.04,cache_write:.5}},limit:{context:105e4,input:922e3,output:128e3}},"claude-opus-4-7":{id:"claude-opus-4-7",name:"Claude Opus 4.7",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"deepseek-v3.2":{id:"deepseek-v3.2",name:"DeepSeek-V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-07",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.58,output:1.68},limit:{context:128e3,output:128e3}},"gpt-4-turbo-vision":{id:"gpt-4-turbo-vision",name:"GPT-4 Turbo Vision",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-11",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:10,output:30},limit:{context:128e3,output:4096},status:"deprecated"},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",family:"gpt-codex",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-02-24",last_updated:"2026-02-24",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"llama-4-scout-17b-16e-instruct":{id:"llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-08",release_date:"2025-04-05",last_updated:"2025-04-05",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:.78},limit:{context:128e3,output:8192}},"gpt-4o-mini":{id:"gpt-4o-mini",name:"GPT-4o mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-07-18",last_updated:"2024-07-18",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.15,output:.6,cache_read:.075},limit:{context:128e3,output:16384},status:"deprecated"},"claude-fable-5":{id:"claude-fable-5",name:"Claude Fable 5",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-09",last_updated:"2026-06-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},status:"beta"},"gpt-image-1.5":{id:"gpt-image-1.5",name:"GPT-Image-1.5",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-11-25",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:5,output:32,cache_read:1.25},limit:{context:0,output:0}},"gpt-4.1":{id:"gpt-4.1",name:"GPT-4.1",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:1047576,output:32768},status:"deprecated"},"text-embedding-ada-002":{id:"text-embedding-ada-002",name:"text-embedding-ada-002",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2022-12-15",last_updated:"2022-12-15",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.1,output:0},limit:{context:8192,output:1536}},"gpt-image-1":{id:"gpt-image-1",name:"GPT-Image-1",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-04-24",last_updated:"2025-04-24",modalities:{input:["text","image"],output:["image"]},open_weights:!1,cost:{input:5,output:40,cache_read:1.25},limit:{context:0,output:0}},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.25,cache_read:.02},limit:{context:4e5,input:272e3,output:128e3}},"model-router":{id:"model-router",name:"Model Router",family:"model-router",attachment:!0,reasoning:!1,tool_call:!0,release_date:"2025-05-19",last_updated:"2025-11-18",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.14,output:0},limit:{context:2e5,output:16384}},"gpt-chat-latest":{id:"gpt-chat-latest",name:"GPT Chat Latest",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-05-05",last_updated:"2026-05-28",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5},limit:{context:128e3,input:111616,output:16384},status:"beta"},"cohere-embed-v3-multilingual":{id:"cohere-embed-v3-multilingual",name:"Embed v3 Multilingual",family:"cohere-embed",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2023-11-07",last_updated:"2023-11-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:0},limit:{context:512,output:1024}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:4.5,cache_read:.075},limit:{context:4e5,input:272e3,output:128e3}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-02-01",release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text","image"],output:["text"]},open_weights:!1,limit:{context:2e5,output:128e3},status:"beta"},"deepseek-v3.2-speciale":{id:"deepseek-v3.2-speciale",name:"DeepSeek-V3.2-Speciale",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2024-07",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.58,output:1.68},limit:{context:128e3,output:128e3}},"claude-haiku-4-5":{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",family:"claude-haiku",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-02-28",release_date:"2025-11-18",last_updated:"2025-11-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:5,cache_read:.1,cache_write:1.25},limit:{context:2e5,output:64e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"claude-sonnet-4-5":{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-07-31",release_date:"2025-11-18",last_updated:"2025-11-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75},limit:{context:2e5,output:64e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"claude-opus-4-1":{id:"claude-opus-4-1",name:"Claude Opus 4.1",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-11-18",last_updated:"2025-11-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:75,cache_read:1.5,cache_write:18.75},limit:{context:2e5,output:32e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"gpt-image-2":{id:"gpt-image-2",name:"GPT-Image-2",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image"],output:["image"]},open_weights:!1,cost:{input:5,output:30,cache_read:1.25},limit:{context:0,output:0}},"kimi-k2.5":{id:"kimi-k2.5",name:"Kimi K2.5",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-06",last_updated:"2026-02-06",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:3},limit:{context:262144,output:262144},interleaved:!0,provider:{npm:"@ai-sdk/openai-compatible",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models",shape:"completions"}},"phi-4-reasoning":{id:"phi-4-reasoning",name:"Phi-4-reasoning",family:"phi",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2023-10",release_date:"2024-12-11",last_updated:"2024-12-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.125,output:.5},limit:{context:32e3,output:4096}},"claude-opus-4-8":{id:"claude-opus-4-8",name:"Claude Opus 4.8",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2025-12-31",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25,context_over_200k:{input:10,output:37.5,cache_read:1,cache_write:12.5}},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek-V4-Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.74,output:3.48},limit:{context:1e6,output:384e3},provider:{npm:"@ai-sdk/openai-compatible",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models",shape:"completions"}},"mistral-medium-2505":{id:"mistral-medium-2505",name:"Mistral Medium 3",family:"mistral-medium",attachment:!0,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-05",release_date:"2025-05-07",last_updated:"2025-05-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.4,output:2},limit:{context:128e3,output:128e3}},"text-embedding-3-small":{id:"text-embedding-3-small",name:"text-embedding-3-small",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.02,output:0},limit:{context:8191,output:1536}},"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.25,output:2,cache_read:.03},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:30,output:180,context_over_200k:{input:60,output:270}},limit:{context:105e4,input:922e3,output:128e3}},"text-embedding-3-large":{id:"text-embedding-3-large",name:"text-embedding-3-large",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.13,output:0},limit:{context:8191,output:3072}},"codestral-2501":{id:"codestral-2501",name:"Codestral 25.01",family:"codestral",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-03",release_date:"2025-01-01",last_updated:"2025-01-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:.9},limit:{context:256e3,output:256e3}},"gpt-3.5-turbo-instruct":{id:"gpt-3.5-turbo-instruct",name:"GPT-3.5 Turbo Instruct",family:"gpt",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,knowledge:"2021-08",release_date:"2023-09-21",last_updated:"2023-09-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.5,output:2},limit:{context:4096,output:4096},status:"deprecated"},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",family:"gpt-terra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:18,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3}},"grok-4-20-non-reasoning":{id:"grok-4-20-non-reasoning",name:"Grok 4.20 (Non-Reasoning)",family:"grok",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-09",release_date:"2026-04-08",last_updated:"2026-04-08",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2,output:6},limit:{context:262e3,output:8192},status:"beta"},"gpt-5.2":{id:"gpt-5.2",name:"GPT-5.2",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5":{id:"gpt-5",name:"GPT-5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.13},limit:{context:4e5,input:272e3,output:128e3}},"claude-sonnet-5":{id:"claude-sonnet-5",name:"Claude Sonnet 5",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-30",last_updated:"2026-06-30",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"}},"llama-3.3-70b-instruct":{id:"llama-3.3-70b-instruct",name:"Llama-3.3-70B-Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2024-12-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.71,output:.71},limit:{context:128e3,output:32768}},"grok-4-20-reasoning":{id:"grok-4-20-reasoning",name:"Grok 4.20 (Reasoning)",family:"grok",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-09",release_date:"2026-04-08",last_updated:"2026-04-08",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2,output:6},limit:{context:262e3,output:8192},status:"beta"},"o4-mini":{id:"o4-mini",name:"o4-mini",family:"o-mini",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.275},limit:{context:2e5,output:1e5},status:"deprecated"},"claude-mythos-5":{id:"claude-mythos-5",name:"Claude Mythos 5",family:"claude-mythos",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-09",last_updated:"2026-06-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5},limit:{context:1e6,output:128e3},provider:{npm:"@ai-sdk/anthropic",api:"https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"},status:"beta"},"o3-mini":{id:"o3-mini",name:"o3-mini",family:"o-mini",attachment:!1,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-05",release_date:"2024-12-20",last_updated:"2025-01-29",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.55},limit:{context:2e5,output:1e5},status:"deprecated"},o3:{id:"o3",name:"o3",family:"o",attachment:!0,reasoning:!0,tool_call:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:2e5,output:1e5}},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5,context_over_200k:{input:10,output:45,cache_read:1}},limit:{context:105e4,input:922e3,output:128e3}}}},deepseek:{id:"deepseek",env:["DEEPSEEK_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.deepseek.com",name:"DeepSeek",doc:"https://api-docs.deepseek.com/quick_start/pricing",models:{"deepseek-v4-flash-vision-exp":{id:"deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",family:"deepseek-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-21",last_updated:"2026-08-21",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.14,output:.28,cache_read:.0028,reasoning:.28},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"},status:"beta"},"deepseek-v4-flash":{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028,reasoning:.28},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-v4-pro":{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.003625,reasoning:.87},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}}}},"moonshotai-cn":{id:"moonshotai-cn",env:["MOONSHOT_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.moonshot.cn/v1",name:"Moonshot AI (China)",doc:"https://platform.moonshot.cn/docs/api/chat",models:{"kimi-k3":{id:"kimi-k3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:3,output:15,cache_read:.3},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.19},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"kimi-k2.7-code-highspeed":{id:"kimi-k2.7-code-highspeed",name:"Kimi K2.7 Code HighSpeed",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:1.9,output:8,cache_read:.38},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}}}},openrouter:{id:"openrouter",env:["OPENROUTER_API_KEY"],npm:"@openrouter/ai-sdk-provider",api:"https://openrouter.ai/api/v1",name:"OpenRouter",doc:"https://openrouter.ai/models",models:{"qwen/qwen3.7-max":{id:"qwen/qwen3.7-max",name:"Qwen3.7 Max",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-05-21",last_updated:"2026-05-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.475,output:4.425,cache_read:.295,cache_write:1.84375},limit:{context:1e6,output:131072}},"qwen/qwen3-coder-plus":{id:"qwen/qwen3-coder-plus",name:"Qwen3 Coder Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.65,output:3.25,cache_read:.13,cache_write:.8125},limit:{context:1e6,output:65536}},"qwen/qwen3-next-80b-a3b-thinking":{id:"qwen/qwen3-next-80b-a3b-thinking",name:"Qwen3-Next 80B-A3B (Thinking)",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.15,output:1.2},limit:{context:262144,output:235929}},"qwen/qwen3-235b-a22b-thinking-2507":{id:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen3 235B A22B Thinking 2507",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-06-30",release_date:"2025-07-25",last_updated:"2025-07-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.23,output:2.3},limit:{context:131072,output:117964}},"qwen/qwen3.5-9b":{id:"qwen/qwen3.5-9b",name:"Qwen3.5 9B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.1,output:.15},limit:{context:262144,output:235929}},"qwen/qwen3-next-80b-a3b-instruct":{id:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen3-Next 80B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09",last_updated:"2025-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:1.1,cache_read:.07},limit:{context:262144,output:235929}},"qwen/qwen3-coder-flash":{id:"qwen/qwen3-coder-flash",name:"Qwen3 Coder Flash",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.195,output:.975,cache_read:.039,cache_write:.24375},limit:{context:1e6,output:65536}},"qwen/qwen3-14b":{id:"qwen/qwen3-14b",name:"Qwen3 14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-04-28",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2275,output:.91},limit:{context:131072,output:8192}},"qwen/qwen3.6-plus":{id:"qwen/qwen3.6-plus",name:"Qwen3.6 Plus",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.325,output:1.95,cache_write:.40625,context_over_200k:{input:1.3,output:3.9,cache_write:1.625}},limit:{context:1e6,output:65536}},"qwen/qwen3.5-27b":{id:"qwen/qwen3.5-27b",name:"Qwen3.5 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.195,output:1.56},limit:{context:262144,output:65536}},"qwen/qwen3.8-27b":{id:"qwen/qwen3.8-27b",name:"Qwen3.8 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.42,output:3,cache_read:.085},limit:{context:1e6,output:131072}},"qwen/qwen3.5-35b-a3b":{id:"qwen/qwen3.5-35b-a3b",name:"Qwen3.5 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3125,output:1.25,cache_read:.15625},limit:{context:262144,output:16384}},"qwen/qwen3.5-plus-20260420":{id:"qwen/qwen3.5-plus-20260420",name:"Qwen3.5 Plus 2026-04-20",family:"qwen3.5",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.8,cache_write:.375,context_over_200k:{input:.375,output:2.25,cache_write:.46875}},limit:{context:1e6,output:65536}},"qwen/qwen3-32b":{id:"qwen/qwen3-32b",name:"Qwen3 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.08,output:.28},limit:{context:131072,output:16384}},"qwen/qwen3.5-plus-02-15":{id:"qwen/qwen3.5-plus-02-15",name:"Qwen3.5 Plus 2026-02-15",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-02-16",last_updated:"2026-02-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.26,output:1.56,context_over_200k:{input:.325,output:1.95}},limit:{context:1e6,output:65536}},"qwen/qwen-plus-2025-07-28":{id:"qwen/qwen-plus-2025-07-28",name:"Qwen Plus 0728",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-08",last_updated:"2025-09-08",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.26,output:.78,context_over_200k:{input:.78,output:2.34}},limit:{context:1e6,output:32768}},"qwen/qwen3-coder":{id:"qwen/qwen3-coder",name:"Qwen3 Coder 480B A35B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-06-30",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1,cache_read:.1},limit:{context:262144,output:65536}},"qwen/qwen2.5-vl-72b-instruct":{id:"qwen/qwen2.5-vl-72b-instruct",name:"Qwen2.5 VL 72B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2025-02-01",last_updated:"2025-02-01",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.8,output:1,cache_read:.4},limit:{context:128e3,output:115200}},"qwen/qwen3-coder-next":{id:"qwen/qwen3-coder-next",name:"Qwen3 Coder Next",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-09",release_date:"2026-02-03",last_updated:"2026-02-03",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.12,output:.8,cache_read:.07},limit:{context:262144,output:235929}},"qwen/qwen3-coder-30b-a3b-instruct":{id:"qwen/qwen3-coder-30b-a3b-instruct",name:"Qwen3-Coder 30B-A3B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.07,output:.28},limit:{context:262144,output:235929}},"qwen/qwen3-235b-a22b-2507":{id:"qwen/qwen3-235b-a22b-2507",name:"Qwen3 235B A22B Instruct 2507",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-06-30",release_date:"2025-07-21",last_updated:"2025-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.09,output:.55},limit:{context:262144,output:16384}},"qwen/qwen3.5-flash-02-23":{id:"qwen/qwen3.5-flash-02-23",name:"Qwen3.5-Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-25",last_updated:"2026-02-25",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.065,output:.26},limit:{context:1e6,output:65536}},"qwen/qwen3.5-397b-a17b":{id:"qwen/qwen3.5-397b-a17b",name:"Qwen3.5 397B-A17B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-15",last_updated:"2026-02-15",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.39,output:2.34},limit:{context:262144,output:65536}},"qwen/qwen3-vl-8b-thinking":{id:"qwen/qwen3-vl-8b-thinking",name:"Qwen3 VL 8B Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-14",last_updated:"2025-10-14",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.18,output:2.1},limit:{context:131072,output:32768}},"qwen/qwen3.6-27b":{id:"qwen/qwen3.6-27b",name:"Qwen3.6 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:2,cache_read:.03},limit:{context:262144,output:65536}},"qwen/qwen3.7-flash":{id:"qwen/qwen3.7-flash",name:"Qwen3.7 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.03,output:.13,cache_read:.006,cache_write:.038},limit:{context:1e6,input:991e3,output:65536}},"qwen/qwen3-30b-a3b-thinking-2507":{id:"qwen/qwen3-30b-a3b-thinking-2507",name:"Qwen3 30B A3B Thinking 2507",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-06-30",release_date:"2025-08-28",last_updated:"2025-08-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:2.4},limit:{context:81920,output:32768}},"qwen/qwen3.6-35b-a3b":{id:"qwen/qwen3.6-35b-a3b",name:"Qwen3.6 35B-A3B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.1,output:.9,cache_read:.05},limit:{context:262144,output:235929}},"qwen/qwen3-max-thinking":{id:"qwen/qwen3-max-thinking",name:"Qwen3 Max Thinking",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-09",last_updated:"2026-02-09",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.78,output:3.9},limit:{context:262144,output:65536}},"qwen/qwen3.8-max-0902":{id:"qwen/qwen3.8-max-0902",name:"Qwen3.8 Max 0902",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-09-02",last_updated:"2026-09-02",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.25,cache_write:2.5},limit:{context:1e6,output:131072}},"qwen/qwen3-max":{id:"qwen/qwen3-max",name:"Qwen3 Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.78,output:3.9,cache_read:.156,cache_write:.975},limit:{context:262144,output:65536}},"qwen/qwen3-vl-8b-instruct":{id:"qwen/qwen3-vl-8b-instruct",name:"Qwen3 VL 8B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-14",last_updated:"2025-10-14",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.117,output:.455},limit:{context:262144,output:32768}},"qwen/qwen3.8-2.4t-a95b":{id:"qwen/qwen3.8-2.4t-a95b",name:"Qwen3.8 2.4T A95B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2,output:6,cache_read:.25},limit:{context:1048576,output:262144}},"qwen/qwen3-vl-30b-a3b-instruct":{id:"qwen/qwen3-vl-30b-a3b-instruct",name:"Qwen3 VL 30B A3B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-10-06",last_updated:"2025-10-06",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.6},limit:{context:262144,output:16384}},"qwen/qwen-plus":{id:"qwen/qwen-plus",name:"Qwen Plus",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2024-01-25",last_updated:"2025-09-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.26,output:.78,cache_read:.052,cache_write:.325,context_over_200k:{input:.78,output:2.34,cache_read:.156,cache_write:.975}},limit:{context:1e6,output:32768}},"qwen/qwen3.5-122b-a10b":{id:"qwen/qwen3.5-122b-a10b",name:"Qwen3.5 122B-A10B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.29,output:2.4},limit:{context:262144,output:81920}},"qwen/qwen-2.5-coder-32b-instruct":{id:"qwen/qwen-2.5-coder-32b-instruct",name:"Qwen2.5 Coder 32B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-06-30",release_date:"2024-11-11",last_updated:"2024-11-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.66,output:1},limit:{context:32768,output:29491}},"qwen/qwen3-30b-a3b-instruct-2507":{id:"qwen/qwen3-30b-a3b-instruct-2507",name:"Qwen3 30B A3B Instruct 2507",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-06-30",release_date:"2025-07-29",last_updated:"2025-07-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.04815,output:.19305},limit:{context:262144,output:32e3}},"qwen/qwen3.6-flash":{id:"qwen/qwen3.6-flash",name:"Qwen3.6 Flash",family:"qwen3.6",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.1875,output:1.125,cache_write:.234375,context_over_200k:{input:.75,output:3,cache_write:.9375}},limit:{context:1e6,output:65536}},"qwen/qwen3-30b-a3b":{id:"qwen/qwen3-30b-a3b",name:"Qwen3 30B A3B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-28",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.12,output:.5},limit:{context:131072,output:16384}},"qwen/qwen-2.5-7b-instruct":{id:"qwen/qwen-2.5-7b-instruct",name:"Qwen2.5 7B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2024-10-16",last_updated:"2024-10-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.2},limit:{context:32768,output:29491}},"qwen/qwen3.8-flash":{id:"qwen/qwen3.8-flash",name:"Qwen3.8 Flash",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.15,output:.47,cache_read:.016,cache_write:.2},limit:{context:1e6,output:131072}},"qwen/qwen3-vl-30b-a3b-thinking":{id:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen3 VL 30B A3B Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-10-06",last_updated:"2025-10-06",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:2.4},limit:{context:262144,output:32768}},"qwen/qwen3.6-max-preview":{id:"qwen/qwen3.6-max-preview",name:"Qwen3.6 Max Preview",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-04-20",last_updated:"2026-04-20",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.027,output:6.162,cache_write:1.28375},limit:{context:262144,output:65536}},"qwen/qwen-2.5-72b-instruct":{id:"qwen/qwen-2.5-72b-instruct",name:"Qwen2.5 72B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2024-09-19",last_updated:"2024-09-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.36,output:.4},limit:{context:32768,output:16384}},"qwen/qwen3-8b":{id:"qwen/qwen3-8b",name:"Qwen3 8B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-03-31",release_date:"2025-04-28",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.117,output:.455},limit:{context:131072,output:8192}},"qwen/qwen3-235b-a22b":{id:"qwen/qwen3-235b-a22b",name:"Qwen3 235B-A22B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-04",last_updated:"2025-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.455,output:1.82},limit:{context:131072,output:8192}},"qwen/qwen3-vl-235b-a22b-thinking":{id:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen3 VL 235B A22B Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.4,output:4},limit:{context:131072,output:32768}},"qwen/qwen3-vl-235b-a22b-instruct":{id:"qwen/qwen3-vl-235b-a22b-instruct",name:"Qwen3 VL 235B A22B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.21,output:1.9,cache_read:.1},limit:{context:262144,output:32768}},"qwen/qwen3.7-plus":{id:"qwen/qwen3.7-plus",name:"Qwen3.7 Plus",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-06-02",last_updated:"2026-06-02",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.32,output:1.28,cache_read:.064,cache_write:.4,context_over_200k:{input:.96,output:3.84,cache_read:.192,cache_write:1.2}},limit:{context:1e6,output:131072}},"qwen/qwen3-vl-32b-instruct":{id:"qwen/qwen3-vl-32b-instruct",name:"Qwen3 VL 32B Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-23",last_updated:"2025-10-23",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.104,output:.416},limit:{context:131072,output:32768}},"baidu/ernie-4.5-vl-424b-a47b":{id:"baidu/ernie-4.5-vl-424b-a47b",name:"ERNIE 4.5 VL 424B A47B ",family:"ernie",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2025-03-31",release_date:"2025-06-30",last_updated:"2025-06-30",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.42,output:1.25},limit:{context:123e3,output:16e3}},"aion-labs/aion-2.0":{id:"aion-labs/aion-2.0",name:"Aion-2.0",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.8,output:1.6,cache_read:.2},limit:{context:131072,output:32768}},"aion-labs/aion-rp-llama-3.1-8b":{id:"aion-labs/aion-rp-llama-3.1-8b",name:"Aion-RP 1.0 (8B)",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12-31",release_date:"2025-02-04",last_updated:"2025-02-04",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.8,output:1.6},limit:{context:32768,output:29491}},"aion-labs/aion-3.0":{id:"aion-labs/aion-3.0",name:"Aion-3.0",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-07",last_updated:"2026-07-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:3,output:6,cache_read:.75},limit:{context:131072,output:32768}},"aion-labs/aion-3.0-mini":{id:"aion-labs/aion-3.0-mini",name:"Aion-3.0-Mini",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-07",last_updated:"2026-07-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.7,output:1.4,cache_read:.18},limit:{context:131072,output:32768}},"~anthropic/claude-fable-latest":{id:"~anthropic/claude-fable-latest",name:"Claude Fable Latest",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-06-09",last_updated:"2026-06-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:.25,cache_write:12.5},limit:{context:1e6,output:128e3}},"~anthropic/claude-opus-latest":{id:"~anthropic/claude-opus-latest",name:"Claude Opus Latest",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3}},"~anthropic/claude-haiku-latest":{id:"~anthropic/claude-haiku-latest",name:"Anthropic Claude Haiku Latest",family:"claude-haiku",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:5,cache_read:.1,cache_write:1.25},limit:{context:2e5,output:64e3}},"~anthropic/claude-sonnet-latest":{id:"~anthropic/claude-sonnet-latest",name:"Anthropic Claude Sonnet Latest",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5},limit:{context:1e6,output:128e3}},"morph/morph-v3-large":{id:"morph/morph-v3-large",name:"Morph V3 Large",family:"morph",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2025-07-07",last_updated:"2025-07-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.9,output:1.9},limit:{context:262144,output:131072}},"morph/morph-v3-fast":{id:"morph/morph-v3-fast",name:"Morph V3 Fast",family:"morph",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-07-07",last_updated:"2025-07-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.8,output:1.2},limit:{context:81920,output:38e3}},"undi95/remm-slerp-l2-13b":{id:"undi95/remm-slerp-l2-13b",name:"ReMM SLERP 13B",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-06-30",release_date:"2023-07-22",last_updated:"2023-07-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.35,output:.65},limit:{context:6144,output:5529}},"~deepseek/deepseek-v4-flash-latest":{id:"~deepseek/deepseek-v4-flash-latest",name:"DeepSeek V4 Flash Latest",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-01",last_updated:"2026-08-01",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.16,cache_read:.013},limit:{context:1310720,output:393216}},"dots-studio/dots-3-note-preview:free":{id:"dots-studio/dots-3-note-preview:free",name:"Dots3-Note Preview (free)",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:512e3,output:460800}},"~x-ai/grok-latest":{id:"~x-ai/grok-latest",name:"Grok Latest",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-08",last_updated:"2026-07-08",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.5,context_over_200k:{input:4,output:12,cache_read:1}},limit:{context:5e5,output:45e4}},"meituan/longcat-2.0":{id:"meituan/longcat-2.0",name:"LongCat 2.0",family:"longcat",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-20",last_updated:"2026-07-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.006},limit:{context:1048756,output:262144}},"poolside/laguna-xs-2.1":{id:"poolside/laguna-xs-2.1",name:"Laguna XS 2.1",family:"laguna",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-02",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.06,output:.12,cache_read:.03},limit:{context:262144,output:32768}},"poolside/laguna-xs-2.1:free":{id:"poolside/laguna-xs-2.1:free",name:"Laguna XS 2.1 (free)",family:"laguna",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-02",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:32768}},"poolside/laguna-s-2.1:free":{id:"poolside/laguna-s-2.1:free",name:"Laguna S 2.1 (free)",family:"laguna-s",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:32768}},"poolside/laguna-s-2.1":{id:"poolside/laguna-s-2.1",name:"Laguna S 2.1",family:"laguna-s",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.09,output:.18,cache_read:.009},limit:{context:1048576,output:131072}},"kwaipilot/kat-coder-pro-v2":{id:"kwaipilot/kat-coder-pro-v2",name:"KAT-Coder-Pro V2",family:"kat-coder",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-27",last_updated:"2026-03-27",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:262144,output:144e3}},"kwaipilot/kat-coder-pro-v2.5":{id:"kwaipilot/kat-coder-pro-v2.5",name:"KAT-Coder-Pro V2.5",family:"kat-coder",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-10",last_updated:"2026-07-10",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.74,output:2.96,cache_read:.15},limit:{context:262144,output:235929}},"stepfun/step-3.7-flash":{id:"stepfun/step-3.7-flash",name:"Step 3.7 Flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03-01",release_date:"2026-05-29",last_updated:"2026-05-29",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.2,output:1.15,cache_read:.04},limit:{context:262144,input:256e3,output:230400}},"stepfun/step-3.5-flash":{id:"stepfun/step-3.5-flash",name:"Step 3.5 Flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-01-29",last_updated:"2026-02-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3},limit:{context:262144,output:65536}},"mistralai/ministral-14b-2512":{id:"mistralai/ministral-14b-2512",name:"Ministral 3 14B 2512",family:"ministral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:.2,cache_read:.02},limit:{context:262144,output:209715}},"mistralai/mistral-large":{id:"mistralai/mistral-large",name:"Mistral Large",family:"mistral-large",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-11-30",release_date:"2024-02-26",last_updated:"2024-02-26",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.2},limit:{context:128e3,output:102400}},"mistralai/codestral-2508":{id:"mistralai/codestral-2508",name:"Codestral 2508",family:"codestral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-08-01",last_updated:"2025-08-01",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:.9,cache_read:.03},limit:{context:256e3,output:204800}},"mistralai/mistral-medium-3-5":{id:"mistralai/mistral-medium-3-5",name:"Mistral Medium 3.5",family:"mistral-medium",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-30",last_updated:"2026-04-30",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.5,output:7.5},limit:{context:262144,output:209715}},"mistralai/devstral-2512":{id:"mistralai/devstral-2512",name:"Devstral 2",family:"devstral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-12",release_date:"2025-12-09",last_updated:"2025-12-09",modalities:{input:["text","pdf"],output:["text"]},open_weights:!0,cost:{input:.4,output:2,cache_read:.04},limit:{context:262144,output:209715}},"mistralai/mistral-large-2407":{id:"mistralai/mistral-large-2407",name:"Mistral Large 2407",family:"mistral-large",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-03-31",release_date:"2024-11-19",last_updated:"2024-11-19",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.2},limit:{context:131072,output:104857}},"mistralai/mistral-small-3.2-24b-instruct":{id:"mistralai/mistral-small-3.2-24b-instruct",name:"Mistral Small 3.2 24B",family:"mistral-small",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-10-31",release_date:"2025-06-20",last_updated:"2025-06-20",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.2},limit:{context:131072,output:16384}},"mistralai/mixtral-8x22b-instruct":{id:"mistralai/mixtral-8x22b-instruct",name:"Mixtral 8x22B Instruct",family:"mistral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-01-31",release_date:"2024-04-17",last_updated:"2024-04-17",modalities:{input:["text","pdf"],output:["text"]},open_weights:!0,cost:{input:2,output:6,cache_read:.2},limit:{context:65536,output:52428}},"mistralai/mistral-saba":{id:"mistralai/mistral-saba",name:"Saba",family:"mistral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-09-30",release_date:"2025-02-17",last_updated:"2025-02-17",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:.6,cache_read:.02},limit:{context:32768,output:26214}},"mistralai/mistral-large-2512":{id:"mistralai/mistral-large-2512",name:"Mistral Large 3",family:"mistral-large",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-11",release_date:"2024-11-01",last_updated:"2025-12-02",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!0,cost:{input:.5,output:1.5,cache_read:.05},limit:{context:262144,output:209715}},"mistralai/ministral-3b-2512":{id:"mistralai/ministral-3b-2512",name:"Ministral 3 3B 2512",family:"ministral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.1,output:.1,cache_read:.01},limit:{context:131072,output:104857}},"mistralai/mistral-nemo":{id:"mistralai/mistral-nemo",name:"Mistral Nemo",family:"mistral-nemo",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-07",release_date:"2024-07-01",last_updated:"2024-07-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.019,output:.03},limit:{context:131072,output:16384}},"mistralai/mistral-medium-3":{id:"mistralai/mistral-medium-3",name:"Mistral Medium 3",family:"mistral-medium",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-05-07",last_updated:"2025-05-07",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.4,output:2,cache_read:.04},limit:{context:131072,output:104857}},"mistralai/mistral-small-24b-instruct-2501":{id:"mistralai/mistral-small-24b-instruct-2501",name:"Mistral Small 3",family:"mistral-small",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-10-31",release_date:"2025-01-30",last_updated:"2025-01-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.08},limit:{context:32768,output:16384}},"mistralai/mistral-small-3.1-24b-instruct":{id:"mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B",family:"mistral-small",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-10-31",release_date:"2025-03-17",last_updated:"2025-03-17",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.351,output:.555},limit:{context:128e3,output:102400}},"mistralai/mistral-small-2603":{id:"mistralai/mistral-small-2603",name:"Mistral Small 4",family:"mistral-small",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-06",release_date:"2026-03-16",last_updated:"2026-03-16",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.6,cache_read:.015},limit:{context:262144,output:209715}},"mistralai/ministral-8b-2512":{id:"mistralai/ministral-8b-2512",name:"Ministral 3 8B 2512",family:"ministral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.15,cache_read:.015},limit:{context:262144,output:209715}},"mistralai/voxtral-small-24b-2507":{id:"mistralai/voxtral-small-24b-2507",name:"Voxtral Small 24B 2507",family:"mistral",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-30",last_updated:"2025-10-30",modalities:{input:["text","audio","pdf"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3,cache_read:.01},limit:{context:32768,output:26214}},"mistralai/mistral-medium-3.1":{id:"mistralai/mistral-medium-3.1",name:"Mistral Medium 3.1",family:"mistral-medium",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-06-30",release_date:"2025-08-13",last_updated:"2025-08-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.4,output:2,cache_read:.04},limit:{context:131072,output:104857}},"xiaomi/mimo-v2.5":{id:"xiaomi/mimo-v2.5",name:"MiMo-V2.5",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","audio","video"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.0028},limit:{context:105e4,output:131072},interleaved:{field:"reasoning_details"}},"xiaomi/mimo-v2.5-pro":{id:"xiaomi/mimo-v2.5-pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.435,output:.87,cache_read:.0036},limit:{context:105e4,output:131072},interleaved:{field:"reasoning_content"}},"minimax/minimax-m2.1":{id:"minimax/minimax-m2.1",name:"MiniMax-M2.1",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03},limit:{context:204800,output:131072},interleaved:{field:"reasoning_details"}},"minimax/minimax-m2":{id:"minimax/minimax-m2",name:"MiniMax-M2",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.255,output:1.02},limit:{context:204800,output:131072},interleaved:{field:"reasoning_details"}},"minimax/minimax-m2.7":{id:"minimax/minimax-m2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:204800,output:131072}},"minimax/minimax-m2.5":{id:"minimax/minimax-m2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.27,output:1.08,cache_read:.027},limit:{context:204800,output:128e3},interleaved:{field:"reasoning_details"}},"minimax/minimax-m3":{id:"minimax/minimax-m3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-01",last_updated:"2026-06-01",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:1048576,output:512e3}},"minimax/minimax-m2-her":{id:"minimax/minimax-m2-her",name:"MiniMax-M2 Her",family:"minimax",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-01-23",last_updated:"2026-01-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.2,cache_read:.03},limit:{context:65536,output:2048}},"minimax/minimax-m1":{id:"minimax/minimax-m1",name:"MiniMax M1",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-06-30",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.4,output:2.2},limit:{context:1e6,output:4e4}},"minimax/minimax-01":{id:"minimax/minimax-01",name:"MiniMax-01",family:"minimax",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-03-31",release_date:"2025-01-15",last_updated:"2025-01-15",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:1.1},limit:{context:1000192,output:900172}},"nvidia/nemotron-3.5-lightning:free":{id:"nvidia/nemotron-3.5-lightning:free",name:"Nemotron 3.5 Lightning (free)",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-08-11",last_updated:"2026-08-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:65536}},"nvidia/nemotron-3.5-content-safety":{id:"nvidia/nemotron-3.5-content-safety",name:"Nemotron 3.5 Content Safety",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:.2},limit:{context:131072,output:117964}},"nvidia/nemotron-3.5-lightning":{id:"nvidia/nemotron-3.5-lightning",name:"Nemotron 3.5 Lightning 30B A3B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-11",last_updated:"2026-08-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.08,output:.2,cache_read:.04},limit:{context:262144,output:131072}},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free":{id:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",name:"Nemotron 3 Nano Omni (free)",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-28",last_updated:"2026-04-28",modalities:{input:["text","image","video","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:65536}},"nvidia/nemotron-3-super-120b-a12b":{id:"nvidia/nemotron-3-super-120b-a12b",name:"Nemotron 3 Super 120B A12B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-11",last_updated:"2026-03-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.085,output:.4},limit:{context:1e6,output:16384}},"nvidia/nemotron-3-ultra-550b-a55b:free":{id:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"Nemotron 3 Ultra (free)",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1e6,output:65536}},"nvidia/nemotron-3-super-120b-a12b:free":{id:"nvidia/nemotron-3-super-120b-a12b:free",name:"Nemotron 3 Super (free)",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-11",last_updated:"2026-03-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:235929}},"nvidia/nemotron-3.5-content-safety:free":{id:"nvidia/nemotron-3.5-content-safety:free",name:"Nemotron 3.5 Content Safety (free)",family:"nemotron",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:128e3,output:8192}},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.625,output:3.125,cache_read:.1875},limit:{context:262144,output:32768}},"nvidia/nemotron-3-nano-30b-a3b":{id:"nvidia/nemotron-3-nano-30b-a3b",name:"Nemotron 3 Nano 30B A3B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-15",last_updated:"2025-12-15",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.2,cache_read:.03},limit:{context:262144,output:235929}},"anthropic/claude-opus-4.8":{id:"anthropic/claude-opus-4.8",name:"Claude Opus 4.8",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3}},"anthropic/claude-opus-4.7":{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25,context_over_200k:{input:10,output:37.5,cache_read:1,cache_write:12.5}},limit:{context:1e6,output:128e3}},"anthropic/claude-opus-5":{id:"anthropic/claude-opus-5",name:"Claude Opus 5",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-05",release_date:"2026-07-24",last_updated:"2026-07-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:1e6,output:128e3}},"anthropic/claude-opus-4.1":{id:"anthropic/claude-opus-4.1",name:"Claude Opus 4.1 (latest)",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-03-31",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:75,cache_read:1.5,cache_write:18.75},limit:{context:2e5,output:32e3}},"anthropic/claude-sonnet-4.6":{id:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-02-17",last_updated:"2026-03-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75,context_over_200k:{input:6,output:22.5,cache_read:.6,cache_write:7.5}},limit:{context:1e6,output:128e3}},"anthropic/claude-3-haiku":{id:"anthropic/claude-3-haiku",name:"Claude 3 Haiku",family:"claude",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2023-08-31",release_date:"2024-03-13",last_updated:"2024-03-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.25,output:1.25,cache_read:.03,cache_write:.3},limit:{context:2e5,output:4096}},"anthropic/claude-haiku-4.5":{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",family:"claude-haiku",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-02-28",release_date:"2025-10-15",last_updated:"2025-10-15",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:5,cache_read:.1,cache_write:1.25},limit:{context:2e5,output:64e3}},"anthropic/claude-opus-4.6":{id:"anthropic/claude-opus-4.6",name:"Claude Opus 4.6",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05-31",release_date:"2026-02-05",last_updated:"2026-03-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25,context_over_200k:{input:10,output:37.5,cache_read:1,cache_write:12.5}},limit:{context:1e6,output:128e3}},"anthropic/claude-fable-5":{id:"anthropic/claude-fable-5",name:"Claude Fable 5",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-09",last_updated:"2026-06-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5},limit:{context:1e6,output:128e3}},"anthropic/claude-opus-4":{id:"anthropic/claude-opus-4",name:"Claude Opus 4",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:75,cache_read:1.5,cache_write:18.75},limit:{context:2e5,output:32e3}},"anthropic/claude-sonnet-4.5":{id:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5 (latest)",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-07-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75,context_over_200k:{input:6,output:22.5,cache_read:.6,cache_write:7.5}},limit:{context:1e6,output:64e3}},"anthropic/claude-opus-4.5":{id:"anthropic/claude-opus-4.5",name:"Claude Opus 4.5 (latest)",family:"claude-opus",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2025-11-24",last_updated:"2025-11-24",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:25,cache_read:.5,cache_write:6.25},limit:{context:2e5,output:64e3}},"anthropic/claude-sonnet-4":{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-01-31",release_date:"2025-05-22",last_updated:"2025-05-22",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:3,output:15,cache_read:.3,cache_write:3.75,context_over_200k:{input:6,output:22.5,cache_read:.6,cache_write:7.5}},limit:{context:1e6,output:64e3}},"anthropic/claude-sonnet-5":{id:"anthropic/claude-sonnet-5",name:"Claude Sonnet 5",family:"claude-sonnet",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-01-31",release_date:"2026-06-30",last_updated:"2026-06-30",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5},limit:{context:1e6,output:128e3}},"anthropic/claude-fable-5.1":{id:"anthropic/claude-fable-5.1",name:"Claude Fable 5.1",family:"claude-fable",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-06",release_date:"2026-09-01",last_updated:"2026-09-01",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:.25,cache_write:12.5},limit:{context:1e6,output:128e3}},"google/gemma-4-26b-a4b-it":{id:"google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["image","text","video"],output:["text"]},open_weights:!0,cost:{input:.07,output:.34},limit:{context:262144,output:16384}},"google/gemini-3.1-pro-preview-customtools":{id:"google/gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-19",last_updated:"2026-02-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:.375,context_over_200k:{input:4,output:18,cache_read:.4},reasoning:12},limit:{context:1048576,output:65536},interleaved:{field:"reasoning_details"}},"google/gemini-3.1-flash-lite-image":{id:"google/gemini-3.1-flash-lite-image",name:"Nano Banana 2 Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2025-01",release_date:"2026-06-30",last_updated:"2026-06-30",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:.25,output:1.5},limit:{context:65536,output:58982}},"google/gemma-3-4b-it":{id:"google/gemma-3-4b-it",name:"Gemma 3 4B",family:"gemma",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-03-13",last_updated:"2025-03-13",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.05,output:.1},limit:{context:131072,output:16384}},"google/lyria-3-clip-preview":{id:"google/lyria-3-clip-preview",name:"Lyria 3 Clip Preview",family:"lyria",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-03-25",last_updated:"2026-03-25",modalities:{input:["text","image"],output:["text","audio"]},open_weights:!1,cost:{input:0,output:0},limit:{context:1048576,output:65536}},"google/gemini-2.5-flash-image":{id:"google/gemini-2.5-flash-image",name:"Nano Banana",family:"gemini-flash",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06",release_date:"2025-08-26",last_updated:"2025-08-26",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03,cache_write:.083333},limit:{context:32768,output:8192}},"google/gemini-3-pro-image":{id:"google/gemini-3-pro-image",name:"Nano Banana Pro",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:.375,reasoning:12},limit:{context:131072,output:32768}},"google/gemini-3.1-pro-preview":{id:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-19",last_updated:"2026-02-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:.375,context_over_200k:{input:4,output:18,cache_read:.4},reasoning:12},limit:{context:1048576,output:65536},interleaved:{field:"reasoning_details"}},"google/gemini-2.5-flash-lite":{id:"google/gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4,cache_read:.01,cache_write:.083333,reasoning:.4},limit:{context:1048576,output:65535}},"google/gemini-3.6-flash":{id:"google/gemini-3.6-flash",name:"Gemini 3.6 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,cache_write:.041667,reasoning:3.75},limit:{context:1048576,output:65536}},"google/gemini-3.1-flash-lite":{id:"google/gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-07",last_updated:"2026-05-07",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.25,output:1.5,cache_read:.025,cache_write:.083333,reasoning:1.5},limit:{context:1048576,output:65536}},"google/gemini-3.5-flash":{id:"google/gemini-3.5-flash",name:"Gemini 3.5 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-19",last_updated:"2026-05-19",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:1.5,output:9,cache_read:.15,cache_write:.083333,reasoning:9},limit:{context:1048576,output:65536}},"google/gemini-3.1-flash-lite-preview":{id:"google/gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.25,output:1.5,cache_read:.025,cache_write:.083333,reasoning:1.5},limit:{context:1048576,output:65536}},"google/gemma-3-27b-it":{id:"google/gemma-3-27b-it",name:"Gemma 3 27B",family:"gemma",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-03-12",last_updated:"2025-03-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.08,output:.45,cache_read:.04},limit:{context:131072,output:117964}},"google/gemini-3.1-flash-image":{id:"google/gemini-3.1-flash-image",name:"Nano Banana 2",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-05-28",last_updated:"2026-05-28",modalities:{input:["image","text"],output:["text","image"]},open_weights:!1,cost:{input:.5,output:3},limit:{context:131072,output:32768}},"google/gemini-3.5-flash-lite":{id:"google/gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",family:"gemini-flash-lite",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-07-21",last_updated:"2026-07-21",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03,cache_write:.083333,reasoning:2.5},limit:{context:1048576,output:65536}},"google/gemini-2.5-pro-preview":{id:"google/gemini-2.5-pro-preview",name:"Gemini 2.5 Pro Preview 06-05",family:"gemini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01-31",release_date:"2025-06-05",last_updated:"2025-06-05",modalities:{input:["pdf","image","text","audio"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125,cache_write:.375,context_over_200k:{input:2.5,output:15,cache_read:.25},reasoning:10},limit:{context:1048576,output:65536}},"google/gemini-3-pro-image-preview":{id:"google/gemini-3-pro-image-preview",name:"Nano Banana Pro Preview",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-11-20",last_updated:"2025-11-20",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:.375,reasoning:12},limit:{context:65536,output:32768}},"google/gemma-4-31b-it:free":{id:"google/gemma-4-31b-it:free",name:"Gemma 4 31B (free)",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["image","text","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:32768}},"google/gemma-4-31b-it":{id:"google/gemma-4-31b-it",name:"Gemma 4 31B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["image","text","video"],output:["text"]},open_weights:!0,cost:{input:.09,output:.34,cache_read:.05},limit:{context:262144,output:16384}},"google/gemini-3-flash-preview":{id:"google/gemini-3-flash-preview",name:"Gemini 3 Flash Preview",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-12-17",last_updated:"2025-12-17",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.5,output:3,cache_read:.05,cache_write:.083333,reasoning:3},limit:{context:1048576,output:65536},interleaved:{field:"reasoning_details"}},"google/gemini-3.8-flash":{id:"google/gemini-3.8-flash",name:"Gemini 3.8 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-09-02",last_updated:"2026-09-02",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,cache_write:.041667,reasoning:3.75},limit:{context:1048576,output:65536}},"google/lyria-3-pro-preview":{id:"google/lyria-3-pro-preview",name:"Lyria 3 Pro Preview",family:"lyria",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-03-25",last_updated:"2026-03-25",modalities:{input:["text","image"],output:["text","audio"]},open_weights:!1,cost:{input:0,output:0},limit:{context:1048576,output:65536}},"google/gemini-3.7-flash":{id:"google/gemini-3.7-flash",name:"Gemini 3.7 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-03",release_date:"2026-08-13",last_updated:"2026-08-13",modalities:{input:["text","image","video","audio","pdf"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,cache_write:.041667,reasoning:3.75},limit:{context:1048576,output:65536}},"google/gemini-2.5-pro":{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125,cache_write:.375,context_over_200k:{input:2.5,output:15,cache_read:.25},reasoning:10},limit:{context:1048576,output:65536}},"google/gemini-3.1-flash-image-preview":{id:"google/gemini-3.1-flash-image-preview",name:"Nano Banana 2 Preview",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-02-26",last_updated:"2026-02-26",modalities:{input:["image","text"],output:["text","image"]},open_weights:!1,cost:{input:.5,output:3},limit:{context:65536,output:58982}},"google/gemini-2.5-flash":{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2025-06-17",last_updated:"2025-06-17",modalities:{input:["text","image","audio","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5,cache_read:.03,cache_write:.083333,reasoning:2.5},limit:{context:1048576,output:65535}},"google/gemini-2.5-pro-preview-05-06":{id:"google/gemini-2.5-pro-preview-05-06",name:"Gemini 2.5 Pro Preview 05-06",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01-31",release_date:"2025-05-07",last_updated:"2025-05-07",modalities:{input:["text","image","pdf","audio","video"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125,cache_write:.375,context_over_200k:{input:2.5,output:15,cache_read:.25},reasoning:10},limit:{context:1048576,output:65535}},"google/gemma-3-12b-it":{id:"google/gemma-3-12b-it",name:"Gemma 3 12B",family:"gemma",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-03-13",last_updated:"2025-03-13",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.05,output:.15},limit:{context:131072,output:16384}},"google/gemma-4-26b-a4b-it:free":{id:"google/gemma-4-26b-a4b-it:free",name:"Gemma 4 26B A4B (free)",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["image","text","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:262144,output:32768}},"google/gemma-2-27b-it":{id:"google/gemma-2-27b-it",name:"Gemma 2 27B",family:"gemma",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2024-07-13",last_updated:"2024-07-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.65,output:.65},limit:{context:8192,output:2048}},"relace/relace-apply-3":{id:"relace/relace-apply-3",name:"Relace Apply 3",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!1,release_date:"2025-09-26",last_updated:"2025-09-26",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.85,output:1.25},limit:{context:256e3,output:128e3}},"relace/relace-search":{id:"relace/relace-search",name:"Relace Search",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1,output:3},limit:{context:256e3,output:128e3}},"nex-agi/nex-n2-mini":{id:"nex-agi/nex-n2-mini",name:"Nex-N2-Mini",family:"agi",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-24",last_updated:"2026-06-24",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.025,output:.1,cache_read:.0025},limit:{context:262144,output:235929}},"nex-agi/nex-n2-pro":{id:"nex-agi/nex-n2-pro",name:"Nex-N2-Pro",family:"agi",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-06-08",last_updated:"2026-06-08",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.25,output:1,cache_read:.025},limit:{context:262144,output:235929}},"thinkingmachines/inkling-small":{id:"thinkingmachines/inkling-small",name:"Inkling Small",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-30",last_updated:"2026-07-30",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:.45,output:1.2,cache_read:.1},limit:{context:1048576,output:262144}},"thinkingmachines/inkling-small:free":{id:"thinkingmachines/inkling-small:free",name:"Inkling Small (free)",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-30",last_updated:"2026-07-30",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1048576,output:262144}},"thinkingmachines/inkling:free":{id:"thinkingmachines/inkling:free",name:"Inkling (free)",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:1048576,output:262144}},"thinkingmachines/inkling":{id:"thinkingmachines/inkling",name:"Inkling",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:1,output:4.05,cache_read:.17},limit:{context:1048576,output:471859}},"gryphe/mythomax-l2-13b":{id:"gryphe/mythomax-l2-13b",name:"MythoMax 13B",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-06-30",release_date:"2023-07-02",last_updated:"2023-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.06,output:.06},limit:{context:8192,output:3686}},"meta/muse-spark-1.3":{id:"meta/muse-spark-1.3",name:"Muse Spark 1.3",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-09-02",last_updated:"2026-09-02",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:1.25,output:4.25,cache_read:.15},limit:{context:1048576,output:943718}},"meta/muse-spark-1.2":{id:"meta/muse-spark-1.2",name:"Muse Spark 1.2",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-05",last_updated:"2026-08-05",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:1.25,output:4.25,cache_read:.15},limit:{context:1048576,output:943718}},"meta/muse-spark-1.2-contributor":{id:"meta/muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-21",last_updated:"2026-08-21",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:.1,output:.2,cache_read:.002},limit:{context:1048576,output:943718}},"meta/muse-spark-1.3-contributor":{id:"meta/muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-09-02",last_updated:"2026-09-02",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:.1,output:.2,cache_read:.002},limit:{context:1048576,output:943718}},"meta/muse-spark-1.1":{id:"meta/muse-spark-1.1",name:"Muse Spark 1.1",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-08",last_updated:"2026-07-09",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:1.25,output:4.25,cache_read:.15},limit:{context:1048576,output:943718}},"meta/muse-glimmer-30b":{id:"meta/muse-glimmer-30b",name:"Muse Glimmer 30B",family:"muse",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-01-04",release_date:"2026-08-10",last_updated:"2026-08-10",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.1,cache_read:.04},limit:{context:131072,output:117964}},"perceptron/perceptron-mk1":{id:"perceptron/perceptron-mk1",name:"Perceptron Mk1",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2026-05-12",last_updated:"2026-05-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.15,output:1.5},limit:{context:32768,output:8192}},"thedrummer/skyfall-36b-v2":{id:"thedrummer/skyfall-36b-v2",name:"Skyfall 36B V2",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2025-03-10",last_updated:"2025-03-10",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.55,output:.8,cache_read:.25},limit:{context:32768,output:29491}},"thedrummer/unslopnemo-12b":{id:"thedrummer/unslopnemo-12b",name:"UnslopNemo 12B",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04-30",release_date:"2024-11-08",last_updated:"2024-11-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.4,output:.4},limit:{context:1024e3,output:819200}},"thedrummer/cydonia-24b-v4.1":{id:"thedrummer/cydonia-24b-v4.1",name:"Cydonia 24B V4.1",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-04-30",release_date:"2025-09-27",last_updated:"2025-09-27",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:.5,cache_read:.15},limit:{context:131072,output:117964}},"bytedance/ui-tars-1.5-7b":{id:"bytedance/ui-tars-1.5-7b",name:"UI-TARS 7B ",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-01-31",release_date:"2025-07-22",last_updated:"2025-07-22",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.2,cache_read:.1},limit:{context:128e3,output:2048}},"bytedance-seed/seed-1.6-flash":{id:"bytedance-seed/seed-1.6-flash",name:"Seed 1.6 Flash",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["image","text","video"],output:["text"]},open_weights:!1,cost:{input:.075,output:.3},limit:{context:262144,output:32768}},"bytedance-seed/seed-2-1-turbo":{id:"bytedance-seed/seed-2-1-turbo",name:"Seed 2.1 Turbo",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:2.5},limit:{context:262144,output:235929}},"bytedance-seed/seed-2.0-code":{id:"bytedance-seed/seed-2.0-code",name:"Seed 2.0 Code",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-14",last_updated:"2026-02-14",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.5,output:3},limit:{context:262144,output:131072}},"bytedance-seed/seed-1.6":{id:"bytedance-seed/seed-1.6",name:"Seed 1.6",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["image","text","video"],output:["text"]},open_weights:!1,cost:{input:.25,output:2},limit:{context:262144,output:32768}},"bytedance-seed/seed-2.0-mini":{id:"bytedance-seed/seed-2.0-mini",name:"Seed 2.0 Mini",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-14",last_updated:"2026-02-14",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4},limit:{context:262144,output:131072}},"bytedance-seed/seed-2.0-lite":{id:"bytedance-seed/seed-2.0-lite",name:"Seed 2.0 Lite",family:"seed",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-14",last_updated:"2026-02-14",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.25,output:2},limit:{context:262144,output:131072}},"inception/mercury-2.5-preview":{id:"inception/mercury-2.5-preview",name:"Mercury 2.5 Preview",family:"mercury",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-31",last_updated:"2026-08-31",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.04,output:.15,cache_read:.004},limit:{context:26e4,output:65536}},"inception/mercury-2":{id:"inception/mercury-2",name:"Mercury 2",family:"mercury",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-04",last_updated:"2026-03-04",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:.75,cache_read:.025},limit:{context:128e3,output:5e4}},"writer/palmyra-x5":{id:"writer/palmyra-x5",name:"Palmyra X5",family:"palmyra",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-01-21",last_updated:"2026-01-21",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.6,output:6},limit:{context:104e4,output:8192}},"~google/gemini-pro-latest":{id:"~google/gemini-pro-latest",name:"Google Gemini Pro Latest",family:"gemini-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["audio","pdf","image","text","video"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:.375,context_over_200k:{input:4,output:18,cache_read:.4},reasoning:12},limit:{context:1048576,output:65536}},"~google/gemini-flash-latest":{id:"~google/gemini-flash-latest",name:"Google Gemini Flash Latest",family:"gemini-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01-01",release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video","pdf","audio"],output:["text"]},open_weights:!1,cost:{input:.75,output:3.75,cache_read:.075,cache_write:.041667,reasoning:3.75},limit:{context:1048576,output:65536}},"microsoft/phi-4":{id:"microsoft/phi-4",name:"Phi 4",family:"phi",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2025-01-10",last_updated:"2025-01-10",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.07,output:.14},limit:{context:16384,output:14745}},"microsoft/wizardlm-2-8x22b":{id:"microsoft/wizardlm-2-8x22b",name:"WizardLM-2 8x22B",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-04-30",release_date:"2024-04-16",last_updated:"2024-04-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.62,output:.62},limit:{context:65535,output:8e3}},"sakana/fugu-ultra":{id:"sakana/fugu-ultra",name:"Fugu Ultra",family:"fugu",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-06-15",last_updated:"2026-06-15",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5,context_over_200k:{input:10,output:45,cache_read:1}},limit:{context:1e6,output:128e3}},"sakana/sakana-namazu":{id:"sakana/sakana-namazu",name:"Sakana Namazu",family:"sakana-namazu",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-08-03",last_updated:"2026-08-03",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.95,output:4,cache_read:.15},limit:{context:262144,output:65536}},"~moonshotai/kimi-latest":{id:"~moonshotai/kimi-latest",name:"MoonshotAI Kimi Latest",family:"kimi",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:2.5,output:14,cache_read:.29},limit:{context:1048576,output:943718}},"ibm-granite/granite-4.2-8b":{id:"ibm-granite/granite-4.2-8b",name:"Granite 4.2 8B",family:"granite",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-31",last_updated:"2026-08-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.15,cache_read:.05},limit:{context:131072,output:117964}},"ibm-granite/granite-4.0-h-micro":{id:"ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 Micro",family:"granite",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-10-20",last_updated:"2025-10-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.017,output:.112},limit:{context:131e3,output:117900}},"deepseek/deepseek-chat-v3.1":{id:"deepseek/deepseek-chat-v3.1",name:"DeepSeek V3.1",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-08-21",last_updated:"2025-08-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.25,output:.95,cache_read:.13},limit:{context:163840,output:32768}},"deepseek/deepseek-v4-flash-vision-exp":{id:"deepseek/deepseek-v4-flash-vision-exp",name:"DeepSeek V4 Flash Vision Exp",family:"deepseek-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-21",last_updated:"2026-08-21",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.44,output:1.32,cache_read:.014},limit:{context:1048576,output:384e3}},"deepseek/deepseek-v4-pro-0813":{id:"deepseek/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.0494,output:3.1482,cache_read:.03498},limit:{context:1048576,output:384e3}},"deepseek/deepseek-v4-flash-0731":{id:"deepseek/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.028},limit:{context:1310720,output:131072}},"deepseek/deepseek-v4-flash":{id:"deepseek/deepseek-v4-flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.088606,output:.177212,cache_read:.017721},limit:{context:1048576,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek/deepseek-r1":{id:"deepseek/deepseek-r1",name:"DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-07",release_date:"2025-01-20",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:2.5},limit:{context:64e3,output:16e3}},"deepseek/deepseek-chat":{id:"deepseek/deepseek-chat",name:"DeepSeek Chat",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-09",release_date:"2025-12-01",last_updated:"2026-02-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.32,output:.89},limit:{context:163840,output:16384}},"deepseek/deepseek-r1-0528":{id:"deepseek/deepseek-r1-0528",name:"R1 0528",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-05-28",last_updated:"2025-05-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:2.15,cache_read:.35},limit:{context:163840,output:32768}},"deepseek/deepseek-v3.2":{id:"deepseek/deepseek-v3.2",name:"DeepSeek V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-07",release_date:"2025-12-01",last_updated:"2025-12-01",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.269,output:.4,cache_read:.1345},limit:{context:163840,output:65536}},"deepseek/deepseek-r1-distill-llama-70b":{id:"deepseek/deepseek-r1-distill-llama-70b",name:"R1 Distill Llama 70B",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-07-31",release_date:"2025-01-23",last_updated:"2025-01-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.8,output:.8},limit:{context:8192,output:7372}},"deepseek/deepseek-v3.2-exp":{id:"deepseek/deepseek-v3.2-exp",name:"DeepSeek V3.2 Exp",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-07-31",release_date:"2025-09-29",last_updated:"2025-09-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.27,output:.41},limit:{context:163840,output:65536}},"deepseek/deepseek-v3.1-terminus":{id:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek V3.1 Terminus",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-09-22",last_updated:"2025-09-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.27,output:1,cache_read:.135},limit:{context:163840,output:32768}},"deepseek/deepseek-v4-pro":{id:"deepseek/deepseek-v4-pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.95526,output:1.91052,cache_read:.079605},limit:{context:1048576,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek/deepseek-chat-v3-0324":{id:"deepseek/deepseek-chat-v3-0324",name:"DeepSeek V3 0324",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-07-31",release_date:"2025-03-24",last_updated:"2025-03-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.29,output:1.14,cache_read:.11},limit:{context:163840,output:147456}},"~openai/gpt-latest":{id:"~openai/gpt-latest",name:"OpenAI GPT Latest",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:15,cache_read:.4,cache_write:5}},limit:{context:105e4,output:128e3}},"~openai/gpt-mini-latest":{id:"~openai/gpt-mini-latest",name:"OpenAI GPT Mini Latest",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-04-27",last_updated:"2026-04-27",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:.75,output:4.5,cache_read:.075},limit:{context:4e5,output:128e3}},"amazon/nova-2-lite-v1":{id:"amazon/nova-2-lite-v1",name:"Nova 2 Lite",family:"nova",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-12-02",last_updated:"2025-12-02",modalities:{input:["text","image","video","pdf"],output:["text"]},open_weights:!1,cost:{input:.3,output:2.5},limit:{context:1e6,output:65535}},"amazon/nova-micro-v1":{id:"amazon/nova-micro-v1",name:"Nova Micro 1.0",family:"nova-micro",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-10-31",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.035,output:.14},limit:{context:128e3,output:5120}},"amazon/nova-pro-v1":{id:"amazon/nova-pro-v1",name:"Nova Pro 1.0",family:"nova-pro",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-10-31",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.8,output:3.2},limit:{context:3e5,output:5120}},"amazon/nova-premier-v1":{id:"amazon/nova-premier-v1",name:"Nova Premier 1.0",family:"nova",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-10-31",last_updated:"2025-10-31",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2.5,output:12.5,cache_read:.625},limit:{context:1e6,output:32e3}},"amazon/nova-lite-v1":{id:"amazon/nova-lite-v1",name:"Nova Lite 1.0",family:"nova-lite",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-10-31",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.06,output:.24},limit:{context:3e5,output:5120}},"inclusionai/ling-3.0-flash":{id:"inclusionai/ling-3.0-flash",name:"Ling 3.0 Flash",family:"ling",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-07-23",last_updated:"2026-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.021,output:.063,cache_read:.0042},limit:{context:262144,output:32768}},"inclusionai/ling-3.0-flash-fin":{id:"inclusionai/ling-3.0-flash-fin",name:"Ling 3.0 Flash Fin",family:"ling",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-27",last_updated:"2026-08-27",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.06,output:.18,cache_read:.012},limit:{context:262144,output:235929}},"inclusionai/ling-3.0-flash-fin:free":{id:"inclusionai/ling-3.0-flash-fin:free",name:"Ling 3.0 Flash Fin (free)",family:"ling",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-08-27",last_updated:"2026-08-27",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:262144,output:32768}},"inclusionai/ling-3.0-flash-sante:free":{id:"inclusionai/ling-3.0-flash-sante:free",name:"Ling 3.0 Flash Sante (free)",family:"ling",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-09-04",last_updated:"2026-09-04",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:262144,output:32768}},"anthracite-org/magnum-v4-72b":{id:"anthracite-org/magnum-v4-72b",name:"Magnum v4 72B",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-30",release_date:"2024-10-22",last_updated:"2024-10-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2.5,output:5},limit:{context:32768,output:4096}},"mancer/weaver":{id:"mancer/weaver",name:"Weaver (alpha)",family:"alpha",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-06-30",release_date:"2023-08-02",last_updated:"2023-08-02",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.4,output:.75},limit:{context:8e3,output:6e3}},"openrouter/free":{id:"openrouter/free",name:"Free Models Router",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-01",last_updated:"2026-02-01",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:0,output:0},limit:{context:2e5,input:2e5,output:8e3}},"openrouter/pareto-code":{id:"openrouter/pareto-code",name:"Pareto Code Router",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!1,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:2e6,output:2e5}},"openrouter/bodybuilder":{id:"openrouter/bodybuilder",name:"Body Builder (beta)",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!1,release_date:"2025-12-05",last_updated:"2025-12-05",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:128e3,output:128e3}},"openrouter/fusion":{id:"openrouter/fusion",name:"Fusion",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!1,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!1,limit:{context:1e6,output:128e3}},"openrouter/auto":{id:"openrouter/auto",name:"Auto Router",family:"auto",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2023-11-08",last_updated:"2023-11-08",modalities:{input:["text","image","audio","pdf","video"],output:["text","image"]},open_weights:!1,limit:{context:2e6,output:2e6}},"sao10k/l3.3-euryale-70b":{id:"sao10k/l3.3-euryale-70b",name:"Llama 3.3 Euryale 70B",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-12-18",last_updated:"2024-12-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.65,output:.75},limit:{context:131072,output:16384}},"sao10k/l3-lunaris-8b":{id:"sao10k/l3-lunaris-8b",name:"Llama 3 8B Lunaris",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-08-13",last_updated:"2024-08-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.04,output:.05},limit:{context:8192,output:7372}},"sao10k/l3.1-euryale-70b":{id:"sao10k/l3.1-euryale-70b",name:"Llama 3.1 Euryale 70B v2.2",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-08-28",last_updated:"2024-08-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.85,output:.85},limit:{context:131072,output:16384}},"x-ai/grok-4.20-multi-agent":{id:"x-ai/grok-4.20-multi-agent",name:"Grok 4.20 Multi-Agent",family:"grok",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-09-01",release_date:"2026-03-31",last_updated:"2026-03-31",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:2e6,output:18e5}},"x-ai/grok-4.3":{id:"x-ai/grok-4.3",name:"Grok 4.3",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:1e6,output:9e5}},"x-ai/grok-4.20":{id:"x-ai/grok-4.20",name:"Grok 4.20",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-09-01",release_date:"2026-03-31",last_updated:"2026-03-31",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:2e6,output:18e5}},"x-ai/grok-4.5":{id:"x-ai/grok-4.5",name:"Grok 4.5",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-08",last_updated:"2026-07-08",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.3,context_over_200k:{input:4,output:12,cache_read:.6}},limit:{context:5e5,output:45e4}},"x-ai/grok-build-0.1":{id:"x-ai/grok-build-0.1",name:"Grok Build 0.1",family:"grok-build",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:2,cache_read:.2,context_over_200k:{input:2,output:4,cache_read:.4}},limit:{context:256e3,output:230400}},"x-ai/grok-4.6":{id:"x-ai/grok-4.6",name:"Grok 4.6",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-02-01",release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.5,context_over_200k:{input:4,output:12,cache_read:1}},limit:{context:5e5,output:45e4}},"meta-llama/llama-3.1-8b-instruct":{id:"meta-llama/llama-3.1-8b-instruct",name:"Llama-3.1-8B-Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.08,cache_read:.025},limit:{context:131072,output:117964}},"meta-llama/llama-guard-4-12b":{id:"meta-llama/llama-guard-4-12b",name:"Llama Guard 4 12B",family:"llama",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-08-31",release_date:"2025-04-30",last_updated:"2025-04-30",modalities:{input:["image","text"],output:["text"]},open_weights:!0,cost:{input:.18,output:.18},limit:{context:163840,output:16384}},"meta-llama/llama-3.2-3b-instruct":{id:"meta-llama/llama-3.2-3b-instruct",name:"Llama 3.2 3B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.33},limit:{context:131072,output:117964}},"meta-llama/llama-3.2-1b-instruct":{id:"meta-llama/llama-3.2-1b-instruct",name:"Llama 3.2 1B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12-31",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.027,output:.201},limit:{context:6e4,output:54e3}},"meta-llama/llama-4-maverick":{id:"meta-llama/llama-4-maverick",name:"Llama 4 Maverick",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-04-05",last_updated:"2025-04-05",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.2,output:.696},limit:{context:1048576,output:115200}},"meta-llama/llama-4-scout":{id:"meta-llama/llama-4-scout",name:"Llama 4 Scout",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-04-05",last_updated:"2025-04-05",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3},limit:{context:1310720,output:16384}},"meta-llama/llama-3.1-70b-instruct":{id:"meta-llama/llama-3.1-70b-instruct",name:"Llama 3.1 70B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.4,output:.4},limit:{context:131072,output:16384}},"meta-llama/llama-3.3-70b-instruct":{id:"meta-llama/llama-3.3-70b-instruct",name:"Llama-3.3-70B-Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2024-12-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.32},limit:{context:131072,output:16384}},"nousresearch/hermes-3-llama-3.1-70b":{id:"nousresearch/hermes-3-llama-3.1-70b",name:"Hermes 3 70B Instruct",family:"nousresearch",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-08-18",last_updated:"2024-08-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.7,output:.7},limit:{context:131072,output:16384}},"nousresearch/hermes-3-llama-3.1-405b":{id:"nousresearch/hermes-3-llama-3.1-405b",name:"Hermes 3 405B Instruct",family:"nousresearch",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-08-16",last_updated:"2024-08-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:1},limit:{context:131072,output:16384}},"nousresearch/hermes-4-405b":{id:"nousresearch/hermes-4-405b",name:"Hermes 4 405B",family:"hermes",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-08-31",release_date:"2025-08-26",last_updated:"2025-08-26",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3},limit:{context:131072,output:117964}},"nousresearch/hermes-4-70b":{id:"nousresearch/hermes-4-70b",name:"Hermes 4 70B",family:"hermes",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-08-31",release_date:"2025-08-26",last_updated:"2025-08-26",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.13,output:.4},limit:{context:131072,output:117964}},"openai/o4-mini-high":{id:"openai/o4-mini-high",name:"o4 Mini High",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-06-30",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.275},limit:{context:2e5,output:1e5}},"openai/gpt-5-nano":{id:"openai/gpt-5-nano",name:"GPT-5 Nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.05,output:.4,cache_read:.005},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-4.1-nano":{id:"openai/gpt-4.1-nano",name:"GPT-4.1 nano",family:"gpt-nano",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4,cache_read:.025},limit:{context:1047576,output:32768}},"openai/gpt-4o-2024-05-13":{id:"openai/gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-05-13",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:15},limit:{context:128e3,output:4096}},"openai/gpt-5-pro":{id:"openai/gpt-5-pro",name:"GPT-5 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-10-06",last_updated:"2025-10-06",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:120},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-4o-mini-2024-07-18":{id:"openai/gpt-4o-mini-2024-07-18",name:"GPT-4o-mini (2024-07-18)",family:"o-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-10-31",release_date:"2024-07-18",last_updated:"2024-07-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.15,output:.6,cache_read:.075},limit:{context:128e3,output:16384}},"openai/o3-mini-high":{id:"openai/o3-mini-high",name:"o3 Mini High",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2023-10-31",release_date:"2025-02-12",last_updated:"2025-02-12",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.55},limit:{context:2e5,output:1e5}},"openai/gpt-5.1-codex-mini":{id:"openai/gpt-5.1-codex-mini",name:"GPT-5.1 Codex mini",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.25,output:2,cache_read:.03},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-6-astra-pro":{id:"openai/gpt-6-astra-pro",name:"GPT-6 Astra Pro",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-09-04",last_updated:"2026-09-04",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5,context_over_200k:{input:20,output:75,cache_read:2,cache_write:25}},limit:{context:105e4,output:128e3}},"openai/gpt-audio-mini":{id:"openai/gpt-audio-mini",name:"GPT Audio Mini",family:"o-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text","audio"],output:["text","audio"]},open_weights:!1,cost:{input:.6,output:2.4},limit:{context:128e3,output:16384}},"openai/gpt-5.1-codex":{id:"openai/gpt-5.1-codex",name:"GPT-5.1 Codex",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.13},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-5.6-sol":{id:"openai/gpt-5.6-sol",name:"GPT-5.6 Sol",family:"gpt-sol",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:15,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-4-turbo-preview":{id:"openai/gpt-4-turbo-preview",name:"GPT-4 Turbo Preview",family:"gpt",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12-31",release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:10,output:30},limit:{context:128e3,output:4096}},"openai/gpt-4o-2024-08-06":{id:"openai/gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-08-06",last_updated:"2024-08-06",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}},"openai/gpt-5.2-codex":{id:"openai/gpt-5.2-codex",name:"GPT-5.2 Codex",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-6-astra":{id:"openai/gpt-6-astra",name:"GPT-6 Astra",family:"gpt-astra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-04-30",release_date:"2026-09-04",last_updated:"2026-09-04",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5,context_over_200k:{input:20,output:75,cache_read:2,cache_write:25}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-5.2-chat":{id:"openai/gpt-5.2-chat",name:"GPT-5.2 Chat",family:"gpt-codex",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-10",last_updated:"2025-12-10",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:128e3,output:32e3}},"openai/gpt-5.6-luna-pro":{id:"openai/gpt-5.6-luna-pro",name:"GPT-5.6 Luna Pro",family:"gpt-luna",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.2,cache_read:.02,cache_write:.25,context_over_200k:{input:.4,output:1.8,cache_read:.04,cache_write:.5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-5.2-pro":{id:"openai/gpt-5.2-pro",name:"GPT-5.2 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:21,output:168},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-4.1-mini":{id:"openai/gpt-4.1-mini",name:"GPT-4.1 mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.4,output:1.6,cache_read:.1},limit:{context:1047576,output:32768}},"openai/gpt-5.4":{id:"openai/gpt-5.4",name:"GPT-5.4",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:15,cache_read:.25,context_over_200k:{input:5,output:22.5,cache_read:.5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.03,output:.13,cache_read:.03},limit:{context:131072,output:117964}},"openai/gpt-4-turbo":{id:"openai/gpt-4-turbo",name:"GPT-4 Turbo",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-12",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:10,output:30},limit:{context:128e3,output:4096}},"openai/gpt-5-image":{id:"openai/gpt-5-image",name:"GPT-5 Image",family:"gpt",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-10-01",release_date:"2025-10-14",last_updated:"2025-10-14",modalities:{input:["image","text","pdf"],output:["image","text"]},open_weights:!1,cost:{input:10,output:10,cache_read:1.25},limit:{context:4e5,output:128e3}},"openai/gpt-5.6-sol-pro":{id:"openai/gpt-5.6-sol-pro",name:"GPT-5.6 Sol Pro",family:"gpt-sol",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:10,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:15,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-oss-safeguard-20b":{id:"openai/gpt-oss-safeguard-20b",name:"gpt-oss-safeguard-20b",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-29",last_updated:"2025-10-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.075,output:.3,cache_read:.0375},limit:{context:131072,output:65536}},"openai/gpt-5.1":{id:"openai/gpt-5.1",name:"GPT-5.1",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-5.1-codex-max":{id:"openai/gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-5.4-image-2":{id:"openai/gpt-5.4-image-2",name:"GPT-5.4 Image 2",family:"gpt",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!1,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["image","text","pdf"],output:["image","text"]},open_weights:!1,cost:{input:8,output:15,cache_read:2},limit:{context:272e3,output:128e3}},"openai/gpt-3.5-turbo-0613":{id:"openai/gpt-3.5-turbo-0613",name:"GPT-3.5 Turbo (older v0613)",family:"gpt",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2021-09-30",release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1,output:2},limit:{context:4095,output:3685}},"openai/gpt-audio":{id:"openai/gpt-audio",name:"GPT Audio",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text","audio"],output:["text","audio"]},open_weights:!1,cost:{input:2.5,output:10},limit:{context:128e3,output:16384}},"openai/o1":{id:"openai/o1",name:"o1",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2023-09",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:60,cache_read:7.5},limit:{context:2e5,output:1e5}},"openai/gpt-4o":{id:"openai/gpt-4o",name:"GPT-4o",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-08-06",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}},"openai/gpt-5.6-luna":{id:"openai/gpt-5.6-luna",name:"GPT-5.6 Luna",family:"gpt-luna",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.2,cache_read:.02,cache_write:.25,context_over_200k:{input:.4,output:1.8,cache_read:.04,cache_write:.5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-5.3-codex":{id:"openai/gpt-5.3-codex",name:"GPT-5.3 Codex",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-4o-mini":{id:"openai/gpt-4o-mini",name:"GPT-4o mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-07-18",last_updated:"2024-07-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.15,output:.6,cache_read:.075},limit:{context:128e3,output:16384}},"openai/o1-pro":{id:"openai/o1-pro",name:"o1-pro",family:"o-pro",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!1,knowledge:"2023-09",release_date:"2025-03-19",last_updated:"2025-03-19",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:150,output:600},limit:{context:2e5,output:1e5}},"openai/gpt-4.1":{id:"openai/gpt-4.1",name:"GPT-4.1",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:1047576,output:32768}},"openai/gpt-5.4-nano":{id:"openai/gpt-5.4-nano",name:"GPT-5.4 nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.25,cache_read:.02},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-5.6-terra-pro":{id:"openai/gpt-5.6-terra-pro",name:"GPT-5.6 Terra Pro",family:"gpt-terra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:18,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-5.5-pro":{id:"openai/gpt-5.5-pro",name:"GPT-5.5 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-04-23",last_updated:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:30,output:180,context_over_200k:{input:60,output:270}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-chat-latest":{id:"openai/gpt-chat-latest",name:"GPT Chat Latest",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-05-05",last_updated:"2026-05-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5},limit:{context:4e5,output:128e3}},"openai/gpt-5.4-mini":{id:"openai/gpt-5.4-mini",name:"GPT-5.4 mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:.75,output:4.5,cache_read:.075},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-3.5-turbo-16k":{id:"openai/gpt-3.5-turbo-16k",name:"GPT-3.5 Turbo 16k",family:"gpt",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2021-09-30",release_date:"2023-08-28",last_updated:"2023-08-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:3,output:4},limit:{context:16385,output:4096}},"openai/gpt-5-image-mini":{id:"openai/gpt-5-image-mini",name:"GPT-5 Image Mini",family:"gpt",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2025-10-16",last_updated:"2025-10-16",modalities:{input:["pdf","image","text"],output:["image","text"]},open_weights:!1,cost:{input:2.5,output:2,cache_read:.25},limit:{context:4e5,output:128e3}},"openai/gpt-3.5-turbo":{id:"openai/gpt-3.5-turbo",name:"GPT-3.5-turbo",family:"gpt",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2021-09-01",release_date:"2023-03-01",last_updated:"2023-11-06",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:1.5},limit:{context:16385,output:4096}},"openai/gpt-5-mini":{id:"openai/gpt-5-mini",name:"GPT-5 Mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.25,output:2,cache_read:.025},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.037,output:.17},limit:{context:131072,output:117964}},"openai/gpt-5.4-pro":{id:"openai/gpt-5.4-pro",name:"GPT-5.4 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:30,output:180,context_over_200k:{input:60,output:270}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-3.5-turbo-instruct":{id:"openai/gpt-3.5-turbo-instruct",name:"GPT-3.5 Turbo Instruct",family:"gpt",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2021-09-30",release_date:"2023-09-28",last_updated:"2023-09-28",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.5,output:2},limit:{context:4095,output:3685}},"openai/gpt-5.6-terra":{id:"openai/gpt-5.6-terra",name:"GPT-5.6 Terra",family:"gpt-terra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:18,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-4":{id:"openai/gpt-4",name:"GPT-4",family:"gpt",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-11",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:30,output:60},limit:{context:8191,output:4096}},"openai/gpt-5.2":{id:"openai/gpt-5.2",name:"GPT-5.2",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["pdf","image","text"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"openai/gpt-5":{id:"openai/gpt-5",name:"GPT-5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"openai/o4-mini":{id:"openai/o4-mini",name:"o4-mini",family:"o-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["image","text","pdf"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.275},limit:{context:2e5,output:1e5}},"openai/o3-mini":{id:"openai/o3-mini",name:"o3-mini",family:"o-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2024-12-20",last_updated:"2025-01-29",modalities:{input:["text","pdf"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.55},limit:{context:2e5,output:1e5}},"openai/o3":{id:"openai/o3",name:"o3",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:2e5,output:1e5}},"openai/o3-pro":{id:"openai/o3-pro",name:"o3-pro",family:"o-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-06-10",last_updated:"2025-06-10",modalities:{input:["text","pdf","image"],output:["text"]},open_weights:!1,cost:{input:20,output:80},limit:{context:2e5,output:1e5}},"openai/gpt-5.5":{id:"openai/gpt-5.5",name:"GPT-5.5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-04-23",last_updated:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5,context_over_200k:{input:10,output:45,cache_read:1}},limit:{context:105e4,input:922e3,output:128e3}},"openai/gpt-4o-2024-11-20":{id:"openai/gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-11-20",last_updated:"2024-11-20",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}},"~z-ai/glm-flash-latest":{id:"~z-ai/glm-flash-latest",name:"GLM Flash Latest",family:"glm-flash",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-27",last_updated:"2026-08-27",modalities:{input:["text","image","video"],output:["text"]},open_weights:!1,cost:{input:.07125,output:.2375,cache_read:.01425},limit:{context:1310720,output:131072}},"~z-ai/glm-latest":{id:"~z-ai/glm-latest",name:"GLM Latest",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-19",last_updated:"2026-08-19",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.12,output:3.52,cache_read:.208},limit:{context:1310720,output:943718}},"moonshotai/kimi-k2-0905":{id:"moonshotai/kimi-k2-0905",name:"Kimi K2 0905",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-12-31",release_date:"2025-09-04",last_updated:"2025-09-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.5},limit:{context:262144,output:100352}},"moonshotai/kimi-k2.6":{id:"moonshotai/kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262144,output:235929},interleaved:{field:"reasoning_details"}},"moonshotai/kimi-k2.7-code":{id:"moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.71,output:3.5,cache_read:.15},limit:{context:262144,output:235929}},"moonshotai/kimi-k2-thinking":{id:"moonshotai/kimi-k2-thinking",name:"Kimi K2 Thinking",family:"kimi-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-08",release_date:"2025-11-06",last_updated:"2025-11-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.5},limit:{context:262144,output:235929},interleaved:{field:"reasoning_details"}},"moonshotai/kimi-k3":{id:"moonshotai/kimi-k3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:3,output:15,cache_read:.3},limit:{context:1048576,output:943718}},"moonshotai/kimi-k2":{id:"moonshotai/kimi-k2",name:"Kimi K2 0711",family:"kimi-k2",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-12-31",release_date:"2025-07-11",last_updated:"2025-07-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.57,output:2.3},limit:{context:131072,output:100352}},"moonshotai/kimi-k2.5":{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-01",last_updated:"2026-01",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.45,output:2.25,cache_read:.07},limit:{context:262144,output:235929},interleaved:{field:"reasoning_details"}},"cohere/north-mini-code:free":{id:"cohere/north-mini-code:free",name:"North Mini Code (free)",family:"north",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-06-17",last_updated:"2026-06-17",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:256e3,output:64e3}},"cohere/command-r-plus-08-2024":{id:"cohere/command-r-plus-08-2024",name:"Command R+",family:"command-r",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06-01",release_date:"2024-08-30",last_updated:"2024-08-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2.5,output:10},limit:{context:128e3,output:4e3}},"cohere/command-a":{id:"cohere/command-a",name:"Command A",family:"command-a",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-08-31",release_date:"2025-03-13",last_updated:"2025-03-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2.5,output:10},limit:{context:256e3,output:8192}},"cohere/command-r7b-12-2024":{id:"cohere/command-r7b-12-2024",name:"Command R7B",family:"command-r",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2024-06-01",release_date:"2024-12-02",last_updated:"2024-12-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.0375,output:.15},limit:{context:128e3,output:4e3}},"cohere/command-r-08-2024":{id:"cohere/command-r-08-2024",name:"Command R",family:"command-r",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-06-01",release_date:"2024-08-30",last_updated:"2024-08-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.15,output:.6},limit:{context:128e3,output:4e3}},"upstage/solar-pro-3":{id:"upstage/solar-pro-3",name:"Solar Pro 3",family:"solar-pro",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.15,output:.6,cache_read:.015},limit:{context:131072,output:117964}},"upstage/solar-pro4":{id:"upstage/solar-pro4",name:"Solar Pro 4",family:"solar",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-10",last_updated:"2026-08-10",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.03,output:.12,cache_read:.006},limit:{context:524288,output:131072}},"arcee-ai/trinity-large-thinking":{id:"arcee-ai/trinity-large-thinking",name:"Trinity Large Thinking",family:"trinity",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-01",last_updated:"2026-05-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.25,output:.8,cache_read:.06},limit:{context:262144,output:8e4}},"tencent/hy3":{id:"tencent/hy3",name:"Hy3",family:"Hy",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-06",last_updated:"2026-07-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.132,output:.528,cache_read:.033},limit:{context:262144,input:192e3,output:128e3}},"tencent/hy4-preview":{id:"tencent/hy4-preview",name:"Hy4 preview",family:"Hy",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-28",last_updated:"2026-08-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.834,output:2.501,cache_read:.042},limit:{context:1048576,output:64e3}},"tencent/hy-mt2-30b-a3b":{id:"tencent/hy-mt2-30b-a3b",name:"Hy-MT2-30B-A3B",family:"Hy",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2026-08-20",last_updated:"2026-08-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.074,output:.295},limit:{context:8192,output:4096}},"tencent/hy-mt2-7b":{id:"tencent/hy-mt2-7b",name:"Hy-MT2-7B",family:"Hy",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2026-08-19",last_updated:"2026-08-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.074,output:.295},limit:{context:8192,output:4096}},"tencent/hy-mt2-1.8b":{id:"tencent/hy-mt2-1.8b",name:"Hy-MT2-1.8B",family:"Hy",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2026-08-20",last_updated:"2026-08-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.044,output:.177},limit:{context:8192,output:4096}},"tencent/hy3-preview":{id:"tencent/hy3-preview",name:"Hy3 preview",family:"Hy",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-20",last_updated:"2026-04-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.18,output:.6,cache_read:.06},limit:{context:262144,output:235929}},"tencent/hunyuan-a13b-instruct":{id:"tencent/hunyuan-a13b-instruct",name:"Hunyuan A13B Instruct",family:"hunyuan",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-03-31",release_date:"2025-07-08",last_updated:"2025-07-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.57},limit:{context:131072,output:117964}},"liquid/lfm-2.5-2.6b:free":{id:"liquid/lfm-2.5-2.6b:free",name:"LFM2.5-2.6B (free)",family:"liquid",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-11",last_updated:"2026-08-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0},limit:{context:65536,output:8192}},"z-ai/glm-4.7":{id:"z-ai/glm-4.7",name:"GLM-4.7",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-12-22",last_updated:"2025-12-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.4,output:1.75,cache_read:.08},limit:{context:204800,output:131072},interleaved:{field:"reasoning_details"}},"z-ai/glm-4.5-air":{id:"z-ai/glm-4.5-air",name:"GLM-4.5-Air",family:"glm-air",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.13,output:.85,cache_read:.025},limit:{context:131072,output:98304}},"z-ai/glm-4.6":{id:"z-ai/glm-4.6",name:"GLM-4.6",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-09-30",last_updated:"2025-09-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.55,output:2.2,cache_read:.11},limit:{context:204800,output:131072}},"z-ai/glm-4.6v":{id:"z-ai/glm-4.6v",name:"GLM-4.6V",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-12-08",last_updated:"2025-12-08",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:.9,cache_read:.055},limit:{context:131072,output:32768}},"z-ai/glm-5.2":{id:"z-ai/glm-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.966,output:3.036,cache_read:.1932},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"z-ai/glm-5.3-flash":{id:"z-ai/glm-5.3-flash",name:"GLM-5.3-Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.075,output:.25,cache_read:.015},limit:{context:1310720,output:131072}},"z-ai/glm-4.5":{id:"z-ai/glm-4.5",name:"GLM-4.5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-07-28",last_updated:"2025-07-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.2,cache_read:.11},limit:{context:131072,output:98304}},"z-ai/glm-4.5v":{id:"z-ai/glm-4.5v",name:"GLM-4.5V",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2025-04",release_date:"2025-08-11",last_updated:"2025-08-11",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:1.8,cache_read:.11},limit:{context:65536,output:16384}},"z-ai/glm-5":{id:"z-ai/glm-5",name:"GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:1.92,cache_read:.12},limit:{context:204800,output:128e3},interleaved:{field:"reasoning_content"}},"z-ai/glm-5.1":{id:"z-ai/glm-5.1",name:"GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-07",last_updated:"2026-04-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.966,output:3.036,cache_read:.1794},limit:{context:204800,output:128e3},interleaved:{field:"reasoning_content"}},"z-ai/glm-5-turbo":{id:"z-ai/glm-5-turbo",name:"GLM-5-Turbo",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-03-16",last_updated:"2026-03-16",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.2,output:4,cache_read:.24},limit:{context:202752,output:131072},interleaved:{field:"reasoning_content"}},"z-ai/glm-5.3":{id:"z-ai/glm-5.3",name:"GLM-5.3",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:1310720,output:943718}},"z-ai/glm-5v-turbo":{id:"z-ai/glm-5v-turbo",name:"GLM-5V-Turbo",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-04-01",last_updated:"2026-04-01",modalities:{input:["image","text","video"],output:["text"]},open_weights:!1,cost:{input:1.2,output:4,cache_read:.24},limit:{context:202752,output:131072}},"z-ai/glm-4.7-flash":{id:"z-ai/glm-4.7-flash",name:"GLM-4.7-Flash",family:"glm-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.0605,output:.4},limit:{context:202752,output:117964},interleaved:{field:"reasoning_details"}},"cognitivecomputations/dolphin-mistral-24b-venice-edition":{id:"cognitivecomputations/dolphin-mistral-24b-venice-edition",name:"Uncensored",family:"mistral",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-04-30",release_date:"2025-07-09",last_updated:"2025-07-09",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.9},limit:{context:128e3,output:8192}},"perplexity/sonar-pro-search":{id:"perplexity/sonar-pro-search",name:"Sonar Pro Search",family:"sonar-pro",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2025-10-30",last_updated:"2025-10-30",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:3,output:15},limit:{context:2e5,output:8e3}},"perplexity/sonar":{id:"perplexity/sonar",name:"Sonar",family:"sonar",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-01-27",last_updated:"2025-01-27",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1,output:1},limit:{context:127072,output:114364}},"perplexity/sonar-reasoning-pro":{id:"perplexity/sonar-reasoning-pro",name:"Sonar Reasoning Pro",family:"sonar-reasoning",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-03-07",last_updated:"2025-03-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2,output:8},limit:{context:128e3,output:115200}},"perplexity/sonar-pro":{id:"perplexity/sonar-pro",name:"Sonar Pro",family:"sonar-pro",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-03-07",last_updated:"2025-03-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:3,output:15},limit:{context:2e5,output:8e3}},"perplexity/sonar-deep-research":{id:"perplexity/sonar-deep-research",name:"Sonar Deep Research",family:"sonar-deep-research",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-03-07",last_updated:"2025-03-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:2,output:8,reasoning:3},limit:{context:128e3,output:115200}},"rekaai/reka-edge":{id:"rekaai/reka-edge",name:"Reka Edge",family:"reka",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-20",last_updated:"2026-03-20",modalities:{input:["image","text","video"],output:["text"]},open_weights:!0,cost:{input:.1,output:.1},limit:{context:16384,output:14745}},"rekaai/reka-flash-3":{id:"rekaai/reka-flash-3",name:"Reka Flash 3",family:"reka",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,knowledge:"2025-01-31",release_date:"2025-03-12",last_updated:"2025-03-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.1,output:.2},limit:{context:65536,output:58982}}}},"xiaomi-token-plan-sgp":{id:"xiaomi-token-plan-sgp",env:["XIAOMI_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://token-plan-sgp.xiaomimimo.com/v1",name:"Xiaomi Token Plan (Singapore)",doc:"https://platform.xiaomimimo.com/#/docs",models:{"mimo-v2.5-pro":{id:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2.5":{id:"mimo-v2.5",name:"MiMo-V2.5",family:"mimo",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text","image","audio","video"],output:["text"]},open_weights:!0,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}},"mimo-v2-pro":{id:"mimo-v2-pro",name:"MiMo-V2-Pro",family:"mimo",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2024-12",release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:0,output:0,cache_read:0},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"mimo-v2.5-tts-voicedesign":{id:"mimo-v2.5-tts-voicedesign",name:"MiMo-V2.5-TTS-VoiceDesign",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2-tts":{id:"mimo-v2-tts",name:"MiMo-V2-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts-voiceclone":{id:"mimo-v2.5-tts-voiceclone",name:"MiMo-V2.5-TTS-VoiceClone",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}},"mimo-v2.5-tts":{id:"mimo-v2.5-tts",name:"MiMo-V2.5-TTS",family:"mimo",attachment:!1,reasoning:!1,tool_call:!1,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["audio"]},open_weights:!0,cost:{input:0,output:0},limit:{context:8192,output:8192}}}},openai:{id:"openai",env:["OPENAI_API_KEY"],npm:"@ai-sdk/openai",name:"OpenAI",doc:"https://platform.openai.com/docs/models",models:{"gpt-5-nano":{id:"gpt-5-nano",name:"GPT-5 Nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.05,output:.4,cache_read:.005},limit:{context:4e5,input:272e3,output:128e3}},"gpt-4.1-nano":{id:"gpt-4.1-nano",name:"GPT-4.1 nano",family:"gpt-nano",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.1,output:.4,cache_read:.025},limit:{context:1047576,output:32768},status:"deprecated"},"gpt-4o-2024-05-13":{id:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-05-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:5,output:15},limit:{context:128e3,output:4096},status:"deprecated"},"gpt-5-pro":{id:"gpt-5-pro",name:"GPT-5 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-10-06",last_updated:"2025-10-06",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:15,output:120},limit:{context:4e5,input:272e3,output:272e3}},"chatgpt-image-latest":{id:"chatgpt-image-latest",name:"chatgpt-image-latest",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-12-16",last_updated:"2025-12-16",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,limit:{context:0,input:0,output:0}},"gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",family:"gpt-sol",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:4,output:20,cache_read:.4,cache_write:5,context_over_200k:{input:8,output:30,cache_read:.8,cache_write:10}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:8,output:40,cache_read:.8,cache_write:10},provider:{body:{service_tier:"priority"}}},pro:{provider:{body:{reasoning:{mode:"pro"}}}}}}},"gpt-4o-2024-08-06":{id:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-08-06",last_updated:"2024-08-06",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}},"gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",family:"gpt-astra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-04-30",release_date:"2026-09-04",last_updated:"2026-09-04",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:10,output:50,cache_read:1,cache_write:12.5,context_over_200k:{input:20,output:75,cache_read:2,cache_write:25}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:20,output:100,cache_read:2,cache_write:25},provider:{body:{service_tier:"priority"}}},pro:{provider:{body:{reasoning:{mode:"pro"}}}}}}},"gpt-5.2-pro":{id:"gpt-5.2-pro",name:"GPT-5.2 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:21,output:168},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.3-codex-spark":{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",family:"gpt-codex-spark",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:128e3,input:1e5,output:32e3}},"gpt-4.1-mini":{id:"gpt-4.1-mini",name:"GPT-4.1 mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.4,output:1.6,cache_read:.1},limit:{context:1047576,output:32768}},"gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:15,cache_read:.25,context_over_200k:{input:5,output:22.5,cache_read:.5}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:5,output:30,cache_read:.5},provider:{body:{service_tier:"priority"}}}}}},"gpt-4-turbo":{id:"gpt-4-turbo",name:"GPT-4 Turbo",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:10,output:30},limit:{context:128e3,output:4096},status:"deprecated"},"gpt-5.1":{id:"gpt-5.1",name:"GPT-5.1",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-09-30",release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},o1:{id:"o1",name:"o1",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2023-09",release_date:"2024-12-05",last_updated:"2024-12-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:15,output:60,cache_read:7.5},limit:{context:2e5,output:1e5},status:"deprecated"},"gpt-4o":{id:"gpt-4o",name:"GPT-4o",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-05-13",last_updated:"2024-08-06",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}},"gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",family:"gpt-luna",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.2,cache_read:.02,cache_write:.25,context_over_200k:{input:.4,output:1.8,cache_read:.04,cache_write:.5}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:.4,output:2.4,cache_read:.04,cache_write:.5},provider:{body:{service_tier:"priority"}}},pro:{provider:{body:{reasoning:{mode:"pro"}}}}}}},"gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-02-05",last_updated:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"gpt-4o-mini":{id:"gpt-4o-mini",name:"GPT-4o mini",family:"gpt-mini",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-07-18",last_updated:"2024-07-18",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:.15,output:.6,cache_read:.075},limit:{context:128e3,output:16384}},"gpt-image-1.5":{id:"gpt-image-1.5",name:"gpt-image-1.5",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-11-25",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,limit:{context:0,input:0,output:0}},"o1-pro":{id:"o1-pro",name:"o1-pro",family:"o-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2023-09",release_date:"2025-03-19",last_updated:"2025-03-19",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:150,output:600},limit:{context:2e5,output:1e5},status:"deprecated"},"gpt-4.1":{id:"gpt-4.1",name:"GPT-4.1",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2024-04",release_date:"2025-04-14",last_updated:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:1047576,output:32768}},"text-embedding-ada-002":{id:"text-embedding-ada-002",name:"text-embedding-ada-002",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2022-12",release_date:"2022-12-15",last_updated:"2022-12-15",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.1,output:0},limit:{context:8192,output:1536}},"gpt-image-1":{id:"gpt-image-1",name:"gpt-image-1",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-04-24",last_updated:"2025-04-24",modalities:{input:["text","image"],output:["image"]},open_weights:!1,limit:{context:0,input:0,output:0},status:"deprecated"},"gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",family:"gpt-nano",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.25,cache_read:.02},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.5-pro":{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-04-23",last_updated:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:30,output:180,context_over_200k:{input:60,output:270}},limit:{context:105e4,input:922e3,output:128e3}},"gpt-image-1-mini":{id:"gpt-image-1-mini",name:"gpt-image-1-mini",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2025-09-26",last_updated:"2025-09-26",modalities:{input:["text","image"],output:["text","image"]},open_weights:!1,limit:{context:0,input:0,output:0}},"gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-17",last_updated:"2026-03-17",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.75,output:4.5,cache_read:.075},limit:{context:4e5,input:272e3,output:128e3},experimental:{modes:{fast:{cost:{input:1.5,output:9,cache_read:.15},provider:{body:{service_tier:"priority"}}}}}},"gpt-image-2":{id:"gpt-image-2",name:"gpt-image-2",family:"gpt-image",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image"],output:["image"]},open_weights:!1,cost:{input:5,output:30,cache_read:1.25},limit:{context:0,input:0,output:0}},"gpt-3.5-turbo":{id:"gpt-3.5-turbo",name:"GPT-3.5-turbo",family:"gpt",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2021-09-01",release_date:"2023-03-01",last_updated:"2023-11-06",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:1.5,cache_read:0},limit:{context:16385,output:4096},status:"deprecated"},"gpt-5.6":{id:"gpt-5.6",name:"GPT-5.6",family:"gpt-sol",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:4,output:20,cache_read:.4,cache_write:5,context_over_200k:{input:8,output:30,cache_read:.8,cache_write:10}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:8,output:40,cache_read:.8,cache_write:10},provider:{body:{service_tier:"priority"}}},pro:{provider:{body:{reasoning:{mode:"pro"}}}}}}},"text-embedding-3-small":{id:"text-embedding-3-small",name:"text-embedding-3-small",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-01",release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.02,output:0},limit:{context:8191,output:1536}},"gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",family:"gpt-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.25,output:2,cache_read:.025},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.4-pro":{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",family:"gpt-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!1,knowledge:"2025-08-31",release_date:"2026-03-05",last_updated:"2026-03-05",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:30,output:180,context_over_200k:{input:60,output:270}},limit:{context:105e4,input:922e3,output:128e3}},"text-embedding-3-large":{id:"text-embedding-3-large",name:"text-embedding-3-large",family:"text-embedding",attachment:!1,reasoning:!1,tool_call:!1,temperature:!1,knowledge:"2024-01",release_date:"2024-01-25",last_updated:"2024-01-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.13,output:0},limit:{context:8191,output:3072}},"gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",family:"gpt-terra",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2026-02-16",release_date:"2026-07-09",last_updated:"2026-07-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:12,cache_read:.2,cache_write:2.5,context_over_200k:{input:4,output:18,cache_read:.4,cache_write:5}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:4,output:24,cache_read:.4,cache_write:5},provider:{body:{service_tier:"priority"}}},pro:{provider:{body:{reasoning:{mode:"pro"}}}}}}},"gpt-4":{id:"gpt-4",name:"GPT-4",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2023-11",release_date:"2023-11-06",last_updated:"2024-04-09",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:30,output:60},limit:{context:8192,output:8192},status:"deprecated"},"gpt-5.2":{id:"gpt-5.2",name:"GPT-5.2",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5":{id:"gpt-5",name:"GPT-5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-09-30",release_date:"2025-08-07",last_updated:"2025-08-07",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.25,output:10,cache_read:.125},limit:{context:4e5,input:272e3,output:128e3}},"gpt-5.2-chat-latest":{id:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",family:"gpt-codex",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-08-31",release_date:"2025-12-11",last_updated:"2025-12-11",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:128e3,output:16384},status:"deprecated"},"o4-mini":{id:"o4-mini",name:"o4-mini",family:"o-mini",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.275},limit:{context:2e5,output:1e5},status:"deprecated"},"gpt-realtime-2.1":{id:"gpt-realtime-2.1",name:"GPT-Realtime-2.1",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!1,knowledge:"2024-09-30",release_date:"2026-07-06",last_updated:"2026-07-06",modalities:{input:["text","audio","image"],output:["text","audio"]},open_weights:!1,cost:{input:4,output:24,cache_read:.4,input_audio:32,output_audio:64},limit:{context:128e3,input:96e3,output:32e3}},"o3-mini":{id:"o3-mini",name:"o3-mini",family:"o-mini",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2024-12-20",last_updated:"2025-01-29",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.1,output:4.4,cache_read:.55},limit:{context:2e5,output:1e5},status:"deprecated"},o3:{id:"o3",name:"o3",family:"o",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-04-16",last_updated:"2025-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:8,cache_read:.5},limit:{context:2e5,output:1e5}},"o3-pro":{id:"o3-pro",name:"o3-pro",family:"o-pro",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2024-05",release_date:"2025-06-10",last_updated:"2025-06-10",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:20,output:80},limit:{context:2e5,output:1e5}},"gpt-5.3-chat-latest":{id:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-08-31",release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.75,output:14,cache_read:.175},limit:{context:128e3,output:16384},status:"deprecated"},"gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",family:"gpt",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-12-01",release_date:"2026-04-23",last_updated:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:5,output:30,cache_read:.5,context_over_200k:{input:10,output:45,cache_read:1}},limit:{context:105e4,input:922e3,output:128e3},experimental:{modes:{fast:{cost:{input:12.5,output:75,cache_read:1.25},provider:{body:{service_tier:"priority"}}}}}},"gpt-4o-2024-11-20":{id:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",family:"gpt",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2023-09",release_date:"2024-11-20",last_updated:"2024-11-20",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:2.5,output:10,cache_read:1.25},limit:{context:128e3,output:16384}}}},siliconflow:{id:"siliconflow",env:["SILICONFLOW_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.siliconflow.com/v1",name:"SiliconFlow",doc:"https://cloud.siliconflow.com/models",models:{"baidu/ERNIE-4.5-300B-A47B":{id:"baidu/ERNIE-4.5-300B-A47B",name:"baidu/ERNIE-4.5-300B-A47B",family:"ernie",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-02",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.28,output:1.1},limit:{context:131e3,output:131e3}},"stepfun-ai/Step-3.5-Flash":{id:"stepfun-ai/Step-3.5-Flash",name:"stepfun-ai/Step-3.5-Flash",family:"step",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.1,output:.3},limit:{context:262e3,output:262e3}},"deepseek-ai/DeepSeek-V3":{id:"deepseek-ai/DeepSeek-V3",name:"deepseek-ai/DeepSeek-V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-12-26",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V4-Flash":{id:"deepseek-ai/DeepSeek-V4-Flash",name:"DeepSeek V4 Flash",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.028},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/DeepSeek-V3.1":{id:"deepseek-ai/DeepSeek-V3.1",name:"deepseek-ai/DeepSeek-V3.1",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-25",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:1},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V3.1-Terminus":{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"deepseek-ai/DeepSeek-V3.1-Terminus",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-29",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:1},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V3.2-Exp":{id:"deepseek-ai/DeepSeek-V3.2-Exp",name:"deepseek-ai/DeepSeek-V3.2-Exp",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-10",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:.41},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-R1":{id:"deepseek-ai/DeepSeek-R1",name:"deepseek-ai/DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-05-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.5,output:2.18},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V3.2":{id:"deepseek-ai/DeepSeek-V3.2",name:"deepseek-ai/DeepSeek-V3.2",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-12-03",last_updated:"2025-12-03",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.27,output:.42},limit:{context:164e3,output:164e3}},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.74,output:3.48,cache_read:.145},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"inclusionAI/Ling-flash-2.0":{id:"inclusionAI/Ling-flash-2.0",name:"inclusionAI/Ling-flash-2.0",family:"ling",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"google/gemma-4-31B-it":{id:"google/gemma-4-31B-it",name:"Gemma 4 31B IT",family:"gemma",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.13,output:.4},limit:{context:262144,output:262144}},"google/gemma-4-26B-A4B-it":{id:"google/gemma-4-26B-A4B-it",name:"Gemma 4 26B A4B IT",family:"gemma",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.12,output:.4},limit:{context:262144,output:262144}},"zai-org/GLM-5.1":{id:"zai-org/GLM-5.1",name:"zai-org/GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-08",last_updated:"2026-04-08",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:205e3,output:205e3},interleaved:{field:"reasoning_content"}},"zai-org/GLM-5V-Turbo":{id:"zai-org/GLM-5V-Turbo",name:"zai-org/GLM-5V-Turbo",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-04-01",last_updated:"2026-04-01",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:1.2,output:4,cache_read:.24,cache_write:0},limit:{context:2e5,output:131072},interleaved:{field:"reasoning_content"}},"zai-org/GLM-4.5-Air":{id:"zai-org/GLM-4.5-Air",name:"zai-org/GLM-4.5-Air",family:"glm-air",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.86},limit:{context:131e3,output:131e3}},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26,cache_write:0},limit:{context:1049e3,output:262e3},interleaved:{field:"reasoning_content"}},"zai-org/GLM-5":{id:"zai-org/GLM-5",name:"zai-org/GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-06-15",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.95,output:2.55,cache_read:.2},limit:{context:205e3,output:205e3},interleaved:{field:"reasoning_content"}},"Qwen/Qwen3-30B-A3B-Instruct-2507":{id:"Qwen/Qwen3-30B-A3B-Instruct-2507",name:"Qwen/Qwen3-30B-A3B-Instruct-2507",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.09,output:.3},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-30B-A3B-Thinking":{id:"Qwen/Qwen3-VL-30B-A3B-Thinking",name:"Qwen/Qwen3-VL-30B-A3B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-11",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.29,output:1},limit:{context:262e3,output:262e3}},"Qwen/Qwen3.5-27B":{id:"Qwen/Qwen3.5-27B",name:"Qwen3.5 27B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:2},limit:{context:262144,output:262144}},"Qwen/Qwen3-8B":{id:"Qwen/Qwen3-8B",name:"Qwen/Qwen3-8B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.06,output:.06},limit:{context:131e3,output:131e3}},"Qwen/Qwen3-VL-32B-Thinking":{id:"Qwen/Qwen3-VL-32B-Thinking",name:"Qwen/Qwen3-VL-32B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-21",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-14B":{id:"Qwen/Qwen3-14B",name:"Qwen/Qwen3-14B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.07,output:.28},limit:{context:131e3,output:131e3}},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{id:"Qwen/Qwen3-Coder-30B-A3B-Instruct",name:"Qwen/Qwen3-Coder-30B-A3B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-01",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.07,output:.28},limit:{context:262e3,output:262e3}},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen/Qwen3.5-9B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-03",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.1,output:.15},limit:{context:262144,output:262144}},"Qwen/Qwen3.5-122B-A10B":{id:"Qwen/Qwen3.5-122B-A10B",name:"Qwen3.5 122B-A10B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.26,output:2.08},limit:{context:262144,output:262144}},"Qwen/Qwen3-VL-235B-A22B-Instruct":{id:"Qwen/Qwen3-VL-235B-A22B-Instruct",name:"Qwen/Qwen3-VL-235B-A22B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-04",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen/Qwen3-Coder-480B-A35B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-31",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.25,output:1},limit:{context:262e3,output:262e3}},"Qwen/Qwen2.5-7B-Instruct":{id:"Qwen/Qwen2.5-7B-Instruct",name:"Qwen/Qwen2.5-7B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.05},limit:{context:33e3,output:4e3}},"Qwen/Qwen2.5-72B-Instruct":{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen/Qwen2.5-72B-Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-09-18",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.59,output:.59},limit:{context:33e3,output:4e3}},"Qwen/Qwen3.5-397B-A17B":{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5 397B-A17B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-15",last_updated:"2026-02-15",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.39,output:2.34},limit:{context:262144,output:262144}},"Qwen/Qwen3.5-35B-A3B":{id:"Qwen/Qwen3.5-35B-A3B",name:"Qwen3.5 35B-A3B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-23",last_updated:"2026-02-23",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.24,output:1.8},limit:{context:262144,output:262144}},"Qwen/Qwen3-VL-32B-Instruct":{id:"Qwen/Qwen3-VL-32B-Instruct",name:"Qwen/Qwen3-VL-32B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-21",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.2,output:.6},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-32B":{id:"Qwen/Qwen3-32B",name:"Qwen/Qwen3-32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-04-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"Qwen/Qwen3-235B-A22B-Thinking-2507":{id:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen/Qwen3-235B-A22B-Thinking-2507",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-07-28",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.13,output:.6},limit:{context:262e3,output:262e3}},"Qwen/Qwen3.6-27B":{id:"Qwen/Qwen3.6-27B",name:"Qwen3.6 27B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-22",last_updated:"2026-04-22",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:3.2},limit:{context:262144,output:262144}},"Qwen/Qwen3-VL-8B-Instruct":{id:"Qwen/Qwen3-VL-8B-Instruct",name:"Qwen/Qwen3-VL-8B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-15",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.18,output:.68},limit:{context:262e3,output:262e3}},"Qwen/Qwen3.6-35B-A3B":{id:"Qwen/Qwen3.6-35B-A3B",name:"Qwen3.6 35B-A3B",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.2,output:1.6},limit:{context:262144,output:262144}},"Qwen/Qwen3-VL-235B-A22B-Thinking":{id:"Qwen/Qwen3-VL-235B-A22B-Thinking",name:"Qwen/Qwen3-VL-235B-A22B-Thinking",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-04",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.45,output:3.5},limit:{context:262e3,output:262e3}},"Qwen/Qwen3-VL-30B-A3B-Instruct":{id:"Qwen/Qwen3-VL-30B-A3B-Instruct",name:"Qwen/Qwen3-VL-30B-A3B-Instruct",family:"qwen",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-10-05",last_updated:"2025-11-25",modalities:{input:["text","image"],output:["text"]},open_weights:!1,cost:{input:.29,output:1},limit:{context:262e3,output:262e3}},"ByteDance-Seed/Seed-OSS-36B-Instruct":{id:"ByteDance-Seed/Seed-OSS-36B-Instruct",name:"ByteDance-Seed/Seed-OSS-36B-Instruct",family:"seed",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-09-04",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.21,output:.57},limit:{context:262e3,output:262e3}},"MiniMaxAI/MiniMax-M2.5":{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMaxAI/MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2026-02-15",last_updated:"2026-06-15",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.3,output:1.2,cache_read:.03},limit:{context:197e3,output:131e3}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"openai/gpt-oss-20b",family:"gpt-oss",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-13",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.04,output:.18},limit:{context:131e3,output:8e3}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"openai/gpt-oss-120b",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-13",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.05,output:.45},limit:{context:131e3,output:8e3}},"moonshotai/Kimi-K2.5":{id:"moonshotai/Kimi-K2.5",name:"moonshotai/Kimi-K2.5",family:"kimi",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.45,output:2.25,cache_read:.07},limit:{context:262e3,output:262e3},interleaved:{field:"reasoning_content"}},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"moonshotai/Kimi-K2.6",family:"kimi",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-21",last_updated:"2026-06-15",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.77,output:4,cache_read:.2},limit:{context:262e3,output:262e3},interleaved:{field:"reasoning_content"}},"tencent/Hunyuan-A13B-Instruct":{id:"tencent/Hunyuan-A13B-Instruct",name:"tencent/Hunyuan-A13B-Instruct",family:"hunyuan",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-06-30",last_updated:"2025-11-25",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.14,output:.57},limit:{context:131e3,output:131e3}},"tencent/Hy3-preview":{id:"tencent/Hy3-preview",name:"Hy3 preview",family:"Hy",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-04-20",last_updated:"2026-04-20",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.066,output:.26,cache_read:.029},limit:{context:262144,output:262144}}}},moonshotai:{id:"moonshotai",env:["MOONSHOT_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.moonshot.ai/v1",name:"Moonshot AI",doc:"https://platform.moonshot.ai/docs/api/chat",models:{"kimi-k2.7-code-highspeed":{id:"kimi-k2.7-code-highspeed",name:"Kimi K2.7 Code HighSpeed",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:1.9,output:8,cache_read:.38},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"kimi-k2.6":{id:"kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.19},limit:{context:262144,output:262144},interleaved:{field:"reasoning_content"}},"kimi-k3":{id:"kimi-k3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:3,output:15,cache_read:.3},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}}}},xai:{id:"xai",env:["XAI_API_KEY"],npm:"@ai-sdk/xai",name:"xAI",doc:"https://docs.x.ai/docs/models",models:{"grok-4.3":{id:"grok-4.3",name:"Grok 4.3",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-17",last_updated:"2026-04-17",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:1e6,output:3e4}},"grok-4.20-0309-reasoning":{id:"grok-4.20-0309-reasoning",name:"Grok 4.20 (Reasoning)",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-09",last_updated:"2026-03-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:1e6,output:3e4}},"grok-4.20-multi-agent-0309":{id:"grok-4.20-multi-agent-0309",name:"Grok 4.20 Multi-Agent",family:"grok",attachment:!0,reasoning:!0,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2026-03-09",last_updated:"2026-03-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:1e6,output:3e4}},"grok-imagine-image":{id:"grok-imagine-image",name:"Grok Imagine Image",family:"grok",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-01-28",last_updated:"2026-01-28",modalities:{input:["text","image","pdf"],output:["image","pdf"]},open_weights:!1,limit:{context:16e3,output:0}},"grok-imagine-video":{id:"grok-imagine-video",name:"Grok Imagine Video",family:"grok",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-01-28",last_updated:"2026-01-28",modalities:{input:["text","image","video","pdf"],output:["video"]},open_weights:!1,limit:{context:1024,output:0}},"grok-4.5":{id:"grok-4.5",name:"Grok 4.5",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-08",last_updated:"2026-07-08",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.3,context_over_200k:{input:4,output:12,cache_read:.6}},limit:{context:5e5,output:5e5}},"grok-build-0.1":{id:"grok-build-0.1",name:"Grok Build 0.1",family:"grok-build",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-16",last_updated:"2026-04-16",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1,output:2,cache_read:.2,context_over_200k:{input:2,output:4,cache_read:.4}},limit:{context:256e3,output:256e3}},"grok-imagine-video-1.5":{id:"grok-imagine-video-1.5",name:"Grok Imagine Video 1.5",family:"grok",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-05-30",last_updated:"2026-05-30",modalities:{input:["text","image","audio","pdf"],output:["video"]},open_weights:!1,limit:{context:1024,output:0}},"grok-imagine-image-2.0":{id:"grok-imagine-image-2.0",name:"Grok Imagine Image 2.0",family:"grok",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-08-07",last_updated:"2026-08-07",modalities:{input:["text","image","pdf"],output:["image","pdf"]},open_weights:!1,limit:{context:64e3,output:0}},"grok-4.6":{id:"grok-4.6",name:"Grok 4.6",family:"grok",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2026-02-01",release_date:"2026-08-12",last_updated:"2026-08-12",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:2,output:6,cache_read:.5,context_over_200k:{input:4,output:12,cache_read:1}},limit:{context:5e5,output:5e5}},"grok-imagine-image-quality":{id:"grok-imagine-image-quality",name:"Grok Imagine Image Quality",family:"grok",attachment:!0,reasoning:!1,tool_call:!1,temperature:!1,release_date:"2026-04-03",last_updated:"2026-04-03",modalities:{input:["text","image","pdf"],output:["image","pdf"]},open_weights:!1,limit:{context:16e3,output:0}},"grok-4.20-0309-non-reasoning":{id:"grok-4.20-0309-non-reasoning",name:"Grok 4.20 (Non-Reasoning)",family:"grok",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-09",last_updated:"2026-03-09",modalities:{input:["text","image","pdf"],output:["text"]},open_weights:!1,cost:{input:1.25,output:2.5,cache_read:.2,context_over_200k:{input:2.5,output:5,cache_read:.4}},limit:{context:1e6,output:3e4}}}},togetherai:{id:"togetherai",env:["TOGETHER_API_KEY"],npm:"@ai-sdk/togetherai",name:"Together AI",doc:"https://docs.together.ai/docs/serverless-models",models:{"essentialai/Rnj-1-Instruct":{id:"essentialai/Rnj-1-Instruct",name:"Rnj-1 Instruct",family:"rnj",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-10",release_date:"2025-12-05",last_updated:"2025-12-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.15,output:.15},limit:{context:32768,output:32768},status:"deprecated"},"deepseek-ai/DeepSeek-V3-1":{id:"deepseek-ai/DeepSeek-V3-1",name:"DeepSeek V3.1",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-08",release_date:"2025-08-21",last_updated:"2025-08-21",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:1.7},limit:{context:131072,output:131072},status:"deprecated"},"deepseek-ai/DeepSeek-V3":{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek-V3",family:"deepseek",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2024-07",release_date:"2024-12-26",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.25,output:1.25},limit:{context:131072,output:131072},status:"deprecated"},"deepseek-ai/DeepSeek-V4-Flash-0731":{id:"deepseek-ai/DeepSeek-V4-Flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.28,cache_read:.03},limit:{context:1e6,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/DeepSeek-V4-Pro-0813":{id:"deepseek-ai/DeepSeek-V4-Pro-0813",name:"DeepSeek V4 Pro 0813",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.32,output:3.96,cache_read:.13},limit:{context:1048576,output:384e3},interleaved:{field:"reasoning_content"}},"deepseek-ai/DeepSeek-R1":{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek-R1",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,knowledge:"2024-07",release_date:"2025-01-20",last_updated:"2025-03-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:3,output:7},limit:{context:163839,output:163839},status:"deprecated"},"deepseek-ai/DeepSeek-V4-Pro":{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",family:"deepseek",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-24",last_updated:"2026-04-24",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.74,output:3.48,cache_read:.2},limit:{context:512e3,output:384e3},interleaved:{field:"reasoning_content"}},"pearl-ai/gemma-4-31b-it":{id:"pearl-ai/gemma-4-31b-it",name:"Pearl AI Gemma 4 31B Instruct",family:"gemma",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,release_date:"2026-04-07",last_updated:"2026-04-07",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:.28,output:.86},limit:{context:32e3,output:32e3}},"nvidia/nemotron-3-ultra-550b-a55b":{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-04",last_updated:"2026-06-04",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:3.6,cache_read:.2},limit:{context:512300,output:512300}},"google/gemma-4-31B-it":{id:"google/gemma-4-31B-it",name:"Gemma 4 31B Instruct",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-07",last_updated:"2026-04-07",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.39,output:.97},limit:{context:262144,output:131072}},"google/gemma-3n-E4B-it":{id:"google/gemma-3n-E4B-it",name:"Gemma 3N E4B Instruct",family:"gemma",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!0,temperature:!0,release_date:"2025-05-20",last_updated:"2025-05-20",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.06,output:.12},limit:{context:32768,output:32768}},"zai-org/GLM-5.1":{id:"zai-org/GLM-5.1",name:"GLM-5.1",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-11",release_date:"2026-04-07",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:202752,output:131072},status:"deprecated"},"zai-org/GLM-5.3":{id:"zai-org/GLM-5.3",name:"GLM-5.3",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:1048576,output:262144},interleaved:{field:"reasoning_content"}},"zai-org/GLM-5.2":{id:"zai-org/GLM-5.2",name:"GLM-5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-16",last_updated:"2026-06-16",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:512e3,output:164e3},interleaved:{field:"reasoning_content"}},"zai-org/GLM-5":{id:"zai-org/GLM-5",name:"GLM-5",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-02-11",last_updated:"2026-02-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1,output:3.2},limit:{context:202752,output:131072},interleaved:{field:"reasoning_content"},status:"deprecated"},"zai-org/GLM-5.3-Flash":{id:"zai-org/GLM-5.3-Flash",name:"GLM-5.3-Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.15,output:.5,cache_read:.03},limit:{context:1048575,output:4e5},interleaved:{field:"reasoning_content"}},"LiquidAI/LFM2-24B-A2B":{id:"LiquidAI/LFM2-24B-A2B",name:"LFM2-24B-A2B",family:"liquid",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2026-02-25",last_updated:"2026-02-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.03,output:.12},limit:{context:32768,output:32768}},"thinkingmachines/Inkling":{id:"thinkingmachines/Inkling",name:"Inkling",family:"ling",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-07-15",last_updated:"2026-07-15",modalities:{input:["text","image","audio"],output:["text"]},open_weights:!0,cost:{input:1,output:4.05,cache_read:.17},limit:{context:524288,output:131072}},"Qwen/Qwen3.7-Max":{id:"Qwen/Qwen3.7-Max",name:"Qwen3.7 Max",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,release_date:"2026-05-21",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.25,output:3.75,cache_read:.125},limit:{context:1e6,output:5e5}},"Qwen/Qwen3-235B-A22B-Instruct-2507-tput":{id:"Qwen/Qwen3-235B-A22B-Instruct-2507-tput",name:"Qwen3 235B A22B Instruct 2507 FP8",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-07",release_date:"2025-07-25",last_updated:"2025-07-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.6},limit:{context:262144,output:262144},status:"deprecated"},"Qwen/Qwen3.6-Plus":{id:"Qwen/Qwen3.6-Plus",name:"Qwen3.6 Plus",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-04-30",last_updated:"2026-04-30",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:3},limit:{context:1e6,output:5e5}},"Qwen/Qwen3.5-9B":{id:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-03",last_updated:"2026-03-03",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.17,output:.25},limit:{context:262144,output:65536}},"Qwen/Qwen3.5-397B-A17B":{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5 397B A17B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-16",last_updated:"2026-06-15",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.6,output:3.6,cache_read:.35},limit:{context:262144,output:13e4},status:"deprecated"},"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8":{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",name:"Qwen3 Coder 480B A35B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2025-04",release_date:"2025-07-23",last_updated:"2025-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:2,output:2},limit:{context:262144,output:262144},status:"deprecated"},"Qwen/Qwen2.5-7B-Instruct-Turbo":{id:"Qwen/Qwen2.5-7B-Instruct-Turbo",name:"Qwen 2.5 7B Instruct Turbo",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2024-09-19",last_updated:"2024-09-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:.3},limit:{context:32768,output:32768}},"Qwen/Qwen3-Coder-Next-FP8":{id:"Qwen/Qwen3-Coder-Next-FP8",name:"Qwen3 Coder Next FP8",family:"qwen",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2026-02-03",release_date:"2026-02-03",last_updated:"2026-02-03",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:1.2},limit:{context:262144,output:262144},status:"deprecated"},"deepcogito/cogito-v2-1-671b":{id:"deepcogito/cogito-v2-1-671b",name:"Cogito v2.1 671B",family:"cogito",attachment:!1,reasoning:!0,tool_call:!1,temperature:!0,release_date:"2025-11-13",last_updated:"2025-11-13",modalities:{input:["text"],output:["text"]},open_weights:!1,cost:{input:1.25,output:1.25},limit:{context:163840,output:163840}},"MiniMaxAI/MiniMax-M2.5":{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:204800,output:131072},status:"deprecated"},"MiniMaxAI/MiniMax-M3":{id:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:524288,output:25e4}},"MiniMaxAI/MiniMax-M2.7":{id:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06},limit:{context:202752,output:131072}},"meta-llama/Llama-3.3-70B-Instruct-Turbo":{id:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2026-07-02",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.04,output:1.04},limit:{context:131072,output:131072}},"meta-llama/Meta-Llama-3-8B-Instruct-Lite":{id:"meta-llama/Meta-Llama-3-8B-Instruct-Lite",name:"Meta Llama 3 8B Instruct Lite",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,temperature:!0,release_date:"2024-04-18",last_updated:"2024-04-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.14,output:.14},limit:{context:8192,output:8192}},"openai/gpt-oss-20b":{id:"openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.05,output:.2},limit:{context:131072,output:131072}},"openai/gpt-oss-120b":{id:"openai/gpt-oss-120b",name:"GPT OSS 120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2025-08",release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.15,output:.6},limit:{context:131072,output:131072}},"moonshotai/Kimi-K2.5":{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,knowledge:"2026-01",release_date:"2026-01-27",last_updated:"2026-01-27",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.5,output:2.8},limit:{context:262144,output:262144},interleaved:!0,status:"deprecated"},"moonshotai/Kimi-K2.7-Code":{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-14",last_updated:"2026-06-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.19},limit:{context:262144,output:131072}},"moonshotai/Kimi-K2.6":{id:"moonshotai/Kimi-K2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:1.2,output:4.5,cache_read:.2},limit:{context:262144,output:131e3}},"moonshotai/Kimi-K3":{id:"moonshotai/Kimi-K3",name:"Kimi K3",family:"kimi-k3",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!1,release_date:"2026-07-16",last_updated:"2026-07-16",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:3,output:15,cache_read:.3},limit:{context:1048576,output:131072},interleaved:{field:"reasoning_content"}}}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",env:["CLOUDFLARE_ACCOUNT_ID","CLOUDFLARE_API_KEY"],npm:"@ai-sdk/openai-compatible",api:"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1",name:"Cloudflare Workers AI",doc:"https://developers.cloudflare.com/workers-ai/models/",models:{"@cf/qwen/qwen3-30b-a3b-fp8":{id:"@cf/qwen/qwen3-30b-a3b-fp8",name:"Qwen3 30B A3b fp8",family:"qwen",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-04-28",last_updated:"2025-04-28",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.0509,output:.335},limit:{context:32768,output:32768}},"@cf/qwen/qwen3.8-27b":{id:"@cf/qwen/qwen3.8-27b",name:"Qwen3.8 27B",family:"qwen",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.45,output:3.2,cache_read:.05},limit:{context:262144,output:262144}},"@cf/qwen/qwq-32b":{id:"@cf/qwen/qwq-32b",name:"Qwq 32B",family:"qwen",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-04",release_date:"2025-03-05",last_updated:"2025-03-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.66,output:1},limit:{context:24e3,output:24e3}},"@cf/qwen/qwen2.5-coder-32b-instruct":{id:"@cf/qwen/qwen2.5-coder-32b-instruct",name:"Qwen2.5 Coder 32B Instruct",family:"qwen",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2024-11-12",last_updated:"2024-11-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.66,output:1},limit:{context:32768,output:32768}},"@cf/deepseek-ai/deepseek-v4-pro-0813":{id:"@cf/deepseek-ai/deepseek-v4-pro-0813",name:"DeepSeek V4 Pro 0813",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-12",last_updated:"2026-08-22",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.32,output:3.96,cache_read:.044},limit:{context:1048576,output:1048576}},"@cf/deepseek-ai/deepseek-v4-flash-0731":{id:"@cf/deepseek-ai/deepseek-v4-flash-0731",name:"DeepSeek V4 Flash 0731",family:"deepseek-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-05",release_date:"2026-07-31",last_updated:"2026-07-31",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.44,output:1.32,cache_read:.014},limit:{context:1310720,output:1048576}},"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b":{id:"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",name:"Deepseek R1 Distill Qwen 32B",family:"deepseek-thinking",attachment:!1,reasoning:!0,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2024-07",release_date:"2025-01-20",last_updated:"2025-05-29",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.497,output:4.881},limit:{context:8e4,output:8e4}},"@cf/mistralai/mistral-small-3.1-24b-instruct":{id:"@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct",family:"mistral-small",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-03-18",last_updated:"2025-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.351,output:.555},limit:{context:128e3,output:128e3}},"@cf/nvidia/nemotron-3-120b-a12b":{id:"@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",family:"nemotron",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-03-11",last_updated:"2026-03-11",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.5,output:1.5},limit:{context:256e3,output:256e3},interleaved:!0},"@cf/google/gemma-4-26b-a4b-it":{id:"@cf/google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",family:"gemma",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-04-02",last_updated:"2026-04-02",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.1,output:.3},limit:{context:256e3,output:16384},interleaved:!0},"@cf/zai-org/glm-5.2":{id:"@cf/zai-org/glm-5.2",name:"Glm 5.2",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-06-13",last_updated:"2026-06-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:262144,output:256e3}},"@cf/zai-org/glm-5.3-flash":{id:"@cf/zai-org/glm-5.3-flash",name:"Glm 5.3 Flash",family:"glm",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-26",last_updated:"2026-08-26",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.15,output:.5,cache_read:.03},limit:{context:1310720,output:1048576}},"@cf/zai-org/glm-5.3":{id:"@cf/zai-org/glm-5.3",name:"Glm 5.3",family:"glm",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2026-08-14",last_updated:"2026-08-14",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:1.4,output:4.4,cache_read:.26},limit:{context:1310720,output:1310720}},"@cf/zai-org/glm-4.7-flash":{id:"@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",family:"glm-flash",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-04",release_date:"2026-01-19",last_updated:"2026-01-19",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.0605,output:.4},limit:{context:131072,output:131072},interleaved:{field:"reasoning_content"}},"@cf/aisingapore/gemma-sea-lion-v4-27b-it":{id:"@cf/aisingapore/gemma-sea-lion-v4-27b-it",name:"Gemma Sea Lion V4 27B It",family:"gemma",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,release_date:"2025-09-23",last_updated:"2025-09-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.351,output:.555},limit:{context:128e3,output:128e3}},"@cf/meta/llama-guard-3-8b":{id:"@cf/meta/llama-guard-3-8b",name:"Llama Guard 3 8B",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.484,output:.03},limit:{context:131072,output:131072}},"@cf/meta/llama-3.1-8b-instruct-fp8":{id:"@cf/meta/llama-3.1-8b-instruct-fp8",name:"Llama 3.1 8B Instruct fp8",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-07-23",last_updated:"2024-07-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.152,output:.287},limit:{context:32e3,output:32e3}},"@cf/meta/llama-3.2-3b-instruct":{id:"@cf/meta/llama-3.2-3b-instruct",name:"Llama 3.2 3B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.0509,output:.335},limit:{context:8e4,output:8e4}},"@cf/meta/llama-3.2-1b-instruct":{id:"@cf/meta/llama-3.2-1b-instruct",name:"Llama 3.2 1B Instruct",family:"llama",attachment:!1,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.027,output:.201},limit:{context:6e4,output:6e4}},"@cf/meta/llama-4-scout-17b-16e-instruct":{id:"@cf/meta/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",family:"llama",attachment:!0,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2024-08",release_date:"2025-04-05",last_updated:"2025-04-05",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.27,output:.85},limit:{context:131e3,output:16384}},"@cf/meta/llama-3.3-70b-instruct-fp8-fast":{id:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct fp8 Fast",family:"llama",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-12-06",last_updated:"2024-12-06",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.293,output:2.253},limit:{context:24e3,output:24e3}},"@cf/meta/llama-3.2-11b-vision-instruct":{id:"@cf/meta/llama-3.2-11b-vision-instruct",name:"Llama 3.2 11B Vision Instruct",family:"llama",attachment:!0,reasoning:!1,tool_call:!1,structured_output:!1,temperature:!0,knowledge:"2023-12",release_date:"2024-09-25",last_updated:"2024-09-25",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.0485,output:.676},limit:{context:128e3,output:128e3}},"@cf/ibm-granite/granite-4.0-h-micro":{id:"@cf/ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 H Micro",family:"granite",attachment:!1,reasoning:!1,tool_call:!0,structured_output:!1,temperature:!0,release_date:"2025-10-07",last_updated:"2025-10-07",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.017,output:.112},limit:{context:131e3,output:131e3}},"@cf/openai/gpt-oss-20b":{id:"@cf/openai/gpt-oss-20b",name:"GPT OSS 20B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.2,output:.3},limit:{context:128e3,output:16384}},"@cf/openai/gpt-oss-120b":{id:"@cf/openai/gpt-oss-120b",name:"GPT OSS 120B",family:"gpt-oss",attachment:!1,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,release_date:"2025-08-05",last_updated:"2025-08-05",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.35,output:.75},limit:{context:128e3,output:16384}},"@cf/moonshotai/kimi-k2.6":{id:"@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-04-21",last_updated:"2026-04-21",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.16},limit:{context:262144,output:256e3},interleaved:{field:"reasoning_content"}},"@cf/moonshotai/kimi-k2.7-code":{id:"@cf/moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",family:"kimi-k2",attachment:!0,reasoning:!0,tool_call:!0,structured_output:!0,temperature:!0,knowledge:"2025-01",release_date:"2026-06-12",last_updated:"2026-06-12",modalities:{input:["text","image"],output:["text"]},open_weights:!0,cost:{input:.95,output:4,cache_read:.19},limit:{context:262144,output:262144}}}},"minimax-cn":{id:"minimax-cn",env:["MINIMAX_API_KEY"],npm:"@ai-sdk/anthropic",api:"https://api.minimaxi.com/anthropic/v1",name:"MiniMax (minimaxi.com)",doc:"https://platform.minimaxi.com/docs/guides/quickstart",models:{"MiniMax-M2":{id:"MiniMax-M2",name:"MiniMax-M2",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-10-27",last_updated:"2025-10-27",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2},limit:{context:204800,output:131072}},"MiniMax-M2.1":{id:"MiniMax-M2.1",name:"MiniMax-M2.1",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2025-12-23",last_updated:"2025-12-23",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.5":{id:"MiniMax-M2.5",name:"MiniMax-M2.5",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-12",last_updated:"2026-02-12",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.03,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.5-highspeed":{id:"MiniMax-M2.5-highspeed",name:"MiniMax-M2.5-highspeed",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-02-13",last_updated:"2026-02-13",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.4,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M3":{id:"MiniMax-M3",name:"MiniMax-M3",family:"minimax",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-06-01",last_updated:"2026-06-25",modalities:{input:["text","image","video"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06,context_over_200k:{input:.6,output:2.4,cache_read:.12}},limit:{context:1048576,output:512e3}},"MiniMax-M2.7-highspeed":{id:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.6,output:2.4,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}},"MiniMax-M2.7":{id:"MiniMax-M2.7",name:"MiniMax-M2.7",family:"minimax",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,release_date:"2026-03-18",last_updated:"2026-03-18",modalities:{input:["text"],output:["text"]},open_weights:!0,cost:{input:.3,output:1.2,cache_read:.06,cache_write:.375},limit:{context:204800,output:131072}}}}};var Hlt="@ai-sdk/openai-compatible",Zlt={input:["text"],output:["text"]},Klt={context:0,output:0};function _1e(e){return e.issues.map(function(t){return"".concat(t.path.length>0?t.path.join("."):"(root)",": ").concat(t.message)}).join("; ")}function zc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";var i,o,a,s,l,c,d,u,p,m,h;var r=((i=e.id)==null?void 0:i.trim())||t.trim(),n=e.modalities||Zlt;return{id:r,name:((o=e.name)==null?void 0:o.trim())||"",family:((a=e.family)==null?void 0:a.trim())||void 0,attachment:(s=e.attachment)!=null?s:!1,reasoning:(l=e.reasoning)!=null?l:!1,tool_call:(c=e.tool_call)!=null?c:!0,structured_output:e.structured_output,temperature:(d=e.temperature)!=null?d:!0,knowledge:((u=e.knowledge)==null?void 0:u.trim())||void 0,release_date:((p=e.release_date)==null?void 0:p.trim())||"",last_updated:((m=e.last_updated)==null?void 0:m.trim())||"",modalities:{input:_to_consumable_array(n.input),output:_to_consumable_array(n.output)},open_weights:(h=e.open_weights)!=null?h:!1,cost:e.cost,limit:_object_spread({},e.limit||Klt),interleaved:e.interleaved,provider:e.provider?_object_spread({},e.provider):void 0,status:e.status,experimental:e.experimental}}function GU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";var n,i,o,a,s,l;return{id:((n=e.id)==null?void 0:n.trim())||t.trim(),env:_to_consumable_array(e.env||[]),npm:((i=e.npm)==null?void 0:i.trim())||Hlt,api:((o=e.api)==null?void 0:o.trim())||void 0,name:((a=e.name)==null?void 0:a.trim())||"",doc:((s=e.doc)==null?void 0:s.trim())||"",apiKey:e.apiKey||"",allowBrowserCors:(l=e.allowBrowserCors)!=null?l:!1,models:Qlt(e.models)}}function Qlt(e){return Object.fromEntries(Object.entries(e||{}).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];var n=zc(r,t);return[n.id,n]}))}function ZA(e){var t=x1e.safeParse(e!=null?e:{});if(!t.success)throw new Error("Invalid AI providers: ".concat(_1e(t.error)));return Object.fromEntries(Object.entries(t.data).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];var i=GU(n,r);return[i.id,i]}))}function bf(e,t){if(!t)return;var r=Wi(e,t.providerId),n=Da(r,t.modelId);if(!(!r||!n))return{providerId:r.id,modelId:n.id}}function Ev(e,t){var r=bf(e,t);return{providerId:r==null?void 0:r.providerId,modelId:r==null?void 0:r.modelId}}function b1e(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"")}function Wi(e,t){return t?e[t]:void 0}function Da(e,t){return t?e==null?void 0:e.models[t]:void 0}function Sh(e){return Object.values(e)}function sp(e){return Object.values((e==null?void 0:e.models)||{})}function wf(e){return sp(e)[0]}var Cv=null;function w1e(e){var t=VU.safeParse(e);return t.success?{success:!0,data:t.data}:(Me.error(t.error),{success:!1})}function HU(e){var t=w1e(e);return t.success?t.data:void 0}function ZU(e){var t=w1e(e);return t.success?(Cv=t.data,!0):!1}function S1e(){Cv=null}function Q6(){if(Cv)return Cv;var e=VU.safeParse(y1e);if(!e.success)throw new Error("Invalid preset AI providers: ".concat(_1e(e.error)));return Cv=e.data,Cv}function k1e(){return Object.values(Q6()).sort(function(e,t){return e.name.localeCompare(t.name)})}function v1e(e){var t=e==null?void 0:e.trim();if(t)return t.replace(/\/+$/,"")}function C1e(e){var t=v1e(e);if(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(Q6())[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(v1e(r.api)===t)return r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}function E1e(e,t){var r=e.trim();if(!r)return;var n=C1e(t);if(n){var i=n.models[r];if(i)return zc(i,r)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(Q6())[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i10=_step.value;var o=i10.models[r];if(o)return zc(o,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function T1e(e){var t=C1e(e.api);return t?Object.entries(t.models).filter(function(param){var _param=_sliced_to_array(param,1),r=_param[0];return!e.models[r]}).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];return zc(n,r)}):[]}function A1e(e,t){return _object_spread_props(_object_spread({},e),{apiKey:t,allowBrowserCors:!1,models:Object.fromEntries(Object.entries(e.models).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];return[r,zc(n,r)]}))})}var Vi=require("obsidian");var KU="https://api.openai.com/v1",Jlt="https://api.anthropic.com/v1",Ylt="https://generativelanguage.googleapis.com/v1beta",QU="https://api.x.ai/v1",Xlt={"@ai-sdk/openai":KU,"@ai-sdk/anthropic":Jlt,"@ai-sdk/google":Ylt,"@ai-sdk/xai":QU};function KA(e){return Xlt[e]}var QA=require("obsidian");var J6=/*#__PURE__*/function(_QA_Modal){"use strict";_inherits(J61,_QA_Modal);function J61(r,n){_class_call_check(this,J61);var _this;_this=_call_super(this,J61,[r]);_this.onConfirm=n;return _this}_create_class(J61,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.createEl("h2",{text:P.t("settings.ai.nutstoreLlmGateway.betaModal.title")}),r.createEl("p",{text:P.t("settings.ai.nutstoreLlmGateway.betaModal.message")}),new QA.Setting(r).addButton(function(n){return n.setButtonText(P.t("settings.ai.nutstoreLlmGateway.betaModal.cancel")).onClick(function(){return _this.close()})}).addButton(function(n){return n.setButtonText(P.t("settings.ai.nutstoreLlmGateway.betaModal.confirm")).setCta().onClick(function(){_this.close(),_this.onConfirm()})})}},{key:"onClose",value:function onClose(){this.contentEl.empty()}}]);return J61}(QA.Modal);var ia=require("obsidian");var Sf=require("obsidian");var I1e=["text","image","pdf","video","audio","file"],Tv=/*#__PURE__*/function(_Sf_Modal){"use strict";_inherits(Tv1,_Sf_Modal);function Tv1(r,n,i,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};_class_call_check(this,Tv1);var _this;_this=_call_super(this,Tv1,[r.app]);_this.onSave=i;_this.isNew=o;_this.options=a;A(_this,"draft");A(_this,"lastMatchedModelId");A(_this,"updateInputModalityTags");A(_this,"cleanupModalMount");_this.draft=Ko(n),_this.ensureModalities(),_this.isNew&&!_this.draft.id.trim()&&_this.draft.modalities.input.length===1&&_this.draft.modalities.input[0]==="text"&&(_this.draft.modalities.input=[]);return _this}_create_class(Tv1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:this.isNew?P.t("settings.ai.modals.model.createTitle"):P.t("settings.ai.modals.model.editTitle")}),new Sf.Setting(r).setName(P.t("settings.ai.model.id")).setDesc(P.t("settings.ai.model.idDesc")).then(function(a){return Er(a.settingEl,"setting-required")}).addText(function(a){a.setValue(_this.draft.id).onChange(function(s){_this.draft.id=s,_this.draft.name=s,_this.lastMatchedModelId=void 0}),a.inputEl.addEventListener("blur",function(){return _this.applyPresetModelById()})});var i=new Sf.Setting(r).setName(P.t("settings.ai.model.inputModalities")).controlEl.createDiv({cls:"ns-mzyy3f"}),o=function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Array.from(i.children)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;var s=a,l=s.dataset.modality,c=_this.draft.modalities.input.includes(l);$p(s,"is-active",c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};this.updateInputModalityTags=o;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var a=_step.value;var s=i.createEl("button",{text:a,cls:"model-editor-modality-tag"});s.type="button",s.dataset.modality=a,s.addEventListener("click",function(){var l=_this.draft.modalities.input.includes(a)?_this.draft.modalities.input.filter(function(c){return c!==a}):_to_consumable_array(_this.draft.modalities.input).concat([a]);_this.draft.modalities.input=_this.normalizeInputModalities(l),o()})};for(var _iterator=I1e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o(),new Sf.Setting(r).addButton(function(a){return a.setButtonText(P.t("settings.filters.save")).setCta().onClick(function(){return _async_to_generator(function(){var _$s,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.draft.id.trim()){new Sf.Notice(P.t("settings.ai.errors.emptyModelId"));return[2]}_state.label=1;case 1:_state.trys.push([1,3,,4]);_$s=Ko(this.draft);_$s.id=_$s.id.trim(),_$s.modalities.input=this.normalizeInputModalities(_$s.modalities.input);return[4,this.onSave(_$s)];case 2:if(!_state.sent())return[2];this.close();return[3,4];case 3:s=_state.sent();Me.error(s),new Sf.Notice("".concat(P.t("settings.ai.errors.saveFailed"),": ").concat(s==null?void 0:s.message));return[3,4];case 4:return[2]}})}).call(_this)})}).addButton(function(a){return a.setButtonText(P.t("settings.filters.cancel")).onClick(function(){return _this.close()})})}},{key:"open",value:function open(){_get(_get_prototype_of(Tv1.prototype),"open",this).call(this),this.cleanupModalMount=zd(this,this.options.modalMountTarget)}},{key:"onClose",value:function onClose(){var r;(r=this.cleanupModalMount)==null||r.call(this),this.cleanupModalMount=void 0,this.contentEl.empty(),this.updateInputModalityTags=void 0}},{key:"ensureModalities",value:function ensureModalities(){this.draft.modalities=this.draft.modalities||{input:[],output:[]},this.draft.modalities.input=this.normalizeInputModalities(this.draft.modalities.input),this.draft.modalities.output=this.draft.modalities.output||[]}},{key:"normalizeInputModalities",value:function normalizeInputModalities(r){var n=new Set(r);return I1e.filter(function(i){return n.has(i)})}},{key:"applyPresetModelById",value:function applyPresetModelById(){var i;if(!this.options.findPresetOnSave)return;var r=this.draft.id.trim();if(!r||this.lastMatchedModelId===r)return;this.lastMatchedModelId=r;var n=E1e(r,this.options.presetProviderApi);n&&(this.draft=_object_spread_props(_object_spread({},Ko(n)),{id:r,modalities:_object_spread_props(_object_spread({},Ko(n.modalities)),{input:this.normalizeInputModalities(n.modalities.input)})}),(i=this.updateInputModalityTags)==null||i.call(this))}}]);return Tv1}(Sf.Modal);var JA=require("obsidian");var Y6=/*#__PURE__*/function(_JA_Modal){"use strict";_inherits(Y61,_JA_Modal);function Y61(r,n){_class_call_check(this,Y61);var _this;_this=_call_super(this,Y61,[r]);_this.mountTarget=n;A(_this,"confirmed",!1);A(_this,"cleanupModalMount");return _this}_create_class(Y61,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:P.t("settings.ai.modals.provider.corsConfirmTitle")}),r.createEl("p",{text:P.t("settings.ai.modals.provider.corsConfirmMessage")}),new JA.Setting(r).addButton(function(n){return n.setButtonText(P.t("settings.filters.cancel")).onClick(function(){return _this.close()})}).addButton(function(n){return n.setButtonText(P.t("settings.ai.modals.provider.corsConfirmEnable")).setCta().onClick(function(){_this.confirmed=!0,_this.close()})})}},{key:"openAndWait",value:function openAndWait(){var _this=this;return _get(_get_prototype_of(Y61.prototype),"open",this).call(this),this.cleanupModalMount=zd(this,this.mountTarget),new Promise(function(r){var n=_this.onClose.bind(_this);_this.onClose=function(){n(),r(_this.confirmed)}})}},{key:"onClose",value:function onClose(){var r;(r=this.cleanupModalMount)==null||r.call(this),this.cleanupModalMount=void 0,this.contentEl.empty()}}]);return Y61}(JA.Modal);var P1e=[{value:"@ai-sdk/openai-compatible",labelKey:"settings.ai.provider.apiFormat.openaiChatCompletions"},{value:"@ai-sdk/openai",labelKey:"settings.ai.provider.apiFormat.openaiResponses"},{value:"@ai-sdk/anthropic",labelKey:"settings.ai.provider.apiFormat.anthropic"}],kh=/*#__PURE__*/function(_ia_Modal){"use strict";_inherits(kh1,_ia_Modal);function kh1(r,n,i,o,a){_class_call_check(this,kh1);var _this;_this=_call_super(this,kh1,[r.app]);_this.plugin=r;_this.onSave=i;_this.isNew=o;_this.mountTarget=a;A(_this,"draft");A(_this,"cleanupModalMount");_this.draft=Ko(n);return _this}_create_class(kh1,[{key:"onOpen",value:function onOpen(){Er(this.modalEl,"provider-editor-modal"),Er(this.contentEl,"provider-editor-modal__content"),this.render()}},_define_property({key:"render"},"value",function render(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty();var n=r.createDiv({cls:"ns-519e92"}),i=r.createDiv({cls:"provider-editor-modal__footer"});n.createEl("h2",{text:this.isNew?P.t("settings.ai.modals.provider.createTitle"):P.t("settings.ai.modals.provider.editTitle")}),new ia.Setting(n).setName(P.t("settings.ai.provider.name")).setDesc(P.t("settings.ai.provider.desc")).then(function(s){return Er(s.settingEl,"setting-required")}).addText(function(s){return s.setValue(_this.draft.name).onChange(function(l){_this.draft.name=l})}),new ia.Setting(n).setName(P.t("settings.ai.provider.apiFormat.name")).setDesc(P.t("settings.ai.provider.apiFormat.desc")).addDropdown(function(s){var l=P1e.map(function(c){return c.value});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=P1e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;s.addOption(c.value,P.t(c.labelKey))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}l.includes(_this.draft.npm)||s.addOption(_this.draft.npm,P.t("settings.ai.provider.apiFormat.other",{npm:_this.draft.npm})),s.setValue(_this.draft.npm),s.onChange(function(c){_this.draft.npm=c})}),new ia.Setting(n).setName(P.t("settings.ai.provider.baseUrl.name")).setDesc(P.t("settings.ai.provider.baseUrl.desc")).then(function(s){return Er(s.settingEl,"setting-required")}).addText(function(s){return s.setPlaceholder("https://api.openai.com/v1").setValue(_this.draft.api||"").onChange(function(l){_this.draft.api=l.trim()||void 0})}),new ia.Setting(n).setName(P.t("settings.ai.provider.apiKey.name")).setDesc(P.t("settings.ai.provider.apiKey.desc")).then(function(s){return Er(s.settingEl,"setting-required")}).addText(function(s){s.setValue(_this.draft.apiKey).onChange(function(l){_this.draft.apiKey=l}),s.inputEl.type="password"}),new ia.Setting(n).setName(P.t("settings.ai.provider.allowBrowserCors.name")).setDesc(P.t("settings.ai.provider.allowBrowserCors.desc")).addToggle(function(s){return s.setValue(!!_this.draft.allowBrowserCors).onChange(function(l){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!l){this.draft.allowBrowserCors=!1;return[2]}return[4,new Y6(this.app,this.mountTarget).openAndWait()];case 1:if(!_state.sent()){this.render();return[2]}this.draft.allowBrowserCors=!0;return[2]}})}).call(_this)})});var o=n.createDiv({cls:"provider-editor-modal__models"});new ia.Setting(o).setName(P.t("settings.ai.models.name")).setDesc(P.t("settings.ai.models.desc")).addButton(function(s){return s.setButtonText(P.t("settings.ai.models.add")).onClick(function(){new Tv(_this.plugin,zc(),function(l){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.draft.models[l.id]?(new ia.Notice(P.t("settings.ai.errors.duplicateModelId")),!1):(this.draft.models=_object_spread_props(_object_spread({},this.draft.models),_define_property({},l.id,l)),this.render(),!0)]})}).call(_this)},!0,{findPresetOnSave:!0,presetProviderApi:_this.draft.api,modalMountTarget:_this.mountTarget}).open()})});var a=sp(this.draft);a.length===0&&o.createDiv({cls:"setting-item-description",text:P.t("settings.ai.models.empty")});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var s=_step.value;new ia.Setting(o).setName(s.name||P.t("settings.ai.unnamedModel")).then(function(l){var d,u;var c=(u=(d=s.modalities)==null?void 0:d.input)!=null?u:["text"];l.descEl.createDiv({cls:"ns-8lsjlt"},function(p){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;p.createSpan({cls:"modality-badge modality-badge-".concat(m),text:m})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}})}).addButton(function(l){return l.setButtonText(P.t("settings.ai.modals.model.edit")).onClick(function(){new Tv(_this.plugin,s,function(c){return _async_to_generator(function(){var _this_draft_models,_key,u,p;return _ts_generator(this,function(_state){if(c.id!==s.id&&this.draft.models[c.id])return[2,(new ia.Notice(P.t("settings.ai.errors.duplicateModelId")),!1)];_this_draft_models=this.draft.models,_key=s.id,u=_this_draft_models[_key],p=_object_without_properties(_this_draft_models,[_to_property_key(_key)]);return[2,(this.draft.models=_object_spread_props(_object_spread({},p),_define_property({},c.id,c)),this.render(),!0)]})}).call(_this)},!1,{modalMountTarget:_this.mountTarget}).open()})}).addButton(function(l){var c=!1,d=function(){c=!1,l.buttonEl.empty(),(0,ia.setIcon)(l.buttonEl,"trash"),Dn(l.buttonEl,"mod-warning")};l.setIcon("trash").onClick(function(){if(!c){c=!0,l.buttonEl.empty(),l.buttonEl.createSpan({text:P.t("settings.ai.modals.confirmDeleteLabel")}),Er(l.buttonEl,"mod-warning");return}_this.deleteModel(s)}),l.buttonEl.addEventListener("blur",d)})};for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}new ia.Setting(i).addButton(function(s){return s.setButtonText(P.t("settings.filters.save")).setCta().onClick(function(){return _async_to_generator(function(){var _$l,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);_$l=Ko(this.draft);this.isNew&&(_$l.id=b1e(_$l.name));return[4,this.onSave(_$l)];case 1:if(!_state.sent())return[2];new ia.Notice(P.t("settings.ai.modals.provider.saved")),this.close();return[3,3];case 2:l=_state.sent();Me.error(l),new ia.Notice(_instanceof(l,Error)?l.message:P.t("settings.ai.errors.saveFailed"));return[3,3];case 3:return[2]}})}).call(_this)})}).addButton(function(s){return s.setButtonText(P.t("settings.filters.cancel")).onClick(function(){return _this.close()})})}),_define_property({key:"deleteModel"},"value",function deleteModel(r){var _this_draft_models=this.draft.models,_key=r.id,n=_this_draft_models[_key],i=_object_without_properties(_this_draft_models,[_to_property_key(_key)]);this.draft.models=i,new ia.Notice(P.t("settings.ai.modals.model.deleted")),this.render()}),{key:"open",value:function open(){_get(_get_prototype_of(kh1.prototype),"open",this).call(this),this.cleanupModalMount=zd(this,this.mountTarget)}},{key:"onClose",value:function onClose(){var r;(r=this.cleanupModalMount)==null||r.call(this),this.cleanupModalMount=void 0,Dn(this.modalEl,"provider-editor-modal"),Dn(this.contentEl,"provider-editor-modal__content"),this.contentEl.empty()}}]);return kh1}(ia.Modal);var YA=require("obsidian");var X6=/*#__PURE__*/function(_YA_Modal){"use strict";_inherits(X61,_YA_Modal);function X61(r,n,i){_class_call_check(this,X61);var _this;_this=_call_super(this,X61,[r]);_this.provider=n;_this.models=i;A(_this,"confirmed",!1);return _this}_create_class(X61,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:P.t("settings.ai.modals.providers.updateModelsTitle")}),r.createEl("p",{text:P.t("settings.ai.modals.providers.updateModelsDesc",{provider:this.provider.name||this.provider.id,count:this.models.length})});var n=r.createEl("ul",{cls:"ns-tjnmw4"});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.models[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=n.createEl("li");o.createSpan({text:i.name&&i.name!==i.id?"".concat(i.name," "):""}),o.createEl("code",{text:i.id})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}new YA.Setting(r).addButton(function(i){return i.setButtonText(P.t("settings.filters.cancel")).onClick(function(){return _this.close()})}).addButton(function(i){return i.setButtonText(P.t("settings.ai.modals.providers.updateModelsConfirm")).setCta().onClick(function(){_this.confirmed=!0,_this.close()})})}},{key:"openAndWait",value:function openAndWait(){var _this=this;return _get(_get_prototype_of(X61.prototype),"open",this).call(this),new Promise(function(r){var n=_this.onClose.bind(_this);_this.onClose=function(){n(),r(_this.confirmed)}})}},{key:"onClose",value:function onClose(){this.contentEl.empty()}}]);return X61}(YA.Modal);var JU="__custom__",eS=/*#__PURE__*/function(_Vi_Modal){"use strict";_inherits(eS1,_Vi_Modal);function eS1(r,n){_class_call_check(this,eS1);var _this;_this=_call_super(this,eS1,[r.app]);_this.plugin=r;_this.onChanged=n;A(_this,"selectedPresetId",JU);A(_this,"authSubscription",null);A(_this,"presetModelsRefreshState","idle");A(_this,"presetModelsRefreshSummary",{providersDelta:0,modelsDelta:0});return _this}_create_class(eS1,[{key:"onOpen",value:function onOpen(){var _this=this;this.authSubscription=qA().subscribe(function(){_this.render()}),this.render()}},_define_property({key:"render"},"value",function render(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:P.t("settings.ai.modals.providers.title")});var n=k1e();new Vi.Setting(r).setName(P.t("settings.ai.providers.refreshPresetName")).setDesc(P.t("settings.ai.providers.refreshPresetDesc")).addButton(function(o){o.setButtonText(_this.getPresetRefreshButtonText()).setDisabled(_this.presetModelsRefreshState==="loading");var a=o.buttonEl;$p(a,"connection-button",_this.presetModelsRefreshState!=="idle"),$p(a,"loading",_this.presetModelsRefreshState==="loading"),$p(a,"ns-fx8a6s",_this.presetModelsRefreshState==="loading"),$p(a,"ns-b8p3m5",_this.presetModelsRefreshState==="loading"),$p(a,"success",_this.presetModelsRefreshState==="success"),$p(a,"mod-warning",_this.presetModelsRefreshState==="error"),o.onClick(function(){return _async_to_generator(function(){var _$s,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(this.presetModelsRefreshState!=="loading"))return[3,5];this.presetModelsRefreshState="loading",this.presetModelsRefreshSummary={providersDelta:0,modelsDelta:0},this.render();_state.label=1;case 1:_state.trys.push([1,3,4,5]);return[4,this.plugin.modelsPresetService.refreshFromRemote()];case 2:_$s=_state.sent();this.presetModelsRefreshState=_$s.success?"success":"error",this.presetModelsRefreshSummary={providersDelta:_$s.providersDelta,modelsDelta:_$s.modelsDelta},_$s.success||new Vi.Notice(_$s.errorMessage?P.t("settings.ai.providers.presetModelsRefreshFailedWithReason",{reason:_$s.errorMessage}):P.t("settings.ai.providers.presetModelsRefreshFailed"),1e4);return[3,5];case 3:s=_state.sent();Me.error(s),this.presetModelsRefreshState="error",new Vi.Notice(_instanceof(s,Error)?P.t("settings.ai.providers.presetModelsRefreshFailedWithReason",{reason:s.message}):P.t("settings.ai.providers.presetModelsRefreshFailed"),1e4);return[3,5];case 4:this.render();return[7];case 5:return[2]}})}).call(_this)})}),new Vi.Setting(r).setName(P.t("settings.ai.providers.name")).setDesc(P.t("settings.ai.providers.desc")).addDropdown(function(o){Er(o.selectEl,"ns-r1ynr0"),o.addOption(JU,P.t("settings.ai.providers.presetCustom"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;o.addOption(a.id,a.name)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o.setValue(_this.selectedPresetId),o.onChange(function(a){_this.selectedPresetId=a})}).addButton(function(o){return o.setButtonText(P.t("settings.ai.providers.add")).setCta().onClick(function(){var a=_this.selectedPresetId!==JU?n.find(function(l){return l.id===_this.selectedPresetId}):void 0,s=a?A1e(a,""):GU();new kh(_this.plugin,s,function(l){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.validateProviderKey(l))return[3,2];this.plugin.settings.ai.providers=_object_spread_props(_object_spread({},this.plugin.settings.ai.providers),_define_property({},l.id,l));return[4,this.onChanged()];case 1:_tmp=(_state.sent(),this.render(),!0);return[3,3];case 2:_tmp=!1;_state.label=3;case 3:return[2,_tmp]}})}).call(_this)},!0).open()})}),this.renderNutstoreGatewaySection();var i=Sh(this.plugin.settings.ai.providers).filter(function(o){return!_this.plugin.nutstoreLlmGatewayService.isManagedProvider(o)});if(i.length===0){r.createDiv({cls:"setting-item-description",text:P.t("settings.ai.providers.empty")});return}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var o=_step.value;var a=T1e(o);new Vi.Setting(r).setName(o.name||P.t("settings.ai.unnamedProvider")).setDesc(o.api||KA(o.npm)||P.t("settings.ai.providers.defaultEndpoint")).then(function(s){a.length>0&&s.descEl.createDiv({cls:"setting-item-description",text:P.t("settings.ai.providers.updateModelsHint",{count:a.length})})}).addButton(function(s){if(a.length===0){s.buttonEl.hide();return}s.setButtonText(P.t("settings.ai.providers.updateModels")).setCta().onClick(function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,new X6(this.plugin.app,o,a).openAndWait()];case 1:_tmp=_state.sent();if(!_tmp)return[3,3];return[4,this.addMissingPresetModels(o,a)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})}).call(_this)})}).addButton(function(s){return s.setButtonText(P.t("settings.ai.modals.provider.edit")).onClick(function(){new kh(_this.plugin,o,function(l){return _async_to_generator(function(){var _this_plugin_settings_ai_providers,_key,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.validateProviderKey(l,o.id))return[2,!1];_this_plugin_settings_ai_providers=this.plugin.settings.ai.providers,_key=o.id,c=_this_plugin_settings_ai_providers[_key],d=_object_without_properties(_this_plugin_settings_ai_providers,[_to_property_key(_key)]);this.plugin.settings.ai.providers=_object_spread_props(_object_spread({},d),_define_property({},l.id,l));return[4,this.onChanged()];case 1:return[2,(_state.sent(),this.render(),!0)]}})}).call(_this)},!1).open()})}).addButton(function(s){var l=!1,c=function(){l=!1,s.buttonEl.empty(),(0,Vi.setIcon)(s.buttonEl,"trash"),Dn(s.buttonEl,"mod-warning")};s.setIcon("trash").onClick(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!l){l=!0,s.buttonEl.empty(),s.buttonEl.createSpan({text:P.t("settings.ai.modals.confirmDeleteLabel")}),Er(s.buttonEl,"mod-warning");return[2]}return[4,this.deleteProvider(o)];case 1:_state.sent();return[2]}})}).call(_this)}),s.buttonEl.addEventListener("blur",c)})};for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}),{key:"getPresetRefreshButtonText",value:function getPresetRefreshButtonText(){switch(this.presetModelsRefreshState){case"loading":return P.t("settings.ai.providers.refreshPresetModelsLoading");case"success":return P.t("settings.ai.providers.refreshPresetModelsSuccess",{providers:this.formatSignedDelta(this.presetModelsRefreshSummary.providersDelta),models:this.formatSignedDelta(this.presetModelsRefreshSummary.modelsDelta)});case"error":return P.t("settings.ai.providers.refreshPresetModelsFailure");default:return P.t("settings.ai.providers.refreshPresetModels")}}},{key:"formatSignedDelta",value:function formatSignedDelta(r){return r>=0?"+".concat(r):"".concat(r)}},{key:"renderNutstoreGatewaySection",value:function renderNutstoreGatewaySection(){var _this=this;var _this1=this,r=_this1.contentEl,n=this.plugin.nutstoreLlmGatewayService.isAuthorized(),i=this.plugin.nutstoreLlmGatewayService.isAuthorizing(),o=this.plugin.nutstoreLlmGatewayService.getPendingAuthorization(),a=this.plugin.settings.ai.providers[_d],s=sp(a).length,l=new Vi.Setting(r).setName(P.t("settings.ai.nutstoreLlmGateway.name")).setDesc(n?P.t("settings.ai.nutstoreLlmGateway.connectedDesc",{count:s}):o?P.t("settings.ai.nutstoreLlmGateway.pendingDesc",{code:o.userCode}):P.t("settings.ai.nutstoreLlmGateway.desc"));if(!n){l.addButton(function(c){if(c.setButtonText(i?P.t("settings.ai.nutstoreLlmGateway.authorizing"):P.t("settings.ai.nutstoreLlmGateway.authorize")).setDisabled(i),i){Er(c.buttonEl,"connection-button","loading","ns-fx8a6s","ns-b8p3m5");return}c.onClick(function(){new J6(_this.plugin.app,function(){return _async_to_generator(function(){var d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);return[4,this.plugin.nutstoreLlmGatewayService.startAuthorization()];case 1:_state.sent();return[4,this.plugin.nutstoreLlmGatewayService.openPendingAuthorizationPage()];case 2:_state.sent(),this.render();return[3,4];case 3:d=_state.sent();Me.error(d),new Vi.Notice(_instanceof(d,Error)?d.message:P.t("settings.login.failure"),1e4);return[3,4];case 4:return[2]}})}).call(_this)}).open()})}),o&&(l.addButton(function(c){return c.setButtonText(P.t("settings.ai.nutstoreLlmGateway.openAuthorizationPage")).onClick(function(){return _async_to_generator(function(){var d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.plugin.nutstoreLlmGatewayService.openPendingAuthorizationPage()];case 1:_state.sent();return[3,3];case 2:d=_state.sent();Me.error(d),new Vi.Notice(_instanceof(d,Error)?d.message:P.t("settings.login.failure"),1e4);return[3,3];case 3:return[2]}})}).call(_this)})}),l.addButton(function(c){c.buttonEl.addClass("mod-warning"),c.setButtonText(P.t("settings.ai.nutstoreLlmGateway.cancelAuthorization")).onClick(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.nutstoreLlmGatewayService.disconnect()];case 1:_state.sent(),this.render();return[2]}})}).call(_this)})}));return}l.addButton(function(c){return c.setButtonText(P.t("settings.ai.nutstoreLlmGateway.refreshModels")).onClick(function(){return _async_to_generator(function(){var d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);return[4,this.plugin.nutstoreLlmGatewayService.refreshModels({removeOnAuthError:!0})];case 1:_state.sent();return[4,this.plugin.settingsService.saveSettings()];case 2:_state.sent(),this.render();return[3,4];case 3:d=_state.sent();Me.error(d),new Vi.Notice(_instanceof(d,Error)?d.message:P.t("settings.ai.nutstoreLlmGateway.errors.refreshFailed"),1e4);return[3,4];case 4:return[2]}})}).call(_this)})}).addButton(function(c){var d=!1,u=function(){d=!1,c.buttonEl.empty(),(0,Vi.setIcon)(c.buttonEl,"trash"),Dn(c.buttonEl,"mod-warning")};c.setIcon("trash").onClick(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!d){d=!0,c.buttonEl.empty(),c.buttonEl.createSpan({text:P.t("settings.ai.modals.confirmDeleteLabel")}),Er(c.buttonEl,"mod-warning");return[2]}return[4,this.plugin.nutstoreLlmGatewayService.disconnect()];case 1:_state.sent(),this.render();return[2]}})}).call(_this)}),c.buttonEl.addEventListener("blur",u)})}},{key:"validateProviderKey",value:function validateProviderKey(r,n){if(!r.id)return new Vi.Notice(P.t("settings.ai.errors.emptyProviderId")),!1;if(this.plugin.nutstoreLlmGatewayService.isProviderId(r.id))return new Vi.Notice(P.t("settings.ai.errors.reservedProviderId")),!1;var i=this.plugin.settings.ai.providers[r.id];return i&&i.id!==n?(new Vi.Notice(P.t("settings.ai.errors.duplicateProviderId")),!1):!0}},_define_property({key:"deleteProvider"},"value",function deleteProvider(r){return _async_to_generator(function(){var _this_plugin_settings_ai_providers,_key,_$n,i,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);_this_plugin_settings_ai_providers=this.plugin.settings.ai.providers,_key=r.id,_$n=_this_plugin_settings_ai_providers[_key],i=_object_without_properties(_this_plugin_settings_ai_providers,[_to_property_key(_key)]);this.plugin.settings.ai.providers=i;return[4,this.onChanged()];case 1:_state.sent(),new Vi.Notice(P.t("settings.ai.modals.provider.deleted")),this.render();return[3,3];case 2:n=_state.sent();Me.error(n),new Vi.Notice(_instanceof(n,Error)?n.message:P.t("settings.ai.errors.saveFailed"));return[3,3];case 3:return[2]}})}).call(this)}),{key:"addMissingPresetModels",value:function addMissingPresetModels(r,n){return _async_to_generator(function(){var _$i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);_$i=this.plugin.settings.ai.providers[r.id];if(!_$i)return[2];o=_object_spread({},_$i.models);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=n[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){a=_step.value;o[a.id]=zc(Ko(a),a.id)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.plugin.settings.ai.providers=_object_spread_props(_object_spread({},this.plugin.settings.ai.providers),_define_property({},r.id,_object_spread_props(_object_spread({},_$i),{models:o})));return[4,this.onChanged()];case 1:_state.sent(),new Vi.Notice(P.t("settings.ai.providers.updateModelsSuccess",{count:n.length})),this.render();return[3,3];case 2:i=_state.sent();Me.error(i),new Vi.Notice(_instanceof(i,Error)?i.message:P.t("settings.ai.errors.saveFailed"));return[3,3];case 3:return[2]}})}).call(this)}},{key:"onClose",value:function onClose(){var r;(r=this.authSubscription)==null||r.unsubscribe(),this.authSubscription=null,this.contentEl.empty()}}]);return eS1}(Vi.Modal);var Gu=require("obsidian");var As=require("obsidian");var Av=/*#__PURE__*/function(_As_Modal){"use strict";_inherits(Av1,_As_Modal);function Av1(r,n,i,o){_class_call_check(this,Av1);var _this;var a;_this=_call_super(this,Av1,[r.app]);_this.onSave=i;_this.isNew=o;A(_this,"draft");A(_this,"headerRows");_this.draft=Ko(n),_this.headerRows=Object.entries((a=_this.draft.config.headers)!=null?a:{}).map(function(param){var _param=_sliced_to_array(param,2),s=_param[0],l=_param[1];return{key:s,value:l}});return _this}_create_class(Av1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:this.isNew?P.t("settings.ai.mcp.editor.createTitle"):P.t("settings.ai.mcp.editor.editTitle")}),new As.Setting(r).setName(P.t("settings.ai.mcp.editor.serverName")).setDesc(P.t("settings.ai.mcp.editor.serverNameDesc")).then(function(a){return Er(a.settingEl,"setting-required")}).addText(function(a){a.setValue(_this.draft.name).onChange(function(s){_this.draft.name=s.trim()}),_this.isNew&&a.inputEl.focus()}),new As.Setting(r).setName(P.t("settings.ai.mcp.editor.url")).setDesc(P.t("settings.ai.mcp.editor.urlDesc")).then(function(a){return Er(a.settingEl,"setting-required")}).addText(function(a){return a.setPlaceholder("https://example.com/mcp").setValue(_this.draft.config.url).onChange(function(s){_this.draft.config.url=s.trim()})});var n=new As.Setting(r).setName(P.t("settings.ai.mcp.editor.headers")).setDesc(P.t("settings.ai.mcp.editor.headersDesc")),i=r.createDiv(),o=function(){i.empty();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var a=_step.value;new As.Setting(i).addText(function(s){return s.setPlaceholder(P.t("settings.ai.mcp.editor.headerKeyPlaceholder")).setValue(a.key).onChange(function(l){a.key=l})}).addText(function(s){return s.setPlaceholder(P.t("settings.ai.mcp.editor.headerValuePlaceholder")).setValue(a.value).onChange(function(l){a.value=l})}).addButton(function(s){return s.setIcon("trash").setTooltip(P.t("settings.ai.mcp.editor.removeHeader")).onClick(function(){_this.headerRows=_this.headerRows.filter(function(l){return l!==a}),o()})})};for(var _iterator=_this.headerRows[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};o(),n.addButton(function(a){return a.setButtonText(P.t("settings.ai.mcp.editor.addHeader")).onClick(function(){_this.headerRows.push({key:"",value:""}),o()})}),new As.Setting(r).setName(P.t("settings.ai.mcp.editor.enabled")).addToggle(function(a){return a.setValue(_this.draft.config.enabled!==!1).onChange(function(s){_this.draft.config.enabled=s})}),new As.Setting(r).addButton(function(a){return a.setButtonText(P.t("settings.filters.save")).setCta().onClick(function(){return _async_to_generator(function(){var s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$c,d,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.validate())return[2];s={};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.headerRows[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$c=_step.value;d=_$c.key.trim();d&&(s[d]=_$c.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}l=Ko(this.draft);l.config.headers=Object.keys(s).length>0?s:void 0;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.onSave(l)];case 2:_state.sent()&&this.close();return[3,4];case 3:c=_state.sent();Me.error(c),new As.Notice(_instanceof(c,Error)?c.message:P.t("settings.ai.errors.saveFailed"),1e4);return[3,4];case 4:return[2]}})}).call(_this)})})}},{key:"validate",value:function validate(){if(!this.draft.name)return new As.Notice(P.t("settings.ai.mcp.errors.emptyName")),!1;if(!uj(this.draft.name))return new As.Notice(P.t("settings.ai.mcp.errors.invalidName")),!1;if(!this.draft.config.url)return new As.Notice(P.t("settings.ai.mcp.errors.emptyUrl")),!1;try{new URL(this.draft.config.url)}catch(r){return new As.Notice(P.t("settings.ai.mcp.errors.invalidUrl")),!1}return!0}},{key:"onClose",value:function onClose(){this.contentEl.empty()}}]);return Av1}(As.Modal);var tS=/*#__PURE__*/function(_Gu_Modal){"use strict";_inherits(tS1,_Gu_Modal);function tS1(r,n){_class_call_check(this,tS1);var _this;_this=_call_super(this,tS1,[r.app]);_this.plugin=r;_this.onChanged=n;return _this}_create_class(tS1,[{key:"onOpen",value:function onOpen(){var _this=this;this.plugin.mcpService.reload().then(function(){return _this.render()}),this.render()}},{key:"servers",get:function get1(){return this.plugin.mcpService.getServers()}},{key:"render",value:function render(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:P.t("settings.ai.mcp.manager.title")});var n=this.plugin.mcpService.getParseError();n&&r.createDiv({cls:"setting-item-description mod-warning",text:P.t("settings.ai.mcp.manager.parseError",{path:lj,reason:n})}),new Gu.Setting(r).setName(P.t("settings.ai.mcp.name")).setDesc(P.t("settings.ai.mcp.manager.configFileHint",{path:lj})).addButton(function(a){return a.setButtonText(P.t("settings.ai.mcp.manager.add")).setCta().onClick(function(){new Av(_this.plugin,{name:"",config:{type:"http",url:"",enabled:!0}},function(s){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.saveDraft(s)];case 1:return[2,!!_state.sent()]}})}).call(_this)},!0).open()})});var i=Object.entries(this.servers);if(i.length===0){r.createDiv({cls:"setting-item-description",text:P.t("settings.ai.mcp.manager.empty")});return}var o=new Map(this.plugin.mcpService.getServerRuntimes().map(function(a){return[a.name,a]}));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];this.renderServer(r,a,s,o.get(a))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"renderServer",value:function renderServer(r,n,i,o){var _this=this;var a=v6(i),s=[i.url];a?(o==null?void 0:o.status)==="connected"?s.push(P.t("settings.ai.mcp.manager.statusConnected",{count:o.tools.length})):o!=null&&o.error&&s.push(P.t("settings.ai.mcp.manager.statusError",{reason:o.error})):s.push(P.t("settings.ai.mcp.manager.statusDisabled")),new Gu.Setting(r).setName(n).setDesc(s.join(" \xb7 ")).addToggle(function(l){return l.setValue(a).setTooltip(P.t("settings.ai.mcp.editor.enabled")).onChange(function(c){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.saveServers(_object_spread_props(_object_spread({},this.servers),_define_property({},n,_object_spread_props(_object_spread({},i),{enabled:c}))))];case 1:_state.sent();return[2]}})}).call(_this)})}).addButton(function(l){return l.setButtonText(P.t("settings.ai.mcp.manager.test")).onClick(function(){return _async_to_generator(function(){var _$c,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:l.setDisabled(!0);_state.label=1;case 1:_state.trys.push([1,3,4,5]);return[4,this.plugin.mcpService.testConnection(i)];case 2:_$c=_state.sent();new Gu.Notice(P.t("settings.ai.mcp.manager.testSuccess",{count:_$c.length}));return[3,5];case 3:c=_state.sent();Me.error(c),new Gu.Notice(P.t("settings.ai.mcp.manager.testFailed",{reason:_instanceof(c,Error)?c.message:String(c)}),1e4);return[3,5];case 4:l.setDisabled(!1);return[7];case 5:return[2]}})}).call(_this)})}).addButton(function(l){return l.setButtonText(P.t("settings.ai.modals.provider.edit")).onClick(function(){new Av(_this.plugin,{name:n,config:eut(i)},function(c){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.saveDraft(c,n)];case 1:return[2,!!_state.sent()]}})}).call(_this)},!1).open()})}).addButton(function(l){var c=!1,d=function(){c=!1,l.buttonEl.empty(),(0,Gu.setIcon)(l.buttonEl,"trash"),Dn(l.buttonEl,"mod-warning")};l.setIcon("trash").onClick(function(){return _async_to_generator(function(){var u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!c){c=!0,l.buttonEl.empty(),l.buttonEl.createSpan({text:P.t("settings.ai.modals.confirmDeleteLabel")}),Er(l.buttonEl,"mod-warning");return[2]}u=_object_spread({},this.servers);delete u[n];return[4,this.saveServers(u)];case 1:_state.sent();return[2]}})}).call(_this)}),l.buttonEl.addEventListener("blur",d)})}},{key:"saveDraft",value:function saveDraft(r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){if(r.name!==n&&this.servers[r.name])return[2,(new Gu.Notice(P.t("settings.ai.mcp.errors.duplicateName")),!1)];i=_object_spread({},this.servers);return[2,(n&&n!==r.name&&delete i[n],i[r.name]=r.config,this.saveServers(i))]})}).call(this)}},{key:"saveServers",value:function saveServers(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);return[4,this.plugin.mcpService.saveServers(r)];case 1:_state.sent();return[4,this.onChanged()];case 2:return[2,(_state.sent(),this.render(),!0)];case 3:n=_state.sent();return[2,(Me.error(n),new Gu.Notice(_instanceof(n,Error)?n.message:P.t("settings.ai.errors.saveFailed"),1e4),!1)];case 4:return[2]}})}).call(this)}},{key:"onClose",value:function onClose(){this.contentEl.empty()}}]);return tS1}(Gu.Modal);function eut(e){return{type:"http",url:e.url,headers:e.headers?_object_spread({},e.headers):void 0,enabled:e.enabled}}var rS=/*#__PURE__*/function(nu1){"use strict";_inherits(rS1,nu1);function rS1(){_class_call_check(this,rS1);var _this;_this=_call_super(this,rS1,arguments);A(_this,"subagentsContainerEl");return _this}_create_class(rS1,[{key:"display",value:function display(){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;this.containerEl.empty(),new jc.Setting(this.containerEl).setName(P.t("settings.sections.ai")).setHeading(),new jc.Setting(this.containerEl).setName(P.t("settings.ai.providers.name")).setDesc(P.t("settings.ai.providers.summary",{count:this.listUserManagedProviders().length})).addButton(function(r){return r.setButtonText(P.t("settings.ai.providers.manage")).onClick(function(){new eS(_this.plugin,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.persist(!1)];case 1:_state.sent(),this.display();return[2]}})}).call(_this)}).open()})}),this.listUserManagedProviders().length===0&&this.containerEl.createEl("p",{cls:"ns-990kz8",text:P.t("settings.ai.providers.emptyHint")}),new jc.Setting(this.containerEl).setName(P.t("settings.ai.defaultModel.name")).setDesc(P.t("settings.ai.defaultModel.desc")).addDropdown(function(r){var n;r.addOption("",P.t("settings.ai.none"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Sh(_this.plugin.settings.ai.providers)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.addOption(i.id,i.name||P.t("settings.ai.unnamedProvider"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r.setValue(((n=_this.plugin.settings.ai.defaultModel)==null?void 0:n.providerId)||"").onChange(function(i){return _async_to_generator(function(){var o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!i)this.plugin.settings.ai.defaultModel=void 0;else{a=Wi(this.plugin.settings.ai.providers,i),s=(o=this.plugin.settings.ai.defaultModel)==null?void 0:o.modelId,l=Da(a,s)||wf(a);this.plugin.settings.ai.defaultModel=l?{providerId:i,modelId:l.id}:void 0}return[4,this.persist()];case 1:_state.sent(),this.display();return[2]}})}).call(_this)})}).addDropdown(function(r){var i,o;var n=Wi(_this.plugin.settings.ai.providers,(i=_this.plugin.settings.ai.defaultModel)==null?void 0:i.providerId);r.addOption("",P.t("settings.ai.none"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=sp(n)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;r.addOption(a.id,a.name||P.t("settings.ai.unnamedModel"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r.setValue(((o=_this.plugin.settings.ai.defaultModel)==null?void 0:o.modelId)||"").setDisabled(!n).onChange(function(a){return _async_to_generator(function(){var l,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=(l=this.plugin.settings.ai.defaultModel)==null?void 0:l.providerId;s&&a?this.plugin.settings.ai.defaultModel={providerId:s,modelId:a}:this.plugin.settings.ai.defaultModel=void 0;return[4,this.persist()];case 1:_state.sent();return[2]}})}).call(_this)})}),new jc.Setting(this.containerEl).setName(P.t("settings.ai.mcp.name")).setDesc(P.t("settings.ai.mcp.summary",{count:Object.keys(this.plugin.mcpService.getServers()).length})).addButton(function(r){return r.setButtonText(P.t("settings.ai.mcp.manage")).onClick(function(){new tS(_this.plugin,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.display();return[2]})}).call(_this)}).open()})}),new jc.Setting(this.containerEl).setName(P.t("settings.ai.yolo.name")).setDesc(P.t("settings.ai.yolo.desc")).addToggle(function(r){var n;return r.setValue((n=_this.plugin.settings.ai.yolo)!=null?n:!1).onChange(function(i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.ai.yolo=i;return[4,this.persist(!1)];case 1:_state.sent();return[2]}})}).call(_this)})}),this.containerEl.createEl("h3",{text:P.t("settings.ai.subagents.heading")}),this.subagentsContainerEl=this.containerEl.createDiv(),this.renderSubagentSettings();return[2]})}).call(this)}},{key:"renderSubagentSettings",value:function renderSubagentSettings(){var r=this.subagentsContainerEl;r&&(r.empty(),this.addSubagentSettings(r,"explorer"),this.addSubagentSettings(r,"memory"))}},{key:"addSubagentSettings",value:function addSubagentSettings(r,n){var _this=this;var i=this.plugin.settings.ai.subagents[n],o="settings.ai.subagents.".concat(n);new jc.Setting(r).setName(P.t("".concat(o,".name"))).setDesc(P.t("".concat(o,".desc"))).addToggle(function(a){return a.setValue(i.enabled).onChange(function(s){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:i.enabled=s;return[4,this.persist(!1)];case 1:_state.sent(),this.renderSubagentSettings();return[2]}})}).call(_this)})}),i.enabled&&new jc.Setting(r).setName(P.t("".concat(o,".model.name"))).setDesc(P.t("".concat(o,".model.desc"))).addDropdown(function(a){var s;a.addOption("",P.t("settings.ai.none"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Sh(_this.plugin.settings.ai.providers)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;a.addOption(l.id,l.name||P.t("settings.ai.unnamedProvider"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}a.setValue(((s=i.model)==null?void 0:s.providerId)||"").onChange(function(l){return _async_to_generator(function(){var c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!l)i.model=void 0;else{d=Wi(this.plugin.settings.ai.providers,l),u=Da(d,(c=i.model)==null?void 0:c.modelId)||wf(d);i.model=u?{providerId:l,modelId:u.id}:void 0}return[4,this.persist()];case 1:_state.sent(),this.renderSubagentSettings();return[2]}})}).call(_this)})}).addDropdown(function(a){var l,c;var s=Wi(_this.plugin.settings.ai.providers,(l=i.model)==null?void 0:l.providerId);a.addOption("",P.t("settings.ai.none"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=sp(s)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;a.addOption(d.id,d.name||P.t("settings.ai.unnamedModel"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}a.setValue(((c=i.model)==null?void 0:c.modelId)||"").setDisabled(!s).onChange(function(d){return _async_to_generator(function(){var p,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:u=(p=i.model)==null?void 0:p.providerId;i.model=u&&d?{providerId:u,modelId:d}:void 0;return[4,this.persist()];case 1:_state.sent();return[2]}})}).call(_this)})})}},{key:"listUserManagedProviders",value:function listUserManagedProviders(){var _this=this;return Sh(this.plugin.settings.ai.providers).filter(function(r){return!_this.plugin.nutstoreLlmGatewayService.isManagedProvider(r)})}},{key:"persist",value:function persist(){return _async_to_generator(function(){var r,n;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:!0;_state.label=1;case 1:_state.trys.push([1,3,,4]);this.plugin.settings.ai.providers=ZA(this.plugin.settings.ai.providers),this.plugin.settings.ai.defaultModel=bf(this.plugin.settings.ai.providers,this.plugin.settings.ai.defaultModel);return[4,this.plugin.settingsService.saveSettings()];case 2:_state.sent(),r&&new jc.Notice(P.t("settings.ai.saved"));return[3,4];case 3:n=_state.sent();Me.error(n),new jc.Notice(_instanceof(n,Error)?P.t("settings.ai.errors.saveFailedWithReason",{reason:n.message}):P.t("settings.ai.errors.saveFailed"),1e4);return[3,4];case 4:return[2]}})}).apply(this,arguments)}}]);return rS1}(nu);var tI=nr(Tg(),1);var ui=require("obsidian");var M1e=require("obsidian");function R1e(e,t){return e.createDirectory(t,{recursive:!0})}var nS=/*#__PURE__*/function(_M1e_Modal){"use strict";_inherits(nS1,_M1e_Modal);function nS1(r,n,i){_class_call_check(this,nS1);var _this;_this=_call_super(this,nS1,[r]);_this.plugin=n;_this.onConfirm=i;return _this}_create_class(nS1,[{key:"onOpen",value:function onOpen(){return _async_to_generator(function(){var _this,_this1,r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_this1=this,r=_this1.contentEl,n=createDiv();r.appendChild(n);return[4,this.plugin.webDAVService.createWebDAVClient()];case 1:i=_state.sent();hhe(n,{fs:{ls:function(o){return _async_to_generator(function(){var a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.getToken()];case 1:a=_state.sent();return[4,TA(this.plugin.settings,a,o)];case 2:return[2,_state.sent().map(zx)]}})}).call(_this)},mkdirs:function(o){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,R1e(i,o)];case 1:_state.sent();return[2]}})})()}},onClose:function(){n.remove(),_this.close()},onConfirm:function(o){Promise.resolve(_this.onConfirm(Xi(o))).then(function(){n.remove(),_this.close()})}});return[2]}})}).call(this)}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty()}}]);return nS1}(M1e.Modal);var XA=require("obsidian");var iS=/*#__PURE__*/function(_XA_Modal){"use strict";_inherits(iS1,_XA_Modal);function iS1(r,n){_class_call_check(this,iS1);var _this;_this=_call_super(this,iS1,[r]);A(_this,"policy");A(_this,"resolve",function(){});A(_this,"settled",!1);_this.policy=n;return _this}_create_class(iS1,[{key:"openAndWait",value:function openAndWait(){var _this=this;return new Promise(function(r){_this.resolve=r,_get(_get_prototype_of(iS1.prototype),"open",_this).call(_this)})}},{key:"settle",value:function settle(r){this.settled||(this.settled=!0,this.resolve(r))}},{key:"onOpen",value:function onOpen(){var _this=this;this.setTitle(P.t("settings.syncPolicy.modal.title"));var _this1=this,r=_this1.contentEl,n=P.t(eI(this.policy));r.createEl("pre",{cls:"ns-24abin",text:n}),new XA.Setting(r).addButton(function(i){return i.setButtonText(P.t("settings.syncPolicy.modal.cancel")).onClick(function(){_this.settle(!1),_this.close()})}).addButton(function(i){return i.setButtonText(P.t("settings.syncPolicy.modal.confirm")).setCta().onClick(function(){_this.settle(!0),_this.close()})})}},{key:"onClose",value:function onClose(){this.settle(!1),this.contentEl.empty()}}]);return iS1}(XA.Modal);var YU="500MB",tut=(0,tI.parse)(YU,{mode:"jedec"}),oS=/*#__PURE__*/function(nu1){"use strict";_inherits(oS1,nu1);function oS1(){_class_call_check(this,oS1);return _call_super(this,oS1,arguments)}_create_class(oS1,[{key:"display",value:function display(){return _async_to_generator(function(){var _this,t;return _ts_generator(this,function(_state){_this=this;this.containerEl.empty(),new ui.Setting(this.containerEl).setName(P.t("settings.sections.common")).setHeading(),new ui.Setting(this.containerEl).setName(P.t("settings.remoteDir.name")).setDesc(P.t("settings.remoteDir.desc")).addText(function(r){r.setPlaceholder(P.t("settings.remoteDir.placeholder")).setValue(_this.plugin.remoteBaseDir).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.remoteDir=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)}),r.inputEl.addEventListener("blur",function(){_this.plugin.settings.remoteDir=_this.plugin.remoteBaseDir,_this.display()})}).addButton(function(r){r.setIcon("folder").onClick(function(){if(!_this.plugin.isAccountConfigured()){new ui.Notice(P.t("sync.error.accountNotConfigured"));return}new nS(_this.app,_this.plugin,function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.remoteDir=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent(),this.display();return[2]}})}).call(_this)}).open()})});new ui.Setting(this.containerEl).setName(P.t("settings.syncPolicy.name")).setDesc(P.t("settings.syncPolicy.desc")).addDropdown(function(r){t=r.addOption("two-way",P.t("settings.syncPolicy.twoWay")).addOption("send-only",P.t("settings.syncPolicy.sendOnly")).addOption("send-only-override-changes",P.t("settings.syncPolicy.sendOnlyOverrideChanges")).addOption("receive-only",P.t("settings.syncPolicy.receiveOnly")).addOption("receive-only-revert-local-changes",P.t("settings.syncPolicy.receiveOnlyRevertLocalChanges")).setValue(_this.plugin.localSettings.syncPolicy).onChange(function(n){return _async_to_generator(function(){var i,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=this.plugin.localSettings.syncPolicy;return[4,new iS(this.app,n).openAndWait()];case 1:if(!_state.sent())return[3,3];this.plugin.localSettings.syncPolicy=n;return[4,this.plugin.settingsService.saveLocalSettings()];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=t.setValue(i);_state.label=4;case 4:_tmp;return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.skipLargeFiles.name")).setDesc(P.t("settings.skipLargeFiles.desc")).addText(function(r){var n=_this.plugin.settings.skipLargeFiles.maxSize.trim();r.setPlaceholder(P.t("settings.skipLargeFiles.placeholder")).setValue(n),r.inputEl.addEventListener("blur",function(){_this.handleMaxFileSizeBlur(r)})}),new ui.Setting(this.containerEl).setName(P.t("settings.mobileAppDownloadFileChunkSize.name")).setDesc(P.t("settings.mobileAppDownloadFileChunkSize.desc")).addText(function(r){r.setPlaceholder(P.t("settings.mobileAppDownloadFileChunkSize.placeholder")).setValue(_this.plugin.settings.mobileAppDownloadFileChunkSize||Id),r.inputEl.addEventListener("blur",function(){_this.handleMobileAppDownloadFileChunkSizeBlur(r)})}),new ui.Setting(this.containerEl).setName(P.t("settings.conflictStrategy.name")).setDesc(P.t("settings.conflictStrategy.desc")).addDropdown(function(r){return r.addOption("no-conflict-merge",P.t("settings.conflictStrategy.noConflictMerge")).addOption("diff3",P.t("settings.conflictStrategy.diff3")).addOption("local-priority",P.t("settings.conflictStrategy.localPriority")).addOption("server-priority",P.t("settings.conflictStrategy.serverPriority")).setValue(_this.plugin.settings.conflictStrategy).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.conflictStrategy=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.confirmBeforeSync.name")).setDesc(P.t("settings.confirmBeforeSync.desc")).addToggle(function(r){return r.setValue(_this.plugin.settings.confirmBeforeSync).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.confirmBeforeSync=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.confirmBeforeDeleteInAutoSync.name")).setDesc(P.t("settings.confirmBeforeDeleteInAutoSync.desc")).addToggle(function(r){return r.setValue(_this.plugin.settings.confirmBeforeDeleteInAutoSync).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.confirmBeforeDeleteInAutoSync=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.realtimeSync.name")).setDesc(P.t("settings.realtimeSync.desc")).addToggle(function(r){return r.setValue(_this.plugin.settings.realtimeSync).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.realtimeSync=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.startupSyncDelay.name")).setDesc(P.t("settings.startupSyncDelay.desc")).addText(function(r){r.setPlaceholder(P.t("settings.startupSyncDelay.placeholder")).setValue(_this.plugin.settings.startupSyncDelaySeconds.toString()).onChange(function(i){return _async_to_generator(function(){var o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=parseFloat(i);if(!!isNaN(o))return[3,2];a=Ed(o,0,86400);this.plugin.settings.startupSyncDelaySeconds=a;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent(),a!==o&&(new ui.Notice(P.t("settings.startupSyncDelay.exceedsMax",{max:86400})),r.setValue(a.toString()));_state.label=2;case 2:return[2]}})}).call(_this)}),r.inputEl.addEventListener("blur",function(){(function(){return _async_to_generator(function(){var i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=parseFloat(r.getValue()),o=isNaN(i)?0:Ed(i,0,86400);isNaN(i)?new ui.Notice(P.t("settings.startupSyncDelay.invalidValue")):o!==i&&new ui.Notice(P.t("settings.startupSyncDelay.exceedsMax",{max:86400})),r.setValue(o.toString()),this.plugin.settings.startupSyncDelaySeconds=o;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})()}),r.inputEl.type="number",r.inputEl.min="0",r.inputEl.max=86400..toString()}),new ui.Setting(this.containerEl).setName(P.t("settings.autoSyncInterval.name")).setDesc(P.t("settings.autoSyncInterval.desc")).addText(function(r){r.setPlaceholder(P.t("settings.autoSyncInterval.placeholder")).setValue(Math.round(_this.plugin.settings.autoSyncIntervalSeconds/60).toString()).onChange(function(i){return _async_to_generator(function(){var o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=parseFloat(i);if(!!isNaN(o))return[3,3];a=Ed(o,0,1440);this.plugin.settings.autoSyncIntervalSeconds=a*60;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[4,this.plugin.scheduledSyncService.updateInterval()];case 2:_state.sent(),a!==o&&(new ui.Notice(P.t("settings.autoSyncInterval.exceedsMax",{max:1440})),r.setValue(a.toString()));_state.label=3;case 3:return[2]}})}).call(_this)}),r.inputEl.addEventListener("blur",function(){(function(){return _async_to_generator(function(){var i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=parseFloat(r.getValue()),o=isNaN(i)?0:Math.round(Ed(i,0,1440));r.setValue(o.toString()),isNaN(i)?new ui.Notice(P.t("settings.autoSyncInterval.invalidValue")):o!==i&&new ui.Notice(P.t("settings.autoSyncInterval.exceedsMax",{max:1440})),this.plugin.settings.autoSyncIntervalSeconds=o*60;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[4,this.plugin.scheduledSyncService.updateInterval()];case 2:_state.sent();return[2]}})}).call(_this)})()}),r.inputEl.type="number",r.inputEl.min="0",r.inputEl.max=1440..toString(),r.inputEl.step="1"}),new ui.Setting(this.containerEl).setName(P.t("settings.syncMode.name")).setDesc(P.t("settings.syncMode.desc")).addDropdown(function(r){return r.addOption("strict",P.t("settings.syncMode.strict")).addOption("loose",P.t("settings.syncMode.loose")).setValue(_this.plugin.settings.syncMode).onChange(function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.syncMode=n;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[2]}})}).call(_this)})}),new ui.Setting(this.containerEl).setName(P.t("settings.language.name")).setDesc(P.t("settings.language.desc")).addDropdown(function(r){return r.addOption("",P.t("settings.language.auto")).addOption("zh","简体中文").addOption("en","English").setValue(_this.plugin.settings.language||"").onChange(function(n){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=n==="zh"||n==="en"||n===""||lo(n);if(!_tmp)return[3,3];this.plugin.settings.language=n||void 0;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent();return[4,this.plugin.i18nService.update()];case 2:_tmp=(_state.sent(),this.settings.rerenderIfVisible());_state.label=3;case 3:_tmp;return[2]}})}).call(_this)})});return[2]})}).call(this)}},{key:"handleMaxFileSizeBlur",value:function handleMaxFileSizeBlur(t){return _async_to_generator(function(){var r,n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=$x(t.getValue(),YU),n=(0,tI.parse)(r,{mode:"jedec"});if(n===null){new ui.Notice(P.t("settings.skipLargeFiles.invalidFormat")),t.setValue(this.plugin.settings.skipLargeFiles.maxSize);return[2]}n>tut&&(new ui.Notice(P.t("settings.skipLargeFiles.exceedsMaxSize")),r=YU),t.setValue(r);_tmp=this.plugin.settings.skipLargeFiles.maxSize!==r;if(!_tmp)return[3,2];this.plugin.settings.skipLargeFiles.maxSize=r;return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}},{key:"handleMobileAppDownloadFileChunkSizeBlur",value:function handleMobileAppDownloadFileChunkSizeBlur(t){return _async_to_generator(function(){var r,n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=$x(t.getValue(),Id),n=(0,tI.parse)(r,{mode:"jedec"});if(n===null){new ui.Notice(P.t("settings.mobileAppDownloadFileChunkSize.invalidFormat")),t.setValue(this.plugin.settings.mobileAppDownloadFileChunkSize||Id);return[2]}n<s$?(new ui.Notice(P.t("settings.mobileAppDownloadFileChunkSize.belowMinSize")),r="64 KiB"):n>l$&&(new ui.Notice(P.t("settings.mobileAppDownloadFileChunkSize.exceedsMaxSize")),r="64 MiB"),t.setValue(r);_tmp=this.plugin.settings.mobileAppDownloadFileChunkSize!==r;if(!_tmp)return[3,2];this.plugin.settings.mobileAppDownloadFileChunkSize=r;return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}}]);return oS1}(nu);var kf=require("obsidian");var sS=require("obsidian");var lS=/*#__PURE__*/function(_sS_Modal){"use strict";_inherits(lS1,_sS_Modal);function lS1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;_class_call_check(this,lS1);var _this;_this=_call_super(this,lS1,[r.app]);_this.onSave=i;_this.getHighlightedRule=o;A(_this,"rules");_this.rules=Ko(n);return _this}_create_class(lS1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h2",{text:P.t("settings.filters.name")}),r.createEl("p",{text:P.t("settings.filters.desc"),cls:"setting-item-description"});var n=r.createDiv({cls:"ns-lfbduq"}),i=[],o=function(){var l;var s=(l=_this.getHighlightedRule)==null?void 0:l.call(_this,_this.rules);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,c=_step_value.rule,d=_step_value.container;c===s?Er(d,"ns-filter-rule-conflict"):Dn(d,"ns-filter-rule-conflict")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}},a=function(){n.empty(),i.length=0,_this.rules.forEach(function(s,l){var y=function y(){var w=bhe(s),S=["ns-dmgdab"],k=["background-none!","hover:bg-[--interactive-normal]!"];w.caseSensitive?(Er.apply(void 0,[v].concat(_to_consumable_array(S))),Dn.apply(void 0,[v].concat(_to_consumable_array(k)))):(Dn.apply(void 0,[v].concat(_to_consumable_array(S))),Er.apply(void 0,[v].concat(_to_consumable_array(k))))};var c=n.createDiv({cls:"ns-r50qrp ns-filter-rule-row"});i.push({rule:s,container:c});var d=n.createEl("input",{type:"checkbox",cls:"ns-7xsse3"});d.checked=s.disabled!==!0,d.title=P.t("settings.filters.toggle");var u=function(){s.disabled===!0?Er(c,"ns-fx8a6s"):Dn(c,"ns-fx8a6s")};u(),d.addEventListener("change",function(){d.checked?delete s.disabled:s.disabled=!0,_this.rules[l]=s,u(),o()});var p=n.createEl("select",{cls:"ns-el4x11"});p.addClass("ns-filter-type");for(var _i1=0,_iter=["exclude","include"];_i1<_iter.length;_i1++){var w=_iter[_i1];var S=p.createEl("option",{value:w,text:w==="exclude"?P.t("settings.filters.types.exclude"):P.t("settings.filters.types.include")});S.selected=s.type===w}p.addEventListener("change",function(){s.type=p.value,_this.rules[l]=s,o()});var m=n.createEl("input",{type:"text",cls:"ns-ed1e2c",placeholder:P.t("settings.filters.placeholder"),value:s.expr});m.spellcheck=!1,m.addEventListener("input",function(){s.expr=m.value,_this.rules[l]=s,o()});var h=c.createDiv({cls:"ns-r50qrp ns-filter-controls"}),g=h.createEl("button",{text:"↑",cls:"ns-el4x11"});g.disabled=l===0,g.addEventListener("click",function(){l!==0&&(_this.rules.splice(l-1,0,_this.rules.splice(l,1)[0]),a())});var x=h.createEl("button",{text:"↓",cls:"ns-el4x11"});x.disabled=l===_this.rules.length-1,x.addEventListener("click",function(){l!==_this.rules.length-1&&(_this.rules.splice(l+1,0,_this.rules.splice(l,1)[0]),a())});var v=h.createEl("button",{text:"Aa",cls:"ns-el4x11"});y(),v.addEventListener("click",function(){s.options.caseSensitive=!s.options.caseSensitive,y()});var _=h.createEl("button",{text:P.t("settings.filters.remove")}),b=!1;_.addEventListener("click",function(){b?(_this.rules.splice(l,1),a()):(b=!0,_.setText(P.t("settings.filters.confirmRemove")),Er(_,"mod-warning"))}),_.addEventListener("blur",function(){b=!1,_.setText(P.t("settings.filters.remove")),Dn(_,"mod-warning")}),c.appendChild(d),c.appendChild(p),c.appendChild(m),c.appendChild(h)}),o()};a(),new sS.Setting(r).addButton(function(s){s.setButtonText(P.t("settings.filters.add")).onClick(function(){_this.rules.push({expr:"",options:{caseSensitive:!1},type:"exclude"}),a()})}),new sS.Setting(r).addButton(function(s){s.setButtonText(P.t("settings.filters.save")).setCta().onClick(function(){_this.onSave(_this.rules),_this.close()})}).addButton(function(s){s.setButtonText(P.t("settings.filters.cancel")).onClick(function(){_this.close()})})}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty()}}]);return lS1}(sS.Modal);function nut(e){return e==="none"||e==="bookmarks"||e==="all"}var uS=/*#__PURE__*/function(nu1){"use strict";_inherits(uS1,nu1);function uS1(){_class_call_check(this,uS1);return _call_super(this,uS1,arguments)}_create_class(uS1,[{key:"display",value:function display(){return _async_to_generator(function(){var _this,t;return _ts_generator(this,function(_state){_this=this;this.containerEl.empty(),new kf.Setting(this.containerEl).setName(P.t("settings.sections.filters")).setHeading();t=this.plugin.app.vault.configDir;new kf.Setting(this.containerEl).setName(P.t("settings.configDirSync.name")).setDesc(P.t("settings.configDirSync.desc",{configDir:t})).addDropdown(function(r){var n;return r.addOption("none",P.t("settings.configDirSync.none")).addOption("bookmarks",P.t("settings.configDirSync.bookmarks")).addOption("all",P.t("settings.configDirSync.all")).setValue((n=_this.plugin.settings.configDirSyncMode)!=null?n:"none").onChange(function(i){return _async_to_generator(function(){var _this,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!nut(i))return[3,4];if(!(i==="bookmarks"))return[3,1];new XU(this.app,t,function(o){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!o)return[3,2];this.plugin.settings.configDirSyncMode="bookmarks";return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=this.display();_state.label=3;case 3:_tmp;return[2]}})}).call(_this)}).open();return[3,4];case 1:if(!(i==="all"))return[3,2];o=M6(t,this.plugin.settings.filterRules.rules);new eB(this.app,t,o,function(a){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!a)return[3,2];this.plugin.settings.configDirSyncMode="all";return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=this.display();_state.label=3;case 3:_tmp;return[2]}})}).call(_this)}).open();return[3,4];case 2:this.plugin.settings.configDirSyncMode=i;return[4,this.plugin.settingsService.saveSettings()];case 3:_state.sent();_state.label=4;case 4:return[2]}})}).call(_this)})}),new kf.Setting(this.containerEl).setName(P.t("settings.filters.name")).setDesc(P.t("settings.filters.desc")).addButton(function(r){r.setButtonText(P.t("settings.filters.edit")).onClick(function(){var o;var n=_this.plugin.settings.filterRules.rules,i=((o=_this.plugin.settings.configDirSyncMode)!=null?o:"none")==="all"?function(a){return M6(t,a)}:void 0;new lS(_this.plugin,n,function(a){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.filterRules.rules=a;return[4,this.plugin.settingsService.saveSettings()];case 1:_state.sent(),this.display();return[2]}})}).call(_this)},i).open()})});return[2]})}).call(this)}}]);return uS1}(nu),XU=/*#__PURE__*/function(_kf_Modal){"use strict";_inherits(XU1,_kf_Modal);function XU1(r,n,i){_class_call_check(this,XU1);var _this;_this=_call_super(this,XU1,[r]);_this.configDir=n;_this.onResult=i;A(_this,"resolved",!1);return _this}_create_class(XU1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.createEl("h2",{text:P.t("settings.configDirSync.bookmarksTitle")}),r.createEl("p",{text:P.t("settings.configDirSync.bookmarksDesc",{configDir:this.configDir})}),new kf.Setting(r).addButton(function(n){return n.setButtonText(P.t("settings.configDirSync.confirm")).setCta().onClick(function(){_this.resolved=!0,_this.close(),_this.onResult(!0)})}).addButton(function(n){return n.setButtonText(P.t("settings.configDirSync.cancel")).onClick(function(){_this.resolved=!0,_this.close(),_this.onResult(!1)})})}},{key:"onClose",value:function onClose(){this.contentEl.empty(),this.resolved||this.onResult(!1)}}]);return XU1}(kf.Modal),eB=/*#__PURE__*/function(_kf_Modal){"use strict";_inherits(eB1,_kf_Modal);function eB1(r,n,i,o){_class_call_check(this,eB1);var _this;_this=_call_super(this,eB1,[r]);_this.configDir=n;_this.pruningRule=i;_this.onResult=o;A(_this,"resolved",!1);return _this}_create_class(eB1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl,n=[P.t("settings.configDirSync.warnSyncs",{configDir:this.configDir}),P.t("settings.configDirSync.warnExcludes",{configDir:this.configDir}),P.t("settings.configDirSync.warnConflict",{configDir:this.configDir}),P.t("settings.configDirSync.warnRisk",{configDir:this.configDir})];r.createEl("h2",{text:P.t("settings.configDirSync.warnTitle")});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.createEl("p",{text:i})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.pruningRule&&r.createEl("p",{text:P.t("settings.configDirSync.warnPruned",{configDir:this.configDir,rule:this.pruningRule.expr}),cls:"ns-config-dir-warning"}),new kf.Setting(r).addButton(function(i){return i.setButtonText(P.t("settings.configDirSync.confirm")).setCta().onClick(function(){_this.resolved=!0,_this.close(),_this.onResult(!0)})}).addButton(function(i){return i.setButtonText(P.t("settings.configDirSync.cancel")).onClick(function(){_this.resolved=!0,_this.close(),_this.onResult(!1)})})}},{key:"onClose",value:function onClose(){this.contentEl.empty(),this.resolved||this.onResult(!1)}}]);return eB1}(kf.Modal);var tB=[{key:"sync",i18nKey:"settings.tabs.sync"},{key:"ai",i18nKey:"settings.tabs.ai"},{key:"troubleshooting",i18nKey:"settings.tabs.troubleshooting"}];var os=require("obsidian");var Ch=require("obsidian");var Iv=/*#__PURE__*/function(_Ch_Modal){"use strict";_inherits(Iv1,_Ch_Modal);function Iv1(r,n){_class_call_check(this,Iv1);var _this;_this=_call_super(this,Iv1,[r.app]);_this.onSuccess=n;A(_this,"options",{syncRecordEnabled:!1,blobEnabled:!1,traverseWebDAVEnabled:!1});return _this}_create_class(Iv1,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;new Ch.Setting(r).setName(P.t("settings.cache.clearModal.title")).setDesc(P.t("settings.cache.clearModal.description"));var n=r.createDiv({cls:"ns-baehdp"});new Ch.Setting(n).setName(P.t("settings.cache.clearModal.syncRecordCache.name")).setDesc(P.t("settings.cache.clearModal.syncRecordCache.desc")).addToggle(function(i){i.setValue(_this.options.syncRecordEnabled).onChange(function(o){_this.options.syncRecordEnabled=o})}),new Ch.Setting(n).setName(P.t("settings.cache.clearModal.blobCache.name")).setDesc(P.t("settings.cache.clearModal.blobCache.desc")).addToggle(function(i){i.setValue(_this.options.blobEnabled).onChange(function(o){_this.options.blobEnabled=o})}),new Ch.Setting(n).setName(P.t("settings.cache.clearModal.traverseWebDAVCache.name")).setDesc(P.t("settings.cache.clearModal.traverseWebDAVCache.desc")).addToggle(function(i){i.setValue(_this.options.traverseWebDAVEnabled).onChange(function(o){_this.options.traverseWebDAVEnabled=o})}),new Ch.Setting(r).addButton(function(i){i.setButtonText(P.t("settings.cache.clearModal.cancel")).onClick(function(){_this.close()})}).addButton(function(i){var o=!1;i.setButtonText(P.t("settings.cache.clear")).onClick(function(){return _async_to_generator(function(){var _tmp,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!o)return[3,7];_state.label=1;case 1:_state.trys.push([1,4,5,6]);_tmp=this.onSuccess;if(!_tmp)return[3,3];return[4,this.onSuccess(this.options)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp,this.close();return[3,6];case 4:a=_state.sent();Me.error("Error clearing cache:",a);return[3,6];case 5:i.setButtonText(P.t("settings.cache.clearModal.confirm")),Dn(i.buttonEl,"mod-warning"),o=!1;return[7];case 6:return[3,8];case 7:o=!0,i.buttonEl.addClass("mod-warning"),i.setButtonText(P.t("settings.cache.confirm"));_state.label=8;case 8:return[2]}})}).call(_this)}),i.buttonEl.addEventListener("blur",function(){o&&(o=!1,i.buttonEl.removeClass("mod-warning"),i.setButtonText(P.t("settings.cache.clear")),Dn(i.buttonEl,"mod-warning"))})})}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty()}}],[{key:"clearSelectedCaches",value:function clearSelectedCaches(r){return _async_to_generator(function(){var n,i,o,a,_tmp,_tmp1,_tmp2,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r.syncRecordEnabled,i=r.blobEnabled,o=r.traverseWebDAVEnabled,a=[];_state.label=1;case 1:_state.trys.push([1,8,,9]);_tmp=n;if(!_tmp)return[3,3];return[4,Ad.clear()];case 2:_tmp=(_state.sent(),a.push(P.t("settings.cache.clearModal.syncRecordCache.name")));_state.label=3;case 3:_tmp;_tmp1=i;if(!_tmp1)return[3,5];return[4,ym.clear()];case 4:_tmp1=(_state.sent(),a.push(P.t("settings.cache.clearModal.blobCache.name")));_state.label=5;case 5:_tmp1;_tmp2=o;if(!_tmp2)return[3,7];return[4,Eu.clear()];case 6:_tmp2=(_state.sent(),a.push(P.t("settings.cache.clearModal.traverseWebDAVCache.name")));_state.label=7;case 7:return[2,(_tmp2,a)];case 8:s=_state.sent();throw Me.error("Error clearing caches:",s),s;case 9:return[2]}})})()}}]);return Iv1}(Ch.Modal);function O0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(e).padStart(t,"0")}function rB(e){return[O0(e.getFullYear(),4),O0(e.getMonth()+1),O0(e.getDate())].join("-")}function O1e(e){return"".concat(rB(e),"T").concat([O0(e.getHours()),O0(e.getMinutes()),O0(e.getSeconds()),O0(e.getMilliseconds(),3)].join("-"))}function Eh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(_instanceof(e,String)||_instanceof(e,Number)||_instanceof(e,Boolean))return Eh(e.valueOf(),t);if(HO(e))return"null";if(WO(e))return String(e);if(qO(e))return JSON.stringify(e);if(Rb(e))return T8(e)?String(e):"null";if(KO(e)||wg(e)||kb(e))return;if((typeof e==="undefined"?"undefined":_type_of(e))=="bigint")return JSON.stringify("".concat(e,"n"));if(ZO(e))return JSON.stringify(String(e));if(VO(e)){try{if(T8(e.getTime()))return JSON.stringify(e.toISOString())}catch(i){return Pv(i,"Date")}return"null"}if(_instanceof(e,Error))return iut(e);if((typeof e==="undefined"?"undefined":_type_of(e))!="object"||e===null)throw new Error("Internal error: Unexpected non-object type: ".concat(typeof e==="undefined"?"undefined":_type_of(e)));var r=aut(e);if(r.called){if(r.error!==void 0)return Pv(r.error,"toJSON");if(r.value!==e)return Eh(r.value,t)}if(t.has(e))return'"[Circular]"';t.add(e);var n;try{if(Array.isArray(e)){var _$i;try{_$i=e.length}catch(a){return Pv(a,"array length")}var o=[];for(var _$a=0;_$a<_$i;_$a+=1){var s=void 0;try{s=e[_$a]}catch(l){o.push(Pv(l,"array index ".concat(_$a)));continue}try{var _$l=Eh(s,t);o.push(_$l===void 0?"null":_$l)}catch(l){o.push(Pv(l,"array index ".concat(_$a)))}}n="[".concat(o.join(","),"]")}else{var _$i1;try{_$i1=Object.keys(e)}catch(a){return Pv(a,"object keys")}var o10=[];_$i1.forEach(function(a){var s;try{var _$l=e[a];s=Eh(_$l,t)}catch(l){s=JSON.stringify(rI(l,"Error accessing property"))}if(s!==void 0){var _$l1=JSON.stringify(a);o10.push("".concat(_$l1,":").concat(s))}}),n="{".concat(o10.join(","),"}")}}finally{try{t.delete(e)}catch(i){}}return n}function iut(e){var t={};t.name=$1e(e,"name",e.name,"Error"),t.message=$1e(e,"message",e.message,"");var r=out(e,"stack");return r!==void 0&&(t.stack=r),JSON.stringify(t)}function $1e(e,t,r,n){try{var _$i=e[t];return typeof _$i=="string"?_$i:r}catch(i){return"[Thrown while reading ".concat(t,": ").concat(rI(i,n),"]")}}function out(e,t){try{var _$r=e[t];return _$r===void 0?void 0:typeof _$r=="string"?_$r:void 0}catch(r){return"[Thrown while reading ".concat(t,": ").concat(rI(r),"]")}}function Pv(e,t){return JSON.stringify("[Unserializable ".concat(t,": ").concat(rI(e),"]"))}function rI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Unknown error";if(_instanceof(e,Error))return e.message;if((typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null)try{var r=e.message;if(typeof r=="string")return r}catch(r){return t}try{return String(e)}catch(r){return t}}function aut(e){try{var _$t=e.toJSON;return typeof _$t!="function"?{called:!1}:{called:!0,value:_$t.call(e)}}catch(t){return{called:!0,error:t}}}function sut(e){if((typeof e==="undefined"?"undefined":_type_of(e))!="object"||e===null)return!1;try{var t=e;return typeof t.timestamp=="string"&&typeof t.level=="string"&&Array.isArray(t.args)}catch(t){return!1}}function lut(e){var t;try{return e===null?"null":e===void 0?"undefined":typeof e=="string"?e:_instanceof(e,Error)?cut(e):(t=Eh(e))!=null?t:nB(e)}catch(r){return"[Unserializable log arg: ".concat(cS(r),"]")}}function iB(e){var t;try{if(e==null)return;if(typeof e=="string")return e;if(sut(e)){var r=uut(e.args);return"[".concat(e.timestamp,"] [").concat(e.level,"] ").concat(r)}return(t=Eh(e))!=null?t:nB(e)}catch(r){return nB(e)}}function uut(e){try{return e.map(lut).join(" ")}catch(t){return"[Unserializable log args: ".concat(cS(t),"]")}}function cut(e){try{if(typeof e.stack=="string"&&e.stack.length>0)return e.stack}catch(n){return"[Unserializable error stack: ".concat(cS(n),"]")}var t="Error";try{typeof e.name=="string"&&e.name.length>0&&(t=e.name)}catch(n){}var r="";try{typeof e.message=="string"&&(r=e.message)}catch(n){r="[Thrown while reading message: ".concat(cS(n),"]")}return r?"".concat(t,": ").concat(r):t}function nB(e){try{return String(e)}catch(t){return"[Unserializable value: ".concat(cS(t),"]")}}function cS(e){if(_instanceof(e,Error))return e.message;if((typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null)try{var t=e.message;if(typeof t=="string")return t}catch(t){return"Unknown error"}try{return String(e)}catch(t){return"Unknown error"}}var dS=/*#__PURE__*/function(nu1){"use strict";_inherits(dS1,nu1);function dS1(){_class_call_check(this,dS1);var _this;_this=_call_super(this,dS1,arguments);A(_this,"blobGarbageCount",5e3);A(_this,"blobGarbageSizeBytes",64*1024);return _this}_create_class(dS1,[{key:"display",value:function display(){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;this.containerEl.empty(),new os.Setting(this.containerEl).setName(P.t("settings.troubleshooting.title")).setHeading(),new os.Setting(this.containerEl).setName(P.t("settings.cache.clearName")).setDesc(P.t("settings.cache.clearDesc")).addButton(function(r){r.setButtonText(P.t("settings.cache.clear")).onClick(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){new Iv(this.plugin,function(n){return _async_to_generator(function(){var i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,Iv.clearSelectedCaches(n)];case 1:_state.sent().length>0?new os.Notice(P.t("settings.cache.cleared")):new os.Notice(P.t("settings.cache.clearModal.nothingSelected"));return[3,3];case 2:i=_state.sent();Me.error("Error clearing cache:",i);o=_instanceof(i,Error)?i.message:String(i);new os.Notice("Error clearing cache: ".concat(o));return[3,3];case 3:return[2]}})})()}).open();return[2]})}).call(_this)})}),new os.Setting(this.containerEl).setName(P.t("settings.log.name")).setDesc(P.t("settings.log.desc")).addButton(function(r){r.setButtonText(P.t("settings.log.saveToNote")).onClick(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.saveLogsToNote()];case 1:_state.sent();return[2]}})}).call(_this)})}),new os.Setting(this.containerEl).setName(P.t("settings.log.clearName")).setDesc(P.t("settings.log.clearDesc")).addButton(function(r){r.setButtonText(P.t("settings.log.clear")).onClick(function(){_this.plugin.loggerService.clear(),new os.Notice(P.t("settings.log.cleared"))})}),!1&&new os.Setting(this.containerEl).setName(P.t("settings.cache.generateBlobGarbageName")).setDesc(P.t("settings.cache.generateBlobGarbageDesc",{count:this.blobGarbageCount,sizeKiB:this.blobGarbageSizeBytes/1024})).addButton(function(r){r.setButtonText(P.t("settings.cache.generateBlobGarbage")).onClick(function(){return _async_to_generator(function(){var _$n,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r.setDisabled(!0);_state.label=1;case 1:_state.trys.push([1,3,4,5]);new os.Notice(P.t("settings.cache.generateBlobGarbageRunning"));return[4,this.generateBlobGarbage()];case 2:_$n=_state.sent();new os.Notice(P.t("settings.cache.generateBlobGarbageDone",{count:_$n}));return[3,5];case 3:n=_state.sent();Me.error("Error generating blob garbage:",n),new os.Notice("Error: ".concat(n.message));return[3,5];case 4:r.setDisabled(!1);return[7];case 5:return[2]}})}).call(_this)})});return[2]})}).call(this)}},{key:"hide",value:function hide(){}},{key:"logs",get:function get1(){return this.plugin.loggerService.logs.map(iB).filter(Db).join("\n\n")}},{key:"saveLogsToNote",value:function saveLogsToNote(){return _async_to_generator(function(){var _$r,i,o,a,s,_tmp,c,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,6,,7]);_$r=new Date,i="nutstore-logs-".concat(O1e(_$r),".md"),o="nutstore-sync/logs",a="".concat(o,"/").concat(i),s="# Nutstore Plugin Logs\n\nGenerated at: ".concat(_$r.toLocaleString(),"\n\nPlugin version: ").concat(this.plugin.manifest.version,"\n\n---\n\n").concat(this.logs);return[4,this.app.vault.adapter.exists(o)];case 1:_tmp=_state.sent();if(_tmp)return[3,3];return[4,this.app.vault.adapter.mkdir(o)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[4,this.app.vault.create(a,s)];case 4:c=_state.sent();new os.Notice(P.t("settings.log.savedToNote",{fileName:a}));return[4,this.app.workspace.getLeaf().openFile(c)];case 5:_state.sent();return[3,7];case 6:r=_state.sent();new os.Notice(P.t("settings.log.saveError")),Me.error("Failed to save logs to note:",r);return[3,7];case 7:return[2]}})}).call(this)}},{key:"generateBlobGarbage",value:function generateBlobGarbage(){return _async_to_generator(function(){var n,i,o;function r(i){var a;var o=new Uint8Array(i);if((a=window.crypto)!=null&&a.getRandomValues)return window.crypto.getRandomValues(o),o;for(var s=0;s<o.length;s++)o[s]=Math.floor(Math.random()*256);return o}return _ts_generator(this,function(_state){switch(_state.label){case 0:n=0;i=0;_state.label=1;case 1:if(!(i<this.blobGarbageCount))return[3,4];o=r(this.blobGarbageSizeBytes);return[4,vm.store(o.buffer)];case 2:_state.sent(),n++;_state.label=3;case 3:i++;return[3,1];case 4:return[2,n]}})}).call(this)}}]);return dS1}(nu);var aS=function(o){return o.TwoWay="two-way",o.SendOnly="send-only",o.SendOnlyOverrideChanges="send-only-override-changes",o.ReceiveOnly="receive-only",o.ReceiveOnlyRevertLocalChanges="receive-only-revert-local-changes",o}(aS||{});function N1e(e){switch(e){case"no-conflict-merge":return"noConflictMerge";case"local-priority":return"localPriority";case"server-priority":return"serverPriority";case"diff3":default:return"diff3"}}function D1e(e){switch(e){case"send-only":return"settings.syncPolicy.sendOnly";case"send-only-override-changes":return"settings.syncPolicy.sendOnlyOverrideChanges";case"receive-only":return"settings.syncPolicy.receiveOnly";case"receive-only-revert-local-changes":return"settings.syncPolicy.receiveOnlyRevertLocalChanges";case"two-way":default:return"settings.syncPolicy.twoWay"}}function eI(e){switch(e){case"send-only":return"settings.syncPolicy.modal.sendOnlyDesc";case"send-only-override-changes":return"settings.syncPolicy.modal.sendOnlyOverrideChangesDesc";case"receive-only":return"settings.syncPolicy.modal.receiveOnlyDesc";case"receive-only-revert-local-changes":return"settings.syncPolicy.modal.receiveOnlyRevertLocalChangesDesc";case"two-way":default:return"settings.syncPolicy.modal.twoWayDesc"}}function dut(e){return{expr:e,options:{caseSensitive:!1},type:"exclude"}}var oB={account:"",credential:"",nutstoreEnterpriseBaseUrl:"",remoteDir:"",conflictStrategy:"no-conflict-merge",oauthResponseText:"",loginMode:"sso",confirmBeforeSync:!0,confirmBeforeDeleteInAutoSync:!0,syncMode:"loose",filterRules:{rules:["**/*.nutstore-sync-*.download","**/__MACOSX","**/.DS_Store","**/.env","**/.nomedia","**/.env.*","**/.git","**/.github","**/.gitlab","**/.idea","**/.svn","**/.trash","**/.vscode","**/.codex","**/.opencode","**/.claude","**/.cursor","**/~$*.doc","**/~$*.docx","**/~$*.ppt","**/~$*.pptx","**/~$*.xls","**/~$*.xlsx","**/desktop.ini","**/node_modules","**/Thumbs.db"].map(dut)},skipLargeFiles:{maxSize:"30 MB"},mobileAppDownloadFileChunkSize:Id,realtimeSync:!1,startupSyncDelaySeconds:0,autoSyncIntervalSeconds:300,language:void 0,ai:{providers:{},defaultModel:void 0,yolo:!1,subagents:{explorer:{enabled:!1},memory:{enabled:!1}},nutstoreLlmGateway:{}},configDirSyncMode:"none"},oI={syncPolicy:"two-way",ai:{}},nI=/*#__PURE__*/function(_iI_PluginSettingTab){"use strict";_inherits(nI1,_iI_PluginSettingTab);function nI1(r,n){_class_call_check(this,nI1);var _this;_this=_call_super(this,nI1,[r,n]);A(_this,"plugin");A(_this,"accountSettings");A(_this,"commonSettings");A(_this,"filterSettings");A(_this,"troubleshootingSettings");A(_this,"aiSettings");A(_this,"warningContainerEl");A(_this,"tabBarEl");A(_this,"activeTab","sync");A(_this,"tabSections");A(_this,"subscriptions",[o1e().subscribe(function(){_this.rerenderIfVisible()}),qA().subscribe(function(){_this.rerenderIfVisible()})]);_this.plugin=n,_this.tabBarEl=_this.containerEl.createDiv(),_this.warningContainerEl=_this.containerEl.createDiv();var i=_this.containerEl.createDiv();_this.accountSettings=new K6(_this.app,_this.plugin,_this,i);var o=_this.containerEl.createDiv();_this.commonSettings=new oS(_this.app,_this.plugin,_this,o);var a=_this.containerEl.createDiv();_this.filterSettings=new uS(_this.app,_this.plugin,_this,a);var s=_this.containerEl.createDiv();_this.aiSettings=new rS(_this.app,_this.plugin,_this,s);var l=_this.containerEl.createDiv();_this.troubleshootingSettings=new dS(_this.app,_this.plugin,_this,l),_this.tabSections={sync:[{section:_this.accountSettings,containerEl:i},{section:_this.commonSettings,containerEl:o},{section:_this.filterSettings,containerEl:a}],ai:[{section:_this.aiSettings,containerEl:s}],troubleshooting:[{section:_this.troubleshootingSettings,containerEl:l}]};return _this}_create_class(nI1,[{key:"display",value:function display(){this.renderTabBar(),this.renderActiveTabContent()}},{key:"renderActiveTabContent",value:function renderActiveTabContent(){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,i,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,o,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value1,o10,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.activeTab==="sync";r?this.warningContainerEl.show():this.warningContainerEl.hide(),r&&(this.warningContainerEl.empty(),new iI.Setting(this.warningContainerEl).setName(P.t("settings.backupWarning.name")).setDesc(P.t("settings.backupWarning.desc")));_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,12,13,14]);_iterator=tB[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,11];n=_step.value;i=n.key===this.activeTab;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=this.tabSections[n.key][Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_step1.value,o=_step_value.containerEl;i?o.show():o.hide()}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(!i)return[3,10];_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator2=this.tabSections[n.key][Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,7];_step_value1=_step2.value,o10=_step_value1.section;return[4,o10.display()];case 5:_state.sent();_state.label=6;case 6:_iteratorNormalCompletion2=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 10:_iteratorNormalCompletion=true;return[3,2];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 14:return[2]}})}).call(this)}},{key:"renderTabBar",value:function renderTabBar(){var _this=this;this.tabBarEl.empty();var r=this.tabBarEl.createDiv({cls:"ns-settings-tabs"}),n=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _this1,_loop=function(){var i=_step.value;var o=r.createEl("button",{cls:"ns-settings-tab",text:P.t(i.i18nKey)});o.classList.toggle("is-active",i.key===_this1.activeTab),o.addEventListener("click",function(){if(_this.activeTab!==i.key){_this.activeTab=i.key;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];s.classList.toggle("is-active",a===_this.activeTab)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_this.renderActiveTabContent()}}),n.set(i.key,o)};for(var _iterator=tB[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_this1=this,_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"isSSO",get:function get1(){return this.plugin.settings.loginMode==="sso"}},{key:"isVisible",value:function isVisible(){return this.containerEl.isConnected&&document.contains(this.containerEl)&&this.containerEl.offsetParent!==null}},{key:"rerenderIfVisible",value:function rerenderIfVisible(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.isVisible();if(!_tmp)return[3,2];this.renderTabBar();return[4,this.renderActiveTabContent()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}},{key:"onClose",value:function onClose(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.accountSettings.hide()];case 1:_state.sent(),this.troubleshootingSettings.hide();return[2]}})}).call(this)}},{key:"unload",value:function unload(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.subscriptions[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.unsubscribe()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}]);return nI1}(iI.PluginSettingTab);var $0=/*#__PURE__*/function(){"use strict";function $01(t,r){_class_call_check(this,$01);this.namespace=t;this.storage=r}_create_class($01,[{key:"updateFileRecord",value:function updateFileRecord(t,r){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.get(this.namespace)];case 1:n=_state.sent();if(!n)return[3,3];n.set(t,r);return[4,this.storage.set(this.namespace,n)];case 2:_tmp=_state.sent();return[3,5];case 3:return[4,this.storage.set(this.namespace,new Map([[t,r]]))];case 4:_tmp=_state.sent();_state.label=5;case 5:_tmp;return[2]}})}).call(this)}},{key:"deleteFileRecord",value:function deleteFileRecord(t){return _async_to_generator(function(){var r,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.get(this.namespace)];case 1:r=_state.sent();_tmp=r&&r.has(t);if(!_tmp)return[3,3];r.delete(t);return[4,this.storage.set(this.namespace,r)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})}).call(this)}},{key:"getRecords",value:function getRecords(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.get(this.namespace)];case 1:t=_state.sent();return[2,t!=null?t:new Map]}})}).call(this)}},{key:"setRecords",value:function setRecords(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.set(this.namespace,t)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"getRecord",value:function getRecord(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.get(this.namespace)];case 1:r=_state.sent();if(r)return[2,r.get(t)];return[2]}})}).call(this)}},{key:"drop",value:function drop(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.unset(this.namespace)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"exists",value:function exists(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.storage.get(this.namespace)];case 1:r=_state.sent();return[2,r?r.has(t):!1]}})}).call(this)}},{key:"batchUpdate",value:function batchUpdate(t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length===0)return[2];return[4,this.storage.get(this.namespace)];case 1:r=_state.sent();if(!r)return[3,3];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];r.set(n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,this.storage.set(this.namespace,r)];case 2:_state.sent();return[3,5];case 3:return[4,this.storage.set(this.namespace,new Map(t))];case 4:_state.sent();_state.label=5;case 5:return[2]}})}).call(this)}}]);return $01}();function aB(e){return e==="manual_sync"?"Manual":"Auto"}function sB(e){switch(e){case"send-only":return"SendOnly";case"send-only-override-changes":return"SendOnlyOverride";case"receive-only":return"ReceiveOnly";case"receive-only-revert-local-changes":return"ReceiveOnlyRevert";case"two-way":default:return"TwoWay"}}function L1e(e){return"[[".concat(aB(e.mode),"][").concat(sB(e.policy),"]]")}function aI(e,t){return"".concat(e," ").concat(t)}function sI(e){return{debug:function(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var _Me1;if(typeof t=="string"){var _Me2;(_Me2=Me).debug.apply(_Me2,[aI(e,t)].concat(_to_consumable_array(r)));return}(_Me1=Me).debug.apply(_Me1,[e,t].concat(_to_consumable_array(r)))},info:function(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var _Me1;if(typeof t=="string"){var _Me2;(_Me2=Me).info.apply(_Me2,[aI(e,t)].concat(_to_consumable_array(r)));return}(_Me1=Me).info.apply(_Me1,[e,t].concat(_to_consumable_array(r)))},warn:function(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var _Me1;if(typeof t=="string"){var _Me2;(_Me2=Me).warn.apply(_Me2,[aI(e,t)].concat(_to_consumable_array(r)));return}(_Me1=Me).warn.apply(_Me1,[e,t].concat(_to_consumable_array(r)))},error:function(t){for(var _len=arguments.length,r=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){r[_key-1]=arguments[_key]}var _Me1;if(typeof t=="string"){var _Me2;(_Me2=Me).error.apply(_Me2,[aI(e,t)].concat(_to_consumable_array(r)));return}(_Me1=Me).error.apply(_Me1,[e,t].concat(_to_consumable_array(r)))}}}function F1e(e,t){return new Promise(function(r,n){var o=function o(){window.clearTimeout(a),i.unsubscribe(),r()};var i=e.subscribe({next:function(){return o()},error:function(s){window.clearTimeout(a),i.unsubscribe(),n(_instanceof(s,Error)?s:new Error(String(s)))}});var a=window.setTimeout(function(){o()},t)})}var z1e=nr(Tg(),1);function Hu(e,t){if(e===void 0||t===void 0)return!1;var r=typeof e=="number"?e:e.getTime(),n=typeof t=="number"?t:t.getTime();return r===n}var lI=nr(ln(),1);function Ot(e,t){return(0,lI.isAbsolute)(t)?t:(0,lI.join)(e,t)}var Rv=nr(ln(),1);function Mv(e,t){return e=(0,Rv.normalize)(e),t=(0,Rv.normalize)(t),t=(0,Rv.isAbsolute)(t)&&t.startsWith(e)?t.replace(e,""):t,(0,Rv.normalize)(t)}function N0(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(!Dc(e,i.path))continue;var o=r.get(i.path);if(!o)return!0;if(!i.isDir){var a=n==="local"?o.local.mtime:o.remote.mtime;if(i.mtime&&a&&!Hu(i.mtime,a))return!0}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function Ov(e,t,r){return e==="loose"&&!!t&&!!r&&!t.isDeleted&&!r.isDeleted&&!t.isDir&&!r.isDir&&t.size===r.size}function $v(e,t,r,n){return _async_to_generator(function(){var l,i,o,a,s,c,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=!Hu(t.mtime,n.local.mtime),o=!Hu(r.mtime,n.remote.mtime),a=i,s="mtime-unchanged";if(!(i&&(s="no-base",(l=n.base)!=null&&l.key&&!n.local.isDir)))return[3,5];if(!(t.size!==n.local.size))return[3,1];s="size-differs";return[3,5];case 1:return[4,e.getBaseContent(n.base.key)];case 2:c=_state.sent();s="base-unavailable";_tmp=c;if(!_tmp)return[3,4];return[4,e.compareFileContent(t.path,c)];case 3:_tmp=(a=!_state.sent(),s=a?"content-differs":"content-equal");_state.label=4;case 4:_tmp;_state.label=5;case 5:return[2,((i||o)&&e.logger.debug({reason:"recorded file change evaluation",localPath:t.path,local:{mtime:t.mtime,size:t.size},remote:{mtime:r.mtime,size:r.size},recordedLocal:{mtime:n.local.mtime,size:n.local.isDir?void 0:n.local.size},recordedRemote:{mtime:n.remote.mtime,size:n.remote.isDir?void 0:n.remote.size},localMtimeChanged:i,contentCheck:s,localChanged:a,remoteChanged:o}),{localChanged:a,remoteChanged:o})]}})})()}function Nv(e,t,r){var n=t.some(function(s){return s.stat.path===e&&!s.ignored}),i=r.some(function(s){return s.stat.path===e&&!s.ignored});if(n||i)return!1;var o=t.some(function(s){return s.stat.path===e}),a=r.some(function(s){return s.stat.path===e});return!o&&!a}function Uc(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if((Dc(e,r.stat.path)||r.stat.path===e)&&r.ignored)return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function Bc(e,t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;(Dc(e,n.stat.path)||n.stat.path===e)&&n.ignored&&r.push(n.stat.path)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var qc=/*#__PURE__*/function(){"use strict";function qc1(t,r){_class_call_check(this,qc1);this.sync=t;this.syncRecordStorage=r}_create_class(qc1,[{key:"getSyncRecordStorage",value:function getSyncRecordStorage(){return this.syncRecordStorage}},{key:"buildDecisionInput",value:function buildDecisionInput(){return _async_to_generator(function(){var _this,t,_ref,r,n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;t=this.getSyncRecordStorage();return[4,Promise.all([t.getRecords(),this.sync.localFS.walk(),this.sync.remoteFs.walk()])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),3]),r=_ref[0],n=_ref[1],i=_ref[2],o={webdav:this.webdav,vault:this.vault,remoteBaseDir:this.remoteBaseDir,syncRecord:t,logger:this.sync.logger},a={createPullTask:function(c){return new Mu(_object_spread({},o,c))},createPushTask:function(c){return new Ou(_object_spread({},o,c))},createConflictResolveTask:function(c){return new Iu(_object_spread({},o,c))},createNoopTask:function(c){return new el(_object_spread({},o,c))},createRemoveLocalTask:function(c){return new tl(_object_spread({},o,c))},createRemoveRemoteTask:function(c){return new Ul(_object_spread({},o,c))},createMkdirLocalTask:function(c){return new bc(_object_spread({},o,c))},createMkdirRemoteTask:function(c){return new Ia(_object_spread({},o,c))},createCleanRecordTask:function(c){return new Zs(_object_spread({},o,c))},createFilenameErrorTask:function(c){return new Jp(_object_spread({},o,c))},createSkippedTask:function(c){return new Bl(_object_spread({},o,c))}},s=function(c,d){return _async_to_generator(function(){var p;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Fl(this.vault,c)];case 1:if(!_state.sent())return[2,!1];return[4,xc(this.vault,c)];case 2:p=_state.sent();return[2,M8(d,p)]}})}).call(_this)},l=function(c){return _async_to_generator(function(){var d,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,vm.get(c)];case 1:d=_state.sent();if(!d)return[3,3];return[4,d.arrayBuffer()];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=null;_state.label=4;case 4:return[2,_tmp]}})})()};return[2,{logger:this.sync.logger,settings:{skipLargeFiles:this.settings.skipLargeFiles,mobileAppDownloadFileChunkSize:this.settings.mobileAppDownloadFileChunkSize,conflictStrategy:this.settings.conflictStrategy,syncMode:this.settings.syncMode,configDir:this.vault.configDir},localStats:n,remoteStats:i,syncRecords:r,remoteBaseDir:this.remoteBaseDir,getBaseContent:l,compareFileContent:s,taskFactory:a}]}})}).call(this)}},{key:"webdav",get:function get1(){return this.sync.webdav}},{key:"settings",get:function get1(){return this.sync.settings}},{key:"vault",get:function get1(){return this.sync.vault}},{key:"remoteBaseDir",get:function get1(){return this.sync.remoteBaseDir}}]);return qc1}();var pS=/*#__PURE__*/function(qc1){"use strict";_inherits(pS1,qc1);function pS1(){_class_call_check(this,pS1);return _call_super(this,pS1,arguments)}_create_class(pS1,[{key:"decide",value:function decide(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.buildDecisionInput()];case 1:t=_state.sent();return[2,j1e(t,{revertLocalChanges:!1})]}})}).call(this)}}]);return pS1}(qc),uI=/*#__PURE__*/function(qc1){"use strict";_inherits(uI1,qc1);function uI1(){_class_call_check(this,uI1);return _call_super(this,uI1,arguments)}_create_class(uI1,[{key:"decide",value:function decide(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.buildDecisionInput()];case 1:t=_state.sent();return[2,j1e(t,{revertLocalChanges:!0})]}})}).call(this)}}]);return uI1}(qc);function j1e(e,t){return _async_to_generator(function(){var _x1,S,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,k,E,C,T,I,_ref,O,M,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,k10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,k11,E1,C1,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,k12,E10,C10,I1,I10,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=e.logger,n=e.settings,i=e.localStats,o=e.remoteStats,a=e.syncRecords,s=e.remoteBaseDir,l=e.taskFactory,c=1/0,d=n.skipLargeFiles.maxSize.trim();d!==""&&(c=(S=(0,z1e.parse)(d,{mode:"jedec"}))!=null?S:1/0);u=i.filter(function(k){return!k.ignored}).map(function(k){return k.stat}),p=o.filter(function(k){return!k.ignored}).map(function(k){return k.stat}),m=new Map(u.map(function(k){return[k.path,k]})),h=new Map(p.map(function(k){return[k.path,k]})),g=new Set(_to_consumable_array(m.keys()).concat(_to_consumable_array(h.keys()))),x=[],v=[],y=[],_=function(k,E,C){var T={remotePath:k,localPath:k,remoteBaseDir:s};return E>c||C!==void 0&&C>c?(x.push(l.createSkippedTask(_object_spread(_object_spread_props(_object_spread({},T),{reason:"file-too-large",maxSize:c,remoteSize:E}),C===void 0?{}:{localSize:C}))),!1):(x.push(l.createPullTask(_object_spread_props(_object_spread({},T),{remoteSize:E,mobileAppDownloadFileChunkSize:n.mobileAppDownloadFileChunkSize}))),!0)},b=function(k,E){var C={remotePath:k,localPath:k,remoteBaseDir:s};return E>c?(x.push(l.createSkippedTask(_object_spread_props(_object_spread({},C),{reason:"file-too-large",maxSize:c,localSize:E}))),!1):(x.push(l.createRemoveLocalTask(C)),!0)};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=g[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];k=_step.value;E=h.get(k),C=m.get(k),T=a.get(k),I={remotePath:k,localPath:k,remoteBaseDir:s};if(!!(C!=null&&C.isDir||E!=null&&E.isDir))return[3,5];if(!(C&&E))return[3,4];if(!T&&Ov(n.syncMode,C,E)){x.push(l.createNoopTask(I));return[3,5]}if(!T){r.debug({reason:"both exist without record — pull from remote",localPath:k,remotePath:Ot(s,k)}),_(k,E.size,C.size);return[3,5]}return[4,$v(e,C,E,T)];case 3:_ref=_state.sent(),O=_ref.localChanged,M=_ref.remoteChanged;(t.revertLocalChanges?M||O:M&&!O)?(r.debug({reason:"both exist, source state changed",localPath:k,remotePath:Ot(s,k)}),_(k,E.size,C.size)):O&&M&&!t.revertLocalChanges?(r.debug({reason:"both local and remote changed — skip",localPath:k,remotePath:Ot(s,k)}),x.push(l.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"conflict-in-receive-only-mode"})))):O&&!t.revertLocalChanges&&r.debug({reason:"preserve local change until revert",localPath:k,remotePath:Ot(s,k)});return[3,5];case 4:if(!C&&E){if(T&&!t.revertLocalChanges){r.debug({reason:"preserve local deletion until revert",localPath:k,remotePath:Ot(s,k)});return[3,5]}r.debug({reason:"remote exists, local missing — pull",localPath:k,remotePath:Ot(s,k)}),_(k,E.size);return[3,5]}if(C&&!E){if(nv(k,n.configDir)){r.debug({reason:"plugin self-path missing remotely — preserve local",localPath:k,remotePath:Ot(s,k)});return[3,5]}if(t.revertLocalChanges){r.debug({reason:"local exists, remote missing — remove local",localPath:k,remotePath:Ot(s,k)}),b(k,C.size);return[3,5]}if(!T){r.debug({reason:"local-only without record — preserve local",localPath:k,remotePath:Ot(s,k)});return[3,5]}!Hu(C.mtime,T.local.mtime)?(r.debug({reason:"remote deleted, local changed — skip to protect local change",localPath:k,remotePath:Ot(s,k)}),x.push(l.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"deleted-remotely-but-changed-locally"})))):(r.debug({reason:"remote deleted, local unchanged — remove local",localPath:k,remotePath:Ot(s,k)}),b(k,C.size));return[3,5]}_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=a[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step1.value,1),k10=_step_value[0];Nv(k10,i,o)&&x.push(l.createCleanRecordTask({remotePath:k10,localPath:k10,remoteBaseDir:s}))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=p[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){k11=_step2.value;if(!k11.isDir)continue;E1=Mv(s,k11.path),C1=m.get(E1);if(C1){if(!C1.isDir){if(t.revertLocalChanges){r.debug({reason:"replace local file with remote folder",remotePath:Ot(s,k11.path),localPath:E1}),v.push(l.createRemoveLocalTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s})),y.push(l.createMkdirLocalTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s}));continue}throw new Error("Folder conflict: remote path ".concat(k11.path," is a folder but local path ").concat(E1," is a file"))}}else{if(a.get(E1)&&!t.revertLocalChanges){r.debug({reason:"preserve local folder deletion until revert",remotePath:Ot(s,k11.path),localPath:E1});continue}r.debug({reason:"remote folder missing locally — mkdir local",remotePath:Ot(s,k11.path),localPath:E1}),y.push(l.createMkdirLocalTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s}))}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=u[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){k12=_step3.value;if(!k12.isDir)continue;E10=h.get(k12.path);if(E10){if(!E10.isDir){if(t.revertLocalChanges){if(Uc(k12.path,i)){C10=Bc(k12.path,i);r.debug({reason:"skip replacing local folder with remote file (contains ignored items)",localPath:k12.path,ignoredPaths:C10}),x.push(l.createSkippedTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:C10}));continue}r.debug({reason:"replace local folder with remote file",localPath:k12.path,remotePath:Ot(s,k12.path)}),_(k12.path,E10.size)&&v.push(l.createRemoveLocalTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,recursive:!0}));continue}throw new Error("Folder conflict: local path ".concat(k12.path," is a folder but remote path ").concat(E10.path," is a file"))}}else{if(nv(k12.path,n.configDir)){r.debug({reason:"plugin self-folder missing remotely — preserve local",localPath:k12.path,remotePath:Ot(s,k12.path)});continue}if(t.revertLocalChanges){if(Uc(k12.path,i)){I1=Bc(k12.path,i);r.debug({reason:"skip removing local folder (contains ignored items)",localPath:k12.path,ignoredPaths:I1}),x.push(l.createSkippedTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:I1}));continue}r.debug({reason:"local folder missing remotely — remove local",localPath:k12.path,remotePath:Ot(s,k12.path)}),v.push(l.createRemoveLocalTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,recursive:!0}));continue}if(!a.get(k12.path)){r.debug({reason:"local folder missing remotely without record — preserve local",localPath:k12.path,remotePath:Ot(s,k12.path)});continue}if(N0(k12.path,u,a,"local"))r.debug({reason:"remote folder deleted, local folder changed — skip to protect local change",localPath:k12.path,remotePath:Ot(s,k12.path)}),x.push(l.createSkippedTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,reason:"deleted-remotely-but-changed-locally"}));else{if(Uc(k12.path,i)){I10=Bc(k12.path,i);r.debug({reason:"skip removing local folder (contains ignored items)",localPath:k12.path,ignoredPaths:I10}),x.push(l.createSkippedTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:I10}));continue}r.debug({reason:"remote folder deleted, local folder unchanged — remove local",localPath:k12.path,remotePath:Ot(s,k12.path)}),v.push(l.createRemoveLocalTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s,recursive:!0}))}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}v.sort(function(k,E){return E.localPath.length-k.localPath.length});w=_to_consumable_array(v).concat(_to_consumable_array(y));return[2,((_x1=x).splice.apply(_x1,[0,0].concat(_to_consumable_array(w))),x)]}})})()}var U1e=nr(Tg(),1);var fS=/*#__PURE__*/function(qc1){"use strict";_inherits(fS1,qc1);function fS1(){_class_call_check(this,fS1);return _call_super(this,fS1,arguments)}_create_class(fS1,[{key:"decide",value:function decide(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.buildDecisionInput()];case 1:t=_state.sent();return[2,B1e(t,{overrideChanges:!1})]}})}).call(this)}}]);return fS1}(qc),cI=/*#__PURE__*/function(qc1){"use strict";_inherits(cI1,qc1);function cI1(){_class_call_check(this,cI1);return _call_super(this,cI1,arguments)}_create_class(cI1,[{key:"decide",value:function decide(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.buildDecisionInput()];case 1:t=_state.sent();return[2,B1e(t,{overrideChanges:!0})]}})}).call(this)}}]);return cI1}(qc);function B1e(e,t){return _async_to_generator(function(){var _x1,S,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,k,E,C,T,I,_ref,O,M,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,k10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,k11,E1,C1,T1,O1,O10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,k12,E10,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=e.logger,n=e.settings,i=e.localStats,o=e.remoteStats,a=e.syncRecords,s=e.remoteBaseDir,l=e.taskFactory,c=1/0,d=n.skipLargeFiles.maxSize.trim();d!==""&&(c=(S=(0,U1e.parse)(d,{mode:"jedec"}))!=null?S:1/0);u=i.filter(function(k){return!k.ignored}).map(function(k){return k.stat}),p=o.filter(function(k){return!k.ignored}).map(function(k){return k.stat}),m=new Map(u.map(function(k){return[k.path,k]})),h=new Map(p.map(function(k){return[k.path,k]})),g=new Set(_to_consumable_array(m.keys()).concat(_to_consumable_array(h.keys()))),x=[],v=[],y=[],_=function(k,E,C){var T={remotePath:k,localPath:k,remoteBaseDir:s};return E>c||C!==void 0&&C>c?(x.push(l.createSkippedTask(_object_spread(_object_spread_props(_object_spread({},T),{reason:"file-too-large",maxSize:c,localSize:E}),C===void 0?{}:{remoteSize:C}))),!1):Pu(k)?(x.push(l.createFilenameErrorTask(T)),!1):(x.push(l.createPushTask(T)),!0)},b=function(k,E){var C={remotePath:k,localPath:k,remoteBaseDir:s};return E>c?(x.push(l.createSkippedTask(_object_spread_props(_object_spread({},C),{reason:"file-too-large",maxSize:c,remoteSize:E}))),!1):(x.push(l.createRemoveRemoteTask(C)),!0)};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=g[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];k=_step.value;E=h.get(k),C=m.get(k),T=a.get(k),I={remotePath:k,localPath:k,remoteBaseDir:s};if(!!(C!=null&&C.isDir||E!=null&&E.isDir))return[3,5];if(!(C&&E))return[3,4];if(!T&&Ov(n.syncMode,C,E)){x.push(l.createNoopTask(I));return[3,5]}if(!T){r.debug({reason:"both exist without record — push from local",localPath:k,remotePath:Ot(s,k)}),_(k,C.size,E.size);return[3,5]}return[4,$v(e,C,E,T)];case 3:_ref=_state.sent(),O=_ref.localChanged,M=_ref.remoteChanged;(t.overrideChanges?O||M:O&&!M)?(r.debug({reason:"both exist, source state changed",localPath:k,remotePath:Ot(s,k)}),_(k,C.size,E.size)):O&&M&&!t.overrideChanges?(r.debug({reason:"both local and remote changed — skip",localPath:k,remotePath:Ot(s,k)}),x.push(l.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"conflict-in-send-only-mode"})))):M&&!t.overrideChanges&&r.debug({reason:"preserve remote-side change until override",localPath:k,remotePath:Ot(s,k)});return[3,5];case 4:if(C&&!E){if(T&&!t.overrideChanges){r.debug({reason:"preserve remote deletion until override",localPath:k,remotePath:Ot(s,k)});return[3,5]}r.debug({reason:"local exists, remote missing — push",localPath:k,remotePath:Ot(s,k)}),_(k,C.size);return[3,5]}if(!C&&E){if(t.overrideChanges){r.debug({reason:"remote exists, local missing — remove remote",localPath:k,remotePath:Ot(s,k)}),b(k,E.size);return[3,5]}if(!T){r.debug({reason:"remote-only without record — preserve remote",localPath:k,remotePath:Ot(s,k)});return[3,5]}!Hu(E.mtime,T.remote.mtime)?(r.debug({reason:"local deleted, remote changed — skip to protect remote change",localPath:k,remotePath:Ot(s,k)}),x.push(l.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"deleted-locally-but-changed-remotely"})))):(r.debug({reason:"local deleted, remote unchanged — remove remote",localPath:k,remotePath:Ot(s,k)}),b(k,E.size));return[3,5]}_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=a[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step1.value,1),k10=_step_value[0];Nv(k10,i,o)&&x.push(l.createCleanRecordTask({remotePath:k10,localPath:k10,remoteBaseDir:s}))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=p[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){k11=_step2.value;if(!k11.isDir)continue;E1=Mv(s,k11.path),C1=m.get(E1);if(C1){if(!C1.isDir){if(t.overrideChanges){if(Uc(k11.path,o)){T1=Bc(k11.path,o);r.debug({reason:"skip replacing remote folder with local file (contains ignored items)",remotePath:Ot(s,k11.path),localPath:E1,ignoredPaths:T1}),x.push(l.createSkippedTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:T1}));continue}r.debug({reason:"replace remote folder with local file",remotePath:Ot(s,k11.path),localPath:E1}),_(E1,C1.size)&&v.push(l.createRemoveRemoteTask({localPath:k11.path,remotePath:k11.path,remoteBaseDir:s}));continue}throw new Error("Folder conflict: remote path ".concat(k11.path," is a folder but local path ").concat(E1," is a file"))}}else{if(t.overrideChanges){if(Uc(k11.path,o)){O1=Bc(k11.path,o);r.debug({reason:"skip removing remote folder (contains ignored items)",remotePath:Ot(s,k11.path),localPath:E1,ignoredPaths:O1}),x.push(l.createSkippedTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:O1}));continue}r.debug({reason:"remote folder missing locally — remove remote",remotePath:Ot(s,k11.path),localPath:E1}),v.push(l.createRemoveRemoteTask({localPath:k11.path,remotePath:k11.path,remoteBaseDir:s}));continue}if(!a.get(E1)){r.debug({reason:"remote folder missing locally without record — preserve remote",remotePath:Ot(s,k11.path),localPath:E1});continue}if(N0(k11.path,p,a,"remote"))r.debug({reason:"local folder deleted, remote folder changed — skip to protect remote change",remotePath:Ot(s,k11.path),localPath:E1}),x.push(l.createSkippedTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s,reason:"deleted-locally-but-changed-remotely"}));else{if(Uc(k11.path,o)){O10=Bc(k11.path,o);r.debug({reason:"skip removing remote folder (contains ignored items)",remotePath:Ot(s,k11.path),localPath:E1,ignoredPaths:O10}),x.push(l.createSkippedTask({localPath:E1,remotePath:k11.path,remoteBaseDir:s,reason:"folder-contains-ignored-items",ignoredPaths:O10}));continue}r.debug({reason:"local folder deleted, remote folder unchanged — remove remote",remotePath:Ot(s,k11.path),localPath:E1}),v.push(l.createRemoveRemoteTask({localPath:k11.path,remotePath:k11.path,remoteBaseDir:s}))}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=u[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){k12=_step3.value;if(!k12.isDir)continue;E10=h.get(k12.path);if(E10){if(!E10.isDir){if(t.overrideChanges){r.debug({reason:"replace remote file with local folder",localPath:k12.path,remotePath:Ot(s,k12.path)}),Pu(k12.path)?x.push(l.createFilenameErrorTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s})):(v.push(l.createRemoveRemoteTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s})),y.push(l.createMkdirRemoteTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s})));continue}throw new Error("Folder conflict: local path ".concat(k12.path," is a folder but remote path ").concat(E10.path," is a file"))}}else{if(a.get(k12.path)&&!t.overrideChanges){r.debug({reason:"preserve remote folder deletion until override",localPath:k12.path,remotePath:Ot(s,k12.path)});continue}r.debug({reason:"local folder missing remotely — mkdir remote",localPath:k12.path,remotePath:Ot(s,k12.path)}),Pu(k12.path)?x.push(l.createFilenameErrorTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s})):y.push(l.createMkdirRemoteTask({localPath:k12.path,remotePath:k12.path,remoteBaseDir:s}))}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}v.sort(function(k,E){return E.remotePath.length-k.remotePath.length});w=_to_consumable_array(v).concat(_to_consumable_array(y));return[2,((_x1=x).splice.apply(_x1,[0,0].concat(_to_consumable_array(w))),x)]}})})()}var q1e=nr(Tg(),1);var mS=/*#__PURE__*/function(qc1){"use strict";_inherits(mS1,qc1);function mS1(){_class_call_check(this,mS1);return _call_super(this,mS1,arguments)}_create_class(mS1,[{key:"decide",value:function decide(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.buildDecisionInput()];case 1:t=_state.sent();return[2,put(t)]}})}).call(this)}}]);return mS1}(qc);function put(e){return _async_to_generator(function(){var _g1,E,t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,C,T,I,O,M,R,_ref,$,R1,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,C1,T1,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,C10,T10,I1,O1,M1,R10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,C11,T11,I10,O10,M10,k;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e.logger,r=e.settings,n=e.localStats,i=e.remoteStats,o=e.syncRecords,a=e.remoteBaseDir,s=e.taskFactory,l=1/0,c=r.skipLargeFiles.maxSize.trim();c!==""&&(l=(E=(0,q1e.parse)(c,{mode:"jedec"}))!=null?E:1/0);d=n.filter(function(C){return!C.ignored}).map(function(C){return C.stat}),u=i.filter(function(C){return!C.ignored}).map(function(C){return C.stat}),p=new Map(d.map(function(C){return[C.path,C]})),m=new Map(u.map(function(C){return[C.path,C]})),h=new Set(_to_consumable_array(p.keys()).concat(_to_consumable_array(m.keys()))),g=[],x=[],v=[],y=[],_=[],b=[],w=function(C,T){var I={remotePath:C,localPath:C,remoteBaseDir:a};return T>l?(g.push(s.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"file-too-large",maxSize:l,remoteSize:T}))),!1):(g.push(s.createRemoveRemoteTask(I)),!0)},S=function(C,T){var I={remotePath:C,localPath:C,remoteBaseDir:a};return T>l?(g.push(s.createSkippedTask(_object_spread_props(_object_spread({},I),{reason:"file-too-large",maxSize:l,localSize:T}))),!1):(g.push(s.createRemoveLocalTask(I)),!0)};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,11,12,13]);_iterator=h[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];C=_step.value;T=m.get(C),I=p.get(C),O=o.get(C),M={remotePath:C,localPath:C,remoteBaseDir:a};if(!!(I!=null&&I.isDir||T!=null&&T.isDir))return[3,9];if(!O)return[3,8];if(!T)return[3,6];R=!Hu(T.mtime,O.remote.mtime);if(!I)return[3,4];return[4,$v(e,I,T,O)];case 3:_ref=_state.sent(),$=_ref.localChanged;if(R)if($){if(t.debug({reason:"both local and remote files changed",remotePath:Ot(a,C),localPath:C,conditions:{remoteChanged:R,localChanged:$,recordExists:!!O,remoteExists:!!T,localExists:!!I}}),T.size>l||I.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",maxSize:l,remoteSize:T.size,localSize:I.size})));return[3,9]}Pu(I.path)?g.push(s.createFilenameErrorTask(M)):g.push(s.createConflictResolveTask(_object_spread_props(_object_spread({},M),{record:O,strategy:r.conflictStrategy,localStat:I,remoteStat:T,mobileAppDownloadFileChunkSize:r.mobileAppDownloadFileChunkSize})));return[3,9]}else{if(t.debug({reason:"remote file changed",remotePath:Ot(a,C),localPath:C,conditions:{remoteChanged:R,recordExists:!!O,remoteExists:!!T,localExists:!!I}}),T.size>l||I.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",maxSize:l,remoteSize:T.size,localSize:I.size})));return[3,9]}g.push(s.createPullTask(_object_spread_props(_object_spread({},M),{remoteSize:T.size,mobileAppDownloadFileChunkSize:r.mobileAppDownloadFileChunkSize})));return[3,9]}else if($){if(t.debug({reason:"local file changed",remotePath:Ot(a,C),localPath:C,conditions:{localChanged:$,recordExists:!!O,remoteExists:!!T,localExists:!!I}}),I.size>l||T.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",maxSize:l,remoteSize:T.size,localSize:I.size})));return[3,9]}Pu(I.path)?g.push(s.createFilenameErrorTask(M)):g.push(s.createPushTask(M));return[3,9]}return[3,5];case 4:if(R){if(t.debug({reason:"remote file changed and local file does not exist",remotePath:Ot(a,C),localPath:C,conditions:{remoteChanged:R,recordExists:!!O,remoteExists:!!T,localExists:!!I}}),T.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",maxSize:l,remoteSize:T.size})));return[3,9]}g.push(s.createPullTask(_object_spread_props(_object_spread({},M),{remoteSize:T.size,mobileAppDownloadFileChunkSize:r.mobileAppDownloadFileChunkSize})));return[3,9]}else{t.debug({reason:"remote file is removable",remotePath:Ot(a,C),localPath:C,conditions:{recordExists:!!O,remoteExists:!!T,localExists:!!I}}),w(C,T.size);return[3,9]}_state.label=5;case 5:return[3,7];case 6:if(I){if(nv(C,r.configDir)){t.debug({reason:"plugin self-path missing remotely — preserve local",remotePath:Ot(a,C),localPath:C});return[3,9]}R1=!Hu(I.mtime,O.local.mtime);if(R1){if(t.debug({reason:"local file changed and remote file does not exist",remotePath:Ot(a,C),localPath:C,conditions:{localChanged:R1,recordExists:!!O,remoteExists:!!T,localExists:!!I}}),I.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",localSize:I.size,maxSize:l})));return[3,9]}Pu(I.path)?g.push(s.createFilenameErrorTask(M)):g.push(s.createPushTask(M));return[3,9]}else{t.debug({reason:"local file is removable",remotePath:Ot(a,C),localPath:C,conditions:{recordExists:!!O,remoteExists:!!T,localExists:!!I}}),S(C,I.size);return[3,9]}}_state.label=7;case 7:return[3,9];case 8:if(T)if(I){if(Ov(r.syncMode,I,T)){g.push(s.createNoopTask(M));return[3,9]}if(t.debug({reason:"both local and remote files exist without a record",remotePath:Ot(a,C),localPath:C,conditions:{recordExists:!!O,remoteExists:!!T,localExists:!!I}}),T.size>l||I.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",remoteSize:T.size,localSize:I.size,maxSize:l})));return[3,9]}Pu(I.path)?g.push(s.createFilenameErrorTask(M)):g.push(s.createConflictResolveTask(_object_spread_props(_object_spread({},M),{strategy:r.conflictStrategy,localStat:I,remoteStat:T,mobileAppDownloadFileChunkSize:r.mobileAppDownloadFileChunkSize})));return[3,9]}else{if(t.debug({reason:"remote file exists without a local file",remotePath:Ot(a,C),localPath:C,conditions:{recordExists:!!O,remoteExists:!!T,localExists:!!I}}),T.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",remoteSize:T.size,maxSize:l})));return[3,9]}g.push(s.createPullTask(_object_spread_props(_object_spread({},M),{remoteSize:T.size,mobileAppDownloadFileChunkSize:r.mobileAppDownloadFileChunkSize})));return[3,9]}else if(I){if(t.debug({reason:"local file exists without a remote file",remotePath:Ot(a,C),localPath:C,conditions:{recordExists:!!O,remoteExists:!!T,localExists:!!I}}),I.size>l){g.push(s.createSkippedTask(_object_spread_props(_object_spread({},M),{reason:"file-too-large",localSize:I.size,maxSize:l})));return[3,9]}Pu(I.path)?g.push(s.createFilenameErrorTask(M)):g.push(s.createPushTask(M));return[3,9]}_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,2];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=o[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step1.value,2),C1=_step_value[0],T1=_step_value[1];Nv(C1,n,i)&&(t.debug({reason:"cleaning orphaned sync record (both local and remote deleted)",remotePath:Ot(a,C1),localPath:C1,conditions:{localExists:!1,remoteExists:!1,recordExists:!!T1}}),g.push(s.createCleanRecordTask({remotePath:C1,localPath:C1,remoteBaseDir:a})))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=u[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){C10=_step2.value;if(!C10.isDir)continue;T10=Mv(a,C10.path),I1=p.get(T10),O1=o.get(T10);if(I1){if(!I1.isDir)throw new Error("Folder conflict: remote path ".concat(C10.path," is a folder but local path ").concat(T10," is a file"));if(!O1){b.push(s.createNoopTask({localPath:T10,remotePath:C10.path,remoteBaseDir:a}));continue}}else if(O1){M1=N0(C10.path,u,o,"remote");if(M1){t.debug({reason:"remote folder content changed",remotePath:Ot(a,C10.path),localPath:T10,conditions:{remoteChanged:M1,localExists:!!I1,recordExists:!!O1}}),y.push(s.createMkdirLocalTask({localPath:T10,remotePath:C10.path,remoteBaseDir:a}));continue}if(Uc(C10.path,i)){R10=Bc(C10.path,i);t.debug({reason:"skip removing remote folder (contains ignored items)",remotePath:Ot(a,C10.path),localPath:T10,conditions:{hasIgnoredItems:!0,localExists:!!I1,recordExists:!!O1},ignoredPaths:R10}),g.push(s.createSkippedTask({localPath:T10,remotePath:C10.path,remoteBaseDir:a,reason:"folder-contains-ignored-items",ignoredPaths:R10}));continue}t.debug({reason:"remote folder is removable (no content changes)",remotePath:Ot(a,C10.path),localPath:T10,conditions:{removable:!0,localExists:!!I1,recordExists:!!O1}}),x.push(s.createRemoveRemoteTask({localPath:C10.path,remotePath:C10.path,remoteBaseDir:a}));continue}else{t.debug({reason:"remote folder does not exist locally",remotePath:Ot(a,C10.path),localPath:T10,conditions:{localExists:!!I1,recordExists:!!O1}}),y.push(s.createMkdirLocalTask({localPath:T10,remotePath:C10.path,remoteBaseDir:a}));continue}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=d[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){C11=_step3.value;if(!C11.isDir)continue;T11=m.get(C11.path),I10=o.get(C11.path);if(T11){if(!I10){b.push(s.createNoopTask({localPath:C11.path,remotePath:T11.path,remoteBaseDir:a}));continue}}else{if(I10){if(nv(C11.path,r.configDir)){t.debug({reason:"plugin self-folder missing remotely — preserve local",remotePath:Ot(a,C11.path),localPath:C11.path});continue}O10=N0(C11.path,d,o,"local");if(O10){t.debug({reason:"local folder content changed",remotePath:Ot(a,C11.path),localPath:C11.path,conditions:{localChanged:O10,remoteExists:!!T11,recordExists:!!I10}}),Pu(C11.path)?g.push(s.createFilenameErrorTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a})):_.push(s.createMkdirRemoteTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a}));continue}if(Uc(C11.path,n)){M10=Bc(C11.path,n);t.debug({reason:"skip removing local folder (contains ignored items)",remotePath:Ot(a,C11.path),localPath:C11.path,conditions:{hasIgnoredItems:!0,remoteExists:!!T11,recordExists:!!I10},ignoredPaths:M10}),g.push(s.createSkippedTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a,reason:"folder-contains-ignored-items",ignoredPaths:M10}));continue}t.debug({reason:"local folder is removable (no content changes)",remotePath:Ot(a,C11.path),localPath:C11.path,conditions:{removable:!0,remoteExists:!!T11,recordExists:!!I10}}),v.push(s.createRemoveLocalTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a,recursive:!0}))}else{t.debug({reason:"local folder does not exist remotely",remotePath:Ot(a,C11.path),localPath:C11.path,conditions:{remoteExists:!!T11,recordExists:!!I10}}),Pu(C11.path)?g.push(s.createFilenameErrorTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a})):_.push(s.createMkdirRemoteTask({localPath:C11.path,remotePath:C11.path,remoteBaseDir:a}));continue}continue}if(!T11.isDir)throw new Error("Folder conflict: local path ".concat(C11.path," is a folder but remote path ").concat(T11.path," is a file"))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}x.sort(function(C,T){return T.remotePath.length-C.remotePath.length}),v.sort(function(C,T){return T.localPath.length-C.localPath.length});k=_to_consumable_array(x).concat(_to_consumable_array(v),_to_consumable_array(y),_to_consumable_array(_),_to_consumable_array(b));return[2,((_g1=g).splice.apply(_g1,[0,0].concat(_to_consumable_array(k))),g)]}})})()}function W1e(e){var t=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;t.set(a.remotePath,a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var r=_to_consumable_array(t.entries()),n=function(a,s){return a.startsWith(s.endsWith("/")?s:"".concat(s,"/"))},i=r.filter(function(param){var _param=_sliced_to_array(param,1),a=_param[0];return!r.some(function(param){var _param=_sliced_to_array(param,1),s=_param[0];return n(s,a)})}),o=new Set;return i.map(function(param){var _param=_sliced_to_array(param,2),a=_param[0],s=_param[1];o.add(a);var l=r.filter(function(param){var _param=_sliced_to_array(param,1),c=_param[0];return!o.has(c)&&n(a,c)}).map(function(param){var _param=_sliced_to_array(param,2),c=_param[0],d=_param[1];return o.add(c),{localPath:d.localPath,remotePath:c}});return new Ru(_object_spread_props(_object_spread({},s.options),{additionalPaths:l}))})}var V1e=nr(ln(),1);function G1e(e){if(e.length===0)return[];var t=e.flatMap(function(o){var _o_options=o.options,a=_o_options.remoteBaseDir,s=_o_options.remotePath;if(typeof a!="string"||typeof s!="string"||s==="")return[];var l=(0,V1e.normalize)(o.remotePath);return l==="."?[]:[{task:o,path:l}]});if(t.length===0)return[];var r=_to_consumable_array(t).sort(function(o,a){return o.path.length!==a.path.length?o.path.length-a.path.length:o.path.localeCompare(a.path)}),n=[],i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var _step_value=_step.value,o=_step_value.task,a=_step_value.path;i.some(function(l){return a===l?!0:Dc(l,a)})||(i.push(a),n.push(new wc(o.options)))};for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}function lB(e){return e.reduce(function(t,r){return t+(_instanceof(r,Ru)?r.getAllPaths().length:1)},0)}function H1e(e,t,r,n,i,o,a,s){return _async_to_generator(function(){var l,c,d,p,m,h,g,x,v,y,_,_tmp,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,b,w,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,S,_10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,b10,w10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(n.length===0)return[2];l=lB(n),c=n.filter(function(b,w){var S,k;return((S=i[w])==null?void 0:S.success)&&!((k=i[w])!=null&&k.skipRecord)});if(c.length===0){s.completed+=l,L7(s.total,s.completed);return[2]}return[4,e.getToken()];case 1:d=_state.sent();_=xv.bind;_tmp={settings:e.settings,vault:t,token:d};return[4,e.getRemoteAccountId()];case 2:return[4,(new(_.apply(xv,[void 0,(_tmp.remoteAccountId=_state.sent(),_tmp.remoteBaseDir=Xi(r),_tmp)]))).walk()];case 3:p=_state.sent(),m=new Map(p.map(function(b){return[b.stat.path,b]})),h=new $0(D6(t.getName(),r),Ad);return[4,h.getRecords()];case 4:g=_state.sent(),x=Date.now(),v=qp(function(b){return h.setRecords(b)},3e3,{trailing:!0,leading:!1}),y=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){b=_step.value;if(_instanceof(b,Ru)){w=b.getAllPaths();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=w[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){S=_step1.value;y.push({task:b,localPath:S.localPath})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else y.push({task:b,localPath:b.localPath})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_10=Ib(y,o);s.completed+=l-y.length,L7(s.total,s.completed);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=5;case 5:_state.trys.push([5,10,11,12]);_iterator2=_10[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,9];b10=_step2.value;w10=b10.map(function(param){var S=param.task,k=param.localPath;return _async_to_generator(function(){var _$E,C,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,I,T,E,C1;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);_$E=m.get(k);return[4,Ya(t,k)];case 1:C=_state.sent();if(_instanceof(S,wc)){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=g.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){I=_step.value;Dc(k,I)&&g.delete(I)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!C||!_$E){g.delete(k);return[2]}}if(!C&&!_$E){g.delete(k);return[2]}if(!C||!_$E)return[2];return[4,function(){return _async_to_generator(function(){var I,O,_ref,M;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(!C.isDir&&$b(k)))return[3,3];return[4,xc(t,k)];case 1:O=_state.sent();return[4,vm.store(O)];case 2:_ref=_state.sent(),M=_ref.key;I=M;_state.label=3;case 3:return[2,lo(I)?void 0:{key:I}]}})})()}()];case 2:T=_state.sent();g.set(k,{remote:_$E.stat,local:C,base:T});return[3,4];case 3:E=_state.sent();C1=_instanceof(E,Error)?E:new Error(String(E));a.error("updateMtimeInRecord",{errorName:C1.name,errorMsg:C1.message},S.toJSON());return[3,4];case 4:return[2]}})})()});return[4,Promise.all(w10)];case 7:_state.sent(),s.completed+=b10.length,L7(s.total,s.completed),v(g);_state.label=8;case 8:_iteratorNormalCompletion2=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 12:return[4,v.flush()];case 13:_state.sent(),a.debug("Records saving completed",{recordsSize:g.size,elapsedMs:Date.now()-x});return[2]}})})()}var dI=/*#__PURE__*/function(Error1){"use strict";_inherits(dI1,Error1);function dI1(){_class_call_check(this,dI1);var _this;_this=_call_super(this,dI1,[P.t("sync.cancelled")]),_this.name="SyncCancelledError";return _this}return dI1}(_wrap_native_super(Error)),pI=/*#__PURE__*/function(){"use strict";function pI1(t,r){var _this=this;_class_call_check(this,pI1);this.plugin=t;this.options=r;A(this,"remoteFs");A(this,"localFS");A(this,"isCancelled",!1);A(this,"preparationProgressEnabled",!1);A(this,"subscriptions",[]);A(this,"currentLogPrefix","[[Sync]]");A(this,"currentLogger",sI(this.currentLogPrefix));this.options=Object.freeze(this.options);var n=Ihe(t);this.remoteFs=new xv(_object_spread_props(_object_spread({},this.options),{settings:t.settings,filterRules:n,onTraversalProgress:function(i){_this.emitPreparationProgress({phase:i.phase==="complete"?"analyzing":"traversingRemote",traversal:i})},throwIfCancelled:function(){return _this.throwIfCancelled()}})),this.localFS=new iA({vault:this.options.vault,syncRecord:new $0(D6(this.vault.getName(),this.remoteBaseDir),Ad),filterRules:n,settings:t.settings}),this.subscriptions.push(_b().subscribe(function(){_this.isCancelled=!0}))}_create_class(pI1,[{key:"emitPreparationProgress",value:function emitPreparationProgress(t){this.preparationProgressEnabled&&wY(t)}},{key:"throwIfCancelled",value:function throwIfCancelled(){if(this.isCancelled)throw new dI}},{key:"start",value:function start(_01){return _async_to_generator(function(param){var _this,t,tmp,r,_$n,i,o,a,s,l,c,d,u,_tmp,D,p,m,_tmp1,h,g,x,v,_$D,_$D1,_ref,L,ee,pe,N,U,G,K,me,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,xe,Y,oe,oe1,err,V,ie,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,xe1,Y5,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,oe2,re,de,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,xe2,y,_,b,w,S,E,C,I,O,M,R,$,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_this1,_loop,_iterator4,_step4,_ret,err,z,_$D2,L10,ee1,pe1,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;t=param.mode,tmp=param.syncPolicy,r=tmp===void 0?this.localSettings.syncPolicy:tmp;this.currentLogPrefix=L1e({mode:t,policy:r}),this.currentLogger=sI(this.currentLogPrefix);_state.label=1;case 1:_state.trys.push([1,40,41,42]);_$n=t==="manual_sync";this.preparationProgressEnabled=_$n;i=!1,o=function(){i||(_Y({showNotice:_$n}),i=!0)};_$n&&o();a=this.settings,s=this.webdav,l=Xi(this.options.remoteBaseDir);this.logger.info("[Sync] Endpoint:",{loginMode:a.loginMode,dav:rp(a),nsdav:aA(a),remoteBaseDir:l});c=new $0(D6(this.vault.getName(),this.remoteBaseDir),Ad),d=new G6(this.plugin);this.emitPreparationProgress({phase:"checkingRemote"});return[4,s.exists(l)];case 2:u=_state.sent();_tmp=u;if(_tmp)return[3,4];return[4,c.drop()];case 3:_tmp=_state.sent();_state.label=4;case 4:_tmp;_state.label=5;case 5:if(!!u)return[3,14];if(this.isCancelled)return[2,(_g(),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];_state.label=6;case 6:_state.trys.push([6,8,,13]);return[4,s.createDirectory(this.options.remoteBaseDir,{recursive:!0})];case 7:_state.sent();return[3,14];case 8:D=_state.sent();if(!Lc(D))return[3,11];return[4,this.handle503Error(6e4)];case 9:if(_state.sent(),this.isCancelled)return[2,(_g(),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];return[4,s.exists(l)];case 10:u=_state.sent();return[3,12];case 11:throw D;case 12:return[3,13];case 13:return[3,5];case 14:this.emitPreparationProgress({phase:"loadingState"});return[4,d.restoreRemoteTraversalCacheIfMissing(this.logger)];case 15:_state.sent();p=function(){switch(r){case"send-only":return new fS(_this,c);case"send-only-override-changes":return new cI(_this,c);case"receive-only":return new pS(_this,c);case"receive-only-revert-local-changes":return new uI(_this,c);case"two-way":default:return new mS(_this,c)}}();this.emitPreparationProgress({phase:"analyzing"});return[4,p.decide()];case 16:m=_state.sent();_tmp1=this.isCancelled;if(_tmp1)return[3,18];this.emitPreparationProgress({phase:"savingCache"});return[4,d.saveRemoteTraversalCache(this.logger,function(){return _this.isCancelled})];case 17:_tmp1=_state.sent();_state.label=18;case 18:if(_tmp1,this.throwIfCancelled(),this.logger.info("[Sync] Decision:",{push:m.filter(function(D){return _instanceof(D,Ou)}).length,pull:m.filter(function(D){return _instanceof(D,Mu)}).length,conflict:m.filter(function(D){return _instanceof(D,Iu)}).length,mkdirRemote:m.filter(function(D){return _instanceof(D,Ia)}).length,mkdirLocal:m.filter(function(D){return _instanceof(D,bc)}).length,removeLocal:m.filter(function(D){return _instanceof(D,tl)}).length,removeRemote:m.filter(function(D){return _instanceof(D,Ul)}).length,noop:m.filter(function(D){return _instanceof(D,el)}).length,skipped:m.filter(function(D){return _instanceof(D,Bl)}).length,total:m.length}),m.length===0)return[2,i?(I7({showNotice:_$n,failedCount:0}),{ended:!0,ranTasks:!1,shouldReloadSettings:!1}):(I7({showNotice:!1,failedCount:0}),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];o();h=m.filter(function(D){return _instanceof(D,el)}),g=m.filter(function(D){return _instanceof(D,Bl)}),x=m.filter(function(D){return!(_instanceof(D,el)||_instanceof(D,Bl))}),v=x.findIndex(function(D){return!_instanceof(D,Zs)});if(this.isCancelled)return[2,(_g(),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];if(!(_$n&&a.confirmBeforeSync&&v>-1))return[3,20];this.plugin.progressService.closeProgressModal();return[4,new P6(this.app,x).openAndWait()];case 19:_$D=_state.sent();if(_$D.confirm)x=_$D.tasks,this.plugin.progressService.showProgressModal();else return[2,(_g(),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];_state.label=20;case 20:if(!(t==="auto_sync"&&a.confirmBeforeDeleteInAutoSync))return[3,31];_$D1=x.filter(function(L){return _instanceof(L,tl)});if(!(_$D1.length>0))return[3,31];new iu.Notice(P.t("deleteConfirm.warningNotice"),3e3);return[4,new Mb(this.app,_$D1).openAndWait()];case 21:_ref=_state.sent(),L=_ref.tasksToDelete,ee=_ref.tasksToReupload,pe=new Map,N=new Map,U=[],G=new Set,K=function(xe){var Y=xe;for(;Y&&Y!=="."&&Y!==""&&Y!=="/"&&!G.has(Y);)G.add(Y),Y=Xi((0,hS.dirname)(Y))},me=function(xe,Y){return _async_to_generator(function(){var oe,H,Q,Fe;return _ts_generator(this,function(_state){switch(_state.label){case 0:oe=(0,iu.normalizePath)((0,hS.dirname)(xe)),H=Xi((0,hS.dirname)(Y));if(!(!(oe==="."||oe===""||oe==="/"||N.has(H)||m.some(function(Q){return _instanceof(Q,Ia)&&Q.remotePath===H})||x.some(function(Q){return _instanceof(Q,Ia)&&Q.remotePath===H}))&&!G.has(H)))return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,s.stat(H)];case 2:_state.sent(),K(H);return[3,4];case 3:Q=_state.sent();this.logger.error(Q);Fe=new Ia({vault:this.vault,webdav:s,remoteBaseDir:this.remoteBaseDir,remotePath:H,localPath:oe,syncRecord:c,logger:this.logger});N.set(H,Fe);return[3,4];case 4:return[2]}})}).call(_this)};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=22;case 22:_state.trys.push([22,28,29,30]);_iterator=ee[Symbol.iterator]();_state.label=23;case 23:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,27];xe=_step.value;return[4,Ya(this.vault,xe.localPath)];case 24:Y=_state.sent();if(!Y)return[3,26];return[4,me(xe.localPath,xe.remotePath)];case 25:if(_state.sent(),Y.isDir){oe=new Ia(xe.options);pe.set(xe,oe),N.set(xe.remotePath,oe)}else{oe1=new Ou(xe.options);pe.set(xe,oe1),U.push(oe1)}_state.label=26;case 26:_iteratorNormalCompletion=true;return[3,23];case 27:return[3,30];case 28:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,30];case 29:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 30:V=Array.from(N.values()),ie=new Set(L);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=ee[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){xe1=_step1.value;Y5=(0,iu.normalizePath)(xe1.localPath);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;for(;Y5&&Y5!=="."&&Y5!==""&&Y5!=="/"&&(Y5=(0,iu.normalizePath)((0,hS.dirname)(Y5)),!(Y5==="."||Y5===""||Y5==="/"));)try{for(_iterator2=ie[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){oe2=_step2.value;if(oe2.localPath===Y5){ie.delete(oe2);break}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}re=[],de=[];_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=x[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){xe2=_step3.value;if(!_instanceof(xe2,tl)){re.push(xe2);continue}if(ie.has(xe2)){de.push(xe2);continue}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}x=_to_consumable_array(V).concat(_to_consumable_array(re),_to_consumable_array(U),_to_consumable_array(de));_state.label=31;case 31:y=Array.from(new Set(_to_consumable_array(x).concat(_to_consumable_array(h),_to_consumable_array(g)))),_=y.filter(function(D){return _instanceof(D,Ia)}),b=y.filter(function(D){return _instanceof(D,Ul)}),w=y.filter(function(D){return!(_instanceof(D,Ia)||_instanceof(D,Ul))}),S=W1e(_),E=_to_consumable_array(G1e(b)).concat(_to_consumable_array(S),_to_consumable_array(w));x.length>500&&iu.Platform.isDesktopApp&&new iu.Notice(P.t("sync.suggestUseClientForManyTasks"),5e3);C=E.filter(function(D){return!(_instanceof(D,el)||_instanceof(D,Zs))});CY({showNotice:_$n}),C.length>0&&N7(C.length,[],null);I=Ib(E,200),O=[],M=!1,R={total:lB(E),completed:0},$=[];_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;_state.label=32;case 32:_state.trys.push([32,37,38,39]);_loop=function(){var _$D,_$_O,L;return _ts_generator(this,function(_state){switch(_state.label){case 0:_$D=_step4.value;return[4,_this1.execTasks(_$D,C,$)];case 1:L=_state.sent();(_$_O=O).push.apply(_$_O,_to_consumable_array(L)),M||(M=_$D.some(function(ee,pe){return _this.didTaskReloadPluginSettings(ee,L[pe])}));return[4,_this1.updateMtimeInRecord(_$D,L,R)];case 2:if(_state.sent(),_this1.isCancelled)return[2,"break"];return[2]}})};_iterator4=I[Symbol.iterator]();_state.label=33;case 33:if(!!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done))return[3,36];_this1=this;return[5,_ts_values(_loop())];case 34:_ret=_state.sent();if(_ret==="break")return[3,36];_state.label=35;case 35:_iteratorNormalCompletion4=true;return[3,33];case 36:return[3,39];case 37:err=_state.sent();_didIteratorError4=true;_iteratorError4=err;return[3,39];case 38:try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}return[7];case 39:if(this.isCancelled)return[2,(_g(),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];z=O.filter(function(D){return!D.success}).length;if(this.logger.info("[Sync] Completed: ".concat(O.length-z," success, ").concat(z," failed")),this.logger.debug("tasks result",O,"failed:",z),t==="manual_sync"&&z>0){_$D2=[];for(L10=0;L10<O.length;L10++){ee1=O[L10];if(!ee1.success&&ee1.error){pe1=ee1.error.task;_$D2.push({taskName:Yp(pe1),localPath:pe1.options.localPath,errorMessage:ee1.error.message})}}new Ob(this.app,_$D2).open()}return[2,(I7({failedCount:z,showNotice:_$n}),{ended:!0,ranTasks:!0,shouldReloadSettings:M})];case 40:n=_state.sent();return[2,(_instanceof(n,dI)?(_g(),this.logger.info("Sync cancelled")):(R7(n),this.logger.error("Sync error:",n)),{ended:!1,ranTasks:!1,shouldReloadSettings:!1})];case 41:this.preparationProgressEnabled=!1,this.currentLogPrefix="[[Sync]]",this.currentLogger=sI(this.currentLogPrefix),this.subscriptions.forEach(function(n){return n.unsubscribe()});return[7];case 42:return[2]}})}).apply(this,arguments)}},{key:"didTaskReloadPluginSettings",value:function didTaskReloadPluginSettings(t,r){return!(r!=null&&r.success)||!this.isPluginSettingsPath(t.localPath)?!1:_instanceof(t,Mu)||_instanceof(t,tl)?!0:_instanceof(t,Iu)?["no-conflict-merge","diff3","server-priority"].includes(t.options.strategy):!1}},{key:"isPluginSettingsPath",value:function isPluginSettingsPath(t){var r=(0,iu.normalizePath)("".concat(this.vault.configDir,"/plugins/").concat(this.plugin.manifest.id));return t==="".concat(r,"/data.json")||t==="".concat(r,"/data.local.json")}},{key:"execTasks",value:function execTasks(t,r,n){return _async_to_generator(function(){var i,o,s,l,c,d,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=[],o=t.filter(function(s){return!(_instanceof(s,el)||_instanceof(s,Zs))});this.logger.debug("Starting to execute sync tasks",{totalTasks:t.length,displayedTasks:o.length,totalDisplayableTasks:r.length,alreadyCompleted:n.length});s=0;_state.label=1;case 1:if(!(s<t.length))return[3,4];l=t[s];if(this.isCancelled)return[3,4];c=!(_instanceof(l,el)||_instanceof(l,Zs));this.logger.debug("Executing task [".concat(s+1,"/").concat(t.length,"] ").concat(l.localPath),{taskName:Yp(l),taskPath:l.localPath}),c&&N7(r.length,n,l);return[4,this.executeWithRetry(l)];case 2:d=_state.sent();this.logger.debug("Task completed [".concat(s+1,"/").concat(t.length,"] ").concat(l.localPath),{taskName:Yp(l),taskPath:l.localPath,result:d}),i[s]=d,c&&(n.push({task:l,success:d.success}),N7(r.length,n,l));_state.label=3;case 3:++s;return[3,1];case 4:a=i.filter(function(s){return s.success}).length;return[2,(this.logger.debug("All tasks execution completed",{totalTasks:t.length,successCount:a,failedCount:t.length-a}),i)]}})}).call(this)}},{key:"executeWithRetry",value:function executeWithRetry(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=0;_state.label=1;case 1:if(this.isCancelled)return[2,{success:!1,error:new Eg(P.t("sync.cancelled"),t)}];return[4,t.exec()];case 2:n=_state.sent();if(!(!n.success&&Lc(n.error)))return[3,4];r++,this.logger.warn("[Sync] 503 on ".concat(t.localPath,", retry #").concat(r," in 60s"));return[4,this.handle503Error(6e4)];case 3:if(_state.sent(),this.isCancelled)return[2,{success:!1,error:new Eg(P.t("sync.cancelled"),t)}];return[3,5];case 4:return[2,n];case 5:return[3,1];case 6:return[2]}})}).call(this)}},{key:"updateMtimeInRecord",value:function updateMtimeInRecord(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,H1e(this.plugin,this.vault,this.remoteBaseDir,t,r,10,this.logger,n)]})}).call(this)}},{key:"handle503Error",value:function handle503Error(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Date.now(),n=r+t;new iu.Notice(P.t("sync.requestsTooFrequent",{time:(0,iu.moment)(n).format("HH:mm:ss")}));return[4,F1e(_b(),n-r)];case 1:_state.sent();return[2]}})})()}},{key:"app",get:function get1(){return this.plugin.app}},{key:"webdav",get:function get1(){return this.options.webdav}},{key:"vault",get:function get1(){return this.options.vault}},{key:"remoteBaseDir",get:function get1(){return this.options.remoteBaseDir}},{key:"settings",get:function get1(){return this.plugin.settings}},{key:"localSettings",get:function get1(){return this.plugin.localSettings}},{key:"logger",get:function get1(){return this.currentLogger}}]);return pI1}();var eo=require("obsidian");var Z1e=nr(ln(),1);function K1e(e,t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=Z1e.posix.normalize(t);if(!n.startsWith("/")||n==="/"||n===Cs||n.startsWith("".concat(Cs,"/"))||n===Yl||n.startsWith("".concat(Yl,"/")))return[2];i=n.slice(1);return[4,e.vault.adapter.readBinary(i)];case 1:o=_state.sent();return[2,"data:".concat(r,";base64,").concat(tx(new Uint8Array(o),!1))]}})})()}var gS=require("@codemirror/state"),D0=require("@codemirror/view"),fI=gS.StateEffect.define(),fut=D0.Decoration.mark({class:"nutstore-chatbox-selection-highlight"}),Q1e=gS.StateField.define({create:function(){return null},update:function update(e,t){var r=e;if(r&&!t.changes.empty){var n=t.changes.mapPos(r.from,1),i=t.changes.mapPos(r.to,-1);r=cB(t.state.doc.length,n,i)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.effects[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n10=_step.value;n10.is(fI)&&(r=n10.value?cB(t.state.doc.length,n10.value.from,n10.value.to):null)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r},provide:function(e){return D0.EditorView.decorations.from(e,function(t){return t?D0.Decoration.set([fut.range(t.from,t.to)]):D0.Decoration.none})}}),mut=D0.EditorView.baseTheme({".nutstore-chatbox-selection-highlight":{backgroundColor:"var(--text-selection)",borderRadius:"2px"}}),hut=[Q1e,mut];function cB(e,t,r){var n=Math.max(0,Math.min(t,e)),i=Math.max(0,Math.min(r,e));return n===i?null:{from:Math.min(n,i),to:Math.max(n,i)}}function uB(e){return e.state.field(Q1e,!1)!==void 0}function J1e(e,t){var r=[];if(!t)return uB(e)&&r.push(fI.of(null)),r;var n=cB(e.state.doc.length,t.from,t.to);return n?(uB(e)||r.push(gS.StateEffect.appendConfig.of(hut)),r.push(fI.of(n)),r):(uB(e)&&r.push(fI.of(null)),r)}function Y1e(e,t,r){var n=J1e(e,{from:t,to:r});n.length>0&&e.dispatch({effects:n})}function X1e(e){var t=J1e(e,null);t.length>0&&e.dispatch({effects:t})}var gut="language-html";function xut(e){return e.split(/\s+/).includes(gut)}function yut(e){return P.t(e?"chatbox.ui.actions.showHtmlCode":"chatbox.ui.actions.runHtmlCode")}function exe(e){var t=e.ownerDocument;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var r=_step.value;if(typeof r.className!="string"||!xut(r.className))return"continue";var n=r.parentElement;if(!n)return"continue";var i=t.createElement("div");i.className="ns-chatbox-runnable-code";var o=t.createElement("div");o.className="ns-chatbox-runnable-code-header";var a=t.createElement("span");a.className="ns-chatbox-runnable-code-lang",a.textContent="HTML";var s=t.createElement("button");s.type="button",s.className="ns-chatbox-runnable-code-toggle";var l=t.createElement("span"),c=t.createElement("span");s.append(l,c),o.append(a,s),i.appendChild(o),n.replaceWith(i),i.appendChild(n);var d=t.createElement("div");d.className="ns-chatbox-runnable-code-preview",d.hidden=!0;var u=t.createElement("iframe");u.setAttribute("sandbox","allow-scripts allow-modals allow-forms allow-popups allow-downloads allow-pointer-lock"),d.appendChild(u),i.appendChild(d);var p=!1,m=!1,h=function(){l.className=p?"ns-ydsw11":"ns-grao4w",c.textContent=yut(p)};h(),s.addEventListener("click",function(){var g;p=!p,p&&!m&&(u.srcdoc=(g=r.textContent)!=null?g:"",m=!0),n.hidden=p,d.hidden=!p,h()})};for(var _iterator=Array.from(e.querySelectorAll("pre > code"))[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var vut="obsidian://nutstore-sync/modal/provider-edit";function txe(e){var r;return((r=e==null?void 0:e.trim())!=null?r:"")||""}function rxe(e){var i,o,a,s,l,c;var t=(o=(i=e.href)==null?void 0:i.trim())!=null?o:"",r=(s=(a=e.datasetHref)==null?void 0:a.trim())!=null?s:"",n=new Set((l=e.classNames)!=null?l:[]);if(r||n.has("internal-link")){var d=r||t;return d?{type:"internal",linktext:d}:{type:"none"}}if(!t||t==="#")return{type:"none"};if(t.startsWith(vut))try{var d10=(c=new URL(t).searchParams.get("providerId"))==null?void 0:c.trim();return{type:"protocol",href:t,providerId:d10||void 0}}catch(d){return{type:"protocol",href:t}}return{type:"external",href:t}}var Wc="nutstore-sync-chatbox";function _ut(e){var r,n,i;var t=e.trim();if(!t)return null;if(t.startsWith("obsidian://open?"))try{t=(r=new URL(t).searchParams.get("file"))!=null?r:t}catch(o){}try{t=decodeURIComponent(t)}catch(o){}return t=t.replace(/^\[\[/,"").replace(/\]\]$/,""),t=(i=(n=t.split("|")[0])==null?void 0:n.trim())!=null?i:"",t=t.replace(/^\/+/,"").replace(/\/+$/,"").trim(),t?(0,eo.normalizePath)(t):null}var xS=/*#__PURE__*/function(_eo_ItemView){"use strict";_inherits(xS1,_eo_ItemView);function xS1(r,n){_class_call_check(this,xS1);var _this;var _this1;_this=_call_super(this,xS1,[r]),_this1=_this;_this.plugin=n;A(_this,"rootEl");A(_this,"controller");A(_this,"unsub");A(_this,"unsubWindowMigrated");A(_this,"lastActiveMarkdownLeaf",null);A(_this,"activeFilePathSnapshot");A(_this,"activeSelectionSnapshot");A(_this,"highlightedEditorView");A(_this,"preservingSelectionForChatFocus",!1);A(_this,"renderMarkdown",function(r,n,i){return _async_to_generator(function(){var _r1,o,a,s,l,c,d,p,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=_this1.app,a=_this1.plugin,s=new eo.Component;_this1.addChild(s),s.load();l=n,c=r.ownerDocument.createElement("div"),d=_this1.getMarkdownSourcePath(!0);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,eo.MarkdownRenderer.render(o,n,c,d,s)];case 2:_state.sent();return[3,4];case 3:p=_state.sent();Me.error("Error rendering chat markdown:",p),s.unload(),r.replaceChildren(),r.textContent=l;return[2];case 4:(_r1=r).replaceChildren.apply(_r1,_to_consumable_array(Array.from(c.childNodes))),r.childNodes.length||(r.textContent=l),i!=null&&i.streaming||exe(r);u=function(p){var m=p.target;if(!_instanceof(m,Element))return;var h=m.closest("a");if(!_instanceof(h,HTMLAnchorElement))return;var g=rxe({href:h.getAttribute("href"),datasetHref:h.getAttribute("data-href"),classNames:Array.from(h.classList)});if(g.type!=="none"){if(p.preventDefault(),p.stopPropagation(),g.type==="internal"){o.workspace.openLinkText(g.linktext,d,!1);return}if(g.type==="protocol"&&g.providerId){a.protocolService.openProviderEditor(g.providerId,a.chatService.getChatModalMountTarget());return}window.open(g.href,"_blank","noopener,noreferrer")}};return[2,(r.addEventListener("click",u),function(){r.removeEventListener("click",u),s.unload(),r.replaceChildren()})]}})})()});_this.registerEvent(_this.app.workspace.on("active-leaf-change",function(i){var o;_this.handleActiveLeafChange(i),(o=_this.controller)==null||o.update(_this.getChatboxProps())})),_this.registerEvent(_this.app.workspace.on("file-open",function(){var i;_this.captureActiveContextSnapshot(),(i=_this.controller)==null||i.update(_this.getChatboxProps())})),_this.registerDomEvent(document,"selectionchange",function(){var i;_this.preservingSelectionForChatFocus||_this.app.workspace.getActiveViewOfType(eo.MarkdownView)&&(_this.captureActiveContextSnapshot(),(i=_this.controller)==null||i.update(_this.getChatboxProps()))});return _this}_create_class(xS1,[{key:"getViewType",value:function getViewType(){return Wc}},{key:"getDisplayText",value:function getDisplayText(){return P.t("chatbox.title")}},{key:"getIcon",value:function getIcon(){return xg}},{key:"resolveDroppedAbstractFile",value:function resolveDroppedAbstractFile(r){var n=_ut(r);if(!n)return null;var i=[n];/\.[^/]+$/.test(n)||i.push("".concat(n,".md"));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;var l=this.plugin.app.vault.getAbstractFileByPath(s);if(l)return l}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var o=n.split("/").pop();if(!o)return null;var a=this.plugin.app.vault.getAllLoadedFiles().filter(function(s){var c=(0,eo.normalizePath)(s.path).replace(/\.md$/i,"");return s.name===o||c===n||c.endsWith("/".concat(o))});return a.length===1?a[0]:null}},{key:"isVaultImageFile",value:function isVaultImageFile(r){return r.path.match(/\.(png|jpe?g|gif|webp|bmp)$/i)!==null}},{key:"createDroppedImageContextItem",value:function createDroppedImageContextItem(r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r.extension.toLowerCase();return[4,this.app.vault.readBinary(r)];case 1:i=_state.sent();return[2,y7(new Blob([i]),{mimeType:"image/".concat(n==="jpg"?"jpeg":n),name:r.name,size:r.stat.size})]}})}).call(this)}},{key:"clearActiveContextSnapshot",value:function clearActiveContextSnapshot(){this.activeFilePathSnapshot=void 0,this.activeSelectionSnapshot=void 0}},{key:"clearSelectionHighlight",value:function clearSelectionHighlight(){if(this.highlightedEditorView){try{X1e(this.highlightedEditorView)}catch(r){}this.highlightedEditorView=void 0}}},{key:"getLastActiveMarkdownView",value:function getLastActiveMarkdownView(){var r=this.lastActiveMarkdownLeaf;return!_instanceof(r==null?void 0:r.view,eo.MarkdownView)||!r.view.containerEl.isConnected?(this.lastActiveMarkdownLeaf=null,null):r.view}},{key:"resolveMarkdownView",value:function resolveMarkdownView(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var n=this.app.workspace.getActiveViewOfType(eo.MarkdownView);return n||(r?this.getLastActiveMarkdownView():null)}},{key:"getEditorView",value:function getEditorView(r){var n,i;return(i=(n=r==null?void 0:r.editor)==null?void 0:n.cm)!=null?i:null}},{key:"getMarkdownSourcePath",value:function getMarkdownSourcePath(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var i,o;var n=this.resolveMarkdownView(r);return txe((o=(i=n==null?void 0:n.file)==null?void 0:i.path)!=null?o:this.activeFilePathSnapshot)}},{key:"persistSelectionHighlight",value:function persistSelectionHighlight(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var n=this.resolveMarkdownView(r),i=this.getEditorView(n);if(!i){this.clearSelectionHighlight();return}var o=i.state.selection.main;if(o.from===o.to){this.clearSelectionHighlight();return}this.highlightedEditorView&&this.highlightedEditorView!==i&&this.clearSelectionHighlight(),Y1e(i,o.from,o.to),this.highlightedEditorView=i}},{key:"handleActiveLeafChange",value:function handleActiveLeafChange(r){if(this.highlightedEditorView&&(r==null?void 0:r.getViewState().type)!==Wc&&this.clearSelectionHighlight(),_instanceof(r==null?void 0:r.view,eo.MarkdownView)){this.lastActiveMarkdownLeaf=r,this.preservingSelectionForChatFocus=!1,this.captureActiveContextSnapshot();return}if((r==null?void 0:r.getViewState().type)===Wc){this.persistSelectionHighlight(!0);return}var n=r==null?void 0:r.getRoot();r&&(n===this.app.workspace.leftSplit||n===this.app.workspace.rightSplit)||(this.preservingSelectionForChatFocus=!1,this.clearActiveContextSnapshot())}},{key:"captureActiveContextSnapshot",value:function captureActiveContextSnapshot(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;var s,l,c,d;var n=this.resolveMarkdownView(r);if(!n){var u=this.app.workspace.getActiveFile();u?(this.activeFilePathSnapshot=u.path,this.activeSelectionSnapshot=void 0):this.clearActiveContextSnapshot(),this.clearSelectionHighlight();return}this.activeFilePathSnapshot=(s=n.file)==null?void 0:s.path;var i=n.editor,o=(l=i==null?void 0:i.listSelections)==null?void 0:l.call(i)[0],a=(c=i==null?void 0:i.getSelection())!=null?c:"";if(!((d=n.file)!=null&&d.path)){this.clearActiveContextSnapshot(),this.clearSelectionHighlight();return}if(!o||!a.trim()){this.activeSelectionSnapshot=void 0,this.clearSelectionHighlight();return}this.activeSelectionSnapshot=x7({type:"selection",filePath:n.file.path,range:{from:{line:o.anchor.line,ch:o.anchor.ch},to:{line:o.head.line,ch:o.head.ch}},selectedText:a})}},{key:"getActiveContextItems",value:function getActiveContextItems(){return this.activeSelectionSnapshot?[this.activeSelectionSnapshot]:this.activeFilePathSnapshot?[rx(this.activeFilePathSnapshot,"file")]:[]}},{key:"openFileChange",value:function openFileChange(r,n){return _async_to_generator(function(){var l,c,d,i,o,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=this.app.vault.getAbstractFileByPath((0,eo.normalizePath)(r));if(!_instanceof(i,eo.TFile))return[2];o=(d=(c=this.app.workspace.getLeavesOfType("markdown").find(function(u){var p;return _instanceof(u.view,eo.MarkdownView)&&((p=u.view.file)==null?void 0:p.path)===i.path}))!=null?c:(l=this.getLastActiveMarkdownView())==null?void 0:l.leaf)!=null?d:this.app.workspace.getLeaf("tab");return[4,o.openFile(i,{active:!0})];case 1:if(_state.sent(),n===void 0||!_instanceof(o.view,eo.MarkdownView))return[2];a=o.view.editor,s={line:Math.max(0,Math.min(n-1,a.lastLine())),ch:0};a.setCursor(s),a.scrollIntoView({from:s,to:s},!0),a.focus();return[2]}})}).call(this)}},{key:"getChatboxProps",value:function getChatboxProps(){var _this=this;var r=this.plugin.chatService.getViewProps(),n=this.getActiveContextItems().filter(function(i){var o=Sd(i);return!r.draft.userContext.some(function(a){return Sd(a)===o})});return _object_spread_props(_object_spread({},r),{activeContextItems:n,renderMarkdown:this.renderMarkdown,onModalHostChange:function(i){return _this.plugin.chatService.setChatModalHost(i)},onOpenFileChange:function(i,o){return _this.openFileChange(i,o)},onResolveResourceDataUrl:function(i,o){return K1e(_this.app,i,o)},onSendMessage:function(i,o){return _this.plugin.chatService.sendMessage(i,o!=null?o:[])},onCaptureActiveContext:function(){var i;_this.captureActiveContextSnapshot(!0),_this.preservingSelectionForChatFocus=!!_this.activeSelectionSnapshot,_this.persistSelectionHighlight(!0),(i=_this.controller)==null||i.update(_this.getChatboxProps())},onAddUserContext:function(i){_this.plugin.chatService.addUserContext(i)},onDropContextItem:function(i){return _async_to_generator(function(){var o,a,_$s,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=this.resolveDroppedAbstractFile(i);if(!o)return[3,6];if(_instanceof(o,eo.TFolder)){this.plugin.chatService.addUserContext(rx(o.path,"folder"));return[2]}if(!_instanceof(o,eo.TFile))return[3,6];if(!this.isVaultImageFile(o))return[3,5];a=v7("image",o.name);this.plugin.chatService.addUserContext(a);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.createDroppedImageContextItem(o)];case 2:_$s=_state.sent();this.plugin.chatService.resolvePendingContextItem(a.id,_$s);return[3,4];case 3:s=_state.sent();throw this.plugin.chatService.resolvePendingContextItem(a.id,null),s;case 4:return[2];case 5:this.plugin.chatService.addUserContext(rx(o.path,"file"));return[2];case 6:return[2]}})}).call(_this)},onRemoveUserContext:function(i){_this.plugin.chatService.removeUserContext(i)},onResolvePendingContextItem:function(i,o){_this.plugin.chatService.resolvePendingContextItem(i,o)}})}},{key:"remountChatbox",value:function remountChatbox(){var _this=this;var r,n;(r=this.unsub)==null||r.call(this),this.unsub=void 0,(n=this.controller)==null||n.destroy(),this.controller=Kme(this.rootEl,this.getChatboxProps()),this.unsub=this.plugin.chatService.subscribe(function(){var i;(i=_this.controller)==null||i.update(_this.getChatboxProps())})}},{key:"onOpen",value:function onOpen(){return _async_to_generator(function(){var _this,r;return _ts_generator(this,function(_state){_this=this;this.contentEl.empty(),this.rootEl=this.contentEl.createDiv({cls:"ns-82q8nr nutstore-chatbox-view"}),this.captureActiveContextSnapshot(!0),this.plugin.chatService.setChatModalHost(this.rootEl),(r=this.unsubWindowMigrated)==null||r.call(this),this.unsubWindowMigrated=this.rootEl.onWindowMigrated(function(){_this.plugin.chatService.setChatModalHost(_this.rootEl),_this.remountChatbox()}),this.remountChatbox(),this.plugin.chatService.ensureSession().catch(function(n){Me.error("Failed to restore ChatBox session",n)});return[2]})}).call(this)}},{key:"onClose",value:function onClose(){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){this.clearSelectionHighlight(),(r=this.unsubWindowMigrated)==null||r.call(this),this.unsubWindowMigrated=void 0,(n=this.unsub)==null||n.call(this),this.unsub=void 0,(i=this.controller)==null||i.destroy(),this.controller=void 0,this.plugin.chatService.setChatModalHost(void 0),this.contentEl.empty();return[2]})}).call(this)}}]);return xS1}(eo.ItemView);var mI=require("obsidian");var L0=/*#__PURE__*/function(_mI_Modal){"use strict";_inherits(L01,_mI_Modal);function L01(r,n,i,o){_class_call_check(this,L01);var _this;_this=_call_super(this,L01,[r]);_this.settings=n;_this.onConfirm=o;A(_this,"selectedPolicy");_this.selectedPolicy=i.syncPolicy;return _this}_create_class(L01,[{key:"onOpen",value:function onOpen(){return _async_to_generator(function(){var _this,_this1,r,n,i,o,a,s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_this2,_loop,_iterator,_step;return _ts_generator(this,function(_state){_this=this;this.setTitle(P.t("sync.confirmModal.title"));_this1=this,r=_this1.contentEl;Er(this.modalEl,"sync-confirm-modal"),Er(r,"sync-confirm-modal__content");n=r.createDiv({cls:"ns-9n15mk"}),i=r.createDiv({cls:"sync-confirm-modal__footer"}),o=n.createDiv({cls:"sync-info"});o.createEl("p",{text:P.t("sync.confirmModal.remoteDir",{dir:this.settings.remoteDir})});a=o.createEl("p");n.createEl("h3",{text:P.t("sync.confirmModal.policyTitle")});s=n.createEl("section"),l=s.createDiv({cls:"ns-f8wori"}),c=s.createEl("pre",{cls:"ns-r5q6wx"}),d=function(){c.setText([P.t("sync.confirmModal.policyBasis"),P.t(eI(_this.selectedPolicy)),P.t("sync.confirmModal.policyRecordNote")].join("\n\n")),_this.selectedPolicy==="two-way"?(a.setText(P.t("sync.confirmModal.strategy",{strategy:P.t("settings.conflictStrategy.".concat(N1e(_this.settings.conflictStrategy)))})),a.hidden=!1):a.hidden=!0};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{_loop=function(){var u=_step.value;var p=l.createEl("label",{cls:"ns-96f5gd"}),m=p.createEl("input",{type:"radio",value:u,attr:{name:"nutstore-sync-policy"}});m.checked=u===_this2.selectedPolicy,m.addEventListener("change",function(){m.checked&&(_this.selectedPolicy=u,d())}),p.createSpan({text:P.t(D1e(u))})};for(_iterator=Object.values(aS)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_this2=this,_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}d(),n.createEl("pre",{cls:"ns-24abin",text:P.t("sync.confirmModal.message")}),new mI.Setting(i).addButton(function(u){return u.setButtonText(P.t("sync.confirmModal.cancel")).onClick(function(){return _this.close()})}).addButton(function(u){return u.setButtonText(P.t("sync.confirmModal.confirm")).setCta().onClick(function(){_this.close(),_this.onConfirm(_this.selectedPolicy)})});return[2]})}).call(this)}},{key:"onClose",value:function onClose(){var _this=this,r=_this.contentEl;r.empty(),Dn(r,"sync-confirm-modal__content"),Dn(this.modalEl,"sync-confirm-modal")}}]);return L01}(mI.Modal);var hI=/*#__PURE__*/function(Pr1){"use strict";_inherits(hI1,Pr1);function hI1(r){_class_call_check(this,hI1);var _this;_this=_call_super(this,hI1);_this.plugin=r;A(_this,"startRibbonEl",null);A(_this,"stopRibbonEl",null);return _this}_create_class(hI1,[{key:"onload",value:function onload(){var _this=this;this.startRibbonEl=this.plugin.addRibbonIcon("refresh-ccw",P.t("sync.startButton"),function(){return _async_to_generator(function(){var _this,_$n,r;return _ts_generator(this,function(_state){_this=this;if(this.plugin.isSyncing)return[2];if(!this.plugin.isAccountConfigured()){new nxe.Notice(P.t("sync.error.accountNotConfigured"));try{_$n=this.plugin.app.setting;_$n&&(_$n.open(),_$n.openTabById(this.plugin.manifest.id))}catch(n){Me.error("Failed to open settings:",n)}return[2]}r=function(n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.syncExecutorService.executeSync({mode:"manual_sync",syncPolicy:n})];case 1:_state.sent();return[2]}})}).call(_this)};this.plugin.settings.confirmBeforeSync?new L0(this.plugin.app,this.plugin.settings,this.plugin.localSettings,function(n){r(n)}).open():r();return[2]})}).call(_this)}),this.stopRibbonEl=this.plugin.addRibbonIcon("square",P.t("sync.stopButton"),function(){return um()}),Er(this.stopRibbonEl,"ns-wa75fd"),this.plugin.addRibbonIcon(xg,P.t("chatbox.openCommand"),function(){_this.openChatbox()})}},{key:"openChatbox",value:function openChatbox(){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.plugin.app.workspace.getLeavesOfType(Wc)[0]||this.plugin.app.workspace.getRightLeaf(!1);_tmp=n;if(!_tmp)return[3,2];return[4,n.setViewState({type:Wc,active:!0})];case 1:_tmp=(_state.sent(),this.plugin.app.workspace.revealLeaf(n));_state.label=2;case 2:_tmp;return[2]}})}).call(this)}},{key:"update",value:function update(){!this.startRibbonEl||!this.stopRibbonEl||(this.plugin.isSyncing?(this.startRibbonEl.setAttr("aria-disabled","true"),this.startRibbonEl.addClass("nutstore-sync-spinning"),Dn(this.stopRibbonEl,"ns-wa75fd")):(this.startRibbonEl.removeAttribute("aria-disabled"),this.startRibbonEl.removeClass("nutstore-sync-spinning"),Er(this.stopRibbonEl,"ns-wa75fd")))}}]);return hI1}(Pr);var Cf=require("obsidian");var but=/^<{7,}(?: .*)?$/,wut=/^\|{7,}(?: .*)?$/,Sut=/^={7,}$/,kut=/^>{7,}(?: .*)?$/;function dB(e){var t="idle",r=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.split(/\r?\n/)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(but.test(n)){t="current";continue}if(t==="current"&&wut.test(n)){t="base";continue}if((t==="current"||t==="base")&&Sut.test(n)){t="incoming";continue}kut.test(n)&&(t==="incoming"&&(r+=1),t="idle")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var yS=/*#__PURE__*/function(Pr1){"use strict";_inherits(yS1,Pr1);function yS1(r){_class_call_check(this,yS1);var _this;_this=_call_super(this,yS1);_this.plugin=r;A(_this,"actions",new Map);A(_this,"refreshVersion",0);A(_this,"unloaded",!1);return _this}_create_class(yS1,[{key:"onload",value:function onload(){var _this=this;this.unloaded=!1,this.plugin.registerEvent(this.plugin.app.workspace.on("active-leaf-change",function(){_this.refresh()})),this.plugin.registerEvent(this.plugin.app.workspace.on("file-open",function(){_this.refresh()})),this.plugin.registerEvent(this.plugin.app.vault.on("modify",function(r){var i;var n=_this.plugin.app.workspace.getActiveViewOfType(Cf.MarkdownView);_instanceof(r,Cf.TFile)&&((i=n==null?void 0:n.file)==null?void 0:i.path)===r.path&&_this.refresh()})),this.refresh()}},{key:"refresh",value:function refresh(){return _async_to_generator(function(){var a,r,n,i,o,_$s,l,c,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=++this.refreshVersion;if(this.unloaded)return[2];n=this.plugin.app.workspace.getActiveViewOfType(Cf.MarkdownView);if(!n)return[2];i=this.getOrCreateAction(n),o=n.file;if(!o||!this.hasConfiguredModel()){i.hidden=!0;return[2]}_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.plugin.app.vault.cachedRead(o)];case 2:_$s=_state.sent();if(this.unloaded||r!==this.refreshVersion||((a=n.file)==null?void 0:a.path)!==o.path)return[2];l=dB(_$s);i.hidden=l===0;c=P.t("chatbox.conflictResolution.action",{count:l});i.setAttribute("aria-label",c),i.setAttribute("data-tooltip-position","bottom"),i.setAttribute("aria-disabled","false"),i.setAttribute("title",c);return[3,4];case 3:s=_state.sent();i.hidden=!0,Me.error("Failed to inspect merge conflicts: ".concat(o.path),s);return[3,4];case 4:return[2]}})}).call(this)}},{key:"getOrCreateAction",value:function getOrCreateAction(r){var _this=this;var n=this.actions.get(r);if(n)return n;var i=r.addAction("git-merge",P.t("chatbox.conflictResolution.action",{count:1}),function(){_this.prepareResolution(r)});return i.hidden=!0,this.actions.set(r,i),i}},{key:"onunload",value:function onunload(){this.unloaded=!0,this.refreshVersion++;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.actions.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.remove()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.actions.clear()}},{key:"hasConfiguredModel",value:function hasConfiguredModel(){return Boolean(bf(this.plugin.settings.ai.providers,this.plugin.settings.ai.defaultModel))}},{key:"prepareResolution",value:function prepareResolution(r){return _async_to_generator(function(){var n,i,_$o,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.getOrCreateAction(r),i=r.file;if(!!(!i||n.getAttribute("aria-disabled")==="true"))return[3,7];n.setAttribute("aria-disabled","true");_state.label=1;case 1:_state.trys.push([1,5,6,7]);if(!this.hasConfiguredModel()){n.hidden=!0,new Cf.Notice(P.t("chatbox.conflictResolution.modelUnavailable"));return[2]}return[4,this.plugin.app.vault.cachedRead(i)];case 2:_$o=_state.sent();if(dB(_$o)===0){n.hidden=!0,new Cf.Notice(P.t("chatbox.conflictResolution.alreadyResolved"));return[2]}return[4,this.plugin.chatService.createDraftSession(P.t("chatbox.conflictResolution.prompt"),[rx(i.path,"file")])];case 3:_state.sent();return[4,this.plugin.commandService.openChatbox()];case 4:_state.sent();return[3,7];case 5:o=_state.sent();Me.error("Failed to prepare AI conflict resolution: ".concat(i.path),o),new Cf.Notice(P.t("chatbox.conflictResolution.failed"));return[3,7];case 6:n.setAttribute("aria-disabled","false"),this.refresh();return[7];case 7:return[2]}})}).call(this)}}]);return yS1}(Pr);var E_=require("obsidian");var xI=/*#__PURE__*/function(){"use strict";function xI1(t,r,n){_class_call_check(this,xI1);this.state=t;this.runtimeStates=r;this.notify=n}_create_class(xI1,[{key:"addUserContext",value:function addUserContext(t){var r=this.getLoadedActiveSession();if(!r)return;var n=this.runtimeStates.get(r.id),i=sm(t);if(i.type==="pending-context"){if(n.draft.userContext.some(function(a){return a.type==="pending-context"&&a.id===i.id}))return;n.draft.userContext.push(i),this.notify();return}var o=Sd(i);n.draft.userContext.some(function(a){return a.type!=="pending-context"&&a.hash===o})||(n.draft.userContext.push(i),this.notify())}},{key:"removeUserContext",value:function removeUserContext(t){var r=this.getLoadedActiveSession();if(!r)return;this.runtimeStates.get(r.id).draft.userContext.splice(t,1),this.notify()}},{key:"resolvePendingContextItem",value:function resolvePendingContextItem(t,r){var n=this.getLoadedActiveSession();if(!n)return;var i=this.runtimeStates.get(n.id),o=i.draft.userContext.findIndex(function(c){return c.type==="pending-context"&&c.id===t});if(o===-1)return;if(r===null){i.draft.userContext.splice(o,1),this.notify();return}var a=sm(r),s=Sd(a);i.draft.userContext.findIndex(function(c,d){return d!==o&&c.type!=="pending-context"&&Sd(c)===s})!==-1?i.draft.userContext.splice(o,1):i.draft.userContext.splice(o,1,a),this.notify()}},{key:"updateInputDraft",value:function updateInputDraft(t){var r=this.getLoadedActiveSession();if(!r)return;var n=this.runtimeStates.get(r.id);n.draft.text=t}},{key:"dedupeUserContextItems",value:function dedupeUserContextItems(t){var r=[],n=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.type==="pending-context")continue;var o=Sd(i);n.has(o)||(n.add(o),r.push(sm(i)))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}},{key:"createTextFileContextPart",value:function createTextFileContextPart(t){return _async_to_generator(function(){var r,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.size>pj;return[4,(r?t.blob.slice(0,pj):t.blob).text()];case 1:i=_state.sent(),o={type:"file",filename:t.filename,mimeType:t.mimeType,size:t.size,truncated:r,content:i};return[2,{type:"text",text:"<UserProvidedFile>\n".concat(JSON.stringify(o,null,2),"\n</UserProvidedFile>")}]}})})()}},{key:"createImageFilePart",value:function createImageFilePart(t){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(t.blob.type===t.mimeType?t.blob:new Blob([t.blob],{type:t.mimeType})).arrayBuffer()];case 1:n=_state.sent();return[2,S6(new Uint8Array(n),{mediaType:t.mimeType,filename:t.name})]}})})()}},{key:"buildMessagePartsFromUserContext",value:function buildMessagePartsFromUserContext(t){return _async_to_generator(function(){var r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,_,_tmp,_10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=this.dedupeUserContextItems(t),i=n.filter(function(o){return o.type==="vault-path"||o.type==="selection"});i.length&&r.push({type:"text",text:_7(i)});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];o=_step.value;if(!(o.type==="image"))return[3,4];_=r.push;return[4,this.createImageFilePart(o)];case 3:_.apply(r,[_state.sent()]);return[3,7];case 4:_tmp=o.type==="file";if(!_tmp)return[3,6];_10=r.push;return[4,this.createTextFileContextPart(o)];case 5:_tmp=_10.apply(r,[_state.sent()]);_state.label=6;case 6:_tmp;_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,r]}})}).call(this)}},{key:"prepareUserContextForMessage",value:function prepareUserContextForMessage(t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o;return _ts_generator(this,function(_state){r=[],n=new Set;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;if(i.type==="pending-context")continue;o=Sd(i);if(!n.has(o)){if(n.add(o),i.type==="image"){r.push(sm(i));continue}if(i.type==="file"){r.push(sm(i));continue}r.push(sm(i))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{dedupedItems:r}]})})()}},{key:"getLoadedActiveSession",value:function getLoadedActiveSession(){return this.state.activeSessionId?this.state.loadedSessions.get(this.state.activeSessionId):void 0}}]);return xI1}();function Zu(e,t){return Rr.isInstance(e)&&e.responseBody!=null?typeof e.responseBody=="string"?e.responseBody:JSON.stringify(e.responseBody):_instanceof(e,Error)?e.message:t}var Ef=require("obsidian");var La=[];for(var e=0;e<256;++e)La.push((e+256).toString(16).slice(1));function ixe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(La[e[t+0]]+La[e[t+1]]+La[e[t+2]]+La[e[t+3]]+"-"+La[e[t+4]]+La[e[t+5]]+"-"+La[e[t+6]]+La[e[t+7]]+"-"+La[e[t+8]]+La[e[t+9]]+"-"+La[e[t+10]]+La[e[t+11]]+La[e[t+12]]+La[e[t+13]]+La[e[t+14]]+La[e[t+15]]).toLowerCase()}var pB,Cut=new Uint8Array(16);function yI(){if(!pB){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");pB=crypto.getRandomValues.bind(crypto)}return pB(Cut)}var fB={};function Eut(e,t,r){var i,o,a;var n;if(e)n=oxe((a=(o=e.random)!=null?o:(i=e.rng)==null?void 0:i.call(e))!=null?a:yI(),e.msecs,e.seq,t,r);else{var s=Date.now(),l=yI();Tut(fB,s,l),n=oxe(l,fB.msecs,fB.seq,t,r)}return t!=null?t:ixe(n)}function Tut(e,t,r){var n,i;return(n=e.msecs)!=null||(e.msecs=-1/0),(i=e.seq)!=null||(e.seq=0),t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function oxe(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError("UUID byte range ".concat(i,":").concat(i+15," is out of buffer bounds"));return t!=null||(t=Date.now()),r!=null||(r=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9]),n[i++]=t/0x10000000000&255,n[i++]=t/0x100000000&255,n[i++]=t/0x1000000&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var Dv=Eut;function Aut(e){for(var t=e.parts.length-1;t>=0;t-=1){var r=e.parts[t];if(r.type==="data-todos")return r.data.items}}function Iut(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];var n=[],i=[],o,a=function(){i.length&&n.push({kind:"content",parts:i}),i=[]};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var s=_step.value;if(s.type==="text"){s.text.trim()&&i.push(s);return"continue"}if(s.type==="reasoning"){a(),s.text.trim()&&n.push({kind:"reasoning",part:s});return"continue"}if(s.type==="data-model-file"){i.push(s.data.file);return"continue"}if(s.type==="data-system-notification"){a(),n.push({kind:"system-notification",notification:s.data});return"continue"}if(s.type==="dynamic-tool"){a();var l={kind:"tool-call",toolCall:s,timing:t[s.toolCallId]},c=r.filter(function(d){return d.toolCallId===s.toolCallId});c.length&&(l.fileChanges=c),s.toolName==="todowrite"&&(o!=null||(o=Aut(e)),o&&(l.todos=o)),n.push(l)}};for(var _iterator=e.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a(),n}function vI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.flatMap(function(n){if(n.role==="system")return[];var i=Iut(n,t,r[n.id]),o=n.parts.some(function(a){return a.type==="data-user-context"});return i.length||o?[{message:n,blocks:i}]:[]})}var Put=200;function Rut(e){var t=function(r){return String(r).padStart(2,"0")};return"".concat(e.getFullYear(),"-").concat(t(e.getMonth()+1),"-").concat(t(e.getDate()),"-").concat(t(e.getHours()),"-").concat(t(e.getMinutes()),"-").concat(t(e.getSeconds()))}function Mut(e){var t=function(r){return String(r).padStart(2,"0")};return(0,Ef.normalizePath)("assets/".concat(e.getFullYear(),"/").concat(t(e.getMonth()+1)))}function Out(e,t){var r=new TextEncoder,n=0,i="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=r.encode(o).byteLength;if(n+a>t)break;i+=o,n+=a}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i}function $ut(e){var t=e.replace(/\s+/g," ").trim().replace(/[\\/:*?"<>|]/g,"-").replace(/^\.+/,"").replace(/[. ]+$/,"");return Out(t,Put).replace(/[. ]+$/,"")||"chat-session"}function axe(e){return e.replace(/\r?\n/g," ").trim()}function Ah(e){return/^[A-Za-z0-9_-]+$/.test(e)?e:JSON.stringify(e)}function mB(e){switch((e||"").toLowerCase()){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";case"image/svg+xml":return"svg";case"image/bmp":return"bmp";case"image/x-icon":case"image/vnd.microsoft.icon":return"ico";default:return"png"}}function sxe(e){var r;var t=/^data:([^;,]+)[;,]/i.exec(e);return(r=t==null?void 0:t[1])==null?void 0:r.toLowerCase()}function Nut(e){var o,a;var t=sxe(e);if(t)return mB(t);var r=((o=e.split("?")[0])==null?void 0:o.split("#")[0])||"",n=/\.([a-zA-Z0-9]+)$/.exec(r),i=(a=n==null?void 0:n[1])==null?void 0:a.toLowerCase();return i&&["jpg","jpeg","png","webp","gif","svg","bmp","ico"].includes(i)?i==="jpeg"?"jpg":i:"png"}function Dut(e){return _async_to_generator(function(){var t,r,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=k6(e);if(!t)throw new Error("Unable to read non-URL image content");return[4,fetch(t)];case 1:r=_state.sent();if(!r.ok)throw new Error("Unable to read image content: ".concat(r.status));_tmp={};return[4,r.arrayBuffer()];case 2:return[2,(_tmp.arrayBuffer=_state.sent(),_tmp.mimeType=r.headers.get("content-type")||sxe(t),_tmp)]}})})()}function Lut(e,t,r){var n=0;for(;;){var i=n===0?"":"-".concat(n+1),o="".concat(r).concat(i),a=(0,Ef.normalizePath)("".concat(t,"/").concat(o,".md"));if(!e.getAbstractFileByPath(a))return a;n+=1}}function Fut(e,t,r,n){return _async_to_generator(function(){var i,_ref,_$o,a,s,l,c,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=k6(t);if(!i)return[3,6];_state.label=1;case 1:_state.trys.push([1,5,,6]);return[4,Dut(t)];case 2:_ref=_state.sent(),_$o=_ref.arrayBuffer,a=_ref.mimeType;return[4,Ja(e,r)];case 3:_state.sent();s=a?mB(a):Nut(i),l="".concat(Dv(),".").concat(s),c=(0,Ef.normalizePath)("".concat(r,"/").concat(l));return[4,Wp(e,c,_$o)];case 4:return[2,(_state.sent(),"".concat(n,"/").concat(l))];case 5:o=_state.sent();return[2,(Me.warn("Failed to persist export image, using source URL",o),i)];case 6:return[2]}})})()}function zut(e,t,r,n){return _async_to_generator(function(){var _$i,o,_tmp,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);return[4,Ja(e,r)];case 1:_state.sent();_$i="".concat(Dv(),".").concat(mB(t.mimeType)),o=(0,Ef.normalizePath)("".concat(r,"/").concat(_$i));_tmp=[e,o];return[4,t.blob.arrayBuffer()];case 2:return[4,Wp.apply(void 0,_tmp.concat([_state.sent()]))];case 3:return[2,(_state.sent(),"".concat(n,"/").concat(_$i))];case 4:i=_state.sent();Me.warn("Failed to persist export image from user context",i);return[2];case 5:return[2]}})})()}function jut(e,t,r,n){return _async_to_generator(function(){var i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,s,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];o=_step.value;if(o.type==="text"){s=o.text.trim();s&&i.push(s);return[3,4]}if(!fj(o))return[3,4];return[4,Fut(e,o,r,n)];case 3:a=_state.sent();a&&i.push(""));_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,i]}})})()}function Uut(e,t,r,n){return _async_to_generator(function(){var i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,u,l,d,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=w6(t);if(!i.length)return[2,[]];o=[],a=i.filter(function(s){return s.type==="vault-path"||s.type==="selection"});a.length&&o.push(_7(a),"");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];s=_step.value;if(!(s.type==="image"))return[3,4];return[4,zut(e,s,r,n)];case 3:u=_state.sent();u&&o.push(""),"");return[3,6];case 4:if(s.type!=="file")return[3,6];l=s.size>64*1024;return[4,(l?s.blob.slice(0,64*1024):s.blob).text()];case 5:d=_state.sent();o.push(["<UserProvidedFile>",JSON.stringify({type:"file",filename:s.filename,mimeType:s.mimeType,size:s.size,truncated:l,content:d},null,2),"</UserProvidedFile>"].join("\n"),"");_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2,o]}})})()}function lxe(e,t){var o,a,s,l,c,d,u,p,m,h;var r=(o=e.model)!=null&&o.providerId&&(a=e.model)!=null&&a.modelId?"".concat(e.model.providerId,"/").concat(e.model.modelId):void 0,n=((l=(s=t.metadata)==null?void 0:s.llm)==null?void 0:l.modelName)||((d=(c=t.metadata)==null?void 0:c.llm)==null?void 0:d.modelId),i=((p=(u=t.metadata)==null?void 0:u.llm)==null?void 0:p.providerName)||((h=(m=t.metadata)==null?void 0:m.llm)==null?void 0:h.providerId);return n&&i?"".concat(i,"/").concat(n):n||i||r||"unknown-model"}function But(e,t,r){if(r.kind==="system-notification")return"\uD83D\uDD14 ".concat(P.t("chatbox.exportRole.systemNotification"));if(t.role==="user")return"\uD83D\uDC64 ".concat(P.t("chatbox.exportRole.user"));if(t.role==="assistant"){var n=lxe(e,t);return"".concat(r.kind==="tool-call"?"\uD83D\uDD27":"\uD83E\uDD16"," ").concat(n)}return"\uD83D\uDEE0 ".concat(P.t("chatbox.exportRole.tool"))}function qut(e,t,r,n){return _async_to_generator(function(){var a,s,l,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l10,c;return _ts_generator(this,function(_state){if(t.kind==="content")return[2,jut(e,t.parts,r,n)];if(t.kind==="reasoning"){l=t.part.text.trim();return[2,l?["> ".concat(l.replace(/\n/g,"\n> "))]:[]]}if(t.kind==="system-notification")return[2,["```json",JSON.stringify(t.notification,null,2),"```"]];i=["- ".concat(P.t("chatbox.exportMeta.toolName"),": `").concat(t.toolCall.toolName,"`"),"- ".concat(P.t("chatbox.exportMeta.toolCallId"),": `").concat(t.toolCall.toolCallId,"`")].concat(_to_consumable_array(t.timing?["- ".concat(P.t("chatbox.exportMeta.duration"),": `").concat(Hg(((a=t.timing.finishedAt)!=null?a:Date.now())-t.timing.startedAt),"`")]:[])),o=t.todos;if(t.toolCall.toolName==="todowrite"&&o){i.push("");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=o[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l10=_step.value;c=l10.status==="completed"?"x":l10.status==="cancelled"?"-":" ";i.push("- [".concat(c,"] ").concat(l10.content))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,(o.length===0&&i.push("- ".concat(P.t("chatbox.ui.states.todoEmpty"))),i)]}return[2,(i.push("","```json",JSON.stringify((s=t.toolCall.input)!=null?s:{},null,2),"```"),t.toolCall.state==="output-available"?i.push("","```text",typeof t.toolCall.output=="string"?t.toolCall.output:JSON.stringify(t.toolCall.output,null,2),"```"):t.toolCall.state==="output-error"&&i.push("","```text",t.toolCall.errorText,"```"),i)]})})()}function Wut(e,t,r,n,i,o,a){return _async_to_generator(function(){var u,p,m,h,g,x,s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,v,y,_,_tmp,_c1,b,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,w,_c2,_c3,S,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=(u=t.model)!=null&&u.providerId&&(p=t.model)!=null&&p.modelId?"".concat(t.model.providerId,"/").concat(t.model.modelId):void 0,l={title:P.t("chatbox.exportFrontmatter.title"),sessionId:P.t("chatbox.exportFrontmatter.sessionId"),exportedAt:P.t("chatbox.exportFrontmatter.exportedAt"),createdAt:P.t("chatbox.exportFrontmatter.createdAt"),updatedAt:P.t("chatbox.exportFrontmatter.updatedAt"),model:P.t("chatbox.exportFrontmatter.model"),includeToolMessages:P.t("chatbox.exportFrontmatter.includeToolMessages"),pluginVersion:P.t("chatbox.exportFrontmatter.pluginVersion")},c=["---","".concat(Ah(l.title),": ").concat(JSON.stringify(axe(r))),"".concat(Ah(l.sessionId),": ").concat(JSON.stringify(t.id)),"".concat(Ah(l.exportedAt),": ").concat(JSON.stringify(new Date().toLocaleString())),"".concat(Ah(l.createdAt),": ").concat(JSON.stringify(new Date(t.createdAt).toLocaleString())),"".concat(Ah(l.updatedAt),": ").concat(JSON.stringify(new Date(t.updatedAt).toLocaleString())),"".concat(Ah(l.model),": ").concat(JSON.stringify(s||null)),"".concat(Ah(l.includeToolMessages),": ").concat(n?"true":"false"),"".concat(Ah(l.pluginVersion),": ").concat(JSON.stringify(i)),"---","","# ".concat(axe(r)),""],d=Yo(t);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,15,16,17]);_iterator=vI(d.timeline,d.toolTimings)[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];_step_value=_step.value,v=_step_value.message,y=_step_value.blocks;if(!(v.role==="user"))return[3,4];return[4,Uut(e,v,o,a)];case 3:_tmp=_state.sent();return[3,5];case 4:_tmp=[];_state.label=5;case 5:_=_tmp;if(y.length===0){;c.push("### ".concat(v.role==="user"?"\uD83D\uDC64 ".concat(P.t("chatbox.exportRole.user")):lxe(t,v)),"","".concat(P.t("chatbox.exportMeta.messageTime"),": ").concat(new Date((h=(m=v.metadata)==null?void 0:m.createdAt)!=null?h:t.createdAt).toLocaleString()),""),_.length>0?(_c1=c).push.apply(_c1,_to_consumable_array(_)):c.push(P.t("chatbox.exportMeta.emptyContent"),"");return[3,13]}b=!1;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=6;case 6:_state.trys.push([6,11,12,13]);_iterator1=y[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,10];w=_step1.value;if(!n&&w.kind==="tool-call")return[3,9];c.push("### ".concat(But(t,v,w)),""),c.push("".concat(P.t("chatbox.exportMeta.messageTime"),": ").concat(new Date((x=(g=v.metadata)==null?void 0:g.createdAt)!=null?x:t.createdAt).toLocaleString()),"");return[4,qut(e,w,o,a)];case 8:S=_state.sent();S.length>0&&(_c2=c).push.apply(_c2,_to_consumable_array(S).concat([""])),!b&&_.length>0&&((_c3=c).push.apply(_c3,_to_consumable_array(_)),b=!0),S.length===0&&v.role!=="assistant"&&(b||c.push(P.t("chatbox.exportMeta.emptyContent"),""));_state.label=9;case 9:_iteratorNormalCompletion1=true;return[3,7];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 13:_iteratorNormalCompletion=true;return[3,2];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:return[2,"".concat(c.join("\n").trim(),"\n")]}})})()}function uxe(e){return _async_to_generator(function(){var t,r,n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=(0,Ef.normalizePath)("".concat(e.manifestId,"/conversations"));return[4,Ja(e.vault,t)];case 1:_state.sent();r=new Date,n="".concat($ut(e.title),"-").concat(Rut(r)),i=Lut(e.vault,t,n),o=Mut(r),a=(0,Ef.normalizePath)("".concat(t,"/").concat(o));return[4,Wut(e.vault,e.session,e.title,e.includeToolMessages,e.manifestVersion,a,o)];case 2:s=_state.sent();return[4,Dx(e.vault,i,s)];case 3:_state.sent();l=e.vault.getAbstractFileByPath(i);if(!_instanceof(l,Ef.TFile))throw new Error("Unable to locate exported file: ".concat(i));return[2,l]}})})()}var Vut=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Gut(e){var t;try{if(typeof Intl!="undefined"&&typeof Intl.DateTimeFormat=="function")return new Intl.DateTimeFormat("en-US",{weekday:"long"}).format(e)}catch(r){}return(t=Vut[e.getDay()])!=null?t:"Sunday"}function Hut(){var e,t;try{if(typeof Intl!="undefined"&&typeof Intl.DateTimeFormat=="function"){var r=(t=(e=Intl.DateTimeFormat()).resolvedOptions)==null?void 0:t.call(e).timeZone;return typeof r=="string"&&r?r:void 0}}catch(r){}}function Zut(e){var t=Hut();return _object_spread({date:rB(e),weekday:Gut(e)},t?{timezone:t}:{})}function Kut(e){var r,n;var t=e.view;return!((r=t==null?void 0:t.file)!=null&&r.path)||!(t.getViewType()in["markdown","canvas","pdf","image","video","audio","bases"])||!((n=t.containerEl)!=null&&n.isConnected)?null:t.file.path}function _I(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var l,c,d,u;var n=(c=(l=e.workspace.getActiveFile())==null?void 0:l.path)!=null?c:null,i=Zut((u=(d=r.now)==null?void 0:d.call(r))!=null?u:new Date),o=new Set;e.workspace.iterateAllLeaves(function(p){var m=Kut(p);m&&o.add(m)});var a=Array.from(o).sort(),s=[{key:"currentDate",content:i,hash:Qa(i)},{key:"activeFile",content:n,hash:Qa(n)},{key:"openFiles",content:a,hash:Qa(a)}];if(t){var p=t.getCatalog();s.push({key:"skills",content:p,hash:Qa(p)})}return s}function bI(e,t){var r=new Map;for(var n=e.length-1;n>=0;n--){var i=Zfe(e[n]);if(i.length){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;r.has(o.key)||r.set(o.key,o.hash)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(r.size===t.length)break}}return t.filter(function(n){return r.get(n.key)!==n.hash})}function hB(e){return{kind:"file",contentCompressed:e.contentCompressed?_object_spread({},e.contentCompressed):void 0,contentBase64:e.contentBase64}}function Qut(e){var t;switch(e.operation){case"create":return{vaultPath:e.vaultPath,operation:"create",before:{kind:e.before.kind},after:((t=e.after)==null?void 0:t.kind)==="file"?hB(e.after):e.after?{kind:"dir"}:void 0,toolCallId:e.toolCallId};case"update":return{vaultPath:e.vaultPath,operation:"update",before:hB(e.before),after:e.after?hB(e.after):void 0,toolCallId:e.toolCallId};case"delete":return{vaultPath:e.vaultPath,operation:"delete",before:e.before.kind==="dir"?{kind:"dir"}:{kind:"file",contentCompressed:e.before.contentCompressed?_object_spread({},e.before.contentCompressed):void 0,contentBase64:e.before.contentBase64},toolCallId:e.toolCallId}}}function F0(e){return e.split("/").filter(Boolean).length}function cxe(e){var t=e.split("/").filter(Boolean),r=[],n="";for(var i=0;i<t.length-1;i+=1)n=n?"".concat(n,"/").concat(t[i]):t[i],r.push(n);return r}function Jut(e){var t=e.trim();if(!t)return"";if(t===x0||t.startsWith("".concat(x0,"/"))){var n=xm(t.slice(x0.length+1));return n==="."?"":n}if(t.startsWith("/"))return"/".concat(xm(t).replace(/^\/+/,""));var r=xm(t.replace(/^\/+/,""));return r==="."?"":r}function lp(e){var n;var t=Jut(e.vaultPath);if(!t||e.operation==="update"&&(!X2(e.before)&&typeof e.before.contentBase64!="string"||e.after&&!X2(e.after)&&typeof e.after.contentBase64!="string")||e.operation==="create"&&((n=e.after)==null?void 0:n.kind)==="file"&&!X2(e.after)&&typeof e.after.contentBase64!="string")return null;if(e.operation==="delete"&&e.before.kind==="file"){var i=e.before;if(!X2(i)&&typeof i.contentBase64!="string")return null}return _object_spread_props(_object_spread({},Qut(e)),{vaultPath:t})}function wI(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"children"in e}function dxe(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!("children"in e)}function Yut(e,t){var r=new Uint16Array(e);globalThis.crypto.getRandomValues(r);var n=new Array(e);for(var i=0;i<e;i++)n[i]=t[r[i]%t.length];return n}var pxe=V2().check(qd(/^[a-z0-9]+$/,{error:"prefix must be lowercase alphanumeric"})),gB=kT().check(Kz({error:"words must be an integer"}),Mo(1,{error:"words must be at least 1"}),ya(16,{error:"words must be at most 16"})),Xut=y6({prefix:gf(pxe),words:gf(gB)}),ect=y6({prefix:gf(pxe),words:gf(gB),namespace:gf(V2())}),xbr=y6({words:gB,allowCollision:gf(CT())}),SI=Object.freeze("aal aani aba abama abas abase abb abba abby abe abel abele abet abidi abies able abler ably abort about abouts above abox abu abut aby acca accent accept access accord ace acer aces ach achar ache achen acher aching acid acier acker acle acor acre act acting action active actor acts actual acute ada adai adam adapt adar adat aday adays add adda added adder addle adds addy ade adet adin adjust admin ado adult advert ady adz aes afar affa affirm aft after aga again agal agama agar agate age aged agen agena agency agenda agent ager ages agger aghan aging agio agnes ago agog agon agonal agra agre agree agua ague agy aha ahead ahir aho ahu aias aid ail ailing ails aim aint air aira aire airs airt airy ait ajar ajari aka akal akala akan ake akey akia akin akka ako akov aku ala alada alaki alala alan aland alar alarm alary alas alb album ale alea alee alem alen alert ales alette alex alf alias alice alida alien align alin aline alist alit alite alive alk all allah allan alle allen aller allow ally alma almost alo alogy alone along alp alpha also alt altar alter altern alto alur always aly alya ama amah amain amang amani amar amara amarin amazon amba ambar amber amble ambo ame amen ament ami amia amic amid amide amil amin amine amini amir amma amman ammer ammo ammu among amor amos amount amp ample amt amy ana anam anan anana anas anat anay anchor and anda ande andi andre andy anele anes angel angelo anger angers angka angle angled angler angles ango ani animal anime anion anis anker ann anna anne annet annie annual anoa anon ansa anser ansu answer ant anta antal antar antara ante antes anthem anti antic anton ants antu any apa apache apar apart apatan ape aper aping apis apollo aport appear append apple apply apps apse apt apus ara arab arad arar arc arca arch arched arches archie archy ardu are area ared arena argas argent argo argon aria arian aries ariot arius ark arks arm armed arming armor arms army arn arna arne arni aro around arrant arras array arris arrow arry art artar artha artist arts arty aru arum ary aryl asa asana ascii ascus ase asem ash asha ashen asher ashes ashy asian aside ask askar asks asp aspect asper assert asset assets assi assign assis assist ast asta aster astern astian ata atap ate aten ates athing ati atik atis atlas atma atom atomic atoms atria atta attach attack attar atter attern attery audio audit auge augh aught auh auk aum aus author auto autos ava avail aval avar ave avens aver avera averse avery aves avian avid avis avo avoid awa await awake awan award aware awat away awd awin awl awn awner awning axe axed axes axis axon ayah aye ayin ayu azine azo azole azon azure baa baar bab babel baby bac bach back backs backup bad badge bae bag bags bah bait baka bal ball balls bam ban banana band bands bane bang bank banks banner bar bara bard bare barer barn barra bars bart barth baru bas base based bases bash basic basis basket bass bat batch bate bath batis battle baud bay bea beam bean beans bear beat beats beaut beck bed beds bee beek been beer before beg begin behind being bel belief bell bella bells below belt ben bench bend bene beni ber bere berg berger beri bern berry bert bes best bet beta beth bets better bhar bias bib bid bien bier big bike bill bin binary bind binder bine bing bins bios biotic bird birds birth bis bishop bit bite bito biz black blad blade blah blank blas blast bled blend blick blind blink blo blob bloc block blood blower blue blur boa board boat bob bod boden body bog bola bold bole boll bolo bolt bom bomb bon bond bone bones boni bonus boo book bool boom boost boot boots bor bord border borg born borne boro borrow bos boss bot both bottom bounce bound bourg bout bouw bow bower boxes boxing boy bra brace brain brains bran branch brand bread break bred breed brew brick bridge brief brig bright bring brit broken broker brook brot brown browse brush bubble buck bucket bud buddy budget buds buff buffer bug build built bulk bull bullet bum bun bund bundle bung bur bureau burg burn burst bury bus buster busy but button buy buyer buzz cab cache cad cade cake cakes cal call caller cam came camel camera camp campo can cancel cand canner cannot canon cant canvas cap cape car cara carbon card care career caret cargo carry cart case cash casino cass cast caster cat catch cate cation caught cause cede cee ceil cel cell cement cent center cep ceptor ceral ceria cern cess cha chaft chai chain chair chal chalk champ chance chang change chant chap char charge chart chat chaus che cheap check chee chef chen cheng chet chi chia chid chief chien chil child chin china chine ching chip chips chlor cho choice chol choose chosen christ chrome chunk church cid cine cion cipher circle cit cite city civil claim clam clang clare class clave clean clear cled click client cline cling clinic clip clips clipse cloak clock clone close closed cloth cloud club coach coal coat cobra cod code coder coe coffee cohol coil coin col cola cold cole coli coll colon color colors column coma comb combat come comes comic coming comma commit common con cond cone cones conn conte conto contra cony cook cool coop cop cope copy cor cord corder core corn corner corp cos cost cot could count county coupon cours course court cover cow cox craft cran cratch crate crawl cream crease create credit cree creen crest crete crew crib crime cris critic cro crop cross crow crumb cry crypt cub cube cue cult cup cur curl curr curse cursor curve custom cut cute cyan cycle dab dad dade dae daemon dag daily dain dak dal dale dam damage dan dance dang danger dao dap dar dark dart das dash data date dater dating datum day days dead deal dealer death deb decess deck decode dee deep define deg degree del delay dele delete delta deme den dene dense dent deny depart depend deploy depth dere derive dern design desk dess detach detail detect dev device dew dha dial dib dice did diet dig digest digit dim din ding dip dire direct dirty dis disc dish disk dit dita ditch div divide dob doc dock docker doctor dod does dog dogs doing dol dom domain don done dont doom door dop dor dos dose dot double dow down draft drag dragon dram draw drawer dream dress drink drive driver drop dry dual dub duck duct ductor duit dum dummy dump dup during dust dux each ean ear earing early earn earth ease east easy eat ebb eben echo eddy eden edge edict edit edith editor edo educt eel eer effect eft egg egger ego either eke eker eking eland elate elb eld elder elding elect elf eli elia elian elite elk ell ella elle ellen elm elod elon elope els else elt elves embar embed ember eme emit emm emma empt empty emu enable encode end ended ender endere ending endue enemy energy engine enos ens ense ensky ensure ental enter entity entry enzyme epoch equal equip era erade eral erase erd ere erg eria erian erie ermine erne eros err erring error ers erse escape escort ess essay essed essie estado estate esteem ester estre eta etch ether ethyl etna etta ettle eva eve even event ever every evil ewer exact exam excel except exist exit expand expect expert expire expiry export extend extent extern extra eye eyen eyer eyey eyn fabric face facet fact factor fad fade fail fair faith fake faker fall fallen false fam family fan fang fant far farm fass fast fat fatal father fatter fault favor fear feat fed fee feed feel feer fei fell fels felt female fen fern fest fet fetch few fib fiber fico fid field fifo fig fight figure file fill filled film filter fin final find finder fine finger finish finite finity fir fire firm first fish fit five fix fixed flag flake flare flash flat fleet flex flight flip flix flo float floor flora flow flower flu fluid flush flux fly foam focus fod fog foil fold folder folie folio folk follow fon fond fono font foo food foot footer for fora force forced forcer ford forest forge forget forgot fork form formal format forme formed former formin fort forth forum fot found fox fra fram frame fred free freeze fresh fried friend frig frist fro frog from front fruit fuel full fully fum fun fund funk fusc fusion future gab gabe gable gad gage gain gal gam game gaming gamma gan gang gant gaon gap gar gara garden gare garten gary gas gast gat gata gate gau gave gaz gear ged gee gel geld gelt gem gen gender gene genic genre gens gent geo ger gerald gers ges gest get geta getter gey gez ghan ghost gid gie gif gift gig gil gin ging gio girl gist git give given giver giving glass glib global glyph gnu goal god going gol gold golly gon gone gong goo good goods gor gos got gra grab grad grade graded grader grain gram grand grant graph grass grat gratis grave gray great gree green greg grey grid griff grim gris gross ground group grow grown growth grunt guan guard gue guess guest guide guild guise gul gulp gum gun guna gur guru gus gust gut gym gyro habit hack had haft hag hah hail hain hair hak hal hala hale half hall halo halt halter halve ham hammer han hand handle hanger hao hap happy hard harm hart hash hasta hat hau hausen have haven haw hawk hawm hay head headed header heal health heap hear heart heat heater heavy heck heder heed heer hehe hei height hein hele hello helm helmet help helper hem heme hen hend hep her hern hero hers het hew hex hey hia hic hid hidden hide high higher hill him hin hind hing hint hip hire hiro his hist hit hler hob hobo hod hog hoi hold holder hole holm holt holy home hon hone hong hood hoof hook hoot hop hope hopper hora horn horse hose host hot hotel hound hour house hoven hover how hub hud hug hui huk hum huma human hun hung hunt hunter hurst hurt hut hwa hyp hyper ian iao iba iban ibid ibo ice iced ich icho icing icon icy ida ide idea ideal idean ides idle idler ido idol ife iffy ignite ignore ihi ijo ikat ike ikey ila ilia ilian ilium ilk ilka ill illy ilot ima image imam imber imer imi imine immi immit immune imp impact impi import imu inca inch income ind indaba indan inde indent index india indic indra indy ineri inermi inez infect infer inform infra ing inga inger ingle inia inion initis inject ink inken inker inkle inks inky inn inner inning ino inoma input insert inside insula intend intent inter intern into invent invert invest invite invoke ion ione ioni ionic ipid ira iran irani ire iris irish irk irma iron ism iso issue issuer ist istle ita itala itali italic itch item iten iter ither ito its itys itza iva ivan ivin ivy iwa iyo izar izard izzard jab jack jade jam jama jaman jan jar jara jat jati java jaw jay jed jem jest jet jete jim jin jing job joch joe john join joint joker jon jong joni jos jours joy juan jud judge jug juice juju jump jun junk junto jur jury just jut kai kaj kan kana kang kari karma kat kate kay kea ked kee keen keep keeper keet kele ken kend kenn kent kep ker kern kernel ket keta key kick kid kids kil killer kim kin kina kind king kino kip kish kiss kit kite kitty knife know known koa kob koch kol kon kona kop kor kos kou kra kraft kreis kua kung lab label labor lac lace lack lad lade laden lady lag lagen lager lai laid lain lak lake lalo lam lama lambda lament lamp lan lana land lander lane lant lap lar large lari las laser lash lass last lat late lated laten later latest latex latin lation laugh launch lava law lay layer layout lazy lea lead leader leaf league lean lear learn lease least leave lech leck lector led leda lede leden ledge ledged ledger lee leed leep leer lees leet left leg legacy legal legate legend leger leges lei leigh lek lemma len lend lene length lens lent leo ler les less lesson lest let lete lett letter lev levant level lever lew lex lexia ley liable lias lice lich lichen licit lick lid lide lie lied lief lier lif life lift light ligne like lim lime limit lin line linear lined linen liner ling linge linger linha linie lining link linked links linky lint lion lip lis lish list listed listen lit lite liter little liv live living liz loa load loaded loader loan lob lobal local locale loch lock locked locker lod lof log loge logged logger logic login logo logos loin loir long loo lood look lookup loom loon loop loot lop lope lord lose loss lost lot lots lotte lou love lover low lower lox loyd luc luck lug lum lunes lung lur lush lut lux lying lys lysis mac mack macro mad made mag mage magic mah mail mailer main maine maint major make maker making mal malar mall mallow mam man mana manage mand mande manent manes mani mania mann mano mans manse mant manual manuel many mao map mapper mar march mare margin marine mark marked marker market markup mars mart marvin mary mas masa mask masked mass massa mast master mat match mate mater math matrix matter max may maya maybe maze meal mean mede media median medio medium meet meg mein mel meld mele melon mem member memo memory men meng ment mental mentor menu mer mere merge merk mero mes mesa mese mesh mess messe messer mester met meta metal mete meteor meter method metic metric mica mico micro mid middle mien mig might mil mile milk mill mime min mina mind mine miner ming mino minor mint minus minute mir mirror mise miss mist mite mitt mix mixed mob mobile mock mod modal mode model modern modify module mog moil moire moment mon money mong mongo mono mont month monton moo moon moor mooth mor more morgen mort most mostly mot mother motion motor mount mouse mouth move movie moving mrs much mud mult mum mun mund mung munity mus museum music must mute mux naa naam nab nable nach nae nag naio nais nak nam nama name nan nance nancy nant nap nar nard nast nat nation native nature nay nea neal near neath neb neck ned nee need needle needs neet nef nei nell nelly neo ness nest nesty net nete never new news next nias nice nici nick nid night nil nim nine ning nisse nit nod node nog noise noma nome non nonce none noop nor norm normal north nose nostic not note notice notify nou noun nous nova novo now nth nub nul null number numero nun nut nye oak oban obe obi object occur och ock ocracy ocular oda odal odd ode odel odin odium odor ods odz oes off offer office offset oft often ogle ohia oil oint oka okee oki okia okra old olden older ole oleg olid olio olive olla olm ology olor olson oman omar omber omega omen omer omina omit ona once one oner onium only ons ontal onto onus onym onza oodles oons oord opal opaque ope open opera opsy opt optic option opus ora oracle orage orang orange orb orbit orc orca order ordu ore orf organ orgia orias orient origin orna orris ort ory osc ose ossal osse ostic otate other otic otis oto otto otus ouch ouf ough ought ounce ounds ours oust out outed outen outer outing output ova oval oven over ovine ovis owe ower owing owl owler own owner oxide oxy oxygen oyer paar pac pace paced pack packer packet pad page pager pagina pail pain paint pair paired pais pal pam pan pand panel pang panic pant pants pap paper paque par para param parate parcel pard paren parent parer pari paring park parse parser part party pass passen past paste pat patch path pathy pau pause paw pawn pay payer pea peace peak peaker peat ped peed peer peg pele pell pen pend pent people pep per peri period perk perm permit person pert perty pes peso pet phase phasis phi phil pho phon phone phonic phony phot photo phrase pia pic pick picked picker pickle pie pier pig pik pile pill pillar pilot pin pine ping pink pip pipe pir piro pit pitch pivot pix pizza place placer plain plan planet plant plash plass plat plate play player please pled plex pliant plied plier pliers plies plot ploy pluck plug plural plus ply pod poi point poke pol polar pole policy polis poly pom pon pond ponder pone ponent pong pont pony pool poor pop poral port porta portal ported porter porto pose poser posing posit poss post postal posted poster pot pow power pox pray prefer prefix prep preset press prest pretty price priced prim prima prime primer print prior pro prob probe prod prof profit prog prompt proof prop proper props prote proto prove proved prow proxy pseudo psi pst psych puan pub public pul pull pulse pump pun punt pur pure purple puru push put python qua quad quake quan quant quare quart quat queen query quest quet queue quick quid quiet quila quin quina quip quire quis quit quite quiz quo quot quota quote raad rab rabbit race rach rack rad rada radio radius raff raft rag rage rah raid rail rain rais raise raised raiser raj rale ram rama rame ran rana rance rand random rang range rank rant rap rapid rapper rare ras rase rash rat rate rated rather rating ratio ration raul raw rax ray rea reach react read reader ready reak real really realm ream rear reason reb recent recipe reck record rect red redd rede redo reduce redux ree reef reek reem reen rees reet ref refer refix refund reg region reh rein reis reit reject rel reland relay reload remain reman remark remote remove renal rename rend render renew rent rep repair repeat repen reply report resent reset resh resize resp rest result resume ret retain retan retch retry return reuse rev reve revet review reward rex rhein rho ria rial rib ric rice rich richt rick rid ridden ride ridge rie rier riff rift rig right rik rim rine ring ringer rink rio riot rip rise risk rist rit rita rite rive river rix roach road rob robe robot roc rock rocket rod rodd roe rog roger roi roit rok roke roker role rolled roller rolley roman rome ron rone rong roof rook room roon root rope ropy rosa rose ross rot rota rotate rote rottle roud rough round roup route router rove row rowing rox roy rub ruby ruck rud ruff rug rule rum run runner rupa rus rush rust rut ruta sab sad safe sage said sak sal salary sale salt sam same sample san sand sans sap sar sass sat save saved saving say scala scalar scale scaled scan scape scar scene schema scheme school schule scient scious scope score screen scribe script scroll sea seal sealed search season seat sec second secret sect sector secure seed seeing seek seen seer seg segue seid seit sele select self seller semble semi sen send sender sense sensor sept ser sera seri serial series sero sert serve server servo sess set sett setter setup seven sey sha shade shader shadow shake shall shan shape share sharp shaw shay she shed sheet shell shen sheng shi shield shift shim shin shine ship shire shirt shiv sho shock shoe shop shore short shot should show shown shu sia sib sic sid side sie sig sigma sign signal sil silent silver sim simple sin since sing single sink sip sir sis sit six size sizes skal skat sker ski skill skim skin skip sky sla slam slash sled sleep slice slick slide slider slot slow slug small smart smarty smith smooth snake snap snow soap sob soc social sock socket soe soever soft soil sol solar sold sole solid solo solute solve solver some son song sons soon sorry sort sorted sou sound source south soy spa space spam span spann spar spark spart spawn spec sped speech speed spell spent sphere spiel spill spin spire spired splice split spoken spor sport sports spot spread spring sprite spur spy square ssi stable stack staff stag stage stake stall stamp stan stance stand star start stash state static status staw stay stead steady steam steel steen stein stell stem sten step stern stick sticks sticky stid still stim stime sting stock stocks stod stof stoff stone stood stop store storm story stra stract strain strand strap stre stream street streng stress strict stride strike string strip stripe strix stroke strom strong stu stub stud studio study stuff stum sty style sub submit subset such suffix suite summer sup super sur sure surf survey sus swap sweet swift swiper switch symbol sync syntax system taa tab tabla table tables tablet tach tag tai tail tain taj take taken taking tal talk tam tan tank tap tar tara tare target task taste tat tau tax tay tea teach team tear tec tech ted tee teen teg teil tele tell tema temp temper tempo tempt ten tenant tensor tent tera teras teri term termin tern terna ternal terne test teste tested tester text tez tha thai than thane thank thanks that the their them theme then these theta they thin thing think third this tho thon thorn those though thouse thread three throw thumb thus thy tic tick ticker ticket tid tie tier tig tight til tile tim time timer times tin ting tiny tip title titre toa toast tod today toe tog toggle toi token tol tom ton tone tong too tool toon top topia topic tops tor torch tot total tou touch tour tout tower town tox toy tra trace track tract trade trag trail train trait tram tran trap trash travel tray tree trend trent tri trial trica trim trin trip tron truck true trust truth try trying tube tum tun tur turn turned tweet twig two type uang ubi uca udal udder udi udo uds ugh uji uke ula ule ull ulla uller ulling ultima ultimo ulu umber umble umbo ume ump umph umu una unable unal unami unbind unca uncate unci uncia unde unden under undo undy unie union unique unit unity unken unless unlink unlock unsafe unset untar until unto unused unwrap unze update upload upo upon upper ura ural uran urate urban urd urde urdu ure urent urf urge urgent urger uri uria urlar urn urna urnal urning uro urs ursa ursal ursus uru urus usable usage usar use used user ush usher ussels ust uster usual usun uta utas utch ute utile utter utu utum uva vai vain vair val vale vali valid vall valor value valuer van vang vara vare vari varna vary vas vast vat vault veal vector veda vedic vee veen veer vei veil vela vell velo velte vend vendor vent venter venue venus vera verb verd verify verity vern versal verse versed verst vert vertex very vest vester vet via vic vice video vie vier view viewer vill villa ville vim vina vince vine vino viol vip vira viral viron virus vis visa vise vision visit visor vista visual vita vive vod voet vog voice void vol vole volent volt volume vote vum waar wab wad wadi wag wagon wah wain wait waka wake wale wali walk walker wall wallet wan wand wander wandle wane wang want wany wap war ward warden ware warf warm warn warp wart was wash washed washer wat watch water wave wax way wayne ways weak wealth weapon wear web wed wee weekly ween weep weet wei weka well welt wem wen wend went".split(" "));function fxe(e,t){return e?"".concat(e,"_").concat(t):t}function tct(e,t){return _async_to_generator(function(){var d,u,p,r,n,i,o,a,s,l,c,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e||typeof e!="string")throw new Error("input must be a non-empty string");r=ect.parse(t!=null?t:{}),n=(d=r.words)!=null?d:8;if(!((u=globalThis.crypto)!=null&&u.subtle))throw new Error("idAgent.from() requires Web Crypto API (crypto.subtle). Use HTTPS in browsers.");i=new TextEncoder,o=i.encode((p=r.namespace)!=null?p:"id-agent");return[4,globalThis.crypto.subtle.importKey("raw",o,{name:"HMAC",hash:"SHA-256"},!1,["sign"])];case 1:a=_state.sent();return[4,globalThis.crypto.subtle.sign("HMAC",a,i.encode(e))];case 2:s=_state.sent(),l=new DataView(s),c=new Array(n);for(m=0;m<n;m++)c[m]=SI[l.getUint16(m*2)%4096];return[2,fxe(r.prefix,c.join("-"))]}})})()}function rct(){var e=function(t){var o;var r=Xut.parse(t!=null?t:{}),n=(o=r.words)!=null?o:8,i=Yut(n,SI);return fxe(r.prefix,i.join("-"))};return e.from=function(t,r){return tct(t,r)},e}var kI=rct();var ybr=Math.log2(SI.length),vbr=new Set(SI);function Is(e){return"".concat(e,"-").concat(Dv())}function Lv(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=3;_state.label=1;case 1:n=0;_state.label=2;case 2:if(!(n<3))return[3,5];i=kI({prefix:e,words:r});return[4,t(i)];case 3:if(!_state.sent())return[2,i];_state.label=4;case 4:n+=1;return[3,2];case 5:r+=1;return[3,1];case 6:return[2]}})})()}var CI=/*#__PURE__*/function(){"use strict";function CI1(t,r,n){_class_call_check(this,CI1);this.app=t;this.notify=r;this.skillRepository=n}_create_class(CI1,[{key:"getActiveAgent",value:function getActiveAgent(t){return Yo(t)}},{key:"appendContextBoundary",value:function appendContextBoundary(t,r,n){var i=Date.now();return r.timeline.push({id:Is("checkpoint"),role:"user",metadata:{createdAt:i},parts:[{type:"data-context-checkpoint",data:n}]}),r.readVaultPaths=[],t.updatedAt=i,r}},{key:"createMessage",value:function createMessage(t,r){return _6(t,{id:Is("message"),createdAt:Date.now(),meta:r==null?void 0:r.meta,isError:r==null?void 0:r.isError,todos:r==null?void 0:r.todos})}},{key:"setMessageOperations",value:function setMessageOperations(t,r,n){var o;var i=n==null?void 0:n.map(lp).filter(function(a){return!!a});i!=null&&i.length&&(t.operations[r]=_to_consumable_array((o=t.operations[r])!=null?o:[]).concat(_to_consumable_array(i)))}},{key:"appendUserMessage",value:function appendUserMessage(t,r,n,i,o){return _async_to_generator(function(){var d,a,s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(d=this.skillRepository)==null?void 0:d.refresh()];case 1:if(_state.sent(),o&&!o())return[2];a=Date.now();n&&(n.updatedAt=a);s=_I(this.app,this.skillRepository),l=bI(t.timeline,s),c={id:Is("message"),role:"user",metadata:{createdAt:a},parts:[]};return[2,(l.length&&c.parts.push({type:"data-workspace-context",data:{deltas:l}}),i!=null&&i.length&&c.parts.push({type:"data-user-context",data:{items:gg(i)}}),r&&c.parts.push({type:"text",text:r}),t.timeline.push(c),c)]}})}).call(this)}},{key:"appendAgentInput",value:function appendAgentInput(t,r,n,i){return i&&!i()?!1:(n&&(n.updatedAt=Date.now()),t.timeline.push(r),!0)}},{key:"removeIncompleteToolCalls",value:function removeIncompleteToolCalls(t){return b6(t)}},{key:"reportFatalError",value:function reportFatalError(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.getActiveAgent(t);Me.error(r),i.timeline.push(this.createMessage({role:"assistant",content:[{type:"text",text:r}]},{meta:n,isError:!0})),this.notify()}},{key:"findToolPart",value:function findToolPart(t,r){for(var n=t.timeline.length-1;n>=0;n-=1){var i=t.timeline[n],o=i.parts.find(function(a){return a.type==="dynamic-tool"&&a.toolCallId===r});if(o)return{message:i,part:o}}}}]);return CI1}();function vS(){return{queued:[]}}function mxe(e,t){var r=Is("turn");return e.scheduler.queued.push({turnId:r,kind:"user-submission",submission:{text:t.text,userContext:gg(t.userContext)}}),r}function hxe(e,t,r){if(r.signal.aborted)return;var n=Is("turn");return e.scheduler.queued.push({turnId:n,kind:"agent-input",input:t,origin:r}),n}function gxe(e,t){var r=Is("turn");return e.scheduler.queued.push({turnId:r,kind:"regenerate",targetMessageId:t}),r}function xxe(e){if(!e.scheduler.active)for(;e.scheduler.queued.length>0;){var t=e.scheduler.queued.shift();if(t.kind==="agent-input"&&t.origin.signal.aborted)continue;var r={turn:t,abortController:new AbortController};return e.scheduler.active=r,r}}function EI(e,t,r){var n=e.scheduler.active;return(n==null?void 0:n.turn.turnId)===t&&n.abortController.signal===r}function yxe(e,t,r,n,i){return!i(t)&&!n.aborted&&EI(e,r,n)}function TI(e,t,r){return EI(e,t,r)?(e.scheduler.active=void 0,!0):!1}function xB(e,t,r){return TI(e,t,r)}function yB(e,t,r){return TI(e,t,r)}function vxe(e,t){e.scheduler.queued=e.scheduler.queued.filter(function(r){return!t(r)})}function _xe(e){return e.scheduler.queued.length>0}function bxe(e){return e.scheduler.queued.flatMap(function(t){return t.kind==="user-submission"?[t.submission]:[]})}var AI=/*#__PURE__*/function(){"use strict";function AI1(t){_class_call_check(this,AI1);this.state=t}_create_class(AI1,[{key:"get",value:function get1(t){var r=this.state.runtimeBySessionId.get(t);return r||(r={runState:"idle",draft:{text:"",userContext:[]},scheduler:vS()},this.state.runtimeBySessionId.set(t,r)),r}},{key:"resetExecution",value:function resetExecution(t){var n,i;var r=this.state.runtimeBySessionId.get(t);r&&((n=r.scheduler.active)==null||n.abortController.abort(),(i=r.manualCompressionAbortController)==null||i.abort(),this.state.runtimeBySessionId.set(t,{runState:"idle",draft:{text:r.draft.text,userContext:r.draft.userContext.slice()},scheduler:vS()}))}},{key:"getAutoApproveRequests",value:function getAutoApproveRequests(t){var r=this.state.autoApproveRequestsBySessionId.get(t);return r||(r=new Set,this.state.autoApproveRequestsBySessionId.set(t,r)),r}}]);return AI1}();function II(e){return Boolean(e.processing||e.manualCompressionAbortController||e.scheduler.active||e.scheduler.queued.length>0)}var c1=nr(wxe(),1);var vB=function(e,t,r){var n=_instanceof(e,RegExp)?Sxe(e,r):e,i=_instanceof(t,RegExp)?Sxe(t,r):t,o=n!==null&&i!=null&&nct(n,i,r);return o&&{start:o[0],end:o[1],pre:r.slice(0,o[0]),body:r.slice(o[0]+n.length,o[1]),post:r.slice(o[1]+i.length)}},Sxe=function(e,t){var r=t.match(e);return r?r[0]:null},nct=function(e,t,r){var n,i,o,a,s,l=r.indexOf(e),c=r.indexOf(t,l+1),d=l;if(l>=0&&c>0){if(e===t)return[l,c];for(n=[],o=r.length;d>=0&&!s;){if(d===l)n.push(d),l=r.indexOf(e,d+1);else if(n.length===1){var u=n.pop();u!==void 0&&(s=[u,c])}else i=n.pop(),i!==void 0&&i<o&&(o=i,a=c),c=r.indexOf(t,d+1);d=l<c&&l>=0?l:c}n.length&&a!==void 0&&(s=[o,a])}return s};var kxe="\0SLASH"+Math.random()+"\0",Cxe="\0OPEN"+Math.random()+"\0",bB="\0CLOSE"+Math.random()+"\0",Exe="\0COMMA"+Math.random()+"\0",Txe="\0PERIOD"+Math.random()+"\0",ict=new RegExp(kxe,"g"),oct=new RegExp(Cxe,"g"),act=new RegExp(bB,"g"),sct=new RegExp(Exe,"g"),lct=new RegExp(Txe,"g"),uct=/\\\\/g,cct=/\\{/g,dct=/\\}/g,pct=/\\,/g,fct=/\\\./g,mct=1e5;function _B(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function hct(e){return e.replace(uct,kxe).replace(cct,Cxe).replace(dct,bB).replace(pct,Exe).replace(fct,Txe)}function gct(e){return e.replace(ict,"\\").replace(oct,"{").replace(act,"}").replace(sct,",").replace(lct,".")}function Axe(e){if(!e)return[""];var t=[],r=vB("{","}",e);if(!r)return e.split(",");var n=r.pre,i=r.body,o=r.post,a=n.split(",");a[a.length-1]+="{"+i+"}";var s=Axe(o);return o.length&&(a[a.length-1]+=s.shift(),a.push.apply(a,s)),t.push.apply(t,a),t}function Ixe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e)return[];var tmp=t.max,r=tmp===void 0?mct:tmp;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),_S(hct(e),r,!0).map(gct)}function xct(e){return"{"+e+"}"}function yct(e){return/^-?0\d/.test(e)}function vct(e,t){return e<=t}function _ct(e,t){return e>=t}function _S(e,t,r){var n=[],i=vB("{","}",e);if(!i)return[e];var o=i.pre,a=i.post.length?_S(i.post,t,!1):[""];if(/\$$/.test(i.pre))for(var s=0;s<a.length&&s<t;s++){var l=o+"{"+i.body+"}"+a[s];n.push(l)}else{var s10=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l10=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),c=s10||l10,d=i.body.indexOf(",")>=0;if(!c&&!d)return i.post.match(/,(?!,).*\}/)?(e=i.pre+"{"+i.body+bB+i.post,_S(e,t,!0)):[e];var u;if(c)u=i.body.split(/\.\./);else if(u=Axe(i.body),u.length===1&&u[0]!==void 0&&(u=_S(u[0],t,!1).map(xct),u.length===1))return a.map(function(m){return i.pre+u[0]+m});var p;if(c&&u[0]!==void 0&&u[1]!==void 0){var m=_B(u[0]),h=_B(u[1]),g=Math.max(u[0].length,u[1].length),x=u.length===3&&u[2]!==void 0?Math.max(Math.abs(_B(u[2])),1):1,v=vct;h<m&&(x*=-1,v=_ct);var _=u.some(yct);p=[];for(var b=m;v(b,h);b+=x){var w=void 0;if(l10)w=String.fromCharCode(b),w==="\\"&&(w="");else if(w=String(b),_){var S=g-w.length;if(S>0){var k=new Array(S+1).join("0");b<0?w="-"+k+w.slice(1):w=k+w}}p.push(w)}}else{p=[];for(var m10=0;m10<u.length;m10++)p.push.apply(p,_S(u[m10],t,!1))}for(var m11=0;m11<p.length;m11++)for(var h10=0;h10<a.length&&n.length<t;h10++){var g10=o+p[m11]+a[h10];(!r||c||g10)&&n.push(g10)}}return n}var bS=function(e){if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var bct={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},wS=function(e){return e.replace(/[[\]\\-]/g,"\\$&")},wct=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},Pxe=function(e){return e.join("")},Rxe=function(e,t){var r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");var n=[],i=[],o=r+1,a=!1,s=!1,l=!1,c=!1,d=r,u="";e:for(;o<e.length;){var g=e.charAt(o);if((g==="!"||g==="^")&&o===r+1){c=!0,o++;continue}if(g==="]"&&a&&!l){d=o+1;break}if(a=!0,g==="\\"&&!l){l=!0,o++;continue}if(g==="["&&!l){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(bct)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),x=_step_value[0],_step_value_=_sliced_to_array(_step_value[1],3),v=_step_value_[0],y=_step_value_[1],_=_step_value_[2];if(e.startsWith(x,o)){if(u)return["$.",!1,e.length-r,!0];o+=x.length,_?i.push(v):n.push(v),s=s||y;continue e}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(l=!1,u){g>u?n.push(wS(u)+"-"+wS(g)):g===u&&n.push(wS(g)),u="",o++;continue}if(e.startsWith("-]",o+1)){n.push(wS(g+"-")),o+=2;continue}if(e.startsWith("-",o+1)){u=g,o+=2;continue}n.push(wS(g)),o++}if(d<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){var g10=n[0].length===2?n[0].slice(-1):n[0];return[wct(g10),!1,d-r,!1]}var p="["+(c?"^":"")+Pxe(n)+"]",m="["+(c?"":"^")+Pxe(i)+"]";return[n.length&&i.length?"("+p+"|"+m+")":n.length?p:m,s,d-r,!0]};var Ih=function(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.windowsPathsNoEscape,t=tmp===void 0?!1:tmp,tmp1=_ref.magicalBraces,r=tmp1===void 0?!0:tmp1;return r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1")};var gl,Sct=new Set(["!","?","+","*","@"]),wB=function(e){return Sct.has(e)},Mxe=function(e){return wB(e.type)},kct=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Cct=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Ect=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Oxe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Tct="(?!(?:^|/)\\.\\.?(?:$|/))",RI="(?!\\.)",Act=new Set(["[","."]),Ict=new Set(["..","."]),Pct=new Set("().*{}+?[]^$\\!"),Rct=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},EB="[^/]",$xe=EB+"*?",Nxe=EB+"+?",Mct=0,Do,Sa,Tf,wr,Oi,Ph,z0,Rh,up,cp,Fv,NI,Dxe,zv,MI,DI,Lxe,SS,SB,jv,OI,LI,Fxe,kS,kB,FI,zxe,zI,jxe,jI,Uxe,Uv,$I,CS,CB,UI,Bxe,Af=/*#__PURE__*/function(){"use strict";function Af1(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_class_call_check(this,Af1);Ht(this,NI);Ht(this,DI);Ht(this,SS);Ht(this,jv);Ht(this,LI);Ht(this,kS);Ht(this,FI);Ht(this,zI);Ht(this,jI);Ht(this,Uv);Ht(this,CS);A(this,"type");Ht(this,Do,void 0);Ht(this,Sa,void 0);Ht(this,Tf,!1);Ht(this,wr,[]);Ht(this,Oi,void 0);Ht(this,Ph,void 0);Ht(this,z0,void 0);Ht(this,Rh,!1);Ht(this,up,void 0);Ht(this,cp,void 0);Ht(this,Fv,!1);A(this,"id",++Mct);this.type=t,t&&Zt(this,Sa,!0),Zt(this,Oi,r),Zt(this,Do,fe(this,Oi)?fe(fe(this,Oi),Do):this),Zt(this,up,fe(this,Do)===this?n:fe(fe(this,Do),up)),Zt(this,z0,fe(this,Do)===this?[]:fe(fe(this,Do),z0)),t==="!"&&!fe(fe(this,Do),Rh)&&fe(this,z0).push(this),Zt(this,Ph,fe(this,Oi)?fe(fe(this,Oi),wr).length:0)}_create_class(Af1,[{key:"depth",get:function get1(){var t,r;return((r=(t=fe(this,Oi))==null?void 0:t.depth)!=null?r:-1)+1}},{key:Symbol.for("nodejs.util.inspect.custom"),value:function value(){var t;return{"@@type":"AST",id:this.id,type:this.type,root:fe(this,Do).id,parent:(t=fe(this,Oi))==null?void 0:t.id,depth:this.depth,partsLength:fe(this,wr).length,parts:fe(this,wr)}}},{key:"hasMagic",get:function get1(){if(fe(this,Sa)!==void 0)return fe(this,Sa);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(typeof t!="string"&&(t.type||t.hasMagic))return Zt(this,Sa,!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return fe(this,Sa)}},{key:"toString",value:function toString(){return fe(this,cp)!==void 0?fe(this,cp):this.type?Zt(this,cp,this.type+"("+fe(this,wr).map(function(t){return String(t)}).join("|")+")"):Zt(this,cp,fe(this,wr).map(function(t){return String(t)}).join(""))}},{key:"push",value:function push(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(r!==""){if(typeof r!="string"&&!(_instanceof(r,gl)&&fe(r,Oi)===this))throw new Error("invalid part: "+r);fe(this,wr).push(r)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"toJSON",value:function toJSON(){var r;var t=this.type===null?fe(this,wr).slice().map(function(n){return typeof n=="string"?n:n.toJSON()}):[this.type].concat(_to_consumable_array(fe(this,wr).map(function(n){return n.toJSON()})));return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===fe(this,Do)||fe(fe(this,Do),Rh)&&((r=fe(this,Oi))==null?void 0:r.type)==="!")&&t.push({}),t}},{key:"isStart",value:function isStart(){var r;if(fe(this,Do)===this)return!0;if(!((r=fe(this,Oi))!=null&&r.isStart()))return!1;if(fe(this,Ph)===0)return!0;var t=fe(this,Oi);for(var n=0;n<fe(this,Ph);n++){var i=fe(t,wr)[n];if(!(_instanceof(i,gl)&&i.type==="!"))return!1}return!0}},{key:"isEnd",value:function isEnd(){var r,n,i;if(fe(this,Do)===this||((r=fe(this,Oi))==null?void 0:r.type)==="!")return!0;if(!((n=fe(this,Oi))!=null&&n.isEnd()))return!1;if(!this.type)return(i=fe(this,Oi))==null?void 0:i.isEnd();var t=fe(this,Oi)?fe(fe(this,Oi),wr).length:0;return fe(this,Ph)===t-1}},{key:"copyIn",value:function copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}},{key:"clone",value:function clone(t){var r=new gl(this.type,t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;r.copyIn(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}},{key:"toMMPattern",value:function toMMPattern(){if(this!==fe(this,Do))return fe(this,Do).toMMPattern();var t=this.toString(),_this_toRegExpSource=_sliced_to_array(this.toRegExpSource(),4),r=_this_toRegExpSource[0],n=_this_toRegExpSource[1],i=_this_toRegExpSource[2],o=_this_toRegExpSource[3];if(!(i||fe(this,Sa)||fe(this,up).nocase&&!fe(this,up).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;var s=(fe(this,up).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp("^".concat(r,"$"),s),{_src:r,_glob:t})}},{key:"options",get:function get1(){return fe(this,up)}},{key:"toRegExpSource",value:function toRegExpSource(t){var _this=this;var l;var r=t!=null?t:!!fe(this,up).dot;if(fe(this,Do)===this&&(Nt(this,Uv,$I).call(this),Nt(this,NI,Dxe).call(this)),!Mxe(this)){var c=this.isStart()&&this.isEnd()&&!fe(this,wr).some(function(h){return typeof h!="string"}),d=fe(this,wr).map(function(h){var _;var _ref=_sliced_to_array(typeof h=="string"?Nt(_=gl,UI,Bxe).call(_,h,fe(_this,Sa),c):h.toRegExpSource(t),4),g=_ref[0],x=_ref[1],v=_ref[2],y=_ref[3];return Zt(_this,Sa,fe(_this,Sa)||v),Zt(_this,Tf,fe(_this,Tf)||y),g}).join(""),u="";if(this.isStart()&&typeof fe(this,wr)[0]=="string"&&!(fe(this,wr).length===1&&Ict.has(fe(this,wr)[0]))){var g=Act,x=r&&g.has(d.charAt(0))||d.startsWith("\\.")&&g.has(d.charAt(2))||d.startsWith("\\.\\.")&&g.has(d.charAt(4)),v=!r&&!t&&g.has(d.charAt(0));u=x?Tct:v?RI:""}var p="";return this.isEnd()&&fe(fe(this,Do),Rh)&&((l=fe(this,Oi))==null?void 0:l.type)==="!"&&(p="(?:$|\\/)"),[u+d+p,Ih(d),Zt(this,Sa,!!fe(this,Sa)),fe(this,Tf)]}var n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=Nt(this,CS,CB).call(this,r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){var c10=this.toString(),d10=this;return Zt(d10,wr,[c10]),d10.type=null,Zt(d10,Sa,void 0),[c10,Ih(this.toString()),!1,!1]}var a=!n||t||r||!RI?"":Nt(this,CS,CB).call(this,!0);a===o&&(a=""),a&&(o="(?:".concat(o,")(?:").concat(a,")*?"));var s="";if(this.type==="!"&&fe(this,Fv))s=(this.isStart()&&!r?RI:"")+Nxe;else{var c11=this.type==="!"?"))"+(this.isStart()&&!r&&!t?RI:"")+$xe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":")".concat(this.type);s=i+o+c11}return[s,Ih(o),Zt(this,Sa,!!fe(this,Sa)),fe(this,Tf)]}}],[{key:"fromGlob",value:function fromGlob(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i;var n=new gl(null,void 0,r);return Nt(i=gl,zv,MI).call(i,t,n,0,r,0),n}}]);return Af1}();Do=new WeakMap,Sa=new WeakMap,Tf=new WeakMap,wr=new WeakMap,Oi=new WeakMap,Ph=new WeakMap,z0=new WeakMap,Rh=new WeakMap,up=new WeakMap,cp=new WeakMap,Fv=new WeakMap,NI=new WeakSet,Dxe=function Dxe1(){if(this!==fe(this,Do))throw new Error("should only call on root");if(fe(this,Rh))return this;this.toString(),Zt(this,Rh,!0);var t;for(;t=fe(this,z0).pop();){if(t.type!=="!")continue;var r=t,n=fe(r,Oi);for(;n;){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;for(var i=fe(r,Ph)+1;!n.type&&i<fe(n,wr).length;i++)try{for(var _iterator=fe(t,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(fe(n,wr)[i])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r=n,n=fe(r,Oi)}}return this},zv=new WeakSet,MI=function(t,r,n,i,o){var g,x,v,y,_;var a=(g=i.maxExtglobRecursion)!=null?g:2,s=!1,l=!1,c=-1,d=!1;if(r.type===null){var b=n,w="";for(;b<t.length;){var S=t.charAt(b++);if(s||S==="\\"){s=!s,w+=S;continue}if(l){b===c+1?(S==="^"||S==="!")&&(d=!0):S==="]"&&!(b===c+2&&d)&&(l=!1),w+=S;continue}else if(S==="["){l=!0,c=b,d=!1,w+=S;continue}if(!i.noext&&wB(S)&&t.charAt(b)==="("&&o<=a){r.push(w),w="";var E=new gl(S,r);b=Nt(x=gl,zv,MI).call(x,t,E,b,i,o+1),r.push(E);continue}w+=S}return r.push(w),b}var u=n+1,p=new gl(null,r),m=[],h="";for(;u<t.length;){var _r1;var b10=t.charAt(u++);if(s||b10==="\\"){s=!s,h+=b10;continue}if(l){u===c+1?(b10==="^"||b10==="!")&&(d=!0):b10==="]"&&!(u===c+2&&d)&&(l=!1),h+=b10;continue}else if(b10==="["){l=!0,c=u,d=!1,h+=b10;continue}if(!i.noext&&wB(b10)&&t.charAt(u)==="("&&(o<=a||r&&Nt(v=r,jv,OI).call(v,b10))){var S10=r&&Nt(y=r,jv,OI).call(y,b10)?0:1;p.push(h),h="";var k=new gl(b10,p);p.push(k),u=Nt(_=gl,zv,MI).call(_,t,k,u,i,o+S10);continue}if(b10==="|"){p.push(h),h="",m.push(p),p=new gl(null,r);continue}if(b10===")")return h===""&&fe(r,wr).length===0&&Zt(r,Fv,!0),p.push(h),h="",(_r1=r).push.apply(_r1,_to_consumable_array(m).concat([p])),u;h+=b10}return r.type=null,Zt(r,Sa,void 0),Zt(r,wr,[t.substring(n-1)]),u},DI=new WeakSet,Lxe=function Lxe1(t){return Nt(this,SS,SB).call(this,t,Cct)},SS=new WeakSet,SB=function SB1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kct;if(!t||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||t.type!==null||fe(t,wr).length!==1||this.type===null)return!1;var n=fe(t,wr)[0];return!n||(typeof n==="undefined"?"undefined":_type_of(n))!="object"||n.type===null?!1:Nt(this,jv,OI).call(this,n.type,r)},jv=new WeakSet,OI=function OI1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ect;var n;return!!((n=r.get(this.type))!=null&&n.includes(t))},LI=new WeakSet,Fxe=function Fxe1(t,r){var n=fe(t,wr)[0],i=new gl(null,n,this.options);fe(i,wr).push(""),n.push(i),Nt(this,kS,kB).call(this,t,r)},kS=new WeakSet,kB=function kB1(t,r){var _fe1;var n=fe(t,wr)[0];(_fe1=fe(this,wr)).splice.apply(_fe1,[r,1].concat(_to_consumable_array(fe(n,wr))));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(n,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;(typeof i==="undefined"?"undefined":_type_of(i))=="object"&&Zt(i,Oi,this)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}Zt(this,cp,void 0)},FI=new WeakSet,zxe=function zxe1(t){var r=Oxe.get(this.type);return!!(r!=null&&r.has(t))},zI=new WeakSet,jxe=function jxe1(t){if(!t||(typeof t==="undefined"?"undefined":_type_of(t))!="object"||t.type!==null||fe(t,wr).length!==1||this.type===null||fe(this,wr).length!==1)return!1;var r=fe(t,wr)[0];return!r||(typeof r==="undefined"?"undefined":_type_of(r))!="object"||r.type===null?!1:Nt(this,FI,zxe).call(this,r.type)},jI=new WeakSet,Uxe=function Uxe1(t){var r=Oxe.get(this.type),n=fe(t,wr)[0],i=r==null?void 0:r.get(n.type);if(!i)return!1;Zt(this,wr,fe(n,wr));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=fe(this,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&Zt(o,Oi,this)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.type=i,Zt(this,cp,void 0),Zt(this,Fv,!1)},Uv=new WeakSet,$I=function(){var t,r;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(Mxe(this)){var n=0,i=!1;do{i=!0;for(var o=0;o<fe(this,wr).length;o++){var a=fe(this,wr)[o];(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&(Nt(r=a,Uv,$I).call(r),Nt(this,SS,SB).call(this,a)?(i=!1,Nt(this,kS,kB).call(this,a,o)):Nt(this,DI,Lxe).call(this,a)?(i=!1,Nt(this,LI,Fxe).call(this,a,o)):Nt(this,zI,jxe).call(this,a)&&(i=!1,Nt(this,jI,Uxe).call(this,a)))}}while(!i&&++n<10)}else try{for(var _iterator=fe(this,wr)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n10=_step.value;(typeof n10==="undefined"?"undefined":_type_of(n10))=="object"&&Nt(t=n10,Uv,$I).call(t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}Zt(this,cp,void 0)},CS=new WeakSet,CB=function CB1(t){var _this=this;return fe(this,wr).map(function(r){if(typeof r=="string")throw new Error("string type in extglob ast??");var _r_toRegExpSource=_sliced_to_array(r.toRegExpSource(t),4),n=_r_toRegExpSource[0],i=_r_toRegExpSource[1],o=_r_toRegExpSource[2],a=_r_toRegExpSource[3];return Zt(_this,Tf,fe(_this,Tf)||a),n}).filter(function(r){return!(_this.isStart()&&_this.isEnd())||!!r}).join("|")},UI=new WeakSet,Bxe=function Bxe1(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var i=!1,o="",a=!1,s=!1;for(var l=0;l<t.length;l++){var c=t.charAt(l);if(i){i=!1,o+=(Pct.has(c)?"\\":"")+c;continue}if(c==="*"){if(s)continue;s=!0,o+=n&&/^[*]+$/.test(t)?Nxe:$xe,r=!0;continue}else s=!1;if(c==="\\"){l===t.length-1?o+="\\\\":i=!0;continue}if(c==="["){var _Rxe=_sliced_to_array(Rxe(t,l),4),d=_Rxe[0],u=_Rxe[1],p=_Rxe[2],m=_Rxe[3];if(p){o+=d,a=a||u,l+=p-1,r=r||m;continue}}if(c==="?"){o+=EB,r=!0;continue}o+=Rct(c)}return[o,Ih(t),!!r,a]},Ht(Af,zv),Ht(Af,UI);gl=Af;var TB=function(e){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tmp=_ref.windowsPathsNoEscape,t=tmp===void 0?!1:tmp,tmp1=_ref.magicalBraces,r=tmp1===void 0?!1:tmp1;return r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")};var ka=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bS(t),!r.nocomment&&t.charAt(0)==="#"?!1:new qv(t,r).match(e)},Oct=/^\*+([^+@!?*[(]*)$/,$ct=function(e){return function(t){return!t.startsWith(".")&&t.endsWith(e)}},Nct=function(e){return function(t){return t.endsWith(e)}},Dct=function(e){return e=e.toLowerCase(),function(t){return!t.startsWith(".")&&t.toLowerCase().endsWith(e)}},Lct=function(e){return e=e.toLowerCase(),function(t){return t.toLowerCase().endsWith(e)}},Fct=/^\*+\.\*+$/,zct=function(e){return!e.startsWith(".")&&e.includes(".")},jct=function(e){return e!=="."&&e!==".."&&e.includes(".")},Uct=/^\.\*+$/,Bct=function(e){return e!=="."&&e!==".."&&e.startsWith(".")},qct=/^\*+$/,Wct=function(e){return e.length!==0&&!e.startsWith(".")},Vct=function(e){return e.length!==0&&e!=="."&&e!==".."},Gct=/^\?+([^+@!?*[(]*)?$/,Hct=function(param){var _param=_sliced_to_array(param,2),e=_param[0],tmp=_param[1],t=tmp===void 0?"":tmp;var r=Vxe([e]);return t?(t=t.toLowerCase(),function(n){return r(n)&&n.toLowerCase().endsWith(t)}):r},Zct=function(param){var _param=_sliced_to_array(param,2),e=_param[0],tmp=_param[1],t=tmp===void 0?"":tmp;var r=Gxe([e]);return t?(t=t.toLowerCase(),function(n){return r(n)&&n.toLowerCase().endsWith(t)}):r},Kct=function(param){var _param=_sliced_to_array(param,2),e=_param[0],tmp=_param[1],t=tmp===void 0?"":tmp;var r=Gxe([e]);return t?function(n){return r(n)&&n.endsWith(t)}:r},Qct=function(param){var _param=_sliced_to_array(param,2),e=_param[0],tmp=_param[1],t=tmp===void 0?"":tmp;var r=Vxe([e]);return t?function(n){return r(n)&&n.endsWith(t)}:r},Vxe=function(param){var _param=_sliced_to_array(param,1),e=_param[0];var t=e.length;return function(r){return r.length===t&&!r.startsWith(".")}},Gxe=function(param){var _param=_sliced_to_array(param,1),e=_param[0];var t=e.length;return function(r){return r.length===t&&r!=="."&&r!==".."}},Hxe=(typeof process==="undefined"?"undefined":_type_of(process))=="object"&&process?_type_of(process.env)=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",qxe={win32:{sep:"\\"},posix:{sep:"/"}},Jct=Hxe==="win32"?qxe.win32.sep:qxe.posix.sep;ka.sep=Jct;var as=Symbol("globstar **");ka.GLOBSTAR=as;var Yct="[^/]",Xct=Yct+"*?",edt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",tdt="(?:(?!(?:\\/|^)\\.).)*?",rdt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(r){return ka(r,e,t)}};ka.filter=rdt;var Ku=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)},ndt=function(e){if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object"||!Object.keys(e).length)return ka;var t=ka;return Object.assign(function(n,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t(n,i,Ku(e,o))},{Minimatch:/*#__PURE__*/function(_t_Minimatch){"use strict";_inherits(Minimatch,_t_Minimatch);function Minimatch(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_class_call_check(this,Minimatch);return _call_super(this,Minimatch,[i,Ku(e,o)])}_create_class(Minimatch,null,[{key:"defaults",value:function defaults(i){return t.defaults(Ku(e,i)).Minimatch}}]);return Minimatch}(t.Minimatch),AST:/*#__PURE__*/function(_t_AST){"use strict";_inherits(AST,_t_AST);function AST(i,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_class_call_check(this,AST);return _call_super(this,AST,[i,o,Ku(e,a)])}_create_class(AST,null,[{key:"fromGlob",value:function fromGlob(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(i,Ku(e,o))}}]);return AST}(t.AST),unescape:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Ku(e,i))},escape:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Ku(e,i))},filter:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Ku(e,i))},defaults:function(n){return t.defaults(Ku(e,n))},makeRe:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Ku(e,i))},braceExpand:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Ku(e,i))},match:function(n,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,i,Ku(e,o))},sep:t.sep,GLOBSTAR:as})};ka.defaults=ndt;var Zxe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return bS(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ixe(e,{max:t.braceExpandMax})};ka.braceExpand=Zxe;var idt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new qv(e,t).makeRe()};ka.makeRe=idt;var odt=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=new qv(t,r);return e=e.filter(function(i){return n.match(i)}),n.options.nonull&&!e.length&&e.push(t),e};ka.match=odt;var Wxe=/[?*]|[+@!]\(.*?\)|\[|\]/,adt=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},BI,Kxe,ES,AB,Mh,Bv,qv=/*#__PURE__*/function(){"use strict";function qv1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_class_call_check(this,qv1);Ht(this,BI);Ht(this,ES);Ht(this,Mh);A(this,"options");A(this,"set");A(this,"pattern");A(this,"windowsPathsNoEscape");A(this,"nonegate");A(this,"negate");A(this,"comment");A(this,"empty");A(this,"preserveMultipleSlashes");A(this,"partial");A(this,"globSet");A(this,"globParts");A(this,"nocase");A(this,"isWindows");A(this,"platform");A(this,"windowsNoMagicRoot");A(this,"maxGlobstarRecursion");A(this,"regexp");var i;bS(t),r=r||{},this.options=r,this.maxGlobstarRecursion=(i=r.maxGlobstarRecursion)!=null?i:200,this.pattern=t,this.platform=r.platform||Hxe,this.isWindows=this.platform==="win32";var n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}_create_class(qv1,[{key:"hasMagic",value:function hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=this.set[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var t=_step.value;try{for(var _iterator1=t[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var r=_step1.value;if(typeof r!="string")return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!1}},{key:"debug",value:function debug(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}}},{key:"make",value:function make(){var _this=this;var _console;var t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=_to_consumable_array(new Set(this.braceExpand())),r.debug&&(this.debug=function(){for(var _len=arguments.length,o=new Array(_len),_key=0;_key<_len;_key++){o[_key]=arguments[_key]}return(_console=console).error.apply(_console,_to_consumable_array(o))}),this.debug(this.pattern,this.globSet);var n=this.globSet.map(function(o){return _this.slashSplit(o)});this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);var i=this.globParts.map(function(o,a,s){if(_this.isWindows&&_this.windowsNoMagicRoot){var l=o[0]===""&&o[1]===""&&(o[2]==="?"||!Wxe.test(o[2]))&&!Wxe.test(o[3]),c=/^[a-z]:/i.test(o[0]);if(l)return _to_consumable_array(o.slice(0,4)).concat(_to_consumable_array(o.slice(4).map(function(d){return _this.parse(d)})));if(c)return[o[0]].concat(_to_consumable_array(o.slice(1).map(function(d){return _this.parse(d)})))}return o.map(function(l){return _this.parse(l)})});if(this.debug(this.pattern,i),this.set=i.filter(function(o){return o.indexOf(!1)===-1}),this.isWindows)for(var o=0;o<this.set.length;o++){var a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}},{key:"preprocess",value:function preprocess(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(this.options.noglobstar)try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;for(var i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _this_options=this.options,tmp=_this_options.optimizationLevel,r=tmp===void 0?1:tmp;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}},{key:"adjascentGlobstarOptimize",value:function adjascentGlobstarOptimize(t){return t.map(function(r){var n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){var i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}},{key:"levelOneOptimize",value:function levelOneOptimize(t){return t.map(function(r){return r=r.reduce(function(n,i){var o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r})}},{key:"levelTwoFileOptimize",value:function levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));var r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(var i=1;i<t.length-1;i++){var o=t[i];i===1&&o===""&&t[0]===""||(o==="."||o==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}var n=0;for(;(n=t.indexOf("..",n+1))!==-1;){var i10=t[n-1];i10&&i10!=="."&&i10!==".."&&i10!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i10))&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}},{key:"firstPhasePreProcess",value:function firstPhasePreProcess(t){var r=!1;do{r=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){var a=i;for(;n[a+1]==="**";)a++;a>i&&n.splice(i+1,a-i);var s=n[i+1],l=n[i+2],c=n[i+3];if(s!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;r=!0,n.splice(i,1);var d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(var a9=1;a9<n.length-1;a9++){var s10=n[a9];a9===1&&s10===""&&n[0]===""||(s10==="."||s10==="")&&(r=!0,n.splice(a9,1),a9--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}var o=0;for(;(o=n.indexOf("..",o+1))!==-1;){var a10=n[o-1];if(a10&&a10!=="."&&a10!==".."&&a10!=="**"){var _n;r=!0;var l10=o===1&&n[o+1]==="**"?["."]:[];(_n=n).splice.apply(_n,[o-1,2].concat(_to_consumable_array(l10))),n.length===0&&n.push(""),o-=2}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}while(r);return t}},{key:"secondPhasePreProcess",value:function secondPhasePreProcess(t){for(var r=0;r<t.length-1;r++)for(var n=r+1;n<t.length;n++){var i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(function(r){return r.length})}},{key:"partsMatch",value:function partsMatch(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var i=0,o=0,a=[],s="";for(;i<t.length&&o<r.length;)if(t[i]===r[o])a.push(s==="b"?r[o]:t[i]),i++,o++;else if(n&&t[i]==="**"&&r[o]===t[i+1])a.push(t[i]),i++;else if(n&&r[o]==="**"&&t[i]===r[o+1])a.push(r[o]),o++;else if(t[i]==="*"&&r[o]&&(this.options.dot||!r[o].startsWith("."))&&r[o]!=="**"){if(s==="b")return!1;s="a",a.push(t[i]),i++,o++}else if(r[o]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(s==="a")return!1;s="b",a.push(r[o]),i++,o++}else return!1;return t.length===r.length&&a}},{key:"parseNegate",value:function parseNegate(){if(this.nonegate)return;var t=this.pattern,r=!1,n=0;for(var i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}},{key:"matchOne",value:function matchOne(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var i=0,o=0;if(this.isWindows){var s=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!s&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!c&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),u=l?3:s?0:void 0,p=d?3:c?0:void 0;if(typeof u=="number"&&typeof p=="number"){var _ref=[t[u],r[p]],m=_ref[0],h=_ref[1];m.toLowerCase()===h.toLowerCase()&&(r[p]=m,o=p,i=u)}}var _this_options=this.options,tmp=_this_options.optimizationLevel,a=tmp===void 0?1:tmp;return a>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(as)?Nt(this,BI,Kxe).call(this,t,r,n,i,o):Nt(this,Mh,Bv).call(this,t,r,n,i,o)}},{key:"braceExpand",value:function braceExpand(){return Zxe(this.pattern,this.options)}},{key:"parse",value:function parse(t){bS(t);var r=this.options;if(t==="**")return as;if(t==="")return"";var n,i=null;(n=t.match(qct))?i=r.dot?Vct:Wct:(n=t.match(Oct))?i=(r.nocase?r.dot?Lct:Dct:r.dot?Nct:$ct)(n[1]):(n=t.match(Gct))?i=(r.nocase?r.dot?Zct:Hct:r.dot?Kct:Qct)(n):(n=t.match(Fct))?i=r.dot?jct:zct:(n=t.match(Uct))&&(i=Bct);var o=Af.fromGlob(t,this.options).toMMPattern();return i&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}},{key:"makeRe",value:function makeRe(){var _this=this;if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?Xct:r.dot?edt:tdt,i=new Set(r.nocase?["i"]:[]),o=t.map(function(l){var c=l.map(function(u){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(_instanceof(u,RegExp))try{for(var _iterator=u.flags.split("")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;i.add(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return typeof u=="string"?adt(u):u===as?as:u._src});c.forEach(function(u,p){var m=c[p+1],h=c[p-1];u!==as||h===as||(h===void 0?m!==void 0&&m!==as?c[p+1]="(?:\\/|"+n+"\\/)?"+m:c[p]=n:m===void 0?c[p-1]=h+"(?:\\/|\\/"+n+")?":m!==as&&(c[p-1]=h+"(?:\\/|\\/"+n+"\\/)"+m,c[p+1]=as))});var d=c.filter(function(u){return u!==as});if(_this.partial&&d.length>=1){var u=[];for(var p=1;p<=d.length;p++)u.push(d.slice(0,p).join("/"));return"(?:"+u.join("|")+")"}return d.join("/")}).join("|"),_ref=_sliced_to_array(t.length>1?["(?:",")"]:["",""],2),a=_ref[0],s=_ref[1];o="^"+a+o+s+"$",this.partial&&(o="^(?:\\/|"+a+o.slice(1,-1)+s+")$"),this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,_to_consumable_array(i).join(""))}catch(l){this.regexp=!1}return this.regexp}},{key:"slashSplit",value:function slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?[""].concat(_to_consumable_array(t.split(/\/+/))):t.split(/\/+/)}},{key:"match",value:function match(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;var n=this.options;this.isWindows&&(t=t.split("\\").join("/"));var i=this.slashSplit(t);this.debug(this.pattern,"split",i);var o=this.set;this.debug(this.pattern,"set",o);var a=i[i.length-1];if(!a)for(var s=i.length-2;!a&&s>=0;s--)a=i[s];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s10=_step.value;var l=i;if(n.matchBase&&s10.length===1&&(l=[a]),this.matchOne(l,s10,r))return n.flipNegate?!0:!this.negate}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n.flipNegate?!1:this.negate}}],[{key:"defaults",value:function defaults(t){return ka.defaults(t).Minimatch}}]);return qv1}();BI=new WeakSet,Kxe=function Kxe1(t,r,n,i,o){var a=r.indexOf(as,o),s=r.lastIndexOf(as),_ref=_sliced_to_array(n?[r.slice(o,a),r.slice(a+1),[]]:[r.slice(o,a),r.slice(a+1,s),r.slice(s+1)],3),l=_ref[0],c=_ref[1],d=_ref[2];if(l.length){var y=t.slice(i,i+l.length);if(!Nt(this,Mh,Bv).call(this,y,l,n,0,0))return!1;i+=l.length,o+=l.length}var u=0;if(d.length){if(d.length+i>t.length)return!1;var y10=t.length-d.length;if(Nt(this,Mh,Bv).call(this,t,d,n,y10,0))u=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(y10--,!Nt(this,Mh,Bv).call(this,t,d,n,y10,0)))return!1;u=d.length+1}}if(!c.length){var y11=!!u;for(var _=i;_<t.length-u;_++){var b=String(t[_]);if(y11=!0,b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1}return n||y11}var p=[[[],0]],m=p[0],h=0,g=[0];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var y12=_step.value;y12===as?(g.push(h),m=[[],0],p.push(m)):(m[0].push(y12),h++)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var x=p.length-1,v=t.length-u;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=p[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var y13=_step1.value;y13[1]=v-(g[x--]+y13[0].length)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!!Nt(this,ES,AB).call(this,t,p,i,0,n,0,!!u)},ES=new WeakSet,AB=function(t,r,n,i,o,a,s){var l=r[i];if(!l){for(var u=n;u<t.length;u++){s=!0;var p=t[u];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s}var _l1=_sliced_to_array(l,2),c=_l1[0],d=_l1[1];for(;n<=d;){if(Nt(this,Mh,Bv).call(this,t.slice(0,n+c.length),c,o,n,0)&&a<this.maxGlobstarRecursion){var m=Nt(this,ES,AB).call(this,t,r,n+c.length,i+1,o,a+1,s);if(m!==!1)return m}var p10=t[n];if(p10==="."||p10===".."||!this.options.dot&&p10.startsWith("."))return!1;n++}return o||null},Mh=new WeakSet,Bv=function Bv1(t,r,n,i,o){var a,s,l,c;for(a=i,s=o,c=t.length,l=r.length;a<c&&s<l;a++,s++){this.debug("matchOne loop");var d=r[s],u=t[a];if(this.debug(r,d,u),d===!1||d===as)return!1;var p=void 0;if(typeof d=="string"?(p=u===d,this.debug("string match",d,u,p)):(p=d.test(u),this.debug("pattern match",d,u,p)),!p)return!1}if(a===c&&s===l)return!0;if(a===c)return n;if(s===l)return a===c-1&&t[a]==="";throw new Error("wtf?")};ka.AST=Af;ka.Minimatch=qv;ka.escape=TB;ka.unescape=Ih;var TS={Z_BEST_COMPRESSION:9,Z_BEST_SPEED:1,Z_DEFAULT_COMPRESSION:-1};function sdt(e){if(!(e===void 0||e===TS.Z_DEFAULT_COMPRESSION)){if(!Number.isInteger(e)||e<0||e>9)throw new RangeError('The "level" option must be between -1 and 9.');return e}}function ldt(e,t){var r=new Uint8Array(t),n=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.set(i,n),n+=i.length}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function IB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wme(e,{level:sdt(t.level)})}function AS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t.maxOutputLength===void 0)return kme(e);var r=t.maxOutputLength;if(!Number.isSafeInteger(r)||r<0)throw new RangeError('The "maxOutputLength" option must be a non-negative integer.');var n=[],i=0;return new Sme(function(a){if(i+a.length>r)throw new RangeError("Decompressed data exceeds the maximum size of ".concat(r," bytes."));n.push(a),i+=a.length}).push(e,!0),ldt(n,i)}var IS=/*#__PURE__*/function(){"use strict";function IS1(){_class_call_check(this,IS1)}_create_class(IS1,[{key:"diff",value:function diff(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);var o=this.castInput(t,n),a=this.castInput(r,n),s=this.removeEmpty(this.tokenize(o,n)),l=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(s,l,n,i)}},{key:"diffWithOptionsObj",value:function diffWithOptionsObj(t,r,n,i){var _this=this;var o;var a=function(y){if(y=_this.postProcess(y,n),i){setTimeout(function(){i(y)},0);return}else return y},s=r.length,l=t.length,c=1,d=s+l;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));var u=(o=n.timeout)!==null&&o!==void 0?o:1/0,p=Date.now()+u,m=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(m[0],r,t,0,n);if(m[0].oldPos+1>=l&&h+1>=s)return a(this.buildValues(m[0].lastComponent,r,t));var g=-1/0,x=1/0,v=function(){for(var y=Math.max(g,-c);y<=Math.min(x,c);y+=2){var _=void 0,b=m[y-1],w=m[y+1];b&&(m[y-1]=void 0);var S=!1;if(w){var E=w.oldPos-y;S=w&&0<=E&&E<s}var k=b&&b.oldPos+1<l;if(!S&&!k){m[y]=void 0;continue}if(!k||S&&b.oldPos<w.oldPos?_=_this.addToPath(w,!0,!1,0,n):_=_this.addToPath(b,!1,!0,1,n),h=_this.extractCommon(_,r,t,y,n),_.oldPos+1>=l&&h+1>=s)return a(_this.buildValues(_.lastComponent,r,t))||!0;m[y]=_,_.oldPos+1>=l&&(x=Math.min(x,y-1)),h+1>=s&&(g=Math.max(g,y+1))}c++};if(i)(function y(){setTimeout(function(){if(c>d||Date.now()>p)return i(void 0);v()||y()},0)})();else for(;c<=d&&Date.now()<=p;){var y=v();if(y)return y}}},{key:"addToPath",value:function addToPath(t,r,n,i,o){var a=t.lastComponent;return a&&!o.oneChangePerToken&&a.added===r&&a.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:r,removed:n,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:a}}}},{key:"extractCommon",value:function extractCommon(t,r,n,i,o){var a=r.length,s=n.length,l=t.oldPos,c=l-i,d=0;for(;c+1<a&&l+1<s&&this.equals(n[l+1],r[c+1],o);)c++,l++,d++,o.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!o.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}},{key:"equals",value:function equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}},{key:"removeEmpty",value:function removeEmpty(t){var r=[];for(var n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}},{key:"castInput",value:function castInput(t,r){return t}},{key:"tokenize",value:function tokenize(t,r){return Array.from(t)}},{key:"join",value:function join(t){return t.join("")}},{key:"postProcess",value:function postProcess(t,r){return t}},{key:"useLongestToken",get:function get1(){return!1}},{key:"buildValues",value:function buildValues(t,r,n){var i=[],o;for(;t;)i.push(t),o=t.previousComponent,delete t.previousComponent,t=o;i.reverse();var a=i.length,s=0,l=0,c=0;for(;s<a;s++){var d=i[s];if(d.removed)d.value=this.join(n.slice(c,c+d.count)),c+=d.count;else{if(!d.added&&this.useLongestToken){var u=r.slice(l,l+d.count);u=u.map(function(p,m){var h=n[c+m];return h.length>p.length?h:p}),d.value=this.join(u)}else d.value=this.join(r.slice(l,l+d.count));l+=d.count,d.added||(c+=d.count)}}return i}}]);return IS1}();var PB=/*#__PURE__*/function(IS1){"use strict";_inherits(PB1,IS1);function PB1(){_class_call_check(this,PB1);var _this;_this=_call_super(this,PB1,arguments),_this.tokenize=cdt;return _this}_create_class(PB1,[{key:"equals",value:function equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes("\n"))&&(t=t.trim()),(!n.newlineIsToken||!r.includes("\n"))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith("\n")&&(t=t.slice(0,-1)),r.endsWith("\n")&&(r=r.slice(0,-1))),_get(_get_prototype_of(PB1.prototype),"equals",this).call(this,t,r,n)}}]);return PB1}(IS),udt=new PB;function RB(e,t,r){return udt.diff(e,t,r)}function cdt(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var o=n[i];i%2&&!t.newlineIsToken?r[r.length-1]+=o:r.push(o)}return r}var Qxe={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function MB(e,t,r,n,i,o,a){var s;a?typeof a=="function"?s={callback:a}:s=a:s={},typeof s.context=="undefined"&&(s.context=4);var l=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){var d=s.callback;RB(r,n,Object.assign(Object.assign({},s),{callback:function(u){var p=c(u);d(p)}}))}else return c(RB(r,n,s));function c(d){if(!d)return;d.push({value:"",lines:[]});function u(y){return y.map(function(_){return" "+_})}var p=[],m=0,h=0,g=[],x=1,v=1;for(var y=0;y<d.length;y++){var _=d[y],b=_.lines||ddt(_.value);if(_.lines=b,_.added||_.removed){if(!m){var w=d[y-1];m=x,h=v,w&&(g=l>0?u(w.lines.slice(-l)):[],m-=g.length,h-=g.length)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=b[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var w10=_step.value;g.push((_.added?"+":"-")+w10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_.added?v+=b.length:x+=b.length}else{var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(m)if(b.length<=l*2&&y<d.length-2)try{for(var _iterator1=u(b)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var w11=_step1.value;g.push(w11)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}else{var w12=Math.min(b.length,l);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=u(b.slice(0,w12))[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var k=_step2.value;g.push(k)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var S={oldStart:m,oldLines:x-m+w12,newStart:h,newLines:v-h+w12,lines:g};p.push(S),m=0,h=0,g=[]}x+=b.length,v+=b.length}}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=p[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var y10=_step3.value;for(var _10=0;_10<y10.lines.length;_10++)y10.lines[_10].endsWith("\n")?y10.lines[_10]=y10.lines[_10].slice(0,-1):(y10.lines.splice(_10+1,0,"\\ No newline at end of file"),_10++)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:o,hunks:p}}}function qI(e,t){if(t||(t=Qxe),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(function(n){return qI(n,t)}).join("\n")}var r=[];t.includeIndex&&e.oldFileName==e.newFileName&&r.push("Index: "+e.oldFileName),t.includeUnderline&&r.push("==================================================================="),t.includeFileHeaders&&(r.push("--- "+e.oldFileName+(typeof e.oldHeader=="undefined"?"":" "+e.oldHeader)),r.push("+++ "+e.newFileName+(typeof e.newHeader=="undefined"?"":" "+e.newHeader)));for(var n=0;n<e.hunks.length;n++){var i=e.hunks[n];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),r.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.lines[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;r.push(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return r.join("\n")+"\n"}function OB(e,t,r,n,i,o,a){if(typeof a=="function"&&(a={callback:a}),a!=null&&a.callback){var s=a.callback;MB(e,t,r,n,i,o,Object.assign(Object.assign({},a),{callback:function(l){s(l?qI(l,a.headerOptions):void 0)}}))}else{var s10=MB(e,t,r,n,i,o,a);return s10?qI(s10,a==null?void 0:a.headerOptions):void 0}}function ddt(e){var t=e.endsWith("\n"),r=e.split("\n").map(function(n){return n+"\n"});return t?r.pop():r.push(r.pop().slice(0,-1)),r}function fdt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}function LB(e,t){return Array(t+1).join(e)}function Xxe(e){return e.replace(/^\n*/,"")}function eye(e){for(var t=e.length;t>0&&e[t-1]==="\n";)t--;return e.substring(0,t)}function tye(e){return eye(Xxe(e))}var mdt=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function FB(e){return zB(e,mdt)}var rye=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function nye(e){return zB(e,rye)}function hdt(e){return oye(e,rye)}var iye=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function gdt(e){return zB(e,iye)}function xdt(e){return oye(e,iye)}function zB(e,t){return t.indexOf(e.nodeName)>=0}function oye(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var ydt=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function aye(e){return ydt.reduce(function(t,r){return t.replace(r[0],r[1])},e)}var ss={};ss.paragraph={filter:"p",replacement:function replacement(e){return"\n\n"+e+"\n\n"}};ss.lineBreak={filter:"br",replacement:function replacement(e,t,r){return r.br+"\n"}};ss.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function replacement(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var i=LB(n===1?"=":"-",e.length);return"\n\n"+e+"\n"+i+"\n\n"}else return"\n\n"+LB("#",n)+" "+e+"\n\n"}};ss.blockquote={filter:"blockquote",replacement:function replacement(e){return e=tye(e).replace(/^/gm,"> "),"\n\n"+e+"\n\n"}};ss.list={filter:["ul","ol"],replacement:function replacement(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}};ss.listItem={filter:"li",replacement:function replacement(e,t,r){var n=r.bulletListMarker+" ",i=t.parentNode;if(i.nodeName==="OL"){var o=i.getAttribute("start"),a=Array.prototype.indexOf.call(i.children,t);n=(o?Number(o)+a:a+1)+". "}var s=/\n$/.test(e);return e=tye(e)+(s?"\n":""),e=e.replace(/\n/gm,"\n"+" ".repeat(n.length)),n+e+(t.nextSibling?"\n":"")}};ss.indentedCodeBlock={filter:function filter(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function replacement(e,t,r){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}};ss.fencedCodeBlock={filter:function filter(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function replacement(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",i=(n.match(/language-(\S+)/)||[null,""])[1],o=t.firstChild.textContent,a=r.fence.charAt(0),s=3,l=new RegExp("^"+a+"{3,}","gm"),c;c=l.exec(o);)c[0].length>=s&&(s=c[0].length+1);var d=LB(a,s);return"\n\n"+d+i+"\n"+o.replace(/\n$/,"")+"\n"+d+"\n\n"}};ss.horizontalRule={filter:"hr",replacement:function replacement(e,t,r){return"\n\n"+r.hr+"\n\n"}};ss.inlineLink={filter:function filter(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function replacement(e,t){var r=jB(t.getAttribute("href")),n=UB(WI(t.getAttribute("title"))),i=n?' "'+n+'"':"";return"["+e+"]("+r+i+")"}};ss.referenceLink={filter:function filter(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function replacement(e,t,r){var n=jB(t.getAttribute("href")),i=WI(t.getAttribute("title"));i&&(i=' "'+UB(i)+'"');var o,a;switch(r.linkReferenceStyle){case"collapsed":o="["+e+"][]",a="["+e+"]: "+n+i;break;case"shortcut":o="["+e+"]",a="["+e+"]: "+n+i;break;default:var s=this.references.length+1;o="["+e+"]["+s+"]",a="["+s+"]: "+n+i}return this.references.push(a),o},references:[],append:function append(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}};ss.emphasis={filter:["em","i"],replacement:function replacement(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};ss.strong={filter:["strong","b"],replacement:function replacement(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};ss.code={filter:function filter(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function replacement(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};ss.image={filter:"img",replacement:function replacement(e,t){var r=aye(WI(t.getAttribute("alt"))),n=jB(t.getAttribute("src")||""),i=WI(t.getAttribute("title")),o=i?' "'+UB(i)+'"':"";return n?"":""}};function WI(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function jB(e){var t=e.replace(/([<>()])/g,"\\$1");return t.indexOf(" ")>=0?"<"+t+">":t}function UB(e){return e.replace(/"/g,'\\"')}function sye(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}sye.prototype={add:function add(e,t){this.array.unshift(t)},keep:function keep(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function remove(e){this._remove.unshift({filter:e,replacement:function replacement(){return""}})},forNode:function forNode(e){if(e.isBlank)return this.blankRule;var t;return(t=$B(this.array,e,this.options))||(t=$B(this._keep,e,this.options))||(t=$B(this._remove,e,this.options))?t:this.defaultRule},forEach:function forEach(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};function $B(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];if(vdt(i,t,r))return i}}function vdt(e,t,r){var n=e.filter;if(typeof n=="string"){if(n===t.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function _dt(e){var t=e.element,r=e.isBlock,n=e.isVoid,i=e.isPre||function(u){return u.nodeName==="PRE"};if(!(!t.firstChild||i(t))){for(var o=null,a=!1,s=null,l=Jxe(s,t,i);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!o||/ $/.test(o.data))&&!a&&c[0]===" "&&(c=c.substr(1)),!c){l=NB(l);continue}l.data=c,o=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(o&&(o.data=o.data.replace(/ $/,"")),o=null,a=!1):n(l)||i(l)?(o=null,a=!0):o&&(a=!1);else{l=NB(l);continue}var d=Jxe(s,l,i);s=l,l=d}o&&(o.data=o.data.replace(/ $/,""),o.data||NB(o))}}function NB(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Jxe(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var BB=typeof window!="undefined"?window:{};function bdt(){var e=BB.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch(r){}return t}function wdt(){var e=function e(){};return Sdt()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function Sdt(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){BB.ActiveXObject&&(e=!0)}return e}var kdt=bdt()?BB.DOMParser:wdt();function Cdt(e,t){var r;if(typeof e=="string"){var n=Edt().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return _dt({element:r,isBlock:FB,isVoid:nye,isPre:t.preformattedCode?Tdt:null}),r}var DB;function Edt(){return DB=DB||new kdt,DB}function Tdt(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Adt(e,t){return e.isBlock=FB(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Idt(e),e.flankingWhitespace=Pdt(e,t),e}function Idt(e){return!nye(e)&&!gdt(e)&&/^\s*$/i.test(e.textContent)&&!hdt(e)&&!xdt(e)}function Pdt(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Rdt(e.textContent);return r.leadingAscii&&Yxe("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&Yxe("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Rdt(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function Yxe(e,t,r){var n,i,o;return e==="left"?(n=t.previousSibling,i=/ $/):(n=t.nextSibling,i=/^ /),n&&(n.nodeType===3?o=i.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?o=!1:n.nodeType===1&&!FB(n)&&(o=i.test(n.textContent))),o}var Mdt=Array.prototype.reduce;function PS(e){if(!_instanceof(this,PS))return new PS(e);var t={rules:ss,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function blankReplacement(r,n){return n.isBlock?"\n\n":""},keepReplacement:function keepReplacement(r,n){return n.isBlock?"\n\n"+n.outerHTML+"\n\n":n.outerHTML},defaultReplacement:function defaultReplacement(r,n){return n.isBlock?"\n\n"+r+"\n\n":r}};this.options=fdt({},t,e),this.rules=new sye(this.options)}PS.prototype={turndown:function turndown(e){if(!Ndt(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=lye.call(this,new Cdt(e,this.options));return Odt.call(this,t)},use:function use1(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function addRule(e,t){return this.rules.add(e,t),this},keep:function keep(e){return this.rules.keep(e),this},remove:function remove(e){return this.rules.remove(e),this},escape:function escape1(e){return aye(e)}};function lye(e){var t=this;return Mdt.call(e.childNodes,function(r,n){n=new Adt(n,t.options);var i="";return n.nodeType===3?i=n.isCode?n.nodeValue:t.escape(n.nodeValue):n.nodeType===1&&(i=$dt.call(t,n)),uye(r,i)},"")}function Odt(e){var t=this;return this.rules.forEach(function(r){typeof r.append=="function"&&(e=uye(e,r.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function $dt(e){var t=this.rules.forNode(e),r=lye.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(r=r.trim()),n.leading+t.replacement(r,e,this.options)+n.trailing}function uye(e,t){var r=eye(e),n=Xxe(t),i=Math.max(e.length-r.length,t.length-n.length),o="\n\n".substring(0,i);return r+o+n}function Ndt(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var Ddt=Object.create,eV=Object.defineProperty,Ldt=Object.getOwnPropertyDescriptor,Fdt=Object.getOwnPropertyNames,zdt=Object.getPrototypeOf,jdt=Object.prototype.hasOwnProperty,Oh=function(e){return(typeof require==="undefined"?"undefined":_type_of(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":_type_of(Proxy))<"u"?new Proxy(e,{get:function(t,r){return((typeof require==="undefined"?"undefined":_type_of(require))<"u"?require:t)[r]}}):e}(function(e){if((typeof require==="undefined"?"undefined":_type_of(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),se=function(e,t){return function(){return e&&(t=e(e=0)),t}},U9=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},St=function(e,t){for(var r in t)eV(e,r,{get:t[r],enumerable:!0})},Udt=function(e,t,r,n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"||typeof t=="function")try{var _loop=function(){var i=_step.value;!jdt.call(e,i)&&i!==r&&eV(e,i,{get:function(){return t[i]},enumerable:!(n=Ldt(t,i))||n.enumerable})};for(var _iterator=Fdt(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return e},Pbe=function(e,t,r){return r=e!=null?Ddt(zdt(e)):{},Udt(t||!e||!e.__esModule?eV(r,"default",{value:e,enumerable:!0}):r,e)};function Bdt(){var e=[{prop:"Function",target:globalThis,violationType:"function_constructor",strategy:"throw",reason:"Function constructor allows arbitrary code execution"},{prop:"eval",target:globalThis,violationType:"eval",strategy:"throw",reason:"eval() allows arbitrary code execution"},{prop:"setTimeout",target:globalThis,violationType:"setTimeout",strategy:"throw",reason:"setTimeout with string argument allows code execution"},{prop:"setInterval",target:globalThis,violationType:"setInterval",strategy:"throw",reason:"setInterval with string argument allows code execution"},{prop:"setImmediate",target:globalThis,violationType:"setImmediate",strategy:"throw",reason:"setImmediate could be used to escape sandbox context"},{prop:"env",target:process,violationType:"process_env",strategy:"throw",reason:"process.env could leak sensitive environment variables",allowedKeys:new Set(["NODE_V8_COVERAGE","NODE_DEBUG","NODE_DEBUG_NATIVE","NODE_COMPILE_CACHE","WATCH_REPORT_DEPENDENCIES","FORCE_COLOR","DEBUG","UNDICI_NO_FG","JEST_WORKER_ID","__MINIMATCH_TESTING_PLATFORM__","LOG_TOKENS","LOG_STREAM"])},{prop:"binding",target:process,violationType:"process_binding",strategy:"throw",reason:"process.binding provides access to native Node.js modules"},{prop:"_linkedBinding",target:process,violationType:"process_binding",strategy:"throw",reason:"process._linkedBinding provides access to native Node.js modules"},{prop:"dlopen",target:process,violationType:"process_dlopen",strategy:"throw",reason:"process.dlopen allows loading native addons"},{prop:"getBuiltinModule",target:process,violationType:"process_get_builtin_module",strategy:"throw",reason:"process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)"},{prop:"exit",target:process,violationType:"process_exit",strategy:"throw",reason:"process.exit could terminate the interpreter"},{prop:"abort",target:process,violationType:"process_exit",strategy:"throw",reason:"process.abort could crash the interpreter"},{prop:"kill",target:process,violationType:"process_kill",strategy:"throw",reason:"process.kill could signal other processes"},{prop:"setuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setuid could escalate privileges"},{prop:"setgid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgid could escalate privileges"},{prop:"seteuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.seteuid could escalate effective user privileges"},{prop:"setegid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setegid could escalate effective group privileges"},{prop:"initgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.initgroups could modify supplementary group IDs"},{prop:"setgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgroups could modify supplementary group IDs"},{prop:"umask",target:process,violationType:"process_umask",strategy:"throw",reason:"process.umask could modify file creation permissions"},{prop:"argv",target:process,violationType:"process_argv",strategy:"throw",reason:"process.argv may contain secrets in CLI arguments"},{prop:"cwd",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.cwd could disclose real host working directory path"},{prop:"chdir",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.chdir could confuse the interpreter's CWD tracking"},{prop:"report",target:process,violationType:"process_report",strategy:"throw",reason:"process.report could disclose full environment, host paths, and system info"},{prop:"loadEnvFile",target:process,violationType:"process_env",strategy:"throw",reason:"process.loadEnvFile could load env files bypassing env proxy"},{prop:"setUncaughtExceptionCaptureCallback",target:process,violationType:"process_exception_handler",strategy:"throw",reason:"setUncaughtExceptionCaptureCallback could intercept security errors"},{prop:"send",target:process,violationType:"process_send",strategy:"throw",reason:"process.send could communicate with parent process in IPC contexts"},{prop:"channel",target:process,violationType:"process_channel",strategy:"throw",reason:"process.channel could access IPC channel to parent process"},{prop:"cpuUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.cpuUsage could enable timing side-channel attacks"},{prop:"memoryUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.memoryUsage could enable timing side-channel attacks"},{prop:"hrtime",target:process,violationType:"process_timing",strategy:"throw",reason:"process.hrtime could enable timing side-channel attacks"},{prop:"WeakRef",target:globalThis,violationType:"weak_ref",strategy:"throw",reason:"WeakRef could be used to leak references outside sandbox"},{prop:"FinalizationRegistry",target:globalThis,violationType:"finalization_registry",strategy:"throw",reason:"FinalizationRegistry could be used to leak references outside sandbox"},{prop:"Reflect",target:globalThis,violationType:"reflect",strategy:"freeze",reason:"Reflect provides introspection capabilities"},{prop:"Proxy",target:globalThis,violationType:"proxy",strategy:"throw",reason:"Proxy allows intercepting and modifying object behavior"},{prop:"WebAssembly",target:globalThis,violationType:"webassembly",strategy:"throw",reason:"WebAssembly allows executing arbitrary compiled code"},{prop:"SharedArrayBuffer",target:globalThis,violationType:"shared_array_buffer",strategy:"throw",reason:"SharedArrayBuffer could enable side-channel communication or timing attacks"},{prop:"Atomics",target:globalThis,violationType:"atomics",strategy:"throw",reason:"Atomics could enable side-channel communication or timing attacks"},{prop:"performance",target:globalThis,violationType:"performance_timing",strategy:"throw",reason:"performance.now() provides sub-millisecond timing for side-channel attacks"},{prop:"stdout",target:process,violationType:"process_stdout",strategy:"throw",reason:"process.stdout could bypass interpreter output to write to host stdout"},{prop:"stderr",target:process,violationType:"process_stderr",strategy:"throw",reason:"process.stderr could bypass interpreter output to write to host stderr"},{prop:"__defineGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineGetter__ allows prototype pollution via getter injection"},{prop:"__defineSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineSetter__ allows prototype pollution via setter injection"},{prop:"__lookupGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupGetter__ enables introspection for prototype pollution attacks"},{prop:"__lookupSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupSetter__ enables introspection for prototype pollution attacks"},{prop:"JSON",target:globalThis,violationType:"json_mutation",strategy:"freeze",reason:"Freeze JSON to prevent mutation of parsing/serialization"},{prop:"Math",target:globalThis,violationType:"math_mutation",strategy:"freeze",reason:"Freeze Math to prevent mutation of math utilities"}];try{var t=Object.getPrototypeOf(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor;t&&t!==Function&&e.push({prop:"constructor",target:Object.getPrototypeOf(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch(t){}try{var t10=Object.getPrototypeOf(function(){return _ts_generator(this,function(_state){return[2]})}).constructor;t10&&t10!==Function&&e.push({prop:"constructor",target:Object.getPrototypeOf(function(){return _ts_generator(this,function(_state){return[2]})}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch(t){}try{var t11=Object.getPrototypeOf(function(){return _wrap_async_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor;t11&&t11!==Function&&t11!==Object.getPrototypeOf(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor&&e.push({prop:"constructor",target:Object.getPrototypeOf(function(){return _wrap_async_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch(t){}return e.filter(function(t){try{return t.target[t.prop]!==void 0}catch(r){return!1}})}var qdt=se(function(){"use strict"});function cye(){return(typeof crypto==="undefined"?"undefined":_type_of(crypto))<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Wdt(e,t){for(var _len=arguments.length,r=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){r[_key-2]=arguments[_key]}return qt.run(e,function(){return t.apply(void 0,_to_consumable_array(r))})}function Vdt(e){return e===void 0?_object_spread_props(_object_spread({},o9),{enabled:!1}):typeof e=="boolean"?_object_spread_props(_object_spread({},o9),{enabled:e}):_object_spread({},o9,e)}var If,VI,dye,nn,qt,pye,o9,hp,td=se(function(){"use strict";var e;if(qdt(),If=!0,VI=null,!If)try{var _Oh=Oh("node:async_hooks"),t=_Oh.AsyncLocalStorage;VI=t}catch(t){}dye="\n\nThis is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com",nn=/*#__PURE__*/function(Error1){_inherits(nn1,Error1);function nn1(r,n){_class_call_check(this,nn1);var _this;_this=_call_super(this,nn1,[r+dye]);A(_this,"violation");_this.violation=n,_this.name="SecurityViolationError";return _this}return nn1}(_wrap_native_super(Error)),qt=!If&&VI?new VI:null,pye=1e3,o9={enabled:!0,auditMode:!1},hp=(e=/*#__PURE__*/function(){function e10(r){_class_call_check(this,e10);A(this,"config");A(this,"refCount",0);A(this,"patchFailures",[]);A(this,"activeExecutionIds",new Set);A(this,"contextCache",new Map);A(this,"originalDescriptors",[]);A(this,"violations",[]);A(this,"activationTime",0);A(this,"totalActiveTimeMs",0);this.config=r}_create_class(e10,[{key:"isExecutionIdActive",value:function isExecutionIdActive(r){return this.activeExecutionIds.has(r)}},{key:"getCachedContext",value:function getCachedContext(r){var n=this.contextCache.get(r);return n||(n={sandboxActive:!0,executionId:r},this.contextCache.set(r,n)),n}},{key:"getPreferredActiveExecutionId",value:function getPreferredActiveExecutionId(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(this.activeExecutionIds.size!==0)try{for(var _iterator=this.activeExecutionIds[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;return r}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"isEnabled",value:function isEnabled(){return this.config.enabled===!0&&qt!==null&&!If}},{key:"updateConfig",value:function updateConfig(r){this.config=_object_spread({},this.config,r)}},{key:"activate",value:function activate(){var _this=this;if(If||!this.config.enabled||!qt){var i=cye(),o=!1;return{run:function(a){return o?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):a()},deactivate:function(){o=!0},executionId:i}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());var r=cye(),n=!1;return{run:function(i){return n?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(_this.activeExecutionIds.add(r),qt.run({sandboxActive:!0,executionId:r},i))},deactivate:function(){n||(n=!0,_this.activeExecutionIds.delete(r),_this.contextCache.delete(r),_this.refCount--,_this.refCount===0&&(_this.restorePatches(),_this.totalActiveTimeMs+=Date.now()-_this.activationTime),_this.refCount<0&&(_this.refCount=0))},executionId:r}}},{key:"forceDeactivate",value:function forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}},{key:"isActive",value:function isActive(){return this.refCount>0}},{key:"getStats",value:function getStats(){return{violationsBlocked:this.violations.length,violations:_to_consumable_array(this.violations),activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}},{key:"getPatchFailures",value:function getPatchFailures(){return _to_consumable_array(this.patchFailures)}},{key:"clearViolations",value:function clearViolations(){this.violations=[]}},{key:"getPathForTarget",value:function getPathForTarget(r,n){return r===globalThis?"globalThis.".concat(n):r===process?"process.".concat(n):r===Error?"Error.".concat(n):r===Function.prototype?"Function.prototype.".concat(n):r===Object.prototype?"Object.prototype.".concat(n):"<object>.".concat(n)}},{key:"shouldBlock",value:function shouldBlock(){if(If||this.config.auditMode||!qt)return!1;var r=qt==null?void 0:qt.getStore();return!((r==null?void 0:r.sandboxActive)!==!0||r.trusted||e.isTrustedScopeActive(r.executionId))}},{key:"recordViolation",value:function recordViolation(r,n,i){var a;var o={timestamp:Date.now(),type:r,message:i,path:n,stack:new Error().stack,executionId:(a=qt==null?void 0:qt.getStore())==null?void 0:a.executionId};if(this.violations.length<pye&&this.violations.push(o),this.config.onViolation)try{this.config.onViolation(o)}catch(s){console.debug("[DefenseInDepthBox] onViolation callback threw:",_instanceof(s,Error)?s.message:s)}return o}},{key:"createBlockingProxy",value:function createBlockingProxy(r,n,i){var o=this;return new Proxy(r,{apply:function apply(a,s,l){var c;if(o.shouldBlock()){var d="".concat(n," is blocked during script execution"),u=o.recordViolation(i,n,d);throw new nn(d,u)}return o.config.auditMode&&((c=qt==null?void 0:qt.getStore())==null?void 0:c.sandboxActive)===!0&&o.recordViolation(i,n,"".concat(n," called (audit mode)")),Reflect.apply(a,s,l)},construct:function construct(a,s,l){var c;if(o.shouldBlock()){var d="".concat(n," constructor is blocked during script execution"),u=o.recordViolation(i,n,d);throw new nn(d,u)}return o.config.auditMode&&((c=qt==null?void 0:qt.getStore())==null?void 0:c.sandboxActive)===!0&&o.recordViolation(i,n,"".concat(n," constructor called (audit mode)")),Reflect.construct(a,s,l)}})}},{key:"createBlockingObjectProxy",value:function createBlockingObjectProxy(r,n,i,o){var a=this;return new Proxy(r,{get:function get1(s,l,c){var d;if(a.shouldBlock()){if(o&&typeof l=="string"&&o.has(l))return Reflect.get(s,l,c);var u="".concat(n,".").concat(String(l)),p="".concat(u," is blocked during script execution"),m=a.recordViolation(i,u,p);throw new nn(p,m)}if(a.config.auditMode&&((d=qt==null?void 0:qt.getStore())==null?void 0:d.sandboxActive)===!0){var u10="".concat(n,".").concat(String(l));a.recordViolation(i,u10,"".concat(u10," accessed (audit mode)"))}return Reflect.get(s,l,c)},set:function set1(s,l,c,d){if(a.shouldBlock()){var u="".concat(n,".").concat(String(l)),p="".concat(u," modification is blocked during script execution"),m=a.recordViolation(i,u,p);throw new nn(p,m)}return n==="process.env"&&l==="DEBUG"?Reflect.set(s,l,c):Reflect.set(s,l,c,d)},ownKeys:function ownKeys(s){if(a.shouldBlock()){var l="".concat(n," enumeration is blocked during script execution"),c=a.recordViolation(i,n,l);throw new nn(l,c)}return Reflect.ownKeys(s)},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(s,l){if(a.shouldBlock()){var c="".concat(n,".").concat(String(l)),d="".concat(c," descriptor access is blocked during script execution"),u=a.recordViolation(i,c,d);throw new nn(d,u)}return Reflect.getOwnPropertyDescriptor(s,l)},has:function has(s,l){if(a.shouldBlock()){var c="".concat(n,".").concat(String(l)),d="".concat(c," existence check is blocked during script execution"),u=a.recordViolation(i,c,d);throw new nn(d,u)}return Reflect.has(s,l)},deleteProperty:function deleteProperty(s,l){if(a.shouldBlock()){var c="".concat(n,".").concat(String(l)),d="".concat(c," deletion is blocked during script execution"),u=a.recordViolation(i,c,d);throw new nn(d,u)}return Reflect.deleteProperty(s,l)},setPrototypeOf:function setPrototypeOf(s,l){if(a.shouldBlock()){var c="".concat(n," setPrototypeOf is blocked during script execution"),d=a.recordViolation(i,n,c);throw new nn(c,d)}return Reflect.setPrototypeOf(s,l)},defineProperty:function defineProperty(s,l,c){if(a.shouldBlock()){var d="".concat(n,".").concat(String(l)),u="".concat(d," defineProperty is blocked during script execution"),p=a.recordViolation(i,d,u);throw new nn(u,p)}return Reflect.defineProperty(s,l,c)}})}},{key:"applyPatches",value:function applyPatches(){this.patchFailures=[];var r=Bdt(),n=new Set(["process_send","process_channel","process_stdout","process_stderr"]);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;n.has(a.violationType)||this.applyPatch(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.lockWellKnownSymbols(),this.protectProxyRevocable();var i=["Function.prototype.constructor","Module._load"],o=this.patchFailures.filter(function(a){return i.includes(a)});if(o.length>0)throw this.restorePatches(),new Error("DefenseInDepthBox: critical patches failed: ".concat(o.join(", ")))}},{key:"protectConstructorChain",value:function protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{var _$r=Object.getPrototypeOf(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor;_$r&&_$r!==Function&&this.patchPrototypeConstructor(_$r.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(r){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",_instanceof(r,Error)?r.message:r)}try{var _$r1=Object.getPrototypeOf(function(){return _ts_generator(this,function(_state){return[2]})}).constructor;_$r1&&_$r1!==Function&&this.patchPrototypeConstructor(_$r1.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(r){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",_instanceof(r,Error)?r.message:r)}try{var _$r2=Object.getPrototypeOf(function(){return _wrap_async_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor,n=Object.getPrototypeOf(function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}).constructor;_$r2&&_$r2!==Function&&_$r2!==n&&this.patchPrototypeConstructor(_$r2.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(r){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",_instanceof(r,Error)?r.message:r)}}},{key:"protectErrorPrepareStackTrace",value:function protectErrorPrepareStackTrace(){var r=this;try{var _$n=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:_$n});var i=_$n==null?void 0:_$n.value;Object.defineProperty(Error,"prepareStackTrace",{get:function get1(){return i},set:function set1(o){var a;if(r.shouldBlock()){var s="Error.prepareStackTrace modification is blocked during script execution",l=r.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",s);throw new nn(s,l)}r.config.auditMode&&((a=qt==null?void 0:qt.getStore())==null?void 0:a.sandboxActive)===!0&&r.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),i=o},configurable:!0})}catch(n){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",_instanceof(n,Error)?n.message:n)}}},{key:"protectPromiseThen",value:function protectPromiseThen(){var r=this;try{var _$i=function i(){var _this=this;for(var _len=arguments.length,s=new Array(_len),_key=0;_key<_len;_key++){s[_key]=arguments[_key]}return qt.run(this.captured,function(){if(!_this.box.isExecutionIdActive(_this.executionId)){if(_this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),_this.box.config.auditMode)return Reflect.apply(_this.cb,void 0,s);if(_this.kind==="fulfilled")return s[0];throw s[0]}return Reflect.apply(_this.cb,void 0,s)})};var n=_$i;var o=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:o});var a=o==null?void 0:o.value;if(typeof a!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function value(s,l){if(!qt)return Reflect.apply(a,this,[s,l]);var c=qt.getStore(),d=(c==null?void 0:c.sandboxActive)===!0&&c.trusted!==!0?c.executionId:void 0;if(!d)return Reflect.apply(a,this,[s,l]);var u=r.getCachedContext(d),p=function(m,h){return typeof m!="function"?m:_$i.bind({box:r,executionId:d,captured:u,cb:m,kind:h})};return Reflect.apply(a,this,[p(s,"fulfilled"),p(l,"rejected")])},writable:!0,configurable:!0})}catch(i){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",_instanceof(i,Error)?i.message:i)}}},{key:"patchPrototypeConstructor",value:function patchPrototypeConstructor(r,n,i){var o=this;try{var _$a=Object.getOwnPropertyDescriptor(r,"constructor");this.originalDescriptors.push({target:r,prop:"constructor",descriptor:_$a});var s=_$a==null?void 0:_$a.value;Object.defineProperty(r,"constructor",{get:function get1(){var l;if(o.shouldBlock()){var c="".concat(n," access is blocked during script execution"),d=o.recordViolation(i,n,c);throw new nn(c,d)}return o.config.auditMode&&((l=qt==null?void 0:qt.getStore())==null?void 0:l.sandboxActive)===!0&&o.recordViolation(i,n,"".concat(n," accessed (audit mode)")),s},set:function set1(l){if(o.shouldBlock()){var c="".concat(n," modification is blocked during script execution"),d=o.recordViolation(i,n,c);throw new nn(c,d)}Object.defineProperty(this,"constructor",{value:l,writable:!0,configurable:!0})},configurable:!0})}catch(a){this.patchFailures.push(n),console.debug("[DefenseInDepthBox] Could not patch ".concat(n,":"),_instanceof(a,Error)?a.message:a)}}},{key:"protectProcessMainModule",value:function protectProcessMainModule(){if((typeof process==="undefined"?"undefined":_type_of(process))>"u")return;var r=this;try{var _$n=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:_$n});var i=_$n==null?void 0:_$n.value;i!==void 0&&Object.defineProperty(process,"mainModule",{get:function get1(){var o;if(r.shouldBlock()){var a="process.mainModule access is blocked during script execution",s=r.recordViolation("process_main_module","process.mainModule",a);throw new nn(a,s)}return r.config.auditMode&&((o=qt==null?void 0:qt.getStore())==null?void 0:o.sandboxActive)===!0&&r.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),i},set:function set1(o){if(r.shouldBlock()){var a="process.mainModule modification is blocked during script execution",s=r.recordViolation("process_main_module","process.mainModule",a);throw new nn(a,s)}Object.defineProperty(process,"mainModule",{value:o,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",_instanceof(n,Error)?n.message:n)}}},{key:"protectProcessExecPath",value:function protectProcessExecPath(){var n;if((typeof process==="undefined"?"undefined":_type_of(process))>"u")return;var r=this;try{var _$i=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:_$i});var o=(n=_$i==null?void 0:_$i.value)!=null?n:process.execPath;Object.defineProperty(process,"execPath",{get:function get1(){var a;if(r.shouldBlock()){var s="process.execPath access is blocked during script execution",l=r.recordViolation("process_exec_path","process.execPath",s);throw new nn(s,l)}return r.config.auditMode&&((a=qt==null?void 0:qt.getStore())==null?void 0:a.sandboxActive)===!0&&r.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),o},set:function set1(a){if(r.shouldBlock()){var s="process.execPath modification is blocked during script execution",l=r.recordViolation("process_exec_path","process.execPath",s);throw new nn(s,l)}Object.defineProperty(process,"execPath",{value:a,writable:!0,configurable:!0})},configurable:!0})}catch(i){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",_instanceof(i,Error)?i.message:i)}}},{key:"lockWellKnownSymbols",value:function lockWellKnownSymbols(){var r=function(n,i){try{var o=Object.getOwnPropertyDescriptor(n,i);if(o!=null&&o.configurable){if("value"in o){Object.defineProperty(n,i,_object_spread_props(_object_spread({},o),{configurable:!1,writable:!1}));return}Object.defineProperty(n,i,_object_spread_props(_object_spread({},o),{configurable:!1}))}}catch(o){}};for(var _i1=0,_iter=[Array,Map,Set,RegExp,Promise];_i1<_iter.length;_i1++){var n=_iter[_i1];r(n,Symbol.species)}for(var _i2=0,_iter1=[Array.prototype,String.prototype,Map.prototype,Set.prototype];_i2<_iter1.length;_i2++){var n10=_iter1[_i2];r(n10,Symbol.iterator)}r(Symbol.prototype,Symbol.toPrimitive),r(Date.prototype,Symbol.toPrimitive);for(var _i3=0,_iter2=[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split];_i3<_iter2.length;_i3++){var n11=_iter2[_i3];r(RegExp.prototype,n11)}r(Function.prototype,Symbol.hasInstance),r(Array.prototype,Symbol.unscopables);for(var _i4=0,_iter3=[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype];_i4<_iter3.length;_i4++){var n12=_iter3[_i4];r(n12,Symbol.toStringTag)}try{var n13=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");this.originalDescriptors.push({target:Error,prop:"stackTraceLimit",descriptor:n13}),Object.defineProperty(Error,"stackTraceLimit",{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch(n){}}},{key:"protectProxyRevocable",value:function protectProxyRevocable(){var r=this;try{var _$n=Proxy.revocable;if(typeof _$n!="function")return;var i=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:i}),Object.defineProperty(Proxy,"revocable",{value:function value(o,a){var s;if(r.shouldBlock()){var l="Proxy.revocable is blocked during script execution",c=r.recordViolation("proxy","Proxy.revocable",l);throw new nn(l,c)}return r.config.auditMode&&((s=qt==null?void 0:qt.getStore())==null?void 0:s.sandboxActive)===!0&&r.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),_$n(o,a)},writable:!1,configurable:!0})}catch(n){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",_instanceof(n,Error)?n.message:n)}}},{key:"protectDynamicImport",value:function protectDynamicImport(){var r;if(!(If||e.importHooksRegistered))try{var _$n=this,i=Oh("node:module"),o=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=((r=i.builtinModules)!=null?r:[])[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=l.startsWith("node:")?l.slice(5):l;o.add(c);var d=c.indexOf("/");d>0&&o.add(c.slice(0,d))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var a=function(l){if(l.startsWith("./")||l.startsWith("../")||l.startsWith("/")||l.startsWith("file:")||l.startsWith("data:")||l.startsWith("blob:")||l.startsWith("http:")||l.startsWith("https:"))return!1;var c=l.startsWith("node:")?l.slice(5):l;if(!c)return!1;if(typeof i.isBuiltin=="function"&&i.isBuiltin(c)||o.has(c))return!0;var d=c.indexOf("/");return d>0&&o.has(c.slice(0,d))},s=function(){var l=qt==null?void 0:qt.getStore();return _$n.config.auditMode===!0&&(l==null?void 0:l.sandboxActive)===!0&&l.trusted!==!0&&!e.isTrustedScopeActive(l.executionId)};if(typeof i.registerHooks=="function"){i.registerHooks({resolve:function resolve(l,c,d){if(l.startsWith("data:")||l.startsWith("blob:"))throw new Error("dynamic import of ".concat(l.startsWith("data:")?"data:":"blob:"," URLs is blocked by defense-in-depth"));if(a(l)){var u="import(".concat(l,")"),p="dynamic import of Node.js builtin '".concat(l,"' is blocked during script execution");if(_$n.shouldBlock()){var m=_$n.recordViolation("dynamic_import_builtin",u,p);throw new nn(p,m)}s()&&_$n.recordViolation("dynamic_import_builtin",u,"dynamic import of Node.js builtin '".concat(l,"' called (audit mode)"))}return d(l,c)}}),e.importHooksRegistered=!0;return}if(typeof i.register=="function"){var l10=["export async function resolve(specifier, context, nextResolve) {",' if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {',' throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");'," }"," return nextResolve(specifier, context);","}"].join("\n");i.register("data:text/javascript,".concat(encodeURIComponent(l10))),e.importHooksRegistered=!0}}catch(n){console.debug("[DefenseInDepthBox] Could not register import() hooks:",_instanceof(n,Error)?n.message:n)}}},{key:"protectModuleLoad",value:function protectModuleLoad(){if(!If)try{var _$r=null;if((typeof process==="undefined"?"undefined":_type_of(process))<"u"){var a=process.mainModule;a&&(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&(_$r=a.constructor)}if(!_$r&&(typeof Oh==="undefined"?"undefined":_type_of(Oh))<"u"&&_type_of(Oh.main)<"u"&&(_$r=Oh.main.constructor),!_$r||typeof _$r._load!="function")return;var n=_$r._load,i=Object.getOwnPropertyDescriptor(_$r,"_load");this.originalDescriptors.push({target:_$r,prop:"_load",descriptor:i});var o=this.createBlockingProxy(n,"Module._load","module_load");Object.defineProperty(_$r,"_load",{value:o,writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Module._load"),console.debug("[DefenseInDepthBox] Could not protect Module._load:",_instanceof(r,Error)?r.message:r)}}},{key:"protectModuleResolveFilename",value:function protectModuleResolveFilename(){if(!If)try{var _$r=null;if((typeof process==="undefined"?"undefined":_type_of(process))<"u"){var a=process.mainModule;a&&(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&(_$r=a.constructor)}if(!_$r&&(typeof Oh==="undefined"?"undefined":_type_of(Oh))<"u"&&_type_of(Oh.main)<"u"&&(_$r=Oh.main.constructor),!_$r||typeof _$r._resolveFilename!="function")return;var n=_$r._resolveFilename,i=Object.getOwnPropertyDescriptor(_$r,"_resolveFilename");this.originalDescriptors.push({target:_$r,prop:"_resolveFilename",descriptor:i});var o=this.createBlockingProxy(n,"Module._resolveFilename","module_resolve_filename");Object.defineProperty(_$r,"_resolveFilename",{value:o,writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Module._resolveFilename"),console.debug("[DefenseInDepthBox] Could not protect Module._resolveFilename:",_instanceof(r,Error)?r.message:r)}}},{key:"applyPatch",value:function applyPatch(r){var n=r.target,i=r.prop,o=r.violationType,a=r.strategy;try{var _$s=n[i];if(_$s===void 0)return;var l=Object.getOwnPropertyDescriptor(n,i);if(this.originalDescriptors.push({target:n,prop:i,descriptor:l}),a==="freeze")(typeof _$s==="undefined"?"undefined":_type_of(_$s))=="object"&&_$s!==null&&Object.freeze(_$s);else{var c=this.getPathForTarget(n,i),d=typeof _$s=="function"?this.createBlockingProxy(_$s,c,o):this.createBlockingObjectProxy(_$s,c,o,r.allowedKeys);Object.defineProperty(n,i,{value:d,writable:!0,configurable:!0})}}catch(s){var l10=this.getPathForTarget(n,i);this.patchFailures.push(l10),console.debug("[DefenseInDepthBox] Could not patch ".concat(l10,":"),_instanceof(s,Error)?s.message:s)}}},{key:"restorePatches",value:function restorePatches(){for(var r=this.originalDescriptors.length-1;r>=0;r--){var _this_originalDescriptors_r=this.originalDescriptors[r],n=_this_originalDescriptors_r.target,i=_this_originalDescriptors_r.prop,o=_this_originalDescriptors_r.descriptor;try{o?Object.defineProperty(n,i,o):delete n[i]}catch(a){var s=this.getPathForTarget(n,i);console.debug("[DefenseInDepthBox] Could not restore ".concat(s,":"),_instanceof(a,Error)?a.message:a)}}this.originalDescriptors=[]}}],[{key:"getInstance",value:function getInstance(r){var n=Vdt(r);if(!e.instance)e.instance=new e(n);else{var i=e.instance.config;if(n.enabled!==i.enabled||n.auditMode!==i.auditMode)throw new Error("DefenseInDepthBox config conflict: requested {enabled: ".concat(n.enabled,", auditMode: ").concat(n.auditMode,"} but singleton already has {enabled: ").concat(i.enabled,", auditMode: ").concat(i.auditMode,"}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations."))}return e.instance}},{key:"resetInstance",value:function resetInstance(){e.instance&&(e.instance.forceDeactivate(),e.instance=null),e.trustedExecutionDepth.clear()}},{key:"isInSandboxedContext",value:function isInSandboxedContext(){var r;return qt?((r=qt==null?void 0:qt.getStore())==null?void 0:r.sandboxActive)===!0:!1}},{key:"getCurrentExecutionId",value:function getCurrentExecutionId(){var r;if(qt)return(r=qt==null?void 0:qt.getStore())==null?void 0:r.executionId}},{key:"enterTrustedScope",value:function enterTrustedScope(r){var i;var n=(i=e.trustedExecutionDepth.get(r))!=null?i:0;e.trustedExecutionDepth.set(r,n+1)}},{key:"leaveTrustedScope",value:function leaveTrustedScope(r){var n=e.trustedExecutionDepth.get(r);if(n){if(n===1){e.trustedExecutionDepth.delete(r);return}e.trustedExecutionDepth.set(r,n-1)}}},{key:"isTrustedScopeActive",value:function isTrustedScopeActive(r){var n;return r?((n=e.trustedExecutionDepth.get(r))!=null?n:0)>0:!1}},{key:"bindCurrentContext",value:function bindCurrentContext(r){var s;if(!qt)return r;var n=e.instance,i=qt.getStore(),o=(i==null?void 0:i.sandboxActive)===!0?i.executionId:n==null?void 0:n.getPreferredActiveExecutionId();if(!o)return r;var a=(s=n==null?void 0:n.getCachedContext(o))!=null?s:{sandboxActive:!0,executionId:o};return function(){for(var _len=arguments.length,l=new Array(_len),_key=0;_key<_len;_key++){l[_key]=arguments[_key]}var c=e.instance;if(!(c&&!c.isExecutionIdActive(o)&&(c.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!c.config.auditMode)))return Wdt.apply(void 0,[a,r].concat(_to_consumable_array(l)))}}},{key:"runTrusted",value:function runTrusted(r){if(!qt)return r();var n=qt.getStore();if(!n)return r();var i=n.executionId;return qt.run(_object_spread_props(_object_spread({},n),{trusted:!0}),function(){e.enterTrustedScope(i);try{var _$o=r();return(typeof _$o==="undefined"?"undefined":_type_of(_$o))=="object"&&_$o!==null&&"finally"in _$o&&typeof _$o.finally=="function"?_$o.finally(function(){e.leaveTrustedScope(i)}):(e.leaveTrustedScope(i),_$o)}catch(o){throw e.leaveTrustedScope(i),o}})}},{key:"runTrustedAsync",value:function runTrustedAsync(r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){if(!qt)return[2,r()];n=qt.getStore();if(!n)return[2,r()];i=n.executionId;return[2,qt.run(_object_spread_props(_object_spread({},n),{trusted:!0}),function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:e.enterTrustedScope(i);_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,r()];case 2:return[2,_state.sent()];case 3:e.leaveTrustedScope(i);return[7];case 4:return[2]}})})()})]})})()}}]);return e10}(),A(e,"instance",null),A(e,"importHooksRegistered",!1),A(e,"trustedExecutionDepth",new Map),e)});function Gdt(e){return typeof e!="function"?e:hp.bindCurrentContext(e)}var fye,mye,Hdt,Zdt,KS,B9,q9=se(function(){"use strict";td(),fye=globalThis.setTimeout.bind(globalThis),mye=globalThis.clearTimeout.bind(globalThis),Hdt=globalThis.setInterval.bind(globalThis),Zdt=globalThis.clearInterval.bind(globalThis),KS=function(e,t){for(var _len=arguments.length,r=new Array(_len>2?_len-2:0),_key=2;_key<_len;_key++){r[_key-2]=arguments[_key]}return fye.apply(void 0,[Gdt(e),t].concat(_to_consumable_array(r)))},B9=mye}),Rbe={};St(Rbe,{echoCommand:function(){return Mbe},flagsForFuzzing:function(){return Obe}});function Kdt(e){var t="",r=0;for(;r<e.length;)if(e[r]==="\\"){if(r+1>=e.length){t+="\\";break}var n=e[r+1];switch(n){case"\\":t+="\\",r+=2;break;case"n":t+="\n",r+=2;break;case"t":t+=" ",r+=2;break;case"r":t+="\r",r+=2;break;case"a":t+="\x07",r+=2;break;case"b":t+="\b",r+=2;break;case"f":t+="\f",r+=2;break;case"v":t+="\v",r+=2;break;case"e":case"E":t+="\x1b",r+=2;break;case"c":return{output:t,stop:!0};case"0":{var i="",o=r+2;for(;o<e.length&&o<r+5&&/[0-7]/.test(e[o]);)i+=e[o],o++;if(i.length===0)t+="\0";else{var a=parseInt(i,8)%256;t+=String.fromCharCode(a)}r=o;break}case"x":{var i10="",o10=r+2;for(;o10<e.length&&o10<r+4&&/[0-9a-fA-F]/.test(e[o10]);)i10+=e[o10],o10++;if(i10.length===0)t+="\\x",r+=2;else{var a9=parseInt(i10,16);t+=String.fromCharCode(a9),r=o10}break}case"u":{var i11="",o11=r+2;for(;o11<e.length&&o11<r+6&&/[0-9a-fA-F]/.test(e[o11]);)i11+=e[o11],o11++;if(i11.length===0)t+="\\u",r+=2;else{var a10=parseInt(i11,16);t+=String.fromCodePoint(a10),r=o11}break}case"U":{var i12="",o12=r+2;for(;o12<e.length&&o12<r+10&&/[0-9a-fA-F]/.test(e[o12]);)i12+=e[o12],o12++;if(i12.length===0)t+="\\U",r+=2;else{var a11=parseInt(i12,16);try{t+=String.fromCodePoint(a11)}catch(s){t+="\\U".concat(i12)}r=o12}break}default:t+="\\".concat(n),r+=2}}else t+=e[r],r++;return{output:t,stop:!1}}var Mbe,Obe,Qdt=se(function(){"use strict";Mbe={name:"echo",execute:function execute(e,t){return _async_to_generator(function(){var a,r,n,i,s,o,s10;return _ts_generator(this,function(_state){r=!1,n=(a=t.xpgEcho)!=null?a:!1,i=0;for(;i<e.length;){s=e[i];if(s==="-n")r=!0,i++;else if(s==="-e")n=!0,i++;else if(s==="-E")n=!1,i++;else if(s==="-ne"||s==="-en")r=!0,n=!0,i++;else break}o=e.slice(i).join(" ");if(n){s10=Kdt(o);if(o=s10.output,s10.stop)return[2,{stdout:o,stderr:"",exitCode:0}]}return[2,(r||(o+="\n"),{stdout:o,stderr:"",exitCode:0})]})})()}},Obe={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0}});function Sn(e){var t=e;if(!t)return t;var r=!1;for(var i=0;i<t.length;i++){var o=t.charCodeAt(i);if(o>255)return t;o>127&&(r=!0)}if(!r)return t;var n=new Uint8Array(t.length);for(var i10=0;i10<t.length;i10++)n[i10]=t.charCodeAt(i10);try{return Nbe.decode(n)}catch(i){return t}}function n1(e){if(!e)return e;var t=Dbe.encode(e),r="";for(var n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r}function Jdt(e){var t="";for(var r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}function p_(e,t){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(typeof e.readFileBytes=="function"))return[3,1];_tmp=e.readFileBytes(t);return[3,3];case 1:return[4,e.readFileBuffer(t)];case 2:_tmp=Jdt.apply(void 0,[_state.sent()]);_state.label=3;case 3:return[2,_tmp]}})})()}function $be(e){return e.stdoutKind?e.stdoutKind:e.stdoutEncoding==="binary"?"bytes":"text"}function hye(e){return $be(e)==="bytes"?e.stdout:n1(e.stdout)}function gye(e){return $be(e)==="bytes"?Sn(e.stdout):e.stdout}var Nbe,Dbe,Lbe,kr=se(function(){"use strict";Nbe=new TextDecoder("utf-8",{fatal:!0}),Dbe=new TextEncoder,Lbe=""});function Wt(e){var t="".concat(e.name," - ").concat(e.summary,"\n\n");if(t+="Usage: ".concat(e.usage,"\n"),e.description){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(t+="\nDescription:\n",typeof e.description=="string")try{for(var _iterator=e.description.split("\n")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t+=r?" ".concat(r,"\n"):"\n"}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else if(e.description.length>0)try{for(var _iterator1=e.description[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r10=_step1.value;t+=r10?" ".concat(r10,"\n"):"\n"}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}if(e.options&&e.options.length>0){t+="\nOptions:\n";var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=e.options[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var r11=_step2.value;t+=" ".concat(r11,"\n")}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}if(e.examples&&e.examples.length>0){t+="\nExamples:\n";var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=e.examples[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var r12=_step3.value;t+=" ".concat(r12,"\n")}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}if(e.notes&&e.notes.length>0){t+="\nNotes:\n";var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=e.notes[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var r13=_step4.value;t+=" ".concat(r13,"\n")}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}return{stdout:t,stderr:"",exitCode:0}}function Vt(e){return e.includes("--help")}function fr(e,t){return{stdout:"",stderr:t.startsWith("--")?"".concat(e,": unrecognized option '").concat(t,"'\n"):"".concat(e,": invalid option -- '").concat(t.replace(/^-/,""),"'\n"),exitCode:1}}var jt=se(function(){"use strict"});function Fo(e,t,r){var n=new Map,i=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(r)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),l=_step_value[0],c=_step_value[1];var d={name:l,type:c.type};c.short&&n.set(c.short,d),c.long&&i.set(c.long,d)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var o=Object.create(null);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries(r)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,2),l10=_step_value1[0],c10=_step_value1[1];c10.default!==void 0?o[l10]=c10.default:c10.type==="boolean"&&(o[l10]=!1)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var a=[],s=!1;for(var l11=0;l11<t.length;l11++){var c11=t[l11];if(s||!c11.startsWith("-")||c11==="-"){a.push(c11);continue}if(c11==="--"){s=!0;continue}if(c11.startsWith("--")){var d10=c11.indexOf("="),u=void 0,p=void 0;d10!==-1?(u=c11.slice(2,d10),p=c11.slice(d10+1)):u=c11.slice(2);var m=i.get(u);if(!m)return{ok:!1,error:fr(e,c11)};var h=m.name,g=m.type;if(g==="boolean")o[h]=!0;else{if(p===void 0){if(l11+1>=t.length)return{ok:!1,error:{stdout:"",stderr:"".concat(e,": option '--").concat(u,"' requires an argument\n"),exitCode:1}};p=t[++l11]}o[h]=g==="number"?parseInt(p,10):p}}else{var d11=c11.slice(1);for(var u10=0;u10<d11.length;u10++){var p10=d11[u10],m10=n.get(p10);if(!m10)return{ok:!1,error:fr(e,"-".concat(p10))};var h10=m10.name,g10=m10.type;if(g10==="boolean")o[h10]=!0;else{var x=void 0;if(u10+1<d11.length)x=d11.slice(u10+1);else if(l11+1<t.length)x=t[++l11];else return{ok:!1,error:{stdout:"",stderr:"".concat(e,": option requires an argument -- '").concat(p10,"'\n"),exitCode:1}};o[h10]=g10==="number"?parseInt(x,10):x;break}}}}return{ok:!0,result:{flags:o,positional:a}}}var zo=se(function(){"use strict";jt()}),n5=se(function(){"use strict"});function W9(e,t,r){return _async_to_generator(function(){var n,tmp,i,tmp1,o,tmp2,a,s,l,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r.cmdName,tmp=r.allowStdinMarker,i=tmp===void 0?!0:tmp,tmp1=r.stopOnError,o=tmp1===void 0?!1:tmp1,tmp2=r.batchSize,a=tmp2===void 0?100:tmp2;if(t.length===0)return[2,{files:[{filename:"",content:e.stdin}],stderr:"",exitCode:0}];s=[],l="",c=0;d=0;_state.label=1;case 1:if(!(d<t.length))return[3,4];u=t.slice(d,d+a);return[4,Promise.all(u.map(function(m){return _async_to_generator(function(){var h,g,h10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(i&&m==="-")return[2,{filename:"-",content:e.stdin,error:null}];_state.label=1;case 1:_state.trys.push([1,3,,4]);h=e.fs.resolvePath(e.cwd,m);return[4,p_(e.fs,h)];case 2:g=_state.sent();return[2,{filename:m,content:g,error:null}];case 3:h10=_state.sent();return[2,{filename:m,content:Lbe,error:"".concat(n,": ").concat(m,": No such file or directory\n")}];case 4:return[2]}})})()}))];case 2:p=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=p[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){m=_step.value;if(m.error){if(l+=m.error,c=1,o)return[2,{files:s,stderr:l,exitCode:c}]}else s.push({filename:m.filename,content:m.content})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=3;case 3:d+=a;return[3,1];case 4:return[2,{files:s,stderr:l,exitCode:c}]}})})()}function tV(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,W9(e,t,_object_spread_props(_object_spread({},r),{stopOnError:!0}))];case 1:n=_state.sent();return[2,n.exitCode!==0?{ok:!1,error:{stdout:"",stderr:n.stderr,exitCode:n.exitCode}}:{ok:!0,content:n.files.map(function(i){return i.content}).join("")}]}})})()}var f_=se(function(){"use strict";kr(),n5()}),Fbe={};St(Fbe,{catCommand:function(){return zbe},flagsForFuzzing:function(){return jbe}});function Ydt(e,t){var r=e.split("\n"),n=e.endsWith("\n"),i=n?r.slice(0,-1):r;return{content:i.map(function(o,a){return"".concat(String(t+a).padStart(6," ")," ").concat(o)}).join("\n")+(n?"\n":""),nextLineNumber:t+i.length}}var xye,yye,zbe,jbe,Xdt=se(function(){"use strict";kr(),zo(),f_(),jt(),xye={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},yye={number:{short:"n",long:"number",type:"boolean"}},zbe={name:"cat",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(xye)];r=Fo("cat",e,yye);if(!r.ok)return[2,r.error];n=r.result.flags.number,i=r.result.positional;return[4,W9(t,i,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1})];case 1:o=_state.sent(),a="",s=1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=o.files[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_step.value,l=_step_value.content;c=l;if(n){d=Ydt(c,s);a+=d.content,s=d.nextLineNumber}else a+=c}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:a,stderr:o.stderr,exitCode:o.exitCode,stdoutEncoding:"binary"}]}})})()}},jbe={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0}});function Ube(e){return _instanceof(e,Nf)||_instanceof(e,Df)||_instanceof(e,Lf)}var Ps,Nf,Df,Lf,qh,Kc,Ci,Hi,$f,i5,rV,Qt,nV,o5,Of,jr=se(function(){"use strict";var e;Ps=/*#__PURE__*/function(Error1){_inherits(Ps1,Error1);function Ps1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Ps1);var _this;_this=_call_super(this,Ps1,[r]);A(_this,"stdout");A(_this,"stderr");_this.stdout=n,_this.stderr=i;return _this}_create_class(Ps1,[{key:"prependOutput",value:function prependOutput(r,n){this.stdout=r+this.stdout,this.stderr=n+this.stderr}}]);return Ps1}(_wrap_native_super(Error)),Nf=/*#__PURE__*/function(Ps1){_inherits(Nf1,Ps1);function Nf1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Nf1);var _this;_this=_call_super(this,Nf1,["break",n,i]);A(_this,"levels");A(_this,"name","BreakError");_this.levels=r;return _this}return Nf1}(Ps),Df=/*#__PURE__*/function(Ps1){_inherits(Df1,Ps1);function Df1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Df1);var _this;_this=_call_super(this,Df1,["continue",n,i]);A(_this,"levels");A(_this,"name","ContinueError");_this.levels=r;return _this}return Df1}(Ps),Lf=/*#__PURE__*/function(Ps1){_inherits(Lf1,Ps1);function Lf1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Lf1);var _this;_this=_call_super(this,Lf1,["return",n,i]);A(_this,"exitCode");A(_this,"name","ReturnError");_this.exitCode=r;return _this}return Lf1}(Ps),qh=/*#__PURE__*/function(Ps1){_inherits(qh1,Ps1);function qh1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,qh1);var _this;_this=_call_super(this,qh1,["errexit: command exited with status ".concat(r),n,i]);A(_this,"exitCode");A(_this,"name","ErrexitError");_this.exitCode=r;return _this}return qh1}(Ps),Kc=/*#__PURE__*/function(Ps1){_inherits(Kc1,Ps1);function Kc1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";_class_call_check(this,Kc1);var _this;_this=_call_super(this,Kc1,["".concat(r,": unbound variable"),n,"bash: ".concat(r,": unbound variable\n")]);A(_this,"varName");A(_this,"name","NounsetError");_this.varName=r;return _this}return Kc1}(Ps),Ci=/*#__PURE__*/function(Ps1){_inherits(Ci1,Ps1);function Ci1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Ci1);var _this;_this=_call_super(this,Ci1,["exit",n,i]);A(_this,"exitCode");A(_this,"name","ExitError");_this.exitCode=r;return _this}return Ci1}(Ps),Hi=/*#__PURE__*/function(Ps1){_inherits(Hi1,Ps1);function Hi1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;_class_call_check(this,Hi1);var _this;_this=_call_super(this,Hi1,[r,n,i]);A(_this,"name","ArithmeticError");A(_this,"fatal");_this.stderr=i||"bash: ".concat(r,"\n"),_this.fatal=o;return _this}return Hi1}(Ps),$f=/*#__PURE__*/function(Ps1){_inherits($f1,Ps1);function $f1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,$f1);var _this;_this=_call_super(this,$f1,[r,n,i]);A(_this,"name","BadSubstitutionError");_this.stderr=i||"bash: ".concat(r,": bad substitution\n");return _this}return $f1}(Ps),i5=/*#__PURE__*/function(Ps1){_inherits(i51,Ps1);function i51(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,i51);var _this;_this=_call_super(this,i51,["no match: ".concat(r),n,i]);A(_this,"name","GlobError");_this.stderr=i||"bash: no match: ".concat(r,"\n");return _this}return i51}(Ps),rV=/*#__PURE__*/function(Ps1){_inherits(rV1,Ps1);function rV1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,rV1);var _this;_this=_call_super(this,rV1,[r,n,i]);A(_this,"name","BraceExpansionError");_this.stderr=i||"bash: ".concat(r,"\n");return _this}return rV1}(Ps),Qt=(e=/*#__PURE__*/function(Ps1){_inherits(e,Ps1);function e(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";_class_call_check(this,e);var _this;_this=_call_super(this,e,[r,i,o]);A(_this,"limitType");A(_this,"name","ExecutionLimitError");_this.limitType=n,_this.stderr=o||"bash: ".concat(r,"\n");return _this}return e}(Ps),A(e,"EXIT_CODE",126),e),nV=/*#__PURE__*/function(Ps1){_inherits(nV1,Ps1);function nV1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";_class_call_check(this,nV1);var _this;_this=_call_super(this,nV1,["execution aborted",r,n]);A(_this,"name","ExecutionAbortedError");return _this}return nV1}(Ps),o5=/*#__PURE__*/function(Ps1){_inherits(o51,Ps1);function o51(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";_class_call_check(this,o51);var _this;_this=_call_super(this,o51,["subshell exit",r,n]);A(_this,"name","SubshellExitError");return _this}return o51}(Ps),Of=/*#__PURE__*/function(Ps1){_inherits(Of1,Ps1);function Of1(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";_class_call_check(this,Of1);var _this;_this=_call_super(this,Of1,["posix fatal error",n,i]);A(_this,"exitCode");A(_this,"name","PosixFatalError");_this.exitCode=r;return _this}return Of1}(Ps)});function cu(e){return _instanceof(e,Error)?e.message:String(e)}var ic=se(function(){"use strict"});function Bbe(e,t,r){var n=e;r>=0&&n.length>r&&(n=n.slice(0,r));var i=Math.abs(t);return i>n.length&&(t<0?n=n.padEnd(i," "):n=n.padStart(i," ")),n}function ept(e,t){var r=t,n=0,i=-1,o=!1;for(r<e.length&&e[r]==="-"&&(o=!0,r++);r<e.length&&/\d/.test(e[r]);)n=n*10+parseInt(e[r],10),r++;if(r<e.length&&e[r]===".")for(r++,i=0;r<e.length&&/\d/.test(e[r]);)i=i*10+parseInt(e[r],10),r++;return o&&n>0&&(n=-n),[n,i,r-t]}function qbe(e){var t="",r=0;for(;r<e.length;)if(e[r]==="\\"&&r+1<e.length)switch(e[r+1]){case"n":t+="\n",r+=2;break;case"t":t+=" ",r+=2;break;case"r":t+="\r",r+=2;break;case"\\":t+="\\",r+=2;break;case"a":t+="\x07",r+=2;break;case"b":t+="\b",r+=2;break;case"f":t+="\f",r+=2;break;case"v":t+="\v",r+=2;break;case"e":case"E":t+="\x1b",r+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{var n="",i=r+1;for(;i<e.length&&i<r+4&&/[0-7]/.test(e[i]);)n+=e[i],i++;t+=String.fromCharCode(parseInt(n,8)),r=i;break}case"x":{var n10=[],i10=r;for(;i10+3<e.length&&e[i10]==="\\"&&e[i10+1]==="x"&&/[0-9a-fA-F]{2}/.test(e.slice(i10+2,i10+4));)n10.push(parseInt(e.slice(i10+2,i10+4),16)),i10+=4;if(n10.length>0){try{var o=new TextDecoder("utf-8",{fatal:!0});t+=o.decode(new Uint8Array(n10))}catch(o){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n10[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;t+=String.fromCharCode(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}r=i10}else t+=e[r],r++;break}case"u":{var n11="",i11=r+2;for(;i11<e.length&&i11<r+6&&/[0-9a-fA-F]/.test(e[i11]);)n11+=e[i11],i11++;n11?(t+=String.fromCodePoint(parseInt(n11,16)),r=i11):(t+="\\u",r+=2);break}case"U":{var n12="",i12=r+2;for(;i12<e.length&&i12<r+10&&/[0-9a-fA-F]/.test(e[i12]);)n12+=e[i12],i12++;n12?(t+=String.fromCodePoint(parseInt(n12,16)),r=i12):(t+="\\U",r+=2);break}default:t+=e[r],r++}else t+=e[r],r++;return t}var Wbe=se(function(){"use strict"});function jS(e,t,r){var n=new Date(t*1e3),i="",o=0;for(;o<e.length;)if(e[o]==="%"&&o+1<e.length){var a=e[o+1],s=rpt(n,a,r);s!==null?(i+=s,o+=2):(i+=e[o],o++)}else i+=e[o],o++;return i}function tpt(e,t){var n;var r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:t};try{var i=new Intl.DateTimeFormat("en-US",r).formatToParts(e),o=function(c){var d,u;return(u=(d=i.find(function(p){return p.type===c}))==null?void 0:d.value)!=null?u:""},a=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),s=o("weekday"),l=function(c,d){var u=Number.parseInt(c,10);return Number.isNaN(u)?d:u};return{year:l(o("year"),e.getFullYear()),month:l(o("month"),e.getMonth()+1),day:l(o("day"),e.getDate()),hour:l(o("hour"),e.getHours())%24,minute:l(o("minute"),e.getMinutes()),second:l(o("second"),e.getSeconds()),weekday:(n=a.get(s))!=null?n:e.getDay()}}catch(i){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),weekday:e.getDay()}}}function rpt(e,t,r){var n=tpt(e,r),i=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(l).padStart(c,"0")},o=Vbe(n.year,n.month,n.day),a=vye(n.year,n.month,n.day,n.weekday,0),s=vye(n.year,n.month,n.day,n.weekday,1);switch(t){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][n.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][n.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][n.month-1];case"c":return"".concat(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][n.weekday]," ").concat(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.month-1]," ").concat(String(n.day).padStart(2," ")," ").concat(i(n.hour),":").concat(i(n.minute),":").concat(i(n.second)," ").concat(n.year);case"C":return i(Math.floor(n.year/100));case"d":return i(n.day);case"D":return"".concat(i(n.month),"/").concat(i(n.day),"/").concat(i(n.year%100));case"e":return String(n.day).padStart(2," ");case"F":return"".concat(n.year,"-").concat(i(n.month),"-").concat(i(n.day));case"g":return i(_ye(n.year,n.month,n.day)%100);case"G":return String(_ye(n.year,n.month,n.day));case"H":return i(n.hour);case"I":return i(n.hour%12||12);case"j":return String(o).padStart(3,"0");case"k":return String(n.hour).padStart(2," ");case"l":return String(n.hour%12||12).padStart(2," ");case"m":return i(n.month);case"M":return i(n.minute);case"n":return"\n";case"N":return"000000000";case"p":return n.hour<12?"AM":"PM";case"P":return n.hour<12?"am":"pm";case"r":return"".concat(i(n.hour%12||12),":").concat(i(n.minute),":").concat(i(n.second)," ").concat(n.hour<12?"AM":"PM");case"R":return"".concat(i(n.hour),":").concat(i(n.minute));case"s":return String(Math.floor(e.getTime()/1e3));case"S":return i(n.second);case"t":return" ";case"T":return"".concat(i(n.hour),":").concat(i(n.minute),":").concat(i(n.second));case"u":return String(n.weekday===0?7:n.weekday);case"U":return i(a);case"V":return i(opt(n.year,n.month,n.day));case"w":return String(n.weekday);case"W":return i(s);case"x":return"".concat(i(n.month),"/").concat(i(n.day),"/").concat(i(n.year%100));case"X":return"".concat(i(n.hour),":").concat(i(n.minute),":").concat(i(n.second));case"y":return i(n.year%100);case"Y":return String(n.year);case"z":return npt(e,r);case"Z":return ipt(e,r);case"%":return"%";default:return null}}function npt(e,t){if(!t){var a=-e.getTimezoneOffset(),s=a>=0?"+":"-",l=Math.floor(Math.abs(a)/60),c=Math.abs(a)%60;return"".concat(s).concat(String(l).padStart(2,"0")).concat(String(c).padStart(2,"0"))}try{var a9=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).formatToParts(e).find(function(s){return s.type==="timeZoneName"});if(a9){var s10=a9.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(s10)return"".concat(s10[1]).concat(s10[2]).concat(s10[3]);if(a9.value==="GMT"||a9.value==="UTC")return"+0000"}}catch(a){}var r=-e.getTimezoneOffset(),n=r>=0?"+":"-",i=Math.floor(Math.abs(r)/60),o=Math.abs(r)%60;return"".concat(n).concat(String(i).padStart(2,"0")).concat(String(o).padStart(2,"0"))}function ipt(e,t){var r,n;try{return(n=(r=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(e).find(function(i){return i.type==="timeZoneName"}))==null?void 0:r.value)!=null?n:"UTC"}catch(i){return"UTC"}}function Vbe(e,t,r){var n=[31,28,31,30,31,30,31,31,30,31,30,31];(e%4===0&&e%100!==0||e%400===0)&&(n[1]=29);var i=r;for(var o=0;o<t-1;o++)i+=n[o];return i}function vye(e,t,r,n,i){var o=Vbe(e,t,r),a=new Date(e,0,1).getDay(),s=1+(7+i-a)%7,l=o-s;return l<0?0:Math.floor(l/7)+1}function opt(e,t,r){var n=new Date(e,t-1,r,12,0,0);n.setDate(n.getDate()+3-(n.getDay()+6)%7);var i=new Date(n.getFullYear(),0,4);i.setDate(i.getDate()+3-(i.getDay()+6)%7);var o=n.getTime()-i.getTime();return 1+Math.round(o/(10080*60*1e3))}function _ye(e,t,r){var n=new Date(e,t-1,r,12,0,0);return n.setDate(n.getDate()+3-(n.getDay()+6)%7),n.getFullYear()}var Gbe=se(function(){"use strict"}),Hbe={};St(Hbe,{flagsForFuzzing:function(){return Kbe},printfCommand:function(){return Zbe}});function apt(e){var t="",r=0;for(;r<e.length;){var n=e[r];if(n<128){t+=String.fromCharCode(n),r++;continue}if((n&224)===192){if(r+1<e.length&&(e[r+1]&192)===128&&n>=194){var i=(n&31)<<6|e[r+1]&63;t+=String.fromCharCode(i),r+=2;continue}t+=String.fromCharCode(n),r++;continue}if((n&240)===224){if(r+2<e.length&&(e[r+1]&192)===128&&(e[r+2]&192)===128){if(n===224&&e[r+1]<160){t+=String.fromCharCode(n),r++;continue}var i10=(n&15)<<12|(e[r+1]&63)<<6|e[r+2]&63;if(i10>=55296&&i10<=57343){t+=String.fromCharCode(n),r++;continue}t+=String.fromCharCode(i10),r+=3;continue}t+=String.fromCharCode(n),r++;continue}if((n&248)===240&&n<=244){if(r+3<e.length&&(e[r+1]&192)===128&&(e[r+2]&192)===128&&(e[r+3]&192)===128){if(n===240&&e[r+1]<144){t+=String.fromCharCode(n),r++;continue}var i11=(n&7)<<18|(e[r+1]&63)<<12|(e[r+2]&63)<<6|e[r+3]&63;if(i11>1114111){t+=String.fromCharCode(n),r++;continue}t+=String.fromCodePoint(i11),r+=4;continue}t+=String.fromCharCode(n),r++;continue}t+=String.fromCharCode(n),r++}return t}function spt(e,t,r,n){var i="",o=0,a=0,s=!1,l="";for(;o<e.length;)if(e[o]==="%"&&o+1<e.length){var c=o;if(o++,e[o]==="%"){i+="%",o++;continue}var d=e.slice(c).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(d){var b=d[1]?parseInt(d[1],10):0,w=d[2]?parseInt(d[2],10):-1,S=d[3],k=d[0],E=t[r+a]||"";a++;var C=void 0;E===""||E==="-1"||E==="-2"?C=Math.floor(Date.now()/1e3):C=parseInt(E,10)||0;var T=jS(S,C,n);if(w>=0&&T.length>w&&(T=T.slice(0,w)),b!==0){var I=Math.abs(b);T.length<I&&(b<0?T=T.padEnd(I," "):T=T.padStart(I," "))}i+=T,o=c+k.length;continue}for(;o<e.length&&"+-0 #'".includes(e[o]);)o++;var u=!1;if(e[o]==="*")u=!0,o++;else for(;o<e.length&&/\d/.test(e[o]);)o++;var p=!1;if(e[o]===".")if(o++,e[o]==="*")p=!0,o++;else for(;o<e.length&&/\d/.test(e[o]);)o++;o<e.length&&"hlL".includes(e[o])&&o++;var m=e[o]||"";o++;var h=e.slice(c,o);if(u){var b10=parseInt(t[r+a]||"0",10);a++,h=h.replace("*",String(b10))}if(p){var b11=parseInt(t[r+a]||"0",10);a++,h=h.replace(".*",".".concat(b11))}var g=t[r+a]||"";a++;var _lpt=lpt(h,m,g),x=_lpt.value,v=_lpt.parseError,y=_lpt.parseErrMsg,_=_lpt.stopped;if(i+=x,v&&(s=!0,y&&(l=y)),_)return{result:i,argsConsumed:a,error:s,errMsg:l,stopped:!0}}else i+=e[o],o++;return{result:i,argsConsumed:a,error:s,errMsg:l,stopped:!1}}function lpt(e,t,r){var n=!1,i="";switch(t){case"d":case"i":{var o=GI(r);return n=Ju,n&&(i="printf: ".concat(r,": invalid number\n")),{value:bye(e,o),parseError:n,parseErrMsg:i}}case"o":{var o10=GI(r);return n=Ju,n&&(i="printf: ".concat(r,": invalid number\n")),{value:upt(e,o10),parseError:n,parseErrMsg:i}}case"u":{var o11=GI(r);n=Ju,n&&(i="printf: ".concat(r,": invalid number\n"));var a=o11<0?o11>>>0:o11;return{value:bye(e.replace("u","d"),a),parseError:n,parseErrMsg:i}}case"x":case"X":{var o12=GI(r);return n=Ju,n&&(i="printf: ".concat(r,": invalid number\n")),{value:cpt(e,o12),parseError:n,parseErrMsg:i}}case"e":case"E":case"f":case"F":case"g":case"G":{var o13=parseFloat(r)||0;return{value:mpt(e,t,o13),parseError:!1,parseErrMsg:""}}case"c":{if(r==="")return{value:"",parseError:!1,parseErrMsg:""};var o14=new TextEncoder().encode(r)[0];return{value:String.fromCharCode(o14),parseError:!1,parseErrMsg:""}}case"s":return{value:ppt(e,r),parseError:!1,parseErrMsg:""};case"q":return{value:fpt(e,r),parseError:!1,parseErrMsg:""};case"b":{var o15=hpt(r);return{value:o15.value,parseError:!1,parseErrMsg:"",stopped:o15.stopped}}default:try{return{value:(0,c1.sprintf)(e,r),parseError:!1,parseErrMsg:""}}catch(o){return{value:"",parseError:!0,parseErrMsg:"printf: [sprintf] unexpected placeholder\n"}}}}function GI(e){Ju=!1;var t=e.trimStart(),r=t!==t.trimEnd();if(e=t.trimEnd(),e.startsWith("'")&&e.length>=2||e.startsWith('"')&&e.length>=2)return e.charCodeAt(1);if(e.startsWith("\\'")&&e.length>=3||e.startsWith('\\"')&&e.length>=3)return e.charCodeAt(2);if(e.startsWith("+")&&(e=e.slice(1)),e.startsWith("0x")||e.startsWith("0X")){var n=parseInt(e,16);return Number.isNaN(n)?(Ju=!0,0):(r&&(Ju=!0),n)}if(e.startsWith("0")&&e.length>1&&/^-?0[0-7]+$/.test(e))return r&&(Ju=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){Ju=!0;var n10=e.match(/^(\d+)#/);return n10?parseInt(n10[1],10):0}if(e!==""&&!/^-?\d+$/.test(e)){Ju=!0;var n11=parseInt(e,10);return Number.isNaN(n11)?0:n11}return r&&(Ju=!0),parseInt(e,10)||0}function bye(e,t){var r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!r)return(0,c1.sprintf)(e.replace(/\.\d*/,""),t);var n=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=t<0,s=Math.abs(t),l=String(s);o>=0&&(l=l.padStart(o,"0"));var c="";a?c="-":n.includes("+")?c="+":n.includes(" ")&&(c=" ");var d=c+l;return i>d.length&&(n.includes("-")?d=d.padEnd(i," "):n.includes("0")&&o<0?d=c+l.padStart(i-c.length,"0"):d=d.padStart(i," ")),d}function upt(e,t){var r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!r)return(0,c1.sprintf)(e,t);var n=r[1]||"",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=Math.abs(t).toString(8);o>=0&&(a=a.padStart(o,"0")),n.includes("#")&&!a.startsWith("0")&&(a="0".concat(a));var s=a;return i>s.length&&(n.includes("-")?s=s.padEnd(i," "):n.includes("0")&&o<0?s=s.padStart(i,"0"):s=s.padStart(i," ")),s}function cpt(e,t){var r=e.includes("X"),n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!n)return(0,c1.sprintf)(e,t);var i=n[1]||"",o=n[2]?parseInt(n[2],10):0,a=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,s=Math.abs(t).toString(16);r&&(s=s.toUpperCase()),a>=0&&(s=s.padStart(a,"0"));var l="";i.includes("#")&&t!==0&&(l=r?"0X":"0x");var c=l+s;return o>c.length&&(i.includes("-")?c=c.padEnd(o," "):i.includes("0")&&a<0?c=l+s.padStart(o-l.length,"0"):c=c.padStart(o," ")),c}function dpt(e){if(e==="")return"''";if(/^[a-zA-Z0-9_./-]+$/.test(e))return e;if(/[\x00-\x1f\x7f-\xff]/.test(e)){var r="$'";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.charCodeAt(0);n==="'"?r+="\\'":n==="\\"?r+="\\\\":n==="\n"?r+="\\n":n===" "?r+="\\t":n==="\r"?r+="\\r":n==="\x07"?r+="\\a":n==="\b"?r+="\\b":n==="\f"?r+="\\f":n==="\v"?r+="\\v":n==="\x1b"?r+="\\E":i<32||i>=127&&i<=255?r+="\\".concat(i.toString(8).padStart(3,"0")):n==='"'?r+='\\"':r+=n}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r+="'",r}var t="";var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r10=_step1.value;" |&;<>()$`\\\"'*?[#~=%!{}".includes(r10)?t+="\\".concat(r10):t+=r10}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return t}function ppt(e,t){var r=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!r)return(0,c1.sprintf)(e.replace(/0+(?=\d)/,""),t);var n=r[1]==="-",i=r[2]?parseInt(r[2],10):0,o=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=n?-i:i;return Bbe(t,a,o)}function fpt(e,t){var r=dpt(t),n=e.match(/^%(-?)(\d*)q$/);if(!n)return r;var i=n[1]==="-",o=n[2]?parseInt(n[2],10):0,a=r;return o>a.length&&(i?a=a.padEnd(o," "):a=a.padStart(o," ")),a}function mpt(e,t,r){var c;var n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!n)return(0,c1.sprintf)(e,r);var i=n[1]||"",o=n[2]?parseInt(n[2],10):0,a=n[3]!==void 0?n[4]?parseInt(n[4],10):0:6,s,l=t.toLowerCase();if(l==="e"?(s=r.toExponential(a),s=s.replace(/e([+-])(\d)$/,"e$10$2"),t==="E"&&(s=s.toUpperCase())):l==="f"?(s=r.toFixed(a),i.includes("#")&&a===0&&!s.includes(".")&&(s+=".")):l==="g"?(s=r.toPrecision(a||1),i.includes("#")||(s=s.replace(/\.?0+$/,""),s=s.replace(/\.?0+e/,"e")),s=s.replace(/e([+-])(\d)$/,"e$10$2"),t==="G"&&(s=s.toUpperCase())):s=r.toString(),r>=0&&(i.includes("+")?s="+".concat(s):i.includes(" ")&&(s=" ".concat(s))),o>s.length)if(i.includes("-"))s=s.padEnd(o," ");else if(i.includes("0")){var d=((c=s.match(/^[+ -]/))==null?void 0:c[0])||"",u=d?s.slice(1):s;s=d+u.padStart(o-d.length,"0")}else s=s.padStart(o," ");return s}function hpt(e){var t="",r=0;for(;r<e.length;)if(e[r]==="\\"&&r+1<e.length)switch(e[r+1]){case"n":t+="\n",r+=2;break;case"t":t+=" ",r+=2;break;case"r":t+="\r",r+=2;break;case"\\":t+="\\",r+=2;break;case"a":t+="\x07",r+=2;break;case"b":t+="\b",r+=2;break;case"f":t+="\f",r+=2;break;case"v":t+="\v",r+=2;break;case"c":return{value:t,stopped:!0};case"x":{var n=[],i=r;for(;i+1<e.length&&e[i]==="\\"&&e[i+1]==="x";){var o="",a=i+2;for(;a<e.length&&a<i+4&&/[0-9a-fA-F]/.test(e[a]);)o+=e[a],a++;if(o)n.push(parseInt(o,16)),i=a;else break}n.length>0?(t+=apt(n),r=i):(t+="\\x",r+=2);break}case"u":{var n10="",i10=r+2;for(;i10<e.length&&i10<r+6&&/[0-9a-fA-F]/.test(e[i10]);)n10+=e[i10],i10++;n10?(t+=String.fromCodePoint(parseInt(n10,16)),r=i10):(t+="\\u",r+=2);break}case"0":{var n11="",i11=r+2;for(;i11<e.length&&i11<r+5&&/[0-7]/.test(e[i11]);)n11+=e[i11],i11++;n11?t+=String.fromCharCode(parseInt(n11,8)):t+="\0",r=i11;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{var n12="",i12=r+1;for(;i12<e.length&&i12<r+4&&/[0-7]/.test(e[i12]);)n12+=e[i12],i12++;t+=String.fromCharCode(parseInt(n12,8)),r=i12;break}default:t+=e[r],r++}else t+=e[r],r++;return{value:t,stopped:!1}}var wye,Zbe,Ju,Kbe,gpt=se(function(){"use strict";jr(),ic(),jt(),Wbe(),Gbe(),wye={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},Zbe={name:"printf",execute:function execute(e,t){return _async_to_generator(function(){var a,r,n,_$s,i,o,_$s1,l,c,d,u,p,m,_spt,h,g,x,v,y,h10,g10,x10;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(wye)];if(e.length===0)return[2,{stdout:"",stderr:"printf: usage: printf format [arguments]\n",exitCode:2}];r=null,n=0;for(;n<e.length;){_$s=e[n];if(_$s==="--"){n++;break}if(_$s==="-v"){if(n+1>=e.length)return[2,{stdout:"",stderr:"printf: -v: option requires an argument\n",exitCode:1}];if(r=e[n+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[a-zA-Z0-9_@*"'$]+\])?$/.test(r))return[2,{stdout:"",stderr:"printf: `".concat(r,"': not a valid identifier\n"),exitCode:2}];n+=2}else{if(_$s.startsWith("-")&&_$s!=="-")break;break}}if(n>=e.length)return[2,{stdout:"",stderr:"printf: usage: printf format [arguments]\n",exitCode:1}];i=e[n],o=e.slice(n+1);try{_$s1=qbe(i),l="",c=0,d=!1,u="",p=t.env.get("TZ"),m=(a=t.limits)==null?void 0:a.maxStringLength;do{_spt=spt(_$s1,o,c,p),h=_spt.result,g=_spt.argsConsumed,x=_spt.error,v=_spt.errMsg,y=_spt.stopped;if(l+=h,m!==void 0&&m>0&&l.length>m)throw new Qt("printf: output size limit exceeded (".concat(m," bytes)"),"string_length");if(c+=g,x&&(d=!0,v&&(u=v)),y)break}while(c<o.length&&c>0);if(c===0&&o.length>0,r){h10=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(h10){g10=h10[1],x10=h10[3];x10=x10.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,function(v,y){var _;return(_=t.env.get(y))!=null?_:""}),t.env.set("".concat(g10,"_").concat(x10),l)}else t.env.set(r,l);return[2,{stdout:"",stderr:u,exitCode:d?1:0}]}return[2,{stdout:l,stderr:u,exitCode:d?1:0}]}catch(s){if(_instanceof(s,Qt))throw s;return[2,{stdout:"",stderr:"printf: ".concat(cu(s),"\n"),exitCode:1}]}return[2]})})()}},Ju=!1,Kbe={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0}}),Qbe={};St(Qbe,{flagsForFuzzing:function(){return Xbe},lsCommand:function(){return Ybe}});function E9(e){if(e<1024)return String(e);if(e<1024*1024){var r=e/1024;return r<10?"".concat(r.toFixed(1),"K"):"".concat(Math.round(r),"K")}if(e<1024*1024*1024){var r10=e/1048576;return r10<10?"".concat(r10.toFixed(1),"M"):"".concat(Math.round(r10),"M")}var t=e/(1024*1024*1024);return t<10?"".concat(t.toFixed(1),"G"):"".concat(Math.round(t),"G")}function T9(e){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=String(e.getDate()).padStart(2," "),n=new Date,i=new Date(n.getTime()-4320*60*60*1e3);if(e>i){var a=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0");return"".concat(t," ").concat(r," ").concat(a,":").concat(s)}var o=e.getFullYear();return"".concat(t," ").concat(r," ").concat(o)}function X0(e){return e.isDirectory?"/":e.isSymbolicLink?"@":e.mode&73?"*":""}function xpt(_01,_11,_21,_31,_41){return _async_to_generator(function(e,t,r,n,i){var o,a,s,l,m,h,g,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x,v,y,_p1,x10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,v10,y10,_,_10,err,x11,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,v11,y11,_11,b,w,S,k,E,C,_tmp,_12,err,x12,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,v12,y12,_13,_14,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=_arguments.length>5&&_arguments[5]!==void 0?_arguments[5]:!1,a=_arguments.length>6&&_arguments[6]!==void 0?_arguments[6]:!1,s=_arguments.length>7&&_arguments[7]!==void 0?_arguments[7]:!1,l=_arguments.length>8&&_arguments[8]!==void 0?_arguments[8]:!1;c=r||n,d=t.fs.getAllPaths(),u=t.fs.resolvePath(t.cwd,"."),p=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=d[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){x=_step.value;v=x.startsWith(u)&&x.slice(u.length+1)||x;if(ka(v,e)||ka(x,e)){y=v.split("/").pop()||v;if(!c&&y.startsWith("."))continue;p.push(v||x)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(p.length===0)return[2,{stdout:"",stderr:"ls: ".concat(e,": No such file or directory\n"),exitCode:2}];if(!s)return[3,11];x10=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator1=p[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,7];v10=_step1.value;y10=t.fs.resolvePath(t.cwd,v10);_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,t.fs.stat(y10)];case 4:_=_state.sent();x10.push({path:v10,size:(m=_.size)!=null?m:0});return[3,6];case 5:_10=_state.sent();x10.push({path:v10,size:0});return[3,6];case 6:_iteratorNormalCompletion1=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 10:x10.sort(function(v,y){return y.size-v.size}),p.length=0,(_p1=p).push.apply(_p1,_to_consumable_array(x10.map(function(v){return v.path})));return[3,12];case 11:p.sort();_state.label=12;case 12:if(!(o&&p.reverse(),i))return[3,26];x11=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=13;case 13:_state.trys.push([13,23,24,25]);_iterator2=p[Symbol.iterator]();_state.label=14;case 14:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,22];v11=_step2.value;y11=t.fs.resolvePath(t.cwd,v11);_state.label=15;case 15:_state.trys.push([15,20,,21]);return[4,t.fs.stat(y11)];case 16:_11=_state.sent(),b=_11.isDirectory?"drwxr-xr-x":"-rw-r--r--";if(!l)return[3,18];return[4,t.fs.lstat(y11)];case 17:_tmp=X0.apply(void 0,[_state.sent()]);return[3,19];case 18:_tmp=_11.isDirectory?"/":"";_state.label=19;case 19:w=_tmp,S=(h=_11.size)!=null?h:0,k=a?E9(S).padStart(5):String(S).padStart(5),E=(g=_11.mtime)!=null?g:new Date(0),C=T9(E);x11.push("".concat(b," 1 user user ").concat(k," ").concat(C," ").concat(v11).concat(w));return[3,21];case 20:_12=_state.sent();x11.push("-rw-r--r-- 1 user user 0 Jan 1 00:00 ".concat(v11));return[3,21];case 21:_iteratorNormalCompletion2=true;return[3,14];case 22:return[3,25];case 23:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,25];case 24:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 25:return[2,{stdout:"".concat(x11.join("\n"),"\n"),stderr:"",exitCode:0}];case 26:if(!l)return[3,37];x12=[];_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;_state.label=27;case 27:_state.trys.push([27,34,35,36]);_iterator3=p[Symbol.iterator]();_state.label=28;case 28:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,33];v12=_step3.value;y12=t.fs.resolvePath(t.cwd,v12);_state.label=29;case 29:_state.trys.push([29,31,,32]);return[4,t.fs.lstat(y12)];case 30:_13=_state.sent();x12.push("".concat(v12).concat(X0(_13)));return[3,32];case 31:_14=_state.sent();x12.push(v12);return[3,32];case 32:_iteratorNormalCompletion3=true;return[3,28];case 33:return[3,36];case 34:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,36];case 35:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 36:return[2,{stdout:"".concat(x12.join("\n"),"\n"),stderr:"",exitCode:0}];case 37:return[2,{stdout:"".concat(p.join("\n"),"\n"),stderr:"",exitCode:0}]}})}).apply(this,arguments)}function Jbe(_01,_11,_21,_31,_41,_51,_61){return _async_to_generator(function(e,t,r,n,i,o,a){var s,l,c,d,u,h,g,x,p,m,v,b,_tmp,w,S,k,E,y,b10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,w10,S10,k10,k11,err,_,b11,w11,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,E1,S11,E10,_S1,C,T,k12,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value,E11,b12,w12,S12,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,k13,k14,_b1,E12,C1,b13,w13,k15,_w1,E13,C10,S13,k16,_S2,E14,C11,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,_step_value1,k17,v10;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=_arguments.length>7&&_arguments[7]!==void 0?_arguments[7]:!1,l=_arguments.length>8&&_arguments[8]!==void 0?_arguments[8]:!1,c=_arguments.length>9&&_arguments[9]!==void 0?_arguments[9]:!1,d=_arguments.length>10&&_arguments[10]!==void 0?_arguments[10]:!1,u=_arguments.length>11&&_arguments[11]!==void 0?_arguments[11]:!1;p=r||n,m=t.fs.resolvePath(t.cwd,e);_state.label=1;case 1:_state.trys.push([1,42,,43]);return[4,t.fs.stat(m)];case 2:v=_state.sent();if(!!v.isDirectory)return[3,6];if(!d)return[3,4];return[4,t.fs.lstat(m)];case 3:_tmp=X0.apply(void 0,[_state.sent()]);return[3,5];case 4:_tmp="";_state.label=5;case 5:b=_tmp;if(i){w=(h=v.size)!=null?h:0,S=l?E9(w).padStart(5):String(w).padStart(5),k=(g=v.mtime)!=null?g:new Date(0),E=T9(k);return[2,{stdout:"-rw-r--r-- 1 user user ".concat(S," ").concat(E," ").concat(e).concat(b,"\n"),stderr:"",exitCode:0}]}return[2,{stdout:"".concat(e).concat(b,"\n"),stderr:"",exitCode:0}];case 6:return[4,t.fs.readdir(m)];case 7:y=_state.sent();if(!(p||(y=y.filter(function(b){return!b.startsWith(".")})),c))return[3,18];b10=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=8;case 8:_state.trys.push([8,15,16,17]);_iterator=y[Symbol.iterator]();_state.label=9;case 9:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];w10=_step.value;S10=m==="/"?"/".concat(w10):"".concat(m,"/").concat(w10);_state.label=10;case 10:_state.trys.push([10,12,,13]);return[4,t.fs.stat(S10)];case 11:k10=_state.sent();b10.push({name:w10,size:(x=k10.size)!=null?x:0});return[3,13];case 12:k11=_state.sent();b10.push({name:w10,size:0});return[3,13];case 13:_iteratorNormalCompletion=true;return[3,9];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:b10.sort(function(w,S){return S.size-w.size}),y=b10.map(function(w){return w.name});return[3,19];case 18:y.sort();_state.label=19;case 19:r&&(y=[".",".."].concat(_to_consumable_array(y))),s&&y.reverse();_="";if(!((o||a)&&(_+="".concat(e,":\n")),i))return[3,24];_+="total ".concat(y.length,"\n");b11=y.filter(function(E){return E==="."||E===".."}),w11=y.filter(function(E){return E!=="."&&E!==".."});_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=b11[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){E1=_step1.value;_+="drwxr-xr-x 1 user user 0 Jan 1 00:00 ".concat(E1,"\n")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}S11=[];E10=0;_state.label=20;case 20:if(!(E10<w11.length))return[3,23];C=w11.slice(E10,E10+100);return[4,Promise.all(C.map(function(I){return _async_to_generator(function(){var M,R,O,$,z,D,L,ee,pe,N,_tmp,$1;return _ts_generator(this,function(_state){switch(_state.label){case 0:O=m==="/"?"/".concat(I):"".concat(m,"/").concat(I);_state.label=1;case 1:_state.trys.push([1,6,,7]);return[4,t.fs.stat(O)];case 2:$=_state.sent(),z=$.isDirectory?"drwxr-xr-x":"-rw-r--r--";if(!d)return[3,4];return[4,t.fs.lstat(O)];case 3:_tmp=X0.apply(void 0,[_state.sent()]);return[3,5];case 4:_tmp=$.isDirectory?"/":"";_state.label=5;case 5:D=_tmp,L=(M=$.size)!=null?M:0,ee=l?E9(L).padStart(5):String(L).padStart(5),pe=(R=$.mtime)!=null?R:new Date(0),N=T9(pe);return[2,{name:I,line:"".concat(z," 1 user user ").concat(ee," ").concat(N," ").concat(I).concat(D,"\n")}];case 6:$1=_state.sent();return[2,{name:I,line:"-rw-r--r-- 1 user user 0 Jan 1 00:00 ".concat(I,"\n")}];case 7:return[2]}})})()}))];case 21:T=_state.sent();(_S1=S11).push.apply(_S1,_to_consumable_array(T));_state.label=22;case 22:E10+=100;return[3,20];case 23:k12=new Map(w11.map(function(E,C){return[E,C]}));S11.sort(function(E,C){var T,I;return((T=k12.get(E.name))!=null?T:0)-((I=k12.get(C.name))!=null?I:0)});_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=S11[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_step_value=_step2.value,E11=_step_value.line;_+=E11}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[3,30];case 24:if(!d)return[3,29];b12=[],w12=y.filter(function(k){return k!=="."&&k!==".."}),S12=y.filter(function(k){return k==="."||k===".."});_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=S12[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){k13=_step3.value;b12.push("".concat(k13,"/"))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}k14=0;_state.label=25;case 25:if(!(k14<w12.length))return[3,28];E12=w12.slice(k14,k14+100);return[4,Promise.all(E12.map(function(T){return _async_to_generator(function(){var I,O,O1;return _ts_generator(this,function(_state){switch(_state.label){case 0:I=m==="/"?"/".concat(T):"".concat(m,"/").concat(T);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.lstat(I)];case 2:O=_state.sent();return[2,"".concat(T).concat(X0(O))];case 3:O1=_state.sent();return[2,T];case 4:return[2]}})})()}))];case 26:C1=_state.sent();(_b1=b12).push.apply(_b1,_to_consumable_array(C1));_state.label=27;case 27:k14+=100;return[3,25];case 28:_+=b12.join("\n")+(b12.length?"\n":"");return[3,30];case 29:_+=y.join("\n")+(y.length?"\n":"");_state.label=30;case 30:if(!o)return[3,41];b13=y.filter(function(k){return k!=="."&&k!==".."}),w13=[];if(!t.fs.readdirWithFileTypes)return[3,32];return[4,t.fs.readdirWithFileTypes(m)];case 31:w13=_state.sent().filter(function(k){return k.isDirectory&&b13.includes(k.name)}).map(function(k){return{name:k.name,isDirectory:!0}});return[3,36];case 32:k15=0;_state.label=33;case 33:if(!(k15<b13.length))return[3,36];E13=b13.slice(k15,k15+100);return[4,Promise.all(E13.map(function(T){return _async_to_generator(function(){var I,O,O1;return _ts_generator(this,function(_state){switch(_state.label){case 0:I=m==="/"?"/".concat(T):"".concat(m,"/").concat(T);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.stat(I)];case 2:O=_state.sent();return[2,{name:T,isDirectory:O.isDirectory}];case 3:O1=_state.sent();return[2,{name:T,isDirectory:!1}];case 4:return[2]}})})()}))];case 34:C10=_state.sent();(_w1=w13).push.apply(_w1,_to_consumable_array(C10.filter(function(T){return T.isDirectory})));_state.label=35;case 35:k15+=100;return[3,33];case 36:w13.sort(function(k,E){return k.name.localeCompare(E.name)}),s&&w13.reverse();S13=[];k16=0;_state.label=37;case 37:if(!(k16<w13.length))return[3,40];E14=w13.slice(k16,k16+100);return[4,Promise.all(E14.map(function(T){return _async_to_generator(function(){var I,O;return _ts_generator(this,function(_state){switch(_state.label){case 0:I=e==="."?"./".concat(T.name):"".concat(e,"/").concat(T.name);return[4,Jbe(I,t,r,n,i,o,!1,s,l,c,d,!0)];case 1:O=_state.sent();return[2,{name:T.name,result:O}]}})})()}))];case 38:C11=_state.sent();(_S2=S13).push.apply(_S2,_to_consumable_array(C11));_state.label=39;case 39:k16+=100;return[3,37];case 40:S13.sort(function(k,E){return k.name.localeCompare(E.name)}),s&&S13.reverse();_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=S13[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){_step_value1=_step4.value,k17=_step_value1.result;_+="\n",_+=k17.stdout}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}_state.label=41;case 41:return[2,{stdout:_,stderr:"",exitCode:0}];case 42:v10=_state.sent();return[2,{stdout:"",stderr:"ls: ".concat(e,": No such file or directory\n"),exitCode:2}];case 43:return[2]}})}).apply(this,arguments)}var Sye,kye,Ybe,Xbe,ypt=se(function(){"use strict";zo(),n5(),jt(),Sye={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},kye={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Ybe={name:"ls",execute:function execute(e,t){return _async_to_generator(function(){var v,y,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,_,b,w,S,k,E,C,T,I,O,_tmp,k10,_tmp1,S10,w10,w11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Sye)];r=Fo("ls",e,kye);if(!r.ok)return[2,r.error];n=r.result.flags.showAll,i=r.result.flags.showAlmostAll,o=r.result.flags.longFormat,a=r.result.flags.humanReadable,s=r.result.flags.recursive,l=r.result.flags.reverse,c=r.result.flags.sortBySize,d=r.result.flags.classifyFiles,u=r.result.flags.directoryOnly,p=r.result.flags.sortByTime;r.result.flags.onePerLine;m=r.result.positional;m.length===0&&m.push(".");h="",g="",x=0;_=0;_state.label=1;case 1:if(!(_<m.length))return[3,19];b=m[_];if(!(_>0&&h&&!h.endsWith("\n\n")&&(h+="\n"),u))return[3,14];w=t.fs.resolvePath(t.cwd,b);_state.label=2;case 2:_state.trys.push([2,12,,13]);return[4,t.fs.stat(w)];case 3:S=_state.sent();if(!o)return[3,7];k=S.isDirectory?"drwxr-xr-x":"-rw-r--r--";if(!d)return[3,5];return[4,t.fs.lstat(w)];case 4:_tmp=X0.apply(void 0,[_state.sent()]);return[3,6];case 5:_tmp=S.isDirectory?"/":"";_state.label=6;case 6:E=_tmp,C=(v=S.size)!=null?v:0,T=a?E9(C).padStart(5):String(C).padStart(5),I=(y=S.mtime)!=null?y:new Date(0),O=T9(I);h+="".concat(k," 1 user user ").concat(T," ").concat(O," ").concat(b).concat(E,"\n");return[3,11];case 7:if(!d)return[3,9];return[4,t.fs.lstat(w)];case 8:_tmp1=X0.apply(void 0,[_state.sent()]);return[3,10];case 9:_tmp1="";_state.label=10;case 10:k10=_tmp1;h+="".concat(b).concat(k10,"\n");_state.label=11;case 11:return[3,13];case 12:S10=_state.sent();g+="ls: cannot access '".concat(b,"': No such file or directory\n"),x=2;return[3,13];case 13:return[3,18];case 14:if(!(b.includes("*")||b.includes("?")||b.includes("[")))return[3,16];return[4,xpt(b,t,n,i,o,l,a,c,d)];case 15:w10=_state.sent();h+=w10.stdout,g+=w10.stderr,w10.exitCode!==0&&(x=w10.exitCode);return[3,18];case 16:return[4,Jbe(b,t,n,i,o,s,m.length>1,l,a,c,d)];case 17:w11=_state.sent();h+=w11.stdout,g+=w11.stderr,w11.exitCode!==0&&(x=w11.exitCode);_state.label=18;case 18:_++;return[3,1];case 19:return[2,{stdout:h,stderr:g,exitCode:x}]}})})()}},Xbe={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0}});function vpt(e,t,r){if(!e)return e;var n=e.replace(/\n\s+at\s.*/g,"");return r&&(n=n.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g,"<path>")),n=n.replace(t?/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g:/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,"<path>"),n=n.replace(/node:internal\/[^\s'",)}\]:]+/g,"<internal>"),n=n.replace(/[A-Z]:\\[^\s'",)}\]:]+/g,"<path>"),r&&(n=n.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g,"<path>")),n}function la(e){return vpt(e,!1,!1)}var yp=se(function(){"use strict"}),ewe={};St(ewe,{flagsForFuzzing:function(){return rwe},mkdirCommand:function(){return twe}});var Cye,twe,rwe,_pt=se(function(){"use strict";yp(),ic(),zo(),Cye={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},twe={name:"mkdir",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,_$d,d,u,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Fo("mkdir",e,Cye);if(!r.ok)return[2,r.error];n=r.result.flags.recursive,i=r.result.flags.verbose,o=r.result.positional;if(o.length===0)return[2,{stdout:"",stderr:"mkdir: missing operand\n",exitCode:1}];a="",s="",l=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];c=_step.value;_state.label=3;case 3:_state.trys.push([3,5,,6]);_$d=t.fs.resolvePath(t.cwd,c);return[4,t.fs.mkdir(_$d,{recursive:n})];case 4:_state.sent(),i&&(a+="mkdir: created directory '".concat(c,"'\n"));return[3,6];case 5:d=_state.sent();u=cu(d);u.includes("ENOENT")||u.includes("no such file")?s+="mkdir: cannot create directory '".concat(c,"': No such file or directory\n"):u.includes("EEXIST")||u.includes("already exists")?s+="mkdir: cannot create directory '".concat(c,"': File exists\n"):s+="mkdir: cannot create directory '".concat(c,"': ").concat(la(u),"\n"),l=1;return[3,6];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2,{stdout:a,stderr:s,exitCode:l}]}})})()}},rwe={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}}),nwe={};St(nwe,{flagsForFuzzing:function(){return owe},rmdirCommand:function(){return iwe}});function bpt(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,l,c,d,u,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="",o="",a=e.fs.resolvePath(e.cwd,t);return[4,Eye(e,a,t,n)];case 1:s=_state.sent();if(i+=s.stdout,o+=s.stderr,s.exitCode!==0)return[2,{stdout:i,stderr:o,exitCode:s.exitCode}];if(!r)return[3,5];l=a,c=t;_state.label=2;case 2:d=Tye(l),u=Tye(c);if(d===l||d==="/"||d==="."||u==="."||u==="")return[3,5];return[4,Eye(e,d,u,n)];case 3:p=_state.sent();if(i+=p.stdout,p.exitCode!==0)return[3,5];l=d,c=u;_state.label=4;case 4:return[3,2];case 5:return[2,{stdout:i,stderr:o,exitCode:0}]}})})()}function Eye(e,t,r,n){return _async_to_generator(function(){var _$i,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,5,,6]);return[4,e.fs.exists(t)];case 1:if(!_state.sent())return[2,{stdout:"",stderr:"rmdir: failed to remove '".concat(r,"': No such file or directory\n"),exitCode:1}];return[4,e.fs.stat(t)];case 2:if(!_state.sent().isDirectory)return[2,{stdout:"",stderr:"rmdir: failed to remove '".concat(r,"': Not a directory\n"),exitCode:1}];return[4,e.fs.readdir(t)];case 3:if(_state.sent().length>0)return[2,{stdout:"",stderr:"rmdir: failed to remove '".concat(r,"': Directory not empty\n"),exitCode:1}];return[4,e.fs.rm(t,{recursive:!1,force:!1})];case 4:_state.sent();_$i="";return[2,(n&&(_$i="rmdir: removing directory, '".concat(r,"'\n")),{stdout:_$i,stderr:"",exitCode:0})];case 5:i=_state.sent();o=cu(i);return[2,{stdout:"",stderr:"rmdir: failed to remove '".concat(r,"': ").concat(o,"\n"),exitCode:1}];case 6:return[2]}})})()}function Tye(e){var t=e.replace(/\/+$/,""),r=t.lastIndexOf("/");return r===-1?".":r===0?"/":t.substring(0,r)}var Aye,Iye,iwe,owe,wpt=se(function(){"use strict";ic(),zo(),Aye="Usage: rmdir [-pv] DIRECTORY...\nRemove empty directories.\n\nOptions:\n -p, --parents Remove DIRECTORY and its ancestors\n -v, --verbose Output a diagnostic for every directory processed",Iye={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},iwe={name:"rmdir",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Fo("rmdir",e,Iye);if(!r.ok)return[2,r.error];if(r.result.flags.help)return[2,{stdout:"".concat(Aye,"\n"),stderr:"",exitCode:0}];n=r.result.flags.parents,i=r.result.flags.verbose,o=r.result.positional;if(o.length===0)return[2,{stdout:"",stderr:"rmdir: missing operand\n",exitCode:1}];a="",s="",l=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];c=_step.value;return[4,bpt(t,c,n,i)];case 3:d=_state.sent();a+=d.stdout,s+=d.stderr,d.exitCode!==0&&(l=d.exitCode);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,{stdout:a,stderr:s,exitCode:l}]}})})()}},owe={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}}),awe={};St(awe,{flagsForFuzzing:function(){return lwe},touchCommand:function(){return swe}});function Spt(e){var t=e.replace(/\//g,"-"),r=new Date(t);if(!Number.isNaN(r.getTime()))return r;var n=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(n){var _n=_sliced_to_array(n,4),o=_n[1],a=_n[2],s=_n[3];if(r=new Date(Number.parseInt(o,10),Number.parseInt(a,10)-1,Number.parseInt(s,10)),!Number.isNaN(r.getTime()))return r}var i=t.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(i){var _i1=_sliced_to_array(i,7),o10=_i1[1],a9=_i1[2],s10=_i1[3],l=_i1[4],c=_i1[5],d=_i1[6];if(r=new Date(Number.parseInt(o10,10),Number.parseInt(a9,10)-1,Number.parseInt(s10,10),Number.parseInt(l,10),Number.parseInt(c,10),Number.parseInt(d,10)),!Number.isNaN(r.getTime()))return r}return null}var swe,lwe,kpt=se(function(){"use strict";ic(),jt(),swe={name:"touch",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,l,_$c,_r1,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u,o,a,s,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l10,_$c1,d10,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=null,i=!1;for(l=0;l<e.length;l++){_$c=e[l];if(_$c==="--"){;(_r1=r).push.apply(_r1,_to_consumable_array(e.slice(l+1)));break}else if(_$c==="-d"||_$c==="--date"){if(l+1>=e.length)return[2,{stdout:"",stderr:"touch: option requires an argument -- 'd'\n",exitCode:1}];n=e[++l]}else if(_$c.startsWith("--date="))n=_$c.slice(7);else if(_$c==="-c"||_$c==="--no-create")i=!0;else if(_$c==="-a"||_$c==="-m"||_$c==="-r"||_$c==="-t")(_$c==="-r"||_$c==="-t")&&l++;else{if(_$c.startsWith("--"))return[2,fr("touch",_$c)];if(_$c.startsWith("-")&&_$c.length>1){d=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$c.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u=_step.value;if(u==="c")i=!0;else if(!(u==="a"||u==="m"))if(u==="d"){if(l+1>=e.length)return[2,{stdout:"",stderr:"touch: option requires an argument -- 'd'\n",exitCode:1}];n=e[++l],d=!0;break}else if(u==="r"||u==="t"){l++,d=!0;break}else return[2,fr("touch","-".concat(u))]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(d)continue}else r.push(_$c)}}if(r.length===0)return[2,{stdout:"",stderr:"touch: missing file operand\n",exitCode:1}];o=null;if(n!==null&&(o=Spt(n),o===null))return[2,{stdout:"",stderr:"touch: invalid date format '".concat(n,"'\n"),exitCode:1}];a="",s=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,11,12,13]);_iterator1=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,10];l10=_step1.value;_state.label=3;case 3:_state.trys.push([3,8,,9]);_$c1=t.fs.resolvePath(t.cwd,l10);return[4,t.fs.exists(_$c1)];case 4:if(!!_state.sent())return[3,6];if(i)return[3,9];return[4,t.fs.writeFile(_$c1,"")];case 5:_state.sent();_state.label=6;case 6:d10=o!=null?o:new Date;return[4,t.fs.utimes(_$c1,d10,d10)];case 7:_state.sent();return[3,9];case 8:c=_state.sent();a+="touch: cannot touch '".concat(l10,"': ").concat(cu(c),"\n"),s=1;return[3,9];case 9:_iteratorNormalCompletion1=true;return[3,2];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 13:return[2,{stdout:"",stderr:a,exitCode:s}]}})})()}},lwe={name:"touch",flags:[{flag:"-c",type:"boolean"},{flag:"-a",type:"boolean"},{flag:"-m",type:"boolean"},{flag:"-d",type:"value",valueHint:"string"}],needsArgs:!0}}),uwe={};St(uwe,{flagsForFuzzing:function(){return dwe},rmCommand:function(){return cwe}});var Pye,cwe,dwe,Cpt=se(function(){"use strict";yp(),ic(),zo(),Pye={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},cwe={name:"rm",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,_$u,u,p,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Fo("rm",e,Pye);if(!r.ok)return[2,r.error];n=r.result.flags.recursive||r.result.flags.recursiveUpper,i=r.result.flags.force,o=r.result.flags.verbose,a=r.result.positional;if(a.length===0)return[2,i?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"rm: missing operand\n",exitCode:1}];s="",l="",c=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=a[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];d=_step.value;_state.label=3;case 3:_state.trys.push([3,6,,7]);_$u=t.fs.resolvePath(t.cwd,d);return[4,t.fs.stat(_$u)];case 4:if(_state.sent().isDirectory&&!n){l+="rm: cannot remove '".concat(d,"': Is a directory\n"),c=1;return[3,7]}return[4,t.fs.rm(_$u,{recursive:n,force:i})];case 5:_state.sent(),o&&(s+="removed '".concat(d,"'\n"));return[3,7];case 6:u=_state.sent();if(!i){p=cu(u);p.includes("ENOENT")||p.includes("no such file")?l+="rm: cannot remove '".concat(d,"': No such file or directory\n"):p.includes("ENOTEMPTY")||p.includes("not empty")?l+="rm: cannot remove '".concat(d,"': Directory not empty\n"):l+="rm: cannot remove '".concat(d,"': ").concat(la(p),"\n"),c=1}return[3,7];case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,{stdout:s,stderr:l,exitCode:c}]}})})()}},dwe={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0}}),pwe={};St(pwe,{cpCommand:function(){return fwe},flagsForFuzzing:function(){return mwe}});var Rye,Mye,fwe,mwe,Ept=se(function(){"use strict";ic(),zo(),jt(),Rye={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},Mye={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},fwe={name:"cp",execute:function execute(e,t){return _async_to_generator(function(){var g,r,n,i,o,a,s,l,c,d,u,p,m,h,x,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x10,_$v,y,_,b,b10,v,y10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Rye)];r=Fo("cp",e,Mye);if(!r.ok)return[2,r.error];n=r.result.flags.recursive||r.result.flags.recursiveUpper,i=r.result.flags.noClobber,o=r.result.flags.preserve,a=r.result.flags.verbose,s=r.result.positional;if(s.length<2)return[2,{stdout:"",stderr:"cp: missing destination file operand\n",exitCode:1}];l=(g=s.pop())!=null?g:"",c=s,d=t.fs.resolvePath(t.cwd,l),u="",p="",m=0,h=!1;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.stat(d)];case 2:h=_state.sent().isDirectory;return[3,4];case 3:x=_state.sent();return[3,4];case 4:if(c.length>1&&!h)return[2,{stdout:"",stderr:"cp: target '".concat(l,"' is not a directory\n"),exitCode:1}];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,17,18,19]);_iterator=c[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,16];x10=_step.value;_state.label=7;case 7:_state.trys.push([7,14,,15]);_$v=t.fs.resolvePath(t.cwd,x10);return[4,t.fs.stat(_$v)];case 8:y=_state.sent(),_=d;if(h){b=x10.split("/").pop()||x10;_=d==="/"?"/".concat(b):"".concat(d,"/").concat(b)}if(y.isDirectory&&!n){p+="cp: -r not specified; omitting directory '".concat(x10,"'\n"),m=1;return[3,15]}if(!i)return[3,12];_state.label=9;case 9:_state.trys.push([9,11,,12]);return[4,t.fs.stat(_)];case 10:_state.sent();return[3,15];case 11:b10=_state.sent();return[3,12];case 12:return[4,t.fs.cp(_$v,_,{recursive:n})];case 13:_state.sent(),a&&(u+="'".concat(x10,"' -> '").concat(_,"'\n"));return[3,15];case 14:v=_state.sent();y10=cu(v);y10.includes("ENOENT")||y10.includes("no such file")?p+="cp: cannot stat '".concat(x10,"': No such file or directory\n"):p+="cp: cannot copy '".concat(x10,"': ").concat(y10,"\n"),m=1;return[3,15];case 15:_iteratorNormalCompletion=true;return[3,6];case 16:return[3,19];case 17:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,19];case 18:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 19:return[2,{stdout:u,stderr:p,exitCode:m}]}})})()}},mwe={name:"cp",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}}),hwe={};St(hwe,{flagsForFuzzing:function(){return xwe},mvCommand:function(){return gwe}});var Oye,$ye,gwe,xwe,Tpt=se(function(){"use strict";ic(),zo(),jt(),Oye={name:"mv",summary:"move (rename) files",usage:"mv [OPTION]... SOURCE... DEST",options:["-f, --force do not prompt before overwriting","-n, --no-clobber do not overwrite an existing file","-v, --verbose explain what is being done"," --help display this help and exit"]},$ye={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},gwe={name:"mv",execute:function execute(e,t){return _async_to_generator(function(){var h,r,n,i,o,a,s,l,c,d,u,p,m,g,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g10,_$x,v,y,y10,y11,x,v10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Oye)];r=Fo("mv",e,$ye);if(!r.ok)return[2,r.error];n=r.result.flags.force,i=r.result.flags.noClobber,o=r.result.flags.verbose,a=r.result.positional;if(i&&(n=!1),a.length<2)return[2,{stdout:"",stderr:"mv: missing destination file operand\n",exitCode:1}];s=(h=a.pop())!=null?h:"",l=a,c=t.fs.resolvePath(t.cwd,s),d="",u="",p=0,m=!1;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.stat(c)];case 2:m=_state.sent().isDirectory;return[3,4];case 3:g=_state.sent();return[3,4];case 4:if(l.length>1&&!m)return[2,{stdout:"",stderr:"mv: target '".concat(s,"' is not a directory\n"),exitCode:1}];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,16,17,18]);_iterator=l[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,15];g10=_step.value;_state.label=7;case 7:_state.trys.push([7,13,,14]);_$x=t.fs.resolvePath(t.cwd,g10),v=c;if(m){y=g10.split("/").pop()||g10;v=c==="/"?"/".concat(y):"".concat(c,"/").concat(y)}if(!i)return[3,11];_state.label=8;case 8:_state.trys.push([8,10,,11]);return[4,t.fs.stat(v)];case 9:_state.sent();return[3,14];case 10:y10=_state.sent();return[3,11];case 11:return[4,t.fs.mv(_$x,v)];case 12:if(_state.sent(),o){y11=m?"".concat(s,"/").concat(g10.split("/").pop()||g10):s;d+="renamed '".concat(g10,"' -> '").concat(y11,"'\n")}return[3,14];case 13:x=_state.sent();v10=cu(x);v10.includes("ENOENT")||v10.includes("no such file")?u+="mv: cannot stat '".concat(g10,"': No such file or directory\n"):u+="mv: cannot move '".concat(g10,"': ").concat(v10,"\n"),p=1;return[3,14];case 14:_iteratorNormalCompletion=true;return[3,6];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 18:return[2,{stdout:d,stderr:u,exitCode:p}]}})})()}},xwe={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}}),ywe={};St(ywe,{flagsForFuzzing:function(){return _we},lnCommand:function(){return vwe}});var Nye,vwe,_we,Apt=se(function(){"use strict";yp(),jt(),Nye={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},vwe={name:"ln",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,_$u,a,s,l,c,u,_$u1,u10,p,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Nye)];r=!1,n=!1,i=!1,o=0;for(;o<e.length&&e[o].startsWith("-");){_$u=e[o];if(_$u==="-s"||_$u==="--symbolic")r=!0,o++;else if(_$u==="-f"||_$u==="--force")n=!0,o++;else if(_$u==="-v"||_$u==="--verbose")i=!0,o++;else if(_$u==="-n"||_$u==="--no-dereference")o++;else if(/^-[sfvn]+$/.test(_$u))_$u.includes("s")&&(r=!0),_$u.includes("f")&&(n=!0),_$u.includes("v")&&(i=!0),o++;else if(_$u==="--"){o++;break}else return[2,fr("ln",_$u)]}a=e.slice(o);if(a.length<2)return[2,{stdout:"",stderr:"ln: missing file operand\n",exitCode:1}];s=a[0],l=a[1],c=t.fs.resolvePath(t.cwd,l);return[4,t.fs.exists(c)];case 1:if(!_state.sent())return[3,7];if(!n)return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,t.fs.rm(c,{force:!0})];case 3:_state.sent();return[3,5];case 4:u=_state.sent();return[2,{stdout:"",stderr:"ln: cannot remove '".concat(l,"': Permission denied\n"),exitCode:1}];case 5:return[3,7];case 6:return[2,{stdout:"",stderr:"ln: failed to create ".concat(r?"symbolic ":"","link '").concat(l,"': File exists\n"),exitCode:1}];case 7:_state.trys.push([7,13,,14]);if(!r)return[3,9];return[4,t.fs.symlink(s,c)];case 8:_state.sent();return[3,12];case 9:_$u1=t.fs.resolvePath(t.cwd,s);return[4,t.fs.exists(_$u1)];case 10:if(!_state.sent())return[2,{stdout:"",stderr:"ln: failed to access '".concat(s,"': No such file or directory\n"),exitCode:1}];return[4,t.fs.link(_$u1,c)];case 11:_state.sent();_state.label=12;case 12:return[3,14];case 13:u10=_state.sent();p=u10;return[2,p.message.includes("EPERM")?{stdout:"",stderr:"ln: '".concat(s,"': hard link not allowed for directory\n"),exitCode:1}:{stdout:"",stderr:"ln: ".concat(la(p.message),"\n"),exitCode:1}];case 14:d="";return[2,(i&&(d="'".concat(l,"' -> '").concat(s,"'\n")),{stdout:d,stderr:"",exitCode:0})]}})})()}},_we={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}}),bwe={};St(bwe,{chmodCommand:function(){return Swe},flagsForFuzzing:function(){return kwe}});function wwe(e,t,r,n,i){return _async_to_generator(function(){var o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,c,d,_tmp,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:o="";return[4,e.fs.readdir(t)];case 1:a=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,14,15,16]);_iterator=a[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];s=_step.value;l=t==="/"?"/".concat(s):"".concat(t,"/").concat(s),c=void 0;if(!(r!==void 0))return[3,4];c=r;return[3,7];case 4:if(!(n!==void 0))return[3,6];return[4,e.fs.stat(l)];case 5:d=_state.sent();c=rW(n,d.mode);return[3,7];case 6:c=420;_state.label=7;case 7:return[4,e.fs.chmod(l,c)];case 8:_state.sent(),i&&(o+="mode of '".concat(l,"' changed to ").concat(c.toString(8).padStart(4,"0"),"\n"));return[4,e.fs.stat(l)];case 9:_tmp=_state.sent().isDirectory;if(!_tmp)return[3,11];return[4,wwe(e,l,r,n,i)];case 10:_tmp=o=o+_state.sent();_state.label=11;case 11:_tmp;_state.label=12;case 12:_iteratorNormalCompletion=true;return[3,3];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:return[2,o]}})})()}function rW(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:420;if(/^[0-7]+$/.test(e))return parseInt(e,8);var r=t&4095,n=e.split(",");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!o)throw new Error("Invalid mode: ".concat(e));var a=o[1]||"a",s=o[2],l=o[3];(a==="a"||a==="")&&(a="ugo");var c=0;l.includes("r")&&(c|=4),l.includes("w")&&(c|=2),(l.includes("x")||l.includes("X"))&&(c|=1);var d=0;l.includes("s")&&(a.includes("u")&&(d|=2048),a.includes("g")&&(d|=1024)),l.includes("t")&&(d|=512);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u=_step1.value;var p=0;u==="u"?p=6:u==="g"?p=3:u==="o"&&(p=0);var m=c<<p;s==="+"?r|=m:s==="-"?r&=~m:s==="="&&(r&=~(7<<p),r|=m)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}s==="+"?r|=d:s==="-"?r&=~d:s==="="&&(l.includes("s")&&(a.includes("u")&&(r&=-2049,r|=d&2048),a.includes("g")&&(r&=-1025,r|=d&1024)),l.includes("t")&&(r&=-513,r|=d&512))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var Dye,Swe,kwe,Ipt=se(function(){"use strict";jt(),Dye={name:"chmod",summary:"change file mode bits",usage:"chmod [OPTIONS] MODE FILE...",options:["-R change files recursively","-v output a diagnostic for every file processed"," --help display this help and exit"]},Swe={name:"chmod",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,p,o,a,s,l,c,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p10,m,h,g,_tmp,g10,h10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Dye)];if(e.length<2)return[2,{stdout:"",stderr:"chmod: missing operand\n",exitCode:1}];r=!1,n=!1,i=0;for(;i<e.length&&e[i].startsWith("-");){p=e[i];if(p==="-R"||p==="--recursive")r=!0,i++;else if(p==="-v"||p==="--verbose")n=!0,i++;else if(p==="--"){i++;break}else{if(/^[+-]?[rwxugo]+/.test(p)||/^\d+$/.test(p))break;if(/^-[Rv]+$/.test(p)){p.includes("R")&&(r=!0),p.includes("v")&&(n=!0),i++;continue}return[2,fr("chmod",p)]}}if(e.length-i<2)return[2,{stdout:"",stderr:"chmod: missing operand\n",exitCode:1}];o=e[i],a=e.slice(i+1),s=/^[0-7]+$/.test(o);if(s)l=parseInt(o,8);else try{rW(o,420)}catch(p){return[2,{stdout:"",stderr:"chmod: invalid mode: '".concat(o,"'\n"),exitCode:1}]}c="",d="",u=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,15,16,17]);_iterator=a[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];p10=_step.value;m=t.fs.resolvePath(t.cwd,p10);_state.label=3;case 3:_state.trys.push([3,12,,13]);h=void 0;if(!(s&&l!==void 0))return[3,4];h=l;return[3,6];case 4:return[4,t.fs.stat(m)];case 5:g=_state.sent();h=rW(o,g.mode);_state.label=6;case 6:return[4,t.fs.chmod(m,h)];case 7:_state.sent(),n&&(c+="mode of '".concat(p10,"' changed to ").concat(h.toString(8).padStart(4,"0"),"\n"));_tmp=r;if(!_tmp)return[3,9];return[4,t.fs.stat(m)];case 8:_tmp=_state.sent().isDirectory;_state.label=9;case 9:if(!_tmp)return[3,11];return[4,wwe(t,m,s?l:void 0,s?void 0:o,n)];case 10:g10=_state.sent();c+=g10;_state.label=11;case 11:return[3,13];case 12:h10=_state.sent();d+="chmod: cannot access '".concat(p10,"': No such file or directory\n"),u=!0;return[3,13];case 13:_iteratorNormalCompletion=true;return[3,2];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:return[2,{stdout:c,stderr:d,exitCode:u?1:0}]}})})()}},kwe={name:"chmod",flags:[{flag:"-R",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2}}),Cwe={};St(Cwe,{flagsForFuzzing:function(){return Twe},pwdCommand:function(){return Ewe}});var Ewe,Twe,Ppt=se(function(){"use strict";Ewe={name:"pwd",execute:function execute(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,n,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;if(i==="-P")r=!0;else if(i==="-L")r=!1;else{if(i==="--")break;i.startsWith("-")}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n=t.cwd;if(!r)return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.realpath(t.cwd)];case 2:n=_state.sent();return[3,4];case 3:i10=_state.sent();return[3,4];case 4:return[2,{stdout:"".concat(n,"\n"),stderr:"",exitCode:0}]}})})()}},Twe={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]}}),Awe={};St(Awe,{flagsForFuzzing:function(){return Pwe},readlinkCommand:function(){return Iwe}});var Lye,Iwe,Pwe,Rpt=se(function(){"use strict";jt(),Lye={name:"readlink",summary:"print resolved symbolic links or canonical file names",usage:"readlink [OPTIONS] FILE...",options:["-f canonicalize by following every symlink in every component of the given name recursively"," --help display this help and exit"]},Iwe={name:"readlink",execute:function execute(e,t){return _async_to_generator(function(){var r,n,s,i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s10,l,c,d,u,p,u10,c10,c11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Lye)];r=!1,n=0;for(;n<e.length&&e[n].startsWith("-");){s=e[n];if(s==="-f"||s==="--canonicalize")r=!0,n++;else if(s==="--"){n++;break}else return[2,fr("readlink",s)]}i=e.slice(n);if(i.length===0)return[2,{stdout:"",stderr:"readlink: missing operand\n",exitCode:1}];o="",a=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,16,17,18]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,15];s10=_step.value;l=t.fs.resolvePath(t.cwd,s10);_state.label=3;case 3:_state.trys.push([3,13,,14]);if(!r)return[3,10];c=l,d=new Set;_state.label=4;case 4:if(!!d.has(c))return[3,9];d.add(c);_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,t.fs.readlink(c)];case 6:u=_state.sent();if(u.startsWith("/"))c=u;else{p=c.substring(0,c.lastIndexOf("/"))||"/";c=t.fs.resolvePath(p,u)}return[3,8];case 7:u10=_state.sent();return[3,9];case 8:return[3,4];case 9:o+="".concat(c,"\n");return[3,12];case 10:return[4,t.fs.readlink(l)];case 11:c10=_state.sent();o+="".concat(c10,"\n");_state.label=12;case 12:return[3,14];case 13:c11=_state.sent();r?o+="".concat(l,"\n"):a=!0;return[3,14];case 14:_iteratorNormalCompletion=true;return[3,2];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 18:return[2,{stdout:o,stderr:"",exitCode:a?1:0}]}})})()}},Pwe={name:"readlink",flags:[{flag:"-f",type:"boolean"},{flag:"-e",type:"boolean"}],needsArgs:!0}});function Rwe(e,t){var r=10,n=null,i=!1,o=!1,a=!1,s=[];for(var l=0;l<e.length;l++){var c=e[l];if(c==="-n"&&l+1<e.length){var d=e[++l];t==="tail"&&d.startsWith("+")?(a=!0,r=parseInt(d.slice(1),10)):r=parseInt(d,10)}else if(t==="tail"&&c.startsWith("-n+"))a=!0,r=parseInt(c.slice(3),10);else if(c.startsWith("-n"))r=parseInt(c.slice(2),10);else if(c==="-c"&&l+1<e.length)n=parseInt(e[++l],10);else if(c.startsWith("-c"))n=parseInt(c.slice(2),10);else if(c.startsWith("--bytes="))n=parseInt(c.slice(8),10);else if(c.startsWith("--lines="))r=parseInt(c.slice(8),10);else if(c==="-q"||c==="--quiet"||c==="--silent")i=!0;else if(c==="-v"||c==="--verbose")o=!0;else if(c.match(/^-\d+$/))r=parseInt(c.slice(1),10);else{if(c.startsWith("--"))return{ok:!1,error:fr(t,c)};if(c.startsWith("-")&&c!=="-")return{ok:!1,error:fr(t,c)};s.push(c)}}return n!==null&&(Number.isNaN(n)||n<0)?{ok:!1,error:{stdout:"",stderr:"".concat(t,": invalid number of bytes\n"),exitCode:1}}:Number.isNaN(r)||r<0?{ok:!1,error:{stdout:"",stderr:"".concat(t,": invalid number of lines\n"),exitCode:1}}:{ok:!0,options:{lines:r,bytes:n,quiet:i,verbose:o,files:s,fromLine:a}}}function Mwe(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,l,c,d,u,p,m,h,g,h10;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=t.quiet,o=t.verbose,a=t.files;if(a.length===0)return[2,{stdout:n(e.stdin),stderr:"",exitCode:0,stdoutEncoding:"binary"}];s="",l="",c=0,d=o||!i&&a.length>1,u=0;p=0;_state.label=1;case 1:if(!(p<a.length))return[3,6];m=a[p];_state.label=2;case 2:_state.trys.push([2,4,,5]);h=e.fs.resolvePath(e.cwd,m);return[4,p_(e.fs,h)];case 3:g=_state.sent();d&&(u>0&&(s+="\n"),s+=n1("==> ".concat(m," <==\n"))),s+=n(g),u++;return[3,5];case 4:h10=_state.sent();l+="".concat(r,": ").concat(m,": No such file or directory\n"),c=1;return[3,5];case 5:p++;return[3,1];case 6:return[2,{stdout:s,stderr:l,exitCode:c,stdoutEncoding:"binary"}]}})})()}function Mpt(e,t,r){if(r!==null)return e.slice(0,r);if(t===0)return"";var n=0,i=0,o=e.length;for(;n<o&&i<t;){var a=e.indexOf("\n",n);if(a===-1)return"".concat(e,"\n");i++,n=a+1}return n>0?e.slice(0,n):""}function Opt(e,t,r,n){if(r!==null)return e.slice(-r);var i=e.length;if(i===0)return"";if(n){var l=0,c=1;for(;l<i&&c<t;){var u=e.indexOf("\n",l);if(u===-1)break;c++,l=u+1}var d=e.slice(l);return d.endsWith("\n")?d:"".concat(d,"\n")}if(t===0)return"";var o=i-1;e[o]==="\n"&&o--;var a=0;for(;o>=0&&a<t;){if(e[o]==="\n"&&(a++,a===t)){o++;break}o--}o<0&&(o=0);var s=e.slice(o);return e[i-1]==="\n"?s:"".concat(s,"\n")}var Owe=se(function(){"use strict";kr(),jt()}),$we={};St($we,{flagsForFuzzing:function(){return Dwe},headCommand:function(){return Nwe}});var Fye,Nwe,Dwe,$pt=se(function(){"use strict";jt(),Owe(),Fye={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},Nwe={name:"head",execute:function execute(e,t){return _async_to_generator(function(){var r,_r_options,n,i;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(Fye)];r=Rwe(e,"head");if(!r.ok)return[2,r.error];_r_options=r.options,n=_r_options.lines,i=_r_options.bytes;return[2,Mwe(t,r.options,"head",function(o){return Mpt(o,n,i)})]})})()}},Dwe={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}}),Lwe={};St(Lwe,{flagsForFuzzing:function(){return zwe},tailCommand:function(){return Fwe}});var zye,Fwe,zwe,Npt=se(function(){"use strict";Owe(),jt(),zye={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},Fwe={name:"tail",execute:function execute(e,t){return _async_to_generator(function(){var r,_r_options,n,i,o;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(zye)];r=Rwe(e,"tail");if(!r.ok)return[2,r.error];_r_options=r.options,n=_r_options.lines,i=_r_options.bytes,o=_r_options.fromLine;return[2,Mwe(t,r.options,"tail",function(a){return Opt(a,n,i,o!=null?o:!1)})]})})()}},zwe={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0}}),jwe={};St(jwe,{flagsForFuzzing:function(){return Bwe},wcCommand:function(){return Uwe}});function jye(e,t){var r=e,n=r.length,i=t?Array.from(Sn(e)).length:n,o=0,a=0,s=!1;for(var l=0;l<n;l++){var c=r[l];c==="\n"?(o++,s&&(a++,s=!1)):c===" "||c===" "||c==="\r"?s&&(a++,s=!1):s=!0}return s&&a++,{lines:o,words:a,third:i}}function qB(e,t,r,n,i,o){var a=[];t&&a.push(String(e.lines).padStart(o)),r&&a.push(String(e.words).padStart(o)),n&&a.push(String(e.third).padStart(o));var s=a.join(" ");return i&&(s+=" ".concat(i)),s}var Uye,Bye,Uwe,Bwe,Dpt=se(function(){"use strict";kr(),zo(),f_(),jt(),Uye={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},Bye={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},Uwe={name:"wc",execute:function execute(e,t){return _async_to_generator(function(){var _Math,_Math1,_Math2,r,_r_result_flags,n,i,o,a,s,l,c,_,d,u,p,m,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,_10,b,w,h,g,x,v,y,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value1,_11,b10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Uye)];r=Fo("wc",e,Bye);if(!r.ok)return[2,r.error];_r_result_flags=r.result.flags,n=_r_result_flags.lines,i=_r_result_flags.words,o=r.result.flags.bytes,a=r.result.flags.chars,s=r.result.positional;!n&&!i&&!o&&!a&&(n=i=o=!0);l=o||a;return[4,W9(t,s,{cmdName:"wc",stopOnError:!1})];case 1:c=_state.sent();if(s.length===0){_=jye(c.files[0].content,a);return[2,{stdout:"".concat(qB(_,n,i,l,"",0),"\n"),stderr:"",exitCode:0}]}d=[],u=0,p=0,m=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c.files[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_step.value,_10=_step_value.filename,b=_step_value.content;w=jye(b,a);u+=w.lines,p+=w.words,m+=w.third,d.push({filename:_10,stats:w})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}h=s.length>1?u:(_Math=Math).max.apply(_Math,_to_consumable_array(d.map(function(_){return _.stats.lines}))),g=s.length>1?p:(_Math1=Math).max.apply(_Math1,_to_consumable_array(d.map(function(_){return _.stats.words}))),x=s.length>1?m:(_Math2=Math).max.apply(_Math2,_to_consumable_array(d.map(function(_){return _.stats.third}))),v=s.length>1?3:0;n&&(v=Math.max(v,String(h).length)),i&&(v=Math.max(v,String(g).length)),l&&(v=Math.max(v,String(x).length));y="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=d[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value1=_step1.value,_11=_step_value1.filename,b10=_step_value1.stats;y+="".concat(qB(b10,n,i,l,_11,v),"\n")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,(s.length>1&&(y+="".concat(qB({lines:u,words:p,third:m},n,i,l,"total",v),"\n")),{stdout:y,stderr:c.stderr,exitCode:c.exitCode})]}})})()}},Bwe={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0}});function nW(e,t){var r=t?"d":"-",n=[e&256?"r":"-",e&128?"w":"-",e&64?"x":"-",e&32?"r":"-",e&16?"w":"-",e&8?"x":"-",e&4?"r":"-",e&2?"w":"-",e&1?"x":"-"];return r+n.join("")}var qwe=se(function(){"use strict"}),Wwe={};St(Wwe,{flagsForFuzzing:function(){return Gwe},statCommand:function(){return Vwe}});var qye,Wye,Vwe,Gwe,Lpt=se(function(){"use strict";zo(),qwe(),jt(),qye={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},Wye={format:{short:"c",type:"string"}},Vwe={name:"stat",execute:function execute(e,t){return _async_to_generator(function(){var l,r,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,u,p,m,h,p10,m10,u10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(qye)];r=Fo("stat",e,Wye);if(!r.ok)return[2,r.error];n=(l=r.result.flags.format)!=null?l:null,i=r.result.positional;if(i.length===0)return[2,{stdout:"",stderr:"stat: missing operand\n",exitCode:1}];o="",a="",s=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];c=_step.value;d=t.fs.resolvePath(t.cwd,c);_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,t.fs.stat(d)];case 4:u=_state.sent();if(n){p=n,m=u.mode.toString(8),h=nW(u.mode,u.isDirectory);p=p.replace(/%n/g,c),p=p.replace(/%N/g,"'".concat(c,"'")),p=p.replace(/%s/g,String(u.size)),p=p.replace(/%F/g,u.isDirectory?"directory":"regular file"),p=p.replace(/%a/g,m),p=p.replace(/%A/g,h),p=p.replace(/%u/g,"1000"),p=p.replace(/%U/g,"user"),p=p.replace(/%g/g,"1000"),p=p.replace(/%G/g,"group"),o+="".concat(p,"\n")}else{p10=u.mode.toString(8).padStart(4,"0"),m10=nW(u.mode,u.isDirectory);o+=" File: ".concat(c,"\n"),o+=" Size: ".concat(u.size," Blocks: ").concat(Math.ceil(u.size/512),"\n"),o+="Access: (".concat(p10,"/").concat(m10,")\n"),o+="Modify: ".concat(u.mtime.toISOString(),"\n")}return[3,6];case 5:u10=_state.sent();a+="stat: cannot stat '".concat(c,"': No such file or directory\n"),s=!0;return[3,6];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2,{stdout:o,stderr:a,exitCode:s?1:0}]}})})()}},Gwe={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0}}),ct,ke,le,Vc,dr,pn,WB,j0,VB,Vye,RS,Pf,Gye,Hye,$i,MS,ci,Zye,dp,Kye,GB,mr,Qye,HB,HI,Jye,Yye,Xye,e2e,Ae,t2e,OS,r2e,n2e,fn,ZB,KB,QB,JB,YB,XB,eq,tq,rq,nq,iq,oq,aq,sq,lq,uq,cq,dq,pq,Rf,ZI,i2e,o2e,a2e,s2e,l2e,i_,Fpt=se(function(){var e,t,r,n,i,o,a,s,l,c;ct=(e=function e(){"use strict";_class_call_check(this,e)},A(e,"FOLD_CASE",1),A(e,"LITERAL",2),A(e,"CLASS_NL",4),A(e,"DOT_NL",8),A(e,"ONE_LINE",16),A(e,"NON_GREEDY",32),A(e,"PERL_X",64),A(e,"UNICODE_GROUPS",128),A(e,"WAS_DOLLAR",256),A(e,"MATCH_NL",e.CLASS_NL|e.DOT_NL),A(e,"PERL",e.CLASS_NL|e.ONE_LINE|e.PERL_X|e.UNICODE_GROUPS),A(e,"POSIX",0),A(e,"UNANCHORED",0),A(e,"ANCHOR_START",1),A(e,"ANCHOR_BOTH",2),e),ke=(t=/*#__PURE__*/function(){"use strict";function t(){_class_call_check(this,t)}_create_class(t,null,[{key:"toUpperCase",value:function toUpperCase(d){var u=String.fromCodePoint(d).toUpperCase();if(u.length>1)return d;var p=String.fromCodePoint(u.codePointAt(0)).toLowerCase();return p.length>1||p.codePointAt(0)!==d?d:u.codePointAt(0)}},{key:"toLowerCase",value:function toLowerCase(d){var u=String.fromCodePoint(d).toLowerCase();if(u.length>1)return d;var p=String.fromCodePoint(u.codePointAt(0)).toUpperCase();return p.length>1||p.codePointAt(0)!==d?d:u.codePointAt(0)}}]);return t}(),A(t,"CODES",new Map([["\x07",7],["\b",8],[" ",9],["\n",10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]])),t),le=/*#__PURE__*/function(){"use strict";function le1(d){_class_call_check(this,le1);A(this,"SIZE",3);this.data=d}_create_class(le1,[{key:"getLo",value:function getLo(d){return this.data[d*this.SIZE]}},{key:"getHi",value:function getHi(d){return this.data[d*this.SIZE+1]}},{key:"getStride",value:function getStride(d){return this.data[d*this.SIZE+2]}},{key:"get",value:function get1(d){var u=d*this.SIZE;return[this.data[u],this.data[u+1],this.data[u+2]]}},{key:"length",get:function get1(){return this.data.length/this.SIZE}}]);return le1}(),Vc=(r=function r(){"use strict";_class_call_check(this,r)},A(r,"CASE_ORBIT",new Map([[75,107],[107,8490],[8490,75],[83,115],[115,383],[383,83],[181,924],[924,956],[956,181],[197,229],[229,8491],[8491,197],[452,453],[453,454],[454,452],[455,456],[456,457],[457,455],[458,459],[459,460],[460,458],[497,498],[498,499],[499,497],[837,921],[921,953],[953,8126],[8126,837],[914,946],[946,976],[976,914],[917,949],[949,1013],[1013,917],[920,952],[952,977],[977,1012],[1012,920],[922,954],[954,1008],[1008,922],[928,960],[960,982],[982,928],[929,961],[961,1009],[1009,929],[931,962],[962,963],[963,931],[934,966],[966,981],[981,934],[937,969],[969,8486],[8486,937],[1042,1074],[1074,7296],[7296,1042],[1044,1076],[1076,7297],[7297,1044],[1054,1086],[1086,7298],[7298,1054],[1057,1089],[1089,7299],[7299,1057],[1058,1090],[1090,7300],[7300,7301],[7301,1058],[1066,1098],[1098,7302],[7302,1066],[1122,1123],[1123,7303],[7303,1122],[7304,42570],[42570,42571],[42571,7304],[7776,7777],[7777,7835],[7835,7776],[223,7838],[7838,223],[8064,8072],[8072,8064],[8065,8073],[8073,8065],[8066,8074],[8074,8066],[8067,8075],[8075,8067],[8068,8076],[8076,8068],[8069,8077],[8077,8069],[8070,8078],[8078,8070],[8071,8079],[8079,8071],[8080,8088],[8088,8080],[8081,8089],[8089,8081],[8082,8090],[8090,8082],[8083,8091],[8091,8083],[8084,8092],[8092,8084],[8085,8093],[8093,8085],[8086,8094],[8094,8086],[8087,8095],[8095,8087],[8096,8104],[8104,8096],[8097,8105],[8105,8097],[8098,8106],[8106,8098],[8099,8107],[8107,8099],[8100,8108],[8108,8100],[8101,8109],[8109,8101],[8102,8110],[8110,8102],[8103,8111],[8111,8103],[8115,8124],[8124,8115],[8131,8140],[8140,8131],[912,8147],[8147,912],[944,8163],[8163,944],[8179,8188],[8188,8179],[64261,64262],[64262,64261],[66560,66600],[66600,66560],[66561,66601],[66601,66561],[66562,66602],[66602,66562],[66563,66603],[66603,66563],[66564,66604],[66604,66564],[66565,66605],[66605,66565],[66566,66606],[66606,66566],[66567,66607],[66607,66567],[66568,66608],[66608,66568],[66569,66609],[66609,66569],[66570,66610],[66610,66570],[66571,66611],[66611,66571],[66572,66612],[66612,66572],[66573,66613],[66613,66573],[66574,66614],[66614,66574],[66575,66615],[66615,66575],[66576,66616],[66616,66576],[66577,66617],[66617,66577],[66578,66618],[66618,66578],[66579,66619],[66619,66579],[66580,66620],[66620,66580],[66581,66621],[66621,66581],[66582,66622],[66622,66582],[66583,66623],[66623,66583],[66584,66624],[66624,66584],[66585,66625],[66625,66585],[66586,66626],[66626,66586],[66587,66627],[66627,66587],[66588,66628],[66628,66588],[66589,66629],[66629,66589],[66590,66630],[66630,66590],[66591,66631],[66631,66591],[66592,66632],[66632,66592],[66593,66633],[66633,66593],[66594,66634],[66634,66594],[66595,66635],[66635,66595],[66596,66636],[66636,66596],[66597,66637],[66637,66597],[66598,66638],[66638,66598],[66599,66639],[66639,66599],[66736,66776],[66776,66736],[66737,66777],[66777,66737],[66738,66778],[66778,66738],[66739,66779],[66779,66739],[66740,66780],[66780,66740],[66741,66781],[66781,66741],[66742,66782],[66782,66742],[66743,66783],[66783,66743],[66744,66784],[66784,66744],[66745,66785],[66785,66745],[66746,66786],[66786,66746],[66747,66787],[66787,66747],[66748,66788],[66788,66748],[66749,66789],[66789,66749],[66750,66790],[66790,66750],[66751,66791],[66791,66751],[66752,66792],[66792,66752],[66753,66793],[66793,66753],[66754,66794],[66794,66754],[66755,66795],[66795,66755],[66756,66796],[66796,66756],[66757,66797],[66797,66757],[66758,66798],[66798,66758],[66759,66799],[66799,66759],[66760,66800],[66800,66760],[66761,66801],[66801,66761],[66762,66802],[66802,66762],[66763,66803],[66803,66763],[66764,66804],[66804,66764],[66765,66805],[66805,66765],[66766,66806],[66806,66766],[66767,66807],[66807,66767],[66768,66808],[66808,66768],[66769,66809],[66809,66769],[66770,66810],[66810,66770],[66771,66811],[66811,66771],[66928,66967],[66967,66928],[66929,66968],[66968,66929],[66930,66969],[66969,66930],[66931,66970],[66970,66931],[66932,66971],[66971,66932],[66933,66972],[66972,66933],[66934,66973],[66973,66934],[66935,66974],[66974,66935],[66936,66975],[66975,66936],[66937,66976],[66976,66937],[66938,66977],[66977,66938],[66940,66979],[66979,66940],[66941,66980],[66980,66941],[66942,66981],[66981,66942],[66943,66982],[66982,66943],[66944,66983],[66983,66944],[66945,66984],[66984,66945],[66946,66985],[66985,66946],[66947,66986],[66986,66947],[66948,66987],[66987,66948],[66949,66988],[66988,66949],[66950,66989],[66989,66950],[66951,66990],[66990,66951],[66952,66991],[66991,66952],[66953,66992],[66992,66953],[66954,66993],[66993,66954],[66956,66995],[66995,66956],[66957,66996],[66996,66957],[66958,66997],[66997,66958],[66959,66998],[66998,66959],[66960,66999],[66999,66960],[66961,67e3],[67e3,66961],[66962,67001],[67001,66962],[66964,67003],[67003,66964],[66965,67004],[67004,66965],[68736,68800],[68800,68736],[68737,68801],[68801,68737],[68738,68802],[68802,68738],[68739,68803],[68803,68739],[68740,68804],[68804,68740],[68741,68805],[68805,68741],[68742,68806],[68806,68742],[68743,68807],[68807,68743],[68744,68808],[68808,68744],[68745,68809],[68809,68745],[68746,68810],[68810,68746],[68747,68811],[68811,68747],[68748,68812],[68812,68748],[68749,68813],[68813,68749],[68750,68814],[68814,68750],[68751,68815],[68815,68751],[68752,68816],[68816,68752],[68753,68817],[68817,68753],[68754,68818],[68818,68754],[68755,68819],[68819,68755],[68756,68820],[68820,68756],[68757,68821],[68821,68757],[68758,68822],[68822,68758],[68759,68823],[68823,68759],[68760,68824],[68824,68760],[68761,68825],[68825,68761],[68762,68826],[68826,68762],[68763,68827],[68827,68763],[68764,68828],[68828,68764],[68765,68829],[68829,68765],[68766,68830],[68830,68766],[68767,68831],[68831,68767],[68768,68832],[68832,68768],[68769,68833],[68833,68769],[68770,68834],[68834,68770],[68771,68835],[68835,68771],[68772,68836],[68836,68772],[68773,68837],[68837,68773],[68774,68838],[68838,68774],[68775,68839],[68839,68775],[68776,68840],[68840,68776],[68777,68841],[68841,68777],[68778,68842],[68842,68778],[68779,68843],[68843,68779],[68780,68844],[68844,68780],[68781,68845],[68845,68781],[68782,68846],[68846,68782],[68783,68847],[68847,68783],[68784,68848],[68848,68784],[68785,68849],[68849,68785],[68786,68850],[68850,68786],[68944,68976],[68976,68944],[68945,68977],[68977,68945],[68946,68978],[68978,68946],[68947,68979],[68979,68947],[68948,68980],[68980,68948],[68949,68981],[68981,68949],[68950,68982],[68982,68950],[68951,68983],[68983,68951],[68952,68984],[68984,68952],[68953,68985],[68985,68953],[68954,68986],[68986,68954],[68955,68987],[68987,68955],[68956,68988],[68988,68956],[68957,68989],[68989,68957],[68958,68990],[68990,68958],[68959,68991],[68991,68959],[68960,68992],[68992,68960],[68961,68993],[68993,68961],[68962,68994],[68994,68962],[68963,68995],[68995,68963],[68964,68996],[68996,68964],[68965,68997],[68997,68965],[71840,71872],[71872,71840],[71841,71873],[71873,71841],[71842,71874],[71874,71842],[71843,71875],[71875,71843],[71844,71876],[71876,71844],[71845,71877],[71877,71845],[71846,71878],[71878,71846],[71847,71879],[71879,71847],[71848,71880],[71880,71848],[71849,71881],[71881,71849],[71850,71882],[71882,71850],[71851,71883],[71883,71851],[71852,71884],[71884,71852],[71853,71885],[71885,71853],[71854,71886],[71886,71854],[71855,71887],[71887,71855],[71856,71888],[71888,71856],[71857,71889],[71889,71857],[71858,71890],[71890,71858],[71859,71891],[71891,71859],[71860,71892],[71892,71860],[71861,71893],[71893,71861],[71862,71894],[71894,71862],[71863,71895],[71895,71863],[71864,71896],[71896,71864],[71865,71897],[71897,71865],[71866,71898],[71898,71866],[71867,71899],[71899,71867],[71868,71900],[71900,71868],[71869,71901],[71901,71869],[71870,71902],[71902,71870],[71871,71903],[71903,71871],[93760,93792],[93792,93760],[93761,93793],[93793,93761],[93762,93794],[93794,93762],[93763,93795],[93795,93763],[93764,93796],[93796,93764],[93765,93797],[93797,93765],[93766,93798],[93798,93766],[93767,93799],[93799,93767],[93768,93800],[93800,93768],[93769,93801],[93801,93769],[93770,93802],[93802,93770],[93771,93803],[93803,93771],[93772,93804],[93804,93772],[93773,93805],[93805,93773],[93774,93806],[93806,93774],[93775,93807],[93807,93775],[93776,93808],[93808,93776],[93777,93809],[93809,93777],[93778,93810],[93810,93778],[93779,93811],[93811,93779],[93780,93812],[93812,93780],[93781,93813],[93813,93781],[93782,93814],[93814,93782],[93783,93815],[93815,93783],[93784,93816],[93816,93784],[93785,93817],[93817,93785],[93786,93818],[93818,93786],[93787,93819],[93819,93787],[93788,93820],[93820,93788],[93789,93821],[93821,93789],[93790,93822],[93822,93790],[93791,93823],[93823,93791],[125184,125218],[125218,125184],[125185,125219],[125219,125185],[125186,125220],[125220,125186],[125187,125221],[125221,125187],[125188,125222],[125222,125188],[125189,125223],[125223,125189],[125190,125224],[125224,125190],[125191,125225],[125225,125191],[125192,125226],[125226,125192],[125193,125227],[125227,125193],[125194,125228],[125228,125194],[125195,125229],[125229,125195],[125196,125230],[125230,125196],[125197,125231],[125231,125197],[125198,125232],[125232,125198],[125199,125233],[125233,125199],[125200,125234],[125234,125200],[125201,125235],[125235,125201],[125202,125236],[125236,125202],[125203,125237],[125237,125203],[125204,125238],[125238,125204],[125205,125239],[125239,125205],[125206,125240],[125240,125206],[125207,125241],[125241,125207],[125208,125242],[125242,125208],[125209,125243],[125243,125209],[125210,125244],[125244,125210],[125211,125245],[125245,125211],[125212,125246],[125246,125212],[125213,125247],[125247,125213],[125214,125248],[125248,125214],[125215,125249],[125249,125215],[125216,125250],[125250,125216],[125217,125251],[125251,125217]])),A(r,"C",new le(new Uint32Array([0,31,1,127,159,1,173,888,715,889,896,7,897,899,1,907,909,2,930,1328,398,1367,1368,1,1419,1420,1,1424,1480,56,1481,1487,1,1515,1518,1,1525,1541,1,1564,1757,193,1806,1807,1,1867,1868,1,1970,1983,1,2043,2044,1,2094,2095,1,2111,2140,29,2141,2143,2,2155,2159,1,2191,2198,1,2274,2436,162,2445,2446,1,2449,2450,1,2473,2481,8,2483,2485,1,2490,2491,1,2501,2502,1,2505,2506,1,2511,2518,1,2520,2523,1,2526,2532,6,2533,2559,26,2560,2564,4,2571,2574,1,2577,2578,1,2601,2609,8,2612,2618,3,2619,2621,2,2627,2630,1,2633,2634,1,2638,2640,1,2642,2648,1,2653,2655,2,2656,2661,1,2679,2688,1,2692,2702,10,2706,2729,23,2737,2740,3,2746,2747,1,2758,2766,4,2767,2769,2,2770,2783,1,2788,2789,1,2802,2808,1,2816,2820,4,2829,2830,1,2833,2834,1,2857,2865,8,2868,2874,6,2875,2885,10,2886,2889,3,2890,2894,4,2895,2900,1,2904,2907,1,2910,2916,6,2917,2936,19,2937,2945,1,2948,2955,7,2956,2957,1,2961,2966,5,2967,2968,1,2971,2973,2,2976,2978,1,2981,2983,1,2987,2989,1,3002,3005,1,3011,3013,1,3017,3022,5,3023,3025,2,3026,3030,1,3032,3045,1,3067,3071,1,3085,3089,4,3113,3130,17,3131,3141,10,3145,3150,5,3151,3156,1,3159,3163,4,3164,3166,2,3167,3172,5,3173,3184,11,3185,3190,1,3213,3217,4,3241,3252,11,3258,3259,1,3269,3273,4,3278,3284,1,3287,3292,1,3295,3300,5,3301,3312,11,3316,3327,1,3341,3345,4,3397,3401,4,3408,3411,1,3428,3429,1,3456,3460,4,3479,3481,1,3506,3516,10,3518,3519,1,3527,3529,1,3531,3534,1,3541,3543,2,3552,3557,1,3568,3569,1,3573,3584,1,3643,3646,1,3676,3712,1,3715,3717,2,3723,3748,25,3750,3774,24,3775,3781,6,3783,3791,8,3802,3803,1,3808,3839,1,3912,3949,37,3950,3952,1,3992,4029,37,4045,4059,14,4060,4095,1,4294,4296,2,4297,4300,1,4302,4303,1,4681,4686,5,4687,4695,8,4697,4702,5,4703,4745,42,4750,4751,1,4785,4790,5,4791,4799,8,4801,4806,5,4807,4823,16,4881,4886,5,4887,4955,68,4956,4989,33,4990,4991,1,5018,5023,1,5110,5111,1,5118,5119,1,5789,5791,1,5881,5887,1,5910,5918,1,5943,5951,1,5972,5983,1,5997,6001,4,6004,6015,1,6110,6111,1,6122,6127,1,6138,6143,1,6158,6170,12,6171,6175,1,6265,6271,1,6315,6319,1,6390,6399,1,6431,6444,13,6445,6447,1,6460,6463,1,6465,6467,1,6510,6511,1,6517,6527,1,6572,6575,1,6602,6607,1,6619,6621,1,6684,6685,1,6751,6781,30,6782,6794,12,6795,6799,1,6810,6815,1,6830,6831,1,6863,6911,1,6989,7156,167,7157,7163,1,7224,7226,1,7242,7244,1,7307,7311,1,7355,7356,1,7368,7375,1,7419,7423,1,7958,7959,1,7966,7967,1,8006,8007,1,8014,8015,1,8024,8030,2,8062,8063,1,8117,8133,16,8148,8149,1,8156,8176,20,8177,8181,4,8191,8203,12,8204,8207,1,8234,8238,1,8288,8303,1,8306,8307,1,8335,8349,14,8350,8351,1,8385,8399,1,8433,8447,1,8588,8591,1,9258,9279,1,9291,9311,1,11124,11125,1,11158,11508,350,11509,11512,1,11558,11560,2,11561,11564,1,11566,11567,1,11624,11630,1,11633,11646,1,11671,11679,1,11687,11743,8,11870,11903,1,11930,12020,90,12021,12031,1,12246,12271,1,12352,12439,87,12440,12544,104,12545,12548,1,12592,12687,95,12774,12782,1,12831,42125,29294,42126,42127,1,42183,42191,1,42540,42559,1,42744,42751,1,42958,42959,1,42962,42964,2,42973,42993,1,43053,43055,1,43066,43071,1,43128,43135,1,43206,43213,1,43226,43231,1,43348,43358,1,43389,43391,1,43470,43482,12,43483,43485,1,43519,43575,56,43576,43583,1,43598,43599,1,43610,43611,1,43715,43738,1,43767,43776,1,43783,43784,1,43791,43792,1,43799,43807,1,43815,43823,8,43884,43887,1,44014,44015,1,44026,44031,1,55204,55215,1,55239,55242,1,55292,63743,1,64110,64111,1,64218,64255,1,64263,64274,1,64280,64284,1,64311,64317,6,64319,64325,3,64451,64466,1,64912,64913,1,64968,64974,1,64976,65007,1,65050,65055,1,65107,65127,20,65132,65135,1,65141,65277,136,65278,65280,1,65471,65473,1,65480,65481,1,65488,65489,1,65496,65497,1,65501,65503,1,65511,65519,8,65520,65531,1,65534,65535,1,65548,65575,27,65595,65598,3,65614,65615,1,65630,65663,1,65787,65791,1,65795,65798,1,65844,65846,1,65935,65949,14,65950,65951,1,65953,65999,1,66046,66175,1,66205,66207,1,66257,66271,1,66300,66303,1,66340,66348,1,66379,66383,1,66427,66431,1,66462,66500,38,66501,66503,1,66518,66559,1,66718,66719,1,66730,66735,1,66772,66775,1,66812,66815,1,66856,66863,1,66916,66926,1,66939,66955,16,66963,66966,3,66978,66994,16,67002,67005,3,67006,67007,1,67060,67071,1,67383,67391,1,67414,67423,1,67432,67455,1,67462,67505,43,67515,67583,1,67590,67591,1,67593,67638,45,67641,67643,1,67645,67646,1,67670,67743,73,67744,67750,1,67760,67807,1,67827,67830,3,67831,67834,1,67868,67870,1,67898,67902,1,67904,67967,1,68024,68027,1,68048,68049,1,68100,68103,3,68104,68107,1,68116,68120,4,68150,68151,1,68155,68158,1,68169,68175,1,68185,68191,1,68256,68287,1,68327,68330,1,68343,68351,1,68406,68408,1,68438,68439,1,68467,68471,1,68498,68504,1,68509,68520,1,68528,68607,1,68681,68735,1,68787,68799,1,68851,68857,1,68904,68911,1,68922,68927,1,68966,68968,1,68998,69005,1,69008,69215,1,69247,69290,43,69294,69295,1,69298,69313,1,69317,69371,1,69416,69423,1,69466,69487,1,69514,69551,1,69580,69599,1,69623,69631,1,69710,69713,1,69750,69758,1,69821,69827,6,69828,69839,1,69865,69871,1,69882,69887,1,69941,69960,19,69961,69967,1,70007,70015,1,70112,70133,21,70134,70143,1,70162,70210,48,70211,70271,1,70279,70281,2,70286,70302,16,70314,70319,1,70379,70383,1,70394,70399,1,70404,70413,9,70414,70417,3,70418,70441,23,70449,70452,3,70458,70469,11,70470,70473,3,70474,70478,4,70479,70481,2,70482,70486,1,70488,70492,1,70500,70501,1,70509,70511,1,70517,70527,1,70538,70540,2,70541,70543,2,70582,70593,11,70595,70596,1,70598,70603,5,70614,70617,3,70618,70624,1,70627,70655,1,70748,70754,6,70755,70783,1,70856,70863,1,70874,71039,1,71094,71095,1,71134,71167,1,71237,71247,1,71258,71263,1,71277,71295,1,71354,71359,1,71370,71375,1,71396,71423,1,71451,71452,1,71468,71471,1,71495,71679,1,71740,71839,1,71923,71934,1,71943,71944,1,71946,71947,1,71956,71959,3,71990,71993,3,71994,72007,13,72008,72015,1,72026,72095,1,72104,72105,1,72152,72153,1,72165,72191,1,72264,72271,1,72355,72367,1,72441,72447,1,72458,72639,1,72674,72687,1,72698,72703,1,72713,72759,46,72774,72783,1,72813,72815,1,72848,72849,1,72872,72887,15,72888,72959,1,72967,72970,3,73015,73017,1,73019,73022,3,73032,73039,1,73050,73055,1,73062,73065,3,73103,73106,3,73113,73119,1,73130,73439,1,73465,73471,1,73489,73531,42,73532,73533,1,73563,73647,1,73649,73663,1,73714,73726,1,74650,74751,1,74863,74869,6,74870,74879,1,75076,77711,1,77811,77823,1,78896,78911,1,78934,78943,1,82939,82943,1,83527,90367,1,90426,92159,1,92729,92735,1,92767,92778,11,92779,92781,1,92863,92874,11,92875,92879,1,92910,92911,1,92918,92927,1,92998,93007,1,93018,93026,8,93048,93052,1,93072,93503,1,93562,93759,1,93851,93951,1,94027,94030,1,94088,94094,1,94112,94175,1,94181,94191,1,94194,94207,1,100344,100351,1,101590,101630,1,101641,110575,1,110580,110588,8,110591,110883,292,110884,110897,1,110899,110927,1,110931,110932,1,110934,110947,1,110952,110959,1,111356,113663,1,113771,113775,1,113789,113791,1,113801,113807,1,113818,113819,1,113824,117759,1,118010,118015,1,118452,118527,1,118574,118575,1,118599,118607,1,118724,118783,1,119030,119039,1,119079,119080,1,119155,119162,1,119275,119295,1,119366,119487,1,119508,119519,1,119540,119551,1,119639,119647,1,119673,119807,1,119893,119965,72,119968,119969,1,119971,119972,1,119975,119976,1,119981,119994,13,119996,120004,8,120070,120075,5,120076,120085,9,120093,120122,29,120127,120133,6,120135,120137,1,120145,120486,341,120487,120780,293,120781,121484,703,121485,121498,1,121504,121520,16,121521,122623,1,122655,122660,1,122667,122879,1,122887,122905,18,122906,122914,8,122917,122923,6,122924,122927,1,122990,123022,1,123024,123135,1,123181,123183,1,123198,123199,1,123210,123213,1,123216,123535,1,123567,123583,1,123642,123646,1,123648,124111,1,124154,124367,1,124411,124414,1,124416,124895,1,124903,124908,5,124911,124927,16,125125,125126,1,125143,125183,1,125260,125263,1,125274,125277,1,125280,126064,1,126133,126208,1,126270,126463,1,126468,126496,28,126499,126501,2,126502,126504,2,126515,126520,5,126522,126524,2,126525,126529,1,126531,126534,1,126536,126540,2,126544,126547,3,126549,126550,1,126552,126560,2,126563,126565,2,126566,126571,5,126579,126589,5,126591,126602,11,126620,126624,1,126628,126634,6,126652,126703,1,126706,126975,1,127020,127023,1,127124,127135,1,127151,127152,1,127168,127184,16,127222,127231,1,127406,127461,1,127491,127503,1,127548,127551,1,127561,127567,1,127570,127583,1,127590,127743,1,128728,128731,1,128749,128751,1,128765,128767,1,128887,128890,1,128986,128991,1,129004,129007,1,129009,129023,1,129036,129039,1,129096,129103,1,129114,129119,1,129160,129167,1,129198,129199,1,129212,129215,1,129218,129279,1,129620,129631,1,129646,129647,1,129661,129663,1,129674,129678,1,129735,129741,1,129757,129758,1,129770,129775,1,129785,129791,1,129939,130042,103,130043,131071,1,173792,173823,1,177978,177983,1,178206,178207,1,183970,183983,1,191457,191471,1,192094,194559,1,195102,196607,1,201547,201551,1,205744,917759,1,918e3,1114111,1]))),A(r,"Cc",new le(new Uint32Array([0,31,1,127,159,1]))),A(r,"Cf",new le(new Uint32Array([173,1536,1363,1537,1541,1,1564,1757,193,1807,2192,385,2193,2274,81,6158,8203,2045,8204,8207,1,8234,8238,1,8288,8292,1,8294,8303,1,65279,65529,250,65530,65531,1,69821,69837,16,78896,78911,1,113824,113827,1,119155,119162,1,917505,917536,31,917537,917631,1]))),A(r,"Co",new le(new Uint32Array([57344,63743,1,983040,1048573,1,1048576,1114109,1]))),A(r,"Cs",new le(new Uint32Array([55296,57343,1]))),A(r,"L",new le(new Uint32Array([65,90,1,97,122,1,170,181,11,186,192,6,193,214,1,216,246,1,248,705,1,710,721,1,736,740,1,748,750,2,880,884,1,886,887,1,890,893,1,895,902,7,904,906,1,908,910,2,911,929,1,931,1013,1,1015,1153,1,1162,1327,1,1329,1366,1,1369,1376,7,1377,1416,1,1488,1514,1,1519,1522,1,1568,1610,1,1646,1647,1,1649,1747,1,1749,1765,16,1766,1774,8,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2036,2037,1,2042,2048,6,2049,2069,1,2074,2084,10,2088,2112,24,2113,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2249,1,2308,2361,1,2365,2384,19,2392,2401,1,2417,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3654,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3782,3804,22,3805,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4256,18,4257,4293,1,4295,4301,6,4304,4346,1,4348,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5024,5109,1,5112,5117,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6103,6108,5,6176,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6823,6917,94,6918,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7293,1,7296,7306,1,7312,7354,1,7357,7359,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,7424,6,7425,7615,1,7680,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8124,1,8126,8130,4,8131,8132,1,8134,8140,1,8144,8147,1,8150,8155,1,8160,8172,1,8178,8180,1,8182,8188,1,8305,8319,14,8336,8348,1,8450,8455,5,8458,8467,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8495,8505,1,8508,8511,1,8517,8521,1,8526,8579,53,8580,11264,2684,11265,11492,1,11499,11502,1,11506,11507,1,11520,11557,1,11559,11565,6,11568,11623,1,11631,11648,17,11649,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11823,12293,470,12294,12337,43,12338,12341,1,12347,12348,1,12353,12438,1,12445,12447,1,12449,12538,1,12540,12543,1,12549,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,42124,1,42192,42237,1,42240,42508,1,42512,42527,1,42538,42539,1,42560,42606,1,42623,42653,1,42656,42725,1,42775,42783,1,42786,42888,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43471,43488,17,43489,43492,1,43494,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43741,1,43744,43754,1,43762,43764,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43866,1,43868,43881,1,43888,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65313,65338,1,65345,65370,1,65382,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66560,66717,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68736,68786,1,68800,68850,1,68864,68899,1,68938,68965,1,68975,68997,1,69248,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71840,71903,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,92992,92995,1,93027,93047,1,93053,93071,1,93504,93548,1,93760,93823,1,93952,94026,1,94032,94099,67,94100,94111,1,94176,94177,1,94179,94208,29,94209,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120512,1,120514,120538,1,120540,120570,1,120572,120596,1,120598,120628,1,120630,120654,1,120656,120686,1,120688,120712,1,120714,120744,1,120746,120770,1,120772,120779,1,122624,122654,1,122661,122666,1,122928,122989,1,123136,123180,1,123191,123197,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124139,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125184,125251,1,125259,126464,1205,126465,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]))),A(r,"foldL",new le(new Uint32Array([837,837,1]))),A(r,"Ll",new le(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,311,2,312,328,2,329,375,2,378,382,2,383,384,1,387,389,2,392,396,4,397,402,5,405,409,4,410,411,1,414,417,3,419,421,2,424,426,2,427,429,2,432,436,4,438,441,3,442,445,3,446,447,1,454,460,3,462,476,2,477,495,2,496,499,3,501,505,4,507,563,2,564,569,1,572,575,3,576,578,2,583,591,2,592,659,1,661,687,1,881,883,2,887,891,4,892,893,1,912,940,28,941,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1020,1072,52,1073,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1376,1416,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7424,118,7425,7467,1,7531,7543,1,7545,7578,1,7681,7829,2,7830,7837,1,7839,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8016,8023,1,8032,8039,1,8048,8061,1,8064,8071,1,8080,8087,1,8096,8103,1,8112,8116,1,8118,8119,1,8126,8130,4,8131,8132,1,8134,8135,1,8144,8147,1,8150,8151,1,8160,8167,1,8178,8180,1,8182,8183,1,8458,8462,4,8463,8467,4,8495,8505,5,8508,8509,1,8518,8521,1,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11377,11379,2,11380,11382,2,11383,11387,1,11393,11491,2,11492,11500,8,11502,11507,5,11520,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42800,42801,1,42803,42865,2,42866,42872,1,42874,42876,2,42879,42887,2,42892,42894,2,42897,42899,2,42900,42901,1,42903,42921,2,42927,42933,6,42935,42947,2,42952,42954,2,42957,42961,4,42963,42971,2,42998,43002,4,43824,43866,1,43872,43880,1,43888,43967,1,64256,64262,1,64275,64279,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,119834,119859,1,119886,119892,1,119894,119911,1,119938,119963,1,119990,119993,1,119995,119997,2,119998,120003,1,120005,120015,1,120042,120067,1,120094,120119,1,120146,120171,1,120198,120223,1,120250,120275,1,120302,120327,1,120354,120379,1,120406,120431,1,120458,120485,1,120514,120538,1,120540,120545,1,120572,120596,1,120598,120603,1,120630,120654,1,120656,120661,1,120688,120712,1,120714,120719,1,120746,120770,1,120772,120777,1,120779,122624,1845,122625,122633,1,122635,122654,1,122661,122666,1,125218,125251,1]))),A(r,"foldLl",new le(new Uint32Array([65,90,1,192,214,1,216,222,1,256,302,2,306,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,453,1,455,456,1,458,459,1,461,475,2,478,494,2,497,498,1,500,502,2,503,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,837,880,43,882,886,4,895,902,7,904,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,984,9,986,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8072,8079,1,8088,8095,1,8104,8111,1,8120,8124,1,8136,8140,1,8152,8155,1,8168,8172,1,8184,8188,1,8486,8490,4,8491,8498,7,8579,11264,2685,11265,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,125184,125217,1]))),A(r,"Lm",new le(new Uint32Array([688,705,1,710,721,1,736,740,1,748,750,2,884,890,6,1369,1600,231,1765,1766,1,2036,2037,1,2042,2074,32,2084,2088,4,2249,2417,168,3654,3782,128,4348,6103,1755,6211,6823,612,7288,7293,1,7468,7530,1,7544,7579,35,7580,7615,1,8305,8319,14,8336,8348,1,11388,11389,1,11631,11823,192,12293,12337,44,12338,12341,1,12347,12445,98,12446,12540,94,12541,12542,1,40981,42232,1251,42233,42237,1,42508,42623,115,42652,42653,1,42775,42783,1,42864,42888,24,42994,42996,1,43e3,43001,1,43471,43494,23,43632,43741,109,43763,43764,1,43868,43871,1,43881,65392,21511,65438,65439,1,67456,67461,1,67463,67504,1,67506,67514,1,68942,68975,33,92992,92995,1,93504,93506,1,93547,93548,1,94099,94111,1,94176,94177,1,94179,110576,16397,110577,110579,1,110581,110587,1,110589,110590,1,122928,122989,1,123191,123197,1,124139,125259,1120]))),A(r,"Lo",new le(new Uint32Array([170,186,16,443,448,5,449,451,1,660,1488,828,1489,1514,1,1519,1522,1,1568,1599,1,1601,1610,1,1646,1647,1,1649,1747,1,1749,1774,25,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2048,2069,1,2112,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2248,1,2308,2361,1,2365,2384,19,2392,2401,1,2418,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3653,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3804,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4352,114,4353,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6108,6176,68,6177,6210,1,6212,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6917,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7287,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,8501,1083,8502,8504,1,11568,11623,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,12294,12348,54,12353,12438,1,12447,12449,2,12450,12538,1,12543,12549,6,12550,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,40980,1,40982,42124,1,42192,42231,1,42240,42507,1,42512,42527,1,42538,42539,1,42606,42656,50,42657,42725,1,42895,42999,104,43003,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43488,43492,1,43495,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43631,1,43633,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43740,1,43744,43754,1,43762,43777,15,43778,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43968,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65382,65391,1,65393,65437,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66640,66717,1,66816,66855,1,66864,66915,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68864,68899,1,68938,68941,1,68943,69248,305,69249,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,93027,93047,1,93053,93071,1,93507,93546,1,93952,94026,1,94032,94208,176,94209,100343,1,100352,101589,1,101631,101640,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,122634,123136,502,123137,123180,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124138,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]))),A(r,"Lt",new le(new Uint32Array([453,459,3,498,8072,7574,8073,8079,1,8088,8095,1,8104,8111,1,8124,8140,16,8188,8188,1]))),A(r,"foldLt",new le(new Uint32Array([452,454,2,455,457,2,458,460,2,497,499,2,8064,8071,1,8080,8087,1,8096,8103,1,8115,8131,16,8179,8179,1]))),A(r,"Lu",new le(new Uint32Array([65,90,1,192,214,1,216,222,1,256,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,461,3,463,475,2,478,494,2,497,500,3,502,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,880,882,2,886,895,9,902,904,2,905,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,978,3,979,980,1,984,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8120,8123,1,8136,8139,1,8152,8155,1,8168,8172,1,8184,8187,1,8450,8455,5,8459,8461,1,8464,8466,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8496,8499,1,8510,8511,1,8517,8579,62,11264,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,119808,119833,1,119860,119885,1,119912,119937,1,119964,119966,2,119967,119973,3,119974,119977,3,119978,119980,1,119982,119989,1,120016,120041,1,120068,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120120,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120172,120197,1,120224,120249,1,120276,120301,1,120328,120353,1,120380,120405,1,120432,120457,1,120488,120512,1,120546,120570,1,120604,120628,1,120662,120686,1,120720,120744,1,120778,125184,4406,125185,125217,1]))),A(r,"Upper",r.Lu),A(r,"foldLu",new le(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,303,2,307,311,2,314,328,2,331,375,2,378,382,2,383,384,1,387,389,2,392,396,4,402,405,3,409,411,1,414,417,3,419,421,2,424,429,5,432,436,4,438,441,3,445,447,2,453,454,1,456,457,1,459,460,1,462,476,2,477,495,2,498,499,1,501,505,4,507,543,2,547,563,2,572,575,3,576,578,2,583,591,2,592,596,1,598,599,1,601,603,2,604,608,4,609,611,2,612,614,1,616,620,1,623,625,2,626,629,3,637,640,3,642,643,1,647,652,1,658,669,11,670,837,167,881,883,2,887,891,4,892,893,1,940,943,1,945,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1072,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1377,1414,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7545,239,7549,7566,17,7681,7829,2,7835,7841,6,7843,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8017,8023,2,8032,8039,1,8048,8061,1,8112,8113,1,8126,8144,18,8145,8160,15,8161,8165,4,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11379,11382,3,11393,11491,2,11500,11502,2,11507,11520,13,11521,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42803,42863,2,42874,42876,2,42879,42887,2,42892,42897,5,42899,42900,1,42903,42921,2,42933,42947,2,42952,42954,2,42957,42961,4,42967,42971,2,42998,43859,861,43888,43967,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,125218,125251,1]))),A(r,"M",new le(new Uint32Array([768,879,1,1155,1161,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2307,1,2362,2364,1,2366,2383,1,2385,2391,1,2402,2403,1,2433,2435,1,2492,2494,2,2495,2500,1,2503,2504,1,2507,2509,1,2519,2530,11,2531,2558,27,2561,2563,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2672,31,2673,2677,4,2689,2691,1,2748,2750,2,2751,2757,1,2759,2761,1,2763,2765,1,2786,2787,1,2810,2815,1,2817,2819,1,2876,2878,2,2879,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2914,2915,1,2946,3006,60,3007,3010,1,3014,3016,1,3018,3021,1,3031,3072,41,3073,3076,1,3132,3134,2,3135,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3203,1,3260,3262,2,3263,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3298,3299,1,3315,3328,13,3329,3331,1,3387,3388,1,3390,3396,1,3398,3400,1,3402,3405,1,3415,3426,11,3427,3457,30,3458,3459,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3570,3571,1,3633,3636,3,3637,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3902,3903,1,3953,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4139,101,4140,4158,1,4182,4185,1,4190,4192,1,4194,4196,1,4199,4205,1,4209,4212,1,4226,4237,1,4239,4250,11,4251,4253,1,4957,4959,1,5906,5909,1,5938,5940,1,5970,5971,1,6002,6003,1,6068,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6443,1,6448,6459,1,6679,6683,1,6741,6750,1,6752,6780,1,6783,6832,49,6833,6862,1,6912,6916,1,6964,6980,1,7019,7027,1,7040,7042,1,7073,7085,1,7142,7155,1,7204,7223,1,7376,7378,1,7380,7400,1,7405,7412,7,7415,7417,1,7616,7679,1,8400,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12335,1,12441,12442,1,42607,42610,1,42612,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43043,24,43044,43047,1,43052,43136,84,43137,43188,51,43189,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43347,1,43392,43395,1,43443,43456,1,43493,43561,68,43562,43574,1,43587,43596,9,43597,43643,46,43644,43645,1,43696,43698,2,43699,43700,1,43703,43704,1,43710,43711,1,43713,43755,42,43756,43759,1,43765,43766,1,44003,44010,1,44012,44013,1,64286,65024,738,65025,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69632,69634,1,69688,69702,1,69744,69747,3,69748,69759,11,69760,69762,1,69808,69818,1,69826,69888,62,69889,69890,1,69927,69940,1,69957,69958,1,70003,70016,13,70017,70018,1,70067,70080,1,70089,70092,1,70094,70095,1,70188,70199,1,70206,70209,3,70367,70378,1,70400,70403,1,70459,70460,1,70462,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70502,3,70503,70508,1,70512,70516,1,70584,70592,1,70594,70597,3,70599,70602,1,70604,70608,1,70610,70625,15,70626,70709,83,70710,70726,1,70750,70832,82,70833,70851,1,71087,71093,1,71096,71104,1,71132,71133,1,71216,71232,1,71339,71351,1,71453,71467,1,71724,71738,1,71984,71989,1,71991,71992,1,71995,71998,1,72e3,72002,2,72003,72145,142,72146,72151,1,72154,72160,1,72164,72193,29,72194,72202,1,72243,72249,1,72251,72254,1,72263,72273,10,72274,72283,1,72330,72345,1,72751,72758,1,72760,72767,1,72850,72871,1,72873,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73098,67,73099,73102,1,73104,73105,1,73107,73111,1,73459,73462,1,73472,73473,1,73475,73524,49,73525,73530,1,73534,73538,1,73562,78912,5350,78919,78933,1,90398,90415,1,92912,92916,1,92976,92982,1,94031,94033,2,94034,94087,1,94095,94098,1,94180,94192,12,94193,113821,19628,113822,118528,4706,118529,118573,1,118576,118598,1,119141,119145,1,119149,119154,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]))),A(r,"foldM",new le(new Uint32Array([921,953,32,8126,8126,1]))),A(r,"Mc",new le(new Uint32Array([2307,2363,56,2366,2368,1,2377,2380,1,2382,2383,1,2434,2435,1,2494,2496,1,2503,2504,1,2507,2508,1,2519,2563,44,2622,2624,1,2691,2750,59,2751,2752,1,2761,2763,2,2764,2818,54,2819,2878,59,2880,2887,7,2888,2891,3,2892,2903,11,3006,3007,1,3009,3010,1,3014,3016,1,3018,3020,1,3031,3073,42,3074,3075,1,3137,3140,1,3202,3203,1,3262,3264,2,3265,3268,1,3271,3272,1,3274,3275,1,3285,3286,1,3315,3330,15,3331,3390,59,3391,3392,1,3398,3400,1,3402,3404,1,3415,3458,43,3459,3535,76,3536,3537,1,3544,3551,1,3570,3571,1,3902,3903,1,3967,4139,172,4140,4145,5,4152,4155,3,4156,4182,26,4183,4194,11,4195,4196,1,4199,4205,1,4227,4228,1,4231,4236,1,4239,4250,11,4251,4252,1,5909,5940,31,6070,6078,8,6079,6085,1,6087,6088,1,6435,6438,1,6441,6443,1,6448,6449,1,6451,6456,1,6681,6682,1,6741,6743,2,6753,6755,2,6756,6765,9,6766,6770,1,6916,6965,49,6971,6973,2,6974,6977,1,6979,6980,1,7042,7073,31,7078,7079,1,7082,7143,61,7146,7148,1,7150,7154,4,7155,7204,49,7205,7211,1,7220,7221,1,7393,7415,22,12334,12335,1,43043,43044,1,43047,43136,89,43137,43188,51,43189,43203,1,43346,43347,1,43395,43444,49,43445,43450,5,43451,43454,3,43455,43456,1,43567,43568,1,43571,43572,1,43597,43643,46,43645,43755,110,43758,43759,1,43765,44003,238,44004,44006,2,44007,44009,2,44010,44012,2,69632,69634,2,69762,69808,46,69809,69810,1,69815,69816,1,69932,69957,25,69958,70018,60,70067,70069,1,70079,70080,1,70094,70188,94,70189,70190,1,70194,70195,1,70197,70368,171,70369,70370,1,70402,70403,1,70462,70463,1,70465,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70584,85,70585,70586,1,70594,70597,3,70599,70602,1,70604,70605,1,70607,70709,102,70710,70711,1,70720,70721,1,70725,70832,107,70833,70834,1,70841,70843,2,70844,70846,1,70849,71087,238,71088,71089,1,71096,71099,1,71102,71216,114,71217,71218,1,71227,71228,1,71230,71340,110,71342,71343,1,71350,71454,104,71456,71457,1,71462,71724,262,71725,71726,1,71736,71984,248,71985,71989,1,71991,71992,1,71997,72e3,3,72002,72145,143,72146,72147,1,72156,72159,1,72164,72249,85,72279,72280,1,72343,72751,408,72766,72873,107,72881,72884,3,73098,73102,1,73107,73108,1,73110,73461,351,73462,73475,13,73524,73525,1,73534,73535,1,73537,90410,16873,90411,90412,1,94033,94087,1,94192,94193,1,119141,119142,1,119149,119154,1]))),A(r,"Me",new le(new Uint32Array([1160,1161,1,6846,8413,1567,8414,8416,1,8418,8420,1,42608,42610,1]))),A(r,"Mn",new le(new Uint32Array([768,879,1,1155,1159,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2306,1,2362,2364,2,2369,2376,1,2381,2385,4,2386,2391,1,2402,2403,1,2433,2492,59,2497,2500,1,2509,2530,21,2531,2558,27,2561,2562,1,2620,2625,5,2626,2631,5,2632,2635,3,2636,2637,1,2641,2672,31,2673,2677,4,2689,2690,1,2748,2753,5,2754,2757,1,2759,2760,1,2765,2786,21,2787,2810,23,2811,2815,1,2817,2876,59,2879,2881,2,2882,2884,1,2893,2901,8,2902,2914,12,2915,2946,31,3008,3021,13,3072,3076,4,3132,3134,2,3135,3136,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3260,59,3263,3270,7,3276,3277,1,3298,3299,1,3328,3329,1,3387,3388,1,3393,3396,1,3405,3426,21,3427,3457,30,3530,3538,8,3539,3540,1,3542,3633,91,3636,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3953,3966,1,3968,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4141,103,4142,4144,1,4146,4151,1,4153,4154,1,4157,4158,1,4184,4185,1,4190,4192,1,4209,4212,1,4226,4229,3,4230,4237,7,4253,4957,704,4958,4959,1,5906,5908,1,5938,5939,1,5970,5971,1,6002,6003,1,6068,6069,1,6071,6077,1,6086,6089,3,6090,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6434,1,6439,6440,1,6450,6457,7,6458,6459,1,6679,6680,1,6683,6742,59,6744,6750,1,6752,6754,2,6757,6764,1,6771,6780,1,6783,6832,49,6833,6845,1,6847,6862,1,6912,6915,1,6964,6966,2,6967,6970,1,6972,6978,6,7019,7027,1,7040,7041,1,7074,7077,1,7080,7081,1,7083,7085,1,7142,7144,2,7145,7149,4,7151,7153,1,7212,7219,1,7222,7223,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8400,8412,1,8417,8421,4,8422,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12333,1,12441,12442,1,42607,42612,5,42613,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43045,26,43046,43052,6,43204,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43345,1,43392,43394,1,43443,43446,3,43447,43449,1,43452,43453,1,43493,43561,68,43562,43566,1,43569,43570,1,43573,43574,1,43587,43596,9,43644,43696,52,43698,43700,1,43703,43704,1,43710,43711,1,43713,43756,43,43757,43766,9,44005,44008,3,44013,64286,20273,65024,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69633,69688,55,69689,69702,1,69744,69747,3,69748,69759,11,69760,69761,1,69811,69814,1,69817,69818,1,69826,69888,62,69889,69890,1,69927,69931,1,69933,69940,1,70003,70016,13,70017,70070,53,70071,70078,1,70089,70092,1,70095,70191,96,70192,70193,1,70196,70198,2,70199,70206,7,70209,70367,158,70371,70378,1,70400,70401,1,70459,70460,1,70464,70502,38,70503,70508,1,70512,70516,1,70587,70592,1,70606,70610,2,70625,70626,1,70712,70719,1,70722,70724,1,70726,70750,24,70835,70840,1,70842,70847,5,70848,70850,2,70851,71090,239,71091,71093,1,71100,71101,1,71103,71104,1,71132,71133,1,71219,71226,1,71229,71231,2,71232,71339,107,71341,71344,3,71345,71349,1,71351,71453,102,71455,71458,3,71459,71461,1,71463,71467,1,71727,71735,1,71737,71738,1,71995,71996,1,71998,72003,5,72148,72151,1,72154,72155,1,72160,72193,33,72194,72202,1,72243,72248,1,72251,72254,1,72263,72273,10,72274,72278,1,72281,72283,1,72330,72342,1,72344,72345,1,72752,72758,1,72760,72765,1,72767,72850,83,72851,72871,1,72874,72880,1,72882,72883,1,72885,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73104,73,73105,73109,4,73111,73459,348,73460,73472,12,73473,73526,53,73527,73530,1,73536,73538,2,73562,78912,5350,78919,78933,1,90398,90409,1,90413,90415,1,92912,92916,1,92976,92982,1,94031,94095,64,94096,94098,1,94180,113821,19641,113822,118528,4706,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]))),A(r,"foldMn",new le(new Uint32Array([921,953,32,8126,8126,1]))),A(r,"N",new le(new Uint32Array([48,57,1,178,179,1,185,188,3,189,190,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2548,2553,1,2662,2671,1,2790,2799,1,2918,2927,1,2930,2935,1,3046,3058,1,3174,3183,1,3192,3198,1,3302,3311,1,3416,3422,1,3430,3448,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3891,1,4160,4169,1,4240,4249,1,4969,4988,1,5870,5872,1,6112,6121,1,6128,6137,1,6160,6169,1,6470,6479,1,6608,6618,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,8304,8308,4,8309,8313,1,8320,8329,1,8528,8578,1,8581,8585,1,9312,9371,1,9450,9471,1,10102,10131,1,11517,12295,778,12321,12329,1,12344,12346,1,12690,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,42528,42537,1,42726,42735,1,43056,43061,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,65799,65843,1,65856,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,66369,66378,9,66513,66517,1,66720,66729,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,68912,68921,1,68928,68937,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70113,70132,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71483,1,71904,71922,1,72016,72025,1,72688,72697,1,72784,72812,1,73040,73049,1,73120,73129,1,73552,73561,1,73664,73684,1,74752,74862,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93019,93025,1,93552,93561,1,93824,93846,1,118e3,118009,1,119488,119507,1,119520,119539,1,119648,119672,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125127,125135,1,125264,125273,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1,130032,130041,1]))),A(r,"Nd",new le(new Uint32Array([48,57,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2662,2671,1,2790,2799,1,2918,2927,1,3046,3055,1,3174,3183,1,3302,3311,1,3430,3439,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3881,1,4160,4169,1,4240,4249,1,6112,6121,1,6160,6169,1,6470,6479,1,6608,6617,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,42528,42537,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,66720,66729,1,68912,68921,1,68928,68937,1,69734,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71481,1,71904,71913,1,72016,72025,1,72688,72697,1,72784,72793,1,73040,73049,1,73120,73129,1,73552,73561,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93552,93561,1,118e3,118009,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125264,125273,1,130032,130041,1]))),A(r,"Nl",new le(new Uint32Array([5870,5872,1,8544,8578,1,8581,8584,1,12295,12321,26,12322,12329,1,12344,12346,1,42726,42735,1,65856,65908,1,66369,66378,9,66513,66517,1,74752,74862,1]))),A(r,"No",new le(new Uint32Array([178,179,1,185,188,3,189,190,1,2548,2553,1,2930,2935,1,3056,3058,1,3192,3198,1,3416,3422,1,3440,3448,1,3882,3891,1,4969,4988,1,6128,6137,1,6618,8304,1686,8308,8313,1,8320,8329,1,8528,8543,1,8585,9312,727,9313,9371,1,9450,9471,1,10102,10131,1,11517,12690,1173,12691,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,43056,43061,1,65799,65843,1,65909,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69733,1,70113,70132,1,71482,71483,1,71914,71922,1,72794,72812,1,73664,73684,1,93019,93025,1,93824,93846,1,119488,119507,1,119520,119539,1,119648,119672,1,125127,125135,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1]))),A(r,"P",new le(new Uint32Array([33,35,1,37,42,1,44,47,1,58,59,1,63,64,1,91,93,1,95,123,28,125,161,36,167,171,4,182,183,1,187,191,4,894,903,9,1370,1375,1,1417,1418,1,1470,1472,2,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3898,38,3899,3901,1,3973,4048,75,4049,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5120,5742,622,5787,5788,1,5867,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8208,829,8209,8231,1,8240,8259,1,8261,8273,1,8275,8286,1,8317,8318,1,8333,8334,1,8968,8971,1,9001,9002,1,10088,10101,1,10181,10182,1,10214,10223,1,10627,10648,1,10712,10715,1,10748,10749,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11822,1,11824,11855,1,11858,11869,1,12289,12291,1,12296,12305,1,12308,12319,1,12336,12349,13,12448,12539,91,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,64830,20819,64831,65040,209,65041,65049,1,65072,65106,1,65108,65121,1,65123,65128,5,65130,65131,1,65281,65283,1,65285,65290,1,65292,65295,1,65306,65307,1,65311,65312,1,65339,65341,1,65343,65371,28,65373,65375,2,65376,65381,1,65792,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,68974,69293,319,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]))),A(r,"Pc",new le(new Uint32Array([95,8255,8160,8256,8276,20,65075,65076,1,65101,65103,1,65343,65343,1]))),A(r,"Pd",new le(new Uint32Array([45,1418,1373,1470,5120,3650,6150,8208,2058,8209,8213,1,11799,11802,3,11834,11835,1,11840,11869,29,12316,12336,20,12448,65073,52625,65074,65112,38,65123,65293,170,68974,69293,319]))),A(r,"Pe",new le(new Uint32Array([41,93,52,125,3899,3774,3901,5788,1887,8262,8318,56,8334,8969,635,8971,9002,31,10089,10101,2,10182,10215,33,10217,10223,2,10628,10648,2,10713,10715,2,10749,11811,1062,11813,11817,2,11862,11868,2,12297,12305,2,12309,12315,2,12318,12319,1,64830,65048,218,65078,65092,2,65096,65114,18,65116,65118,2,65289,65341,52,65373,65379,3]))),A(r,"Pf",new le(new Uint32Array([187,8217,8030,8221,8250,29,11779,11781,2,11786,11789,3,11805,11809,4]))),A(r,"Pi",new le(new Uint32Array([171,8216,8045,8219,8220,1,8223,8249,26,11778,11780,2,11785,11788,3,11804,11808,4]))),A(r,"Po",new le(new Uint32Array([33,35,1,37,39,1,42,46,2,47,58,11,59,63,4,64,92,28,161,167,6,182,183,1,191,894,703,903,1370,467,1371,1375,1,1417,1472,55,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3973,113,4048,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5742,5867,125,5868,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6149,1,6151,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8214,835,8215,8224,9,8225,8231,1,8240,8248,1,8251,8254,1,8257,8259,1,8263,8273,1,8275,8277,2,8278,8286,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11782,5,11783,11784,1,11787,11790,3,11791,11798,1,11800,11801,1,11803,11806,3,11807,11818,11,11819,11822,1,11824,11833,1,11836,11839,1,11841,11843,2,11844,11855,1,11858,11860,1,12289,12291,1,12349,12539,190,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,65040,21029,65041,65046,1,65049,65072,23,65093,65094,1,65097,65100,1,65104,65106,1,65108,65111,1,65119,65121,1,65128,65130,2,65131,65281,150,65282,65283,1,65285,65287,1,65290,65294,2,65295,65306,11,65307,65311,4,65312,65340,28,65377,65380,3,65381,65792,411,65793,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]))),A(r,"Ps",new le(new Uint32Array([40,91,51,123,3898,3775,3900,5787,1887,8218,8222,4,8261,8317,56,8333,8968,635,8970,9001,31,10088,10100,2,10181,10214,33,10216,10222,2,10627,10647,2,10712,10714,2,10748,11810,1062,11812,11816,2,11842,11861,19,11863,11867,2,12296,12304,2,12308,12314,2,12317,64831,52514,65047,65077,30,65079,65091,2,65095,65113,18,65115,65117,2,65288,65339,51,65371,65375,4,65378,65378,1]))),A(r,"S",new le(new Uint32Array([36,43,7,60,62,1,94,96,2,124,126,2,162,166,1,168,169,1,172,174,2,175,177,1,180,184,4,215,247,32,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,1014,113,1154,1421,267,1422,1423,1,1542,1544,1,1547,1550,3,1551,1758,207,1769,1789,20,1790,2038,248,2046,2047,1,2184,2546,362,2547,2554,7,2555,2801,246,2928,3059,131,3060,3066,1,3199,3407,208,3449,3647,198,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6107,366,6464,6622,158,6623,6655,1,7009,7018,1,7028,7036,1,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,8260,8274,14,8314,8316,1,8330,8332,1,8352,8384,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8472,1,8478,8483,1,8485,8489,2,8494,8506,12,8507,8512,5,8513,8516,1,8522,8525,1,8527,8586,59,8587,8592,5,8593,8967,1,8972,9e3,1,9003,9257,1,9280,9290,1,9372,9449,1,9472,10087,1,10132,10180,1,10183,10213,1,10224,10626,1,10649,10711,1,10716,10747,1,10750,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12443,12444,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,42752,42774,1,42784,42785,1,42889,42890,1,43048,43051,1,43062,43065,1,43639,43641,1,43867,43882,15,43883,64297,20414,64434,64450,1,64832,64847,1,64975,65020,45,65021,65023,1,65122,65124,2,65125,65126,1,65129,65284,155,65291,65308,17,65309,65310,1,65342,65344,2,65372,65374,2,65504,65510,1,65512,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,69006,710,69007,71487,2480,73685,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,123647,432,126124,126128,4,126254,126704,450,126705,126976,271,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]))),A(r,"Sc",new le(new Uint32Array([36,162,126,163,165,1,1423,1547,124,2046,2047,1,2546,2547,1,2555,2801,246,3065,3647,582,6107,8352,2245,8353,8384,1,43064,65020,21956,65129,65284,155,65504,65505,1,65509,65510,1,73693,73696,1,123647,126128,2481]))),A(r,"Sk",new le(new Uint32Array([94,96,2,168,175,7,180,184,4,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,2184,1283,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,12443,12444,1,42752,42774,1,42784,42785,1,42889,42890,1,43867,43882,15,43883,64434,20551,64435,64450,1,65342,65344,2,65507,127995,62488,127996,127999,1]))),A(r,"Sm",new le(new Uint32Array([43,60,17,61,62,1,124,126,2,172,177,5,215,247,32,1014,1542,528,1543,1544,1,8260,8274,14,8314,8316,1,8330,8332,1,8472,8512,40,8513,8516,1,8523,8592,69,8593,8596,1,8602,8603,1,8608,8614,3,8622,8654,32,8655,8658,3,8660,8692,32,8693,8959,1,8992,8993,1,9084,9115,31,9116,9139,1,9180,9185,1,9655,9665,10,9720,9727,1,9839,10176,337,10177,10180,1,10183,10213,1,10224,10239,1,10496,10626,1,10649,10711,1,10716,10747,1,10750,11007,1,11056,11076,1,11079,11084,1,64297,65122,825,65124,65126,1,65291,65308,17,65309,65310,1,65372,65374,2,65506,65513,7,65514,65516,1,69006,69007,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,126704,126705,1]))),A(r,"So",new le(new Uint32Array([166,169,3,174,176,2,1154,1421,267,1422,1550,128,1551,1758,207,1769,1789,20,1790,2038,248,2554,2928,374,3059,3064,1,3066,3199,133,3407,3449,42,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6464,723,6622,6655,1,7009,7018,1,7028,7036,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8478,7,8479,8483,1,8485,8489,2,8494,8506,12,8507,8522,15,8524,8525,1,8527,8586,59,8587,8597,10,8598,8601,1,8604,8607,1,8609,8610,1,8612,8613,1,8615,8621,1,8623,8653,1,8656,8657,1,8659,8661,2,8662,8691,1,8960,8967,1,8972,8991,1,8994,9e3,1,9003,9083,1,9085,9114,1,9140,9179,1,9186,9257,1,9280,9290,1,9372,9449,1,9472,9654,1,9656,9664,1,9666,9719,1,9728,9838,1,9840,10087,1,10132,10175,1,10240,10495,1,11008,11055,1,11077,11078,1,11085,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,43048,43051,1,43062,43063,1,43065,43639,574,43640,43641,1,64832,64847,1,64975,65021,46,65022,65023,1,65508,65512,4,65517,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,71487,3191,73685,73692,1,73697,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,126124,2909,126254,126976,722,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,127994,1,128e3,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]))),A(r,"Z",new le(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8232,8233,1,8239,8287,48,12288,12288,1]))),A(r,"Zl",new le(new Uint32Array([8232,8232,1]))),A(r,"Zp",new le(new Uint32Array([8233,8233,1]))),A(r,"Zs",new le(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8239,8287,48,12288,12288,1]))),A(r,"Adlam",new le(new Uint32Array([125184,125259,1,125264,125273,1,125278,125279,1]))),A(r,"Ahom",new le(new Uint32Array([71424,71450,1,71453,71467,1,71472,71494,1]))),A(r,"Anatolian_Hieroglyphs",new le(new Uint32Array([82944,83526,1]))),A(r,"Arabic",new le(new Uint32Array([1536,1540,1,1542,1547,1,1549,1562,1,1564,1566,1,1568,1599,1,1601,1610,1,1622,1647,1,1649,1756,1,1758,1791,1,1872,1919,1,2160,2190,1,2192,2193,1,2199,2273,1,2275,2303,1,64336,64450,1,64467,64829,1,64832,64911,1,64914,64967,1,64975,65008,33,65009,65023,1,65136,65140,1,65142,65276,1,69216,69246,1,69314,69316,1,69372,69375,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1]))),A(r,"Armenian",new le(new Uint32Array([1329,1366,1,1369,1418,1,1421,1423,1,64275,64279,1]))),A(r,"Avestan",new le(new Uint32Array([68352,68405,1,68409,68415,1]))),A(r,"Balinese",new le(new Uint32Array([6912,6988,1,6990,7039,1]))),A(r,"Bamum",new le(new Uint32Array([42656,42743,1,92160,92728,1]))),A(r,"Bassa_Vah",new le(new Uint32Array([92880,92909,1,92912,92917,1]))),A(r,"Batak",new le(new Uint32Array([7104,7155,1,7164,7167,1]))),A(r,"Bengali",new le(new Uint32Array([2432,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1]))),A(r,"Bhaiksuki",new le(new Uint32Array([72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1]))),A(r,"Bopomofo",new le(new Uint32Array([746,747,1,12549,12591,1,12704,12735,1]))),A(r,"Brahmi",new le(new Uint32Array([69632,69709,1,69714,69749,1,69759,69759,1]))),A(r,"Braille",new le(new Uint32Array([10240,10495,1]))),A(r,"Buginese",new le(new Uint32Array([6656,6683,1,6686,6687,1]))),A(r,"Buhid",new le(new Uint32Array([5952,5971,1]))),A(r,"Canadian_Aboriginal",new le(new Uint32Array([5120,5759,1,6320,6389,1,72368,72383,1]))),A(r,"Carian",new le(new Uint32Array([66208,66256,1]))),A(r,"Caucasian_Albanian",new le(new Uint32Array([66864,66915,1,66927,66927,1]))),A(r,"Chakma",new le(new Uint32Array([69888,69940,1,69942,69959,1]))),A(r,"Cham",new le(new Uint32Array([43520,43574,1,43584,43597,1,43600,43609,1,43612,43615,1]))),A(r,"Cherokee",new le(new Uint32Array([5024,5109,1,5112,5117,1,43888,43967,1]))),A(r,"Chorasmian",new le(new Uint32Array([69552,69579,1]))),A(r,"Common",new le(new Uint32Array([0,64,1,91,96,1,123,169,1,171,185,1,187,191,1,215,247,32,697,735,1,741,745,1,748,767,1,884,894,10,901,903,2,1541,1548,7,1563,1567,4,1600,1757,157,2274,2404,130,2405,3647,1242,4053,4056,1,4347,5867,1520,5868,5869,1,5941,5942,1,6146,6147,1,6149,7379,1230,7393,7401,8,7402,7404,1,7406,7411,1,7413,7415,1,7418,8192,774,8193,8203,1,8206,8292,1,8294,8304,1,8308,8318,1,8320,8334,1,8352,8384,1,8448,8485,1,8487,8489,1,8492,8497,1,8499,8525,1,8527,8543,1,8585,8587,1,8592,9257,1,9280,9290,1,9312,10239,1,10496,11123,1,11126,11157,1,11159,11263,1,11776,11869,1,12272,12292,1,12294,12296,2,12297,12320,1,12336,12343,1,12348,12351,1,12443,12444,1,12448,12539,91,12540,12688,148,12689,12703,1,12736,12773,1,12783,12832,49,12833,12895,1,12927,13007,1,13055,13144,89,13145,13311,1,19904,19967,1,42752,42785,1,42888,42890,1,43056,43065,1,43310,43471,161,43867,43882,15,43883,64830,20947,64831,65040,209,65041,65049,1,65072,65106,1,65108,65126,1,65128,65131,1,65279,65281,2,65282,65312,1,65339,65344,1,65371,65381,1,65392,65438,46,65439,65504,65,65505,65510,1,65512,65518,1,65529,65533,1,65792,65794,1,65799,65843,1,65847,65855,1,65936,65948,1,66e3,66044,1,66273,66299,1,113824,113827,1,117760,118009,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119142,1,119146,119162,1,119171,119172,1,119180,119209,1,119214,119274,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,120831,1,126065,126132,1,126209,126269,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127487,1,127489,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,917505,917536,31,917537,917631,1]))),A(r,"foldCommon",new le(new Uint32Array([924,956,32]))),A(r,"Coptic",new le(new Uint32Array([994,1007,1,11392,11507,1,11513,11519,1]))),A(r,"Cuneiform",new le(new Uint32Array([73728,74649,1,74752,74862,1,74864,74868,1,74880,75075,1]))),A(r,"Cypriot",new le(new Uint32Array([67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3]))),A(r,"Cypro_Minoan",new le(new Uint32Array([77712,77810,1]))),A(r,"Cyrillic",new le(new Uint32Array([1024,1156,1,1159,1327,1,7296,7306,1,7467,7544,77,11744,11775,1,42560,42655,1,65070,65071,1,122928,122989,1,123023,123023,1]))),A(r,"Deseret",new le(new Uint32Array([66560,66639,1]))),A(r,"Devanagari",new le(new Uint32Array([2304,2384,1,2389,2403,1,2406,2431,1,43232,43263,1,72448,72457,1]))),A(r,"Dives_Akuru",new le(new Uint32Array([71936,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1]))),A(r,"Dogra",new le(new Uint32Array([71680,71739,1]))),A(r,"Duployan",new le(new Uint32Array([113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1]))),A(r,"Egyptian_Hieroglyphs",new le(new Uint32Array([77824,78933,1,78944,82938,1]))),A(r,"Elbasan",new le(new Uint32Array([66816,66855,1]))),A(r,"Elymaic",new le(new Uint32Array([69600,69622,1]))),A(r,"Ethiopic",new le(new Uint32Array([4608,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,124896,124902,1,124904,124907,1,124909,124910,1,124912,124926,1]))),A(r,"Garay",new le(new Uint32Array([68928,68965,1,68969,68997,1,69006,69007,1]))),A(r,"Georgian",new le(new Uint32Array([4256,4293,1,4295,4301,6,4304,4346,1,4348,4351,1,7312,7354,1,7357,7359,1,11520,11557,1,11559,11565,6]))),A(r,"Glagolitic",new le(new Uint32Array([11264,11359,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1]))),A(r,"Gothic",new le(new Uint32Array([66352,66378,1]))),A(r,"Grantha",new le(new Uint32Array([70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70460,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1]))),A(r,"Greek",new le(new Uint32Array([880,883,1,885,887,1,890,893,1,895,900,5,902,904,2,905,906,1,908,910,2,911,929,1,931,993,1,1008,1023,1,7462,7466,1,7517,7521,1,7526,7530,1,7615,7936,321,7937,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8486,43877,35391,65856,65934,1,65952,119296,53344,119297,119365,1]))),A(r,"foldGreek",new le(new Uint32Array([181,837,656]))),A(r,"Gujarati",new le(new Uint32Array([2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1]))),A(r,"Gunjala_Gondi",new le(new Uint32Array([73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1]))),A(r,"Gurmukhi",new le(new Uint32Array([2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1]))),A(r,"Gurung_Khema",new le(new Uint32Array([90368,90425,1]))),A(r,"Han",new le(new Uint32Array([11904,11929,1,11931,12019,1,12032,12245,1,12293,12295,2,12321,12329,1,12344,12347,1,13312,19903,1,19968,40959,1,63744,64109,1,64112,64217,1,94178,94179,1,94192,94193,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]))),A(r,"Hangul",new le(new Uint32Array([4352,4607,1,12334,12335,1,12593,12686,1,12800,12830,1,12896,12926,1,43360,43388,1,44032,55203,1,55216,55238,1,55243,55291,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1]))),A(r,"Hanifi_Rohingya",new le(new Uint32Array([68864,68903,1,68912,68921,1]))),A(r,"Hanunoo",new le(new Uint32Array([5920,5940,1]))),A(r,"Hatran",new le(new Uint32Array([67808,67826,1,67828,67829,1,67835,67839,1]))),A(r,"Hebrew",new le(new Uint32Array([1425,1479,1,1488,1514,1,1519,1524,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64335,1]))),A(r,"Hiragana",new le(new Uint32Array([12353,12438,1,12445,12447,1,110593,110879,1,110898,110928,30,110929,110930,1,127488,127488,1]))),A(r,"Imperial_Aramaic",new le(new Uint32Array([67648,67669,1,67671,67679,1]))),A(r,"Inherited",new le(new Uint32Array([768,879,1,1157,1158,1,1611,1621,1,1648,2385,737,2386,2388,1,6832,6862,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8204,8205,1,8400,8432,1,12330,12333,1,12441,12442,1,65024,65039,1,65056,65069,1,66045,66272,227,70459,118528,48069,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,917760,917999,1]))),A(r,"foldInherited",new le(new Uint32Array([921,953,32,8126,8126,1]))),A(r,"Inscriptional_Pahlavi",new le(new Uint32Array([68448,68466,1,68472,68479,1]))),A(r,"Inscriptional_Parthian",new le(new Uint32Array([68416,68437,1,68440,68447,1]))),A(r,"Javanese",new le(new Uint32Array([43392,43469,1,43472,43481,1,43486,43487,1]))),A(r,"Kaithi",new le(new Uint32Array([69760,69826,1,69837,69837,1]))),A(r,"Kannada",new le(new Uint32Array([3200,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1]))),A(r,"Katakana",new le(new Uint32Array([12449,12538,1,12541,12543,1,12784,12799,1,13008,13054,1,13056,13143,1,65382,65391,1,65393,65437,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110880,288,110881,110882,1,110933,110948,15,110949,110951,1]))),A(r,"Kawi",new le(new Uint32Array([73472,73488,1,73490,73530,1,73534,73562,1]))),A(r,"Kayah_Li",new le(new Uint32Array([43264,43309,1,43311,43311,1]))),A(r,"Kharoshthi",new le(new Uint32Array([68096,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1]))),A(r,"Khitan_Small_Script",new le(new Uint32Array([94180,101120,6940,101121,101589,1,101631,101631,1]))),A(r,"Khmer",new le(new Uint32Array([6016,6109,1,6112,6121,1,6128,6137,1,6624,6655,1]))),A(r,"Khojki",new le(new Uint32Array([70144,70161,1,70163,70209,1]))),A(r,"Khudawadi",new le(new Uint32Array([70320,70378,1,70384,70393,1]))),A(r,"Kirat_Rai",new le(new Uint32Array([93504,93561,1]))),A(r,"Lao",new le(new Uint32Array([3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1]))),A(r,"Latin",new le(new Uint32Array([65,90,1,97,122,1,170,186,16,192,214,1,216,246,1,248,696,1,736,740,1,7424,7461,1,7468,7516,1,7522,7525,1,7531,7543,1,7545,7614,1,7680,7935,1,8305,8319,14,8336,8348,1,8490,8491,1,8498,8526,28,8544,8584,1,11360,11391,1,42786,42887,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43007,1,43824,43866,1,43868,43876,1,43878,43881,1,64256,64262,1,65313,65338,1,65345,65370,1,67456,67461,1,67463,67504,1,67506,67514,1,122624,122654,1,122661,122666,1]))),A(r,"Lepcha",new le(new Uint32Array([7168,7223,1,7227,7241,1,7245,7247,1]))),A(r,"Limbu",new le(new Uint32Array([6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6479,1]))),A(r,"Linear_A",new le(new Uint32Array([67072,67382,1,67392,67413,1,67424,67431,1]))),A(r,"Linear_B",new le(new Uint32Array([65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1]))),A(r,"Lisu",new le(new Uint32Array([42192,42239,1,73648,73648,1]))),A(r,"Lycian",new le(new Uint32Array([66176,66204,1]))),A(r,"Lydian",new le(new Uint32Array([67872,67897,1,67903,67903,1]))),A(r,"Mahajani",new le(new Uint32Array([69968,70006,1]))),A(r,"Makasar",new le(new Uint32Array([73440,73464,1]))),A(r,"Malayalam",new le(new Uint32Array([3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1]))),A(r,"Mandaic",new le(new Uint32Array([2112,2139,1,2142,2142,1]))),A(r,"Manichaean",new le(new Uint32Array([68288,68326,1,68331,68342,1]))),A(r,"Marchen",new le(new Uint32Array([72816,72847,1,72850,72871,1,72873,72886,1]))),A(r,"Masaram_Gondi",new le(new Uint32Array([72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1]))),A(r,"Medefaidrin",new le(new Uint32Array([93760,93850,1]))),A(r,"Meetei_Mayek",new le(new Uint32Array([43744,43766,1,43968,44013,1,44016,44025,1]))),A(r,"Mende_Kikakui",new le(new Uint32Array([124928,125124,1,125127,125142,1]))),A(r,"Meroitic_Cursive",new le(new Uint32Array([68e3,68023,1,68028,68047,1,68050,68095,1]))),A(r,"Meroitic_Hieroglyphs",new le(new Uint32Array([67968,67999,1]))),A(r,"Miao",new le(new Uint32Array([93952,94026,1,94031,94087,1,94095,94111,1]))),A(r,"Modi",new le(new Uint32Array([71168,71236,1,71248,71257,1]))),A(r,"Mongolian",new le(new Uint32Array([6144,6145,1,6148,6150,2,6151,6169,1,6176,6264,1,6272,6314,1,71264,71276,1]))),A(r,"Mro",new le(new Uint32Array([92736,92766,1,92768,92777,1,92782,92783,1]))),A(r,"Multani",new le(new Uint32Array([70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1]))),A(r,"Myanmar",new le(new Uint32Array([4096,4255,1,43488,43518,1,43616,43647,1,71376,71395,1]))),A(r,"Nabataean",new le(new Uint32Array([67712,67742,1,67751,67759,1]))),A(r,"Nag_Mundari",new le(new Uint32Array([124112,124153,1]))),A(r,"Nandinagari",new le(new Uint32Array([72096,72103,1,72106,72151,1,72154,72164,1]))),A(r,"New_Tai_Lue",new le(new Uint32Array([6528,6571,1,6576,6601,1,6608,6618,1,6622,6623,1]))),A(r,"Newa",new le(new Uint32Array([70656,70747,1,70749,70753,1]))),A(r,"Nko",new le(new Uint32Array([1984,2042,1,2045,2047,1]))),A(r,"Nushu",new le(new Uint32Array([94177,110960,16783,110961,111355,1]))),A(r,"Nyiakeng_Puachue_Hmong",new le(new Uint32Array([123136,123180,1,123184,123197,1,123200,123209,1,123214,123215,1]))),A(r,"Ogham",new le(new Uint32Array([5760,5788,1]))),A(r,"Ol_Chiki",new le(new Uint32Array([7248,7295,1]))),A(r,"Ol_Onal",new le(new Uint32Array([124368,124410,1,124415,124415,1]))),A(r,"Old_Hungarian",new le(new Uint32Array([68736,68786,1,68800,68850,1,68858,68863,1]))),A(r,"Old_Italic",new le(new Uint32Array([66304,66339,1,66349,66351,1]))),A(r,"Old_North_Arabian",new le(new Uint32Array([68224,68255,1]))),A(r,"Old_Permic",new le(new Uint32Array([66384,66426,1]))),A(r,"Old_Persian",new le(new Uint32Array([66464,66499,1,66504,66517,1]))),A(r,"Old_Sogdian",new le(new Uint32Array([69376,69415,1]))),A(r,"Old_South_Arabian",new le(new Uint32Array([68192,68223,1]))),A(r,"Old_Turkic",new le(new Uint32Array([68608,68680,1]))),A(r,"Old_Uyghur",new le(new Uint32Array([69488,69513,1]))),A(r,"Oriya",new le(new Uint32Array([2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1]))),A(r,"Osage",new le(new Uint32Array([66736,66771,1,66776,66811,1]))),A(r,"Osmanya",new le(new Uint32Array([66688,66717,1,66720,66729,1]))),A(r,"Pahawh_Hmong",new le(new Uint32Array([92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1]))),A(r,"Palmyrene",new le(new Uint32Array([67680,67711,1]))),A(r,"Pau_Cin_Hau",new le(new Uint32Array([72384,72440,1]))),A(r,"Phags_Pa",new le(new Uint32Array([43072,43127,1]))),A(r,"Phoenician",new le(new Uint32Array([67840,67867,1,67871,67871,1]))),A(r,"Psalter_Pahlavi",new le(new Uint32Array([68480,68497,1,68505,68508,1,68521,68527,1]))),A(r,"Rejang",new le(new Uint32Array([43312,43347,1,43359,43359,1]))),A(r,"Runic",new le(new Uint32Array([5792,5866,1,5870,5880,1]))),A(r,"Samaritan",new le(new Uint32Array([2048,2093,1,2096,2110,1]))),A(r,"Saurashtra",new le(new Uint32Array([43136,43205,1,43214,43225,1]))),A(r,"Sharada",new le(new Uint32Array([70016,70111,1]))),A(r,"Shavian",new le(new Uint32Array([66640,66687,1]))),A(r,"Siddham",new le(new Uint32Array([71040,71093,1,71096,71133,1]))),A(r,"SignWriting",new le(new Uint32Array([120832,121483,1,121499,121503,1,121505,121519,1]))),A(r,"Sinhala",new le(new Uint32Array([3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,70113,70132,1]))),A(r,"Sogdian",new le(new Uint32Array([69424,69465,1]))),A(r,"Sora_Sompeng",new le(new Uint32Array([69840,69864,1,69872,69881,1]))),A(r,"Soyombo",new le(new Uint32Array([72272,72354,1]))),A(r,"Sundanese",new le(new Uint32Array([7040,7103,1,7360,7367,1]))),A(r,"Sunuwar",new le(new Uint32Array([72640,72673,1,72688,72697,1]))),A(r,"Syloti_Nagri",new le(new Uint32Array([43008,43052,1]))),A(r,"Syriac",new le(new Uint32Array([1792,1805,1,1807,1866,1,1869,1871,1,2144,2154,1]))),A(r,"Tagalog",new le(new Uint32Array([5888,5909,1,5919,5919,1]))),A(r,"Tagbanwa",new le(new Uint32Array([5984,5996,1,5998,6e3,1,6002,6003,1]))),A(r,"Tai_Le",new le(new Uint32Array([6480,6509,1,6512,6516,1]))),A(r,"Tai_Tham",new le(new Uint32Array([6688,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1]))),A(r,"Tai_Viet",new le(new Uint32Array([43648,43714,1,43739,43743,1]))),A(r,"Takri",new le(new Uint32Array([71296,71353,1,71360,71369,1]))),A(r,"Tamil",new le(new Uint32Array([2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,73664,73713,1,73727,73727,1]))),A(r,"Tangsa",new le(new Uint32Array([92784,92862,1,92864,92873,1]))),A(r,"Tangut",new le(new Uint32Array([94176,94208,32,94209,100343,1,100352,101119,1,101632,101640,1]))),A(r,"Telugu",new le(new Uint32Array([3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3199,1]))),A(r,"Thaana",new le(new Uint32Array([1920,1969,1]))),A(r,"Thai",new le(new Uint32Array([3585,3642,1,3648,3675,1]))),A(r,"Tibetan",new le(new Uint32Array([3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4052,1,4057,4058,1]))),A(r,"Tifinagh",new le(new Uint32Array([11568,11623,1,11631,11632,1,11647,11647,1]))),A(r,"Tirhuta",new le(new Uint32Array([70784,70855,1,70864,70873,1]))),A(r,"Todhri",new le(new Uint32Array([67008,67059,1]))),A(r,"Toto",new le(new Uint32Array([123536,123566,1]))),A(r,"Tulu_Tigalari",new le(new Uint32Array([70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1]))),A(r,"Ugaritic",new le(new Uint32Array([66432,66461,1,66463,66463,1]))),A(r,"Vai",new le(new Uint32Array([42240,42539,1]))),A(r,"Vithkuqi",new le(new Uint32Array([66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1]))),A(r,"Wancho",new le(new Uint32Array([123584,123641,1,123647,123647,1]))),A(r,"Warang_Citi",new le(new Uint32Array([71840,71922,1,71935,71935,1]))),A(r,"Yezidi",new le(new Uint32Array([69248,69289,1,69291,69293,1,69296,69297,1]))),A(r,"Yi",new le(new Uint32Array([40960,42124,1,42128,42182,1]))),A(r,"Zanabazar_Square",new le(new Uint32Array([72192,72263,1]))),A(r,"CATEGORIES",new Map([["C",r.C],["Cc",r.Cc],["Cf",r.Cf],["Co",r.Co],["Cs",r.Cs],["L",r.L],["Ll",r.Ll],["Lm",r.Lm],["Lo",r.Lo],["Lt",r.Lt],["Lu",r.Lu],["M",r.M],["Mc",r.Mc],["Me",r.Me],["Mn",r.Mn],["N",r.N],["Nd",r.Nd],["Nl",r.Nl],["No",r.No],["P",r.P],["Pc",r.Pc],["Pd",r.Pd],["Pe",r.Pe],["Pf",r.Pf],["Pi",r.Pi],["Po",r.Po],["Ps",r.Ps],["S",r.S],["Sc",r.Sc],["Sk",r.Sk],["Sm",r.Sm],["So",r.So],["Z",r.Z],["Zl",r.Zl],["Zp",r.Zp],["Zs",r.Zs]])),A(r,"SCRIPTS",new Map([["Adlam",r.Adlam],["Ahom",r.Ahom],["Anatolian_Hieroglyphs",r.Anatolian_Hieroglyphs],["Arabic",r.Arabic],["Armenian",r.Armenian],["Avestan",r.Avestan],["Balinese",r.Balinese],["Bamum",r.Bamum],["Bassa_Vah",r.Bassa_Vah],["Batak",r.Batak],["Bengali",r.Bengali],["Bhaiksuki",r.Bhaiksuki],["Bopomofo",r.Bopomofo],["Brahmi",r.Brahmi],["Braille",r.Braille],["Buginese",r.Buginese],["Buhid",r.Buhid],["Canadian_Aboriginal",r.Canadian_Aboriginal],["Carian",r.Carian],["Caucasian_Albanian",r.Caucasian_Albanian],["Chakma",r.Chakma],["Cham",r.Cham],["Cherokee",r.Cherokee],["Chorasmian",r.Chorasmian],["Common",r.Common],["Coptic",r.Coptic],["Cuneiform",r.Cuneiform],["Cypriot",r.Cypriot],["Cypro_Minoan",r.Cypro_Minoan],["Cyrillic",r.Cyrillic],["Deseret",r.Deseret],["Devanagari",r.Devanagari],["Dives_Akuru",r.Dives_Akuru],["Dogra",r.Dogra],["Duployan",r.Duployan],["Egyptian_Hieroglyphs",r.Egyptian_Hieroglyphs],["Elbasan",r.Elbasan],["Elymaic",r.Elymaic],["Ethiopic",r.Ethiopic],["Garay",r.Garay],["Georgian",r.Georgian],["Glagolitic",r.Glagolitic],["Gothic",r.Gothic],["Grantha",r.Grantha],["Greek",r.Greek],["Gujarati",r.Gujarati],["Gunjala_Gondi",r.Gunjala_Gondi],["Gurmukhi",r.Gurmukhi],["Gurung_Khema",r.Gurung_Khema],["Han",r.Han],["Hangul",r.Hangul],["Hanifi_Rohingya",r.Hanifi_Rohingya],["Hanunoo",r.Hanunoo],["Hatran",r.Hatran],["Hebrew",r.Hebrew],["Hiragana",r.Hiragana],["Imperial_Aramaic",r.Imperial_Aramaic],["Inherited",r.Inherited],["Inscriptional_Pahlavi",r.Inscriptional_Pahlavi],["Inscriptional_Parthian",r.Inscriptional_Parthian],["Javanese",r.Javanese],["Kaithi",r.Kaithi],["Kannada",r.Kannada],["Katakana",r.Katakana],["Kawi",r.Kawi],["Kayah_Li",r.Kayah_Li],["Kharoshthi",r.Kharoshthi],["Khitan_Small_Script",r.Khitan_Small_Script],["Khmer",r.Khmer],["Khojki",r.Khojki],["Khudawadi",r.Khudawadi],["Kirat_Rai",r.Kirat_Rai],["Lao",r.Lao],["Latin",r.Latin],["Lepcha",r.Lepcha],["Limbu",r.Limbu],["Linear_A",r.Linear_A],["Linear_B",r.Linear_B],["Lisu",r.Lisu],["Lycian",r.Lycian],["Lydian",r.Lydian],["Mahajani",r.Mahajani],["Makasar",r.Makasar],["Malayalam",r.Malayalam],["Mandaic",r.Mandaic],["Manichaean",r.Manichaean],["Marchen",r.Marchen],["Masaram_Gondi",r.Masaram_Gondi],["Medefaidrin",r.Medefaidrin],["Meetei_Mayek",r.Meetei_Mayek],["Mende_Kikakui",r.Mende_Kikakui],["Meroitic_Cursive",r.Meroitic_Cursive],["Meroitic_Hieroglyphs",r.Meroitic_Hieroglyphs],["Miao",r.Miao],["Modi",r.Modi],["Mongolian",r.Mongolian],["Mro",r.Mro],["Multani",r.Multani],["Myanmar",r.Myanmar],["Nabataean",r.Nabataean],["Nag_Mundari",r.Nag_Mundari],["Nandinagari",r.Nandinagari],["New_Tai_Lue",r.New_Tai_Lue],["Newa",r.Newa],["Nko",r.Nko],["Nushu",r.Nushu],["Nyiakeng_Puachue_Hmong",r.Nyiakeng_Puachue_Hmong],["Ogham",r.Ogham],["Ol_Chiki",r.Ol_Chiki],["Ol_Onal",r.Ol_Onal],["Old_Hungarian",r.Old_Hungarian],["Old_Italic",r.Old_Italic],["Old_North_Arabian",r.Old_North_Arabian],["Old_Permic",r.Old_Permic],["Old_Persian",r.Old_Persian],["Old_Sogdian",r.Old_Sogdian],["Old_South_Arabian",r.Old_South_Arabian],["Old_Turkic",r.Old_Turkic],["Old_Uyghur",r.Old_Uyghur],["Oriya",r.Oriya],["Osage",r.Osage],["Osmanya",r.Osmanya],["Pahawh_Hmong",r.Pahawh_Hmong],["Palmyrene",r.Palmyrene],["Pau_Cin_Hau",r.Pau_Cin_Hau],["Phags_Pa",r.Phags_Pa],["Phoenician",r.Phoenician],["Psalter_Pahlavi",r.Psalter_Pahlavi],["Rejang",r.Rejang],["Runic",r.Runic],["Samaritan",r.Samaritan],["Saurashtra",r.Saurashtra],["Sharada",r.Sharada],["Shavian",r.Shavian],["Siddham",r.Siddham],["SignWriting",r.SignWriting],["Sinhala",r.Sinhala],["Sogdian",r.Sogdian],["Sora_Sompeng",r.Sora_Sompeng],["Soyombo",r.Soyombo],["Sundanese",r.Sundanese],["Sunuwar",r.Sunuwar],["Syloti_Nagri",r.Syloti_Nagri],["Syriac",r.Syriac],["Tagalog",r.Tagalog],["Tagbanwa",r.Tagbanwa],["Tai_Le",r.Tai_Le],["Tai_Tham",r.Tai_Tham],["Tai_Viet",r.Tai_Viet],["Takri",r.Takri],["Tamil",r.Tamil],["Tangsa",r.Tangsa],["Tangut",r.Tangut],["Telugu",r.Telugu],["Thaana",r.Thaana],["Thai",r.Thai],["Tibetan",r.Tibetan],["Tifinagh",r.Tifinagh],["Tirhuta",r.Tirhuta],["Todhri",r.Todhri],["Toto",r.Toto],["Tulu_Tigalari",r.Tulu_Tigalari],["Ugaritic",r.Ugaritic],["Vai",r.Vai],["Vithkuqi",r.Vithkuqi],["Wancho",r.Wancho],["Warang_Citi",r.Warang_Citi],["Yezidi",r.Yezidi],["Yi",r.Yi],["Zanabazar_Square",r.Zanabazar_Square]])),A(r,"FOLD_CATEGORIES",new Map([["L",r.foldL],["Ll",r.foldLl],["Lt",r.foldLt],["Lu",r.foldLu],["M",r.foldM],["Mn",r.foldMn]])),A(r,"FOLD_SCRIPT",new Map([["Common",r.foldCommon],["Greek",r.foldGreek],["Inherited",r.foldInherited]])),A(r,"Print",new le(new Uint32Array([33,126,1,161,172,1,174,887,1,890,895,1,900,906,1,908,910,2,911,929,1,931,1327,1,1329,1366,1,1369,1418,1,1421,1423,1,1425,1479,1,1488,1514,1,1519,1524,1,1542,1563,1,1565,1756,1,1758,1805,1,1808,1866,1,1869,1969,1,1984,2042,1,2045,2093,1,2096,2110,1,2112,2139,1,2142,2144,2,2145,2154,1,2160,2190,1,2199,2273,1,2275,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1,2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1,2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1,2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1,2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1,3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1,3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,3585,3642,1,3647,3675,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1,3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4058,1,4096,4293,1,4295,4301,6,4304,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,5024,5109,1,5112,5117,1,5120,5759,1,5761,5788,1,5792,5880,1,5888,5909,1,5919,5942,1,5952,5971,1,5984,5996,1,5998,6e3,1,6002,6003,1,6016,6109,1,6112,6121,1,6128,6137,1,6144,6157,1,6159,6169,1,6176,6264,1,6272,6314,1,6320,6389,1,6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6608,6618,1,6622,6683,1,6686,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1,6832,6862,1,6912,6988,1,6990,7155,1,7164,7223,1,7227,7241,1,7245,7306,1,7312,7354,1,7357,7367,1,7376,7418,1,7424,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8208,8231,1,8240,8286,1,8304,8305,1,8308,8334,1,8336,8348,1,8352,8384,1,8400,8432,1,8448,8587,1,8592,9257,1,9280,9290,1,9312,11123,1,11126,11157,1,11159,11507,1,11513,11557,1,11559,11565,6,11568,11623,1,11631,11632,1,11647,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11744,11869,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12289,12351,1,12353,12438,1,12441,12543,1,12549,12591,1,12593,12686,1,12688,12773,1,12783,12830,1,12832,42124,1,42128,42182,1,42192,42539,1,42560,42743,1,42752,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43052,1,43056,43065,1,43072,43127,1,43136,43205,1,43214,43225,1,43232,43347,1,43359,43388,1,43392,43469,1,43471,43481,1,43486,43518,1,43520,43574,1,43584,43597,1,43600,43609,1,43612,43714,1,43739,43766,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43883,1,43888,44013,1,44016,44025,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64450,1,64467,64911,1,64914,64967,1,64975,65008,33,65009,65049,1,65056,65106,1,65108,65126,1,65128,65131,1,65136,65140,1,65142,65276,1,65281,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65504,65510,1,65512,65518,1,65532,65533,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,65792,65794,1,65799,65843,1,65847,65934,1,65936,65948,1,65952,66e3,48,66001,66045,1,66176,66204,1,66208,66256,1,66272,66299,1,66304,66339,1,66349,66378,1,66384,66426,1,66432,66461,1,66463,66499,1,66504,66517,1,66560,66717,1,66720,66729,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66927,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67671,67742,1,67751,67759,1,67808,67826,1,67828,67829,1,67835,67867,1,67871,67897,1,67903,67968,65,67969,68023,1,68028,68047,1,68050,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1,68192,68255,1,68288,68326,1,68331,68342,1,68352,68405,1,68409,68437,1,68440,68466,1,68472,68497,1,68505,68508,1,68521,68527,1,68608,68680,1,68736,68786,1,68800,68850,1,68858,68903,1,68912,68921,1,68928,68965,1,68969,68997,1,69006,69007,1,69216,69246,1,69248,69289,1,69291,69293,1,69296,69297,1,69314,69316,1,69372,69415,1,69424,69465,1,69488,69513,1,69552,69579,1,69600,69622,1,69632,69709,1,69714,69749,1,69759,69820,1,69822,69826,1,69840,69864,1,69872,69881,1,69888,69940,1,69942,69959,1,69968,70006,1,70016,70111,1,70113,70132,1,70144,70161,1,70163,70209,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1,70320,70378,1,70384,70393,1,70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70459,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1,70656,70747,1,70749,70753,1,70784,70855,1,70864,70873,1,71040,71093,1,71096,71133,1,71168,71236,1,71248,71257,1,71264,71276,1,71296,71353,1,71360,71369,1,71376,71395,1,71424,71450,1,71453,71467,1,71472,71494,1,71680,71739,1,71840,71922,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1,72096,72103,1,72106,72151,1,72154,72164,1,72192,72263,1,72272,72354,1,72368,72440,1,72448,72457,1,72640,72673,1,72688,72697,1,72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1,72816,72847,1,72850,72871,1,72873,72886,1,72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1,73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1,73440,73464,1,73472,73488,1,73490,73530,1,73534,73562,1,73648,73664,16,73665,73713,1,73727,74649,1,74752,74862,1,74864,74868,1,74880,75075,1,77712,77810,1,77824,78895,1,78912,78933,1,78944,82938,1,82944,83526,1,90368,90425,1,92160,92728,1,92736,92766,1,92768,92777,1,92782,92862,1,92864,92873,1,92880,92909,1,92912,92917,1,92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1,93504,93561,1,93760,93850,1,93952,94026,1,94031,94087,1,94095,94111,1,94176,94180,1,94192,94193,1,94208,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1,117760,118009,1,118016,118451,1,118528,118573,1,118576,118598,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119154,1,119163,119274,1,119296,119365,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,121483,1,121499,121503,1,121505,121519,1,122624,122654,1,122661,122666,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,122928,122989,1,123023,123136,113,123137,123180,1,123184,123197,1,123200,123209,1,123214,123215,1,123536,123566,1,123584,123641,1,123647,124112,465,124113,124153,1,124368,124410,1,124415,124896,481,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125127,125142,1,125184,125259,1,125264,125273,1,125278,125279,1,126065,126132,1,126209,126269,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1,917760,917999,1]))),r),dr=(n=/*#__PURE__*/function(){"use strict";function n(){_class_call_check(this,n)}_create_class(n,null,[{key:"is32",value:function is32(d,u){var p=0,m=d.length;for(;p<m;){var h=p+Math.floor((m-p)/2),g=d.getLo(h),x=d.getHi(h);if(g<=u&&u<=x){var v=d.getStride(h);return(u-g)%v===0}u<g?m=h:p=h+1}return!1}},{key:"is",value:function is1(d,u){if(u<=this.MAX_LATIN1){for(var p=0;p<d.length;p++){var m=d.getHi(p);if(u>m)continue;var h=d.getLo(p);if(u<h)return!1;var g=d.getStride(p);return(u-h)%g===0}return!1}return d.length>0&&u>=d.getLo(0)&&this.is32(d,u)}},{key:"isUpper",value:function isUpper(d){if(d<=this.MAX_LATIN1){var u=String.fromCodePoint(d);return u.toUpperCase()===u&&u.toLowerCase()!==u}return this.is(Vc.Upper,d)}},{key:"isPrint",value:function isPrint(d){return d<=this.MAX_LATIN1?d>=32&&d<this.MAX_ASCII||d>=161&&d!==173:this.is(Vc.Print,d)}},{key:"simpleFold",value:function simpleFold(d){if(Vc.CASE_ORBIT.has(d))return Vc.CASE_ORBIT.get(d);var u=ke.toLowerCase(d);return u!==d?u:ke.toUpperCase(d)}},{key:"equalsIgnoreCase",value:function equalsIgnoreCase(d,u){if(d<0||u<0||d===u)return!0;if(d<=this.MAX_ASCII&&u<=this.MAX_ASCII)return ke.CODES.get("A")<=d&&d<=ke.CODES.get("Z")&&(d|=32),ke.CODES.get("A")<=u&&u<=ke.CODES.get("Z")&&(u|=32),d===u;for(var p=this.simpleFold(d);p!==d;p=this.simpleFold(p))if(p===u)return!0;return!1}}]);return n}(),A(n,"MAX_RUNE",1114111),A(n,"MAX_ASCII",127),A(n,"MAX_LATIN1",255),A(n,"MAX_BMP",65535),A(n,"MIN_FOLD",65),A(n,"MAX_FOLD",125251),n),pn=(i=/*#__PURE__*/function(){"use strict";function i(){_class_call_check(this,i)}_create_class(i,null,[{key:"emptyInts",value:function emptyInts(){return[]}},{key:"isalnum",value:function isalnum(d){return ke.CODES.get("0")<=d&&d<=ke.CODES.get("9")||ke.CODES.get("a")<=d&&d<=ke.CODES.get("z")||ke.CODES.get("A")<=d&&d<=ke.CODES.get("Z")}},{key:"unhex",value:function unhex(d){return ke.CODES.get("0")<=d&&d<=ke.CODES.get("9")?d-ke.CODES.get("0"):ke.CODES.get("a")<=d&&d<=ke.CODES.get("f")?d-ke.CODES.get("a")+10:ke.CODES.get("A")<=d&&d<=ke.CODES.get("F")?d-ke.CODES.get("A")+10:-1}},{key:"escapeRune",value:function escapeRune(d){var u="";if(dr.isPrint(d))this.METACHARACTERS.indexOf(String.fromCodePoint(d))>=0&&(u+="\\"),u+=String.fromCodePoint(d);else switch(d){case ke.CODES.get('"'):u+='\\"';break;case ke.CODES.get("\\"):u+="\\\\";break;case ke.CODES.get(" "):u+="\\t";break;case ke.CODES.get("\n"):u+="\\n";break;case ke.CODES.get("\r"):u+="\\r";break;case ke.CODES.get("\b"):u+="\\b";break;case ke.CODES.get("\f"):u+="\\f";break;default:{var p=d.toString(16);d<256?(u+="\\x",p.length===1&&(u+="0"),u+=p):u+="\\x{".concat(p,"}");break}}return u}},{key:"stringToRunes",value:function stringToRunes(d){return String(d).split("").map(function(u){return u.codePointAt(0)})}},{key:"runeToString",value:function runeToString(d){return String.fromCodePoint(d)}},{key:"isWordRune",value:function isWordRune(d){return ke.CODES.get("a")<=d&&d<=ke.CODES.get("z")||ke.CODES.get("A")<=d&&d<=ke.CODES.get("Z")||ke.CODES.get("0")<=d&&d<=ke.CODES.get("9")||d===ke.CODES.get("_")}},{key:"emptyOpContext",value:function emptyOpContext(d,u){var p=0;return d<0&&(p|=this.EMPTY_BEGIN_TEXT|this.EMPTY_BEGIN_LINE),d===ke.CODES.get("\n")&&(p|=this.EMPTY_BEGIN_LINE),u<0&&(p|=this.EMPTY_END_TEXT|this.EMPTY_END_LINE),u===ke.CODES.get("\n")&&(p|=this.EMPTY_END_LINE),this.isWordRune(d)!==this.isWordRune(u)?p|=this.EMPTY_WORD_BOUNDARY:p|=this.EMPTY_NO_WORD_BOUNDARY,p}},{key:"quoteMeta",value:function quoteMeta(d){var _this=this;return d.split("").map(function(u){return _this.METACHARACTERS.indexOf(u)>=0?"\\".concat(u):u}).join("")}},{key:"charCount",value:function charCount(d){return d>dr.MAX_BMP?2:1}},{key:"stringToUtf8ByteArray",value:function stringToUtf8ByteArray(d){if(globalThis.TextEncoder)return Array.from(new TextEncoder().encode(d));{var u=[],p=0;for(var m=0;m<d.length;m++){var h=d.charCodeAt(m);h<128?u[p++]=h:h<2048?(u[p++]=h>>6|192,u[p++]=h&63|128):(h&64512)===55296&&m+1<d.length&&(d.charCodeAt(m+1)&64512)===56320?(h=65536+((h&1023)<<10)+(d.charCodeAt(++m)&1023),u[p++]=h>>18|240,u[p++]=h>>12&63|128,u[p++]=h>>6&63|128,u[p++]=h&63|128):(u[p++]=h>>12|224,u[p++]=h>>6&63|128,u[p++]=h&63|128)}return u}}},{key:"utf8ByteArrayToString",value:function utf8ByteArrayToString(d){if(globalThis.TextDecoder)return new TextDecoder("utf-8").decode(new Uint8Array(d));{var u=[],p=0,m=0;for(;p<d.length;){var h=d[p++];if(h<128)u[m++]=String.fromCharCode(h);else if(h>191&&h<224){var g=d[p++];u[m++]=String.fromCharCode((h&31)<<6|g&63)}else if(h>239&&h<365){var g10=d[p++],x=d[p++],v=d[p++],y=((h&7)<<18|(g10&63)<<12|(x&63)<<6|v&63)-65536;u[m++]=String.fromCharCode(55296+(y>>10)),u[m++]=String.fromCharCode(56320+(y&1023))}else{var g11=d[p++],x10=d[p++];u[m++]=String.fromCharCode((h&15)<<12|(g11&63)<<6|x10&63)}}return u.join("")}}}]);return i}(),A(i,"METACHARACTERS","\\.+*?()|[]{}^$"),A(i,"EMPTY_BEGIN_LINE",1),A(i,"EMPTY_END_LINE",2),A(i,"EMPTY_BEGIN_TEXT",4),A(i,"EMPTY_END_TEXT",8),A(i,"EMPTY_WORD_BOUNDARY",16),A(i,"EMPTY_NO_WORD_BOUNDARY",32),A(i,"EMPTY_ALL",-1),i),WB=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var p={};for(var m=0;m<d.length;m++){var h=d[m],g=u+m;p[h]=g,p[g]=h}return Object.freeze(p)},j0=(o=/*#__PURE__*/function(){"use strict";function o10(){_class_call_check(this,o10)}_create_class(o10,[{key:"getEncoding",value:function getEncoding(){throw Error("not implemented")}},{key:"isUTF8Encoding",value:function isUTF8Encoding(){return this.getEncoding()===o.Encoding.UTF_8}},{key:"isUTF16Encoding",value:function isUTF16Encoding(){return this.getEncoding()===o.Encoding.UTF_16}}]);return o10}(),A(o,"Encoding",WB(["UTF_16","UTF_8"])),o),VB=/*#__PURE__*/function(j01){"use strict";_inherits(VB1,j01);function VB1(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;_class_call_check(this,VB1);var _this;_this=_call_super(this,VB1),_this.bytes=d;return _this}_create_class(VB1,[{key:"getEncoding",value:function getEncoding(){return j0.Encoding.UTF_8}},{key:"asCharSequence",value:function asCharSequence(){return pn.utf8ByteArrayToString(this.bytes)}},{key:"asBytes",value:function asBytes(){return this.bytes}},{key:"length",value:function length(){return this.bytes.length}}]);return VB1}(j0),Vye=/*#__PURE__*/function(j01){"use strict";_inherits(Vye1,j01);function Vye1(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;_class_call_check(this,Vye1);var _this;_this=_call_super(this,Vye1),_this.charSequence=d;return _this}_create_class(Vye1,[{key:"getEncoding",value:function getEncoding(){return j0.Encoding.UTF_16}},{key:"asCharSequence",value:function asCharSequence(){return this.charSequence}},{key:"asBytes",value:function asBytes(){return this.charSequence.toString().split("").map(function(d){return d.codePointAt(0)})}},{key:"length",value:function length(){return this.charSequence.length}}]);return Vye1}(j0),RS=/*#__PURE__*/function(){"use strict";function RS1(){_class_call_check(this,RS1)}_create_class(RS1,null,[{key:"utf16",value:function utf16(d){return new Vye(d)}},{key:"utf8",value:function utf8(d){return Array.isArray(d)?new VB(d):new VB(pn.stringToUtf8ByteArray(d))}}]);return RS1}(),Pf=/*#__PURE__*/function(){"use strict";function Pf1(){_class_call_check(this,Pf1)}_create_class(Pf1,[{key:"canCheckPrefix",value:function canCheckPrefix(){return!0}},{key:"endPos",value:function endPos(){return this.end}}],[{key:"EOF",value:function EOF(){return-8}}]);return Pf1}(),Gye=/*#__PURE__*/function(Pf1){"use strict";_inherits(Gye1,Pf1);function Gye1(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.length;_class_call_check(this,Gye1);var _this;_this=_call_super(this,Gye1),_this.bytes=d,_this.start=u,_this.end=p;return _this}_create_class(Gye1,[{key:"step",value:function step(d){if(d+=this.start,d>=this.end)return Pf.EOF();var u=this.bytes[d++]&255;return u&128?(u&224)===192?(u=u&31,d>=this.end?Pf.EOF():(u=u<<6|this.bytes[d++]&63,u<<3|2)):(u&240)===224?(u=u&15,d+1>=this.end?Pf.EOF():(u=u<<6|this.bytes[d++]&63,u=u<<6|this.bytes[d++]&63,u<<3|3)):(u=u&7,d+2>=this.end?Pf.EOF():(u=u<<6|this.bytes[d++]&63,u=u<<6|this.bytes[d++]&63,u=u<<6|this.bytes[d++]&63,u<<3|4)):u<<3|1}},{key:"index",value:function index(d,u){u+=this.start;var p=this.indexOf(this.bytes,d.prefixUTF8,u);return p<0?p:p-u}},{key:"context",value:function context(d){d+=this.start;var u=-1;if(d>this.start&&d<=this.end){var m=d-1;if(u=this.bytes[m--],u>=128){var h=d-4;for(h<this.start&&(h=this.start);m>=h&&(this.bytes[m]&192)===128;)m--;m<this.start&&(m=this.start),u=this.step(m)>>3}}var p=d<this.end?this.step(d)>>3:-1;return pn.emptyOpContext(u,p)}},{key:"indexOf",value:function indexOf(d,u){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var m=u.length;if(m===0)return-1;var h=d.length;for(var g=p;g<=h-m;g++)for(var x=0;x<m&&d[g+x]===u[x];x++)if(x===m-1)return g;return-1}}]);return Gye1}(Pf),Hye=/*#__PURE__*/function(Pf1){"use strict";_inherits(Hye1,Pf1);function Hye1(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.length;_class_call_check(this,Hye1);var _this;_this=_call_super(this,Hye1),_this.charSequence=d,_this.start=u,_this.end=p;return _this}_create_class(Hye1,[{key:"step",value:function step(d){if(d+=this.start,d<this.end){var u=this.charSequence.codePointAt(d);return u<<3|pn.charCount(u)}else return Pf.EOF()}},{key:"index",value:function index(d,u){u+=this.start;var p=this.charSequence.indexOf(d.prefix,u);return p<0?p:p-u}},{key:"context",value:function context(d){d+=this.start;var u=d>0&&d<=this.charSequence.length?this.charSequence.codePointAt(d-1):-1,p=d<this.charSequence.length?this.charSequence.codePointAt(d):-1;return pn.emptyOpContext(u,p)}}]);return Hye1}(Pf),$i=/*#__PURE__*/function(){"use strict";function $i1(){_class_call_check(this,$i1)}_create_class($i1,null,[{key:"fromUTF8",value:function fromUTF8(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.length;return new Gye(d,u,p)}},{key:"fromUTF16",value:function fromUTF16(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.length;return new Hye(d,u,p)}}]);return $i1}(),MS=/*#__PURE__*/function(Error1){"use strict";_inherits(MS1,Error1);function MS1(d){_class_call_check(this,MS1);var _this;_this=_call_super(this,MS1,[d]),_this.name="RE2JSException";return _this}return MS1}(_wrap_native_super(Error)),ci=/*#__PURE__*/function(MS1){"use strict";_inherits(ci1,MS1);function ci1(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;_class_call_check(this,ci1);var _this;var p="error parsing regexp: ".concat(d);u&&(p+=": `".concat(u,"`")),_this=_call_super(this,ci1,[p]),_this.name="RE2JSSyntaxException",_this.message=p,_this.error=d,_this.input=u;return _this}_create_class(ci1,[{key:"getDescription",value:function getDescription(){return this.error}},{key:"getPattern",value:function getPattern(){return this.input}}]);return ci1}(MS),Zye=/*#__PURE__*/function(MS1){"use strict";_inherits(Zye1,MS1);function Zye1(d){_class_call_check(this,Zye1);var _this;_this=_call_super(this,Zye1,[d]),_this.name="RE2JSCompileException";return _this}return Zye1}(MS),dp=/*#__PURE__*/function(MS1){"use strict";_inherits(dp1,MS1);function dp1(d){_class_call_check(this,dp1);var _this;_this=_call_super(this,dp1,[d]),_this.name="RE2JSGroupException";return _this}return dp1}(MS),Kye=/*#__PURE__*/function(MS1){"use strict";_inherits(Kye1,MS1);function Kye1(d){_class_call_check(this,Kye1);var _this;_this=_call_super(this,Kye1,[d]),_this.name="RE2JSFlagsException";return _this}return Kye1}(MS),GB=/*#__PURE__*/function(){"use strict";function GB1(d,u){_class_call_check(this,GB1);if(d===null)throw new Error("pattern is null");this.patternInput=d;var p=this.patternInput.re2();this.patternGroupCount=p.numberOfCapturingGroups(),this.groups=[],this.namedGroups=p.namedGroups,this.numberOfInstructions=p.numberOfInstructions(),_instanceof(u,j0)?this.resetMatcherInput(u):Array.isArray(u)?this.resetMatcherInput(RS.utf8(u)):this.resetMatcherInput(RS.utf16(u))}_create_class(GB1,[{key:"pattern",value:function pattern(){return this.patternInput}},{key:"reset",value:function reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}},{key:"resetMatcherInput",value:function resetMatcherInput(d){if(d===null)throw new Error("input is null");return this.matcherInput=d,this.reset(),this}},{key:"start",value:function start(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(typeof d=="string"){var u=this.namedGroups[d];if(!Number.isFinite(u))throw new dp("group '".concat(d,"' not found"));d=u}return this.loadGroup(d),this.groups[2*d]}},{key:"end",value:function end(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(typeof d=="string"){var u=this.namedGroups[d];if(!Number.isFinite(u))throw new dp("group '".concat(d,"' not found"));d=u}return this.loadGroup(d),this.groups[2*d+1]}},{key:"programSize",value:function programSize(){return this.numberOfInstructions}},{key:"group",value:function group(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(typeof d=="string"){var m=this.namedGroups[d];if(!Number.isFinite(m))throw new dp("group '".concat(d,"' not found"));d=m}var u=this.start(d),p=this.end(d);return u<0&&p<0?null:this.substring(u,p)}},{key:"groupCount",value:function groupCount(){return this.patternGroupCount}},{key:"loadGroup",value:function loadGroup(d){if(d<0||d>this.patternGroupCount)throw new dp("Group index out of bounds: ".concat(d));if(!this.hasMatch)throw new dp("perhaps no match attempted");if(d===0||this.hasGroups)return;var u=this.groups[1]+1;u>this.matcherInputLength&&(u=this.matcherInputLength);var p=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],u,this.anchorFlag,1+this.patternGroupCount);if(!p[0])throw new dp("inconsistency in matching group data");this.groups=p[1],this.hasGroups=!0}},{key:"matches",value:function matches(){return this.genMatch(0,ct.ANCHOR_BOTH)}},{key:"lookingAt",value:function lookingAt(){return this.genMatch(0,ct.ANCHOR_START)}},{key:"find",value:function find(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(d!==null){if(d<0||d>this.matcherInputLength)throw new dp("start index out of bounds: ".concat(d));return this.reset(),this.genMatch(d,0)}return d=0,this.hasMatch&&(d=this.groups[1],this.groups[0]===this.groups[1]&&d++),this.genMatch(d,ct.UNANCHORED)}},{key:"genMatch",value:function genMatch(d,u){var p=this.patternInput.re2().matchMachineInput(this.matcherInput,d,this.matcherInputLength,u,1);return p[0]?(this.groups=p[1],this.hasMatch=!0,this.hasGroups=!1,this.anchorFlag=u,!0):!1}},{key:"substring",value:function substring(d,u){return this.matcherInput.isUTF8Encoding()?pn.utf8ByteArrayToString(this.matcherInput.asBytes().slice(d,u)):this.matcherInput.asCharSequence().substring(d,u).toString()}},{key:"inputLength",value:function inputLength(){return this.matcherInputLength}},{key:"appendReplacement",value:function appendReplacement(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var p="",m=this.start(),h=this.end();return this.appendPos<m&&(p+=this.substring(this.appendPos,m)),this.appendPos=h,p+=u?this.appendReplacementInternalJava(d):this.appendReplacementInternalJs(d),p}},{key:"appendReplacementInternalJava",value:function appendReplacementInternalJava(d){var u="",p=0,m=d.length;for(var h=0;h<m-1;h++){if(d.codePointAt(h)===ke.CODES.get("\\")){p<h&&(u+=d.substring(p,h)),h++,p=h;continue}if(d.codePointAt(h)===ke.CODES.get("$")){var g=d.codePointAt(h+1);if(ke.CODES.get("0")<=g&&g<=ke.CODES.get("9")){var x=g-ke.CODES.get("0");for(p<h&&(u+=d.substring(p,h)),h+=2;h<m&&(g=d.codePointAt(h),!(g<ke.CODES.get("0")||g>ke.CODES.get("9")||x*10+g-ke.CODES.get("0")>this.patternGroupCount));h++)x=x*10+g-ke.CODES.get("0");if(x>this.patternGroupCount)throw new dp("n > number of groups: ".concat(x));var v=this.group(x);v!==null&&(u+=v),p=h,h--;continue}else if(g===ke.CODES.get("{")){p<h&&(u+=d.substring(p,h)),h++;var x10=h+1;for(;x10<d.length&&d.codePointAt(x10)!==ke.CODES.get("}")&&d.codePointAt(x10)!==ke.CODES.get(" ");)x10++;if(x10===d.length||d.codePointAt(x10)!==ke.CODES.get("}"))throw new dp("named capture group is missing trailing '}'");var v10=d.substring(h+1,x10);u+=this.group(v10),p=x10+1}}}return p<m&&(u+=d.substring(p,m)),u}},{key:"appendReplacementInternalJs",value:function appendReplacementInternalJs(d){var u="",p=0,m=d.length;for(var h=0;h<m-1;h++)if(d.codePointAt(h)===ke.CODES.get("$")){var g=d.codePointAt(h+1);if(ke.CODES.get("$")===g){p<h&&(u+=d.substring(p,h)),u+="$",h++,p=h+1;continue}else if(ke.CODES.get("&")===g){p<h&&(u+=d.substring(p,h));var x=this.group(0);x!==null?u+=x:u+="$&",h++,p=h+1;continue}else if(ke.CODES.get("1")<=g&&g<=ke.CODES.get("9")){var x10=g-ke.CODES.get("0");for(p<h&&(u+=d.substring(p,h)),h+=2;h<m&&(g=d.codePointAt(h),!(g<ke.CODES.get("0")||g>ke.CODES.get("9")||x10*10+g-ke.CODES.get("0")>this.patternGroupCount));h++)x10=x10*10+g-ke.CODES.get("0");if(x10>this.patternGroupCount){u+="$".concat(x10),p=h,h--;continue}var v=this.group(x10);v!==null&&(u+=v),p=h,h--;continue}else if(g===ke.CODES.get("<")){p<h&&(u+=d.substring(p,h)),h++;var x11=h+1;for(;x11<d.length&&d.codePointAt(x11)!==ke.CODES.get(">")&&d.codePointAt(x11)!==ke.CODES.get(" ");)x11++;if(x11===d.length||d.codePointAt(x11)!==ke.CODES.get(">")){u+=d.substring(h-1,x11+1),p=x11+1;continue}var v10=d.substring(h+1,x11);Object.prototype.hasOwnProperty.call(this.namedGroups,v10)?u+=this.group(v10):u+="$<".concat(v10,">"),p=x11+1}}return p<m&&(u+=d.substring(p,m)),u}},{key:"appendTail",value:function appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}},{key:"replaceAll",value:function replaceAll(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.replace(d,!0,u)}},{key:"replaceFirst",value:function replaceFirst(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.replace(d,!1,u)}},{key:"replace",value:function replace(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var m="";for(this.reset();this.find()&&(m+=this.appendReplacement(d,p),!!u););return m+=this.appendTail(),m}}],[{key:"quoteReplacement",value:function quoteReplacement(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return u?d.indexOf("\\")<0&&d.indexOf("$")<0?d:d.split("").map(function(p){var m=p.codePointAt(0);return m===ke.CODES.get("\\")||m===ke.CODES.get("$")?"\\".concat(p):p}).join(""):d.indexOf("$")<0?d:d.split("").map(function(p){return p.codePointAt(0)===ke.CODES.get("$")?"$$":p}).join("")}}]);return GB1}(),mr=(a=/*#__PURE__*/function(){"use strict";function a9(u){_class_call_check(this,a9);this.op=u,this.out=0,this.arg=0,this.runes=[]}_create_class(a9,[{key:"matchRune",value:function matchRune(u){if(this.runes.length===1){var h=this.runes[0];return this.arg&ct.FOLD_CASE?dr.equalsIgnoreCase(h,u):u===h}for(var h10=0;h10<this.runes.length&&h10<=8;h10+=2){if(u<this.runes[h10])return!1;if(u<=this.runes[h10+1])return!0}var p=0,m=this.runes.length/2|0;for(;p<m;){var h11=p+((m-p)/2|0);if(this.runes[2*h11]<=u){if(u<=this.runes[2*h11+1])return!0;p=h11+1}else m=h11}return!1}},{key:"toString",value:function toString(){switch(this.op){case a.ALT:return"alt -> ".concat(this.out,", ").concat(this.arg);case a.ALT_MATCH:return"altmatch -> ".concat(this.out,", ").concat(this.arg);case a.CAPTURE:return"cap ".concat(this.arg," -> ").concat(this.out);case a.EMPTY_WIDTH:return"empty ".concat(this.arg," -> ").concat(this.out);case a.MATCH:return"match";case a.FAIL:return"fail";case a.NOP:return"nop -> ".concat(this.out);case a.RUNE:return this.runes===null?"rune <null>":["rune ",a.escapeRunes(this.runes),this.arg&ct.FOLD_CASE?"/i":""," -> ",this.out].join("");case a.RUNE1:return"rune1 ".concat(a.escapeRunes(this.runes)," -> ").concat(this.out);case a.RUNE_ANY:return"any -> ".concat(this.out);case a.RUNE_ANY_NOT_NL:return"anynotnl -> ".concat(this.out);default:throw new Error("unhandled case in Inst.toString")}}}],[{key:"isRuneOp",value:function isRuneOp(u){return a.RUNE<=u&&u<=a.RUNE_ANY_NOT_NL}},{key:"escapeRunes",value:function escapeRunes(u){var p='"';var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;p+=pn.escapeRune(m)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return p+='"',p}}]);return a9}(),A(a,"ALT",1),A(a,"ALT_MATCH",2),A(a,"CAPTURE",3),A(a,"EMPTY_WIDTH",4),A(a,"FAIL",5),A(a,"MATCH",6),A(a,"NOP",7),A(a,"RUNE",8),A(a,"RUNE1",9),A(a,"RUNE_ANY",10),A(a,"RUNE_ANY_NOT_NL",11),a),Qye=function Qye1(){"use strict";_class_call_check(this,Qye1);this.inst=null,this.cap=[]},HB=/*#__PURE__*/function(){"use strict";function HB1(){_class_call_check(this,HB1);this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}_create_class(HB1,[{key:"contains",value:function contains(d){var u=this.sparse[d];return u<this.size&&this.densePcs[u]===d}},{key:"isEmpty",value:function isEmpty(){return this.size===0}},{key:"add",value:function add(d){var u=this.size++;return this.sparse[d]=u,this.denseThreads[u]=null,this.densePcs[u]=d,u}},{key:"clear",value:function clear(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}},{key:"toString",value:function toString(){var d="{";for(var u=0;u<this.size;u++)u!==0&&(d+=", "),d+=this.densePcs[u];return d+="}",d}}]);return HB1}(),HI=/*#__PURE__*/function(){"use strict";function iW(){_class_call_check(this,iW)}_create_class(iW,[{key:"init",value:function init(u){this.ncap=u,u>this.matchcap.length?this.initNewCap(u):this.resetCap(u)}},{key:"resetCap",value:function resetCap(u){for(var p=0;p<this.poolSize;p++){var m=this.pool[p];m.cap=Array(u).fill(0)}}},{key:"initNewCap",value:function initNewCap(u){for(var p=0;p<this.poolSize;p++){var m=this.pool[p];m.cap=Array(u).fill(0)}this.matchcap=Array(u).fill(0)}},{key:"submatches",value:function submatches(){return this.ncap===0?pn.emptyInts():this.matchcap.slice(0,this.ncap)}},{key:"alloc",value:function alloc(u){var p;return this.poolSize>0?(this.poolSize--,p=this.pool[this.poolSize]):p=new Qye,p.inst=u,p}},{key:"freeQueue",value:function freeQueue(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var m=u.size-p,h=this.poolSize+m;this.pool.length<h&&(this.pool=this.pool.slice(0,Math.max(this.pool.length*2,h)));for(var g=p;g<u.size;g++){var x=u.denseThreads[g];x!==null&&(this.pool[this.poolSize]=x,this.poolSize++)}u.clear()}},{key:"freeThread",value:function freeThread(u){this.pool.length<=this.poolSize&&(this.pool=this.pool.slice(0,this.pool.length*2)),this.pool[this.poolSize]=u,this.poolSize++}},{key:"match",value:function match(u,p,m){var h=this.re2.cond;if(h===pn.EMPTY_ALL||(m===ct.ANCHOR_START||m===ct.ANCHOR_BOTH)&&p!==0)return!1;this.matched=!1,this.matchcap=Array(this.prog.numCap).fill(-1);var g=this.q0,x=this.q1,v=u.step(p),y=v>>3,_=v&7,b=-1,w=0;v!==Pf.EOF()&&(v=u.step(p+_),b=v>>3,w=v&7);var S;for(p===0?S=pn.emptyOpContext(-1,y):S=u.context(p);;){if(g.isEmpty()){if(h&pn.EMPTY_BEGIN_TEXT&&p!==0||this.matched)break;if(this.re2.prefix.length!==0&&b!==this.re2.prefixRune&&u.canCheckPrefix()){var C=u.index(this.re2,p);if(C<0)break;p+=C,v=u.step(p),y=v>>3,_=v&7,v=u.step(p+_),b=v>>3,w=v&7}}!this.matched&&(p===0||m===ct.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=p),this.add(g,this.prog.start,p,this.matchcap,S,null));var k=p+_;if(S=u.context(k),this.step(g,x,p,k,y,S,m,p===u.endPos()),_===0||this.ncap===0&&this.matched)break;p+=_,y=b,_=w,y!==-1&&(v=u.step(p+_),b=v>>3,w=v&7);var E=g;g=x,x=E}return this.freeQueue(x),this.matched}},{key:"step",value:function step(u,p,m,h,g,x,v,y){var _=this.re2.longest;for(var b=0;b<u.size;b++){var w=u.denseThreads[b];if(w===null)continue;if(_&&this.matched&&this.ncap>0&&this.matchcap[0]<w.cap[0]){this.freeThread(w);continue}var S=w.inst,k=!1;switch(S.op){case mr.MATCH:if(v===ct.ANCHOR_BOTH&&!y)break;this.ncap>0&&(!_||!this.matched||this.matchcap[1]<m)&&(w.cap[1]=m,this.matchcap=w.cap.slice(0,this.ncap)),_||this.freeQueue(u,b+1),this.matched=!0;break;case mr.RUNE:k=S.matchRune(g);break;case mr.RUNE1:k=g===S.runes[0];break;case mr.RUNE_ANY:k=!0;break;case mr.RUNE_ANY_NOT_NL:k=g!==ke.CODES.get("\n");break;default:throw new Error("bad inst")}k&&(w=this.add(p,S.out,h,w.cap,x,w)),w!==null&&(this.freeThread(w),u.denseThreads[b]=null)}u.clear()}},{key:"add",value:function add(u,p,m,h,g,x){if(p===0||u.contains(p))return x;var v=u.add(p),y=this.prog.inst[p];switch(y.op){case mr.FAIL:break;case mr.ALT:case mr.ALT_MATCH:x=this.add(u,y.out,m,h,g,x),x=this.add(u,y.arg,m,h,g,x);break;case mr.EMPTY_WIDTH:!(y.arg&~g)&&(x=this.add(u,y.out,m,h,g,x));break;case mr.NOP:x=this.add(u,y.out,m,h,g,x);break;case mr.CAPTURE:if(y.arg<this.ncap){var _=h[y.arg];h[y.arg]=m,this.add(u,y.out,m,h,g,null),h[y.arg]=_}else x=this.add(u,y.out,m,h,g,x);break;case mr.MATCH:case mr.RUNE:case mr.RUNE1:case mr.RUNE_ANY:case mr.RUNE_ANY_NOT_NL:x===null?x=this.alloc(y):x.inst=y,this.ncap>0&&x.cap!==h&&(x.cap=h.slice(0,this.ncap)),u.denseThreads[v]=x,x=null;break;default:throw new Error("unhandled")}return x}}],[{key:"fromRE2",value:function fromRE2(u){var p=new iW;return p.prog=u.prog,p.re2=u,p.q0=new HB(p.prog.numInst()),p.q1=new HB(p.prog.numInst()),p.pool=[],p.poolSize=0,p.matched=!1,p.matchcap=Array(p.prog.numCap<2?2:p.prog.numCap).fill(0),p.ncap=0,p}},{key:"fromMachine",value:function fromMachine(u){var p=new iW;return p.re2=u.re2,p.prog=u.prog,p.q0=u.q0,p.q1=u.q1,p.pool=u.pool,p.poolSize=u.poolSize,p.matched=u.matched,p.matchcap=u.matchcap,p.ncap=u.ncap,p}}]);return iW}(),Jye=function(d){var u=-0x7ee3623b;for(var p=0;p<d.length;p++)u^=d[p],u=Math.imul(u,0x1000193);return u},Yye=function(d,u){if(d.length!==u.length)return!1;for(var p=0;p<d.length;p++)if(d[p]!==u[p])return!1;return!0},Xye=function Xye1(d,u){"use strict";_class_call_check(this,Xye1);this.nfaStates=d,this.isMatch=u,this.nextAscii=new Array(dr.MAX_ASCII+1).fill(null),this.nextMap=new Map},e2e=/*#__PURE__*/function(){"use strict";function e2e1(d){_class_call_check(this,e2e1);this.prog=d,this.stateCache=new Map,this.stateCount=0,this.startState=null,this.stateLimit=1e4}_create_class(e2e1,[{key:"computeClosure",value:function computeClosure(d){var u=new Set,p=_to_consumable_array(d),m=!1;for(;p.length>0;){var h=p.pop();if(u.has(h))continue;u.add(h);var g=this.prog.getInst(h);switch(g.op){case mr.MATCH:m=!0;break;case mr.ALT:case mr.ALT_MATCH:p.push(g.out),p.push(g.arg);break;case mr.NOP:case mr.CAPTURE:p.push(g.out);break;case mr.EMPTY_WIDTH:return null}}return{pcs:Int32Array.from(u).sort(),isMatch:m}}},{key:"getState",value:function getState(d){var u=this.computeClosure(d);if(!u)return null;var p=u.pcs,m=Jye(p),h=this.stateCache.get(m);if(h)for(var x=0;x<h.length;x++){var v=h[x];if(Yye(v.nfaStates,p))return v}else h=[],this.stateCache.set(m,h);if(this.stateCount>=this.stateLimit)return this.stateCache.clear(),this.stateCount=0,this.startState=null,null;var g=new Xye(p,u.isMatch);return h.push(g),this.stateCount++,g}},{key:"step",value:function step(d,u,p){if(p===ct.UNANCHORED&&u<=dr.MAX_ASCII){var g=d.nextAscii[u];if(g!==null)return g}else{var g10=u+(p===ct.UNANCHORED?0:dr.MAX_RUNE+1);if(d.nextMap.has(g10))return d.nextMap.get(g10)}var m=[];for(var g11=0;g11<d.nfaStates.length;g11++){var x=d.nfaStates[g11],v=this.prog.getInst(x);mr.isRuneOp(v.op)&&v.matchRune(u)&&m.push(v.out)}p===ct.UNANCHORED&&m.push(this.prog.start);var h=this.getState(m);if(p===ct.UNANCHORED&&u<=dr.MAX_ASCII)d.nextAscii[u]=h;else{var g12=u+(p===ct.UNANCHORED?0:dr.MAX_RUNE+1);d.nextMap.set(g12,h)}return h}},{key:"match",value:function match(d,u,p){if((p===ct.ANCHOR_START||p===ct.ANCHOR_BOTH)&&u!==0)return!1;if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;var m=d.endPos(),h=this.startState;if(h.isMatch)if(p===ct.ANCHOR_BOTH){if(u===m)return!0}else return!0;var g=u;for(;g<m;){var x=d.step(g),v=x>>3,y=x&7;if(y===0)break;if(h=this.step(h,v,p),h===null)return null;if(h.isMatch)if(p===ct.ANCHOR_BOTH){if(g+y===m)return!0}else return!0;if(h.nfaStates.length===0&&p!==ct.UNANCHORED)return!1;g+=y}return!1}}]);return e2e1}(),Ae=(s=/*#__PURE__*/function(){"use strict";function s10(u){_class_call_check(this,s10);this.op=u,this.flags=0,this.subs=s.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups={}}_create_class(s10,[{key:"reinit",value:function reinit(){this.flags=0,this.subs=s.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups={}}},{key:"toString",value:function toString(){return this.appendTo()}},{key:"appendTo",value:function appendTo(){var u="";switch(this.op){case s.Op.NO_MATCH:u+="[^\\x00-\\x{10FFFF}]";break;case s.Op.EMPTY_MATCH:u+="(?:)";break;case s.Op.STAR:case s.Op.PLUS:case s.Op.QUEST:case s.Op.REPEAT:{var p=this.subs[0];switch(p.op>s.Op.CAPTURE||p.op===s.Op.LITERAL&&p.runes.length>1?u+="(?:".concat(p.appendTo(),")"):u+=p.appendTo(),this.op){case s.Op.STAR:u+="*";break;case s.Op.PLUS:u+="+";break;case s.Op.QUEST:u+="?";break;case s.Op.REPEAT:u+="{".concat(this.min),this.min!==this.max&&(u+=",",this.max>=0&&(u+=this.max)),u+="}";break}this.flags&ct.NON_GREEDY&&(u+="?");break}case s.Op.CONCAT:{var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.subs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p10=_step.value;p10.op===s.Op.ALTERNATE?u+="(?:".concat(p10.appendTo(),")"):u+=p10.appendTo()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}break}case s.Op.ALTERNATE:{var p11="";var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=this.subs[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var m=_step1.value;u+=p11,p11="|",u+=m.appendTo()}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break}case s.Op.LITERAL:this.flags&ct.FOLD_CASE&&(u+="(?i:");var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=this.runes[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var p12=_step2.value;u+=pn.escapeRune(p12)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}this.flags&ct.FOLD_CASE&&(u+=")");break;case s.Op.ANY_CHAR_NOT_NL:u+="(?-s:.)";break;case s.Op.ANY_CHAR:u+="(?s:.)";break;case s.Op.CAPTURE:this.name===null||this.name.length===0?u+="(":u+="(?P<".concat(this.name,">"),this.subs[0].op!==s.Op.EMPTY_MATCH&&(u+=this.subs[0].appendTo()),u+=")";break;case s.Op.BEGIN_TEXT:u+="\\A";break;case s.Op.END_TEXT:this.flags&ct.WAS_DOLLAR?u+="(?-m:$)":u+="\\z";break;case s.Op.BEGIN_LINE:u+="^";break;case s.Op.END_LINE:u+="$";break;case s.Op.WORD_BOUNDARY:u+="\\b";break;case s.Op.NO_WORD_BOUNDARY:u+="\\B";break;case s.Op.CHAR_CLASS:if(this.runes.length%2!==0){u+="[invalid char class]";break}if(u+="[",this.runes.length===0)u+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===dr.MAX_RUNE){u+="^";for(var p13=1;p13<this.runes.length-1;p13+=2){var m10=this.runes[p13]+1,h=this.runes[p13+1]-1;u+=s.quoteIfHyphen(m10),u+=pn.escapeRune(m10),m10!==h&&(u+="-",u+=s.quoteIfHyphen(h),u+=pn.escapeRune(h))}}else for(var p14=0;p14<this.runes.length;p14+=2){var m11=this.runes[p14],h10=this.runes[p14+1];u+=s.quoteIfHyphen(m11),u+=pn.escapeRune(m11),m11!==h10&&(u+="-",u+=s.quoteIfHyphen(h10),u+=pn.escapeRune(h10))}u+="]";break;default:u+=this.op;break}return u}},{key:"maxCap",value:function maxCap(){var u=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(this.op===s.Op.CAPTURE&&(u=this.cap),this.subs!==null)try{for(var _iterator=this.subs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;var m=p.maxCap();u<m&&(u=m)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return u}},{key:"equals",value:function equals(u){if(!(u!==null&&_instanceof(u,s))||this.op!==u.op)return!1;switch(this.op){case s.Op.END_TEXT:{if((this.flags&ct.WAS_DOLLAR)!==(u.flags&ct.WAS_DOLLAR))return!1;break}case s.Op.LITERAL:case s.Op.CHAR_CLASS:{if(this.runes===null&&u.runes===null)break;if(this.runes===null||u.runes===null||this.runes.length!==u.runes.length)return!1;for(var p=0;p<this.runes.length;p++)if(this.runes[p]!==u.runes[p])return!1;break}case s.Op.ALTERNATE:case s.Op.CONCAT:{if(this.subs.length!==u.subs.length)return!1;for(var p10=0;p10<this.subs.length;++p10)if(!this.subs[p10].equals(u.subs[p10]))return!1;break}case s.Op.STAR:case s.Op.PLUS:case s.Op.QUEST:{if((this.flags&ct.NON_GREEDY)!==(u.flags&ct.NON_GREEDY)||!this.subs[0].equals(u.subs[0]))return!1;break}case s.Op.REPEAT:{if((this.flags&ct.NON_GREEDY)!==(u.flags&ct.NON_GREEDY)||this.min!==u.min||this.max!==u.max||!this.subs[0].equals(u.subs[0]))return!1;break}case s.Op.CAPTURE:{if(this.cap!==u.cap||(this.name===null?u.name!==null:this.name!==u.name)||!this.subs[0].equals(u.subs[0]))return!1;break}}return!0}}],[{key:"isPseudoOp",value:function isPseudoOp(u){return u>=s.Op.LEFT_PAREN}},{key:"emptySubs",value:function emptySubs(){return[]}},{key:"quoteIfHyphen",value:function quoteIfHyphen(u){return u===ke.CODES.get("-")?"\\":""}},{key:"fromRegexp",value:function fromRegexp(u){var p=new s(u.op);return p.flags=u.flags,p.subs=u.subs,p.runes=u.runes,p.cap=u.cap,p.min=u.min,p.max=u.max,p.name=u.name,p.namedGroups=u.namedGroups,p}}]);return s10}(),A(s,"Op",WB(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","LEFT_PAREN","VERTICAL_BAR"])),s),t2e=/*#__PURE__*/function(){"use strict";function t2e1(){_class_call_check(this,t2e1);this.inst=[],this.start=0,this.numCap=2}_create_class(t2e1,[{key:"getInst",value:function getInst(d){return this.inst[d]}},{key:"numInst",value:function numInst(){return this.inst.length}},{key:"addInst",value:function addInst(d){this.inst.push(new mr(d))}},{key:"skipNop",value:function skipNop(d){var u=this.inst[d];for(;u.op===mr.NOP||u.op===mr.CAPTURE;)u=this.inst[d],d=u.out;return u}},{key:"prefix",value:function prefix(){var d="",u=this.skipNop(this.start);if(!mr.isRuneOp(u.op)||u.runes.length!==1)return[u.op===mr.MATCH,d];for(;mr.isRuneOp(u.op)&&u.runes.length===1&&!(u.arg&ct.FOLD_CASE);)d+=String.fromCodePoint(u.runes[0]),u=this.skipNop(u.out);return[u.op===mr.MATCH,d]}},{key:"startCond",value:function startCond(){var d=0,u=this.start;e:for(;;){var p=this.inst[u];switch(p.op){case mr.EMPTY_WIDTH:d|=p.arg;break;case mr.FAIL:return-1;case mr.CAPTURE:case mr.NOP:break;default:break e}u=p.out}return d}},{key:"next",value:function next(d){var u=this.inst[d>>1];return d&1?u.arg:u.out}},{key:"patch",value:function patch(d,u){for(;d!==0;){var p=this.inst[d>>1];d&1?(d=p.arg,p.arg=u):(d=p.out,p.out=u)}}},{key:"append",value:function append(d,u){if(d===0)return u;if(u===0)return d;var p=d;for(;;){var h=this.next(p);if(h===0)break;p=h}var m=this.inst[p>>1];return p&1?m.arg=u:m.out=u,d}},{key:"toString",value:function toString(){var d="";for(var u=0;u<this.inst.length;u++){var p=d.length;d+=u,u===this.start&&(d+="*"),d+=" ".substring(d.length-p),d+=this.inst[u],d+="\n"}return d}}]);return t2e1}(),OS=function OS1(){"use strict";var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;_class_call_check(this,OS1);this.i=d,this.out=u,this.nullable=p},r2e=/*#__PURE__*/function(){"use strict";function a9(){_class_call_check(this,a9);this.prog=new t2e,this.newInst(mr.FAIL)}_create_class(a9,[{key:"newInst",value:function newInst(u){return this.prog.addInst(u),new OS(this.prog.numInst()-1,0,!0)}},{key:"nop",value:function nop(){var u=this.newInst(mr.NOP);return u.out=u.i<<1,u}},{key:"fail",value:function fail(){return new OS}},{key:"cap",value:function cap(u){var p=this.newInst(mr.CAPTURE);return p.out=p.i<<1,this.prog.getInst(p.i).arg=u,this.prog.numCap<u+1&&(this.prog.numCap=u+1),p}},{key:"cat",value:function cat1(u,p){return u.i===0||p.i===0?this.fail():(this.prog.patch(u.out,p.i),new OS(u.i,p.out,u.nullable&&p.nullable))}},{key:"alt",value:function alt1(u,p){if(u.i===0)return p;if(p.i===0)return u;var m=this.newInst(mr.ALT),h=this.prog.getInst(m.i);return h.out=u.i,h.arg=p.i,m.out=this.prog.append(u.out,p.out),m.nullable=u.nullable||p.nullable,m}},{key:"loop",value:function loop(u,p){var m=this.newInst(mr.ALT),h=this.prog.getInst(m.i);return p?(h.arg=u.i,m.out=m.i<<1):(h.out=u.i,m.out=m.i<<1|1),this.prog.patch(u.out,m.i),m}},{key:"quest",value:function quest(u,p){var m=this.newInst(mr.ALT),h=this.prog.getInst(m.i);return p?(h.arg=u.i,m.out=m.i<<1):(h.out=u.i,m.out=m.i<<1|1),m.out=this.prog.append(m.out,u.out),m}},{key:"star",value:function star(u,p){return u.nullable?this.quest(this.plus(u,p),p):this.loop(u,p)}},{key:"plus",value:function plus(u,p){return new OS(u.i,this.loop(u,p).out,u.nullable)}},{key:"empty",value:function empty(u){var p=this.newInst(mr.EMPTY_WIDTH);return this.prog.getInst(p.i).arg=u,p.out=p.i<<1,p}},{key:"rune",value:function rune(u,p){var m=this.newInst(mr.RUNE);m.nullable=!1;var h=this.prog.getInst(m.i);return h.runes=u,p&=ct.FOLD_CASE,(u.length!==1||dr.simpleFold(u[0])===u[0])&&(p&=-2),h.arg=p,m.out=m.i<<1,!(p&ct.FOLD_CASE)&&u.length===1||u.length===2&&u[0]===u[1]?h.op=mr.RUNE1:u.length===2&&u[0]===0&&u[1]===dr.MAX_RUNE?h.op=mr.RUNE_ANY:u.length===4&&u[0]===0&&u[1]===ke.CODES.get("\n")-1&&u[2]===ke.CODES.get("\n")+1&&u[3]===dr.MAX_RUNE&&(h.op=mr.RUNE_ANY_NOT_NL),m}},{key:"compile",value:function compile(u){switch(u.op){case Ae.Op.NO_MATCH:return this.fail();case Ae.Op.EMPTY_MATCH:return this.nop();case Ae.Op.LITERAL:if(u.runes.length===0)return this.nop();{var p=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u.runes[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;var h=this.rune([m],u.flags);p=p===null?h:this.cat(p,h)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return p}case Ae.Op.CHAR_CLASS:return this.rune(u.runes,u.flags);case Ae.Op.ANY_CHAR_NOT_NL:return this.rune(a9.ANY_RUNE_NOT_NL(),0);case Ae.Op.ANY_CHAR:return this.rune(a9.ANY_RUNE(),0);case Ae.Op.BEGIN_LINE:return this.empty(pn.EMPTY_BEGIN_LINE);case Ae.Op.END_LINE:return this.empty(pn.EMPTY_END_LINE);case Ae.Op.BEGIN_TEXT:return this.empty(pn.EMPTY_BEGIN_TEXT);case Ae.Op.END_TEXT:return this.empty(pn.EMPTY_END_TEXT);case Ae.Op.WORD_BOUNDARY:return this.empty(pn.EMPTY_WORD_BOUNDARY);case Ae.Op.NO_WORD_BOUNDARY:return this.empty(pn.EMPTY_NO_WORD_BOUNDARY);case Ae.Op.CAPTURE:{var p10=this.cap(u.cap<<1),m10=this.compile(u.subs[0]),h10=this.cap(u.cap<<1|1);return this.cat(this.cat(p10,m10),h10)}case Ae.Op.STAR:return this.star(this.compile(u.subs[0]),(u.flags&ct.NON_GREEDY)!==0);case Ae.Op.PLUS:return this.plus(this.compile(u.subs[0]),(u.flags&ct.NON_GREEDY)!==0);case Ae.Op.QUEST:return this.quest(this.compile(u.subs[0]),(u.flags&ct.NON_GREEDY)!==0);case Ae.Op.CONCAT:{if(u.subs.length===0)return this.nop();{var p11=null;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=u.subs[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var m11=_step1.value;var h11=this.compile(m11);p11=p11===null?h11:this.cat(p11,h11)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return p11}}case Ae.Op.ALTERNATE:{if(u.subs.length===0)return this.nop();{var p12=null;var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=u.subs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var m12=_step2.value;var h12=this.compile(m12);p12=p12===null?h12:this.alt(p12,h12)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return p12}}default:throw new Zye("regexp: unhandled case in compile")}}}],[{key:"ANY_RUNE_NOT_NL",value:function ANY_RUNE_NOT_NL(){return[0,ke.CODES.get("\n")-1,ke.CODES.get("\n")+1,dr.MAX_RUNE]}},{key:"ANY_RUNE",value:function ANY_RUNE(){return[0,dr.MAX_RUNE]}},{key:"compileRegexp",value:function compileRegexp(u){var p=new a9,m=p.compile(u);return p.prog.patch(m.out,p.newInst(mr.MATCH).i),p.prog.start=m.i,p.prog}}]);return a9}(),n2e=/*#__PURE__*/function(){"use strict";function fp(){_class_call_check(this,fp)}_create_class(fp,null,[{key:"simplify",value:function simplify(u){if(u===null)return null;switch(u.op){case Ae.Op.CAPTURE:case Ae.Op.CONCAT:case Ae.Op.ALTERNATE:{var p=u;for(var m=0;m<u.subs.length;m++){var h=u.subs[m],g=fp.simplify(h);p===u&&g!==h&&(p=Ae.fromRegexp(u),p.runes=[],p.subs=u.subs.slice(0,u.subs.length)),p!==u&&(p.subs[m]=g)}return p}case Ae.Op.STAR:case Ae.Op.PLUS:case Ae.Op.QUEST:{var p10=fp.simplify(u.subs[0]);return fp.simplify1(u.op,u.flags,p10,u)}case Ae.Op.REPEAT:{if(u.min===0&&u.max===0)return new Ae(Ae.Op.EMPTY_MATCH);var p11=fp.simplify(u.subs[0]);if(u.max===-1){if(u.min===0)return fp.simplify1(Ae.Op.STAR,u.flags,p11,null);if(u.min===1)return fp.simplify1(Ae.Op.PLUS,u.flags,p11,null);var h10=new Ae(Ae.Op.CONCAT),g10=[];for(var x=0;x<u.min-1;x++)g10.push(p11);return g10.push(fp.simplify1(Ae.Op.PLUS,u.flags,p11,null)),h10.subs=g10.slice(0),h10}if(u.min===1&&u.max===1)return p11;var m10=null;if(u.min>0){m10=[];for(var h11=0;h11<u.min;h11++)m10.push(p11)}if(u.max>u.min){var h12=fp.simplify1(Ae.Op.QUEST,u.flags,p11,null);for(var g11=u.min+1;g11<u.max;g11++){var x10=new Ae(Ae.Op.CONCAT);x10.subs=[p11,h12],h12=fp.simplify1(Ae.Op.QUEST,u.flags,x10,null)}if(m10===null)return h12;m10.push(h12)}if(m10!==null){var h13=new Ae(Ae.Op.CONCAT);return h13.subs=m10.slice(0),h13}return new Ae(Ae.Op.NO_MATCH)}}return u}},{key:"simplify1",value:function simplify1(u,p,m,h){return m.op===Ae.Op.EMPTY_MATCH||u===m.op&&(p&ct.NON_GREEDY)===(m.flags&ct.NON_GREEDY)?m:(h!==null&&h.op===u&&(h.flags&ct.NON_GREEDY)===(p&ct.NON_GREEDY)&&m===h.subs[0]||(h=new Ae(u),h.flags=p,h.subs=[m]),h)}}]);return fp}(),fn=function fn1(d,u){"use strict";_class_call_check(this,fn1);this.sign=d,this.cls=u},ZB=[48,57],KB=[9,10,12,13,32,32],QB=[48,57,65,90,95,95,97,122],JB=new Map([["\\d",new fn(1,ZB)],["\\D",new fn(-1,ZB)],["\\s",new fn(1,KB)],["\\S",new fn(-1,KB)],["\\w",new fn(1,QB)],["\\W",new fn(-1,QB)]]),YB=[48,57,65,90,97,122],XB=[65,90,97,122],eq=[0,127],tq=[9,9,32,32],rq=[0,31,127,127],nq=[48,57],iq=[33,126],oq=[97,122],aq=[32,126],sq=[33,47,58,64,91,96,123,126],lq=[9,13,32,32],uq=[65,90],cq=[48,57,65,90,95,95,97,122],dq=[48,57,65,70,97,102],pq=new Map([["[:alnum:]",new fn(1,YB)],["[:^alnum:]",new fn(-1,YB)],["[:alpha:]",new fn(1,XB)],["[:^alpha:]",new fn(-1,XB)],["[:ascii:]",new fn(1,eq)],["[:^ascii:]",new fn(-1,eq)],["[:blank:]",new fn(1,tq)],["[:^blank:]",new fn(-1,tq)],["[:cntrl:]",new fn(1,rq)],["[:^cntrl:]",new fn(-1,rq)],["[:digit:]",new fn(1,nq)],["[:^digit:]",new fn(-1,nq)],["[:graph:]",new fn(1,iq)],["[:^graph:]",new fn(-1,iq)],["[:lower:]",new fn(1,oq)],["[:^lower:]",new fn(-1,oq)],["[:print:]",new fn(1,aq)],["[:^print:]",new fn(-1,aq)],["[:punct:]",new fn(1,sq)],["[:^punct:]",new fn(-1,sq)],["[:space:]",new fn(1,lq)],["[:^space:]",new fn(-1,lq)],["[:upper:]",new fn(1,uq)],["[:^upper:]",new fn(-1,uq)],["[:word:]",new fn(1,cq)],["[:^word:]",new fn(-1,cq)],["[:xdigit:]",new fn(1,dq)],["[:^xdigit:]",new fn(-1,dq)]]),Rf=/*#__PURE__*/function(){"use strict";function Dh(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pn.emptyInts();_class_call_check(this,Dh);this.r=u,this.len=u.length}_create_class(Dh,[{key:"toArray",value:function toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}},{key:"cleanClass",value:function cleanClass(){if(this.len<4)return this;Dh.qsortIntPair(this.r,0,this.len-2);var u=2;for(var p=2;p<this.len;p+=2){var m=this.r[p],h=this.r[p+1];if(m<=this.r[u-1]+1){h>this.r[u-1]&&(this.r[u-1]=h);continue}this.r[u]=m,this.r[u+1]=h,u+=2}return this.len=u,this}},{key:"appendLiteral",value:function appendLiteral(u,p){return p&ct.FOLD_CASE?this.appendFoldedRange(u,u):this.appendRange(u,u)}},{key:"appendRange",value:function appendRange(u,p){if(this.len>0){for(var m=2;m<=4;m+=2)if(this.len>=m){var h=this.r[this.len-m],g=this.r[this.len-m+1];if(u<=g+1&&h<=p+1)return u<h&&(this.r[this.len-m]=u),p>g&&(this.r[this.len-m+1]=p),this}}return this.r[this.len++]=u,this.r[this.len++]=p,this}},{key:"appendFoldedRange",value:function appendFoldedRange(u,p){if(u<=dr.MIN_FOLD&&p>=dr.MAX_FOLD)return this.appendRange(u,p);if(p<dr.MIN_FOLD||u>dr.MAX_FOLD)return this.appendRange(u,p);u<dr.MIN_FOLD&&(this.appendRange(u,dr.MIN_FOLD-1),u=dr.MIN_FOLD),p>dr.MAX_FOLD&&(this.appendRange(dr.MAX_FOLD+1,p),p=dr.MAX_FOLD);for(var m=u;m<=p;m++){this.appendRange(m,m);for(var h=dr.simpleFold(m);h!==m;h=dr.simpleFold(h))this.appendRange(h,h)}return this}},{key:"appendClass",value:function appendClass(u){for(var p=0;p<u.length;p+=2)this.appendRange(u[p],u[p+1]);return this}},{key:"appendFoldedClass",value:function appendFoldedClass(u){for(var p=0;p<u.length;p+=2)this.appendFoldedRange(u[p],u[p+1]);return this}},{key:"appendNegatedClass",value:function appendNegatedClass(u){var p=0;for(var m=0;m<u.length;m+=2){var h=u[m],g=u[m+1];p<=h-1&&this.appendRange(p,h-1),p=g+1}return p<=dr.MAX_RUNE&&this.appendRange(p,dr.MAX_RUNE),this}},{key:"appendTable",value:function appendTable(u){for(var p=0;p<u.length;++p){var m=u.getLo(p),h=u.getHi(p),g=u.getStride(p);if(g===1){this.appendRange(m,h);continue}for(var x=m;x<=h;x+=g)this.appendRange(x,x)}return this}},{key:"appendNegatedTable",value:function appendNegatedTable(u){var p=0;for(var m=0;m<u.length;++m){var h=u.getLo(m),g=u.getHi(m),x=u.getStride(m);if(x===1){p<=h-1&&this.appendRange(p,h-1),p=g+1;continue}for(var v=h;v<=g;v+=x)p<=v-1&&this.appendRange(p,v-1),p=v+1}return p<=dr.MAX_RUNE&&this.appendRange(p,dr.MAX_RUNE),this}},{key:"appendTableWithSign",value:function appendTableWithSign(u,p){return p<0?this.appendNegatedTable(u):this.appendTable(u)}},{key:"negateClass",value:function negateClass(){var u=0,p=0;for(var m=0;m<this.len;m+=2){var h=this.r[m],g=this.r[m+1];u<=h-1&&(this.r[p]=u,this.r[p+1]=h-1,p+=2),u=g+1}return this.len=p,u<=dr.MAX_RUNE&&(this.r[this.len++]=u,this.r[this.len++]=dr.MAX_RUNE),this}},{key:"appendClassWithSign",value:function appendClassWithSign(u,p){return p<0?this.appendNegatedClass(u):this.appendClass(u)}},{key:"appendGroup",value:function appendGroup(u,p){var m=u.cls;return p&&(m=new Dh().appendFoldedClass(m).cleanClass().toArray()),this.appendClassWithSign(m,u.sign)}},{key:"toString",value:function toString(){return Dh.charClassToString(this.r,this.len)}}],[{key:"charClassToString",value:function charClassToString(u,p){var m="[";for(var h=0;h<p;h+=2){h>0&&(m+=" ");var g=u[h],x=u[h+1];g===x?m+="0x".concat(g.toString(16)):m+="0x".concat(g.toString(16),"-0x").concat(x.toString(16))}return m+="]",m}},{key:"cmp",value:function cmp(u,p,m,h){var g=u[p]-m;return g!==0?g:h-u[p+1]}},{key:"qsortIntPair",value:function qsortIntPair(u,p,m){var h=((p+m)/2|0)&-2,g=u[h],x=u[h+1],v=p,y=m;for(;v<=y;){for(;v<m&&Dh.cmp(u,v,g,x)<0;)v+=2;for(;y>p&&Dh.cmp(u,y,g,x)>0;)y-=2;if(v<=y){if(v!==y){var _=u[v];u[v]=u[y],u[y]=_,_=u[v+1],u[v+1]=u[y+1],u[y+1]=_}v+=2,y-=2}}p<y&&Dh.qsortIntPair(u,p,y),v<m&&Dh.qsortIntPair(u,v,m)}}]);return Dh}(),ZI=/*#__PURE__*/function(){"use strict";function Hwe(u,p){_class_call_check(this,Hwe);this.first=u,this.second=p}_create_class(Hwe,null,[{key:"of",value:function of1(u,p){return new Hwe(u,p)}}]);return Hwe}(),i2e=/*#__PURE__*/function(){"use strict";function i2e1(d){_class_call_check(this,i2e1);this.str=d,this.position=0}_create_class(i2e1,[{key:"pos",value:function pos(){return this.position}},{key:"rewindTo",value:function rewindTo(d){this.position=d}},{key:"more",value:function more(){return this.position<this.str.length}},{key:"peek",value:function peek(){return this.str.codePointAt(this.position)}},{key:"skip",value:function skip(d){this.position+=d}},{key:"skipString",value:function skipString(d){this.position+=d.length}},{key:"pop",value:function pop(){var d=this.str.codePointAt(this.position);return this.position+=pn.charCount(d),d}},{key:"lookingAt",value:function lookingAt(d){return this.rest().startsWith(d)}},{key:"rest",value:function rest(){return this.str.substring(this.position)}},{key:"from",value:function from(d){return this.str.substring(d,this.position)}},{key:"toString",value:function toString(){return this.rest()}}]);return i2e1}(),o2e=(l=/*#__PURE__*/function(){"use strict";function l10(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_class_call_check(this,l10);this.wholeRegexp=u,this.flags=p,this.numCap=0,this.namedGroups={},this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null}_create_class(l10,[{key:"newRegexp",value:function newRegexp(u){var p=this.free;return p!==null&&p.subs!==null&&p.subs.length>0?(this.free=p.subs[0],p.reinit(),p.op=u):(p=new Ae(u),this.numRegexp+=1),p}},{key:"reuse",value:function reuse(u){this.height!==null&&Object.prototype.hasOwnProperty.call(this.height,u)&&delete this.height[u],u.subs!==null&&u.subs.length>0&&(u.subs[0]=this.free),this.free=u}},{key:"checkLimits",value:function checkLimits(u){if(this.numRunes>l.MAX_RUNES)throw new ci(l.ERR_LARGE);this.checkSize(u),this.checkHeight(u)}},{key:"checkSize",value:function checkSize(u){if(this.size===null){if(this.repeats===0&&(this.repeats=1),u.op===Ae.Op.REPEAT){var p=u.max;p===-1&&(p=u.min),p<=0&&(p=1),p>l.MAX_SIZE/this.repeats?this.repeats=l.MAX_SIZE:this.repeats*=p}if(this.numRegexp<l.MAX_SIZE/this.repeats)return;this.size={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.stack[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p10=_step.value;this.checkSize(p10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(this.calcSize(u,!0)>l.MAX_SIZE)throw new ci(l.ERR_LARGE)}},{key:"calcSize",value:function calcSize(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!p&&Object.prototype.hasOwnProperty.call(this.size,u))return this.size[u];var m=0;switch(u.op){case Ae.Op.LITERAL:{m=u.runes.length;break}case Ae.Op.CAPTURE:case Ae.Op.STAR:{m=2+this.calcSize(u.subs[0]);break}case Ae.Op.PLUS:case Ae.Op.QUEST:{m=1+this.calcSize(u.subs[0]);break}case Ae.Op.CONCAT:{var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u.subs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;m=m+this.calcSize(h)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}break}case Ae.Op.ALTERNATE:{var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=u.subs[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var h10=_step1.value;m=m+this.calcSize(h10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}u.subs.length>1&&(m=m+u.subs.length-1);break}case Ae.Op.REPEAT:{var h11=this.calcSize(u.subs[0]);if(u.max===-1){u.min===0?m=2+h11:m=1+u.min*h11;break}m=u.max*h11+(u.max-u.min);break}}return m=Math.max(1,m),this.size[u]=m,m}},{key:"checkHeight",value:function checkHeight(u){if(!(this.numRegexp<l.MAX_HEIGHT)){if(this.height===null){this.height={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.stack[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;this.checkHeight(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(this.calcHeight(u,!0)>l.MAX_HEIGHT)throw new ci(l.ERR_NESTING_DEPTH)}}},{key:"calcHeight",value:function calcHeight(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!p&&Object.prototype.hasOwnProperty.call(this.height,u))return this.height[u];var m=1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u.subs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;var g=this.calcHeight(h);m<1+g&&(m=1+g)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this.height[u]=m,m}},{key:"pop",value:function pop(){return this.stack.pop()}},{key:"popToPseudo",value:function popToPseudo(){var u=this.stack.length,p=u;for(;p>0&&!Ae.isPseudoOp(this.stack[p-1].op);)p--;var m=this.stack.slice(p,u);return this.stack=this.stack.slice(0,p),m}},{key:"push",value:function push(u){if(this.numRunes+=u.runes.length,u.op===Ae.Op.CHAR_CLASS&&u.runes.length===2&&u.runes[0]===u.runes[1]){if(this.maybeConcat(u.runes[0],this.flags&-2))return null;u.op=Ae.Op.LITERAL,u.runes=[u.runes[0]],u.flags=this.flags&-2}else if(u.op===Ae.Op.CHAR_CLASS&&u.runes.length===4&&u.runes[0]===u.runes[1]&&u.runes[2]===u.runes[3]&&dr.simpleFold(u.runes[0])===u.runes[2]&&dr.simpleFold(u.runes[2])===u.runes[0]||u.op===Ae.Op.CHAR_CLASS&&u.runes.length===2&&u.runes[0]+1===u.runes[1]&&dr.simpleFold(u.runes[0])===u.runes[1]&&dr.simpleFold(u.runes[1])===u.runes[0]){if(this.maybeConcat(u.runes[0],this.flags|ct.FOLD_CASE))return null;u.op=Ae.Op.LITERAL,u.runes=[u.runes[0]],u.flags=this.flags|ct.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(u),this.checkLimits(u),u}},{key:"maybeConcat",value:function maybeConcat(u,p){var m=this.stack.length;if(m<2)return!1;var h=this.stack[m-1],g=this.stack[m-2];return h.op!==Ae.Op.LITERAL||g.op!==Ae.Op.LITERAL||(h.flags&ct.FOLD_CASE)!==(g.flags&ct.FOLD_CASE)?!1:(g.runes=l.concatRunes(g.runes,h.runes),u>=0?(h.runes=[u],h.flags=p,!0):(this.pop(),this.reuse(h),!1))}},{key:"newLiteral",value:function newLiteral(u,p){var m=this.newRegexp(Ae.Op.LITERAL);return m.flags=p,p&ct.FOLD_CASE&&(u=l.minFoldRune(u)),m.runes=[u],m}},{key:"literal",value:function literal(u){this.push(this.newLiteral(u,this.flags))}},{key:"op",value:function op(u){var p=this.newRegexp(u);return p.flags=this.flags,this.push(p)}},{key:"repeat",value:function repeat(u,p,m,h,g,x){var v=this.flags;if(v&ct.PERL_X&&(g.more()&&g.lookingAt("?")&&(g.skip(1),v^=ct.NON_GREEDY),x!==-1))throw new ci(l.ERR_INVALID_REPEAT_OP,g.from(x));var y=this.stack.length;if(y===0)throw new ci(l.ERR_MISSING_REPEAT_ARGUMENT,g.from(h));var _=this.stack[y-1];if(Ae.isPseudoOp(_.op))throw new ci(l.ERR_MISSING_REPEAT_ARGUMENT,g.from(h));var b=this.newRegexp(u);if(b.min=p,b.max=m,b.flags=v,b.subs=[_],this.stack[y-1]=b,this.checkLimits(b),u===Ae.Op.REPEAT&&(p>=2||m>=2)&&!this.repeatIsValid(b,1e3))throw new ci(l.ERR_INVALID_REPEAT_SIZE,g.from(h))}},{key:"repeatIsValid",value:function repeatIsValid(u,p){if(u.op===Ae.Op.REPEAT){var m=u.max;if(m===0)return!0;if(m<0&&(m=u.min),m>p)return!1;m>0&&(p=Math.trunc(p/m))}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u.subs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m10=_step.value;if(!this.repeatIsValid(m10,p))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}},{key:"concat",value:function concat(){this.maybeConcat(-1,0);var u=this.popToPseudo();return u.length===0?this.push(this.newRegexp(Ae.Op.EMPTY_MATCH)):this.push(this.collapse(u,Ae.Op.CONCAT))}},{key:"alternate",value:function alternate(){var u=this.popToPseudo();return u.length>0&&this.cleanAlt(u[u.length-1]),u.length===0?this.push(this.newRegexp(Ae.Op.NO_MATCH)):this.push(this.collapse(u,Ae.Op.ALTERNATE))}},{key:"cleanAlt",value:function cleanAlt(u){u.op===Ae.Op.CHAR_CLASS&&(u.runes=new Rf(u.runes).cleanClass().toArray(),u.runes.length===2&&u.runes[0]===0&&u.runes[1]===dr.MAX_RUNE?(u.runes=[],u.op=Ae.Op.ANY_CHAR):u.runes.length===4&&u.runes[0]===0&&u.runes[1]===ke.CODES.get("\n")-1&&u.runes[2]===ke.CODES.get("\n")+1&&u.runes[3]===dr.MAX_RUNE&&(u.runes=[],u.op=Ae.Op.ANY_CHAR_NOT_NL))}},{key:"collapse",value:function collapse(u,p){var _h1;if(u.length===1)return u[0];var m=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;m+=v.op===p?v.subs.length:1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var h=new Array(m).fill(null),g=0;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=u[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var v10=_step1.value;v10.op===p?((_h1=h).splice.apply(_h1,[g,v10.subs.length].concat(_to_consumable_array(v10.subs))),g+=v10.subs.length,this.reuse(v10)):h[g++]=v10}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var x=this.newRegexp(p);if(x.subs=h,p===Ae.Op.ALTERNATE&&(x.subs=this.factor(x.subs),x.subs.length===1)){var v11=x;x=x.subs[0],this.reuse(v11)}return x}},{key:"factor",value:function factor(u){if(u.length<2)return u;var p=0,m=u.length,h=0,g=null,x=0,v=0,y=0;for(var b=0;b<=m;b++){var w=null,S=0,k=0;if(b<m){var E=u[p+b];if(E.op===Ae.Op.CONCAT&&E.subs.length>0&&(E=E.subs[0]),E.op===Ae.Op.LITERAL&&(w=E.runes,S=E.runes.length,k=E.flags&ct.FOLD_CASE),k===v){var C=0;for(;C<x&&C<S&&g[C]===w[C];)C++;if(C>0){x=C;continue}}}if(b!==y)if(b===y+1)u[h++]=u[p+y];else{var E1=this.newRegexp(Ae.Op.LITERAL);E1.flags=v,E1.runes=g.slice(0,x);for(var I=y;I<b;I++)u[p+I]=this.removeLeadingString(u[p+I],x),this.checkLimits(u[p+I]);var C1=this.collapse(u.slice(p+y,p+b),Ae.Op.ALTERNATE),T=this.newRegexp(Ae.Op.CONCAT);T.subs=[E1,C1],u[h++]=T}y=b,g=w,x=S,v=k}m=h,p=0,y=0,h=0;var _=null;for(var b10=0;b10<=m;b10++){var w10=null;if(!(b10<m&&(w10=l.leadingRegexp(u[p+b10]),_!==null&&_.equals(w10)&&(l.isCharClass(_)||_.op===Ae.Op.REPEAT&&_.min===_.max&&l.isCharClass(_.subs[0]))))){if(b10!==y)if(b10===y+1)u[h++]=u[p+y];else{var S10=_;for(var C10=y;C10<b10;C10++){var T1=C10!==y;u[p+C10]=this.removeLeadingRegexp(u[p+C10],T1),this.checkLimits(u[p+C10])}var k10=this.collapse(u.slice(p+y,p+b10),Ae.Op.ALTERNATE),E10=this.newRegexp(Ae.Op.CONCAT);E10.subs=[S10,k10],u[h++]=E10}y=b10,_=w10}}m=h,p=0,y=0,h=0;for(var b11=0;b11<=m;b11++)if(!(b11<m&&l.isCharClass(u[p+b11]))){if(b11!==y)if(b11===y+1)u[h++]=u[p+y];else{var w11=y;for(var k11=y+1;k11<b11;k11++){var E11=u[p+w11],C11=u[p+k11];(E11.op<C11.op||E11.op===C11.op&&(E11.runes!==null?E11.runes.length:0)<(C11.runes!==null?C11.runes.length:0))&&(w11=k11)}var S11=u[p+y];u[p+y]=u[p+w11],u[p+w11]=S11;for(var k12=y+1;k12<b11;k12++)l.mergeCharClass(u[p+y],u[p+k12]),this.reuse(u[p+k12]);this.cleanAlt(u[p+y]),u[h++]=u[p+y]}b11<m&&(u[h++]=u[p+b11]),y=b11+1}m=h,p=0,y=0,h=0;for(var b12=0;b12<m;++b12)b12+1<m&&u[p+b12].op===Ae.Op.EMPTY_MATCH&&u[p+b12+1].op===Ae.Op.EMPTY_MATCH||(u[h++]=u[p+b12]);return m=h,p=0,u.slice(p,m)}},{key:"removeLeadingString",value:function removeLeadingString(u,p){if(u.op===Ae.Op.CONCAT&&u.subs.length>0){var m=this.removeLeadingString(u.subs[0],p);if(u.subs[0]=m,m.op===Ae.Op.EMPTY_MATCH)switch(this.reuse(m),u.subs.length){case 0:case 1:u.op=Ae.Op.EMPTY_MATCH,u.subs=null;break;case 2:{var h=u;u=u.subs[1],this.reuse(h);break}default:u.subs=u.subs.slice(1,u.subs.length);break}return u}return u.op===Ae.Op.LITERAL&&(u.runes=u.runes.slice(p,u.runes.length),u.runes.length===0&&(u.op=Ae.Op.EMPTY_MATCH)),u}},{key:"removeLeadingRegexp",value:function removeLeadingRegexp(u,p){if(u.op===Ae.Op.CONCAT&&u.subs.length>0){switch(p&&this.reuse(u.subs[0]),u.subs=u.subs.slice(1,u.subs.length),u.subs.length){case 0:{u.op=Ae.Op.EMPTY_MATCH,u.subs=Ae.emptySubs();break}case 1:{var m=u;u=u.subs[0],this.reuse(m);break}}return u}return p&&this.reuse(u),this.newRegexp(Ae.Op.EMPTY_MATCH)}},{key:"parseInternal",value:function parseInternal(){if(this.flags&ct.LITERAL)return l.literalRegexp(this.wholeRegexp,this.flags);var u=-1,p=-1,m=-1,h=new i2e(this.wholeRegexp);for(;h.more();){var g=-1;e:switch(h.peek()){case ke.CODES.get("("):if(this.flags&ct.PERL_X&&h.lookingAt("(?")){this.parsePerlFlags(h);break}this.op(Ae.Op.LEFT_PAREN).cap=++this.numCap,h.skip(1);break;case ke.CODES.get("|"):this.parseVerticalBar(),h.skip(1);break;case ke.CODES.get(")"):this.parseRightParen(),h.skip(1);break;case ke.CODES.get("^"):this.flags&ct.ONE_LINE?this.op(Ae.Op.BEGIN_TEXT):this.op(Ae.Op.BEGIN_LINE),h.skip(1);break;case ke.CODES.get("$"):this.flags&ct.ONE_LINE?this.op(Ae.Op.END_TEXT).flags|=ct.WAS_DOLLAR:this.op(Ae.Op.END_LINE),h.skip(1);break;case ke.CODES.get("."):this.flags&ct.DOT_NL?this.op(Ae.Op.ANY_CHAR):this.op(Ae.Op.ANY_CHAR_NOT_NL),h.skip(1);break;case ke.CODES.get("["):this.parseClass(h);break;case ke.CODES.get("*"):case ke.CODES.get("+"):case ke.CODES.get("?"):{g=h.pos();var x=null;switch(h.pop()){case ke.CODES.get("*"):x=Ae.Op.STAR;break;case ke.CODES.get("+"):x=Ae.Op.PLUS;break;case ke.CODES.get("?"):x=Ae.Op.QUEST;break}this.repeat(x,p,m,g,h,u);break}case ke.CODES.get("{"):{g=h.pos();var x10=l.parseRepeat(h);if(x10<0){h.rewindTo(g),this.literal(h.pop());break}p=x10>>16,m=(x10&dr.MAX_BMP)<<16>>16,this.repeat(Ae.Op.REPEAT,p,m,g,h,u);break}case ke.CODES.get("\\"):{var x11=h.pos();if(h.skip(1),(this.flags&ct.PERL_X)!==0&&h.more())switch(h.pop()){case ke.CODES.get("A"):this.op(Ae.Op.BEGIN_TEXT);break e;case ke.CODES.get("b"):this.op(Ae.Op.WORD_BOUNDARY);break e;case ke.CODES.get("B"):this.op(Ae.Op.NO_WORD_BOUNDARY);break e;case ke.CODES.get("C"):throw new ci(l.ERR_INVALID_ESCAPE,"\\C");case ke.CODES.get("Q"):{var _=h.rest(),b=_.indexOf("\\E");b>=0&&(_=_.substring(0,b)),h.skipString(_),h.skipString("\\E");var w=0;for(;w<_.length;){var S=_.codePointAt(w);this.literal(S),w+=pn.charCount(S)}break e}case ke.CODES.get("z"):this.op(Ae.Op.END_TEXT);break e;default:h.rewindTo(x11);break}var v=this.newRegexp(Ae.Op.CHAR_CLASS);if(v.flags=this.flags,h.lookingAt("\\p")||h.lookingAt("\\P")){var _10=new Rf;if(this.parseUnicodeClass(h,_10)){v.runes=_10.toArray(),this.push(v);break e}}var y=new Rf;if(this.parsePerlClassEscape(h,y)){v.runes=y.toArray(),this.push(v);break e}h.rewindTo(x11),this.reuse(v),this.literal(l.parseEscape(h));break}default:this.literal(h.pop());break}u=g}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new ci(l.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}},{key:"parsePerlFlags",value:function parsePerlFlags(u){var p=u.pos(),m=u.rest();if(m.startsWith("(?P<")||m.startsWith("(?<")){var v=m.charAt(2)==="P"?4:3,y=m.indexOf(">");if(y<0)throw new ci(l.ERR_INVALID_NAMED_CAPTURE,m);var _=m.substring(v,y);if(u.skipString(_),u.skip(v+1),!l.isValidCaptureName(_))throw new ci(l.ERR_INVALID_NAMED_CAPTURE,m.substring(0,y+1));var b=this.op(Ae.Op.LEFT_PAREN);if(b.cap=++this.numCap,this.namedGroups[_])throw new ci(l.ERR_DUPLICATE_NAMED_CAPTURE,_);this.namedGroups[_]=this.numCap,b.name=_;return}u.skip(2);var h=this.flags,g=1,x=!1;e:for(;u.more();){var v10=u.pop();switch(v10){case ke.CODES.get("i"):h|=ct.FOLD_CASE,x=!0;break;case ke.CODES.get("m"):h&=-17,x=!0;break;case ke.CODES.get("s"):h|=ct.DOT_NL,x=!0;break;case ke.CODES.get("U"):h|=ct.NON_GREEDY,x=!0;break;case ke.CODES.get("-"):if(g<0)break e;g=-1,h=~h,x=!1;break;case ke.CODES.get(":"):case ke.CODES.get(")"):if(g<0){if(!x)break e;h=~h}v10===ke.CODES.get(":")&&this.op(Ae.Op.LEFT_PAREN),this.flags=h;return;default:break e}}throw new ci(l.ERR_INVALID_PERL_OP,u.from(p))}},{key:"parseVerticalBar",value:function parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(Ae.Op.VERTICAL_BAR)}},{key:"swapVerticalBar",value:function swapVerticalBar(){var u=this.stack.length;if(u>=3&&this.stack[u-2].op===Ae.Op.VERTICAL_BAR&&l.isCharClass(this.stack[u-1])&&l.isCharClass(this.stack[u-3])){var p=this.stack[u-1],m=this.stack[u-3];if(p.op>m.op){var h=m;m=p,p=h,this.stack[u-3]=m}return l.mergeCharClass(m,p),this.reuse(p),this.pop(),!0}if(u>=2){var p10=this.stack[u-1],m10=this.stack[u-2];if(m10.op===Ae.Op.VERTICAL_BAR)return u>=3&&this.cleanAlt(this.stack[u-3]),this.stack[u-2]=p10,this.stack[u-1]=m10,!0}return!1}},{key:"parseRightParen",value:function parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new ci(l.ERR_UNEXPECTED_PAREN,this.wholeRegexp);var u=this.pop(),p=this.pop();if(p.op!==Ae.Op.LEFT_PAREN)throw new ci(l.ERR_UNEXPECTED_PAREN,this.wholeRegexp);this.flags=p.flags,p.cap===0?this.push(u):(p.op=Ae.Op.CAPTURE,p.subs=[u],this.push(p))}},{key:"parsePerlClassEscape",value:function parsePerlClassEscape(u,p){var m=u.pos();if(!(this.flags&ct.PERL_X)||!u.more()||u.pop()!==ke.CODES.get("\\")||!u.more())return!1;u.pop();var h=u.from(m),g=JB.has(h)?JB.get(h):null;return g===null?!1:(p.appendGroup(g,(this.flags&ct.FOLD_CASE)!==0),!0)}},{key:"parseNamedClass",value:function parseNamedClass(u,p){var m=u.rest(),h=m.indexOf(":]");if(h<0)return!1;var g=m.substring(0,h+2);u.skipString(g);var x=pq.has(g)?pq.get(g):null;if(x===null)throw new ci(l.ERR_INVALID_CHAR_RANGE,g);return p.appendGroup(x,(this.flags&ct.FOLD_CASE)!==0),!0}},{key:"parseUnicodeClass",value:function parseUnicodeClass(u,p){var m=u.pos();if(!(this.flags&ct.UNICODE_GROUPS)||!u.lookingAt("\\p")&&!u.lookingAt("\\P"))return!1;u.skip(1);var h=1,g=u.pop();if(g===ke.CODES.get("P")&&(h=-1),!u.more())throw u.rewindTo(m),new ci(l.ERR_INVALID_CHAR_RANGE,u.rest());g=u.pop();var x;if(g!==ke.CODES.get("{"))x=pn.runeToString(g);else{var b=u.rest(),w=b.indexOf("}");if(w<0)throw u.rewindTo(m),new ci(l.ERR_INVALID_CHAR_RANGE,u.rest());x=b.substring(0,w),u.skipString(x),u.skip(1)}x.length!==0&&x.codePointAt(0)===ke.CODES.get("^")&&(h=0-h,x=x.substring(1));var v=l.unicodeTable(x);if(v===null)throw new ci(l.ERR_INVALID_CHAR_RANGE,u.from(m));var y=v.first,_=v.second;if(!(this.flags&ct.FOLD_CASE)||_===null)p.appendTableWithSign(y,h);else{var b10=new Rf().appendTable(y).appendTable(_).cleanClass().toArray();p.appendClassWithSign(b10,h)}return!0}},{key:"parseClass",value:function parseClass(u){var p=u.pos();u.skip(1);var m=this.newRegexp(Ae.Op.CHAR_CLASS);m.flags=this.flags;var h=new Rf,g=1;u.more()&&u.lookingAt("^")&&(g=-1,u.skip(1),!(this.flags&ct.CLASS_NL)&&h.appendRange(ke.CODES.get("\n"),ke.CODES.get("\n")));var x=!0;for(;!u.more()||u.peek()!==ke.CODES.get("]")||x;){if(u.more()&&u.lookingAt("-")&&!(this.flags&ct.PERL_X)&&!x){var b=u.rest();if(b==="-"||!b.startsWith("-]"))throw u.rewindTo(p),new ci(l.ERR_INVALID_CHAR_RANGE,u.rest())}x=!1;var v=u.pos();if(u.lookingAt("[:")){if(this.parseNamedClass(u,h))continue;u.rewindTo(v)}if(this.parseUnicodeClass(u,h)||this.parsePerlClassEscape(u,h))continue;u.rewindTo(v);var y=l.parseClassChar(u,p),_=y;if(u.more()&&u.lookingAt("-")){if(u.skip(1),u.more()&&u.lookingAt("]"))u.skip(-1);else if(_=l.parseClassChar(u,p),_<y)throw new ci(l.ERR_INVALID_CHAR_RANGE,u.from(v))}this.flags&ct.FOLD_CASE?h.appendFoldedRange(y,_):h.appendRange(y,_)}u.skip(1),h.cleanClass(),g<0&&h.negateClass(),m.runes=h.toArray(),this.push(m)}}],[{key:"unicodeTable",value:function unicodeTable(u){return u==="Any"?ZI.of(l.ANY_TABLE,l.ANY_TABLE):Vc.CATEGORIES.has(u)?ZI.of(Vc.CATEGORIES.get(u),Vc.FOLD_CATEGORIES.get(u)):Vc.SCRIPTS.has(u)?ZI.of(Vc.SCRIPTS.get(u),Vc.FOLD_SCRIPT.get(u)):null}},{key:"minFoldRune",value:function minFoldRune(u){if(u<dr.MIN_FOLD||u>dr.MAX_FOLD)return u;var p=u,m=u;for(u=dr.simpleFold(u);u!==m;u=dr.simpleFold(u))p>u&&(p=u);return p}},{key:"leadingRegexp",value:function leadingRegexp(u){if(u.op===Ae.Op.EMPTY_MATCH)return null;if(u.op===Ae.Op.CONCAT&&u.subs.length>0){var p=u.subs[0];return p.op===Ae.Op.EMPTY_MATCH?null:p}return u}},{key:"literalRegexp",value:function literalRegexp(u,p){var m=new Ae(Ae.Op.LITERAL);return m.flags=p,m.runes=pn.stringToRunes(u),m}},{key:"parse",value:function parse(u,p){return new l(u,p).parseInternal()}},{key:"parseRepeat",value:function parseRepeat(u){var p=u.pos();if(!u.more()||!u.lookingAt("{"))return-1;u.skip(1);var m=l.parseInt(u);if(m===-1||!u.more())return-1;var h;if(!u.lookingAt(","))h=m;else{if(u.skip(1),!u.more())return-1;if(u.lookingAt("}"))h=-1;else if((h=l.parseInt(u))===-1)return-1}if(!u.more()||!u.lookingAt("}"))return-1;if(u.skip(1),m<0||m>1e3||h===-2||h>1e3||h>=0&&m>h)throw new ci(l.ERR_INVALID_REPEAT_SIZE,u.from(p));return m<<16|h&dr.MAX_BMP}},{key:"isValidCaptureName",value:function isValidCaptureName(u){if(u.length===0)return!1;for(var p=0;p<u.length;p++){var m=u.codePointAt(p);if(m!==ke.CODES.get("_")&&!pn.isalnum(m))return!1}return!0}},{key:"parseInt",value:function parseInt1(u){var p=u.pos();for(;u.more()&&u.peek()>=ke.CODES.get("0")&&u.peek()<=ke.CODES.get("9");)u.skip(1);var m=u.from(p);return m.length===0||m.length>1&&m.codePointAt(0)===ke.CODES.get("0")?-1:m.length>8?-2:parseFloat(m,10)}},{key:"isCharClass",value:function isCharClass(u){return u.op===Ae.Op.LITERAL&&u.runes.length===1||u.op===Ae.Op.CHAR_CLASS||u.op===Ae.Op.ANY_CHAR_NOT_NL||u.op===Ae.Op.ANY_CHAR}},{key:"matchRune",value:function matchRune(u,p){switch(u.op){case Ae.Op.LITERAL:return u.runes.length===1&&u.runes[0]===p;case Ae.Op.CHAR_CLASS:for(var m=0;m<u.runes.length;m+=2)if(u.runes[m]<=p&&p<=u.runes[m+1])return!0;return!1;case Ae.Op.ANY_CHAR_NOT_NL:return p!==ke.CODES.get("\n");case Ae.Op.ANY_CHAR:return!0}return!1}},{key:"mergeCharClass",value:function mergeCharClass(u,p){switch(u.op){case Ae.Op.ANY_CHAR:break;case Ae.Op.ANY_CHAR_NOT_NL:l.matchRune(p,ke.CODES.get("\n"))&&(u.op=Ae.Op.ANY_CHAR);break;case Ae.Op.CHAR_CLASS:p.op===Ae.Op.LITERAL?u.runes=new Rf(u.runes).appendLiteral(p.runes[0],p.flags).toArray():u.runes=new Rf(u.runes).appendClass(p.runes).toArray();break;case Ae.Op.LITERAL:if(p.runes[0]===u.runes[0]&&p.flags===u.flags)break;u.op=Ae.Op.CHAR_CLASS,u.runes=new Rf().appendLiteral(u.runes[0],u.flags).appendLiteral(p.runes[0],p.flags).toArray();break}}},{key:"parseEscape",value:function parseEscape(u){var p=u.pos();if(u.skip(1),!u.more())throw new ci(l.ERR_TRAILING_BACKSLASH);var m=u.pop();e:switch(m){case ke.CODES.get("1"):case ke.CODES.get("2"):case ke.CODES.get("3"):case ke.CODES.get("4"):case ke.CODES.get("5"):case ke.CODES.get("6"):case ke.CODES.get("7"):if(!u.more()||u.peek()<ke.CODES.get("0")||u.peek()>ke.CODES.get("7"))break;case ke.CODES.get("0"):{var h=m-ke.CODES.get("0");for(var g=1;g<3&&!(!u.more()||u.peek()<ke.CODES.get("0")||u.peek()>ke.CODES.get("7"));g++)h=h*8+u.peek()-ke.CODES.get("0"),u.skip(1);return h}case ke.CODES.get("x"):{if(!u.more())break;if(m=u.pop(),m===ke.CODES.get("{")){var x=0,v=0;for(;;){if(!u.more())break e;if(m=u.pop(),m===ke.CODES.get("}"))break;var y=pn.unhex(m);if(y<0||(v=v*16+y,v>dr.MAX_RUNE))break e;x++}if(x===0)break e;return v}var h10=pn.unhex(m);if(!u.more())break;m=u.pop();var g10=pn.unhex(m);if(h10<0||g10<0)break;return h10*16+g10}case ke.CODES.get("a"):return ke.CODES.get("\x07");case ke.CODES.get("f"):return ke.CODES.get("\f");case ke.CODES.get("n"):return ke.CODES.get("\n");case ke.CODES.get("r"):return ke.CODES.get("\r");case ke.CODES.get("t"):return ke.CODES.get(" ");case ke.CODES.get("v"):return ke.CODES.get("\v");default:if(m<=dr.MAX_ASCII&&!pn.isalnum(m))return m;break}throw new ci(l.ERR_INVALID_ESCAPE,u.from(p))}},{key:"parseClassChar",value:function parseClassChar(u,p){if(!u.more())throw new ci(l.ERR_MISSING_BRACKET,u.from(p));return u.lookingAt("\\")?l.parseEscape(u):u.pop()}},{key:"concatRunes",value:function concatRunes(u,p){return _to_consumable_array(u).concat(_to_consumable_array(p))}}]);return l10}(),A(l,"ERR_INTERNAL_ERROR","regexp/syntax: internal error"),A(l,"ERR_INVALID_CHAR_RANGE","invalid character class range"),A(l,"ERR_INVALID_ESCAPE","invalid escape sequence"),A(l,"ERR_INVALID_NAMED_CAPTURE","invalid named capture"),A(l,"ERR_INVALID_PERL_OP","invalid or unsupported Perl syntax"),A(l,"ERR_INVALID_REPEAT_OP","invalid nested repetition operator"),A(l,"ERR_INVALID_REPEAT_SIZE","invalid repeat count"),A(l,"ERR_MISSING_BRACKET","missing closing ]"),A(l,"ERR_MISSING_PAREN","missing closing )"),A(l,"ERR_MISSING_REPEAT_ARGUMENT","missing argument to repetition operator"),A(l,"ERR_TRAILING_BACKSLASH","trailing backslash at end of expression"),A(l,"ERR_DUPLICATE_NAMED_CAPTURE","duplicate capture group name"),A(l,"ERR_UNEXPECTED_PAREN","unexpected )"),A(l,"ERR_NESTING_DEPTH","expression nests too deeply"),A(l,"ERR_LARGE","expression too large"),A(l,"MAX_HEIGHT",1e3),A(l,"MAX_SIZE",3355443),A(l,"MAX_RUNES",0x2000000),A(l,"ANY_TABLE",new le(new Uint32Array([0,dr.MAX_RUNE,1]))),l),a2e=/*#__PURE__*/function(){"use strict";function a2e1(d){_class_call_check(this,a2e1);this.value=d}_create_class(a2e1,[{key:"get",value:function get1(){return this.value}},{key:"set",value:function set1(d){this.value=d}},{key:"compareAndSet",value:function compareAndSet(d,u){return this.value===d?(this.value=u,!0):!1}}]);return a2e1}(),s2e=/*#__PURE__*/function(){"use strict";function W0(u,p){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;_class_call_check(this,W0);this.expr=u,this.prog=p,this.numSubexp=m,this.longest=h,this.cond=p.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new a2e,this.dfa=new e2e(p)}_create_class(W0,[{key:"executeEngine",value:function executeEngine(u,p,m,h){if(h>0)return this.doExecuteNFA(u,p,m,h);var g=this.dfa.match(u,p,m);return g!==null?g?[]:null:this.doExecuteNFA(u,p,m,h)}},{key:"numberOfCapturingGroups",value:function numberOfCapturingGroups(){return this.numSubexp}},{key:"numberOfInstructions",value:function numberOfInstructions(){return this.prog.numInst()}},{key:"get",value:function get1(){var u;do u=this.pooled.get();while(u&&!this.pooled.compareAndSet(u,u.next));return u}},{key:"reset",value:function reset(){this.pooled.set(null)}},{key:"put",value:function put1(u,p){var m=this.pooled.get();do m=this.pooled.get(),!p&&m&&(u=HI.fromMachine(u),p=!0),u.next!==m&&(u.next=m);while(!this.pooled.compareAndSet(m,u))}},{key:"toString",value:function toString(){return this.expr}},{key:"doExecuteNFA",value:function doExecuteNFA(u,p,m,h){var g=this.get(),x=!1;g?g.next!==null&&(g=HI.fromMachine(g),x=!0):(g=HI.fromRE2(this),x=!0),g.init(h);var v=g.match(u,p,m)?g.submatches():null;return this.put(g,x),v}},{key:"match",value:function match(u){return this.executeEngine($i.fromUTF16(u),0,ct.UNANCHORED,0)!==null}},{key:"matchWithGroup",value:function matchWithGroup(u,p,m,h,g){return _instanceof(u,j0)||(u=RS.utf16(u)),this.matchMachineInput(u,p,m,h,g)}},{key:"matchMachineInput",value:function matchMachineInput(u,p,m,h,g){if(p>m)return[!1,null];var x=u.isUTF16Encoding()?$i.fromUTF16(u.asCharSequence(),0,m):$i.fromUTF8(u.asBytes(),0,m),v=this.executeEngine(x,p,h,2*g);return v===null?[!1,null]:[!0,v]}},{key:"matchUTF8",value:function matchUTF8(u){return this.executeEngine($i.fromUTF8(u),0,ct.UNANCHORED,0)!==null}},{key:"replaceAll",value:function replaceAll(u,p){return this.replaceAllFunc(u,function(){return p},2*u.length+1)}},{key:"replaceFirst",value:function replaceFirst(u,p){return this.replaceAllFunc(u,function(){return p},1)}},{key:"replaceAllFunc",value:function replaceAllFunc(u,p,m){var h=0,g=0,x="",v=$i.fromUTF16(u),y=0;for(;g<=u.length;){var _=this.executeEngine(v,g,ct.UNANCHORED,2);if(_===null||_.length===0)break;x+=u.substring(h,_[0]),(_[1]>h||_[0]===0)&&(x+=p(u.substring(_[0],_[1])),y++),h=_[1];var b=v.step(g)&7;if(g+b>_[1]?g+=b:g+1>_[1]?g++:g=_[1],y>=m)break}return x+=u.substring(h),x}},{key:"pad",value:function pad(u){if(u===null)return null;var p=(1+this.numSubexp)*2;if(u.length<p){var m=new Array(p).fill(-1);for(var h=0;h<u.length;h++)m[h]=u[h];u=m}return u}},{key:"allMatches",value:function allMatches(u,p){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(h){return h};var h=[],g=u.endPos();p<0&&(p=g+1);var x=0,v=0,y=-1;for(;v<p&&x<=g;){var _=this.executeEngine(u,x,ct.UNANCHORED,this.prog.numCap);if(_===null||_.length===0)break;var b=!0;if(_[1]===x){_[0]===y&&(b=!1);var w=u.step(x);w<0?x=g+1:x+=w&7}else x=_[1];y=_[1],b&&(h.push(m(this.pad(_))),v++)}return h}},{key:"findUTF8",value:function findUTF8(u){var p=this.executeEngine($i.fromUTF8(u),0,ct.UNANCHORED,2);return p===null?null:u.slice(p[0],p[1])}},{key:"findUTF8Index",value:function findUTF8Index(u){var p=this.executeEngine($i.fromUTF8(u),0,ct.UNANCHORED,2);return p===null?null:p.slice(0,2)}},{key:"find",value:function find(u){var p=this.executeEngine($i.fromUTF16(u),0,ct.UNANCHORED,2);return p===null?"":u.substring(p[0],p[1])}},{key:"findIndex",value:function findIndex(u){return this.executeEngine($i.fromUTF16(u),0,ct.UNANCHORED,2)}},{key:"findUTF8Submatch",value:function findUTF8Submatch(u){var p=this.executeEngine($i.fromUTF8(u),0,ct.UNANCHORED,this.prog.numCap);if(p===null)return null;var m=new Array(1+this.numSubexp).fill(null);for(var h=0;h<m.length;h++)2*h<p.length&&p[2*h]>=0&&(m[h]=u.slice(p[2*h],p[2*h+1]));return m}},{key:"findUTF8SubmatchIndex",value:function findUTF8SubmatchIndex(u){return this.pad(this.executeEngine($i.fromUTF8(u),0,ct.UNANCHORED,this.prog.numCap))}},{key:"findSubmatch",value:function findSubmatch(u){var p=this.executeEngine($i.fromUTF16(u),0,ct.UNANCHORED,this.prog.numCap);if(p===null)return null;var m=new Array(1+this.numSubexp).fill(null);for(var h=0;h<m.length;h++)2*h<p.length&&p[2*h]>=0&&(m[h]=u.substring(p[2*h],p[2*h+1]));return m}},{key:"findSubmatchIndex",value:function findSubmatchIndex(u){return this.pad(this.executeEngine($i.fromUTF16(u),0,ct.UNANCHORED,this.prog.numCap))}},{key:"findAllUTF8",value:function findAllUTF8(u,p){var m=this.allMatches($i.fromUTF8(u),p,function(h){return u.slice(h[0],h[1])});return m.length===0?null:m}},{key:"findAllUTF8Index",value:function findAllUTF8Index(u,p){var m=this.allMatches($i.fromUTF8(u),p,function(h){return h.slice(0,2)});return m.length===0?null:m}},{key:"findAll",value:function findAll(u,p){var m=this.allMatches($i.fromUTF16(u),p,function(h){return u.substring(h[0],h[1])});return m.length===0?null:m}},{key:"findAllIndex",value:function findAllIndex(u,p){var m=this.allMatches($i.fromUTF16(u),p,function(h){return h.slice(0,2)});return m.length===0?null:m}},{key:"findAllUTF8Submatch",value:function findAllUTF8Submatch(u,p){var m=this.allMatches($i.fromUTF8(u),p,function(h){var g=new Array(h.length/2|0).fill(null);for(var x=0;x<g.length;x++)h[2*x]>=0&&(g[x]=u.slice(h[2*x],h[2*x+1]));return g});return m.length===0?null:m}},{key:"findAllUTF8SubmatchIndex",value:function findAllUTF8SubmatchIndex(u,p){var m=this.allMatches($i.fromUTF8(u),p);return m.length===0?null:m}},{key:"findAllSubmatch",value:function findAllSubmatch(u,p){var m=this.allMatches($i.fromUTF16(u),p,function(h){var g=new Array(h.length/2|0).fill(null);for(var x=0;x<g.length;x++)h[2*x]>=0&&(g[x]=u.substring(h[2*x],h[2*x+1]));return g});return m.length===0?null:m}},{key:"findAllSubmatchIndex",value:function findAllSubmatchIndex(u,p){var m=this.allMatches($i.fromUTF16(u),p);return m.length===0?null:m}}],[{key:"initTest",value:function initTest(u){var p=W0.compile(u),m=new W0(p.expr,p.prog,p.numSubexp,p.longest);return m.cond=p.cond,m.prefix=p.prefix,m.prefixUTF8=p.prefixUTF8,m.prefixComplete=p.prefixComplete,m.prefixRune=p.prefixRune,m}},{key:"compile",value:function compile(u){return W0.compileImpl(u,ct.PERL,!1)}},{key:"compilePOSIX",value:function compilePOSIX(u){return W0.compileImpl(u,ct.POSIX,!0)}},{key:"compileImpl",value:function compileImpl(u,p,m){var h=o2e.parse(u,p),g=h.maxCap();h=n2e.simplify(h);var x=r2e.compileRegexp(h),v=new W0(u,x,g,m),_x_prefix=_sliced_to_array(x.prefix(),2),y=_x_prefix[0],_=_x_prefix[1];return v.prefixComplete=y,v.prefix=_,v.prefixUTF8=pn.stringToUtf8ByteArray(v.prefix),v.prefix.length>0&&(v.prefixRune=v.prefix.codePointAt(0)),v.namedGroups=h.namedGroups,v}},{key:"match",value:function match(u,p){return W0.compile(u).match(p)}}]);return W0}(),l2e=/*#__PURE__*/function(){"use strict";function Qv(){_class_call_check(this,Qv)}_create_class(Qv,null,[{key:"isUpperCaseAlpha",value:function isUpperCaseAlpha(u){return"A"<=u&&u<="Z"}},{key:"isHexadecimal",value:function isHexadecimal(u){return"0"<=u&&u<="9"||"A"<=u&&u<="F"||"a"<=u&&u<="f"}},{key:"getUtf8CharSize",value:function getUtf8CharSize(u){var p=u.charCodeAt(0);return p<128?1:p<2048?2:p<65536?3:4}},{key:"translate",value:function translate(u){if(typeof u!="string")return u;var p="",m=!1,h=u.length;h===0&&(p="(?:)",m=!0);var g=0;for(;g<h;){var x=u[g];if(x==="\\"){if(g+1<h)switch(x=u[g+1],x){case"\\":{p+="\\\\",g+=2;continue}case"c":{if(g+2<h){var y=u[g+2];if(Qv.isUpperCaseAlpha(y)){p+="\\x",p+=(y.charCodeAt(0)-64>>4).toString(16).toUpperCase(),p+=(y.charCodeAt(0)-64&15).toString(16).toUpperCase(),g+=3,m=!0;continue}}p+="\\c",g+=2;continue}case"u":{if(g+2<h){var y10=u[g+2];if(Qv.isHexadecimal(y10)){p+="\\x{"+y10,g+=3;for(var _=0;_<3&&g<h&&(y10=u[g],!!Qv.isHexadecimal(y10));++g,++_)p+=y10;p+="}",m=!0;continue}else if(y10==="{"){p+="\\x",g+=2,m=!0;continue}}p+="\\u",g+=2;continue}default:{p+="\\";var y11=Qv.getUtf8CharSize(x);p+=u.substring(g+1,g+1+y11),g+=y11+1;continue}}}else if(x==="/"){p+="\\/",g+=1,m=!0;continue}else if(x==="("&&g+2<h&&u[g+1]==="?"&&u[g+2]==="<"&&(g+3>=h||u[g+3]!=="="&&u[g+3]!=="!")){p+="(?P<",g+=3,m=!0;continue}var v=Qv.getUtf8CharSize(x);p+=u.substring(g,g+v),g+=v}return m?p:u}}]);return Qv}(),i_=(c=/*#__PURE__*/function(){"use strict";function c10(u,p){_class_call_check(this,c10);this.patternInput=u,this.flagsInput=p}_create_class(c10,[{key:"reset",value:function reset(){this.re2Input.reset()}},{key:"flags",value:function flags(){return this.flagsInput}},{key:"pattern",value:function pattern(){return this.patternInput}},{key:"re2",value:function re2(){return this.re2Input}},{key:"matches",value:function matches(u){return this.testExact(u)}},{key:"matcher",value:function matcher(u){return Array.isArray(u)&&(u=RS.utf8(u)),new GB(this,u)}},{key:"test",value:function test(u){return Array.isArray(u)?this.re2Input.matchUTF8(u):this.re2Input.match(u)}},{key:"testExact",value:function testExact(u){var p=Array.isArray(u)?$i.fromUTF8(u):$i.fromUTF16(u);return this.re2Input.executeEngine(p,0,ct.ANCHOR_BOTH,0)!==null}},{key:"split",value:function split(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var m=this.matcher(u),h=[],g=0,x=0;for(;m.find();){if(x===0&&m.end()===0){x=m.end();continue}if(p>0&&h.length===p-1)break;if(x===m.start()){if(p===0){g+=1,x=m.end();continue}}else for(;g>0;)h.push(""),g-=1;h.push(m.substring(x,m.start())),x=m.end()}if(p===0&&x!==m.inputLength()){for(;g>0;)h.push(""),g-=1;h.push(m.substring(x,m.inputLength()))}return(p!==0||h.length===0)&&h.push(m.substring(x,m.inputLength())),h}},{key:"toString",value:function toString(){return this.patternInput}},{key:"programSize",value:function programSize(){return this.re2Input.numberOfInstructions()}},{key:"groupCount",value:function groupCount(){return this.re2Input.numberOfCapturingGroups()}},{key:"namedGroups",value:function namedGroups(){return this.re2Input.namedGroups}},{key:"equals",value:function equals(u){return this===u?!0:u===null||this.constructor!==u.constructor?!1:this.flagsInput===u.flagsInput&&this.patternInput===u.patternInput}}],[{key:"quote",value:function quote(u){return pn.quoteMeta(u)}},{key:"quoteReplacement",value:function quoteReplacement(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return GB.quoteReplacement(u,p)}},{key:"translateRegExp",value:function translateRegExp(u){return l2e.translate(u)}},{key:"compile",value:function compile(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var m=u;if(p&c.CASE_INSENSITIVE&&(m="(?i)".concat(m)),p&c.DOTALL&&(m="(?s)".concat(m)),p&c.MULTILINE&&(m="(?m)".concat(m)),(p&~(c.MULTILINE|c.DOTALL|c.CASE_INSENSITIVE|c.DISABLE_UNICODE_GROUPS|c.LONGEST_MATCH))!==0)throw new Kye("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");var h=ct.PERL;p&c.DISABLE_UNICODE_GROUPS&&(h&=-129);var g=new c(u,p);return g.re2Input=s2e.compileImpl(m,h,(p&c.LONGEST_MATCH)!==0),g}},{key:"matches",value:function matches(u,p){return c.compile(u).testExact(p)}},{key:"initTest",value:function initTest(u,p,m){if(u==null)throw new Error("pattern is null");if(m==null)throw new Error("re2 is null");var h=new c(u,p);return h.re2Input=m,h}}]);return c10}(),A(c,"CASE_INSENSITIVE",1),A(c,"DOTALL",2),A(c,"MULTILINE",4),A(c,"DISABLE_UNICODE_GROUPS",8),A(c,"LONGEST_MATCH",16),c)});function zpt(e){var t=0;return e.includes("i")&&(t|=i_.CASE_INSENSITIVE),e.includes("m")&&(t|=i_.MULTILINE),e.includes("s")&&(t|=i_.DOTALL),t}function jpt(e){return i_.translateRegExp(e)}function ir(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return new Zwe(e,t)}var Zwe,V9,Upt=se(function(){"use strict";Fpt(),Zwe=/*#__PURE__*/function(){function Zwe1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";_class_call_check(this,Zwe1);A(this,"_re2");A(this,"_pattern");A(this,"_flags");A(this,"_global");A(this,"_ignoreCase");A(this,"_multiline");A(this,"_lastIndex",0);A(this,"_nativeRegex",null);A(this,"_matcher",null);A(this,"_matcherInput",null);this._pattern=e,this._flags=t,this._global=t.includes("g"),this._ignoreCase=t.includes("i"),this._multiline=t.includes("m");try{var _$r=jpt(e),n=zpt(t);this._re2=i_.compile(_$r,n)}catch(r){if(_instanceof(r,ci)){var n10=r.message||"",i="";throw n10.includes("(?=")||n10.includes("(?!")||n10.includes("(?<")||n10.includes("(?<!")||e.includes("(?=")||e.includes("(?!")||e.includes("(?<=")||e.includes("(?<!")?i=" Lookahead (?=, ?!) and lookbehind (?<=, ?<!) assertions are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support these features.":(n10.includes("backreference")||/\\[1-9]/.test(e))&&(i=" Backreferences (\\1, \\2, etc.) are not supported in this environment because the regex engine uses RE2 for ReDoS protection. RE2 guarantees linear-time matching but cannot support backreferences."),new SyntaxError("Invalid regular expression: /".concat(e,"/: ").concat(n10).concat(i))}throw r}}_create_class(Zwe1,[{key:"acquireMatcher",value:function acquireMatcher(e){return this._matcher===null?(this._matcher=this._re2.matcher(e),this._matcherInput=e,this._matcher):(this._matcherInput!==e&&(this._matcher.matcherInput.charSequence=e,this._matcherInput=e),this._matcher.reset(),this._matcher)}},{key:"test",value:function test(e){return this._global&&(this._lastIndex=0),this.acquireMatcher(e).find()}},{key:"exec",value:function exec(e){var s;var t=this.acquireMatcher(e),r=this._global?this._lastIndex:0;if(!t.find(r))return this._global&&(this._lastIndex=0),null;var n=this._re2.groupCount(),i=[];i.push((s=t.group(0))!=null?s:"");for(var l=1;l<=n;l++){var c=t.group(l);i.push(c)}var o=i;o.index=t.start(0),o.input=e;var a=this._re2.namedGroups();if(a&&Object.keys(a).length>0){var l10=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(a)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),c10=_step_value[0],d=_step_value[1];var u=t.group(d);u!==null&&(l10[c10]=u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}o.groups=l10}return this._global&&(this._lastIndex=t.end(0),t.start(0)===t.end(0)&&this._lastIndex++),o}},{key:"match",value:function match(e){var i;if(this._global&&(this._lastIndex=0),!this._global)return this.exec(e);var t=[],r=this.acquireMatcher(e),n=0;for(;r.find(n);){var o=(i=r.group(0))!=null?i:"";if(t.push(o),n=r.end(0),r.start(0)===r.end(0)&&n++,n>e.length)break}return t.length>0?t:null}},{key:"replace",value:function replace(e,t){var l,c;if(this._global&&(this._lastIndex=0),typeof t=="string"){var d=this.acquireMatcher(e);return this._global?d.replaceAll(t,!0):d.replaceFirst(t,!0)}var r=[],n=this._re2.matcher(e),i=0,o=0,a=this._re2.groupCount(),s=this._re2.namedGroups();for(;n.find(o);){r.push(e.slice(i,n.start(0)));var d10=[],u=(l=n.group(0))!=null?l:"";for(var h=1;h<=a;h++)d10.push(n.group(h));if(d10.push(n.start(0)),d10.push(e),s&&Object.keys(s).length>0){var h10=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(s)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),g=_step_value[0],x=_step_value[1];h10[g]=(c=n.group(x))!=null?c:""}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}d10.push(h10)}var p=n.start(0),m=n.end(0);if(r.push(t.apply(void 0,[u].concat(_to_consumable_array(d10)))),i=m,o=i,p===m&&o++,!this._global||o>e.length)break}return r.push(e.slice(i)),r.join("")}},{key:"split",value:function split(e,t){return t===void 0||t<0?this._re2.split(e,-1):t===0?[]:this._re2.split(e,-1).slice(0,t)}},{key:"search",value:function search(e){var t=this.acquireMatcher(e);return t.find()?t.start(0):-1}},{key:"matchAll",value:function matchAll(e){var o,t,r,n,i,a,l,s,l10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._global)throw new Error("matchAll requires global flag");this._lastIndex=0;t=this._re2.matcher(e),r=this._re2.groupCount(),n=this._re2.namedGroups(),i=0;_state.label=1;case 1:if(!t.find(i))return[3,4];a=[];a.push((o=t.group(0))!=null?o:"");for(l=1;l<=r;l++)a.push(t.group(l));s=a;if(s.index=t.start(0),s.input=e,n&&Object.keys(n).length>0){l10=Object.create(null);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=Object.entries(n)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),c=_step_value[0],d=_step_value[1];u=t.group(d);u!==null&&(l10[c]=u)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}s.groups=l10}return[4,s];case 2:if(_state.sent(),i=t.end(0),t.start(0)===t.end(0)&&i++,i>e.length)return[3,4];_state.label=3;case 3:return[3,1];case 4:return[2]}})}},{key:"native",get:function get1(){if(!this._nativeRegex)try{this._nativeRegex=new RegExp(this._pattern,this._flags)}catch(e){this._nativeRegex=new RegExp("",this._flags),Object.defineProperty(this._nativeRegex,"source",{value:this._pattern,writable:!1})}return this._nativeRegex}},{key:"source",get:function get1(){return this._pattern}},{key:"flags",get:function get1(){return this._flags}},{key:"global",get:function get1(){return this._global}},{key:"ignoreCase",get:function get1(){return this._ignoreCase}},{key:"multiline",get:function get1(){return this._multiline}},{key:"lastIndex",get:function get1(){return this._lastIndex},set:function set1(e){this._lastIndex=e}}]);return Zwe1}(),V9=/*#__PURE__*/function(){function V91(e){_class_call_check(this,V91);A(this,"_regex");this._regex=e}_create_class(V91,[{key:"test",value:function test(e){return this._regex.global&&(this._regex.lastIndex=0),this._regex.test(e)}},{key:"exec",value:function exec(e){return this._regex.exec(e)}},{key:"match",value:function match(e){return this._regex.global&&(this._regex.lastIndex=0),e.match(this._regex)}},{key:"replace",value:function replace(e,t){return this._regex.global&&(this._regex.lastIndex=0),e.replace(this._regex,t)}},{key:"split",value:function split(e,t){return e.split(this._regex,t)}},{key:"search",value:function search(e){return e.search(this._regex)}},{key:"matchAll",value:function matchAll(e){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._regex.global)throw new Error("matchAll requires global flag");this._regex.lastIndex=0;t=this._regex.exec(e);_state.label=1;case 1:if(!(t!==null))return[3,4];return[4,t];case 2:_state.sent(),t[0].length===0&&this._regex.lastIndex++,t=this._regex.exec(e);_state.label=3;case 3:return[3,1];case 4:return[2]}})}},{key:"native",get:function get1(){return this._regex}},{key:"source",get:function get1(){return this._regex.source}},{key:"flags",get:function get1(){return this._regex.flags}},{key:"global",get:function get1(){return this._regex.global}},{key:"ignoreCase",get:function get1(){return this._regex.ignoreCase}},{key:"multiline",get:function get1(){return this._regex.multiline}},{key:"lastIndex",get:function get1(){return this._regex.lastIndex},set:function set1(e){this._regex.lastIndex=e}}]);return V91}()}),Ei=se(function(){"use strict";Upt()});function su(e,t,r){var n=typeof r=="boolean"?{ignoreCase:r}:r!=null?r:{},i=t;n.stripQuotes&&(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1));var o=n.ignoreCase?"i:".concat(i):i,a=Jv.get(o);if(!a){if(a=Bpt(i,n.ignoreCase),Jv.size>=Kwe){var s=Jv.keys().next().value;s!==void 0&&Jv.delete(s)}Jv.set(o,a)}return a.test(e)}function Bpt(e,t){var r="^";for(var n=0;n<e.length;n++){var i=e[n];if(i==="*")r+=".*";else if(i==="?")r+=".";else if(i==="["){var o=n+1;for(;o<e.length&&e[o]!=="]";)o++;r+=e.slice(n,o+1),n=o}else i==="."||i==="+"||i==="^"||i==="$"||i==="{"||i==="}"||i==="("||i===")"||i==="|"||i==="\\"?r+="\\".concat(i):r+=i}return r+="$",ir(r,t?"i":"")}var Kwe,Jv,Qwe=se(function(){"use strict";Ei(),Kwe=2048,Jv=new Map});function US(e,t){var r=e.ignoreCase?t.toLowerCase():t,n=e.needles;for(var i=0;i<n.length;i++)if(r.indexOf(n[i])!==-1)return!0;return!1}function u2e(e,t){return e.replace(/\$(&|\d+|<([^>]+)>)/g,function(r,n,i){var a,s,l;if(n==="&")return t[0];if(i!==void 0)return(s=(a=t.groups)==null?void 0:a[i])!=null?s:"";var o=parseInt(n,10);return(l=t[o])!=null?l:""})}function oW(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var M,R;var tmp=r.invertMatch,n=tmp===void 0?!1:tmp,tmp1=r.showLineNumbers,i=tmp1===void 0?!1:tmp1,tmp2=r.countOnly,o=tmp2===void 0?!1:tmp2,tmp3=r.countMatches,a=tmp3===void 0?!1:tmp3,tmp4=r.filename,s=tmp4===void 0?"":tmp4,tmp5=r.onlyMatching,l=tmp5===void 0?!1:tmp5,tmp6=r.beforeContext,c=tmp6===void 0?0:tmp6,tmp7=r.afterContext,d=tmp7===void 0?0:tmp7,tmp8=r.maxCount,u=tmp8===void 0?0:tmp8,tmp9=r.contextSeparator,p=tmp9===void 0?"--":tmp9,tmp10=r.showColumn,m=tmp10===void 0?!1:tmp10,tmp11=r.vimgrep,h=tmp11===void 0?!1:tmp11,tmp12=r.showByteOffset,g=tmp12===void 0?!1:tmp12,tmp13=r.replace,x=tmp13===void 0?null:tmp13,tmp14=r.passthru,v=tmp14===void 0?!1:tmp14,tmp15=r.multiline,y=tmp15===void 0?!1:tmp15,_=r.kResetGroup,b=r.preFilter;if(y)return qpt(e,t,{invertMatch:n,showLineNumbers:i,countOnly:o,countMatches:a,filename:s,onlyMatching:l,beforeContext:c,afterContext:d,maxCount:u,contextSeparator:p,showColumn:m,showByteOffset:g,replace:x,kResetGroup:_,preFilter:b});var w=e.split("\n"),S=w.length,k=S>0&&w[S-1]===""?S-1:S;if(o||a){var $=0,z=(a||l)&&!n;for(var D=0;D<k;D++){var L=w[D];if(!(b&&!n&&!US(b,L)))if(t.lastIndex=0,z)for(var ee=t.exec(L);ee!==null;ee=t.exec(L))$++,ee[0].length===0&&t.lastIndex++;else t.test(L)!==n&&$++}return{output:"".concat(s?"".concat(s,":").concat($):String($),"\n"),matched:$>0,matchCount:$}}if(c===0&&d===0&&!v){var $1=[],z10=!1,D10=0,L10=0;for(var ee1=0;ee1<k&&!(u>0&&D10>=u);ee1++){var pe=w[ee1],N=null;if(b&&!US(b,pe)||(t.lastIndex=0,N=t.exec(pe)),N!==null!==n)if(z10=!0,D10++,l)for(var U=N;U!==null;U=t.exec(pe)){var G=_!==void 0?(M=U[_])!=null?M:"":U[0],K=x!==null?u2e(x,U):G,me=s?"".concat(s,":"):"";g&&(me+="".concat(L10+U.index,":")),i&&(me+="".concat(ee1+1,":")),m&&(me+="".concat(U.index+1,":")),$1.push(me+K),U[0].length===0&&t.lastIndex++}else if(h)for(var U1=N;U1!==null;U1=t.exec(pe)){var G5=s?"".concat(s,":"):"";g&&(G5+="".concat(L10+U1.index,":")),i&&(G5+="".concat(ee1+1,":")),m&&(G5+="".concat(U1.index+1,":")),$1.push(G5+pe),U1[0].length===0&&t.lastIndex++}else{var U10=N?N.index+1:1,G10=pe;x!==null&&(t.lastIndex=0,G10=t.replace(pe,function(){for(var _len=arguments.length,me=new Array(_len),_key=0;_key<_len;_key++){me[_key]=arguments[_key]}if(me[0].length===0)return"";var V=me,ie=me[me.length-1];return(typeof ie==="undefined"?"undefined":_type_of(ie))=="object"&&ie!==null?(V.groups=ie,V.input=me[me.length-2],V.index=me[me.length-3]):(V.input=me[me.length-1],V.index=me[me.length-2]),u2e(x,V)}));var K10=s?"".concat(s,":"):"";g&&(K10+="".concat(L10+(N?N.index:0),":")),i&&(K10+="".concat(ee1+1,":")),m&&(K10+="".concat(U10,":")),$1.push(K10+G10)}L10+=pe.length+1}return{output:$1.length>0?"".concat($1.join("\n"),"\n"):"",matched:z10,matchCount:D10}}if(v){var $10=[],z11=!1,D11=0;for(var L11=0;L11<k;L11++){var ee2=w[L11],pe1=void 0;b&&!US(b,ee2)?pe1=!1:(t.lastIndex=0,pe1=t.test(ee2));var N10=pe1!==n;N10&&(z11=!0,D11++);var U11=N10?":":"-",G11=s?"".concat(s).concat(U11):"";i&&(G11+="".concat(L11+1).concat(U11)),$10.push(G11+ee2)}return{output:$10.length>0?"".concat($10.join("\n"),"\n"):"",matched:z11,matchCount:D11}}var E=[],C=0,T=new Set,I=-1,O=[];for(var $11=0;$11<k&&!(u>0&&C>=u);$11++){var z12=w[$11],D12=void 0;b&&!US(b,z12)?D12=!1:(t.lastIndex=0,D12=t.test(z12)),D12!==n&&(O.push($11),C++)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=O[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var $12=_step.value;var z13=Math.max(0,$12-c);I>=0&&z13>I+1&&E.push(p);for(var L12=z13;L12<$12;L12++)if(!T.has(L12)){T.add(L12),I=L12;var ee3=w[L12];i&&(ee3="".concat(L12+1,"-").concat(ee3)),s&&(ee3="".concat(s,"-").concat(ee3)),E.push(ee3)}if(!T.has($12)){T.add($12),I=$12;var L13=w[$12];if(l){t.lastIndex=0;for(var ee4=t.exec(L13);ee4!==null;ee4=t.exec(L13)){var pe2=_!==void 0?(R=ee4[_])!=null?R:"":ee4[0],N11=x!==null?x:pe2,U12=s?"".concat(s,":"):"";i&&(U12+="".concat($12+1,":")),m&&(U12+="".concat(ee4.index+1,":")),E.push(U12+N11),ee4[0].length===0&&t.lastIndex++}}else{var ee5=L13;i&&(ee5="".concat($12+1,":").concat(ee5)),s&&(ee5="".concat(s,":").concat(ee5)),E.push(ee5)}}var D13=Math.min(k-1,$12+d);for(var L14=$12+1;L14<=D13;L14++)if(!T.has(L14)){T.add(L14),I=L14;var ee6=w[L14];i&&(ee6="".concat(L14+1,"-").concat(ee6)),s&&(ee6="".concat(s,"-").concat(ee6)),E.push(ee6)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{output:E.length>0?"".concat(E.join("\n"),"\n"):"",matched:C>0,matchCount:C}}function qpt(e,t,r){var O;var n=r.invertMatch,i=r.showLineNumbers,o=r.countOnly,a=r.countMatches,s=r.filename,l=r.onlyMatching,c=r.beforeContext,d=r.afterContext,u=r.maxCount,p=r.contextSeparator,m=r.showColumn,h=r.showByteOffset,g=r.replace,x=r.kResetGroup,v=r.preFilter;if(v&&!n&&!US(v,e))return o||a?{output:"".concat(s?"".concat(s,":0"):"0","\n"),matched:!1,matchCount:0}:{output:"",matched:!1,matchCount:0};var y=e.split("\n"),_=y.length,b=_>0&&y[_-1]===""?_-1:_,w=[0];for(var M=0;M<e.length;M++)e[M]==="\n"&&w.push(M+1);var S=function(M){var R=0;for(var $=0;$<w.length&&!(w[$]>M);$++)R=$;return R},k=function(M){var R=S(M);return M-w[R]+1},E=[];t.lastIndex=0;for(var M1=t.exec(e);M1!==null&&!(u>0&&E.length>=u);M1=t.exec(e)){var R=S(M1.index),$=S(M1.index+Math.max(0,M1[0].length-1)),z=x!==void 0?(O=M1[x])!=null?O:"":M1[0];E.push({startLine:R,endLine:$,byteOffset:M1.index,column:k(M1.index),matchText:z}),M1[0].length===0&&t.lastIndex++}if(o||a){var M10;if(a)M10=n?0:E.length;else{var R1=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=E[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var $1=_step.value;for(var z10=$1.startLine;z10<=$1.endLine;z10++)R1.add(z10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}M10=n?b-R1.size:R1.size}return{output:"".concat(s?"".concat(s,":").concat(M10):String(M10),"\n"),matched:M10>0,matchCount:M10}}if(n){var M11=new Set;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=E[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var $10=_step1.value;for(var z11=$10.startLine;z11<=$10.endLine;z11++)M11.add(z11)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var R10=[];for(var $11=0;$11<b;$11++)if(!M11.has($11)){var z12=y[$11];i&&(z12="".concat($11+1,":").concat(z12)),s&&(z12="".concat(s,":").concat(z12)),R10.push(z12)}return{output:R10.length>0?"".concat(R10.join("\n"),"\n"):"",matched:R10.length>0,matchCount:R10.length}}if(E.length===0)return{output:"",matched:!1,matchCount:0};var C=new Set,T=-1,I=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=E[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var M12=_step2.value;var R11=Math.max(0,M12.startLine-c),$12=Math.min(b-1,M12.endLine+d);T>=0&&R11>T+1&&I.push(p);for(var z13=R11;z13<M12.startLine;z13++)if(!C.has(z13)){C.add(z13),T=z13;var D=y[z13];i&&(D="".concat(z13+1,"-").concat(D)),s&&(D="".concat(s,"-").concat(D)),I.push(D)}if(l){var z14=g!==null?g:M12.matchText,D10=s?"".concat(s,":"):"";h&&(D10+="".concat(M12.byteOffset,":")),i&&(D10+="".concat(M12.startLine+1,":")),m&&(D10+="".concat(M12.column,":")),I.push(D10+z14);for(var L=M12.startLine;L<=M12.endLine;L++)C.add(L),T=L}else for(var z15=M12.startLine;z15<=M12.endLine&&z15<b;z15++)if(!C.has(z15)){C.add(z15),T=z15;var D11=y[z15];g!==null&&z15===M12.startLine&&(t.lastIndex=0,D11=t.replace(D11,g));var L10=s?"".concat(s,":"):"";h&&z15===M12.startLine&&(L10+="".concat(M12.byteOffset,":")),i&&(L10+="".concat(z15+1,":")),m&&z15===M12.startLine&&(L10+="".concat(M12.column,":")),I.push(L10+D11)}for(var z16=M12.endLine+1;z16<=$12;z16++)if(!C.has(z16)){C.add(z16),T=z16;var D12=y[z16];i&&(D12="".concat(z16+1,"-").concat(D12)),s&&(D12="".concat(s,"-").concat(D12)),I.push(D12)}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return{output:I.length>0?"".concat(I.join("\n"),"\n"):"",matched:!0,matchCount:E.length}}var Wpt=se(function(){"use strict"});function c2e(e){var t="",r=0;for(;r<e.length;){if(e.slice(r,r+7)==="[[:<:]]"){t+="\\b",r+=7;continue}if(e.slice(r,r+7)==="[[:>:]]"){t+="\\b",r+=7;continue}if(e[r]==="["){var n="[";for(r++,r<e.length&&(e[r]==="^"||e[r]==="!")&&(n+="^",r++),r<e.length&&e[r]==="]"&&(n+="\\]",r++);r<e.length&&e[r]!=="]";){if(e[r]==="["&&r+1<e.length&&e[r+1]===":"){var i=e.indexOf(":]",r+2);if(i!==-1){var o=e.slice(r+2,i),a=Ywe.get(o);if(a){n+=a,r=i+2;continue}}}if(e[r]==="\\"&&r+1<e.length){n+=e[r]+e[r+1],r+=2;continue}n+=e[r],r++}r<e.length&&e[r]==="]"&&(n+="]",r++),t+=n;continue}if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++}return t}function Jwe(e,t){var s;var r,n;switch(t.mode){case"fixed":r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(r=c2e(e),r=r.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),t.mode==="perl"){r=Zpt(r),r=Kpt(r),r=Qpt(r);var l=eft(r);r=l.pattern,n=l.kResetGroup}break}default:r=c2e(e),r=ift(r);break}t.wholeWord&&(r="\\b(?:".concat(r,")\\b")),t.lineRegexp&&(r="^".concat(r,"$"));var i=/\\u\{[0-9A-Fa-f]+\}/.test(r),o="g"+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.multilineDotall?"s":"")+(i?"u":""),a=Vpt(r,(s=t.ignoreCase)!=null?s:!1);return{regex:ir(r,o),kResetGroup:n,preFilter:a!=null?a:void 0}}function Vpt(e,t){var r=e;if(r.startsWith("\\b(?:")&&r.endsWith(")\\b")?r=r.slice(5,r.length-3):r.startsWith("\\b")&&r.endsWith("\\b")&&r.length>=4&&(r=r.slice(2,r.length-2)),r.length===0)return null;var n=Gpt(r);if(n===null)return null;var i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=Hpt(o);if(a===null||a.length===0)return null;i.push(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i.length===0?null:{needles:t?i.map(function(o){return o.toLowerCase()}):i,ignoreCase:t}}function Gpt(e){var t=[],r=0,n=!1,i=0;for(var o=0;o<e.length;o++){var a=e[o];if(a==="\\"){o++;continue}if(n){a==="]"&&(n=!1);continue}if(a==="[")n=!0;else if(a==="(")r++;else if(a===")"){if(r--,r<0)return null}else a==="|"&&r===0&&(t.push(e.slice(i,o)),i=o+1)}return r!==0||n?null:(t.push(e.slice(i)),t)}function Hpt(e){var t=e;if(t.startsWith("^")&&(t=t.slice(1)),t.endsWith("$")){var n=0;for(var i=t.length-2;i>=0&&t[i]==="\\";i--)n++;n%2===0&&(t=t.slice(0,-1))}if(t.length===0)return null;var r="";for(var n10=0;n10<t.length;n10++){var i10=t[n10];if(i10==="\\"){var o=t[n10+1];if(o===void 0||/[dDwWsSbBAZzGQE0-9ckpPNXRxuU]/.test(o))return null;o==="n"?r+="\n":o==="t"?r+=" ":o==="r"?r+="\r":o==="f"?r+="\f":o==="v"?r+="\v":r+=o,n10++;continue}if(/[.*+?^${}()|[\]]/.test(i10))return null;r+=i10}return r}function Zpt(e){var t="",r=0;for(;r<e.length;)if(e[r]==="\\"&&r+1<e.length&&e[r+1]==="Q"){r+=2;var n="";for(;r<e.length;){if(e[r]==="\\"&&r+1<e.length&&e[r+1]==="E"){r+=2;break}n+=e[r],r++}t+=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else t+=e[r],r++;return t}function Kpt(e){return e.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function Qpt(e){var t="",r=0;for(;r<e.length;){if(e[r]==="("&&r+1<e.length&&e[r+1]==="?"){var n=e.slice(r).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(n){var i=n[1]||"",o=n[2]||"",a=n[3];if(a===":"){var s=r+n[0].length-1,l=Jpt(e,r);if(l!==-1){var c=e.slice(s+1,l),d=Ypt(c,i,o);t+="(?:".concat(d,")"),r=l+1;continue}}else if(a===")"||a===""){r+=n[0].length;continue}}}t+=e[r],r++}return t}function Jpt(e,t){var r=0,n=t;for(;n<e.length;){if(e[n]==="\\"){n+=2;continue}if(e[n]==="["){for(n++;n<e.length&&e[n]!=="]";)e[n]==="\\"&&n++,n++;n++;continue}if(e[n]==="(")r++;else if(e[n]===")"&&(r--,r===0))return n;n++}return-1}function Ypt(e,t,r){var n=e;return t.includes("i")&&(n=Xpt(n)),n}function Xpt(e){var t="",r=0;for(;r<e.length;){var n=e[r];if(n==="\\"){r+1<e.length?(t+=n+e[r+1],r+=2):(t+=n,r++);continue}if(n==="["){t+=n,r++,r<e.length&&e[r]==="^"&&(t+=e[r],r++);var i=[];for(;r<e.length&&e[r]!=="]";)if(e[r]==="\\")i.push(e[r]),r++,r<e.length&&(i.push(e[r]),r++);else if(e[r]==="-"&&i.length>0&&r+1<e.length&&e[r+1]!=="]"){var o=i[i.length-1],a=e[r+1];i.push("-"),i.push(a),/[a-z]/.test(o)&&/[a-z]/.test(a)?(i.push(o.toUpperCase()),i.push("-"),i.push(a.toUpperCase())):/[A-Z]/.test(o)&&/[A-Z]/.test(a)&&(i.push(o.toLowerCase()),i.push("-"),i.push(a.toLowerCase())),r+=2}else{var o10=e[r];if(i.push(o10),/[a-zA-Z]/.test(o10)){var a9=o10===o10.toLowerCase()?o10.toUpperCase():o10.toLowerCase();i.includes(a9)||i.push(a9)}r++}t+=i.join(""),r<e.length&&(t+=e[r],r++);continue}if(/[a-zA-Z]/.test(n)){var i10=n.toLowerCase(),o11=n.toUpperCase();t+="[".concat(o11).concat(i10,"]")}else t+=n;r++}return t}function eft(e){var t=tft(e);if(t===-1)return{pattern:e};var r=e.slice(0,t),n=e.slice(t+2),i=rft(r);return{pattern:"(?:".concat(r,")(").concat(n,")"),kResetGroup:i+1}}function tft(e){var t=0;for(;t<e.length-1;)if(e[t]==="\\"){if(e[t+1]==="K"){var r=0,n=t-1;for(;n>=0&&e[n]==="\\";)r++,n--;if(r%2===0)return t}t+=2}else t++;return-1}function rft(e){var t=0,r=0;for(;r<e.length;){if(e[r]==="\\"){r+=2;continue}if(e[r]==="["){for(r++;r<e.length&&e[r]!=="]";)e[r]==="\\"&&r++,r++;r++;continue}if(e[r]==="(")if(r+1<e.length&&e[r+1]==="?"){if(r+2<e.length){var n=e[r+2];if(n===":"||n==="="||n==="!"){r++;continue}if(n==="<"&&r+3<e.length){var i=e[r+3];if(i==="="||i==="!"){r++;continue}t++,r++;continue}}}else t++;r++}return t}function nft(e){var t=e.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return t=t.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),t=t.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),t}function ift(e){var t="",r=0,n=!0,i=0;for(;r<e.length;){var o=e[r];if(o==="["){for(t+=o,r++,r<e.length&&(e[r]==="^"||e[r]==="!")&&(t+=e[r],r++),r<e.length&&e[r]==="]"&&(t+=e[r],r++);r<e.length&&e[r]!=="]";)e[r]==="\\"&&r+1<e.length?(t+=e[r]+e[r+1],r+=2):(t+=e[r],r++);r<e.length&&e[r]==="]"&&(t+=e[r],r++),n=!1;continue}if(o==="\\"&&r+1<e.length){var a=e[r+1];if(a==="|"){t+="|",r+=2,n=!0;continue}if(a==="("){t+="(",r+=2,i++,n=!0;continue}if(a===")"){t+=")",r+=2,i=Math.max(0,i-1),n=!1;continue}if(a==="{"){var s=e.slice(r).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(s){var l=s[1],c=s[2]!==void 0,d=s[3]||"";c?t+="{".concat(l,",").concat(d,"}"):t+="{".concat(l,"}"),r+=s[0].length,n=!1;continue}t+="\\{",r+=2,n=!1;continue}if(a==="}"){t+="\\}",r+=2,n=!1;continue}t+=o+a,r+=2,n=!1;continue}if(o==="*"&&n){t+="\\*",r++;continue}if(o==="^"){if(n){t+="^",r++;continue}t+="\\^",r++;continue}if(o==="$"){var a9=r===e.length-1,s10=r+2<e.length&&e[r+1]==="\\"&&e[r+2]===")";a9||s10?t+="$":t+="\\$",r++,n=!1;continue}o==="+"||o==="?"||o==="|"||o==="("||o===")"||o==="{"||o==="}"?t+="\\".concat(o):t+=o,r++,n=!1}return t}var Ywe,oft=se(function(){"use strict";Ei(),Ywe=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]])}),Xwe=se(function(){"use strict";Wpt(),oft()}),s9={};St(s9,{egrepCommand:function(){return r4e},egrepFlagsForFuzzing:function(){return o4e},fgrepCommand:function(){return t4e},fgrepFlagsForFuzzing:function(){return i4e},flagsForFuzzing:function(){return n4e},grepCommand:function(){return l9}});function e4e(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;return _async_to_generator(function(){var o,s,l,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s10,l10,c,d,err,a9;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(i>=iV)return[2];o=r.fs.resolvePath(r.cwd,e);_state.label=1;case 1:_state.trys.push([1,14,,15]);return[4,r.fs.stat(o)];case 2:if(!_state.sent().isDirectory){s=e.split("/").pop()||"";if(t){l=t.replace(/^\//,"");su(s,l,{stripQuotes:!0})&&n.push(e)}return[2]}return[4,r.fs.readdir(o)];case 3:a=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,11,12,13]);_iterator=a[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];s10=_step.value;l10=e==="."?s10:"".concat(e,"/").concat(s10),c=r.fs.resolvePath(r.cwd,l10);return[4,r.fs.stat(c)];case 6:if(!_state.sent().isDirectory)return[3,8];return[4,e4e(l10,t,r,n,i+1)];case 7:_state.sent();return[3,9];case 8:if(t){d=t.replace(/^\//,"");su(s10,d,{stripQuotes:!0})&&n.push(l10)}_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,5];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:return[3,15];case 14:a9=_state.sent();return[3,15];case 15:return[2]}})})()}function aft(e,t){return _async_to_generator(function(){var r,n,i,o,s,l,c,d,a,s10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l10,c10,s11,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l11,c11,s12;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=e.lastIndexOf("/");if(!(n===-1?(i=t.cwd,o=e):(i=e.slice(0,n)||"/",o=e.slice(n+1)),e.includes("**")))return[3,2];s=[],l=e.split("**"),c=l[0].replace(/\/$/,"")||".",d=l[1]||"";return[4,e4e(c,d,t,s)];case 1:return[2,(_state.sent(),s.map(function(u){return{path:u}}))];case 2:a=t.fs.resolvePath(t.cwd,i);_state.label=3;case 3:_state.trys.push([3,8,,9]);if(!t.fs.readdirWithFileTypes)return[3,5];return[4,t.fs.readdirWithFileTypes(a)];case 4:s10=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=s10[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l10=_step.value;if(su(l10.name,o,{stripQuotes:!0})){c10=n===-1?l10.name:"".concat(i,"/").concat(l10.name);r.push({path:c10,isFile:l10.isFile})}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,7];case 5:return[4,t.fs.readdir(a)];case 6:s11=_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=s11[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){l11=_step1.value;if(su(l11,o,{stripQuotes:!0})){c11=n===-1?l11:"".concat(i,"/").concat(l11);r.push({path:c11})}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=7;case 7:return[3,9];case 8:s12=_state.sent();return[3,9];case 9:return[2,r.sort(function(s,l){return s.path.localeCompare(l.path)})]}})})()}function A9(_01,_11,_21){return _async_to_generator(function(e,t){var r,n,i,o,a,s,l,c,d,p,p10,u,p11,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m,_l1,h,g,err,p12,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m10,_l2,h10,g10,err,c10;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:[],n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:[],i=_arguments.length>4&&_arguments[4]!==void 0?_arguments[4]:[],o=_arguments.length>5?_arguments[5]:void 0,a=_arguments.length>6&&_arguments[6]!==void 0?_arguments[6]:0;if(a>=iV)return[2,[]];s=t.fs.resolvePath(t.cwd,e),l=[];_state.label=1;case 1:_state.trys.push([1,24,,25]);if(!(o!==void 0))return[3,2];c=o,d=!o;return[3,4];case 2:return[4,t.fs.stat(s)];case 3:p=_state.sent();c=p.isFile,d=p.isDirectory;_state.label=4;case 4:if(c){p10=e.split("/").pop()||e;return[2,n.length>0&&n.some(function(m){return su(p10,m,{stripQuotes:!0})})?[]:r.length>0&&!r.some(function(m){return su(p10,m,{stripQuotes:!0})})?[]:[{path:e,isFile:!0}]]}if(!d)return[2,[]];u=e.split("/").pop()||e;if(i.length>0&&i.some(function(p){return su(u,p,{stripQuotes:!0})}))return[2,[]];if(!t.fs.readdirWithFileTypes)return[3,14];return[4,t.fs.readdirWithFileTypes(s)];case 5:p11=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=6;case 6:_state.trys.push([6,11,12,13]);_iterator=p11[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];m=_step.value;if(m.name.startsWith("."))return[3,9];h=e==="."?m.name:"".concat(e,"/").concat(m.name);return[4,A9(h,t,r,n,i,m.isFile,a+1)];case 8:g=_state.sent();(_l1=l).push.apply(_l1,_to_consumable_array(g));_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,7];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:return[3,23];case 14:return[4,t.fs.readdir(s)];case 15:p12=_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=16;case 16:_state.trys.push([16,21,22,23]);_iterator1=p12[Symbol.iterator]();_state.label=17;case 17:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,20];m10=_step1.value;if(m10.startsWith("."))return[3,19];h10=e==="."?m10:"".concat(e,"/").concat(m10);return[4,A9(h10,t,r,n,i,void 0,a+1)];case 18:g10=_state.sent();(_l2=l).push.apply(_l2,_to_consumable_array(g10));_state.label=19;case 19:_iteratorNormalCompletion1=true;return[3,17];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 23:return[3,25];case 24:c10=_state.sent();return[3,25];case 25:return[2,l]}})}).apply(this,arguments)}var d2e,l9,iV,t4e,r4e,n4e,i4e,o4e,fq=se(function(){"use strict";kr(),Qwe(),jt(),Xwe(),d2e={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},l9={name:"grep",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,N,U,G,K,V,V10,me,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,V11,C,T,I,O,N10,N11,M,R,$,z,D,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,N12,_D1,U1,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,G5,_D2,K10,err,_D3,U10,err,L,ee,N13,U11,G10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,K11,me1,V12,pe;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(d2e)];r=!1,n=!1,i=!1,o=!1,a=!1,s=!1,l=!1,c=!1,d=!1,u=!1,p=!1,m=!1,h=!1,g=!1,x=!1,v=0,y=0,_=0,b=[],w=[],S=[],k=null,E=[];for(N=0;N<e.length;N++){U=e[N];if(U.startsWith("-")&&U!=="-"){if(U==="-e"&&N+1<e.length){k=e[++N];continue}if(U.startsWith("--include=")){b.push(U.slice(10));continue}if(U.startsWith("--exclude=")){w.push(U.slice(10));continue}if(U.startsWith("--exclude-dir=")){S.push(U.slice(14));continue}if(U.startsWith("--max-count=")){v=parseInt(U.slice(12),10);continue}G=U.match(/^-m(\d+)$/);if(G){v=parseInt(G[1],10);continue}if(U==="-m"&&N+1<e.length){v=parseInt(e[++N],10);continue}K=U.match(/^-([ABC])(\d+)$/);if(K){V=parseInt(K[2],10);K[1]==="A"?_=V:K[1]==="B"?y=V:K[1]==="C"&&(y=V,_=V);continue}if((U==="-A"||U==="-B"||U==="-C")&&N+1<e.length){V10=parseInt(e[++N],10);U==="-A"?_=V10:U==="-B"?y=V10:(y=V10,_=V10);continue}me=U.startsWith("--")?[U]:U.slice(1).split("");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=me[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){V11=_step.value;if(V11==="i"||V11==="--ignore-case")r=!0;else if(V11==="n"||V11==="--line-number")n=!0;else if(V11==="v"||V11==="--invert-match")i=!0;else if(V11==="c"||V11==="--count")o=!0;else if(V11==="l"||V11==="--files-with-matches")a=!0;else if(V11==="L"||V11==="--files-without-match")s=!0;else if(V11==="r"||V11==="R"||V11==="--recursive")l=!0;else if(V11==="w"||V11==="--word-regexp")c=!0;else if(V11==="x"||V11==="--line-regexp")d=!0;else if(V11==="E"||V11==="--extended-regexp")u=!0;else if(V11==="P"||V11==="--perl-regexp")p=!0;else if(V11==="F"||V11==="--fixed-strings")m=!0;else if(V11==="o"||V11==="--only-matching")h=!0;else if(V11==="h"||V11==="--no-filename")g=!0;else if(V11==="q"||V11==="--quiet"||V11==="--silent")x=!0;else{if(V11.startsWith("--"))return[2,fr("grep",V11)];if(V11.length===1)return[2,fr("grep","-".concat(V11))]}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else k===null?k=U:E.push(U)}if(k===null)return[2,{stdout:"",stderr:"grep: missing pattern\n",exitCode:2}];C=m?"fixed":u?"extended":p?"perl":"basic";try{N10=Jwe(k,{mode:C,ignoreCase:r,wholeWord:c,lineRegexp:d});T=N10.regex,I=N10.kResetGroup,O=N10.preFilter}catch(N){return[2,{stdout:"",stderr:"grep: invalid regular expression: ".concat(k,"\n"),exitCode:2}]}if(E.length===0&&t.stdin!==void 0){N11=oW(Sn(t.stdin),T,{invertMatch:i,showLineNumbers:n,countOnly:o,filename:"",onlyMatching:h,beforeContext:y,afterContext:_,maxCount:v,kResetGroup:I,preFilter:O});return[2,x?{stdout:"",stderr:"",exitCode:N11.matched?0:1}:{stdout:N11.output,stderr:"",exitCode:N11.matched?0:1}]}if(E.length===0)return[2,{stdout:"",stderr:"grep: no input files\n",exitCode:2}];M="",R="",$=!1,z=!1,D=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,19,20,21]);_iterator1=E[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,18];N12=_step1.value;if(!(N12.includes("*")||N12.includes("?")||N12.includes("[")))return[3,14];return[4,aft(N12,t)];case 3:U1=_state.sent();_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(!l)return[3,12];_state.label=4;case 4:_state.trys.push([4,9,10,11]);_iterator2=U1[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,8];G5=_step2.value;return[4,A9(G5.path,t,b,w,S,G5.isFile)];case 6:K10=_state.sent();(_D2=D).push.apply(_D2,_to_consumable_array(K10));_state.label=7;case 7:_iteratorNormalCompletion2=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 11:return[3,13];case 12:(_D1=D).push.apply(_D1,_to_consumable_array(U1));_state.label=13;case 13:return[3,17];case 14:if(!l)return[3,16];return[4,A9(N12,t,b,w,S)];case 15:U10=_state.sent();(_D3=D).push.apply(_D3,_to_consumable_array(U10));return[3,17];case 16:D.push({path:N12});_state.label=17;case 17:_iteratorNormalCompletion1=true;return[3,2];case 18:return[3,21];case 19:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,21];case 20:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 21:L=(D.length>1||l)&&!g,ee=50;N13=0;_state.label=22;case 22:if(!(N13<D.length))return[3,25];U11=D.slice(N13,N13+ee);return[4,Promise.all(U11.map(function(K){return _async_to_generator(function(){var me,V,ie,re,_tmp,de,Y,oe,xe,ie1;return _ts_generator(this,function(_state){switch(_state.label){case 0:me=K.path,V=me.split("/").pop()||me;if(w.length>0&&!l&&w.some(function(ie){return su(V,ie,{stripQuotes:!0})})||b.length>0&&!l&&!b.some(function(ie){return su(V,ie,{stripQuotes:!0})}))return[2,null];_state.label=1;case 1:_state.trys.push([1,6,,7]);ie=t.fs.resolvePath(t.cwd,me),re=!1;if(!(K.isFile===void 0))return[3,3];return[4,t.fs.stat(ie)];case 2:_tmp=re=_state.sent().isDirectory;return[3,4];case 3:_tmp=re=!K.isFile;_state.label=4;case 4:if(_tmp,re)return[2,l?null:{error:"grep: ".concat(me,": Is a directory\n")}];return[4,t.fs.readFile(ie)];case 5:de=_state.sent();if(O&&!i){Y=O.ignoreCase?de.toLowerCase():de;if(!O.needles.some(function(oe){return Y.includes(oe)})){if(o){oe=L?"".concat(me,":0"):"0";return[2,{file:me,result:{output:"".concat(oe,"\n"),matched:!1,matchCount:0}}]}return[2,{file:me,result:{output:"",matched:!1,matchCount:0}}]}}xe=oW(de,T,{invertMatch:i,showLineNumbers:n,countOnly:o,filename:L?me:"",onlyMatching:h,beforeContext:y,afterContext:_,maxCount:v,kResetGroup:I,preFilter:O});return[2,{file:me,result:xe}];case 6:ie1=_state.sent();return[2,{error:"grep: ".concat(me,": No such file or directory\n")}];case 7:return[2]}})})()}))];case 23:G10=_state.sent();_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=G10[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){K11=_step3.value;if(K11===null)continue;if("error"in K11&&K11.error){R+=K11.error,K11.error.includes("Is a directory")||(z=!0);continue}if(!("file"in K11)||!K11.result)continue;me1=K11.file,V12=K11.result;if(V12.matched){if($=!0,x)return[2,{stdout:"",stderr:"",exitCode:0}];a?M+="".concat(me1,"\n"):s||(M+=V12.output)}else s?M+="".concat(me1,"\n"):o&&!a&&(M+=V12.output)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}_state.label=24;case 24:N13+=ee;return[3,22];case 25:return[2,(z?pe=2:s?pe=M.length>0?0:1:pe=$?0:1,x?{stdout:"",stderr:"",exitCode:pe}:{stdout:M,stderr:R,exitCode:pe})]}})})()}},iV=256,t4e={name:"fgrep",execute:function execute(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,l9.execute(["-F"].concat(_to_consumable_array(e)),t)]})})()}},r4e={name:"egrep",execute:function execute(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,l9.execute(["-E"].concat(_to_consumable_array(e)),t)]})})()}},n4e={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},i4e={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},o4e={name:"egrep",flags:[],stdinType:"text",needsArgs:!0}});function a4e(e,t){if(Array.isArray(e))throw new TypeError("".concat(t,": expected object, got array"));if(Object.getPrototypeOf(e)!==null)throw new TypeError("".concat(t,": expected null-prototype object, got prototypal object"))}function vi(e){return!aW.has(e)}function Zi(e,t,r){a4e(e,"safeSet"),vi(t)&&(e[t]=r)}function s_(e,t){return a4e(e,"safeHasOwn"),Object.hasOwn(e,t)}function u9(e){var t=new WeakMap,r=function(n){if(n===null||(typeof n==="undefined"?"undefined":_type_of(n))!="object"||_instanceof(n,Date))return n;var i=t.get(n);if(i!==void 0)return i;if(Array.isArray(n)){var a=[];t.set(n,a);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;a.push(r(s))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a}var o=Object.create(null);t.set(n,o);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.keys(n)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var a9=_step1.value;o[a9]=r(n[a9])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return o};return r(e)}function Gi(e){return e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)?e:null}function sft(e){return Object.assign(Object.create(null),e)}function ls(e){return Object.assign(Object.create(null),e)}function s4e(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var _Object;return(_Object=Object).assign.apply(_Object,[Object.create(null)].concat(_to_consumable_array(e)))}var aW,lft,vp=se(function(){"use strict";aW=new Set(["__proto__","constructor","prototype"]),lft=new Set(_to_consumable_array(aW).concat(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]))});function uft(){var e=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(sW).sort()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),t=_step_value[0],r=_step_value[1];var n=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r.extensions[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var i=_step1.value;n.push("*".concat(i))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=r.globs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var i10=_step2.value;n.push(i10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}e.push("".concat(t,": ").concat(n.join(", ")))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"".concat(e.join("\n"),"\n")}var sW,oV,l4e=se(function(){"use strict";Ei(),vp(),sW=sft({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),oV=/*#__PURE__*/function(){function oV1(){_class_call_check(this,oV1);A(this,"types");this.types=new Map(Object.entries(sW).map(function(param){var _param=_sliced_to_array(param,2),e=_param[0],t=_param[1];return[e,{extensions:_to_consumable_array(t.extensions),globs:_to_consumable_array(t.globs)}]}))}_create_class(oV1,[{key:"addType",value:function addType(e){var t=e.indexOf(":");if(t===-1)return;var r=e.slice(0,t),n=e.slice(t+1);if(n.startsWith("include:")){var i=n.slice(8),o=this.types.get(i);if(o){var _a_extensions,_a_globs;var a=this.types.get(r)||{extensions:[],globs:[]};(_a_extensions=a.extensions).push.apply(_a_extensions,_to_consumable_array(o.extensions)),(_a_globs=a.globs).push.apply(_a_globs,_to_consumable_array(o.globs)),this.types.set(r,a)}}else{var i10=this.types.get(r)||{extensions:[],globs:[]};if(n.startsWith("*.")&&!n.slice(2).includes("*")){var o10=n.slice(1);i10.extensions.includes(o10)||i10.extensions.push(o10)}else i10.globs.includes(n)||i10.globs.push(n);this.types.set(r,i10)}}},{key:"clearType",value:function clearType(e){var t=this.types.get(e);t&&(t.extensions=[],t.globs=[])}},{key:"getType",value:function getType(e){return this.types.get(e)}},{key:"getAllTypes",value:function getAllTypes(){return this.types}},{key:"matchesType",value:function matchesType(e,t){var r=e.toLowerCase();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(n==="all"){if(this.matchesAnyType(e))return!0;continue}var i=this.types.get(n);if(i){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=i.extensions[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o=_step1.value;if(r.endsWith(o))return!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=i.globs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var o10=_step2.value;if(o10.includes("*")){var a=o10.replace(/\./g,"\\.").replace(/\*/g,".*");if(ir("^".concat(a,"$"),"i").test(e))return!0}else if(r===o10.toLowerCase())return!0}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}},{key:"matchesAnyType",value:function matchesAnyType(e){var t=e.toLowerCase();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.types.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r.extensions[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var n=_step1.value;if(t.endsWith(n))return!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=r.globs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var n10=_step2.value;if(n10.includes("*")){var i=n10.replace(/\./g,"\\.").replace(/\*/g,".*");if(ir("^".concat(i,"$"),"i").test(e))return!0}else if(t===n10.toLowerCase())return!0}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}}]);return oV1}()});function cft(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}var dft=se(function(){"use strict"});function pft(e){var t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;var r=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return r*1024;case"M":return r*1024*1024;case"G":return r*1024*1024*1024;default:return r}}function fft(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:"rg: invalid --max-filesize value: ".concat(e,"\n"),exitCode:1}}function p2e(e){return null}function mft(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function hft(e,t,r){var n=e[t];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=aV[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(n.startsWith("--".concat(i.long,"="))){var o=n.slice("--".concat(i.long,"=").length),a=c9(r,i,o);return a?{newIndex:t,error:a}:{newIndex:t}}if(i.short&&n.startsWith("-".concat(i.short))&&n.length>2){var o10=n.slice(2),a9=c9(r,i,o10);return a9?{newIndex:t,error:a9}:{newIndex:t}}if(i.short&&n==="-".concat(i.short)||n==="--".concat(i.long)){if(t+1>=e.length)return null;var o11=e[t+1],a10=c9(r,i,o11);return a10?{newIndex:t+1,error:a10}:{newIndex:t+1}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return null}function gft(e){return aV.find(function(t){return t.short===e})}function c9(e,t,r){if(t.validate){var i=t.validate(r);if(i)return i}if(t.ignored||!t.target)return;var n=t.parse?t.parse(r):r;t.multi?e[t.target].push(n):e[t.target]=n}function xft(e,t){var r=e[t];if(r==="--sort"&&t+1<e.length){var n=e[t+1];if(n==="path"||n==="none")return{value:n,newIndex:t+1}}if(r.startsWith("--sort=")){var n10=r.slice(7);if(n10==="path"||n10==="none")return{value:n10,newIndex:t}}return null}function yft(e,t){var r=e[t],n=r.match(/^-([ABC])(\d+)$/);return n?{flag:n[1],value:parseInt(n[2],10),newIndex:t}:(r==="-A"||r==="-B"||r==="-C")&&t+1<e.length?{flag:r[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function vft(e){var t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function _ft(e){var t=cft(),r=null,n=[],i=-1,o=-1,a=-1,s=!1;for(var l=0;l<e.length;l++){var c=e[l];if(c.startsWith("-")&&c!=="-"){var d=yft(e,l);if(d){var x=d.flag,v=d.value,y=d.newIndex;x==="A"?i=Math.max(i,v):x==="B"?o=Math.max(o,v):a=v,l=y;continue}var u=vft(c);if(u!==null){t.maxCount=u;continue}var p=hft(e,l,t);if(p){if(p.error)return{success:!1,error:p.error};l=p.newIndex;continue}var m=xft(e,l);if(m){t.sort=m.value,l=m.newIndex;continue}var h=c.startsWith("--")?[c]:c.slice(1).split(""),g=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var x10=_step.value;if(c4e.has(x10)){t.lineNumber=!0,s=!0;continue}if(x10==="u"||x10==="--unrestricted"){mft(t);continue}if(x10==="P"||x10==="--pcre2")return{success:!1,error:{stdout:"",stderr:"rg: PCRE2 is not supported. Use standard regex syntax instead.\n",exitCode:1}};if(x10.length===1){var y10=gft(x10);if(y10){if(l+1>=e.length)return{success:!1,error:fr("rg","-".concat(x10))};var _=c9(t,y10,e[l+1]);if(_)return{success:!1,error:_};l++,g=!0;continue}}var v10=u4e.get(x10);if(v10){v10(t);continue}if(x10.startsWith("--"))return{success:!1,error:fr("rg",x10)};if(x10.length===1)return{success:!1,error:fr("rg","-".concat(x10))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else r===null&&t.patterns.length===0&&t.patternFiles.length===0?r=c:n.push(c)}return(i>=0||a>=0)&&(t.afterContext=Math.max(i>=0?i:0,a>=0?a:0)),(o>=0||a>=0)&&(t.beforeContext=Math.max(o>=0?o:0,a>=0?a:0)),r!==null&&t.patterns.push(r),(t.column||t.vimgrep)&&(s=!0),{success:!0,options:t,paths:n,explicitLineNumbers:s}}var aV,u4e,c4e,bft=se(function(){"use strict";jt(),dft(),aV=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:p2e},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:p2e},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:pft,validate:fft},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",ignored:!0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],u4e=new Map([["i",function(e){e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["--ignore-case",function(e){e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["s",function(e){e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["--case-sensitive",function(e){e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["S",function(e){e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["--smart-case",function(e){e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["F",function(e){e.fixedStrings=!0}],["--fixed-strings",function(e){e.fixedStrings=!0}],["w",function(e){e.wordRegexp=!0}],["--word-regexp",function(e){e.wordRegexp=!0}],["x",function(e){e.lineRegexp=!0}],["--line-regexp",function(e){e.lineRegexp=!0}],["v",function(e){e.invertMatch=!0}],["--invert-match",function(e){e.invertMatch=!0}],["U",function(e){e.multiline=!0}],["--multiline",function(e){e.multiline=!0}],["--multiline-dotall",function(e){e.multilineDotall=!0,e.multiline=!0}],["c",function(e){e.count=!0}],["--count",function(e){e.count=!0}],["--count-matches",function(e){e.countMatches=!0}],["l",function(e){e.filesWithMatches=!0}],["--files",function(e){e.files=!0}],["--files-with-matches",function(e){e.filesWithMatches=!0}],["--files-without-match",function(e){e.filesWithoutMatch=!0}],["--stats",function(e){e.stats=!0}],["o",function(e){e.onlyMatching=!0}],["--only-matching",function(e){e.onlyMatching=!0}],["q",function(e){e.quiet=!0}],["--quiet",function(e){e.quiet=!0}],["N",function(e){e.lineNumber=!1}],["--no-line-number",function(e){e.lineNumber=!1}],["H",function(e){e.withFilename=!0}],["--with-filename",function(e){e.withFilename=!0}],["I",function(e){e.noFilename=!0}],["--no-filename",function(e){e.noFilename=!0}],["0",function(e){e.nullSeparator=!0}],["--null",function(e){e.nullSeparator=!0}],["b",function(e){e.byteOffset=!0}],["--byte-offset",function(e){e.byteOffset=!0}],["--column",function(e){e.column=!0,e.lineNumber=!0}],["--no-column",function(e){e.column=!1}],["--vimgrep",function(e){e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],["--json",function(e){e.json=!0}],["--hidden",function(e){e.hidden=!0}],["--no-ignore",function(e){e.noIgnore=!0}],["--no-ignore-dot",function(e){e.noIgnoreDot=!0}],["--no-ignore-vcs",function(e){e.noIgnoreVcs=!0}],["L",function(e){e.followSymlinks=!0}],["--follow",function(e){e.followSymlinks=!0}],["z",function(e){e.searchZip=!0}],["--search-zip",function(e){e.searchZip=!0}],["a",function(e){e.searchBinary=!0}],["--text",function(e){e.searchBinary=!0}],["--heading",function(e){e.heading=!0}],["--passthru",function(e){e.passthru=!0}],["--include-zero",function(e){e.includeZero=!0}],["--glob-case-insensitive",function(e){e.globCaseInsensitive=!0}]]),c4e=new Set(["n","--line-number"])});function wft(e){return"'".concat(e.replace(/'/g,"'\\''"),"'")}function i1(e){return e.map(wft).join(" ")}var m_=se(function(){"use strict"});function d4e(_01,_11){return _async_to_generator(function(e,t){var r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,s,l,s10,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1,n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:!1,i=_arguments.length>4&&_arguments[4]!==void 0?_arguments[4]:[];o=new sV(e,t,r,n);return[4,o.load(t)];case 1:_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,9,10,11]);_iterator=i[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];a=_step.value;_state.label=4;case 4:_state.trys.push([4,6,,7]);s=e.resolvePath(t,a);return[4,e.readFile(s)];case 5:l=_state.sent();o.addPatternsFromContent(l,t);return[3,7];case 6:s10=_state.sent();return[3,7];case 7:_iteratorNormalCompletion=true;return[3,3];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,o]}})}).apply(this,arguments)}var KI,sV,Sft=se(function(){"use strict";Ei(),KI=/*#__PURE__*/function(){function KI1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"/";_class_call_check(this,KI1);A(this,"patterns",[]);A(this,"basePath");this.basePath=e}_create_class(KI1,[{key:"parse",value:function parse(e){var t=e.split("\n");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=r.replace(/\s+$/,"");if(!n||n.startsWith("#"))continue;var i=!1;n.startsWith("!")&&(i=!0,n=n.slice(1));var o=!1;n.endsWith("/")&&(o=!0,n=n.slice(0,-1));var a=!1;n.startsWith("/")?(a=!0,n=n.slice(1)):n.includes("/")&&!n.startsWith("**/")&&(a=!0);var s=this.patternToRegex(n,a);this.patterns.push({pattern:r,regex:s,negated:i,directoryOnly:o,rooted:a})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"patternToRegex",value:function patternToRegex(e,t){var r="";t?r="^":r="(?:^|/)";var n=0;for(;n<e.length;){var i=e[n];if(i==="*")e[n+1]==="*"?e[n+2]==="/"?(r+="(?:.*/)?",n+=3):(n+2>=e.length,r+=".*",n+=2):(r+="[^/]*",n++);else if(i==="?")r+="[^/]",n++;else if(i==="["){var o=n+1;for(o<e.length&&e[o]==="!"&&o++,o<e.length&&e[o]==="]"&&o++;o<e.length&&e[o]!=="]";)o++;if(o<e.length){var a=e.slice(n,o+1);a.startsWith("[!")&&(a="[^".concat(a.slice(2))),r+=a,n=o+1}else r+="\\[",n++}else i==="/"?(r+="/",n++):(r+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n++)}return r+="(?:/.*)?$",ir(r)}},{key:"matches",value:function matches(e,t){var r=e.replace(/^\.\//,"");r=r.replace(/^\//,"");var n=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.patterns[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i.directoryOnly&&!t||i.regex.test(r)&&(n=!i.negated)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}},{key:"isWhitelisted",value:function isWhitelisted(e,t){var r=e.replace(/^\.\//,"");r=r.replace(/^\//,"");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.patterns[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(!(n.directoryOnly&&!t)&&n.negated&&n.regex.test(r))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}},{key:"getBasePath",value:function getBasePath(){return this.basePath}}]);return KI1}(),sV=/*#__PURE__*/function(){function sV1(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;_class_call_check(this,sV1);A(this,"parsers",[]);A(this,"fs");A(this,"skipDotIgnore");A(this,"skipVcsIgnore");A(this,"loadedDirs",new Set);this.fs=e,this.skipDotIgnore=r,this.skipVcsIgnore=n}_create_class(sV1,[{key:"load",value:function load(e){return _async_to_generator(function(){var t,r,i,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,o,a,s,l,s10,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=[],r=e;for(;;){t.unshift(r);i=this.fs.resolvePath(r,"..");if(i===r)break;r=i}n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,14,15,16]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];i10=_step.value;this.loadedDirs.add(i10);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=3;case 3:_state.trys.push([3,10,11,12]);_iterator1=n[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,9];o=_step1.value;a=this.fs.resolvePath(i10,o);_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,this.fs.readFile(a)];case 6:s=_state.sent(),l=new KI(i10);l.parse(s),this.parsers.push(l);return[3,8];case 7:s10=_state.sent();return[3,8];case 8:_iteratorNormalCompletion1=true;return[3,4];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 12:_iteratorNormalCompletion=true;return[3,2];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:return[2]}})}).call(this)}},{key:"loadForDirectory",value:function loadForDirectory(e){return _async_to_generator(function(){var t,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,i,o,i10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.loadedDirs.has(e))return[2];this.loadedDirs.add(e);t=[];this.skipVcsIgnore||t.push(".gitignore"),this.skipDotIgnore||t.push(".rgignore",".ignore");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];r=_step.value;n=this.fs.resolvePath(e,r);_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,this.fs.readFile(n)];case 4:i=_state.sent(),o=new KI(e);o.parse(i),this.parsers.push(o);return[3,6];case 5:i10=_state.sent();return[3,6];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2]}})}).call(this)}},{key:"addPatternsFromContent",value:function addPatternsFromContent(e,t){var r=new KI(t);r.parse(e),this.parsers.push(r)}},{key:"matches",value:function matches(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.parsers[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=r.getBasePath();if(!e.startsWith(n))continue;var i=e.slice(n.length).replace(/^\//,"");if(r.matches(i,t))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}},{key:"isWhitelisted",value:function isWhitelisted(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.parsers[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=r.getBasePath();if(!e.startsWith(n))continue;var i=e.slice(n.length).replace(/^\//,"");if(r.isWhitelisted(i,t))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}}],[{key:"isCommonIgnored",value:function isCommonIgnored(e){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(e)}}]);return sV1}()});function kft(e){return e.length>=2&&e[0]===31&&e[1]===139}function Cft(e){var t=!1;for(var r=0;r<e.length;r++){var n=e[r];n==="["&&!t?t=!0:n==="]"&&t&&(t=!1)}return t?"rg: glob '".concat(e,"' has an unclosed character class"):null}function Eft(e){return _async_to_generator(function(){var t,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x,v,y,x10,o,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,x11,_o1,v10,_,y10,v11,err,a,s,l,c,x12,d,_tmp,u,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,x13,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,x14,_ref,p,m,h,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e.ctx,r=e.options,n=e.paths,i=e.explicitLineNumbers;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r.globs[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){x=_step.value;v=x.startsWith("!")?x.slice(1):x,y=Cft(v);if(y)return[2,{stdout:"",stderr:"".concat(y,"\n"),exitCode:1}]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(r.files){x10=_to_consumable_array(r.patterns).concat(_to_consumable_array(n));return[2,Ift(t,x10,r)]}o=_to_consumable_array(r.patterns);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator1=r.patternFiles[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,9];x11=_step1.value;_state.label=3;case 3:_state.trys.push([3,7,,8]);v10=void 0;if(!(x11==="-"))return[3,4];v10=Sn(t.stdin);return[3,6];case 4:_=t.fs.resolvePath(t.cwd,x11);return[4,t.fs.readFile(_)];case 5:v10=_state.sent();_state.label=6;case 6:y10=v10.split("\n").filter(function(_){return _.length>0});(_o1=o).push.apply(_o1,_to_consumable_array(y10));return[3,8];case 7:v11=_state.sent();return[2,{stdout:"",stderr:"rg: ".concat(x11,": No such file or directory\n"),exitCode:2}];case 8:_iteratorNormalCompletion1=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 12:if(o.length===0)return[2,r.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"rg: no pattern given\n",exitCode:2}];a=n.length===0?["."]:n,s=Tft(r,o);try{x12=Aft(o,r,s);l=x12.regex,c=x12.kResetGroup}catch(x){return[2,{stdout:"",stderr:"rg: invalid regex: ".concat(o.join(", "),"\n"),exitCode:2}]}d=null;_tmp=r.noIgnore;if(_tmp)return[3,14];return[4,d4e(t.fs,t.cwd,r.noIgnoreDot,r.noIgnoreVcs,r.ignoreFiles)];case 13:_tmp=d=_state.sent();_state.label=14;case 14:_tmp;u=new oV;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=r.typeClear[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){x13=_step2.value;u.clearType(x13)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=r.typeAdd[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){x14=_step3.value;u.addType(x14)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[4,p4e(t,a,r,d,u)];case 15:_ref=_state.sent(),p=_ref.files,m=_ref.singleExplicitFile;if(p.length===0)return[2,{stdout:"",stderr:"",exitCode:1}];h=!r.noFilename&&(r.withFilename||!m||p.length>1),g=r.lineNumber;return[2,(i||(m&&p.length===1&&(g=!1),r.onlyMatching&&(g=!1)),Mft(t,p,l,r,h,g,c))]}})})()}function Tft(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(function(r){return/[A-Z]/.test(r)}):!1}function Aft(e,t,r){var n;return e.length===1?n=e[0]:n=e.map(function(i){return t.fixedStrings?i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):"(?:".concat(i,")")}).join("|"),Jwe(n,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:r,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}function p4e(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,d,_tmp,d10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=[],a=0,s=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,12,13,14]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,11];l=_step.value;c=e.fs.resolvePath(e.cwd,l);_state.label=3;case 3:_state.trys.push([3,9,,10]);return[4,e.fs.stat(c)];case 4:d=_state.sent();if(!d.isFile)return[3,5];if(a++,r.maxFilesize>0&&d.size>r.maxFilesize)return[3,10];m4e(l,r,n,c,i)&&o.push(l);return[3,8];case 5:_tmp=d.isDirectory;if(!_tmp)return[3,7];s++;return[4,f4e(e,l,c,0,r,n,i,o)];case 6:_tmp=_state.sent();_state.label=7;case 7:_tmp;_state.label=8;case 8:return[3,10];case 9:d10=_state.sent();return[3,10];case 10:_iteratorNormalCompletion=true;return[3,2];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 14:return[2,{files:r.sort==="path"?o.sort():o,singleExplicitFile:a===1&&s===0}]}})})()}function f4e(e,t,r,n,i,o,a,s){return _async_to_generator(function(){var _tmp,l,_tmp1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,u,p,m,h,g,x,v,y,y10,v10,_tmp2,y11,_tmp3,v11,v12,err,l10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!!(n>=i.maxDepth))return[3,38];_tmp=o;if(!_tmp)return[3,2];return[4,o.loadForDirectory(r)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;_state.label=3;case 3:_state.trys.push([3,37,,38]);if(!e.fs.readdirWithFileTypes)return[3,5];return[4,e.fs.readdirWithFileTypes(r)];case 4:_tmp1=_state.sent();return[3,7];case 5:return[4,e.fs.readdir(r)];case 6:_tmp1=_state.sent().map(function(c){return{name:c,isFile:void 0}});_state.label=7;case 7:l=_tmp1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=8;case 8:_state.trys.push([8,34,35,36]);_iterator=l[Symbol.iterator]();_state.label=9;case 9:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,33];c=_step.value;d=c.name;if(!i.noIgnore&&sV.isCommonIgnored(d))return[3,32];u=d.startsWith("."),p=t==="."?d:t==="./"?"./".concat(d):t.endsWith("/")?"".concat(t).concat(d):"".concat(t,"/").concat(d),m=e.fs.resolvePath(r,d),h=void 0,g=void 0,x=!1;if(!(c.isFile!==void 0&&"isDirectory"in c))return[3,16];v=c;if(x=v.isSymbolicLink===!0,x&&!i.followSymlinks)return[3,32];if(!(x&&i.followSymlinks))return[3,14];_state.label=10;case 10:_state.trys.push([10,12,,13]);return[4,e.fs.stat(m)];case 11:y=_state.sent();h=y.isFile,g=y.isDirectory;return[3,13];case 12:y10=_state.sent();return[3,32];case 13:return[3,15];case 14:h=v.isFile,g=v.isDirectory;_state.label=15;case 15:return[3,25];case 16:_state.trys.push([16,24,,25]);if(!e.fs.lstat)return[3,18];return[4,e.fs.lstat(m)];case 17:_tmp2=_state.sent();return[3,20];case 18:return[4,e.fs.stat(m)];case 19:_tmp2=_state.sent();_state.label=20;case 20:v10=_tmp2;if(x=v10.isSymbolicLink===!0,x&&!i.followSymlinks)return[3,32];if(!(x&&i.followSymlinks))return[3,22];return[4,e.fs.stat(m)];case 21:_tmp3=_state.sent();return[3,23];case 22:_tmp3=v10;_state.label=23;case 23:y11=_tmp3;h=y11.isFile,g=y11.isDirectory;return[3,25];case 24:v11=_state.sent();return[3,32];case 25:if(!(!(o!=null&&o.matches(m,g))&&!(u&&!i.hidden&&!(o!=null&&o.isWhitelisted(m,g)))))return[3,32];if(!g)return[3,27];return[4,f4e(e,p,m,n+1,i,o,a,s)];case 26:_state.sent();return[3,32];case 27:if(!h)return[3,32];if(!(i.maxFilesize>0))return[3,31];_state.label=28;case 28:_state.trys.push([28,30,,31]);return[4,e.fs.stat(m)];case 29:if(_state.sent().size>i.maxFilesize)return[3,32];return[3,31];case 30:v12=_state.sent();return[3,32];case 31:m4e(p,i,o,m,a)&&s.push(p);_state.label=32;case 32:_iteratorNormalCompletion=true;return[3,9];case 33:return[3,36];case 34:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,36];case 35:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 36:return[3,38];case 37:l10=_state.sent();return[3,38];case 38:return[2]}})})()}function m4e(e,t,r,n,i){var o=e.split("/").pop()||e;if(r!=null&&r.matches(n,!1)||t.types.length>0&&!i.matchesType(o,t.types)||t.typesNot.length>0&&i.matchesType(o,t.typesNot))return!1;if(t.globs.length>0){var a=t.globCaseInsensitive,s=t.globs.filter(function(c){return!c.startsWith("!")}),l=t.globs.filter(function(c){return c.startsWith("!")}).map(function(c){return c.slice(1)});if(s.length>0){var c=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;if(Zc(o,d,a)||Zc(e,d,a)){c=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!c)return!1}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=l[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var c10=_step1.value;if(c10.startsWith("/")){var d10=c10.slice(1);if(Zc(e,d10,a))return!1}else if(Zc(o,c10,a)||Zc(e,c10,a))return!1}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}if(t.iglobs.length>0){var a9=t.iglobs.filter(function(l){return!l.startsWith("!")}),s10=t.iglobs.filter(function(l){return l.startsWith("!")}).map(function(l){return l.slice(1)});if(a9.length>0){var l10=!1;var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=a9[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c11=_step2.value;if(Zc(o,c11,!0)||Zc(e,c11,!0)){l10=!0;break}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}if(!l10)return!1}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=s10[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var l11=_step3.value;if(l11.startsWith("/")){var c12=l11.slice(1);if(Zc(e,c12,!0))return!1}else if(Zc(o,l11,!0)||Zc(e,l11,!0))return!1}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}return!0}function Zc(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var n="^";for(var i=0;i<t.length;i++){var o=t[i];if(o==="*")t[i+1]==="*"?(n+=".*",i++):n+="[^/]*";else if(o==="?")n+="[^/]";else if(o==="["){var a=i+1;for(a<t.length&&t[a]==="!"&&a++,a<t.length&&t[a]==="]"&&a++;a<t.length&&t[a]!=="]";)a++;if(a<t.length){var s=t.slice(i,a+1);s.startsWith("[!")&&(s="[^".concat(s.slice(2))),n+=s,i=a}else n+="\\["}else n+=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return n+="$",ir(n,r?"i":"").test(e)}function Ift(e,t,r){return _async_to_generator(function(){var n,_tmp,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l10,o,_ref,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=null;_tmp=r.noIgnore;if(_tmp)return[3,2];return[4,d4e(e.fs,e.cwd,r.noIgnoreDot,r.noIgnoreVcs,r.ignoreFiles)];case 1:_tmp=n=_state.sent();_state.label=2;case 2:_tmp;i=new oV;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r.typeClear[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l=_step.value;i.clearType(l)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=r.typeAdd[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){l10=_step1.value;i.addType(l10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}o=t.length===0?["."]:t;return[4,p4e(e,o,r,n,i)];case 3:_ref=_state.sent(),a=_ref.files;if(a.length===0)return[2,{stdout:"",stderr:"",exitCode:1}];if(r.quiet)return[2,{stdout:"",stderr:"",exitCode:0}];s=r.nullSeparator?"\0":"\n";return[2,{stdout:a.map(function(l){return l+s}).join(""),stderr:"",exitCode:0}]}})})()}function Pft(e,t){if(t.length===0)return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(Zc(e,r,!1))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function Rft(e,t,r,n){return _async_to_generator(function(){var a,s,l,c,a9,s10,l10,c10,i,o,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,6,,7]);if(!(n.preprocessor&&e.exec))return[3,2];a=r.split("/").pop()||r;if(!Pft(a,n.preprocessorGlobs))return[3,2];return[4,e.exec(i1([n.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]})];case 1:s=_state.sent();if(s.exitCode===0&&s.stdout){l=Sn(s.stdout),c=l.slice(0,8192);return[2,{content:l,isBinary:c.includes("\0")}]}_state.label=2;case 2:if(!(n.searchZip&&r.endsWith(".gz")))return[3,4];return[4,e.fs.readFileBuffer(t)];case 3:a9=_state.sent();if(kft(a9))try{s10=AS(a9),l10=new TextDecoder().decode(s10),c10=l10.slice(0,8192);return[2,{content:l10,isBinary:c10.includes("\0")}]}catch(s){return[2,null]}_state.label=4;case 4:return[4,e.fs.readFile(t)];case 5:i=_state.sent(),o=i.slice(0,8192);return[2,{content:i,isBinary:o.includes("\0")}];case 6:i10=_state.sent();return[2,null];case 7:return[2]}})})()}function Mft(e,t,r,n,i,o,a){return _async_to_generator(function(){var s,l,c,d,u,p,m,x,v,y,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_,b,w,S,k,E,C,T,I,O,M,O1,S10,S11,h,x10,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:s="",l=!1,c=[],d=0,u=0,p=0,m=50;x=0;_state.label=1;case 1:if(!(x<t.length))return[3,4];v=t.slice(x,x+m);return[4,Promise.all(v.map(function(_){return _async_to_generator(function(){var b,w,S,k,E,C;return _ts_generator(this,function(_state){switch(_state.label){case 0:b=e.fs.resolvePath(e.cwd,_);return[4,Rft(e,b,_,n)];case 1:w=_state.sent();if(!w)return[2,null];S=w.content,k=w.isBinary;if(p+=S.length,k&&!n.searchBinary)return[2,null];E=i&&!n.heading?_:"",C=oW(S,r,{invertMatch:n.invertMatch,showLineNumbers:o,countOnly:n.count,countMatches:n.countMatches,filename:E,onlyMatching:n.onlyMatching,beforeContext:n.beforeContext,afterContext:n.afterContext,maxCount:n.maxCount,contextSeparator:n.contextSeparator,showColumn:n.column,vimgrep:n.vimgrep,showByteOffset:n.byteOffset,replace:n.replace!==null?nft(n.replace):null,passthru:n.passthru,multiline:n.multiline,kResetGroup:a});return[2,n.json&&C.matched?{file:_,result:C,content:S,isBinary:!1}:{file:_,result:C}]}})})()}))];case 2:y=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=y[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_=_step.value;if(!_)continue;b=_.file,w=_.result;if(w.matched){if(l=!0,u++,d+=w.matchCount,n.quiet&&!n.json)return[3,4];if(n.json&&!n.quiet){S=_.content||"";c.push(JSON.stringify({type:"begin",data:{path:{text:b}}}));k=S.split("\n");r.lastIndex=0;E=0;for(C=0;C<k.length;C++){T=k[C];r.lastIndex=0;I=[];for(O=r.exec(T);O!==null;O=r.exec(T)){M={match:{text:O[0]},start:O.index,end:O.index+O[0].length};n.replace!==null&&(M.replacement={text:n.replace}),I.push(M),O[0].length===0&&r.lastIndex++}if(I.length>0){O1={type:"match",data:{path:{text:b},lines:{text:"".concat(T,"\n")},line_number:C+1,absolute_offset:E,submatches:I}};c.push(JSON.stringify(O1))}E+=T.length+1}c.push(JSON.stringify({type:"end",data:{path:{text:b},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:S.length,bytes_printed:0,matched_lines:w.matchCount,matches:w.matchCount}}}))}else if(n.filesWithMatches){S10=n.nullSeparator?"\0":"\n";s+="".concat(b).concat(S10)}else n.filesWithoutMatch||(n.heading&&!n.noFilename&&(s+="".concat(b,"\n")),s+=w.output)}else if(n.filesWithoutMatch){S11=n.nullSeparator?"\0":"\n";s+="".concat(b).concat(S11)}else n.includeZero&&(n.count||n.countMatches)&&(s+=w.output)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=3;case 3:x+=m;return[3,1];case 4:n.json&&(c.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:u,bytes_searched:p,bytes_printed:0,matched_lines:d,matches:d}}})),s="".concat(c.join("\n"),"\n"));h=n.quiet&&!n.json?"":s;if(n.stats&&!n.json){x10=["","".concat(d," matches"),"".concat(d," matched lines"),"".concat(u," files contained matches"),"".concat(t.length," files searched"),"".concat(p," bytes searched")].join("\n");h+="".concat(x10,"\n")}return[2,(n.filesWithoutMatch?g=s.length>0?0:1:g=l?0:1,{stdout:h,stderr:"",exitCode:g})]}})})()}var Oft=se(function(){"use strict";kr(),m_(),Ei(),Xwe(),l4e(),Sft()}),h4e={};St(h4e,{flagsForFuzzing:function(){return x4e},rgCommand:function(){return g4e}});var f2e,g4e,x4e,$ft=se(function(){"use strict";jt(),l4e(),bft(),Oft(),f2e={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:"rg (ripgrep) recursively searches directories for a regex pattern.\nUnlike grep, rg is recursive by default and respects .gitignore files.\n\nEXAMPLES:\n rg foo Search for 'foo' in current directory\n rg foo src/ Search in src/ directory\n rg -i foo Case-insensitive search\n rg -w foo Match whole words only\n rg -t js foo Search only JavaScript files\n rg -g '*.ts' foo Search files matching glob\n rg --hidden foo Include hidden files\n rg -l foo List files with matches only",options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},g4e={name:"rg",execute:function execute(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(f2e)];if(e.includes("--type-list"))return[2,{stdout:uft(),stderr:"",exitCode:0}];r=_ft(e);return[2,r.success?Eft({ctx:t,options:r.options,paths:r.paths,explicitLineNumbers:r.explicitLineNumbers}):r.error]})})()}},x4e={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0}});function yl(e,t,r){if(!e||hp.isInSandboxedContext())return;var n="".concat(t," ").concat(r," attempted outside defense context");throw new nn(n,{timestamp:Date.now(),type:"missing_defense_context",message:n,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:hp.getCurrentExecutionId()})}function Wh(e,t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:yl(e,t,"".concat(r," (pre-await)"));return[4,n()];case 1:i=_state.sent();return[2,(yl(e,t,"".concat(r," (post-await)")),i)]}})})()}var Ff=se(function(){"use strict";td()});function y4e(e){var t="",r=0,n=!1;for(;r<e.length;){if(e[r]==="["&&!n){if(e[r+1]==="["&&e[r+2]===":"){var i=e.indexOf(":]]",r+3);if(i!==-1){var o=e.slice(r+3,i),a=d9.get(o);if(a){t+="[".concat(a,"]"),r=i+3;continue}}}if(e[r+1]==="^"&&e[r+2]==="["&&e[r+3]===":"){var i10=e.indexOf(":]]",r+4);if(i10!==-1){var o10=e.slice(r+4,i10),a9=d9.get(o10);if(a9){t+="[^".concat(a9,"]"),r=i10+3;continue}}}t+="[",r++,n=!0,r<e.length&&e[r]==="^"&&(t+="^",r++),r<e.length&&e[r]==="]"&&(t+="\\]",r++);continue}if(n){if(e[r]==="]"){t+="]",r++,n=!1;continue}if(e[r]==="["&&e[r+1]===":"){var i11=e.indexOf(":]",r+2);if(i11!==-1){var o11=e.slice(r+2,i11),a10=d9.get(o11);if(a10){t+=a10,r=i11+2;continue}}}if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++;continue}if(e[r]==="\\"&&r+1<e.length){var i12=e[r+1];if(i12==="+"||i12==="?"||i12==="|"){t+=i12,r+=2;continue}if(i12==="("||i12===")"){t+=i12,r+=2;continue}if(i12==="{"||i12==="}"){t+=i12,r+=2;continue}if(i12==="t"){t+=" ",r+=2;continue}if(i12==="n"){t+="\n",r+=2;continue}if(i12==="r"){t+="\r",r+=2;continue}t+=e[r]+i12,r+=2;continue}if(e[r]==="+"||e[r]==="?"||e[r]==="|"||e[r]==="("||e[r]===")"){t+="\\".concat(e[r]),r++;continue}if(e[r]==="^"&&!(t===""||t.endsWith("("))){t+="\\^",r++;continue}if(e[r]==="$"){var i13=r===e.length-1,o12=r+2<e.length&&e[r+1]==="\\"&&e[r+2]===")";if(!i13&&!o12){t+="\\$",r++;continue}}t+=e[r],r++}return t}function v4e(e){var t="",r=!1;for(var n=0;n<e.length;n++)e[n]==="["&&!r?(r=!0,t+="[",n++,n<e.length&&e[n]==="^"&&(t+="^",n++),n<e.length&&e[n]==="]"&&(t+="]",n++),n--):e[n]==="]"&&r?(r=!1,t+="]"):!r&&e[n]==="{"&&e[n+1]===","?(t+="{0,",n++):t+=e[n];return t}function Nft(e){var t="";for(var r=0;r<e.length;r++){var n=e[r],i=n.charCodeAt(0);n==="\\"?t+="\\\\":n===" "?t+="\\t":n==="\n"?t+="$\n":n==="\r"?t+="\\r":n==="\x07"?t+="\\a":n==="\b"?t+="\\b":n==="\f"?t+="\\f":n==="\v"?t+="\\v":i<32||i>=127?t+="\\".concat(i.toString(8).padStart(3,"0")):t+=n}return"".concat(t,"$")}var d9,Dft=se(function(){"use strict";d9=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function Lft(e,t,r){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:e,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:t,pendingFileReads:[],pendingFileWrites:[],rangeStates:r||new Map,linesConsumedInCycle:0}}function Fft(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"first"in e&&"step"in e}function zft(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"offset"in e}function Wv(e,t,r,n,i){if(e==="$")return t===r;if(typeof e=="number")return t===e;if(Fft(e)){var o=e.first,a=e.step;return a===0?t===o:(t-o)%a===0&&t>=o}if((typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"pattern"in e)try{var o10=e.pattern;o10===""&&i!=null&&i.lastPattern?o10=i.lastPattern:o10!==""&&i&&(i.lastPattern=o10);var a9=v4e(y4e(o10));return ir(a9).test(n)}catch(o){return!1}return!1}function mq(e){var t=function(r){return r===void 0?"undefined":r==="$"?"$":typeof r=="number"?String(r):"pattern"in r?"/".concat(r.pattern,"/"):"first"in r?"".concat(r.first,"~").concat(r.step):"unknown"};return"".concat(t(e.start),",").concat(t(e.end))}function jft(e,t,r,n,i,o){if(!e||!e.start&&!e.end)return!0;var a=e.start,s=e.end;if(a!==void 0&&s===void 0)return Wv(a,t,r,n,o);if(a!==void 0&&s!==void 0){var l=(typeof a==="undefined"?"undefined":_type_of(a))=="object"&&"pattern"in a,c=(typeof s==="undefined"?"undefined":_type_of(s))=="object"&&"pattern"in s,d=zft(s);if(d&&i){var u=mq(e),p=i.get(u);if(p||(p={active:!1},i.set(u,p)),p.active){var m=p.startLine||t;return t>=m+s.offset&&(p.active=!1,i.set(u,p)),!0}else return Wv(a,t,r,n,o)?(p.active=!0,p.startLine=t,i.set(u,p),s.offset===0&&(p.active=!1,i.set(u,p)),!0):!1}if(!l&&!c&&!d){var u10=typeof a=="number"?a:a==="$"?r:1,p10=typeof s=="number"?s:r;if(u10<=p10)return t>=u10&&t<=p10;if(i){var m10=mq(e),h=i.get(m10);return h||(h={active:!1},i.set(m10,h)),!h.completed&&t>=u10?(h.completed=!0,i.set(m10,h),!0):!1}return!1}if(i){var u11=mq(e),p11=i.get(u11);if(p11||(p11={active:!1},i.set(u11,p11)),p11.active)return Wv(s,t,r,n,o)&&(p11.active=!1,typeof a=="number"&&(p11.completed=!0),i.set(u11,p11)),!0;{if(p11.completed)return!1;var m11=!1;return typeof a=="number"?m11=t>=a:m11=Wv(a,t,r,n,o),m11?(p11.active=!0,p11.startLine=t,i.set(u11,p11),Wv(s,t,r,n,o)&&(p11.active=!1,typeof a=="number"&&(p11.completed=!0),i.set(u11,p11)),!0):!1}}return Wv(a,t,r,n,o)}return!0}function V0(e,t,r,n,i,o){var a=jft(e,t,r,n,i,o);return e!=null&&e.negated?!a:a}function Uft(e,t,r,n){var i="",o=0,a=!1;for(;o<=e.length;){t.lastIndex=o;var s=t.exec(e);if(!s){i+=e.slice(o);break}if(s.index!==o){i+=e.slice(o,s.index),o=s.index,a=!1;continue}var l=s[0],c=s.slice(1);if(a&&l.length===0){if(o<e.length)i+=e[o],o++;else break;a=!1;continue}if(i+=n(l,c),a=!1,l.length===0)if(o<e.length)i+=e[o],o++;else break;else o+=l.length,a=!0}return i}function hq(e,t,r){var n="",i=0;for(;i<e.length;){if(e[i]==="\\"&&i+1<e.length){var o=e[i+1];if(o==="&"){n+="&",i+=2;continue}if(o==="n"){n+="\n",i+=2;continue}if(o==="t"){n+=" ",i+=2;continue}if(o==="r"){n+="\r",i+=2;continue}var a=parseInt(o,10);if(a===0){n+=t,i+=2;continue}if(a>=1&&a<=9){n+=r[a-1]||"",i+=2;continue}n+=o,i+=2;continue}if(e[i]==="&"){n+=t,i++;continue}n+=e[i],i++}return n}function m2e(e,t,r){if(t>0&&e.length>t)throw new Qt("sed: ".concat(r," size limit exceeded (").concat(t," bytes)"),"string_length")}function Bft(e,t,r){var a,s,l,c;var n=t.lineNumber,i=t.totalLines,o=t.patternSpace;if(e.type==="label"){(a=t.coverage)==null||a.hit("sed:cmd:".concat(e.type));return}if(V0(e.address,n,i,o,t.rangeStates,t))switch((s=t.coverage)==null||s.hit("sed:cmd:".concat(e.type)),e.type){case"substitute":{var d=e,u="";d.global&&(u+="g"),d.ignoreCase&&(u+="i");var p=d.pattern;p===""&&t.lastPattern?p=t.lastPattern:p!==""&&(t.lastPattern=p);var m=v4e(d.extendedRegex?p:y4e(p));try{var h=ir(m,u),g=h.test(t.patternSpace);if(h.lastIndex=0,g){if(t.substitutionMade=!0,d.nthOccurrence&&d.nthOccurrence>0&&!d.global){var x=0,v=d.nthOccurrence,y=ir(m,"g".concat(d.ignoreCase?"i":""));t.patternSpace=y.replace(t.patternSpace,function(_){for(var _len=arguments.length,b=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){b[_key-1]=arguments[_key]}if(x++,x===v){var w=b.slice(0,-2);return hq(d.replacement,_,w)}return _})}else if(d.global){var x10=ir(m,"g".concat(d.ignoreCase?"i":""));t.patternSpace=Uft(t.patternSpace,x10,d.replacement,function(v,y){return hq(d.replacement,v,y)})}else t.patternSpace=h.replace(t.patternSpace,function(x){for(var _len=arguments.length,v=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){v[_key-1]=arguments[_key]}var y=v.slice(0,-2);return hq(d.replacement,x,y)});d.printOnMatch&&t.lineNumberOutput.push(t.patternSpace)}}catch(h){}break}case"print":t.lineNumberOutput.push(t.patternSpace);break;case"printFirstLine":{var d10=t.patternSpace.indexOf("\n");d10!==-1?t.lineNumberOutput.push(t.patternSpace.slice(0,d10)):t.lineNumberOutput.push(t.patternSpace);break}case"delete":t.deleted=!0;break;case"deleteFirstLine":{var d11=t.patternSpace.indexOf("\n");d11!==-1?(t.patternSpace=t.patternSpace.slice(d11+1),t.restartCycle=!0,t.inDRestartedCycle=!0):t.deleted=!0;break}case"zap":t.patternSpace="";break;case"append":t.appendBuffer.push(e.text);break;case"insert":t.appendBuffer.unshift("__INSERT__".concat(e.text));break;case"change":t.deleted=!0,t.changedText=e.text;break;case"hold":t.holdSpace=t.patternSpace;break;case"holdAppend":t.holdSpace?t.holdSpace+="\n".concat(t.patternSpace):t.holdSpace=t.patternSpace,m2e(t.holdSpace,(l=r==null?void 0:r.maxStringLength)!=null?l:0,"hold space");break;case"get":t.patternSpace=t.holdSpace;break;case"getAppend":t.patternSpace+="\n".concat(t.holdSpace),m2e(t.patternSpace,(c=r==null?void 0:r.maxStringLength)!=null?c:0,"pattern space");break;case"exchange":{var d12=t.patternSpace;t.patternSpace=t.holdSpace,t.holdSpace=d12;break}case"next":t.printed=!0;break;case"quit":t.quit=!0,e.exitCode!==void 0&&(t.exitCode=e.exitCode);break;case"quitSilent":t.quit=!0,t.quitSilent=!0,e.exitCode!==void 0&&(t.exitCode=e.exitCode);break;case"list":{var d13=Nft(t.patternSpace);t.lineNumberOutput.push(d13);break}case"printFilename":t.currentFilename&&t.lineNumberOutput.push(t.currentFilename);break;case"version":{var d14=[4,8,0];if(e.minVersion){var u10=e.minVersion.split("."),p10=[],m10=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=u10[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h10=_step.value;var g10=parseInt(h10,10);if(Number.isNaN(g10)||g10<0){t.quit=!0,t.exitCode=1,t.errorMessage="sed: invalid version string: ".concat(e.minVersion),m10=!0;break}p10.push(g10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!m10){for(;p10.length<3;)p10.push(0);for(var h11=0;h11<3;h11++){if(p10[h11]>d14[h11]){t.quit=!0,t.exitCode=1,t.errorMessage="sed: this is not GNU sed version ".concat(e.minVersion);break}if(p10[h11]<d14[h11])break}}}break}case"readFile":t.pendingFileReads.push({filename:e.filename,wholeFile:!0});break;case"readFileLine":t.pendingFileReads.push({filename:e.filename,wholeFile:!1});break;case"writeFile":t.pendingFileWrites.push({filename:e.filename,content:"".concat(t.patternSpace,"\n")});break;case"writeFirstLine":{var d15=t.patternSpace.indexOf("\n"),u11=d15!==-1?t.patternSpace.slice(0,d15):t.patternSpace;t.pendingFileWrites.push({filename:e.filename,content:"".concat(u11,"\n")});break}case"execute":t.errorMessage="sed: e command (shell execution) is not supported in sandboxed environment",t.quit=!0;break;case"transliterate":t.patternSpace=qft(t.patternSpace,e);break;case"lineNumber":t.lineNumberOutput.push(String(t.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function qft(e,t){var r="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=t.source.indexOf(n);i!==-1?r+=t.dest[i]:r+=n}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function _4e(e,t,r,n){var l,c,d,u,p,m,h;var i=new Map;for(var g=0;g<e.length;g++){var x=e[g];x.type==="label"&&i.set(x.name,g)}var o=(l=n==null?void 0:n.maxIterations)!=null?l:b4e,a=0,s=0;for(;s<e.length;){if(a++,a>o)throw new Qt("sed: command execution exceeded maximum iterations (".concat(o,")"),"iterations");if(t.deleted||t.quit||t.quitSilent||t.restartCycle)break;var g10=e[s];if(g10.type==="next"){if(V0(g10.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if((c=t.coverage)==null||c.hit("sed:cmd:next"),t.nCommandOutput.push(t.patternSpace),r&&r.currentLineIndex+t.linesConsumedInCycle+1<r.lines.length){t.linesConsumedInCycle++;var x10=r.lines[r.currentLineIndex+t.linesConsumedInCycle];t.patternSpace=x10,t.lineNumber=r.currentLineIndex+t.linesConsumedInCycle+1,t.substitutionMade=!1}else{t.quit=!0,t.deleted=!0;break}s++;continue}if(g10.type==="nextAppend"){if(V0(g10.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t))if((d=t.coverage)==null||d.hit("sed:cmd:nextAppend"),r&&r.currentLineIndex+t.linesConsumedInCycle+1<r.lines.length){t.linesConsumedInCycle++;var x11=r.lines[r.currentLineIndex+t.linesConsumedInCycle];t.patternSpace+="\n".concat(x11),t.lineNumber=r.currentLineIndex+t.linesConsumedInCycle+1}else{t.quit=!0;break}s++;continue}if(g10.type==="branch"){var x12=g10;if(V0(x12.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)){if((u=t.coverage)==null||u.hit("sed:cmd:branch"),x12.label){var v=i.get(x12.label);if(v!==void 0){s=v;continue}t.branchRequest=x12.label;break}break}s++;continue}if(g10.type==="branchOnSubst"){var x13=g10;if(V0(x13.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&((p=t.coverage)==null||p.hit("sed:cmd:branchOnSubst"),t.substitutionMade)){if(t.substitutionMade=!1,x13.label){var v10=i.get(x13.label);if(v10!==void 0){s=v10;continue}t.branchRequest=x13.label;break}break}s++;continue}if(g10.type==="branchOnNoSubst"){var x14=g10;if(V0(x14.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&((m=t.coverage)==null||m.hit("sed:cmd:branchOnNoSubst"),!t.substitutionMade)){if(x14.label){var v11=i.get(x14.label);if(v11!==void 0){s=v11;continue}t.branchRequest=x14.label;break}break}s++;continue}if(g10.type==="group"){var x15=g10;if(V0(x15.address,t.lineNumber,t.totalLines,t.patternSpace,t.rangeStates,t)&&((h=t.coverage)==null||h.hit("sed:cmd:group"),_4e(x15.commands,t,r,n),t.branchRequest)){var v12=i.get(t.branchRequest);if(v12!==void 0){t.branchRequest=void 0,s=v12;continue}break}s++;continue}Bft(g10,t,n),s++}return t.linesConsumedInCycle}var b4e,Wft=se(function(){"use strict";jr(),Ei(),Dft(),b4e=1e4}),Et,w4e,Vft=se(function(){"use strict";(function(e){e.NUMBER="NUMBER",e.DOLLAR="DOLLAR",e.PATTERN="PATTERN",e.STEP="STEP",e.RELATIVE_OFFSET="RELATIVE_OFFSET",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.COMMA="COMMA",e.NEGATION="NEGATION",e.COMMAND="COMMAND",e.SUBSTITUTE="SUBSTITUTE",e.TRANSLITERATE="TRANSLITERATE",e.LABEL_DEF="LABEL_DEF",e.BRANCH="BRANCH",e.BRANCH_ON_SUBST="BRANCH_ON_SUBST",e.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",e.TEXT_CMD="TEXT_CMD",e.FILE_READ="FILE_READ",e.FILE_READ_LINE="FILE_READ_LINE",e.FILE_WRITE="FILE_WRITE",e.FILE_WRITE_LINE="FILE_WRITE_LINE",e.EXECUTE="EXECUTE",e.VERSION="VERSION",e.EOF="EOF",e.ERROR="ERROR"})(Et||(Et={})),w4e=/*#__PURE__*/function(){function w4e1(e){_class_call_check(this,w4e1);A(this,"input");A(this,"pos",0);A(this,"line",1);A(this,"column",1);this.input=e}_create_class(w4e1,[{key:"tokenize",value:function tokenize(){var e=[];for(;this.pos<this.input.length;){var t=this.nextToken();t&&e.push(t)}return e.push(this.makeToken(Et.EOF,"")),e}},{key:"makeToken",value:function makeToken(e,t,r){return _object_spread({type:e,value:t,line:this.line,column:this.column},r)}},{key:"peek",value:function peek(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.input[this.pos+e]||""}},{key:"advance",value:function advance(){var e=this.input[this.pos++]||"";return e==="\n"?(this.line++,this.column=1):this.column++,e}},{key:"readEscapedString",value:function readEscapedString(e){var t="";for(;this.pos<this.input.length&&this.peek()!==e;)if(this.peek()==="\\"){this.advance();var r=this.advance();r==="n"?t+="\n":r==="t"?t+=" ":t+=r}else{if(this.peek()==="\n")return null;t+=this.advance()}return t}},{key:"skipWhitespace",value:function skipWhitespace(){for(;this.pos<this.input.length;){var e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="#")for(;this.pos<this.input.length&&this.peek()!=="\n";)this.advance();else break}}},{key:"nextToken",value:function nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;var e=this.line,t=this.column,r=this.peek();return r==="\n"?(this.advance(),{type:Et.NEWLINE,value:"\n",line:e,column:t}):r===";"?(this.advance(),{type:Et.SEMICOLON,value:";",line:e,column:t}):r==="{"?(this.advance(),{type:Et.LBRACE,value:"{",line:e,column:t}):r==="}"?(this.advance(),{type:Et.RBRACE,value:"}",line:e,column:t}):r===","?(this.advance(),{type:Et.COMMA,value:",",line:e,column:t}):r==="!"?(this.advance(),{type:Et.NEGATION,value:"!",line:e,column:t}):r==="$"?(this.advance(),{type:Et.DOLLAR,value:"$",line:e,column:t}):this.isDigit(r)?this.readNumber():r==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():r==="/"?this.readPattern():r===":"?this.readLabelDef():this.readCommand()}},{key:"readNumber",value:function readNumber(){var e=this.line,t=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="~"){this.advance();var n="";for(;this.isDigit(this.peek());)n+=this.advance();var i=parseInt(r,10),o=parseInt(n,10)||0;return{type:Et.STEP,value:"".concat(i,"~").concat(o),first:i,step:o,line:e,column:t}}return{type:Et.NUMBER,value:parseInt(r,10),line:e,column:t}}},{key:"readRelativeOffset",value:function readRelativeOffset(){var e=this.line,t=this.column;this.advance();var r="";for(;this.isDigit(this.peek());)r+=this.advance();var n=parseInt(r,10)||0;return{type:Et.RELATIVE_OFFSET,value:"+".concat(n),offset:n,line:e,column:t}}},{key:"readPattern",value:function readPattern(){var e=this.line,t=this.column;this.advance();var r="",n=!1;for(;this.pos<this.input.length;){var i=this.peek();if(i==="/"&&!n)break;if(i==="\\")r+=this.advance(),this.pos<this.input.length&&this.peek()!=="\n"&&(r+=this.advance());else{if(i==="\n")break;i==="["&&!n?(n=!0,r+=this.advance(),this.peek()==="^"&&(r+=this.advance()),this.peek()==="]"&&(r+=this.advance())):i==="]"&&n?(n=!1,r+=this.advance()):r+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:Et.PATTERN,value:r,pattern:r,line:e,column:t}}},{key:"readLabelDef",value:function readLabelDef(){var e=this.line,t=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();var r="";for(;this.pos<this.input.length;){var n=this.peek();if(n===" "||n===" "||n==="\n"||n===";"||n==="}"||n==="{")break;r+=this.advance()}return{type:Et.LABEL_DEF,value:r,label:r,line:e,column:t}}},{key:"readCommand",value:function readCommand(){var e=this.line,t=this.column,r=this.advance();switch(r){case"s":return this.readSubstitute(e,t);case"y":return this.readTransliterate(e,t);case"a":case"i":case"c":return this.readTextCommand(r,e,t);case"b":return this.readBranch(Et.BRANCH,"b",e,t);case"t":return this.readBranch(Et.BRANCH_ON_SUBST,"t",e,t);case"T":return this.readBranch(Et.BRANCH_ON_NO_SUBST,"T",e,t);case"r":return this.readFileCommand(Et.FILE_READ,"r",e,t);case"R":return this.readFileCommand(Et.FILE_READ_LINE,"R",e,t);case"w":return this.readFileCommand(Et.FILE_WRITE,"w",e,t);case"W":return this.readFileCommand(Et.FILE_WRITE_LINE,"W",e,t);case"e":return this.readExecute(e,t);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:Et.COMMAND,value:r,line:e,column:t};case"v":return this.readVersion(e,t);default:return{type:Et.ERROR,value:r,line:e,column:t}}}},{key:"readSubstitute",value:function readSubstitute(e,t){var r=this.advance();if(!r||r==="\n")return{type:Et.ERROR,value:"s",line:e,column:t};var n="",i=!1;for(;this.pos<this.input.length;){var s=this.peek();if(s===r&&!i)break;if(s==="\\")this.advance(),this.pos<this.input.length&&this.peek()!=="\n"?this.peek()===r&&!i?n+=this.advance():(n+="\\",n+=this.advance()):n+="\\";else{if(s==="\n")break;s==="["&&!i?(i=!0,n+=this.advance(),this.peek()==="^"&&(n+=this.advance()),this.peek()==="]"&&(n+=this.advance())):s==="]"&&i?(i=!1,n+=this.advance()):n+=this.advance()}}if(this.peek()!==r)return{type:Et.ERROR,value:"unterminated substitution pattern",line:e,column:t};this.advance();var o="";for(;this.pos<this.input.length&&this.peek()!==r;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){var s10=this.peek();s10==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()==="\n"?(o+="\n",this.advance()):o+="\\"):s10==="\n"?(o+="\n",this.advance()):o+="\\".concat(this.advance())}else o+="\\";else{if(this.peek()==="\n")break;o+=this.advance()}this.peek()===r&&this.advance();var a="";for(;this.pos<this.input.length;){var s11=this.peek();if(s11==="g"||s11==="i"||s11==="p"||s11==="I"||this.isDigit(s11))a+=this.advance();else break}return{type:Et.SUBSTITUTE,value:"s".concat(r).concat(n).concat(r).concat(o).concat(r).concat(a),pattern:n,replacement:o,flags:a,line:e,column:t}}},{key:"readTransliterate",value:function readTransliterate(e,t){var r=this.advance();if(!r||r==="\n")return{type:Et.ERROR,value:"y",line:e,column:t};var n=this.readEscapedString(r);if(n===null||this.peek()!==r)return{type:Et.ERROR,value:"unterminated transliteration source",line:e,column:t};this.advance();var i=this.readEscapedString(r);if(i===null||this.peek()!==r)return{type:Et.ERROR,value:"unterminated transliteration dest",line:e,column:t};this.advance();var o=this.peek();for(;o===" "||o===" ";)this.advance(),o=this.peek();return o!==""&&o!==";"&&o!=="\n"&&o!=="}"?{type:Et.ERROR,value:"extra text at the end of a transform command",line:e,column:t}:{type:Et.TRANSLITERATE,value:"y".concat(r).concat(n).concat(r).concat(i).concat(r),source:n,dest:i,line:e,column:t}}},{key:"readTextCommand",value:function readTextCommand(e,t,r){var n=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]==="\n"||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(n=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),n&&this.peek()==="\n"&&this.advance();var i="";for(;this.pos<this.input.length;){var o=this.peek();if(o==="\n"){if(i.endsWith("\\")){i="".concat(i.slice(0,-1),"\n"),this.advance();continue}break}if(o==="\\"&&this.pos+1<this.input.length){var a=this.input[this.pos+1];if(a==="n"){i+="\n",this.advance(),this.advance();continue}if(a==="t"){i+=" ",this.advance(),this.advance();continue}if(a==="r"){i+="\r",this.advance(),this.advance();continue}}i+=this.advance()}return{type:Et.TEXT_CMD,value:e,text:i,line:t,column:r}}},{key:"readBranch",value:function readBranch(e,t,r,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();var i="";for(;this.pos<this.input.length;){var o=this.peek();if(o===" "||o===" "||o==="\n"||o===";"||o==="}"||o==="{")break;i+=this.advance()}return{type:e,value:t,label:i||void 0,line:r,column:n}}},{key:"readVersion",value:function readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();var r="";for(;this.pos<this.input.length;){var n=this.peek();if(n===" "||n===" "||n==="\n"||n===";"||n==="}"||n==="{")break;r+=this.advance()}return{type:Et.VERSION,value:"v",label:r||void 0,line:e,column:t}}},{key:"readFileCommand",value:function readFileCommand(e,t,r,n){for(;this.peek()===" "||this.peek()===" ";)this.advance();var i="";for(;this.pos<this.input.length;){var o=this.peek();if(o==="\n"||o===";")break;i+=this.advance()}return{type:e,value:t,filename:i.trim(),line:r,column:n}}},{key:"readExecute",value:function readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();var r="";for(;this.pos<this.input.length;){var n=this.peek();if(n==="\n"||n===";")break;r+=this.advance()}return{type:Et.EXECUTE,value:"e",command:r.trim()||void 0,line:e,column:t}}},{key:"isDigit",value:function isDigit(e){return e>="0"&&e<="9"}}]);return w4e1}()});function Gft(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var r=!1,n=!1,i=[];for(var s=0;s<e.length;s++){var l=e[s];if(i.length===0&&s===0){var c=l.match(/^#([nr]+)\s*(?:\n|$)/i);if(c){var d=c[1].toLowerCase();d.includes("n")&&(r=!0),d.includes("r")&&(n=!0),l=l.slice(c[0].length)}}if(i.length>0&&i[i.length-1].endsWith("\\")){var c10=i[i.length-1];i[i.length-1]="".concat(c10,"\n").concat(l)}else i.push(l)}var o=i.join("\n"),a=new C4e([o],t||n).parse();if(!a.error&&a.commands.length>0){var s10=Hft(a.commands);if(s10)return{commands:[],error:s10,silentMode:r,extendedRegexMode:n}}return _object_spread_props(_object_spread({},a),{silentMode:r,extendedRegexMode:n})}function Hft(e){var t=new Set;S4e(e,t);var r=k4e(e,t);if(r)return"undefined label '".concat(r,"'")}function S4e(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.type==="label"?t.add(r.name):r.type==="group"&&S4e(r.commands,t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function k4e(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if((r.type==="branch"||r.type==="branchOnSubst"||r.type==="branchOnNoSubst")&&r.label&&!t.has(r.label))return r.label;if(r.type==="group"){var n=k4e(r.commands,t);if(n)return n}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var C4e,Zft=se(function(){"use strict";Vft(),C4e=/*#__PURE__*/function(){function C4e1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_class_call_check(this,C4e1);A(this,"scripts");A(this,"tokens",[]);A(this,"pos",0);A(this,"extendedRegex",!1);this.scripts=e,this.extendedRegex=t}_create_class(C4e1,[{key:"parse",value:function parse(){var t,r,n;var e=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.scripts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=new w4e(i);for(this.tokens=o.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(Et.NEWLINE)||this.check(Et.SEMICOLON)){this.advance();continue}var a=this.pos,s=this.parseCommand();if(s.error)return{commands:[],error:s.error};if(s.command&&e.push(s.command),this.pos===a&&!this.isAtEnd())return{commands:[],error:"unknown command: '".concat((n=(t=this.peek())==null?void 0:t.value)!=null?n:(r=this.peek())==null?void 0:r.type,"'")}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{commands:e}}},{key:"parseCommand",value:function parseCommand(){var e=this.parseAddressRange();if(e!=null&&e.error)return{command:null,error:e.error};var t=e==null?void 0:e.address;for(this.check(Et.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(Et.NEWLINE)||this.check(Et.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};var r=this.peek();switch(r.type){case Et.COMMAND:return this.parseSimpleCommand(r,t);case Et.SUBSTITUTE:return this.parseSubstituteFromToken(r,t);case Et.TRANSLITERATE:return this.parseTransliterateFromToken(r,t);case Et.LABEL_DEF:return this.advance(),{command:{type:"label",name:r.label||""}};case Et.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:r.label}};case Et.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:r.label}};case Et.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:r.label}};case Et.TEXT_CMD:return this.advance(),this.parseTextCommand(r,t);case Et.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:r.filename||""}};case Et.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:r.filename||""}};case Et.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:r.filename||""}};case Et.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:r.filename||""}};case Et.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:r.command}};case Et.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:r.label}};case Et.LBRACE:return this.parseGroup(t);case Et.RBRACE:return{command:null};case Et.ERROR:return{command:null,error:"invalid command: ".concat(r.value)};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}},{key:"parseSimpleCommand",value:function parseSimpleCommand(e,t){this.advance();var r=e.value;switch(r){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:"unknown command: ".concat(r)}}}},{key:"parseSubstituteFromToken",value:function parseSubstituteFromToken(e,t){this.advance();var r=e.flags||"",n,i=r.match(/(\d+)/);return i&&(n=parseInt(i[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:r.includes("g"),ignoreCase:r.includes("i")||r.includes("I"),printOnMatch:r.includes("p"),nthOccurrence:n,extendedRegex:this.extendedRegex}}}},{key:"parseTransliterateFromToken",value:function parseTransliterateFromToken(e,t){this.advance();var r=e.source||"",n=e.dest||"";return r.length!==n.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:r,dest:n}}}},{key:"parseTextCommand",value:function parseTextCommand(e,t){var r=e.value,n=e.text||"";switch(r){case"a":return{command:{type:"append",address:t,text:n}};case"i":return{command:{type:"insert",address:t,text:n}};case"c":return{command:{type:"change",address:t,text:n}};default:return{command:null,error:"unknown text command: ".concat(r)}}}},{key:"parseGroup",value:function parseGroup(e){var r,n,i;this.advance();var t=[];for(;!this.isAtEnd()&&!this.check(Et.RBRACE);){if(this.check(Et.NEWLINE)||this.check(Et.SEMICOLON)){this.advance();continue}var o=this.pos,a=this.parseCommand();if(a.error)return{command:null,error:a.error};if(a.command&&t.push(a.command),this.pos===o&&!this.isAtEnd())return{command:null,error:"unknown command: '".concat((i=(r=this.peek())==null?void 0:r.value)!=null?i:(n=this.peek())==null?void 0:n.type,"'")}}return this.check(Et.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}},{key:"parseAddressRange",value:function parseAddressRange(){if(this.check(Et.COMMA))return{error:"expected context address"};var e=this.parseAddress();if(e===void 0)return;var t;if(this.check(Et.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(Et.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}},{key:"parseAddress",value:function parseAddress(){var e=this.peek();switch(e.type){case Et.NUMBER:return this.advance(),e.value;case Et.DOLLAR:return this.advance(),"$";case Et.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case Et.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case Et.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}},{key:"peek",value:function peek(){return this.tokens[this.pos]||{type:Et.EOF,value:"",line:0,column:0}}},{key:"advance",value:function advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}},{key:"check",value:function check(e){return this.peek().type===e}},{key:"isAtEnd",value:function isAtEnd(){return this.peek().type===Et.EOF}}]);return C4e1}()}),E4e={};St(E4e,{flagsForFuzzing:function(){return A4e},sedCommand:function(){return T4e}});function gq(_01,_11,_21){return _async_to_generator(function(e,t,r){var n,T,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,I,O,_$M,R,$,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,pe,N,_$U,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,pe1,z,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,pe2,D,L,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,pe3,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,pe4,ee,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator6,_step6,pe5,_iteratorNormalCompletion7,_didIteratorError7,_iteratorError7,_loop1,_iterator7,_step7,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:{};i=n.limits,o=n.filename,a=n.fs,s=n.cwd,l=n.coverage,c=n.requireDefenseContext;yl(c,"sed","processing entry");d=function(I,O){return Wh(c,"sed",I,O)},u=e.endsWith("\n"),p=e.split("\n");p.length>0&&p[p.length-1]===""&&p.pop();m=p.length,h="",x=!1,v=(T=i==null?void 0:i.maxStringLength)!=null?T:0,y=function(I){if(h+=I,v>0&&h.length>v)throw new Qt("sed: output size limit exceeded (".concat(v," bytes)"),"string_length")},_="",w=new Map,S=new Map,k=new Map,E=new Map,C=i?{maxIterations:i.maxSedIterations,maxStringLength:v}:void 0;I=0;_state.label=1;case 1:if(!(I<p.length))return[3,14];O=_object_spread_props(_object_spread({},Lft(m,o,w)),{patternSpace:p[I],holdSpace:_,lastPattern:b,lineNumber:I+1,totalLines:m,substitutionMade:!1,coverage:l}),_$M={lines:p,currentLineIndex:I},R=0,$=1e4;O.linesConsumedInCycle=0;_state.label=2;case 2:if(R++,R>$)return[3,12];if(!(O.restartCycle=!1,O.pendingFileReads=[],O.pendingFileWrites=[],_4e(t,O,_$M,C),a&&s))return[3,11];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_loop=function(){var pe,N,_$U,K,_$U1,G,U;return _ts_generator(this,function(_state){switch(_state.label){case 0:pe=_step.value;N=a.resolvePath(s,pe.filename);_state.label=1;case 1:_state.trys.push([1,7,,8]);if(!pe.wholeFile)return[3,3];return[4,d("read command file",function(){return a.readFile(N)})];case 2:_$U=_state.sent();O.appendBuffer.push(_$U.replace(/\n$/,""));return[3,6];case 3:if(!!S.has(N))return[3,5];return[4,d("read command file line cache",function(){return a.readFile(N)})];case 4:K=_state.sent();S.set(N,K.split("\n")),k.set(N,0);_state.label=5;case 5:_$U1=S.get(N),G=k.get(N);_$U1&&G!==void 0&&G<_$U1.length&&(O.appendBuffer.push(_$U1[G]),k.set(N,G+1));_state.label=6;case 6:return[3,8];case 7:U=_state.sent();if(_instanceof(U,nn))throw U;return[3,8];case 8:return[2]}})};_iterator=O.pendingFileReads[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];return[5,_ts_values(_loop())];case 5:_state.sent();_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=O.pendingFileWrites[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){pe=_step1.value;N=a.resolvePath(s,pe.filename),_$U=E.get(N)||"";E.set(N,_$U+pe.content)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=11;case 11:if(O.restartCycle&&!O.deleted&&!O.quit&&!O.quitSilent)return[3,2];_state.label=12;case 12:_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(I+=O.linesConsumedInCycle,_=O.holdSpace,b=O.lastPattern,!r)try{for(_iterator2=O.nCommandOutput[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){pe1=_step2.value;y("".concat(pe1,"\n"))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}z=O.lineNumberOutput.length>0;_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=O.lineNumberOutput[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){pe2=_step3.value;y("".concat(pe2,"\n"))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}D=[],L=[];_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=O.appendBuffer[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){pe3=_step4.value;pe3.startsWith("__INSERT__")?D.push(pe3.slice(10)):L.push(pe3)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator5=D[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){pe4=_step5.value;y("".concat(pe4,"\n"))}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}ee=!1;!O.deleted&&!O.quitSilent?r?O.printed&&(y("".concat(O.patternSpace,"\n")),ee=!0):(y("".concat(O.patternSpace,"\n")),ee=!0):O.changedText!==void 0&&(y("".concat(O.changedText,"\n")),ee=!0);_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(_iterator6=L[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){pe5=_step6.value;y("".concat(pe5,"\n"))}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}if(x=(z||ee)&&L.length===0,O.quit||O.quitSilent){if(O.exitCode!==void 0&&(g=O.exitCode),O.errorMessage)return[2,{output:"",exitCode:g||1,errorMessage:O.errorMessage}];return[3,14]}_state.label=13;case 13:I++;return[3,1];case 14:_iteratorNormalCompletion7=true,_didIteratorError7=false,_iteratorError7=undefined;if(!(a&&s))return[3,22];_state.label=15;case 15:_state.trys.push([15,20,21,22]);_loop1=function(){var _step_value,I,O,M;return _ts_generator(this,function(_state){switch(_state.label){case 0:_step_value=_sliced_to_array(_step7.value,2),I=_step_value[0],O=_step_value[1];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,d("flush pending file writes",function(){return a.writeFile(I,O)})];case 2:_state.sent();return[3,4];case 3:M=_state.sent();if(_instanceof(M,nn))throw M;return[3,4];case 4:return[2]}})};_iterator7=E[Symbol.iterator]();_state.label=16;case 16:if(!!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done))return[3,19];return[5,_ts_values(_loop1())];case 17:_state.sent();_state.label=18;case 18:_iteratorNormalCompletion7=true;return[3,16];case 19:return[3,22];case 20:err=_state.sent();_didIteratorError7=true;_iteratorError7=err;return[3,22];case 21:try{if(!_iteratorNormalCompletion7&&_iterator7.return!=null){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}return[7];case 22:return[2,(!u&&x&&h.endsWith("\n")&&(h=h.slice(0,-1)),{output:h,exitCode:g})]}})}).apply(this,arguments)}var h2e,T4e,A4e,Kft=se(function(){"use strict";kr(),yp(),jr(),Ff(),td(),jt(),Wft(),Zft(),h2e={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:"Commands:\n s/regexp/replacement/[flags] substitute\n d delete pattern space\n p print pattern space\n a\\ text append text after line\n i\\ text insert text before line\n c\\ text change (replace) line with text\n h copy pattern space to hold space\n H append pattern space to hold space\n g copy hold space to pattern space\n G append hold space to pattern space\n x exchange pattern and hold spaces\n n read next line into pattern space\n N append next line to pattern space\n y/source/dest/ transliterate characters\n = print line number\n l list pattern space (escape special chars)\n b [label] branch to label\n t [label] branch on substitution\n T [label] branch if no substitution\n :label define label\n q quit\n Q quit without printing\n\nAddresses:\n N line number\n $ last line\n /regexp/ lines matching regexp\n N,M range from line N to M\n first~step every step-th line starting at first"},T4e={name:"sed",execute:function execute(e,t){return _async_to_generator(function(){var g,x,v,r,n,i,o,a,s,l,_$y,_,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$b,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_loop,_iterator1,_step1,_ret,err,_Gft,c,d,u,p,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_loop1,_iterator2,_step2,_ret1,err,m,_$y1,y,h,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_loop2,_iterator3,_step3,_ret2,err,_$y2,y10;return _ts_generator(this,function(_state){switch(_state.label){case 0:yl(t.requireDefenseContext,"sed","execution entry");r=function(y,_){return Wh(t.requireDefenseContext,"sed",y,_)};if(Vt(e))return[2,Wt(h2e)];n=[],i=[],o=!1,a=!1,s=!1,l=[];for(_$y=0;_$y<e.length;_$y++){_=e[_$y];if(_==="-n"||_==="--quiet"||_==="--silent")o=!0;else if(_==="-i"||_==="--in-place")a=!0;else if(_.startsWith("-i"))a=!0;else if(_==="-E"||_==="-r"||_==="--regexp-extended")s=!0;else if(_==="-e")_$y+1<e.length&&n.push(e[++_$y]);else if(_==="-f")_$y+1<e.length&&i.push(e[++_$y]);else{if(_.startsWith("--"))return[2,fr("sed",_)];if(_==="-")l.push(_);else if(_.startsWith("-")&&_.length>1){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$b=_step.value;if(_$b!=="n"&&_$b!=="e"&&_$b!=="f"&&_$b!=="i"&&_$b!=="E"&&_$b!=="r")return[2,fr("sed","-".concat(_$b))]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_.includes("n")&&(o=!0),_.includes("i")&&(a=!0),(_.includes("E")||_.includes("r"))&&(s=!0),_.includes("e")&&!_.includes("n")&&!_.includes("i")&&_$y+1<e.length&&n.push(e[++_$y]),_.includes("f")&&!_.includes("e")&&_$y+1<e.length&&i.push(e[++_$y])}else!_.startsWith("-")&&n.length===0&&i.length===0?n.push(_):_.startsWith("-")||l.push(_)}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var _$y,_,_$b,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$w,S,b;return _ts_generator(this,function(_state){switch(_state.label){case 0:_$y=_step1.value;_=t.fs.resolvePath(t.cwd,_$y);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,r("script file read",function(){return t.fs.readFile(_)})];case 2:_$b=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$b.split("\n")[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$w=_step.value;S=_$w.trim();S&&!S.startsWith("#")&&n.push(S)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,4];case 3:b=_state.sent();if(_instanceof(b,nn))throw b;return[2,{v:{stdout:"",stderr:"sed: couldn't open file ".concat(_$y,": No such file or directory\n"),exitCode:1}}];case 4:return[2]}})};_iterator1=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=4;case 4:_iteratorNormalCompletion1=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 8:if(n.length===0)return[2,{stdout:"",stderr:"sed: no script specified\n",exitCode:1}];_Gft=Gft(n,s),c=_Gft.commands,d=_Gft.error,u=_Gft.silentMode;if(d)return[2,{stdout:"",stderr:"sed: ".concat(d,"\n"),exitCode:1}];p=!!(o||u);if(!a)return[3,17];if(l.length===0)return[2,{stdout:"",stderr:"sed: -i requires at least one file argument\n",exitCode:1}];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=9;case 9:_state.trys.push([9,14,15,16]);_loop1=function(){var _$y,_,_$b,_$w,b;return _ts_generator(this,function(_state){switch(_state.label){case 0:_$y=_step2.value;if(_$y==="-")return[2,"continue"];_=t.fs.resolvePath(t.cwd,_$y);_state.label=1;case 1:_state.trys.push([1,5,,6]);return[4,r("in-place input read",function(){return t.fs.readFile(_)})];case 2:_$b=_state.sent();return[4,r("in-place processing",function(){return gq(_$b,c,p,{limits:t.limits,filename:_$y,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext})})];case 3:_$w=_state.sent();if(_$w.errorMessage)return[2,{v:{stdout:"",stderr:"".concat(_$w.errorMessage,"\n"),exitCode:(g=_$w.exitCode)!=null?g:1}}];return[4,r("in-place output write",function(){return t.fs.writeFile(_,_$w.output)})];case 4:_state.sent();return[3,6];case 5:b=_state.sent();if(_instanceof(b,nn))throw b;return[2,{v:_instanceof(b,Qt)?{stdout:"",stderr:"sed: ".concat(la(b.message),"\n"),exitCode:Qt.EXIT_CODE}:{stdout:"",stderr:"sed: ".concat(_$y,": No such file or directory\n"),exitCode:1}}];case 6:return[2]}})};_iterator2=l[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,13];return[5,_ts_values(_loop1())];case 11:_ret1=_state.sent();if(_type_of(_ret1)==="object")return[2,_ret1.v];_state.label=12;case 12:_iteratorNormalCompletion2=true;return[3,10];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 16:return[2,{stdout:"",stderr:"",exitCode:0}];case 17:m="";if(!(l.length===0))return[3,21];m=Sn(t.stdin);_state.label=18;case 18:_state.trys.push([18,20,,21]);return[4,r("stdin processing",function(){return gq(m,c,p,{limits:t.limits,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext})})];case 19:_$y1=_state.sent();return[2,{stdout:_$y1.output,stderr:_$y1.errorMessage?"".concat(_$y1.errorMessage,"\n"):"",exitCode:(x=_$y1.exitCode)!=null?x:0}];case 20:y=_state.sent();if(_instanceof(y,nn))throw y;if(_instanceof(y,Qt))return[2,{stdout:"",stderr:"sed: ".concat(la(y.message),"\n"),exitCode:Qt.EXIT_CODE}];throw y;case 21:h=!1;_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;_state.label=22;case 22:_state.trys.push([22,27,28,29]);_loop2=function(){var _$y,_,_$b,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:_$y=_step3.value;_=void 0;if(!(_$y==="-"))return[3,1];h?_="":(_=Sn(t.stdin),h=!0);return[3,5];case 1:_$b=t.fs.resolvePath(t.cwd,_$y);_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,r("input file read",function(){return t.fs.readFile(_$b)})];case 3:_=_state.sent();return[3,5];case 4:w=_state.sent();if(_instanceof(w,nn))throw w;return[2,{v:_instanceof(w,Qt)?{stdout:"",stderr:"sed: ".concat(la(w.message),"\n"),exitCode:Qt.EXIT_CODE}:{stdout:"",stderr:"sed: ".concat(_$y,": No such file or directory\n"),exitCode:1}}];case 5:m.length>0&&_.length>0&&!m.endsWith("\n")&&(m+="\n"),m+=_;return[2]}})};_iterator3=l[Symbol.iterator]();_state.label=23;case 23:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,26];return[5,_ts_values(_loop2())];case 24:_ret2=_state.sent();if(_type_of(_ret2)==="object")return[2,_ret2.v];_state.label=25;case 25:_iteratorNormalCompletion3=true;return[3,23];case 26:return[3,29];case 27:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,29];case 28:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 29:_state.trys.push([29,31,,32]);return[4,r("final processing",function(){return gq(m,c,p,{limits:t.limits,filename:l.length===1?l[0]:void 0,fs:t.fs,cwd:t.cwd,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext})})];case 30:_$y2=_state.sent();return[2,{stdout:_$y2.output,stderr:_$y2.errorMessage?"".concat(_$y2.errorMessage,"\n"):"",exitCode:(v=_$y2.exitCode)!=null?v:0}];case 31:y10=_state.sent();if(_instanceof(y10,nn))throw y10;if(_instanceof(y10,Qt))return[2,{stdout:"",stderr:"sed: ".concat(la(y10.message),"\n"),exitCode:Qt.EXIT_CODE}];throw y10;case 32:return[2]}})})()}},A4e={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function Jc(e){return Object.assign(Object.create(null),Object.fromEntries(e))}function Gc(e,t){return Object.assign(Object.create(null),Object.fromEntries(e),t)}function I9(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}var _Object;return(_Object=Object).assign.apply(_Object,[Object.create(null)].concat(_to_consumable_array(e)))}var Vh=se(function(){"use strict"});function Qft(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var tmp=e.fieldSep,t=tmp===void 0?R4e:tmp,tmp1=e.maxIterations,r=tmp1===void 0?I4e:tmp1,tmp2=e.maxRecursionDepth,n=tmp2===void 0?P4e:tmp2,tmp3=e.maxOutputSize,i=tmp3===void 0?0:tmp3,o=e.fs,a=e.cwd,s=e.exec,l=e.coverage,c=e.requireDefenseContext;return{FS:" ",OFS:" ",ORS:"\n",OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"\x1c",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:r,maxRecursionDepth:n,maxOutputSize:i,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:o,cwd:a,exec:s,coverage:l,requireDefenseContext:c}}var I4e,P4e,R4e,Jft=se(function(){"use strict";Ei(),I4e=1e4,P4e=100,R4e=new V9(/\s+/)});function Yft(e,t,r){switch(r){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return Math.pow(e,t);default:return 0}}var Xft=se(function(){"use strict"});function nc(e){if(typeof e=="number")return e;var t=parseFloat(e);return Number.isNaN(t)?0:t}function Fa(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function G9(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.type==="regex")return[2,e.pattern];return[4,t.evalExpr(e)];case 1:r=Fa.apply(void 0,[_state.sent()]);return[2,(r.startsWith("/")&&r.endsWith("/")&&(r=r.slice(1,-1)),r)]}})})()}function M4e(e,t){return _async_to_generator(function(){var _tmp,_tmp1,_tmp2,_,_10,_11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e)return[3,6];if(!(e.type==="variable"))return[3,1];_tmp1=e.name;return[3,5];case 1:if(!(e.type==="field"))return[3,3];_10=(_="$").concat;_11=Math.floor;return[4,t.evalExpr(e.index)];case 2:_tmp2=_10.apply(_,[_11.apply(Math,[nc.apply(void 0,[_state.sent()])])]);return[3,4];case 3:_tmp2="$0";_state.label=4;case 4:_tmp1=_tmp2;_state.label=5;case 5:_tmp=_tmp1;return[3,7];case 6:_tmp="$0";_state.label=7;case 7:return[2,_tmp]}})})()}function O4e(e,t){var r;if(e==="$0")return t.line;if(e.startsWith("$")){var n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return Fa((r=t.vars[e])!=null?r:"")}function $4e(e,t,r){if(e==="$0")r.line=t,r.fields=r.FS===" "?t.trim().split(/\s+/).filter(Boolean):r.fieldSep.split(t),r.NF=r.fields.length;else if(e.startsWith("$")){var n=parseInt(e.slice(1),10)-1;for(;r.fields.length<=n;)r.fields.push("");r.fields[n]=t,r.NF=r.fields.length,r.line=r.fields.join(r.OFS)}else r.vars[e]=t}function emt(e,t,r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=t.line.length;return[3,3];case 1:return[4,r.evalExpr(e[0])];case 2:_tmp=Fa.apply(void 0,[_state.sent()]).length;_state.label=3;case 3:return[2,_tmp]}})})()}function tmt(e,t,r){return _async_to_generator(function(){var n,i,_,o,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,""];return[4,r.evalExpr(e[0])];case 1:n=Fa.apply(void 0,[_state.sent()]);_=Math.floor;return[4,r.evalExpr(e[1])];case 2:i=_.apply(Math,[nc.apply(void 0,[_state.sent()])])-1;if(!(e.length>=3))return[3,4];_10=Math.floor;return[4,r.evalExpr(e[2])];case 3:o=_10.apply(Math,[nc.apply(void 0,[_state.sent()])]);return[2,n.substr(Math.max(0,i),o)];case 4:return[2,n.substr(Math.max(0,i))]}})})()}function rmt(e,t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,0];return[4,r.evalExpr(e[0])];case 1:n=Fa.apply(void 0,[_state.sent()]);return[4,r.evalExpr(e[1])];case 2:i=Fa.apply(void 0,[_state.sent()]),o=n.indexOf(i);return[2,o===-1?0:o+1]}})})()}function nmt(e,t,r){return _async_to_generator(function(){var n,i,o,a,l,c,s,l10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,0];return[4,r.evalExpr(e[0])];case 1:n=Fa.apply(void 0,[_state.sent()]),i=e[1];if(i.type!=="variable")return[2,0];o=i.name,a=t.FS;if(!(e.length>=3))return[3,5];l=e[2];if(!(l.type==="regex"))return[3,2];a=ir(l.pattern);return[3,4];case 2:return[4,r.evalExpr(l)];case 3:c=Fa.apply(void 0,[_state.sent()]);a=c===" "?ir("\\s+"):c;_state.label=4;case 4:return[3,6];case 5:t.FS===" "&&(a=ir("\\s+"));_state.label=6;case 6:s=typeof a=="string"?n.split(a):a.split(n);t.arrays[o]=Object.create(null);for(l10=0;l10<s.length;l10++)t.arrays[o][String(l10+1)]=s[l10];return[2,s.length]}})})()}function imt(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,0];return[4,G9(e[0],r)];case 1:n=_state.sent();return[4,r.evalExpr(e[1])];case 2:i=Fa.apply(void 0,[_state.sent()]);return[4,M4e(e[2],r)];case 3:o=_state.sent(),a=O4e(o,t);try{s=ir(n).replace(a,N4e(i)),l=s!==a?1:0;return[2,($4e(o,s,t),l)]}catch(s){return[2,0]}return[2]}})})()}function omt(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,0];return[4,G9(e[0],r)];case 1:n=_state.sent();return[4,r.evalExpr(e[1])];case 2:i=Fa.apply(void 0,[_state.sent()]);return[4,M4e(e[2],r)];case 3:o=_state.sent(),a=O4e(o,t);try{s=ir(n,"g"),l=s.match(a),c=l?l.length:0,d=s.replace(a,N4e(i));return[2,($4e(o,d,t),c)]}catch(s){return[2,0]}return[2]}})})()}function N4e(e){return function(t){var r="",n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length){var i=e[n+1];i==="&"?(r+="&",n+=2):i==="\\"?(r+="\\",n+=2):(r+=e[n+1],n+=2)}else e[n]==="&"?(r+=t,n++):(r+=e[n],n++);return r}}function amt(e,t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<2)return[2,(t.RSTART=0,t.RLENGTH=-1,0)];return[4,r.evalExpr(e[0])];case 1:n=Fa.apply(void 0,[_state.sent()]);return[4,G9(e[1],r)];case 2:i=_state.sent();try{o=ir(i).exec(n);if(o)return[2,(t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART)]}catch(o){}return[2,(t.RSTART=0,t.RLENGTH=-1,0)]}})})()}function smt(e,t,r){return _async_to_generator(function(){var n,i,o,a,_tmp,s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length<3)return[2,""];return[4,G9(e[0],r)];case 1:n=_state.sent();return[4,r.evalExpr(e[1])];case 2:i=Fa.apply(void 0,[_state.sent()]);return[4,r.evalExpr(e[2])];case 3:o=Fa.apply(void 0,[_state.sent()]);if(!(e.length>=4))return[3,5];return[4,r.evalExpr(e[3])];case 4:_tmp=Fa.apply(void 0,[_state.sent()]);return[3,6];case 5:_tmp=t.line;_state.label=6;case 6:a=_tmp;try{s=o.toLowerCase()==="g",l=s?0:parseInt(o,10)||1;if(s)return[2,ir(n,"g").replace(a,function(c){for(var _len=arguments.length,d=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){d[_key-1]=arguments[_key]}return g2e(i,c,d.slice(0,-2))})];{c=0;return[2,ir(n,"g").replace(a,function(d){for(var _len=arguments.length,u=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){u[_key-1]=arguments[_key]}return c++,c===l?g2e(i,d,u.slice(0,-2)):d})]}}catch(s){return[2,a]}return[2]}})})()}function g2e(e,t,r){var n="",i=0;for(;i<e.length;)if(e[i]==="\\"&&i+1<e.length){var o=e[i+1];if(o==="&")n+="&",i+=2;else if(o==="0")n+=t,i+=2;else if(o>="1"&&o<="9"){var a=parseInt(o,10)-1;n+=r[a]||"",i+=2}else o==="n"?(n+="\n",i+=2):o==="t"?(n+=" ",i+=2):(n+=o,i+=2)}else e[i]==="&"?(n+=t,i++):(n+=e[i],i++);return n}function lmt(e,t,r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp="";return[3,3];case 1:return[4,r.evalExpr(e[0])];case 2:_tmp=Fa.apply(void 0,[_state.sent()]).toLowerCase();_state.label=3;case 3:return[2,_tmp]}})})()}function umt(e,t,r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp="";return[3,3];case 1:return[4,r.evalExpr(e[0])];case 2:_tmp=Fa.apply(void 0,[_state.sent()]).toUpperCase();_state.label=3;case 3:return[2,_tmp]}})})()}function cmt(e,t,r){return _async_to_generator(function(){var n,i,o,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length===0)return[2,""];return[4,r.evalExpr(e[0])];case 1:n=Fa.apply(void 0,[_state.sent()]),i=[];o=1;_state.label=2;case 2:if(!(o<e.length))return[3,5];_=i.push;return[4,r.evalExpr(e[o])];case 3:_.apply(i,[_state.sent()]);_state.label=4;case 4:o++;return[3,2];case 5:return[2,lV(n,i)]}})})()}function dmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=0;return[3,3];case 1:_=Math.floor;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function pmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=0;return[3,3];case 1:_=Math.sqrt;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function fmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=0;return[3,3];case 1:_=Math.sin;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function mmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=0;return[3,3];case 1:_=Math.cos;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function hmt(e,t,r){return _async_to_generator(function(){var n,i,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length>0))return[3,2];return[4,r.evalExpr(e[0])];case 1:_tmp=nc.apply(void 0,[_state.sent()]);return[3,3];case 2:_tmp=0;_state.label=3;case 3:n=_tmp;if(!(e.length>1))return[3,5];return[4,r.evalExpr(e[1])];case 4:_tmp1=nc.apply(void 0,[_state.sent()]);return[3,6];case 5:_tmp1=0;_state.label=6;case 6:i=_tmp1;return[2,Math.atan2(n,i)]}})})()}function gmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=0;return[3,3];case 1:_=Math.log;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function xmt(e,t,r){return _async_to_generator(function(){var _tmp,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length===0))return[3,1];_tmp=1;return[3,3];case 1:_=Math.exp;return[4,r.evalExpr(e[0])];case 2:_tmp=_.apply(Math,[nc.apply(void 0,[_state.sent()])]);_state.label=3;case 3:return[2,_tmp]}})})()}function ymt(e,t,r){return t.random?t.random():Math.random()}function vmt(e,t,r){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length>0))return[3,2];return[4,r.evalExpr(e[0])];case 1:_tmp=nc.apply(void 0,[_state.sent()]);return[3,3];case 2:_tmp=Date.now();_state.label=3;case 3:n=_tmp;return[2,(t.vars._srand_seed=n,n)]}})})()}function _mt(e,t){return function(){throw new Error("".concat(e,"() is not supported - ").concat(t))}}function xq(e){return function(){throw new Error("function '".concat(e,"()' is not implemented"))}}function lV(e,t){var _loop=function(){if(e[i]==="%"&&i+1<e.length){var o=i+1,a="",s="",l="",c=void 0,d=o;for(;o<e.length&&/\d/.test(e[o]);)o++;o>d&&e[o]==="$"?(c=parseInt(e.substring(d,o),10)-1,o++):o=d;var u=function(){if(o<e.length){if(o+1<e.length&&(e[o]==="h"&&e[o+1]==="h"||e[o]==="l"&&e[o+1]==="l")){o+=2;return}/[lzjh]/.test(e[o])&&o++}};for(;o<e.length&&/[-+ #0]/.test(e[o]);)a+=e[o++];if(e[o]==="*"){var h=t[r++],g=h!==void 0?Math.floor(Number(h)):0;g<0?(a+="-",s=String(Math.min(-g,Lh))):s=String(Math.min(g,Lh)),o++}else for(;o<e.length&&/\d/.test(e[o]);)s+=e[o++];if(s&&parseInt(s,10)>Lh&&(s=String(Lh)),e[o]==="."){if(o++,e[o]==="*"){var h10=t[r++];l=String(Math.min(h10!==void 0?Math.floor(Number(h10)):0,Lh)),o++}else for(;o<e.length&&/\d/.test(e[o]);)l+=e[o++];l&&parseInt(l,10)>Lh&&(l=String(Lh))}u();var p=e[o],m=t[c!==void 0?c:r];switch(p){case"s":{var h11=m!==void 0?String(m):"";if(l&&(h11=h11.substring(0,parseInt(l,10))),s){var g10=parseInt(s,10);a.includes("-")?h11=h11.padEnd(g10):h11=h11.padStart(g10)}n+=h11,c===void 0&&r++;break}case"d":case"i":{var h12=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(h12)&&(h12=0);var g11=h12<0,x=Math.abs(h12).toString();if(l){var _=parseInt(l,10);x=x.padStart(_,"0")}var v="";g11?v="-":a.includes("+")?v="+":a.includes(" ")&&(v=" ");var y=v+x;if(s){var _10=parseInt(s,10);a.includes("-")?y=y.padEnd(_10):a.includes("0")&&!l?y=v+x.padStart(_10-v.length,"0"):y=y.padStart(_10)}n+=y,c===void 0&&r++;break}case"f":{var h13=m!==void 0?Number(m):0;Number.isNaN(h13)&&(h13=0);var g12=l?parseInt(l,10):6,x10=h13.toFixed(g12);if(s){var v10=parseInt(s,10);a.includes("-")?x10=x10.padEnd(v10):x10=x10.padStart(v10)}n+=x10,c===void 0&&r++;break}case"e":case"E":{var h14=m!==void 0?Number(m):0;Number.isNaN(h14)&&(h14=0);var g13=l?parseInt(l,10):6,x11=h14.toExponential(g13);if(p==="E"&&(x11=x11.toUpperCase()),s){var v11=parseInt(s,10);a.includes("-")?x11=x11.padEnd(v11):x11=x11.padStart(v11)}n+=x11,c===void 0&&r++;break}case"g":case"G":{var h15=m!==void 0?Number(m):0;Number.isNaN(h15)&&(h15=0);var g14=l?parseInt(l,10):6,x12=h15!==0?Math.floor(Math.log10(Math.abs(h15))):0,v12=void 0;if(h15===0?v12="0":x12<-4||x12>=g14?(v12=h15.toExponential(g14-1),p==="G"&&(v12=v12.toUpperCase())):v12=h15.toPrecision(g14),v12.includes(".")&&(v12=v12.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),v12.includes("e")&&(v12=v12.replace(/\.?0+e/,"e")),s){var y10=parseInt(s,10);a.includes("-")?v12=v12.padEnd(y10):v12=v12.padStart(y10)}n+=v12,c===void 0&&r++;break}case"x":case"X":{var h16=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(h16)&&(h16=0);var g15=Math.abs(h16).toString(16);if(p==="X"&&(g15=g15.toUpperCase()),l){var y11=parseInt(l,10);g15=g15.padStart(y11,"0")}var x13=h16<0?"-":"",v13=x13+g15;if(s){var y12=parseInt(s,10);a.includes("-")?v13=v13.padEnd(y12):a.includes("0")&&!l?v13=x13+g15.padStart(y12-x13.length,"0"):v13=v13.padStart(y12)}n+=v13,c===void 0&&r++;break}case"o":{var h17=m!==void 0?Math.floor(Number(m)):0;Number.isNaN(h17)&&(h17=0);var g16=Math.abs(h17).toString(8);if(l){var y13=parseInt(l,10);g16=g16.padStart(y13,"0")}var x14=h17<0?"-":"",v14=x14+g16;if(s){var y14=parseInt(s,10);a.includes("-")?v14=v14.padEnd(y14):a.includes("0")&&!l?v14=x14+g16.padStart(y14-x14.length,"0"):v14=v14.padStart(y14)}n+=v14,c===void 0&&r++;break}case"c":{typeof m=="number"?n+=String.fromCharCode(m):n+=String(m!=null?m:"").charAt(0)||"",c===void 0&&r++;break}case"%":n+="%";break;default:n+=e.substring(i,o+1)}i=o+1}else if(e[i]==="\\"&&i+1<e.length){var o10=e[i+1];switch(o10){case"n":n+="\n";break;case"t":n+=" ";break;case"r":n+="\r";break;case"\\":n+="\\";break;default:n+=o10}i+=2}else n+=e[i++]};var r=0,n="",i=0;for(;i<e.length;)_loop();return n}var Lh,D4e,L4e=se(function(){"use strict";Ei(),Lh=1e4,D4e=new Map([["length",emt],["substr",tmt],["index",rmt],["split",nmt],["sub",imt],["gsub",omt],["match",amt],["gensub",smt],["tolower",lmt],["toupper",umt],["sprintf",cmt],["int",dmt],["sqrt",pmt],["sin",fmt],["cos",mmt],["atan2",hmt],["log",gmt],["exp",xmt],["rand",ymt],["srand",vmt],["system",_mt("system","shell execution not allowed in sandboxed environment")],["close",function(){return 0}],["fflush",function(){return 0}],["systime",xq("systime")],["mktime",xq("mktime")],["strftime",xq("strftime")]])});function ec(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function _o(e){if(typeof e=="number")return e;var t=parseFloat(e);return Number.isNaN(t)?0:t}function ti(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function x2e(e){if(typeof e=="number")return!0;var t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function lW(e,t){try{return ir(e).test(t)}catch(r){return!1}}var a5=se(function(){"use strict";Ei()});function F4e(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function uV(e,t){var r;return t===0?e.line:t<0||t>e.fields.length?"":(r=e.fields[t-1])!=null?r:""}function z4e(e,t,r){if(t===0)e.line=ti(r),e.fields=F4e(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=ti(r),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function H9(e,t){e.line=t,e.fields=F4e(e,t),e.NF=e.fields.length}function bmt(e,t){if(e.FS=t,t===" ")e.fieldSep=new V9(/\s+/);else try{e.fieldSep=ir(t)}catch(r){e.fieldSep=ir(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}var cV=se(function(){"use strict";Ei(),a5()});function dV(e,t){var r;switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return(r=e.vars[t])!=null?r:""}function s5(e,t,r){switch(t){case"FS":bmt(e,ti(r));return;case"OFS":e.OFS=ti(r);return;case"ORS":e.ORS=ti(r);return;case"OFMT":e.OFMT=ti(r);return;case"NR":e.NR=Math.floor(_o(r));return;case"NF":{var n=Math.floor(_o(r));if(n<e.NF)e.fields=e.fields.slice(0,n),e.line=e.fields.join(e.OFS);else if(n>e.NF){for(;e.fields.length<n;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=n;return}case"FNR":e.FNR=Math.floor(_o(r));return;case"FILENAME":e.FILENAME=ti(r);return;case"RSTART":e.RSTART=Math.floor(_o(r));return;case"RLENGTH":e.RLENGTH=Math.floor(_o(r));return;case"SUBSEP":e.SUBSEP=ti(r);return}e.vars[t]=r}function l5(e,t){var r=t,n=new Set,i=e.arrayAliases.get(r);for(;i!==void 0&&!n.has(r);)n.add(r),r=i,i=e.arrayAliases.get(r);return r}function pV(e,t,r){var i,o,a,s;if(t==="ARGV")return(i=e.ARGV[r])!=null?i:"";if(t==="ENVIRON")return(o=e.ENVIRON[r])!=null?o:"";var n=l5(e,t);return(s=(a=e.arrays[n])==null?void 0:a[r])!=null?s:""}function j4e(e,t,r,n){var i=l5(e,t);e.arrays[i]||(e.arrays[i]=Object.create(null)),e.arrays[i][r]=n}function wmt(e,t,r){var i;if(t==="ARGV")return e.ARGV[r]!==void 0;if(t==="ENVIRON")return e.ENVIRON[r]!==void 0;var n=l5(e,t);return((i=e.arrays[n])==null?void 0:i[r])!==void 0}function Smt(e,t,r){var n=l5(e,t);e.arrays[n]&&delete e.arrays[n][r]}function kmt(e,t){var r=l5(e,t);delete e.arrays[r]}var U4e=se(function(){"use strict";cV(),a5()});function Cmt(e){fV=e}function Sl(e,t){yl(e.requireDefenseContext,"awk",t)}function wn(e,t,r){return Wh(e.requireDefenseContext,"awk",t,r)}function hr(e,t){return _async_to_generator(function(){var r,_,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=(Sl(e,"expression evaluation"),(r=e.coverage)==null||r.hit("awk:expr:".concat(t.type)),t.type);switch(_){case"number":return[3,1];case"string":return[3,2];case"regex":return[3,3];case"field":return[3,4];case"variable":return[3,5];case"array_access":return[3,6];case"binary":return[3,7];case"unary":return[3,8];case"ternary":return[3,9];case"call":return[3,15];case"assignment":return[3,16];case"pre_increment":return[3,17];case"pre_decrement":return[3,18];case"post_increment":return[3,19];case"post_decrement":return[3,20];case"in":return[3,21];case"getline":return[3,22];case"tuple":return[3,23]}return[3,24];case 1:return[2,t.value];case 2:return[2,t.value];case 3:return[2,lW(t.pattern,e.line)?1:0];case 4:return[2,Emt(e,t)];case 5:return[2,dV(e,t.name)];case 6:return[2,Tmt(e,t)];case 7:return[2,Amt(e,t)];case 8:return[2,Rmt(e,t)];case 9:return[4,wn(e,"ternary condition evaluation",function(){return hr(e,t.condition)})];case 10:if(!ec.apply(void 0,[_state.sent()]))return[3,12];return[4,wn(e,"ternary consequent evaluation",function(){return hr(e,t.consequent)})];case 11:_tmp=_state.sent();return[3,14];case 12:return[4,wn(e,"ternary alternate evaluation",function(){return hr(e,t.alternate)})];case 13:_tmp=_state.sent();_state.label=14;case 14:return[2,_tmp];case 15:return[2,Mmt(e,t.name,t.args)];case 16:return[2,$mt(e,t)];case 17:return[2,Nmt(e,t.operand)];case 18:return[2,Dmt(e,t.operand)];case 19:return[2,Lmt(e,t.operand)];case 20:return[2,Fmt(e,t.operand)];case 21:return[2,zmt(e,t.key,t.array)];case 22:return[2,jmt(e,t.variable,t.file,t.command)];case 23:return[2,qmt(e,t.elements)];case 24:return[2,""];case 25:return[2]}})})()}function Emt(e,t){return _async_to_generator(function(){var r,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"field reference evaluation");_=Math.floor;return[4,wn(e,"field index evaluation",function(){return hr(e,t.index)})];case 1:r=_.apply(Math,[_o.apply(void 0,[_state.sent()])]);return[2,uV(e,r)]}})})()}function Tmt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"array access evaluation");return[4,wn(e,"array key evaluation",function(){return hr(e,t.key)})];case 1:r=ti.apply(void 0,[_state.sent()]);return[2,pV(e,t.array,r)]}})})()}function Amt(e,t){return _async_to_generator(function(){var s,l,r,_tmp,_tmp1,c,d,_tmp2,c10,d10,_tmp3,n,i,c11,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"binary expression evaluation");r=t.operator;if(!(r==="||"))return[3,4];return[4,wn(e,"logical-or left evaluation",function(){return hr(e,t.left)})];case 1:_tmp=ec.apply(void 0,[_state.sent()]);if(_tmp)return[3,3];return[4,wn(e,"logical-or right evaluation",function(){return hr(e,t.right)})];case 2:_tmp=ec.apply(void 0,[_state.sent()]);_state.label=3;case 3:return[2,_tmp?1:0];case 4:if(!(r==="&&"))return[3,8];return[4,wn(e,"logical-and left evaluation",function(){return hr(e,t.left)})];case 5:_tmp1=ec.apply(void 0,[_state.sent()]);if(!_tmp1)return[3,7];return[4,wn(e,"logical-and right evaluation",function(){return hr(e,t.right)})];case 6:_tmp1=ec.apply(void 0,[_state.sent()]);_state.label=7;case 7:return[2,_tmp1?1:0];case 8:if(!(r==="~"))return[3,13];return[4,wn(e,"regex left evaluation",function(){return hr(e,t.left)})];case 9:c=_state.sent();t.right.type==="regex"&&((s=e.coverage)==null||s.hit("awk:expr:regex"));if(!(t.right.type==="regex"))return[3,10];_tmp2=t.right.pattern;return[3,12];case 10:return[4,wn(e,"regex right evaluation",function(){return hr(e,t.right)})];case 11:_tmp2=ti.apply(void 0,[_state.sent()]);_state.label=12;case 12:d=_tmp2;try{return[2,ir(d).test(ti(c))?1:0]}catch(u){return[2,0]}_state.label=13;case 13:if(!(r==="!~"))return[3,18];return[4,wn(e,"negated-regex left evaluation",function(){return hr(e,t.left)})];case 14:c10=_state.sent();t.right.type==="regex"&&((l=e.coverage)==null||l.hit("awk:expr:regex"));if(!(t.right.type==="regex"))return[3,15];_tmp3=t.right.pattern;return[3,17];case 15:return[4,wn(e,"negated-regex right evaluation",function(){return hr(e,t.right)})];case 16:_tmp3=ti.apply(void 0,[_state.sent()]);_state.label=17;case 17:d10=_tmp3;try{return[2,ir(d10).test(ti(c10))?0:1]}catch(u){return[2,1]}_state.label=18;case 18:return[4,wn(e,"binary left evaluation",function(){return hr(e,t.left)})];case 19:n=_state.sent();return[4,wn(e,"binary right evaluation",function(){return hr(e,t.right)})];case 20:i=_state.sent();if(r===" "){c11=ti(n)+ti(i);if(e.maxOutputSize>0&&c11.length>e.maxOutputSize)throw new Qt("awk: string concatenation size limit exceeded (".concat(e.maxOutputSize," bytes)"),"string_length",e.output);return[2,c11]}if(Imt(r))return[2,Pmt(n,i,r)];o=_o(n),a=_o(i);return[2,Yft(o,a,r)]}})})()}function Imt(e){return["<","<=",">",">=","==","!="].includes(e)}function Pmt(e,t,r){var n=x2e(e),i=x2e(t);if(n&&i){var s=_o(e),l=_o(t);switch(r){case"<":return s<l?1:0;case"<=":return s<=l?1:0;case">":return s>l?1:0;case">=":return s>=l?1:0;case"==":return s===l?1:0;case"!=":return s!==l?1:0}}var o=ti(e),a=ti(t);switch(r){case"<":return o<a?1:0;case"<=":return o<=a?1:0;case">":return o>a?1:0;case">=":return o>=a?1:0;case"==":return o===a?1:0;case"!=":return o!==a?1:0}return 0}function Rmt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"unary expression evaluation");return[4,wn(e,"unary operand evaluation",function(){return hr(e,t.operand)})];case 1:r=_state.sent();switch(t.operator){case"!":return[2,ec(r)?0:1];case"-":return[2,-_o(r)];case"+":return[2,+_o(r)];default:return[2,r]}return[2]}})})()}function Mmt(e,t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){Sl(e,"function call evaluation");n=D4e.get(t);if(n)return[2,n(r,e,{evalExpr:function(o){return hr(e,o)}})];i=e.functions.get(t);return[2,i?Omt(e,i,r):""]})})()}function Omt(e,t,r){return _async_to_generator(function(){var _loop,s,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,i,l10,o,_tmp,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l11,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,l12;return _ts_generator(this,function(_state){switch(_state.label){case 0:_loop=function(l10){var c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=t.params[l10];if(!(l10<r.length))return[3,2];d=r[l10];d.type==="variable"&&(e.arrayAliases.set(c,d.name),i.push(c));return[4,wn(e,"user function argument evaluation",function(){return hr(e,d)})];case 1:u=_state.sent();e.vars[c]=u;return[3,3];case 2:e.vars[c]="";_state.label=3;case 3:return[2]}})};if(Sl(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new Qt("awk: recursion depth exceeded maximum (".concat(e.maxRecursionDepth,")"),"recursion",e.output);n=Object.create(null);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t.params[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l=_step.value;n[l]=e.vars[l]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}i=[];l10=0;_state.label=1;case 1:if(!(l10<t.params.length))return[3,4];return[5,_ts_values(_loop(l10))];case 2:_state.sent();_state.label=3;case 3:l10++;return[3,1];case 4:e.hasReturn=!1,e.returnValue=void 0;o=fV;_tmp=o;if(!_tmp)return[3,6];return[4,wn(e,"user function body execution",function(){return o(e,t.body.statements)})];case 5:_tmp=_state.sent();_state.label=6;case 6:_tmp;a=(s=e.returnValue)!=null?s:"";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=t.params[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){l11=_step1.value;n[l11]!==void 0?e.vars[l11]=n[l11]:delete e.vars[l11]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=i[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){l12=_step2.value;e.arrayAliases.delete(l12)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,(e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,a)]}})})()}function $mt(e,t){return _async_to_generator(function(){var r,n,i,o,a,c,_,c10,s,l,a9,_10,a10;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"assignment evaluation");return[4,wn(e,"assignment value evaluation",function(){return hr(e,t.value)})];case 1:r=_state.sent(),n=t.target,i=t.operator;if(!(i==="="))return[3,2];o=r;return[3,8];case 2:if(!(n.type==="field"))return[3,4];_=Math.floor;return[4,wn(e,"assignment field index",function(){return hr(e,n.index)})];case 3:c=_.apply(Math,[_o.apply(void 0,[_state.sent()])]);a=uV(e,c);return[3,7];case 4:if(!(n.type==="variable"))return[3,5];a=dV(e,n.name);return[3,7];case 5:return[4,wn(e,"assignment array key",function(){return hr(e,n.key)})];case 6:c10=ti.apply(void 0,[_state.sent()]);a=pV(e,n.array,c10);_state.label=7;case 7:s=_o(a),l=_o(r);switch(i){case"+=":o=s+l;break;case"-=":o=s-l;break;case"*=":o=s*l;break;case"/=":o=l!==0?s/l:0;break;case"%=":o=l!==0?s%l:0;break;case"^=":o=Math.pow(s,l);break;default:o=r}_state.label=8;case 8:if(!(n.type==="field"))return[3,10];_10=Math.floor;return[4,wn(e,"assignment target field index",function(){return hr(e,n.index)})];case 9:a9=_10.apply(Math,[_o.apply(void 0,[_state.sent()])]);z4e(e,a9,o);return[3,13];case 10:if(!(n.type==="variable"))return[3,11];s5(e,n.name,o);return[3,13];case 11:return[4,wn(e,"assignment target array key",function(){return hr(e,n.key)})];case 12:a10=ti.apply(void 0,[_state.sent()]);j4e(e,n.array,a10,o);_state.label=13;case 13:return[2,o]}})})()}function Z9(e,t,r,n){return _async_to_generator(function(){var i,o,_,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"inc/dec evaluation");if(!(t.type==="field"))return[3,2];_=Math.floor;return[4,wn(e,"inc/dec field index",function(){return hr(e,t.index)})];case 1:o=_.apply(Math,[_o.apply(void 0,[_state.sent()])]);i=_o(uV(e,o)),z4e(e,o,i+r);return[3,5];case 2:if(!(t.type==="variable"))return[3,3];i=_o(dV(e,t.name)),s5(e,t.name,i+r);return[3,5];case 3:return[4,wn(e,"inc/dec array key",function(){return hr(e,t.key)})];case 4:o10=ti.apply(void 0,[_state.sent()]);i=_o(pV(e,t.array,o10)),j4e(e,t.array,o10,i+r);_state.label=5;case 5:return[2,n?i+r:i]}})})()}function Nmt(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Z9(e,t,1,!0)]})})()}function Dmt(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Z9(e,t,-1,!0)]})})()}function Lmt(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Z9(e,t,1,!1)]})})()}function Fmt(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Z9(e,t,-1,!1)]})})()}function zmt(e,t,r){return _async_to_generator(function(){var i,n,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:Sl(e,"in-expression evaluation");if(!(t.type==="tuple"))return[3,9];(i=e.coverage)==null||i.hit("awk:expr:tuple");o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var a,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=_step.value;_=o.push;return[4,wn(e,"tuple key element evaluation",function(){return hr(e,a)})];case 1:_.apply(o,[ti.apply(void 0,[_state.sent()])]);return[2]}})};_iterator=t.elements[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:n=o.join(e.SUBSEP);return[3,11];case 9:return[4,wn(e,"in-expression key evaluation",function(){return hr(e,t)})];case 10:n=ti.apply(void 0,[_state.sent()]);_state.label=11;case 11:return[2,wmt(e,r,n)?1:0]}})})()}function jmt(e,t,r,n){return _async_to_generator(function(){var i,o;return _ts_generator(this,function(_state){if(Sl(e,"getline evaluation"),n)return[2,Umt(e,t,n)];if(r)return[2,Bmt(e,t,r)];if(!e.lines||e.lineIndex===void 0)return[2,-1];i=e.lineIndex+1;if(i>=e.lines.length)return[2,0];o=e.lines[i];return[2,(t?s5(e,t,o):H9(e,o),e.NR++,e.lineIndex=i,1)]})})()}function Umt(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l,_$u,u,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=e.exec;if(!n)return[2,-1];Sl(e,"getline command source");return[4,wn(e,"getline command expression",function(){return hr(e,r)})];case 1:i=ti.apply(void 0,[_state.sent()]),o="__cmd_".concat(i),a="__cmdi_".concat(i);if(!(e.vars[o]===void 0))return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,wn(e,"getline command exec",function(){return n(i)})];case 3:_$u=_state.sent();s=Sn(_$u.stdout).split("\n"),s.length>0&&s[s.length-1]===""&&s.pop(),e.vars[o]=JSON.stringify(s),e.vars[a]=-1,l=-1;return[3,5];case 4:u=_state.sent();if(_instanceof(u,nn))throw u;return[2,-1];case 5:return[3,7];case 6:s=JSON.parse(e.vars[o]),l=e.vars[a];_state.label=7;case 7:c=l+1;if(c>=s.length)return[2,0];d=s[c];return[2,(e.vars[a]=c,t?s5(e,t,d):H9(e,d),1)]}})})()}function Bmt(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l,c,p,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=e.fs;if(!n||!e.cwd)return[2,-1];Sl(e,"getline file source");return[4,wn(e,"getline filename evaluation",function(){return hr(e,r)})];case 1:i=ti.apply(void 0,[_state.sent()]);if(i==="/dev/null")return[2,0];o=n.resolvePath(e.cwd,i),a="__fc_".concat(o),s="__fi_".concat(o);if(!(e.vars[a]===void 0))return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,wn(e,"getline file read",function(){return n.readFile(o)})];case 3:l=_state.sent().split("\n"),l.length>0&&l[l.length-1]===""&&l.pop(),e.vars[a]=JSON.stringify(l),e.vars[s]=-1,c=-1;return[3,5];case 4:p=_state.sent();if(_instanceof(p,nn))throw p;return[2,-1];case 5:return[3,7];case 6:l=JSON.parse(e.vars[a]),c=e.vars[s];_state.label=7;case 7:d=c+1;if(d>=l.length)return[2,0];u=l[d];return[2,(e.vars[s]=d,t?s5(e,t,u):H9(e,u),1)]}})})()}function qmt(e,t){return _async_to_generator(function(){var _loop,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_loop=function(r){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,wn(e,"tuple intermediate element",function(){return hr(e,t[r])})];case 1:_state.sent();return[2]}})};if(Sl(e,"tuple evaluation"),t.length===0)return[2,""];r=0;_state.label=1;case 1:if(!(r<t.length-1))return[3,4];return[5,_ts_values(_loop(r))];case 2:_state.sent();_state.label=3;case 3:r++;return[3,1];case 4:return[2,wn(e,"tuple final element",function(){return hr(e,t[t.length-1])})]}})})()}var fV,B4e=se(function(){"use strict";kr(),jr(),Ei(),Ff(),td(),Xft(),L4e(),cV(),a5(),U4e(),fV=null});function mV(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new Qt("awk: output size limit exceeded (".concat(e.maxOutputSize," bytes)"),"string_length",e.output)}function rd(e,t){yl(e.requireDefenseContext,"awk",t)}function hn(e,t,r){return Wh(e.requireDefenseContext,"awk",t,r)}function WS(e,t){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,_ret,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"block execution");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_step.value;return[4,hn(e,"statement execution",function(){return o1(e,r)})];case 1:if(_state.sent(),Wmt(e))return[2,"break"];return[2]}})};_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_ret==="break")return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2]}})})()}function Wmt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}function o1(e,t){return _async_to_generator(function(){var r,_,n,_tmp,_10,n10,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=(rd(e,"single statement execution"),(r=e.coverage)==null||r.hit("awk:stmt:".concat(t.type)),t.type);switch(_){case"block":return[3,1];case"expr_stmt":return[3,3];case"print":return[3,5];case"printf":return[3,7];case"if":return[3,9];case"while":return[3,11];case"do_while":return[3,13];case"for":return[3,15];case"for_in":return[3,17];case"break":return[3,19];case"continue":return[3,20];case"next":return[3,21];case"nextfile":return[3,22];case"exit":return[3,23];case"return":return[3,27];case"delete":return[3,31]}return[3,33];case 1:return[4,hn(e,"nested block statement",function(){return WS(e,t.statements)})];case 2:_state.sent();return[3,33];case 3:return[4,hn(e,"expression statement",function(){return hr(e,t.expression)})];case 4:_state.sent();return[3,33];case 5:return[4,hn(e,"print statement",function(){return Vmt(e,t.args,t.output)})];case 6:_state.sent();return[3,33];case 7:return[4,hn(e,"printf statement",function(){return Gmt(e,t.format,t.args,t.output)})];case 8:_state.sent();return[3,33];case 9:return[4,hn(e,"if statement",function(){return Hmt(e,t)})];case 10:_state.sent();return[3,33];case 11:return[4,hn(e,"while statement",function(){return Zmt(e,t)})];case 12:_state.sent();return[3,33];case 13:return[4,hn(e,"do-while statement",function(){return Kmt(e,t)})];case 14:_state.sent();return[3,33];case 15:return[4,hn(e,"for statement",function(){return Qmt(e,t)})];case 16:_state.sent();return[3,33];case 17:return[4,hn(e,"for-in statement",function(){return Jmt(e,t)})];case 18:_state.sent();return[3,33];case 19:e.loopBreak=!0;return[3,33];case 20:e.loopContinue=!0;return[3,33];case 21:e.shouldNext=!0;return[3,33];case 22:e.shouldNextFile=!0;return[3,33];case 23:e.shouldExit=!0;n=t.code;if(!n)return[3,25];_10=Math.floor;return[4,hn(e,"exit code expression",function(){return hr(e,n)})];case 24:_tmp=_10.apply(Math,[_o.apply(void 0,[_state.sent()])]);return[3,26];case 25:_tmp=0;_state.label=26;case 26:e.exitCode=_tmp;return[3,33];case 27:e.hasReturn=!0;n10=t.value;if(!n10)return[3,29];return[4,hn(e,"return expression",function(){return hr(e,n10)})];case 28:_tmp1=_state.sent();return[3,30];case 29:_tmp1="";_state.label=30;case 30:e.returnValue=_tmp1;return[3,33];case 31:return[4,hn(e,"delete statement",function(){return Ymt(e,t.target)})];case 32:_state.sent();return[3,33];case 33:return[2]}})})()}function Vmt(e,t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,err,i,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"print execution");n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=_step.value;return[4,hn(e,"print argument evaluation",function(){return hr(e,o)})];case 1:a=_state.sent();typeof a=="number"?Number.isInteger(a)&&Math.abs(a)<Number.MAX_SAFE_INTEGER?n.push(String(a)):n.push(lV(e.OFMT,[a])):n.push(ti(a));return[2]}})};_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:i=n.join(e.OFS)+e.ORS;if(!r)return[3,10];return[4,hn(e,"print redirection write",function(){return q4e(e,r.redirect,r.file,i)})];case 9:_tmp=_state.sent();return[3,11];case 10:_tmp=(e.output+=i,mV(e));_state.label=11;case 11:_tmp;return[2]}})})()}function Gmt(e,t,r,n){return _async_to_generator(function(){var i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,err,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"printf execution");return[4,hn(e,"printf format evaluation",function(){return hr(e,t)})];case 1:i=ti.apply(void 0,[_state.sent()]),o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_loop=function(){var s,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=_step.value;_=o.push;return[4,hn(e,"printf argument evaluation",function(){return hr(e,s)})];case 1:_.apply(o,[_state.sent()]);return[2]}})};_iterator=r[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];return[5,_ts_values(_loop())];case 4:_state.sent();_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:a=lV(i,o);if(!n)return[3,11];return[4,hn(e,"printf redirection write",function(){return q4e(e,n.redirect,n.file,a)})];case 10:_tmp=_state.sent();return[3,12];case 11:_tmp=(e.output+=a,mV(e));_state.label=12;case 12:_tmp;return[2]}})})()}function q4e(e,t,r,n){return _async_to_generator(function(){var i,o,a,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"file write execution");i=e.fs;if(!i||!e.cwd){e.output+=n,mV(e);return[2]}return[4,hn(e,"redirection filename evaluation",function(){return hr(e,r)})];case 1:o=ti.apply(void 0,[_state.sent()]),a=i.resolvePath(e.cwd,o);if(!(t===">"))return[3,6];if(!e.openedFiles.has(a))return[3,3];return[4,hn(e,"redirection append write",function(){return i.appendFile(a,n)})];case 2:_tmp1=_state.sent();return[3,5];case 3:return[4,hn(e,"redirection overwrite write",function(){return i.writeFile(a,n)})];case 4:_tmp1=(_state.sent(),e.openedFiles.add(a));_state.label=5;case 5:_tmp=_tmp1;return[3,8];case 6:e.openedFiles.has(a)||e.openedFiles.add(a);return[4,hn(e,"redirection append mode write",function(){return i.appendFile(a,n)})];case 7:_tmp=_state.sent();_state.label=8;case 8:_tmp;return[2]}})})()}function Hmt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"if execution");return[4,hn(e,"if condition evaluation",function(){return hr(e,t.condition)})];case 1:if(!ec.apply(void 0,[_state.sent()]))return[3,3];return[4,hn(e,"if consequent execution",function(){return o1(e,t.consequent)})];case 2:_state.sent();return[3,5];case 3:if(!t.alternate)return[3,5];r=t.alternate;return[4,hn(e,"if alternate execution",function(){return o1(e,r)})];case 4:_state.sent();_state.label=5;case 5:return[2]}})})()}function Zmt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"while execution");r=0;_state.label=1;case 1:return[4,hn(e,"while condition evaluation",function(){return hr(e,t.condition)})];case 2:if(!ec.apply(void 0,[_state.sent()]))return[3,5];if(r++,r>e.maxIterations)throw new Qt("awk: while loop exceeded maximum iterations (".concat(e.maxIterations,")"),"iterations",e.output);e.loopContinue=!1;return[4,hn(e,"while body execution",function(){return o1(e,t.body)})];case 3:if(_state.sent(),e.loopBreak){e.loopBreak=!1;return[3,5]}if(e.shouldExit||e.shouldNext||e.hasReturn)return[3,5];_state.label=4;case 4:return[3,1];case 5:return[2]}})})()}function Kmt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"do-while execution");r=0;_state.label=1;case 1:if(r++,r>e.maxIterations)throw new Qt("awk: do-while loop exceeded maximum iterations (".concat(e.maxIterations,")"),"iterations",e.output);e.loopContinue=!1;return[4,hn(e,"do-while body execution",function(){return o1(e,t.body)})];case 2:if(_state.sent(),e.loopBreak){e.loopBreak=!1;return[3,5]}if(e.shouldExit||e.shouldNext||e.hasReturn)return[3,5];_state.label=3;case 3:return[4,hn(e,"do-while condition evaluation",function(){return hr(e,t.condition)})];case 4:if(ec.apply(void 0,[_state.sent()]))return[3,1];_state.label=5;case 5:return[2]}})})()}function Qmt(e,t){return _async_to_generator(function(){var r,n,i,_tmp,o,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"for execution");r=t.init,n=t.condition,i=t.update;_tmp=r;if(!_tmp)return[3,2];return[4,hn(e,"for init evaluation",function(){return hr(e,r)})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;o=0;_state.label=3;case 3:_tmp1=!n;if(_tmp1)return[3,5];return[4,hn(e,"for condition evaluation",function(){return hr(e,n)})];case 4:_tmp1=ec.apply(void 0,[_state.sent()]);_state.label=5;case 5:if(!_tmp1)return[3,10];if(o++,o>e.maxIterations)throw new Qt("awk: for loop exceeded maximum iterations (".concat(e.maxIterations,")"),"iterations",e.output);e.loopContinue=!1;return[4,hn(e,"for body execution",function(){return o1(e,t.body)})];case 6:if(_state.sent(),e.loopBreak){e.loopBreak=!1;return[3,10]}if(e.shouldExit||e.shouldNext||e.hasReturn)return[3,10];_tmp2=i;if(!_tmp2)return[3,8];return[4,hn(e,"for update evaluation",function(){return hr(e,i)})];case 7:_tmp2=_state.sent();_state.label=8;case 8:_tmp2;_state.label=9;case 9:return[3,3];case 10:return[2]}})})()}function Jmt(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:rd(e,"for-in execution");r=e.arrays[t.array];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!r)return[3,8];_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=Object.keys(r)[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];n=_step.value;e.vars[t.variable]=n,e.loopContinue=!1;return[4,hn(e,"for-in body execution",function(){return o1(e,t.body)})];case 3:if(_state.sent(),e.loopBreak){e.loopBreak=!1;return[3,5]}if(e.shouldExit||e.shouldNext||e.hasReturn)return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2]}})})()}function Ymt(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(rd(e,"delete execution"),t.type==="array_access"))return[3,2];return[4,hn(e,"delete key evaluation",function(){return hr(e,t.key)})];case 1:r=ti.apply(void 0,[_state.sent()]);Smt(e,t.array,r);return[3,3];case 2:t.type==="variable"&&kmt(e,t.name);_state.label=3;case 3:return[2]}})})()}var Xmt=se(function(){"use strict";jr(),Ff(),L4e(),B4e(),a5(),U4e(),Cmt(WS)}),W4e,eht=se(function(){"use strict";Ff(),B4e(),cV(),Xmt(),a5(),W4e=/*#__PURE__*/function(){function W4e1(e){_class_call_check(this,W4e1);A(this,"ctx");A(this,"program",null);A(this,"rangeStates",[]);this.ctx=e}_create_class(W4e1,[{key:"assertDefenseContext",value:function assertDefenseContext(e){yl(this.ctx.requireDefenseContext,"awk",e)}},{key:"withDefenseContext",value:function withDefenseContext(e,t){return Wh(this.ctx.requireDefenseContext,"awk",e,t)}},{key:"execute",value:function execute(e){this.assertDefenseContext("program initialization"),this.program=e,this.ctx.output="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.functions[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;this.ctx.functions.set(t.name,t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.rangeStates=e.rules.map(function(){return!1})}},{key:"executeBegin",value:function executeBegin(){return _async_to_generator(function(){var _this,e,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_this1,_loop,_iterator,_step,_ret,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!(this.assertDefenseContext("BEGIN execution entry"),!!this.program))return[3,8];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var t,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_step.value;_tmp=((e=t.pattern)==null?void 0:e.type)==="begin";if(!_tmp)return[3,2];return[4,_this1.withDefenseContext("BEGIN block execution",function(){return WS(_this.ctx,t.action.statements)})];case 1:_tmp=(_state.sent(),_this1.ctx.shouldExit);_state.label=2;case 2:if(_tmp)return[2,"break"];return[2]}})};_iterator=this.program.rules[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];_this1=this;return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_ret==="break")return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2]}})}).call(this)}},{key:"executeLine",value:function executeLine(e){return _async_to_generator(function(){var _this,t,r,_this1,_loop,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!(this.assertDefenseContext("line execution entry"),!(!this.program||this.ctx.shouldExit)))return[3,4];_loop=function(n){var i,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=_this1.program.rules[n];_tmp=((t=i.pattern)==null?void 0:t.type)==="begin"||((r=i.pattern)==null?void 0:r.type)==="end";if(_tmp)return[3,4];return[4,_this1.withDefenseContext("rule match",function(){return _this.matchesRule(i,n)})];case 1:_tmp1=_state.sent();if(!_tmp1)return[3,3];return[4,_this1.withDefenseContext("rule block execution",function(){return WS(_this.ctx,i.action.statements)})];case 2:_tmp1=_state.sent();_state.label=3;case 3:_tmp=_tmp1;_state.label=4;case 4:_tmp;return[2]}})};H9(this.ctx,e),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;n=0;_state.label=1;case 1:if(!(n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile)))return[3,4];_this1=this;return[5,_ts_values(_loop(n))];case 2:_state.sent();_state.label=3;case 3:n++;return[3,1];case 4:return[2]}})}).call(this)}},{key:"executeEnd",value:function executeEnd(){return _async_to_generator(function(){var _this,e,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_this1,_loop,_iterator,_step,_ret,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!(this.assertDefenseContext("END execution entry"),!!this.program&&!this.ctx.inEndBlock))return[3,9];this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var t,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_step.value;_tmp=((e=t.pattern)==null?void 0:e.type)==="end";if(!_tmp)return[3,2];return[4,_this1.withDefenseContext("END block execution",function(){return WS(_this.ctx,t.action.statements)})];case 1:_tmp=(_state.sent(),_this1.ctx.shouldExit);_state.label=2;case 2:if(_tmp)return[2,"break"];return[2]}})};_iterator=this.program.rules[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];_this1=this;return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_ret==="break")return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:this.ctx.inEndBlock=!1;_state.label=9;case 9:return[2]}})}).call(this)}},{key:"getOutput",value:function getOutput(){return this.ctx.output}},{key:"getExitCode",value:function getExitCode(){return this.ctx.exitCode}},{key:"getContext",value:function getContext(){return this.ctx}},{key:"matchesRule",value:function matchesRule(e,t){return _async_to_generator(function(){var _this,r,_,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.assertDefenseContext("rule matching");r=e.pattern;if(!r)return[2,!0];_=r.type;switch(_){case"begin":return[3,1];case"end":return[3,1];case"regex_pattern":return[3,2];case"expr_pattern":return[3,3];case"range":return[3,5]}return[3,8];case 1:return[2,!1];case 2:return[2,lW(r.pattern,this.ctx.line)];case 3:return[4,this.withDefenseContext("expression pattern evaluation",function(){return hr(_this.ctx,r.expression)})];case 4:return[2,ec.apply(void 0,[_state.sent()])];case 5:return[4,this.withDefenseContext("range start pattern",function(){return _this.matchPattern(r.start)})];case 6:n=_state.sent();return[4,this.withDefenseContext("range end pattern",function(){return _this.matchPattern(r.end)})];case 7:i=_state.sent();return[2,this.rangeStates[t]?(i&&(this.rangeStates[t]=!1),!0):n?(this.rangeStates[t]=!0,i&&(this.rangeStates[t]=!1),!0):!1];case 8:return[2,!1];case 9:return[2]}})}).call(this)}},{key:"matchPattern",value:function matchPattern(e){return _async_to_generator(function(){var _this,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_=(this.assertDefenseContext("pattern matching"),e.type);switch(_){case"regex_pattern":return[3,1];case"expr_pattern":return[3,2]}return[3,4];case 1:return[2,lW(e.pattern,this.ctx.line)];case 2:return[4,this.withDefenseContext("nested expression pattern",function(){return hr(_this.ctx,e.expression)})];case 3:return[2,ec.apply(void 0,[_state.sent()])];case 4:return[2,!1];case 5:return[2]}})}).call(this)}}]);return W4e1}()}),tht=se(function(){"use strict";Jft(),eht()});function rht(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var W,y2e,v2e,V4e,nht=se(function(){"use strict";(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(W||(W={})),y2e=new Map([["BEGIN",W.BEGIN],["END",W.END],["if",W.IF],["else",W.ELSE],["while",W.WHILE],["do",W.DO],["for",W.FOR],["in",W.IN],["break",W.BREAK],["continue",W.CONTINUE],["next",W.NEXT],["nextfile",W.NEXTFILE],["exit",W.EXIT],["return",W.RETURN],["delete",W.DELETE],["function",W.FUNCTION],["print",W.PRINT],["printf",W.PRINTF],["getline",W.GETLINE]]),v2e=new Set([W.COMMA,W.LBRACE,W.AND,W.OR,W.QUESTION,W.COLON,W.DO,W.ELSE,W.IF,W.WHILE]),V4e=/*#__PURE__*/function(){function V4e1(e){_class_call_check(this,V4e1);A(this,"input");A(this,"pos",0);A(this,"line",1);A(this,"column",1);A(this,"lastTokenType",null);this.input=e}_create_class(V4e1,[{key:"tokenize",value:function tokenize(){var e=[];for(;this.pos<this.input.length;){var t=this.nextToken();t&&(e.push(t),this.lastTokenType=t.type)}return e.push(this.makeToken(W.EOF,"")),e}},{key:"makeToken",value:function makeToken(e,t){return{type:e,value:t,line:this.line,column:this.column}}},{key:"peek",value:function peek(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.input[this.pos+e]||""}},{key:"advance",value:function advance(){var e=this.input[this.pos++]||"";return e==="\n"?(this.line++,this.column=1):this.column++,e}},{key:"skipWhitespace",value:function skipWhitespace(){for(;this.pos<this.input.length;){var e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="\\")if(this.peek(1)==="\n")this.advance(),this.advance();else break;else if(e==="#")for(;this.pos<this.input.length&&this.peek()!=="\n";)this.advance();else break}}},{key:"nextToken",value:function nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;var e=this.line,t=this.column,r=this.peek();return r==="\n"?(this.advance(),this.lastTokenType!==null&&v2e.has(this.lastTokenType)?this.nextToken():{type:W.NEWLINE,value:"\n",line:e,column:t}):r==='"'?this.readString():r==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(r)||r==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(r)||r==="_"?this.readIdentifier():this.readOperator()}},{key:"canBeRegex",value:function canBeRegex(){return new Set([null,W.NEWLINE,W.SEMICOLON,W.LBRACE,W.RBRACE,W.LPAREN,W.LBRACKET,W.COMMA,W.ASSIGN,W.PLUS_ASSIGN,W.MINUS_ASSIGN,W.STAR_ASSIGN,W.SLASH_ASSIGN,W.PERCENT_ASSIGN,W.CARET_ASSIGN,W.AND,W.OR,W.NOT,W.MATCH,W.NOT_MATCH,W.QUESTION,W.COLON,W.LT,W.GT,W.LE,W.GE,W.EQ,W.NE,W.PLUS,W.MINUS,W.STAR,W.PERCENT,W.CARET,W.PRINT,W.PRINTF,W.IF,W.WHILE,W.DO,W.FOR,W.RETURN]).has(this.lastTokenType)}},{key:"readString",value:function readString(){var e=this.line,t=this.column;this.advance();var r="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();var n=this.advance();switch(n){case"n":r+="\n";break;case"t":r+=" ";break;case"r":r+="\r";break;case"f":r+="\f";break;case"b":r+="\b";break;case"v":r+="\v";break;case"a":r+="\x07";break;case"\\":r+="\\";break;case'"':r+='"';break;case"/":r+="/";break;case"x":{var i="";for(;i.length<2&&/[0-9a-fA-F]/.test(this.peek());)i+=this.advance();i.length>0?r+=String.fromCharCode(parseInt(i,16)):r+="x";break}default:if(/[0-7]/.test(n)){var i10=n;for(;i10.length<3&&/[0-7]/.test(this.peek());)i10+=this.advance();r+=String.fromCharCode(parseInt(i10,8))}else r+=n}}else r+=this.advance();return this.peek()==='"'&&this.advance(),{type:W.STRING,value:r,line:e,column:t}}},{key:"readRegex",value:function readRegex(){var e=this.line,t=this.column;this.advance();var r="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")r+=this.advance(),this.pos<this.input.length&&(r+=this.advance());else{if(this.peek()==="\n")break;r+=this.advance()}return this.peek()==="/"&&this.advance(),r=rht(r),{type:W.REGEX,value:r,line:e,column:t}}},{key:"readNumber",value:function readNumber(){var e=this.line,t=this.column,r="";for(;this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(r+=this.advance();this.isDigit(this.peek());)r+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(r+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(r+=this.advance());this.isDigit(this.peek());)r+=this.advance();return{type:W.NUMBER,value:parseFloat(r),line:e,column:t}}},{key:"readIdentifier",value:function readIdentifier(){var e=this.line,t=this.column,r="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)r+=this.advance();var n=y2e.get(r);return n!==void 0?{type:n,value:r,line:e,column:t}:{type:W.IDENT,value:r,line:e,column:t}}},{key:"readOperator",value:function readOperator(){var e=this.line,t=this.column,r=this.advance(),n=this.peek();switch(r){case"+":return n==="+"?(this.advance(),{type:W.INCREMENT,value:"++",line:e,column:t}):n==="="?(this.advance(),{type:W.PLUS_ASSIGN,value:"+=",line:e,column:t}):{type:W.PLUS,value:"+",line:e,column:t};case"-":return n==="-"?(this.advance(),{type:W.DECREMENT,value:"--",line:e,column:t}):n==="="?(this.advance(),{type:W.MINUS_ASSIGN,value:"-=",line:e,column:t}):{type:W.MINUS,value:"-",line:e,column:t};case"*":return n==="*"?(this.advance(),{type:W.CARET,value:"**",line:e,column:t}):n==="="?(this.advance(),{type:W.STAR_ASSIGN,value:"*=",line:e,column:t}):{type:W.STAR,value:"*",line:e,column:t};case"/":return n==="="?(this.advance(),{type:W.SLASH_ASSIGN,value:"/=",line:e,column:t}):{type:W.SLASH,value:"/",line:e,column:t};case"%":return n==="="?(this.advance(),{type:W.PERCENT_ASSIGN,value:"%=",line:e,column:t}):{type:W.PERCENT,value:"%",line:e,column:t};case"^":return n==="="?(this.advance(),{type:W.CARET_ASSIGN,value:"^=",line:e,column:t}):{type:W.CARET,value:"^",line:e,column:t};case"=":return n==="="?(this.advance(),{type:W.EQ,value:"==",line:e,column:t}):{type:W.ASSIGN,value:"=",line:e,column:t};case"!":return n==="="?(this.advance(),{type:W.NE,value:"!=",line:e,column:t}):n==="~"?(this.advance(),{type:W.NOT_MATCH,value:"!~",line:e,column:t}):{type:W.NOT,value:"!",line:e,column:t};case"<":return n==="="?(this.advance(),{type:W.LE,value:"<=",line:e,column:t}):{type:W.LT,value:"<",line:e,column:t};case">":return n==="="?(this.advance(),{type:W.GE,value:">=",line:e,column:t}):n===">"?(this.advance(),{type:W.APPEND,value:">>",line:e,column:t}):{type:W.GT,value:">",line:e,column:t};case"&":return n==="&"?(this.advance(),{type:W.AND,value:"&&",line:e,column:t}):{type:W.IDENT,value:"&",line:e,column:t};case"|":return n==="|"?(this.advance(),{type:W.OR,value:"||",line:e,column:t}):{type:W.PIPE,value:"|",line:e,column:t};case"~":return{type:W.MATCH,value:"~",line:e,column:t};case"?":return{type:W.QUESTION,value:"?",line:e,column:t};case":":return{type:W.COLON,value:":",line:e,column:t};case",":return{type:W.COMMA,value:",",line:e,column:t};case";":return{type:W.SEMICOLON,value:";",line:e,column:t};case"(":return{type:W.LPAREN,value:"(",line:e,column:t};case")":return{type:W.RPAREN,value:")",line:e,column:t};case"{":return{type:W.LBRACE,value:"{",line:e,column:t};case"}":return{type:W.RBRACE,value:"}",line:e,column:t};case"[":return{type:W.LBRACKET,value:"[",line:e,column:t};case"]":return{type:W.RBRACKET,value:"]",line:e,column:t};case"$":return{type:W.DOLLAR,value:"$",line:e,column:t};default:return{type:W.IDENT,value:r,line:e,column:t}}}},{key:"isDigit",value:function isDigit(e){return e>="0"&&e<="9"}},{key:"isAlpha",value:function isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}},{key:"isAlphaNumeric",value:function isAlphaNumeric(e){return this.isDigit(e)||this.isAlpha(e)}}]);return V4e1}()});function iht(e){e.expect(bt.PRINT);var t=[];if(e.check(bt.NEWLINE)||e.check(bt.SEMICOLON)||e.check(bt.RBRACE)||e.check(bt.PIPE)||e.check(bt.GT)||e.check(bt.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(P9(e));e.check(bt.COMMA);)e.advance(),t.push(P9(e));var r;return e.check(bt.GT)?(e.advance(),r={redirect:">",file:e.parsePrimary()}):e.check(bt.APPEND)&&(e.advance(),r={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:r}}function P9(e){return oht(e)?uW(e,!0):uW(e,!1)}function uW(e,t){var n;var r=t?e.parseTernary():aht(e);if(e.match(bt.ASSIGN,bt.PLUS_ASSIGN,bt.MINUS_ASSIGN,bt.STAR_ASSIGN,bt.SLASH_ASSIGN,bt.PERCENT_ASSIGN,bt.CARET_ASSIGN)){var i=e.advance(),o=uW(e,t);if(r.type!=="variable"&&r.type!=="field"&&r.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:(n=new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value))!=null?n:"=",target:r,value:o}}return r}function oht(e){var t=0,r=e.pos;for(;r<e.tokens.length;){var n=e.tokens[r];if(n.type===bt.LPAREN&&t++,n.type===bt.RPAREN&&t--,n.type===bt.QUESTION&&t===0)return!0;if(n.type===bt.NEWLINE||n.type===bt.SEMICOLON||n.type===bt.RBRACE||n.type===bt.COMMA||n.type===bt.PIPE)return!1;r++}return!1}function aht(e){var t=_2e(e);for(;e.check(bt.OR);){e.advance();var r=_2e(e);t={type:"binary",operator:"||",left:t,right:r}}return t}function _2e(e){var t=b2e(e);for(;e.check(bt.AND);){e.advance();var r=b2e(e);t={type:"binary",operator:"&&",left:t,right:r}}return t}function b2e(e){var t=sht(e);if(e.check(bt.IN)){e.advance();var r=String(e.expect(bt.IDENT).value);return{type:"in",key:t,array:r}}return t}function sht(e){var t=w2e(e);for(;lht(e)&&!uht(e);){var r=w2e(e);t={type:"binary",operator:" ",left:t,right:r}}return t}function w2e(e){var t=S2e(e);for(;e.match(bt.MATCH,bt.NOT_MATCH);){var r=e.advance().type===bt.MATCH?"~":"!~",n=S2e(e);t={type:"binary",operator:r,left:t,right:n}}return t}function S2e(e){var r;var t=e.parseAddSub();for(;e.match(bt.LT,bt.LE,bt.GE,bt.EQ,bt.NE);){var n=e.advance(),i=e.parseAddSub();t={type:"binary",operator:(r=new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value))!=null?r:"==",left:t,right:i}}return t}function lht(e){return e.match(bt.NUMBER,bt.STRING,bt.IDENT,bt.DOLLAR,bt.LPAREN,bt.NOT,bt.MINUS,bt.PLUS,bt.INCREMENT,bt.DECREMENT)}function uht(e){return e.match(bt.AND,bt.OR,bt.QUESTION,bt.ASSIGN,bt.PLUS_ASSIGN,bt.MINUS_ASSIGN,bt.STAR_ASSIGN,bt.SLASH_ASSIGN,bt.PERCENT_ASSIGN,bt.CARET_ASSIGN,bt.COMMA,bt.SEMICOLON,bt.NEWLINE,bt.RBRACE,bt.RPAREN,bt.RBRACKET,bt.COLON,bt.PIPE,bt.APPEND,bt.GT,bt.IN)}function cht(e){e.expect(bt.PRINTF);var t=e.check(bt.LPAREN);t&&(e.advance(),e.skipNewlines());var r=t?e.parseExpression():P9(e),n=[];for(;e.check(bt.COMMA);)e.advance(),t&&e.skipNewlines(),n.push(t?e.parseExpression():P9(e));t&&(e.skipNewlines(),e.expect(bt.RPAREN));var i;return e.check(bt.GT)?(e.advance(),i={redirect:">",file:e.parsePrimary()}):e.check(bt.APPEND)&&(e.advance(),i={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:r,args:n,output:i}}var bt,dht=se(function(){"use strict";bt={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"}}),G4e,pht=se(function(){"use strict";nht(),dht(),G4e=/*#__PURE__*/function(){function G4e1(){_class_call_check(this,G4e1);A(this,"tokens",[]);A(this,"pos",0)}_create_class(G4e1,[{key:"parse",value:function parse(e){var t=new V4e(e);return this.tokens=t.tokenize(),this.pos=0,this.parseProgram()}},{key:"setPos",value:function setPos(e){this.pos=e}},{key:"current",value:function current(){return this.tokens[this.pos]||{type:W.EOF,value:"",line:0,column:0}}},{key:"advance",value:function advance(){var e=this.current();return this.pos<this.tokens.length&&this.pos++,e}},{key:"match",value:function match(){for(var _len=arguments.length,e=new Array(_len),_key=0;_key<_len;_key++){e[_key]=arguments[_key]}return e.includes(this.current().type)}},{key:"check",value:function check(e){return this.current().type===e}},{key:"expect",value:function expect(e,t){if(!this.check(e)){var r=this.current();throw new Error(t||"Expected ".concat(e,", got ").concat(r.type," at line ").concat(r.line,":").concat(r.column))}return this.advance()}},{key:"skipNewlines",value:function skipNewlines(){for(;this.check(W.NEWLINE);)this.advance()}},{key:"skipTerminators",value:function skipTerminators(){for(;this.check(W.NEWLINE)||this.check(W.SEMICOLON);)this.advance()}},{key:"parseProgram",value:function parseProgram(){var e=[],t=[];for(this.skipNewlines();!this.check(W.EOF)&&(this.skipNewlines(),!this.check(W.EOF));)this.check(W.FUNCTION)?e.push(this.parseFunction()):t.push(this.parseRule()),this.skipTerminators();return{functions:e,rules:t}}},{key:"parseFunction",value:function parseFunction(){this.expect(W.FUNCTION);var e=this.expect(W.IDENT).value;this.expect(W.LPAREN);var t=[];if(!this.check(W.RPAREN))for(t.push(this.expect(W.IDENT).value);this.check(W.COMMA);)this.advance(),t.push(this.expect(W.IDENT).value);this.expect(W.RPAREN),this.skipNewlines();var r=this.parseBlock();return{name:e,params:t,body:r}}},{key:"parseRule",value:function parseRule(){var e;if(this.check(W.BEGIN))this.advance(),e={type:"begin"};else if(this.check(W.END))this.advance(),e={type:"end"};else if(this.check(W.LBRACE))e=void 0;else if(this.check(W.REGEX)){var r=this.advance();if(this.check(W.AND)||this.check(W.OR)){var n={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:r.value}};e={type:"expr_pattern",expression:this.parseLogicalOrRest(n)}}else{var n10={type:"regex_pattern",pattern:r.value};if(this.check(W.COMMA)){this.advance();var i;this.check(W.REGEX)?i={type:"regex_pattern",pattern:this.advance().value}:i={type:"expr_pattern",expression:this.parseExpression()},e={type:"range",start:n10,end:i}}else e=n10}}else{var r10={type:"expr_pattern",expression:this.parseExpression()};if(this.check(W.COMMA)){this.advance();var n11;this.check(W.REGEX)?n11={type:"regex_pattern",pattern:this.advance().value}:n11={type:"expr_pattern",expression:this.parseExpression()},e={type:"range",start:r10,end:n11}}else e=r10}this.skipNewlines();var t;return this.check(W.LBRACE)?t=this.parseBlock():t={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:e,action:t}}},{key:"parseBlock",value:function parseBlock(){this.expect(W.LBRACE),this.skipNewlines();var e=[];for(;!this.check(W.RBRACE)&&!this.check(W.EOF);)e.push(this.parseStatement()),this.skipTerminators();return this.expect(W.RBRACE),{type:"block",statements:e}}},{key:"parseStatement",value:function parseStatement(){if(this.check(W.SEMICOLON)||this.check(W.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(W.LBRACE))return this.parseBlock();if(this.check(W.IF))return this.parseIf();if(this.check(W.WHILE))return this.parseWhile();if(this.check(W.DO))return this.parseDoWhile();if(this.check(W.FOR))return this.parseFor();if(this.check(W.BREAK))return this.advance(),{type:"break"};if(this.check(W.CONTINUE))return this.advance(),{type:"continue"};if(this.check(W.NEXT))return this.advance(),{type:"next"};if(this.check(W.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(W.EXIT)){this.advance();var e;return!this.check(W.NEWLINE)&&!this.check(W.SEMICOLON)&&!this.check(W.RBRACE)&&!this.check(W.EOF)&&(e=this.parseExpression()),{type:"exit",code:e}}if(this.check(W.RETURN)){this.advance();var e10;return!this.check(W.NEWLINE)&&!this.check(W.SEMICOLON)&&!this.check(W.RBRACE)&&!this.check(W.EOF)&&(e10=this.parseExpression()),{type:"return",value:e10}}if(this.check(W.DELETE)){this.advance();var e11=this.parsePrimary();if(e11.type!=="array_access"&&e11.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:e11}}return this.check(W.PRINT)?iht(this):this.check(W.PRINTF)?cht(this):{type:"expr_stmt",expression:this.parseExpression()}}},{key:"parseIf",value:function parseIf(){this.expect(W.IF),this.expect(W.LPAREN);var e=this.parseExpression();this.expect(W.RPAREN),this.skipNewlines();var t=this.parseStatement();this.skipTerminators();var r;return this.check(W.ELSE)&&(this.advance(),this.skipNewlines(),r=this.parseStatement()),{type:"if",condition:e,consequent:t,alternate:r}}},{key:"parseWhile",value:function parseWhile(){this.expect(W.WHILE),this.expect(W.LPAREN);var e=this.parseExpression();this.expect(W.RPAREN),this.skipNewlines();var t=this.parseStatement();return{type:"while",condition:e,body:t}}},{key:"parseDoWhile",value:function parseDoWhile(){this.expect(W.DO),this.skipNewlines();var e=this.parseStatement();this.skipNewlines(),this.expect(W.WHILE),this.expect(W.LPAREN);var t=this.parseExpression();return this.expect(W.RPAREN),{type:"do_while",body:e,condition:t}}},{key:"parseFor",value:function parseFor(){if(this.expect(W.FOR),this.expect(W.LPAREN),this.check(W.IDENT)){var i=this.advance();if(this.check(W.IN)){this.advance();var o=this.expect(W.IDENT).value;this.expect(W.RPAREN),this.skipNewlines();var a=this.parseStatement();return{type:"for_in",variable:i.value,array:o,body:a}}this.pos--}var e;this.check(W.SEMICOLON)||(e=this.parseExpression()),this.expect(W.SEMICOLON);var t;this.check(W.SEMICOLON)||(t=this.parseExpression()),this.expect(W.SEMICOLON);var r;this.check(W.RPAREN)||(r=this.parseExpression()),this.expect(W.RPAREN),this.skipNewlines();var n=this.parseStatement();return{type:"for",init:e,condition:t,update:r,body:n}}},{key:"parseExpression",value:function parseExpression(){return this.parseAssignment()}},{key:"parseAssignment",value:function parseAssignment(){var e=this.parseTernary();if(this.match(W.ASSIGN,W.PLUS_ASSIGN,W.MINUS_ASSIGN,W.STAR_ASSIGN,W.SLASH_ASSIGN,W.PERCENT_ASSIGN,W.CARET_ASSIGN)){var t=this.advance(),r=this.parseAssignment();if(e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid assignment target");var n=new Set(["=","+=","-=","*=","/=","%=","^="]),i=t.value;if(!n.has(i))throw new Error("Unknown assignment operator: ".concat(i));return{type:"assignment",operator:i,target:e,value:r}}return e}},{key:"parseTernary",value:function parseTernary(){var e=this.parsePipeGetline();if(this.check(W.QUESTION)){this.advance();var t=this.parseExpression();this.expect(W.COLON);var r=this.parseExpression();e={type:"ternary",condition:e,consequent:t,alternate:r}}return e}},{key:"parsePipeGetline",value:function parsePipeGetline(){var e=this.parseOr();if(this.check(W.PIPE)){if(this.advance(),!this.check(W.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();var t;return this.check(W.IDENT)&&(t=this.advance().value),{type:"getline",command:e,variable:t}}return e}},{key:"parseOr",value:function parseOr(){var e=this.parseAnd();for(;this.check(W.OR);){this.advance();var t=this.parseAnd();e={type:"binary",operator:"||",left:e,right:t}}return e}},{key:"parseLogicalOrRest",value:function parseLogicalOrRest(e){for(e=this.parseLogicalAndRest(e);this.check(W.OR);){this.advance();var t=this.parseAnd();e={type:"binary",operator:"||",left:e,right:t}}return e}},{key:"parseLogicalAndRest",value:function parseLogicalAndRest(e){for(;this.check(W.AND);){this.advance();var t=this.parseIn();e={type:"binary",operator:"&&",left:e,right:t}}return e}},{key:"parseAnd",value:function parseAnd(){var e=this.parseIn();for(;this.check(W.AND);){this.advance();var t=this.parseIn();e={type:"binary",operator:"&&",left:e,right:t}}return e}},{key:"parseIn",value:function parseIn(){var e=this.parseConcatenation();if(this.check(W.IN)){this.advance();var t=this.expect(W.IDENT).value;return{type:"in",key:e,array:t}}return e}},{key:"parseConcatenation",value:function parseConcatenation(){var e=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){var t=this.parseMatch();e={type:"binary",operator:" ",left:e,right:t}}return e}},{key:"parseMatch",value:function parseMatch(){var e=this.parseComparison();for(;this.match(W.MATCH,W.NOT_MATCH);){var t=this.advance().type===W.MATCH?"~":"!~",r=this.parseComparison();e={type:"binary",operator:t,left:e,right:r}}return e}},{key:"parseComparison",value:function parseComparison(){var t;var e=this.parseAddSub();for(;this.match(W.LT,W.LE,W.GT,W.GE,W.EQ,W.NE);){var r=this.advance(),n=this.parseAddSub();e={type:"binary",operator:(t=new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(r.value))!=null?t:"==",left:e,right:n}}return e}},{key:"canStartExpression",value:function canStartExpression(){return this.match(W.NUMBER,W.STRING,W.IDENT,W.DOLLAR,W.LPAREN,W.NOT,W.MINUS,W.PLUS,W.INCREMENT,W.DECREMENT)}},{key:"isConcatTerminator",value:function isConcatTerminator(){return this.match(W.AND,W.OR,W.QUESTION,W.ASSIGN,W.PLUS_ASSIGN,W.MINUS_ASSIGN,W.STAR_ASSIGN,W.SLASH_ASSIGN,W.PERCENT_ASSIGN,W.CARET_ASSIGN,W.COMMA,W.SEMICOLON,W.NEWLINE,W.RBRACE,W.RPAREN,W.RBRACKET,W.COLON,W.PIPE,W.APPEND,W.IN)}},{key:"parseAddSub",value:function parseAddSub(){var e=this.parseMulDiv();for(;this.match(W.PLUS,W.MINUS);){var t=this.advance().value,r=this.parseMulDiv();e={type:"binary",operator:t,left:e,right:r}}return e}},{key:"parseMulDiv",value:function parseMulDiv(){var t;var e=this.parseUnary();for(;this.match(W.STAR,W.SLASH,W.PERCENT);){var r=this.advance(),n=this.parseUnary();e={type:"binary",operator:(t=new Map([["*","*"],["/","/"],["%","%"]]).get(r.value))!=null?t:"*",left:e,right:n}}return e}},{key:"parseUnary",value:function parseUnary(){if(this.check(W.INCREMENT)){this.advance();var e=this.parseUnary();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:e}}:{type:"pre_increment",operand:e}}if(this.check(W.DECREMENT)){this.advance();var e10=this.parseUnary();return e10.type!=="variable"&&e10.type!=="field"&&e10.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:e10}}:{type:"pre_decrement",operand:e10}}if(this.match(W.NOT,W.MINUS,W.PLUS)){var e11=this.advance().value,t=this.parseUnary();return{type:"unary",operator:e11,operand:t}}return this.parsePower()}},{key:"parsePower",value:function parsePower(){var e=this.parsePostfix();if(this.check(W.CARET)){this.advance();var t=this.parsePower();e={type:"binary",operator:"^",left:e,right:t}}return e}},{key:"parsePostfix",value:function parsePostfix(){var e=this.parsePrimary();if(this.check(W.INCREMENT)){if(this.advance(),e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:e}}if(this.check(W.DECREMENT)){if(this.advance(),e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:e}}return e}},{key:"parseFieldIndex",value:function parseFieldIndex(){if(this.check(W.INCREMENT)){this.advance();var e=this.parseFieldIndex();return e.type!=="variable"&&e.type!=="field"&&e.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:e}}:{type:"pre_increment",operand:e}}if(this.check(W.DECREMENT)){this.advance();var e10=this.parseFieldIndex();return e10.type!=="variable"&&e10.type!=="field"&&e10.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:e10}}:{type:"pre_decrement",operand:e10}}if(this.match(W.NOT,W.MINUS,W.PLUS)){var e11=this.advance().value,t=this.parseFieldIndex();return{type:"unary",operator:e11,operand:t}}return this.parseFieldIndexPower()}},{key:"parseFieldIndexPower",value:function parseFieldIndexPower(){var e=this.parseFieldIndexPrimary();if(this.check(W.CARET)){this.advance();var t=this.parseFieldIndexPower();e={type:"binary",operator:"^",left:e,right:t}}return e}},{key:"parseFieldIndexPrimary",value:function parseFieldIndexPrimary(){if(this.check(W.NUMBER))return{type:"number",value:this.advance().value};if(this.check(W.STRING))return{type:"string",value:this.advance().value};if(this.check(W.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(W.LPAREN)){this.advance();var e=this.parseExpression();return this.expect(W.RPAREN),e}if(this.check(W.IDENT)){var e10=this.advance().value;if(this.check(W.LPAREN)){this.advance();var t=[];if(!this.check(W.RPAREN))for(t.push(this.parseExpression());this.check(W.COMMA);)this.advance(),t.push(this.parseExpression());return this.expect(W.RPAREN),{type:"call",name:e10,args:t}}if(this.check(W.LBRACKET)){this.advance();var t10=this.parseExpression();if(this.check(W.COMMA)){var r=[t10];for(;this.check(W.COMMA);)this.advance(),r.push(this.parseExpression());this.expect(W.RBRACKET);var n=r.reduce(function(i,o){return{type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:o}});return{type:"array_access",array:e10,key:n}}return this.expect(W.RBRACKET),{type:"array_access",array:e10,key:t10}}return{type:"variable",name:e10}}throw new Error("Unexpected token in field index: ".concat(this.current().type," at line ").concat(this.current().line,":").concat(this.current().column))}},{key:"parsePrimary",value:function parsePrimary(){if(this.check(W.NUMBER))return{type:"number",value:this.advance().value};if(this.check(W.STRING))return{type:"string",value:this.advance().value};if(this.check(W.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(W.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(W.LPAREN)){this.advance();var e=this.parseExpression();if(this.check(W.COMMA)){var t=[e];for(;this.check(W.COMMA);)this.advance(),t.push(this.parseExpression());return this.expect(W.RPAREN),{type:"tuple",elements:t}}return this.expect(W.RPAREN),e}if(this.check(W.GETLINE)){this.advance();var e10,t10;return this.check(W.IDENT)&&(e10=this.advance().value),this.check(W.LT)&&(this.advance(),t10=this.parsePrimary()),{type:"getline",variable:e10,file:t10}}if(this.check(W.IDENT)){var e11=this.advance().value;if(this.check(W.LPAREN)){this.advance();var t11=[];if(this.skipNewlines(),!this.check(W.RPAREN))for(t11.push(this.parseExpression());this.check(W.COMMA);)this.advance(),this.skipNewlines(),t11.push(this.parseExpression());return this.skipNewlines(),this.expect(W.RPAREN),{type:"call",name:e11,args:t11}}if(this.check(W.LBRACKET)){this.advance();var t12=[this.parseExpression()];for(;this.check(W.COMMA);)this.advance(),t12.push(this.parseExpression());this.expect(W.RBRACKET);var r;if(t12.length===1)r=t12[0];else{r=t12[0];for(var n=1;n<t12.length;n++)r={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:r,right:{type:"variable",name:"SUBSEP"}},right:t12[n]}}return{type:"array_access",array:e11,key:r}}return{type:"variable",name:e11}}throw new Error("Unexpected token: ".concat(this.current().type," at line ").concat(this.current().line,":").concat(this.current().column))}}]);return G4e1}()}),H4e={};St(H4e,{awkCommand2:function(){return Z4e},flagsForFuzzing:function(){return K4e}});function yq(e){return e.replace(/\\t/g," ").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function k2e(e){if(e===" ")return ir("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return ir(e)}catch(t){return ir(C2e(e))}return ir(C2e(e))}function C2e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var E2e,Z4e,K4e,fht=se(function(){"use strict";kr(),Vh(),jr(),Ei(),Ff(),td(),jt(),tht(),pht(),E2e={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},Z4e={name:"awk",execute:function execute(e,t){return _async_to_generator(function(){var v,y,r,n,i,o,a,_$_,b,_$w,S,k,E,_$w1,s,l,c,d,u,p,m,_$_1,h,g,x,_$_2,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_loop,_iterator,_step,_ret,err,b10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_loop1,_iterator1,_step1,_ret1,err,_,b11,_$w2;return _ts_generator(this,function(_state){switch(_state.label){case 0:yl(t.requireDefenseContext,"awk","execution entry");r=function(_,b){return Wh(t.requireDefenseContext,"awk",_,b)};if(Vt(e))return[2,Wt(E2e)];n=new V9(/\s+/),i=" ",o=Object.create(null),a=0;for(_$_=0;_$_<e.length;_$_++){b=e[_$_];if(b==="-F"&&_$_+1<e.length)i=yq(e[++_$_]),n=k2e(i),a=_$_+1;else if(b.startsWith("-F"))i=yq(b.slice(2)),n=k2e(i),a=_$_+1;else if(b==="-v"&&_$_+1<e.length){_$w=e[++_$_],S=_$w.indexOf("=");if(S>0){k=_$w.slice(0,S),E=yq(_$w.slice(S+1));o[k]=E}a=_$_+1}else{if(b.startsWith("--"))return[2,fr("awk",b)];if(b.startsWith("-")&&b.length>1){_$w1=b[1];if(_$w1!=="F"&&_$w1!=="v")return[2,fr("awk","-".concat(_$w1))];a=_$_+1}else if(!b.startsWith("-")){a=_$_;break}}}if(a>=e.length)return[2,{stdout:"",stderr:"awk: missing program\n",exitCode:1}];s=e[a],l=e.slice(a+1),c=new G4e;try{d=c.parse(s)}catch(_){return[2,{stdout:"",stderr:"awk: ".concat(_instanceof(_,Error)?_.message:String(_),"\n"),exitCode:1}]}u={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:function(_,b){return _async_to_generator(function(){var _$w,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,5]);return[4,r("appendFile read",function(){return t.fs.readFile(_)})];case 1:_$w=_state.sent();return[4,r("appendFile write",function(){return t.fs.writeFile(_,_$w+b)})];case 2:_state.sent();return[3,5];case 3:w=_state.sent();if(_instanceof(w,nn))throw w;return[4,r("appendFile create",function(){return t.fs.writeFile(_,b)})];case 4:_state.sent();return[3,5];case 5:return[2]}})})()},resolvePath:t.fs.resolvePath.bind(t.fs)},p=t.exec,m=Qft({fieldSep:n,maxIterations:(v=t.limits)==null?void 0:v.maxAwkIterations,maxOutputSize:(y=t.limits)==null?void 0:y.maxStringLength,fs:u,cwd:t.cwd,exec:p?function(_){return r("command pipe exec",function(){return p(_,{cwd:t.cwd,signal:t.signal})})}:void 0,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext});m.FS=i,m.vars=Object.assign(Object.create(null),o),m.ARGC=l.length+1,m.ARGV=Object.create(null),m.ARGV[0]="awk";for(_$_1=0;_$_1<l.length;_$_1++)m.ARGV[String(_$_1+1)]=l[_$_1];m.ENVIRON=Jc(t.env);h=new W4e(m);h.execute(d);g=d.rules.some(function(_){var b,_$w;return((b=_.pattern)==null?void 0:b.type)!=="begin"&&((_$w=_.pattern)==null?void 0:_$w.type)!=="end"}),x=d.rules.some(function(_){var b;return((b=_.pattern)==null?void 0:b.type)==="end"});_state.label=1;case 1:_state.trys.push([1,24,,25]);return[4,r("BEGIN execution",function(){return h.executeBegin()})];case 2:if(!(_state.sent(),m.shouldExit))return[3,4];return[4,r("END execution after BEGIN exit",function(){return h.executeEnd()})];case 3:return[2,(_state.sent(),{stdout:h.getOutput(),stderr:"",exitCode:h.getExitCode()})];case 4:if(!g&&!x)return[2,{stdout:h.getOutput(),stderr:"",exitCode:h.getExitCode()}];_$_2=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(l.length>0))return[3,13];_state.label=5;case 5:_state.trys.push([5,10,11,12]);_loop=function(){var b,_$w,S,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:b=_step.value;_state.label=1;case 1:_state.trys.push([1,3,,4]);_$w=t.fs.resolvePath(t.cwd,b);return[4,r("input file read",function(){return t.fs.readFile(_$w)})];case 2:S=_state.sent().split("\n");S.length>0&&S[S.length-1]===""&&S.pop(),_$_2.push({filename:b,lines:S});return[3,4];case 3:w=_state.sent();if(_instanceof(w,nn))throw w;return[2,{v:{stdout:"",stderr:"awk: ".concat(b,": No such file or directory\n"),exitCode:1}}];case 4:return[2]}})};_iterator=l[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];return[5,_ts_values(_loop())];case 7:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[3,14];case 13:b10=Sn(t.stdin).split("\n");b10.length>0&&b10[b10.length-1]===""&&b10.pop(),_$_2.push({filename:"",lines:b10});_state.label=14;case 14:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=15;case 15:_state.trys.push([15,20,21,22]);_loop1=function(){var _loop,b,_ret;return _ts_generator(this,function(_state){switch(_state.label){case 0:_loop=function(){var _$w;return _ts_generator(this,function(_state){switch(_state.label){case 0:m.lineIndex++;_$w=m.lineIndex;return[4,r("line execution",function(){return h.executeLine(b.lines[_$w])})];case 1:if(_state.sent(),m.shouldExit||m.shouldNextFile)return[2,"break"];return[2]}})};b=_step1.value;m.FILENAME=b.filename,m.FNR=0,m.lines=b.lines,m.lineIndex=-1,m.shouldNextFile=!1;_state.label=1;case 1:if(!(m.lineIndex<b.lines.length-1))return[3,4];return[5,_ts_values(_loop())];case 2:_ret=_state.sent();if(_ret==="break")return[3,4];_state.label=3;case 3:return[3,1];case 4:if(m.shouldExit)return[2,"break"];return[2]}})};_iterator1=_$_2[Symbol.iterator]();_state.label=16;case 16:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,19];return[5,_ts_values(_loop1())];case 17:_ret1=_state.sent();if(_ret1==="break")return[3,19];_state.label=18;case 18:_iteratorNormalCompletion1=true;return[3,16];case 19:return[3,22];case 20:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,22];case 21:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 22:return[4,r("END execution",function(){return h.executeEnd()})];case 23:return[2,(_state.sent(),{stdout:h.getOutput(),stderr:"",exitCode:h.getExitCode()})];case 24:_=_state.sent();if(_instanceof(_,nn))throw _;b11=_instanceof(_,Error)?_.message:String(_),_$w2=_instanceof(_,Qt)?Qt.EXIT_CODE:2;return[2,{stdout:h.getOutput(),stderr:"awk: ".concat(b11,"\n"),exitCode:_$w2}];case 25:return[2]}})})()}},K4e={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0}});function T2e(e){var a;var t=e.trim(),r=t.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!r){var s=parseFloat(t);return Number.isNaN(s)?0:s}var n=parseFloat(r[1]),i=(r[2]||"").toLowerCase(),o=(a=Q4e.get(i))!=null?a:1;return n*o}function A2e(e){var r;var t=e.trim().toLowerCase().slice(0,3);return(r=J4e.get(t))!=null?r:0}function mht(e,t){var r=e.split(/(\d+)/),n=t.split(/(\d+)/),i=Math.max(r.length,n.length);for(var o=0;o<i;o++){var a=r[o]||"",s=n[o]||"",l=/^\d+$/.test(a)?parseInt(a,10):null,c=/^\d+$/.test(s)?parseInt(s,10):null;if(l!==null&&c!==null){if(l!==c)return l-c}else if(a!==s)return a.localeCompare(s)}return 0}function I2e(e){return e.replace(/[^a-zA-Z0-9\s]/g,"")}function cW(e,t,r){var n=r!==null?r:/\s+/,i=e.split(n),o=t.startField-1;if(o>=i.length)return"";if(t.endField===void 0){var l=i[o]||"";return t.startChar!==void 0&&(l=l.slice(t.startChar-1)),t.ignoreLeading&&(l=l.trimStart()),l}var a=Math.min(t.endField-1,i.length-1),s="";for(var l10=o;l10<=a&&l10<i.length;l10++){var c=i[l10]||"";if(l10===o&&t.startChar!==void 0&&(c=c.slice(t.startChar-1)),l10===a&&t.endChar!==void 0){var d=l10===o&&t.startChar!==void 0?t.endChar-t.startChar+1:t.endChar;c=c.slice(0,d)}l10>o&&(s+=r||" "),s+=c}return t.ignoreLeading&&(s=s.trimStart()),s}function P2e(e,t,r){var n=e,i=t;if(r.dictionaryOrder&&(n=I2e(n),i=I2e(i)),r.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),r.monthSort){var o=A2e(n),a=A2e(i);return o-a}if(r.humanNumeric){var o10=T2e(n),a9=T2e(i);return o10-a9}if(r.versionSort)return mht(n,i);if(r.numeric){var o11=parseFloat(n)||0,a10=parseFloat(i)||0;return o11-a10}return n.localeCompare(i)}function hht(e){var t=e.keys,r=e.fieldDelimiter,n=e.numeric,i=e.ignoreCase,o=e.reverse,a=e.humanNumeric,s=e.versionSort,l=e.dictionaryOrder,c=e.monthSort,d=e.ignoreLeadingBlanks,u=e.stable;return function(p,m){var x,v,y,_,b,w,S;var h=p,g=m;if(d&&(h=h.trimStart(),g=g.trimStart()),t.length===0){var k=P2e(h,g,{numeric:n,ignoreCase:i,humanNumeric:a,versionSort:s,dictionaryOrder:l,monthSort:c});if(k!==0)return o?-k:k;if(!u){var E=p.localeCompare(m);return o?-E:E}return 0}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var k10=_step.value;var E1=cW(h,k10,r),C=cW(g,k10,r);k10.ignoreLeading&&(E1=E1.trimStart(),C=C.trimStart());var T={numeric:(x=k10.numeric)!=null?x:n,ignoreCase:(v=k10.ignoreCase)!=null?v:i,humanNumeric:(y=k10.humanNumeric)!=null?y:a,versionSort:(_=k10.versionSort)!=null?_:s,dictionaryOrder:(b=k10.dictionaryOrder)!=null?b:l,monthSort:(w=k10.monthSort)!=null?w:c},I=(S=k10.reverse)!=null?S:o,O=P2e(E1,C,T);if(O!==0)return I?-O:O}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!u){var k11=p.localeCompare(m);return o?-k11:k11}return 0}}function ght(e,t){if(t.keys.length===0){if(t.ignoreCase){var i=new Set;return e.filter(function(o){var a=o.toLowerCase();return i.has(a)?!1:(i.add(a),!0)})}return _to_consumable_array(new Set(e))}var r=t.keys[0],n=new Set;return e.filter(function(i){var a;var o=cW(i,r,t.fieldDelimiter);return((a=r.ignoreCase)!=null?a:t.ignoreCase)&&(o=o.toLowerCase()),n.has(o)?!1:(n.add(o),!0)})}var Q4e,J4e,xht=se(function(){"use strict";Q4e=new Map([["",1],["k",1024],["m",1048576],["g",0x40000000],["t",0x10000000000],["p",0x4000000000000],["e",0x1000000000000000]]),J4e=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]])});function vq(e){var t={startField:1},r="",n=e,i=n.match(/([bdfhMnrV]+)$/);i&&(r=i[1],n=n.slice(0,-r.length)),r.includes("n")&&(t.numeric=!0),r.includes("r")&&(t.reverse=!0),r.includes("f")&&(t.ignoreCase=!0),r.includes("b")&&(t.ignoreLeading=!0),r.includes("h")&&(t.humanNumeric=!0),r.includes("V")&&(t.versionSort=!0),r.includes("d")&&(t.dictionaryOrder=!0),r.includes("M")&&(t.monthSort=!0);var o=n.split(",");if(o.length===0||o[0]==="")return null;var a=o[0].split("."),s=parseInt(a[0],10);if(Number.isNaN(s)||s<1)return null;if(t.startField=s,a.length>1&&a[1]){var l=parseInt(a[1],10);!Number.isNaN(l)&&l>=1&&(t.startChar=l)}if(o.length>1&&o[1]){var l10=o[1],c=l10.match(/([bdfhMnrV]+)$/);if(c){var u=c[1];u.includes("n")&&(t.numeric=!0),u.includes("r")&&(t.reverse=!0),u.includes("f")&&(t.ignoreCase=!0),u.includes("b")&&(t.ignoreLeading=!0),u.includes("h")&&(t.humanNumeric=!0),u.includes("V")&&(t.versionSort=!0),u.includes("d")&&(t.dictionaryOrder=!0),u.includes("M")&&(t.monthSort=!0),l10=l10.slice(0,-u.length)}var d=l10.split(".");if(d[0]){var u10=parseInt(d[0],10);if(!Number.isNaN(u10)&&u10>=1&&(t.endField=u10),d.length>1&&d[1]){var p=parseInt(d[1],10);!Number.isNaN(p)&&p>=1&&(t.endChar=p)}}}return t}var yht=se(function(){"use strict"}),Y4e={};St(Y4e,{flagsForFuzzing:function(){return e3e},sortCommand:function(){return X4e}});var R2e,X4e,e3e,vht=se(function(){"use strict";kr(),f_(),jt(),xht(),yht(),R2e={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:"KEYDEF is F[.C][OPTS][,F[.C][OPTS]]\n F is a field number (1-indexed)\n C is a character position within the field (1-indexed)\n OPTS can be: b d f h M n r V (per-key modifiers)\n\nExamples:\n -k1 sort by first field\n -k2,2 sort by second field only\n -k1.3 sort by first field starting at 3rd character\n -k1,2n sort by fields 1-2 numerically\n -k2 -k1 sort by field 2, then by field 1"},X4e={name:"sort",execute:function execute(e,t){return _async_to_generator(function(){var r,n,l,c,d,u,d10,d11,d12,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u10,i,o,a,l10,c10,s,l11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(R2e)];r={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},n=[];for(l=0;l<e.length;l++){c=e[l];if(c==="-r"||c==="--reverse")r.reverse=!0;else if(c==="-n"||c==="--numeric-sort")r.numeric=!0;else if(c==="-u"||c==="--unique")r.unique=!0;else if(c==="-f"||c==="--ignore-case")r.ignoreCase=!0;else if(c==="-h"||c==="--human-numeric-sort")r.humanNumeric=!0;else if(c==="-V"||c==="--version-sort")r.versionSort=!0;else if(c==="-d"||c==="--dictionary-order")r.dictionaryOrder=!0;else if(c==="-M"||c==="--month-sort")r.monthSort=!0;else if(c==="-b"||c==="--ignore-leading-blanks")r.ignoreLeadingBlanks=!0;else if(c==="-s"||c==="--stable")r.stable=!0;else if(c==="-c"||c==="--check")r.checkOnly=!0;else if(c==="-o"||c==="--output")r.outputFile=e[++l]||null;else if(c.startsWith("-o"))r.outputFile=c.slice(2)||null;else if(c.startsWith("--output="))r.outputFile=c.slice(9)||null;else if(c==="-t"||c==="--field-separator")r.fieldDelimiter=e[++l]||null;else if(c.startsWith("-t"))r.fieldDelimiter=c.slice(2)||null;else if(c.startsWith("--field-separator="))r.fieldDelimiter=c.slice(18)||null;else if(c==="-k"||c==="--key"){d=e[++l];if(d){u=vq(d);u&&r.keys.push(u)}}else if(c.startsWith("-k")){d10=vq(c.slice(2));d10&&r.keys.push(d10)}else if(c.startsWith("--key=")){d11=vq(c.slice(6));d11&&r.keys.push(d11)}else{if(c.startsWith("--"))return[2,fr("sort",c)];if(c.startsWith("-")&&!c.startsWith("--")){d12=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u10=_step.value;if(u10==="r")r.reverse=!0;else if(u10==="n")r.numeric=!0;else if(u10==="u")r.unique=!0;else if(u10==="f")r.ignoreCase=!0;else if(u10==="h")r.humanNumeric=!0;else if(u10==="V")r.versionSort=!0;else if(u10==="d")r.dictionaryOrder=!0;else if(u10==="M")r.monthSort=!0;else if(u10==="b")r.ignoreLeadingBlanks=!0;else if(u10==="s")r.stable=!0;else if(u10==="c")r.checkOnly=!0;else{d12=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(d12)return[2,fr("sort",c)]}else n.push(c)}}return[4,tV(t,n,{cmdName:"sort"})];case 1:i=_state.sent();if(!i.ok)return[2,i.error];o=Sn(i.content).split("\n");o.length>0&&o[o.length-1]===""&&o.pop();a=hht(r);if(r.checkOnly){l10=n.length>0?n[0]:"-";for(c10=1;c10<o.length;c10++)if(a(o[c10-1],o[c10])>0)return[2,{stdout:"",stderr:"sort: ".concat(l10,":").concat(c10+1,": disorder: ").concat(o[c10],"\n"),exitCode:1}];return[2,{stdout:"",stderr:"",exitCode:0}]}o.sort(a),r.unique&&(o=ght(o,r));s=o.length>0?"".concat(o.join("\n"),"\n"):"";if(!r.outputFile)return[3,3];l11=t.fs.resolvePath(t.cwd,r.outputFile);return[4,t.fs.writeFile(l11,s)];case 2:return[2,(_state.sent(),{stdout:"",stderr:"",exitCode:0})];case 3:return[2,{stdout:s,stderr:"",exitCode:0}]}})})()}},e3e={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0}}),t3e={};St(t3e,{flagsForFuzzing:function(){return n3e},uniqCommand:function(){return r3e}});var M2e,O2e,r3e,n3e,_ht=se(function(){"use strict";kr(),zo(),f_(),jt(),M2e={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},O2e={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},r3e={name:"uniq",execute:function execute(e,t){return _async_to_generator(function(){var r,_r_result_flags,n,i,o,a,s,l,c,d,u,p,m,x,h,g,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,x10,v;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(M2e)];r=Fo("uniq",e,O2e);if(!r.ok)return[2,r.error];_r_result_flags=r.result.flags,n=_r_result_flags.count,i=_r_result_flags.duplicatesOnly,o=_r_result_flags.uniqueOnly,a=_r_result_flags.ignoreCase,s=r.result.positional;return[4,tV(t,s,{cmdName:"uniq"})];case 1:l=_state.sent();if(!l.ok)return[2,l.error];c=(a?Sn(l.content):l.content).split("\n");if(c.length>0&&c[c.length-1]===""&&c.pop(),c.length===0)return[2,{stdout:"",stderr:"",exitCode:0}];d=[],u=c[0],p=1,m=function(x,v){return a?x.toLowerCase()===v.toLowerCase():x===v};for(x=1;x<c.length;x++)m(c[x],u)?p++:(d.push({line:u,count:p}),u=c[x],p=1);d.push({line:u,count:p});h=d;i?h=d.filter(function(x){return x.count>1}):o&&(h=d.filter(function(x){return x.count===1}));g="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=h[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_step.value,x10=_step_value.line,v=_step_value.count;n?g+="".concat(String(v).padStart(4)," ").concat(x10,"\n"):g+="".concat(x10,"\n")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,a?{stdout:g,stderr:"",exitCode:0}:{stdout:g,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}]}})})()}},n3e={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}}),i3e={};St(i3e,{commCommand:function(){return o3e},flagsForFuzzing:function(){return a3e}});var $2e,o3e,a3e,bht=se(function(){"use strict";kr(),jt(),$2e={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},o3e={name:"comm",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x,a,s,l,c,d,u,p,m,h,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt($2e)];r=!1,n=!1,i=!1,o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){x=_step.value;if(x==="-1")r=!0;else if(x==="-2")n=!0;else if(x==="-3")i=!0;else if(x==="-12"||x==="-21")r=!0,n=!0;else if(x==="-13"||x==="-31")r=!0,i=!0;else if(x==="-23"||x==="-32")n=!0,i=!0;else if(x==="-123"||x==="-132"||x==="-213"||x==="-231"||x==="-312"||x==="-321")r=!0,n=!0,i=!0;else{if(x.startsWith("-")&&x!=="-")return[2,fr("comm",x)];o.push(x)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(o.length!==2)return[2,{stdout:"",stderr:"comm: missing operand\nTry 'comm --help' for more information.\n",exitCode:1}];a=function(x){return _async_to_generator(function(){var v,v10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(x==="-")return[2,Sn(t.stdin)];_state.label=1;case 1:_state.trys.push([1,3,,4]);v=t.fs.resolvePath(t.cwd,x);return[4,t.fs.readFile(v)];case 2:return[2,_state.sent()];case 3:v10=_state.sent();return[2,null];case 4:return[2]}})})()};return[4,a(o[0])];case 1:s=_state.sent();if(s===null)return[2,{stdout:"",stderr:"comm: ".concat(o[0],": No such file or directory\n"),exitCode:1}];return[4,a(o[1])];case 2:l=_state.sent();if(l===null)return[2,{stdout:"",stderr:"comm: ".concat(o[1],": No such file or directory\n"),exitCode:1}];c=s.split("\n"),d=l.split("\n");c.length>0&&c[c.length-1]===""&&c.pop(),d.length>0&&d[d.length-1]===""&&d.pop();u=0,p=0,m="",h=r?"":" ",g=(r?"":" ")+(n?"":" ");for(;u<c.length||p<d.length;)u>=c.length?(n||(m+="".concat(h).concat(d[p],"\n")),p++):p>=d.length?(r||(m+="".concat(c[u],"\n")),u++):c[u]<d[p]?(r||(m+="".concat(c[u],"\n")),u++):c[u]>d[p]?(n||(m+="".concat(h).concat(d[p],"\n")),p++):(i||(m+="".concat(g).concat(c[u],"\n")),u++,p++);return[2,{stdout:m,stderr:"",exitCode:0}]}})})()}},a3e={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2}}),s3e={};St(s3e,{cutCommand:function(){return l3e},flagsForFuzzing:function(){return u3e}});function wht(e){var t=[],r=e.split(",");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(n.includes("-")){var _n_split=_sliced_to_array(n.split("-"),2),i=_n_split[0],o=_n_split[1];t.push({start:i?parseInt(i,10):1,end:o?parseInt(o,10):null})}else{var i10=parseInt(n,10);t.push({start:i10,end:i10})}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function Sht(e,t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.start-1,o=n.end===null?e.length:n.end;for(var a=i;a<o&&a<e.length;a++)a>=0&&!r.includes(e[a])&&r.push(e[a])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var N2e,l3e,u3e,kht=se(function(){"use strict";kr(),f_(),jt(),N2e={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]},l3e={name:"cut",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,u,p,m,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,h,s,l,c,d,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,u10,p10,m10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,h10,g,x,v,p11,m11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(N2e)];r=" ",n=null,i=null,o=!1,a=[];for(u=0;u<e.length;u++){p=e[u];if(p==="-d")r=e[++u]||" ";else if(p.startsWith("-d"))r=p.slice(2);else if(p==="-f")n=e[++u];else if(p.startsWith("-f"))n=p.slice(2);else if(p==="-c")i=e[++u];else if(p.startsWith("-c"))i=p.slice(2);else if(p==="-s"||p==="--only-delimited")o=!0;else{if(p.startsWith("--"))return[2,fr("cut",p)];if(p.startsWith("-")){m=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=p.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){h=_step.value;if(h==="s")o=!0;else if(!"dfc".includes(h)){m=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(m)return[2,fr("cut",p)]}else a.push(p)}}if(!n&&!i)return[2,{stdout:"",stderr:"cut: you must specify a list of bytes, characters, or fields\n",exitCode:1}];return[4,tV(t,a,{cmdName:"cut"})];case 1:s=_state.sent();if(!s.ok)return[2,s.error];l=(i?Sn(s.content):s.content).split("\n");l.length>0&&l[l.length-1]===""&&l.pop();c=wht(n||i||"1"),d="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){u10=_step1.value;if(i){p10=Array.from(u10),m10=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=c[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){h10=_step2.value;g=h10.start-1,x=h10.end===null?p10.length:h10.end;for(v=g;v<x&&v<p10.length;v++)v>=0&&m10.push(p10[v])}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}d+="".concat(m10.join(""),"\n")}else{if(o&&!u10.includes(r))continue;p11=u10.split(r),m11=Sht(p11,c);d+="".concat(m11.join(r),"\n")}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,i?{stdout:d,stderr:"",exitCode:0}:{stdout:d,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}]}})})()}},u3e={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}}),c3e={};St(c3e,{flagsForFuzzing:function(){return p3e},pasteCommand:function(){return d3e}});function D2e(e,t){if(e.length===0)return"";if(e.length===1)return e[0];var r=e[0];for(var n=1;n<e.length;n++){var i=(n-1)%t.length;r+=t[i]+e[n]}return r}var L2e,F2e,d3e,p3e,Cht=se(function(){"use strict";kr(),zo(),jt(),L2e={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},F2e={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},d3e={name:"paste",execute:function execute(e,t){return _async_to_generator(function(){var p,r,n,i,o,a,s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m,h,g,h10,g10,g11,err,u,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m10,_Math,m11,h11,g12,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,x;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(L2e)];r=Fo("paste",e,F2e);if(!r.ok)return[2,r.error];n=r.result.flags.delimiter,i=r.result.flags.serial,o=r.result.positional;if(o.length===0)return[2,{stdout:"",stderr:"usage: paste [-s] [-d delimiters] file ...\n",exitCode:1}];a=Sn(t.stdin),s=a?a.split("\n"):[""];s.length>0&&s[s.length-1]===""&&s.pop();l=o.filter(function(m){return m==="-"}).length,c=[],d=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];m=_step.value;if(!(m==="-"))return[3,3];h=[];for(g=d;g<s.length;g+=l)h.push(s[g]);c.push(h),d++;return[3,7];case 3:h10=t.fs.resolvePath(t.cwd,m);_state.label=4;case 4:_state.trys.push([4,6,,7]);return[4,t.fs.readFile(h10)];case 5:g10=_state.sent().split("\n");g10.length>0&&g10[g10.length-1]===""&&g10.pop(),c.push(g10);return[3,7];case 6:g11=_state.sent();return[2,{stdout:"",stderr:"paste: ".concat(m,": No such file or directory\n"),exitCode:1}];case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:u="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(i)try{for(_iterator1=c[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){m10=_step1.value;m10&&(u+="".concat(D2e(m10,n),"\n"))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}else{;m11=(_Math=Math).max.apply(_Math,_to_consumable_array(c.map(function(h){var g;return(g=h==null?void 0:h.length)!=null?g:0})));for(h11=0;h11<m11;h11++){g12=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=c[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){x=_step2.value;g12.push((p=x==null?void 0:x[h11])!=null?p:"")}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}u+="".concat(D2e(g12,n),"\n")}}return[2,{stdout:u,stderr:"",exitCode:0}]}})})()}},p3e={name:"paste",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0}}),f3e={};St(f3e,{flagsForFuzzing:function(){return g3e},trCommand:function(){return h3e}});function z2e(e){var t="",r=0;for(;r<e.length;){if(e[r]==="["&&e[r+1]===":"){var n=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=m3e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];if(e.slice(r).startsWith(i)){t+=o,r+=i.length,n=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(n)continue}if(e[r]==="\\"&&r+1<e.length){var n10=e[r+1];n10==="n"?t+="\n":n10==="t"?t+=" ":n10==="r"?t+="\r":t+=n10,r+=2;continue}if(r+2<e.length&&e[r+1]==="-"){var n11=e.charCodeAt(r),i10=e.charCodeAt(r+2);if(i10-n11>65536)throw new Error("tr: character range too large: '".concat(e[r],"-").concat(e[r+2],"'"));for(var o10=n11;o10<=i10;o10++)t+=String.fromCharCode(o10);r+=3;continue}t+=e[r],r++}return t}var j2e,m3e,U2e,h3e,g3e,Eht=se(function(){"use strict";kr(),yp(),zo(),jt(),j2e={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:"SET syntax:\n a-z character range\n [:alnum:] all letters and digits\n [:alpha:] all letters\n [:digit:] all digits\n [:lower:] all lowercase letters\n [:upper:] all uppercase letters\n [:space:] all whitespace\n [:blank:] horizontal whitespace\n [:punct:] all punctuation\n [:print:] all printable characters\n [:graph:] all printable characters except space\n [:cntrl:] all control characters\n [:xdigit:] all hexadecimal digits\n \\n, \\t, \\r escape sequences"},m3e=new Map([["[:alnum:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"],["[:alpha:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"],["[:blank:]"," "],["[:cntrl:]",Array.from({length:32},function(e,t){return String.fromCharCode(t)}).join("").concat("")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},function(e,t){return String.fromCharCode(33+t)}).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},function(e,t){return String.fromCharCode(32+t)}).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]"," \n\r\f\v"],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]),U2e={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},h3e={name:"tr",execute:function execute(e,t){return _async_to_generator(function(){var p,r,n,i,o,a,s,l,c,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$m,_$m1,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,h,_$m2,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,h10,_$m3,h11,g,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,h12,_$m4,h13,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,g10;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(j2e)];r=Fo("tr",e,U2e);if(!r.ok)return[2,r.error];n=r.result.flags.complement||r.result.flags.complementUpper,i=r.result.flags.delete,o=r.result.flags.squeeze,a=r.result.positional;if(a.length<1)return[2,{stdout:"",stderr:"tr: missing operand\n",exitCode:1}];if(!i&&!o&&a.length<2)return[2,{stdout:"",stderr:"tr: missing operand after SET1\n",exitCode:1}];try{s=z2e(a[0]),l=a.length>1?z2e(a[1]):""}catch(m){return[2,{stdout:"",stderr:"".concat(la(m.message),"\n"),exitCode:1}]}c=Sn(t.stdin),d=function(m){var h=s.includes(m);return n?!h:h},u="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(i)try{for(_iterator=c[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$m=_step.value;d(_$m)||(u+=_$m)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else if(o&&a.length===1){_$m1="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=c[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){h=_step1.value;d(h)&&h===_$m1||(u+=h,_$m1=h)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else{if(n){_$m2=l.length>0?l[l.length-1]:"";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=c[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){h10=_step2.value;s.includes(h10)?u+=h10:u+=_$m2}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else{_$m3=new Map;for(h11=0;h11<s.length;h11++){g=h11<l.length?l[h11]:l[l.length-1];_$m3.set(s[h11],g)}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=c[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){h12=_step3.value;u+=(p=_$m3.get(h12))!=null?p:h12}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}if(o){_$m4="",h13="";_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=u[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){g10=_step4.value;l.includes(g10)&&g10===h13||(_$m4+=g10,h13=g10)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}u=_$m4}}return[2,{stdout:u,stderr:"",exitCode:0}]})})()}},g3e={name:"tr",flags:[{flag:"-c",type:"boolean"},{flag:"-C",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-s",type:"boolean"}],stdinType:"text",needsArgs:!0}}),x3e={};St(x3e,{flagsForFuzzing:function(){return v3e},rev:function(){return y3e}});function Tht(e){return Array.from(e).reverse().join("")}var B2e,y3e,v3e,Aht=se(function(){"use strict";kr(),jt(),B2e={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]},y3e={name:"rev",execute:function(e,t){return _async_to_generator(function(){var o,a,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,_r1,l,n,i,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,s10,_iterator1,_step1,s11,l10,l11,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(B2e)];r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s=_step.value;if(s==="--"){;l=e.indexOf(s);(_r1=r).push.apply(_r1,_to_consumable_array(e.slice(l+1)));break}else{if(s.startsWith("-")&&s!=="-")return[2,fr("rev",s)];r.push(s)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n="",i=function(s){var l=s.split("\n"),c=s.endsWith("\n")&&l[l.length-1]==="";return c&&l.pop(),l.map(Tht).join("\n")+(c?"\n":"")};_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(!(r.length===0))return[3,1];s10=(o=Sn(t.stdin))!=null?o:"";n=i(s10);return[3,9];case 1:_state.trys.push([1,7,8,9]);_iterator1=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,6];s11=_step1.value;if(!(s11==="-"))return[3,3];l10=(a=Sn(t.stdin))!=null?a:"";n+=i(l10);return[3,5];case 3:l11=t.fs.resolvePath(t.cwd,s11);return[4,t.fs.readFile(l11)];case 4:c=_state.sent();if(c===null)return[2,{exitCode:1,stdout:n,stderr:"rev: ".concat(s11,": No such file or directory\n")}];n+=i(c);_state.label=5;case 5:_iteratorNormalCompletion1=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 9:return[2,{exitCode:0,stdout:n,stderr:""}]}})})()}},v3e={name:"rev",flags:[],stdinType:"text",needsFiles:!0}}),_3e={};St(_3e,{flagsForFuzzing:function(){return w3e},nl:function(){return b3e}});function Iht(e,t,r){var n=String(e);switch(t){case"ln":return n.padEnd(r);case"rn":return n.padStart(r);case"rz":return n.padStart(r,"0");default:return t}}function Pht(e,t){switch(t){case"a":return!0;case"t":return e.trim().length>0;case"n":return!1;default:return t}}function q2e(e,t,r){if(e==="")return{output:"",nextNumber:r};var n=e.split("\n"),i=[],o=r,a=e.endsWith("\n")&&n[n.length-1]==="";a&&n.pop();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(Pht(s,t.bodyStyle)){var l=Iht(o,t.numberFormat,t.width);i.push("".concat(l).concat(t.separator).concat(s)),o+=t.increment}else{var l10=" ".repeat(t.width);i.push("".concat(l10).concat(t.separator).concat(s))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{output:i.join("\n")+(a?"\n":""),nextNumber:o}}var W2e,b3e,w3e,Rht=se(function(){"use strict";kr(),jt(),W2e={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]},b3e={name:"nl",execute:function(e,t){return _async_to_generator(function(){var s,r,n,i,l,c,c10,c11,c12,c13,c14,c15,c16,c17,c18,_n,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,l10,_iterator,_step,l11,c19,d,u,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(W2e)];r={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},n=[],i=0;for(;i<e.length;){l=e[i];if(l==="-b"&&i+1<e.length){c=e[i+1];if(c!=="a"&&c!=="t"&&c!=="n")return[2,{exitCode:1,stdout:"",stderr:"nl: invalid body numbering style: '".concat(c,"'\n")}];r.bodyStyle=c,i+=2}else if(l.startsWith("-b")){c10=l.slice(2);if(c10!=="a"&&c10!=="t"&&c10!=="n")return[2,{exitCode:1,stdout:"",stderr:"nl: invalid body numbering style: '".concat(c10,"'\n")}];r.bodyStyle=c10,i++}else if(l==="-n"&&i+1<e.length){c11=e[i+1];if(c11!=="ln"&&c11!=="rn"&&c11!=="rz")return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line numbering format: '".concat(c11,"'\n")}];r.numberFormat=c11,i+=2}else if(l.startsWith("-n")){c12=l.slice(2);if(c12!=="ln"&&c12!=="rn"&&c12!=="rz")return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line numbering format: '".concat(c12,"'\n")}];r.numberFormat=c12,i++}else if(l==="-w"&&i+1<e.length){c13=parseInt(e[i+1],10);if(Number.isNaN(c13)||c13<1)return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line number field width: '".concat(e[i+1],"'\n")}];r.width=c13,i+=2}else if(l.startsWith("-w")){c14=parseInt(l.slice(2),10);if(Number.isNaN(c14)||c14<1)return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line number field width: '".concat(l.slice(2),"'\n")}];r.width=c14,i++}else if(l==="-s"&&i+1<e.length)r.separator=e[i+1],i+=2;else if(l.startsWith("-s"))r.separator=l.slice(2),i++;else if(l==="-v"&&i+1<e.length){c15=parseInt(e[i+1],10);if(Number.isNaN(c15))return[2,{exitCode:1,stdout:"",stderr:"nl: invalid starting line number: '".concat(e[i+1],"'\n")}];r.startNumber=c15,i+=2}else if(l.startsWith("-v")){c16=parseInt(l.slice(2),10);if(Number.isNaN(c16))return[2,{exitCode:1,stdout:"",stderr:"nl: invalid starting line number: '".concat(l.slice(2),"'\n")}];r.startNumber=c16,i++}else if(l==="-i"&&i+1<e.length){c17=parseInt(e[i+1],10);if(Number.isNaN(c17))return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line number increment: '".concat(e[i+1],"'\n")}];r.increment=c17,i+=2}else if(l.startsWith("-i")){c18=parseInt(l.slice(2),10);if(Number.isNaN(c18))return[2,{exitCode:1,stdout:"",stderr:"nl: invalid line number increment: '".concat(l.slice(2),"'\n")}];r.increment=c18,i++}else if(l==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(l.startsWith("-")&&l!=="-")return[2,fr("nl",l)];n.push(l),i++}}o="",a=r.startNumber;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(n.length===0))return[3,1];l10=(s=Sn(t.stdin))!=null?s:"";o=q2e(l10,r,a).output;return[3,8];case 1:_state.trys.push([1,6,7,8]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];l11=_step.value;c19=t.fs.resolvePath(t.cwd,l11);return[4,t.fs.readFile(c19)];case 3:d=_state.sent();if(d===null)return[2,{exitCode:1,stdout:o,stderr:"nl: ".concat(l11,": No such file or directory\n")}];u=q2e(d,r,a);o+=u.output,a=u.nextNumber;_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,{exitCode:0,stdout:o,stderr:""}]}})})()}},w3e={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}}),S3e={};St(S3e,{flagsForFuzzing:function(){return C3e},fold:function(){return k3e}});function Mht(e,t,r){return r?new TextEncoder().encode(e).length:e===" "?8-t%8:e==="\b"?-1:1}function Oht(e,t){if(e.length===0)return e;var r=t.width,n=t.breakAtSpaces,i=t.countBytes,o=[],a="",s=0,l=-1,c=0;for(var d=0;d<e.length;d++){var u=e[d],p=Mht(u,s,i);s+p>r&&a.length>0?n&&l>=0?(o.push(a.slice(0,l+1)),a=a.slice(l+1)+u,s=s-c-1+p,l=-1,c=0):(o.push(a),a=u,s=p,l=-1,c=0):(a+=u,s+=p,(u===" "||u===" ")&&(l=a.length-1,c=s-p))}return a.length>0&&o.push(a),o.join("\n")}function V2e(e,t){if(e==="")return"";var r=e.split("\n"),n=e.endsWith("\n")&&r[r.length-1]==="";return n&&r.pop(),r.map(function(i){return Oht(i,t)}).join("\n")+(n?"\n":"")}var G2e,k3e,C3e,$ht=se(function(){"use strict";kr(),jt(),G2e={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]},k3e={name:"fold",execute:function(e,t){return _async_to_generator(function(){var a,r,n,i,s,l,l10,l11,c,l12,_n,l13,c10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,o,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,s10,_iterator1,_step1,s11,l14,c11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(G2e)];r={width:80,breakAtSpaces:!1,countBytes:!1},n=[],i=0;for(;i<e.length;){s=e[i];if(s==="-w"&&i+1<e.length){l=parseInt(e[i+1],10);if(Number.isNaN(l)||l<1)return[2,{exitCode:1,stdout:"",stderr:"fold: invalid number of columns: '".concat(e[i+1],"'\n")}];r.width=l,i+=2}else if(s.startsWith("-w")&&s.length>2){l10=parseInt(s.slice(2),10);if(Number.isNaN(l10)||l10<1)return[2,{exitCode:1,stdout:"",stderr:"fold: invalid number of columns: '".concat(s.slice(2),"'\n")}];r.width=l10,i++}else if(s==="-s")r.breakAtSpaces=!0,i++;else if(s==="-b")r.countBytes=!0,i++;else if(s==="-bs"||s==="-sb")r.breakAtSpaces=!0,r.countBytes=!0,i++;else if(s.match(/^-[sb]+w\d+$/)){s.includes("s")&&(r.breakAtSpaces=!0),s.includes("b")&&(r.countBytes=!0);l11=s.replace(/^-[sb]+w/,""),c=parseInt(l11,10);if(Number.isNaN(c)||c<1)return[2,{exitCode:1,stdout:"",stderr:"fold: invalid number of columns: '".concat(l11,"'\n")}];r.width=c,i++}else if(s.match(/^-[sb]+w$/)&&i+1<e.length){s.includes("s")&&(r.breakAtSpaces=!0),s.includes("b")&&(r.countBytes=!0);l12=parseInt(e[i+1],10);if(Number.isNaN(l12)||l12<1)return[2,{exitCode:1,stdout:"",stderr:"fold: invalid number of columns: '".concat(e[i+1],"'\n")}];r.width=l12,i+=2}else if(s==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else if(s.startsWith("-")&&s!=="-"){l13=s.slice(1),c10=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=l13[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;if(d==="s")r.breakAtSpaces=!0;else if(d==="b")r.countBytes=!0;else{c10=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(c10)return[2,fr("fold",s)];i++}else n.push(s),i++}o="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(!(n.length===0))return[3,1];s10=(a=Sn(t.stdin))!=null?a:"";o=V2e(s10,r);return[3,8];case 1:_state.trys.push([1,6,7,8]);_iterator1=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,5];s11=_step1.value;l14=t.fs.resolvePath(t.cwd,s11);return[4,t.fs.readFile(l14)];case 3:c11=_state.sent();if(c11===null)return[2,{exitCode:1,stdout:o,stderr:"fold: ".concat(s11,": No such file or directory\n")}];o+=V2e(c11,r);_state.label=4;case 4:_iteratorNormalCompletion1=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 8:return[2,{exitCode:0,stdout:o,stderr:""}]}})})()}},C3e={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0}}),E3e={};St(E3e,{expand:function(){return T3e},flagsForFuzzing:function(){return A3e}});function QI(e){var t=e.split(",").map(function(n){return n.trim()}),r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=parseInt(n,10);if(Number.isNaN(i)||i<1)return null;r.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}for(var n10=1;n10<r.length;n10++)if(r[n10]<=r[n10-1])return null;return r}function Nht(e,t){if(t.length===1){var r=t[0];return r-e%r}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r10=_step.value;if(r10>e)return r10-e}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(t.length>=2){var r11=t[t.length-1]-t[t.length-2],n=t[t.length-1],i=Math.floor((e-n)/r11)+1;return n+i*r11-e}return 1}function Dht(e,t){var r=t.tabStops,n=t.leadingOnly,i="",o=0,a=!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(s===" ")if(n&&!a)i+=s,o++;else{var l=Nht(o,r);i+=" ".repeat(l),o+=l}else s!==" "&&s!==" "&&(a=!1),i+=s,o++}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i}function H2e(e,t){if(e==="")return"";var r=e.split("\n"),n=e.endsWith("\n")&&r[r.length-1]==="";return n&&r.pop(),r.map(function(i){return Dht(i,t)}).join("\n")+(n?"\n":"")}var Z2e,T3e,A3e,Lht=se(function(){"use strict";kr(),jt(),Z2e={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]},T3e={name:"expand",execute:function(e,t){return _async_to_generator(function(){var a,r,n,i,s,l,l10,l11,l12,_n,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,s10,_iterator,_step,s11,l13,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Z2e)];r={tabStops:[8],leadingOnly:!1},n=[],i=0;for(;i<e.length;){s=e[i];if(s==="-t"&&i+1<e.length){l=QI(e[i+1]);if(!l)return[2,{exitCode:1,stdout:"",stderr:"expand: invalid tab size: '".concat(e[i+1],"'\n")}];r.tabStops=l,i+=2}else if(s.startsWith("-t")&&s.length>2){l10=QI(s.slice(2));if(!l10)return[2,{exitCode:1,stdout:"",stderr:"expand: invalid tab size: '".concat(s.slice(2),"'\n")}];r.tabStops=l10,i++}else if(s==="--tabs"&&i+1<e.length){l11=QI(e[i+1]);if(!l11)return[2,{exitCode:1,stdout:"",stderr:"expand: invalid tab size: '".concat(e[i+1],"'\n")}];r.tabStops=l11,i+=2}else if(s.startsWith("--tabs=")){l12=QI(s.slice(7));if(!l12)return[2,{exitCode:1,stdout:"",stderr:"expand: invalid tab size: '".concat(s.slice(7),"'\n")}];r.tabStops=l12,i++}else if(s==="-i"||s==="--initial")r.leadingOnly=!0,i++;else if(s==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(s.startsWith("-")&&s!=="-")return[2,fr("expand",s)];n.push(s),i++}}o="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(n.length===0))return[3,1];s10=(a=Sn(t.stdin))!=null?a:"";o=H2e(s10,r);return[3,8];case 1:_state.trys.push([1,6,7,8]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];s11=_step.value;l13=t.fs.resolvePath(t.cwd,s11);return[4,t.fs.readFile(l13)];case 3:c=_state.sent();if(c===null)return[2,{exitCode:1,stdout:o,stderr:"expand: ".concat(s11,": No such file or directory\n")}];o+=H2e(c,r);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,{exitCode:0,stdout:o,stderr:""}]}})})()}},A3e={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0}}),I3e={};St(I3e,{flagsForFuzzing:function(){return R3e},unexpand:function(){return P3e}});function JI(e){var t=e.split(",").map(function(n){return n.trim()}),r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=parseInt(n,10);if(Number.isNaN(i)||i<1)return null;r.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}for(var n10=1;n10<r.length;n10++)if(r[n10]<=r[n10-1])return null;return r}function K2e(e,t){if(t.length===1){var r=t[0];return e+(r-e%r)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r10=_step.value;if(r10>e)return r10}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(t.length>=2){var r11=t[t.length-1]-t[t.length-2],n=t[t.length-1],i=Math.floor((e-n)/r11)+1;return n+i*r11}return-1}function Fht(e,t){var r=t.tabStops,n=t.allBlanks,i="",o=0,a="",s=0,l=!0,c=function(){if(a.length===0)return;var d=s+a.length;if(!n&&!l){i+=a,a="";return}var u=s,p="";for(;u<d;){var h=K2e(u,r);if(h<=d&&h>u)p+=" ",u=h;else break}var m=d-u;m>0&&(p+=" ".repeat(m)),i+=p,a=""};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;d===" "?(a.length===0&&(s=o),a+=d,o++):d===" "?(c(),i+=d,o=K2e(o,r)):(c(),i+=d,o++,l=!1)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return c(),i}function Q2e(e,t){if(e==="")return"";var r=e.split("\n"),n=e.endsWith("\n")&&r[r.length-1]==="";return n&&r.pop(),r.map(function(i){return Fht(i,t)}).join("\n")+(n?"\n":"")}var J2e,P3e,R3e,zht=se(function(){"use strict";kr(),jt(),J2e={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]},P3e={name:"unexpand",execute:function(e,t){return _async_to_generator(function(){var a,r,n,i,s,l,l10,l11,l12,_n,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,s10,_iterator,_step,s11,l13,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(J2e)];r={tabStops:[8],allBlanks:!1},n=[],i=0;for(;i<e.length;){s=e[i];if(s==="-t"&&i+1<e.length){l=JI(e[i+1]);if(!l)return[2,{exitCode:1,stdout:"",stderr:"unexpand: invalid tab size: '".concat(e[i+1],"'\n")}];r.tabStops=l,i+=2}else if(s.startsWith("-t")&&s.length>2){l10=JI(s.slice(2));if(!l10)return[2,{exitCode:1,stdout:"",stderr:"unexpand: invalid tab size: '".concat(s.slice(2),"'\n")}];r.tabStops=l10,i++}else if(s==="--tabs"&&i+1<e.length){l11=JI(e[i+1]);if(!l11)return[2,{exitCode:1,stdout:"",stderr:"unexpand: invalid tab size: '".concat(e[i+1],"'\n")}];r.tabStops=l11,i+=2}else if(s.startsWith("--tabs=")){l12=JI(s.slice(7));if(!l12)return[2,{exitCode:1,stdout:"",stderr:"unexpand: invalid tab size: '".concat(s.slice(7),"'\n")}];r.tabStops=l12,i++}else if(s==="-a"||s==="--all")r.allBlanks=!0,i++;else if(s==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(s.startsWith("-")&&s!=="-")return[2,fr("unexpand",s)];n.push(s),i++}}o="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(n.length===0))return[3,1];s10=(a=Sn(t.stdin))!=null?a:"";o=Q2e(s10,r);return[3,8];case 1:_state.trys.push([1,6,7,8]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];s11=_step.value;l13=t.fs.resolvePath(t.cwd,s11);return[4,t.fs.readFile(l13)];case 3:c=_state.sent();if(c===null)return[2,{exitCode:1,stdout:o,stderr:"unexpand: ".concat(s11,": No such file or directory\n")}];o+=Q2e(c,r);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,{exitCode:0,stdout:o,stderr:""}]}})})()}},R3e={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0}}),M3e={};St(M3e,{flagsForFuzzing:function(){return $3e},strings:function(){return O3e}});function jht(e){return e>=32&&e<=126||e===9}function Y2e(e,t){if(t===null)return"";switch(t){case"o":return"".concat(e.toString(8).padStart(7," ")," ");case"x":return"".concat(e.toString(16).padStart(7," ")," ");case"d":return"".concat(e.toString(10).padStart(7," ")," ");default:return t}}function X2e(e,t){var r=[],n="",i=0,o=typeof e=="string"?new TextEncoder().encode(e):e;for(var a=0;a<o.length;a++){var s=o[a];if(jht(s))n.length===0&&(i=a),n+=String.fromCharCode(s);else{if(n.length>=t.minLength){var l=Y2e(i,t.offsetFormat);r.push("".concat(l).concat(n))}n=""}}if(n.length>=t.minLength){var a9=Y2e(i,t.offsetFormat);r.push("".concat(a9).concat(n))}return r}var eve,O3e,$3e,Uht=se(function(){"use strict";kr(),jt(),eve={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]},O3e={name:"strings",execute:function(e,t){return _async_to_generator(function(){var r,n,i,s,l,l10,l11,l12,l13,l14,l15,_n,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,s10,_iterator,_step,s11,l16,d,u,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(eve)];r={minLength:4,offsetFormat:null},n=[],i=0;for(;i<e.length;){s=e[i];if(s==="-n"&&i+1<e.length){l=Number.parseInt(e[i+1],10);if(Number.isNaN(l)||l<1)return[2,{exitCode:1,stdout:"",stderr:"strings: invalid minimum string length: '".concat(e[i+1],"'\n")}];r.minLength=l,i+=2}else if(s.match(/^-n\d+$/)){l10=Number.parseInt(s.slice(2),10);if(Number.isNaN(l10)||l10<1)return[2,{exitCode:1,stdout:"",stderr:"strings: invalid minimum string length: '".concat(s.slice(2),"'\n")}];r.minLength=l10,i++}else if(s.match(/^-\d+$/)){l11=Number.parseInt(s.slice(1),10);if(Number.isNaN(l11)||l11<1)return[2,{exitCode:1,stdout:"",stderr:"strings: invalid minimum string length: '".concat(s.slice(1),"'\n")}];r.minLength=l11,i++}else if(s==="-t"&&i+1<e.length){l12=e[i+1];if(l12!=="o"&&l12!=="x"&&l12!=="d")return[2,{exitCode:1,stdout:"",stderr:"strings: invalid radix: '".concat(l12,"'\n")}];r.offsetFormat=l12,i+=2}else if(s.startsWith("-t")&&s.length===3){l13=s[2];if(l13!=="o"&&l13!=="x"&&l13!=="d")return[2,{exitCode:1,stdout:"",stderr:"strings: invalid radix: '".concat(l13,"'\n")}];r.offsetFormat=l13,i++}else if(s==="-a"||s==="--all"||s==="-")s==="-"&&n.push(s),i++;else if(s==="-e"&&i+1<e.length){l14=e[i+1];if(l14!=="s"&&l14!=="S")return[2,{exitCode:1,stdout:"",stderr:"strings: invalid encoding: '".concat(l14,"'\n")}];i+=2}else if(s.startsWith("-e")&&s.length===3){l15=s[2];if(l15!=="s"&&l15!=="S")return[2,{exitCode:1,stdout:"",stderr:"strings: invalid encoding: '".concat(l15,"'\n")}];i++}else if(s==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(s.startsWith("-")&&s!=="-")return[2,fr("strings",s)];n.push(s),i++}}o="",a=function(){var s;return Uint8Array.from((s=t.stdin)!=null?s:"",function(l){return l.charCodeAt(0)})};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(n.length===0))return[3,1];s10=X2e(a(),r);o=s10.length>0?"".concat(s10.join("\n"),"\n"):"";return[3,12];case 1:_state.trys.push([1,10,11,12]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];s11=_step.value;l16=void 0;if(!(s11==="-"))return[3,3];l16=a();return[3,7];case 3:d=t.fs.resolvePath(t.cwd,s11);_state.label=4;case 4:_state.trys.push([4,6,,7]);return[4,t.fs.readFileBuffer(d)];case 5:l16=_state.sent();return[3,7];case 6:u=_state.sent();return[2,{exitCode:1,stdout:o,stderr:"strings: ".concat(s11,": No such file or directory\n")}];case 7:c=X2e(l16,r);c.length>0&&(o+="".concat(c.join("\n"),"\n"));_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2,{exitCode:0,stdout:o,stderr:""}]}})})()}},$3e={name:"strings",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-a",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsFiles:!0}}),N3e={};St(N3e,{flagsForFuzzing:function(){return L3e},split:function(){return D3e}});function tve(e){var t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;var r=Number.parseInt(t[1],10);if(Number.isNaN(r)||r<1)return null;var n=(t[2]||"").toUpperCase(),i=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(n);return i===void 0?null:r*i}function Bht(e,t,r){if(t)return e.toString().padStart(r,"0");var n="abcdefghijklmnopqrstuvwxyz",i="",o=e;for(var a=0;a<r;a++)i=n[o%26]+i,o=Math.floor(o/26);return i}function qht(e,t){var r=e.split("\n"),n=e.endsWith("\n")&&r[r.length-1]==="";n&&r.pop();var i=[];for(var o=0;o<r.length;o+=t){var a=r.slice(o,o+t),s=o+t>=r.length&&!n?a.join("\n"):"".concat(a.join("\n"),"\n");i.push({content:s,hasContent:!0})}return i}function Wht(e,t){var r=new TextEncoder().encode(e),n=new TextDecoder,i=[];for(var o=0;o<r.length;o+=t){var a=r.slice(o,o+t);i.push({content:n.decode(a),hasContent:a.length>0})}return i}function Vht(e,t){var r=new TextEncoder().encode(e),n=new TextDecoder,i=[],o=Math.ceil(r.length/t);for(var a=0;a<t;a++){var s=a*o,l=Math.min(s+o,r.length),c=r.slice(s,l);i.push({content:n.decode(c),hasContent:c.length>0})}return i}var rve,_q,D3e,L3e,Ght=se(function(){"use strict";kr(),jt(),rve={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},_q=1e5,D3e={name:"split",execute:function(e,t){return _async_to_generator(function(){var c,r,n,i,d,u,u10,u11,u12,u13,u14,u15,u16,_n,o,a,s,d10,u17,l,d11,u18,p,m,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(rve)];r={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},n=[],i=0;for(;i<e.length;){d=e[i];if(d==="-l"&&i+1<e.length){u=Number.parseInt(e[i+1],10);if(Number.isNaN(u)||u<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of lines: '".concat(e[i+1],"'\n")}];r.mode="lines",r.lines=u,i+=2}else if(d.match(/^-l\d+$/)){u10=Number.parseInt(d.slice(2),10);if(Number.isNaN(u10)||u10<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of lines: '".concat(d.slice(2),"'\n")}];r.mode="lines",r.lines=u10,i++}else if(d==="-b"&&i+1<e.length){u11=tve(e[i+1]);if(u11===null)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of bytes: '".concat(e[i+1],"'\n")}];r.mode="bytes",r.bytes=u11,i+=2}else if(d.match(/^-b.+$/)){u12=tve(d.slice(2));if(u12===null)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of bytes: '".concat(d.slice(2),"'\n")}];r.mode="bytes",r.bytes=u12,i++}else if(d==="-n"&&i+1<e.length){u13=Number.parseInt(e[i+1],10);if(Number.isNaN(u13)||u13<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of chunks: '".concat(e[i+1],"'\n")}];r.mode="chunks",r.chunks=u13,i+=2}else if(d.match(/^-n\d+$/)){u14=Number.parseInt(d.slice(2),10);if(Number.isNaN(u14)||u14<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid number of chunks: '".concat(d.slice(2),"'\n")}];r.mode="chunks",r.chunks=u14,i++}else if(d==="-a"&&i+1<e.length){u15=Number.parseInt(e[i+1],10);if(Number.isNaN(u15)||u15<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid suffix length: '".concat(e[i+1],"'\n")}];r.suffixLength=u15,i+=2}else if(d.match(/^-a\d+$/)){u16=Number.parseInt(d.slice(2),10);if(Number.isNaN(u16)||u16<1)return[2,{exitCode:1,stdout:"",stderr:"split: invalid suffix length: '".concat(d.slice(2),"'\n")}];r.suffixLength=u16,i++}else if(d==="-d"||d==="--numeric-suffixes")r.useNumericSuffix=!0,i++;else if(d.startsWith("--additional-suffix="))r.additionalSuffix=d.slice(20),i++;else if(d==="--additional-suffix"&&i+1<e.length)r.additionalSuffix=e[i+1],i+=2;else if(d==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(d.startsWith("-")&&d!=="-")return[2,fr("split",d)];n.push(d),i++}}o="-",a="x";n.length>=1&&(o=n[0]),n.length>=2&&(a=n[1]);if(!(o==="-"))return[3,1];s=(c=t.stdin)!=null?c:"";return[3,5];case 1:d10=t.fs.resolvePath(t.cwd,o);_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,p_(t.fs,d10)];case 3:s=_state.sent();return[3,5];case 4:u17=_state.sent();return[2,{exitCode:1,stdout:"",stderr:"split: ".concat(o,": No such file or directory\n")}];case 5:if(s==="")return[2,{exitCode:0,stdout:"",stderr:""}];switch(r.mode){case"lines":l=qht(s,r.lines);break;case"bytes":l=Wht(s,r.bytes);break;case"chunks":l=Vht(s,r.chunks);break;default:return[2,r.mode]}if(l.length>_q)return[2,{exitCode:1,stdout:"",stderr:"split: too many output files (".concat(l.length,"), limit is ").concat(_q,"\n")}];d11=0;_state.label=6;case 6:if(!(d11<l.length))return[3,9];u18=l[d11];if(!u18.hasContent)return[3,8];p=Bht(d11,r.useNumericSuffix,r.suffixLength),m="".concat(a).concat(p).concat(r.additionalSuffix),h=t.fs.resolvePath(t.cwd,m);return[4,t.fs.writeFile(h,u18.content,"binary")];case 7:_state.sent();_state.label=8;case 8:d11++;return[3,6];case 9:return[2,{exitCode:0,stdout:"",stderr:""}]}})})()}},L3e={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0}}),F3e={};St(F3e,{column:function(){return z3e},flagsForFuzzing:function(){return j3e}});function nve(e,t,r){return t?r?e.split(t):e.split(t).filter(function(n){return n.length>0}):r?e.split(/[ \t]/):e.split(/[ \t]+/).filter(function(n){return n.length>0})}function Hht(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;for(var n=0;n<r.length;n++){var i=r[n].length;(t[n]===void 0||i>t[n])&&(t[n]=i)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function Zht(e,t){if(e.length===0)return"";var r=Hht(e),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=[];for(var a=0;a<i.length;a++)a===i.length-1?o.push(i[a]):o.push(i[a].padEnd(r[a]));n.push(o.join(t))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n.join("\n")}function Kht(e,t,r){var _Math;if(e.length===0)return"";var n=(_Math=Math).max.apply(_Math,_to_consumable_array(e.map(function(c){return c.length}))),i=r.length,o=n+i,a=Math.max(1,Math.floor((t+i)/o)),s=Math.ceil(e.length/a),l=[];for(var c=0;c<s;c++){var d=[];for(var u=0;u<a;u++){var p=u*s+c;p<e.length&&(u===a-1||(u+1)*s+c>=e.length?d.push(e[p]):d.push(e[p].padEnd(n)))}l.push(d.join(r))}return l.join("\n")}var ive,ove,z3e,j3e,Qht=se(function(){"use strict";kr(),zo(),jt(),ive={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},ove={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}},z3e={name:"column",execute:function(e,t){return _async_to_generator(function(){var h,g,r,_r_result_flags,n,i,o,a,s,l,c,d,x,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,v,y,_,err,u,p,m,x10,x11,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,v10,_x1,y10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(ive)];r=Fo("column",e,ove);if(!r.ok)return[2,r.error];_r_result_flags=r.result.flags,n=_r_result_flags.table,i=_r_result_flags.separator,o=_r_result_flags.outputSep,a=_r_result_flags.width,s=_r_result_flags.noMerge,l=r.result.positional,c=o!=null?o:" ";if(!(l.length===0))return[3,1];d=(h=Sn(t.stdin))!=null?h:"";return[3,11];case 1:x=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,8,9,10]);_iterator=l[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];v=_step.value;if(!(v==="-"))return[3,4];x.push((g=Sn(t.stdin))!=null?g:"");return[3,6];case 4:y=t.fs.resolvePath(t.cwd,v);return[4,t.fs.readFile(y)];case 5:_=_state.sent();if(_===null)return[2,{exitCode:1,stdout:"",stderr:"column: ".concat(v,": No such file or directory\n")}];x.push(_);_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,3];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:d=x.join("");_state.label=11;case 11:if(d===""||d.trim()==="")return[2,{exitCode:0,stdout:"",stderr:""}];u=d.split("\n");d.endsWith("\n")&&u[u.length-1]===""&&u.pop();p=u.filter(function(x){return x.trim().length>0});if(n){x10=p.map(function(v){return nve(v,i,s)});m=Zht(x10,c)}else{x11=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=p[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){v10=_step1.value;y10=nve(v10,i,s);(_x1=x11).push.apply(_x1,_to_consumable_array(y10))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}m=Kht(x11,a,c)}return[2,(m.length>0&&(m+="\n"),{exitCode:0,stdout:m,stderr:""})]}})})()}},j3e={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0}}),U3e={};St(U3e,{flagsForFuzzing:function(){return q3e},join:function(){return B3e}});function Jht(e,t){return t?e.split(t):e.split(/[ \t]+/).filter(function(r){return r.length>0})}function Yht(e,t,r,n){var a;var i=Jht(e,t),o=(a=i[r-1])!=null?a:"";return n&&(o=o.toLowerCase()),{fields:i,joinKey:o,original:e}}function bq(e,t,r){var a,s,l;var n=(a=r.separator)!=null?a:" ";if(r.outputFormat){var c=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.outputFormat[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,d=_step_value.file,u=_step_value.field;var p=d===1?e:t;p&&u===0?c.push(p.joinKey):p&&p.fields[u-1]!==void 0?c.push(p.fields[u-1]):c.push(r.emptyString)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return c.join(n)}var i=[],o=(l=(s=e==null?void 0:e.joinKey)!=null?s:t==null?void 0:t.joinKey)!=null?l:"";if(i.push(o),e)for(var c10=0;c10<e.fields.length;c10++)c10!==r.field1-1&&i.push(e.fields[c10]);if(t)for(var c11=0;c11<t.fields.length;c11++)c11!==r.field2-1&&i.push(t.fields[c11]);return i.join(n)}function Xht(e){var t=e.split(","),r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.trim().match(/^(\d+)\.(\d+)$/);if(!i)return null;var o=Number.parseInt(i[1],10),a=Number.parseInt(i[2],10);if(o!==1&&o!==2)return null;r.push({file:o,field:a})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var ave,B3e,q3e,egt=se(function(){"use strict";kr(),jt(),ave={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]},B3e={name:"join",execute:function(e,t){return _async_to_generator(function(){var p,r,n,i,m,h,h10,h11,h12,h13,_n,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m10,h14,g,err,a,s,l,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m11,h15,d,u,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,m12,h16,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,g10,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,m13;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(ave)];r={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},n=[],i=0;for(;i<e.length;){m=e[i];if(m==="-1"&&i+1<e.length){h=Number.parseInt(e[i+1],10);if(Number.isNaN(h)||h<1)return[2,{exitCode:1,stdout:"",stderr:"join: invalid field number: '".concat(e[i+1],"'\n")}];r.field1=h,i+=2}else if(m==="-2"&&i+1<e.length){h10=Number.parseInt(e[i+1],10);if(Number.isNaN(h10)||h10<1)return[2,{exitCode:1,stdout:"",stderr:"join: invalid field number: '".concat(e[i+1],"'\n")}];r.field2=h10,i+=2}else if((m==="-t"||m==="--field-separator")&&i+1<e.length)r.separator=e[i+1],i+=2;else if(m.startsWith("-t")&&m.length>2)r.separator=m.slice(2),i++;else if(m==="-a"&&i+1<e.length){h11=Number.parseInt(e[i+1],10);if(h11!==1&&h11!==2)return[2,{exitCode:1,stdout:"",stderr:"join: invalid file number: '".concat(e[i+1],"'\n")}];r.printUnpairable.add(h11),i+=2}else if(m.match(/^-a[12]$/))r.printUnpairable.add(Number.parseInt(m[2],10)),i++;else if(m==="-v"&&i+1<e.length){h12=Number.parseInt(e[i+1],10);if(h12!==1&&h12!==2)return[2,{exitCode:1,stdout:"",stderr:"join: invalid file number: '".concat(e[i+1],"'\n")}];r.onlyUnpairable.add(h12),i+=2}else if(m.match(/^-v[12]$/))r.onlyUnpairable.add(Number.parseInt(m[2],10)),i++;else if(m==="-e"&&i+1<e.length)r.emptyString=e[i+1],i+=2;else if(m==="-o"&&i+1<e.length){h13=Xht(e[i+1]);if(!h13)return[2,{exitCode:1,stdout:"",stderr:"join: invalid field spec: '".concat(e[i+1],"'\n")}];r.outputFormat=h13,i+=2}else if(m==="-i"||m==="--ignore-case")r.ignoreCase=!0,i++;else if(m==="--"){;(_n=n).push.apply(_n,_to_consumable_array(e.slice(i+1)));break}else{if(m.startsWith("-")&&m!=="-")return[2,fr("join",m)];n.push(m),i++}}if(n.length!==2)return[2,{exitCode:1,stdout:"",stderr:n.length<2?"join: missing file operand\n":"join: extra operand\n"}];o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];m10=_step.value;if(!(m10==="-"))return[3,3];o.push((p=Sn(t.stdin))!=null?p:"");return[3,5];case 3:h14=t.fs.resolvePath(t.cwd,m10);return[4,t.fs.readFile(h14)];case 4:g=_state.sent();if(g===null)return[2,{exitCode:1,stdout:"",stderr:"join: ".concat(m10,": No such file or directory\n")}];o.push(g);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:a=function(m,h){var g=m.split("\n");return m.endsWith("\n")&&g[g.length-1]===""&&g.pop(),g.filter(function(x){return x.length>0}).map(function(x){return Yht(x,r.separator,h,r.ignoreCase)})},s=a(o[0],r.field1),l=a(o[1],r.field2),c=new Map;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){m11=_step1.value;h15=c.get(m11.joinKey);h15?h15.push(m11):c.set(m11.joinKey,[m11])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}d=[],u=new Set;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=s[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){m12=_step2.value;h16=c.get(m12.joinKey);if(h16&&h16.length>0){_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(u.add(m12.joinKey),r.onlyUnpairable.size===0)try{for(_iterator3=h16[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){g10=_step3.value;d.push(bq(m12,g10,r))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}else(r.printUnpairable.has(1)||r.onlyUnpairable.has(1))&&d.push(bq(m12,null,r))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;if(r.printUnpairable.has(2)||r.onlyUnpairable.has(2))try{for(_iterator4=l[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){m13=_step4.value;u.has(m13.joinKey)||d.push(bq(null,m13,r))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[2,{exitCode:0,stdout:n1(d.length>0?"".concat(d.join("\n"),"\n"):""),stderr:"",stdoutEncoding:"binary"}]}})})()}},q3e={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}}),W3e={};St(W3e,{flagsForFuzzing:function(){return G3e},teeCommand:function(){return V3e}});var sve,lve,V3e,G3e,tgt=se(function(){"use strict";kr(),zo(),jt(),sve={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},lve={append:{short:"a",long:"append",type:"boolean"}},V3e={name:"tee",execute:function execute(e,t){return _async_to_generator(function(){var r,_r_result_flags,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,_tmp,c10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(sve)];r=Fo("tee",e,lve);if(!r.ok)return[2,r.error];_r_result_flags=r.result.flags,n=_r_result_flags.append,i=r.result.positional,o=t.stdin,a="",s=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,11,12,13]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];l=_step.value;_state.label=3;case 3:_state.trys.push([3,8,,9]);c=t.fs.resolvePath(t.cwd,l);if(!n)return[3,5];return[4,t.fs.appendFile(c,o,"binary")];case 4:_tmp=_state.sent();return[3,7];case 5:return[4,t.fs.writeFile(c,o,"binary")];case 6:_tmp=_state.sent();_state.label=7;case 7:_tmp;return[3,9];case 8:c10=_state.sent();a+="tee: ".concat(l,": No such file or directory\n"),s=1;return[3,9];case 9:_iteratorNormalCompletion=true;return[3,2];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:return[2,{stdout:o,stderr:a,exitCode:s,stdoutEncoding:"binary"}]}})})()}},G3e={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0}});function Yc(e,t){switch(e.type){case"name":{var r=e.pattern,n=r.match(/^\*(\.[a-zA-Z0-9]+)$/);if(n){var i=n[1],o=t.name;if(e.ignoreCase){if(!o.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!o.endsWith(i))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:su(t.name,r,e.ignoreCase),pruned:!1,printed:!1}}case"path":{var r10=e.pattern,n10=t.relativePath,i10=r10.split("/");for(var a=0;a<i10.length-1;a++){var s=i10[a];if(s&&s!=="."&&s!==".."&&!s.includes("*")&&!s.includes("?")&&!s.includes("[")){var l="/".concat(s,"/");if(e.ignoreCase){if(!n10.toLowerCase().includes(l.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n10.includes(l))return{matches:!1,pruned:!1,printed:!1}}}var o10=r10.match(/\*(\.[a-zA-Z0-9]+)$/);if(o10){var a9=o10[1];if(e.ignoreCase){if(!n10.toLowerCase().endsWith(a9.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n10.endsWith(a9))return{matches:!1,pruned:!1,printed:!1}}return{matches:su(n10,r10,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{var r11=e.ignoreCase?"i":"";return{matches:ir(e.pattern,r11).test(t.relativePath),pruned:!1,printed:!1}}catch(r){return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{var r12=(Date.now()-t.mtime)/864e5,n11;return e.comparison==="more"?n11=r12>e.days:e.comparison==="less"?n11=r12<e.days:n11=Math.floor(r12)===e.days,{matches:n11,pruned:!1,printed:!1}}case"newer":{var r13=t.newerRefTimes.get(e.refPath);return r13===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>r13,pruned:!1,printed:!1}}case"size":{var r14=e.value;switch(e.unit){case"c":r14=e.value;break;case"k":r14=e.value*1024;break;case"M":r14=e.value*1024*1024;break;case"G":r14=e.value*1024*1024*1024;break;case"b":r14=e.value*512;break}var n12;return e.comparison==="more"?n12=t.size>r14:e.comparison==="less"?n12=t.size<r14:e.unit==="b"?n12=Math.ceil(t.size/512)===e.value:n12=t.size===r14,{matches:n12,pruned:!1,printed:!1}}case"perm":{var r15=t.mode&511,n13=e.mode&511,i11;return e.matchType==="exact"?i11=r15===n13:e.matchType==="all"?i11=(r15&n13)===n13:i11=(r15&n13)!==0,{matches:i11,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{var r16=Yc(e.expr,t);return{matches:!r16.matches,pruned:r16.pruned,printed:!1}}case"and":{var r17=Yc(e.left,t);if(!r17.matches)return{matches:!1,pruned:r17.pruned,printed:!1};var n14=Yc(e.right,t);return{matches:n14.matches,pruned:r17.pruned||n14.pruned,printed:r17.printed||n14.printed}}case"or":{var r18=Yc(e.left,t);if(r18.matches)return r18;var n15=Yc(e.right,t);return{matches:n15.matches,pruned:r18.pruned||n15.pruned,printed:n15.printed}}}}function p9(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return p9(e.expr);case"and":case"or":return p9(e.left)||p9(e.right)}}function f9(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return f9(e.expr);case"and":case"or":return f9(e.left)||f9(e.right);default:return!1}}function rgt(e){var t={terminalDirName:null,requiredExtension:null};if(!e)return t;var r=ngt(e);if(igt(e)&&r.length===1){var n=r[0].split("/").filter(function(i){return i.length>0});if(n.length>=2)for(var i=n.length-2;i>=0;i--){var o=n[i];if(!o.includes("*")&&!o.includes("?")&&!o.includes("[")&&o!=="."&&o!==".."){var a=n[i+1];if(a&&(a.includes("*")||a.includes("?"))){t.terminalDirName=o;var s=a.match(/^\*(\.[a-zA-Z0-9]+)$/);s&&(t.requiredExtension=s[1])}break}}}return t}function ngt(e){var t=[],r=function(n){n.type==="path"?t.push(n.pattern):n.type==="not"?r(n.expr):(n.type==="and"||n.type==="or")&&(r(n.left),r(n.right))};return r(e),t}function igt(e){var t=function(r){return r.type==="type"&&r.fileType==="f"?!0:r.type==="not"?t(r.expr):r.type==="and"||r.type==="or"?t(r.left)||t(r.right):!1};return t(e)}function ogt(e){var t=[],r=function(n){n&&(n.type==="newer"?t.push(n.refPath):n.type==="not"?r(n.expr):(n.type==="and"||n.type==="or")&&(r(n.left),r(n.right)))};return r(e),t}function m9(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return m9(e.expr);case"and":case"or":return m9(e.left)&&m9(e.right)}}function Yv(e,t,r,n,i){switch(e.type){case"name":{var o=e.pattern,a=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(a){var s=a[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:su(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{var o10=e.pattern,a9=o10.split("/");for(var l=0;l<a9.length-1;l++){var c=a9[l];if(c&&c!=="."&&c!==".."&&!c.includes("*")&&!c.includes("?")&&!c.includes("[")){var d="/".concat(c,"/");if(e.ignoreCase){if(!r.toLowerCase().includes(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(d))return{matches:!1,pruned:!1,printed:!1}}}var s10=o10.match(/\*(\.[a-zA-Z0-9]+)$/);if(s10){var l10=s10[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(l10.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(l10))return{matches:!1,pruned:!1,printed:!1}}return{matches:su(r,o10,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{var o11=e.ignoreCase?"i":"";return{matches:ir(e.pattern,o11).test(r),pruned:!1,printed:!1}}catch(o){return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:n,pruned:!1,printed:!1}:e.fileType==="d"?{matches:i,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{var o12=Yv(e.expr,t,r,n,i);return{matches:!o12.matches,pruned:o12.pruned,printed:!1}}case"and":{var o13=Yv(e.left,t,r,n,i);if(!o13.matches)return{matches:!1,pruned:o13.pruned,printed:!1};var a10=Yv(e.right,t,r,n,i);return{matches:a10.matches,pruned:o13.pruned||a10.pruned,printed:o13.printed||a10.printed}}case"or":{var o14=Yv(e.left,t,r,n,i);if(o14.matches)return o14;var a11=Yv(e.right,t,r,n,i);return{matches:a11.matches,pruned:o14.pruned||a11.pruned,printed:a11.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function h9(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return h9(e.expr);case"and":case"or":return h9(e.left)||h9(e.right);default:return!1}}function jh(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return jh(e.expr);case"and":case"or":return jh(e.left)&&jh(e.right)}}function agt(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!jh(e))return dW(e,t);var r={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:Yc(e,r).pruned}}function dW(e,t){switch(e.type){case"or":{if(jh(e.left)){var r={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(Yc(e.left,r).pruned)return{shouldPrune:!0}}return dW(e.right,t)}case"and":{if(jh(e.left)&&jh(e.right)){var r10={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:Yc(e,r10).pruned}}if(jh(e.left)){var r11={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return Yc(e.left,r11).matches?dW(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}var sgt=se(function(){"use strict";Ei(),Qwe()});function lgt(e,t){var r=[],n=[],i=t;for(;i<e.length;){var a=e[i];if(a==="("||a==="\\("){r.push({type:"lparen"}),i++;continue}if(a===")"||a==="\\)"){r.push({type:"rparen"}),i++;continue}if(a==="-name"&&i+1<e.length)r.push({type:"expr",expr:{type:"name",pattern:e[++i]}});else if(a==="-iname"&&i+1<e.length)r.push({type:"expr",expr:{type:"name",pattern:e[++i],ignoreCase:!0}});else if(a==="-path"&&i+1<e.length)r.push({type:"expr",expr:{type:"path",pattern:e[++i]}});else if(a==="-ipath"&&i+1<e.length)r.push({type:"expr",expr:{type:"path",pattern:e[++i],ignoreCase:!0}});else if(a==="-regex"&&i+1<e.length)r.push({type:"expr",expr:{type:"regex",pattern:e[++i]}});else if(a==="-iregex"&&i+1<e.length)r.push({type:"expr",expr:{type:"regex",pattern:e[++i],ignoreCase:!0}});else if(a==="-type"&&i+1<e.length){var s=e[++i];if(s==="f"||s==="d")r.push({type:"expr",expr:{type:"type",fileType:s}});else return{expr:null,pathIndex:i,error:"find: Unknown argument to -type: ".concat(s,"\n"),actions:[]}}else if(a==="-empty")r.push({type:"expr",expr:{type:"empty"}});else if(a==="-mtime"&&i+1<e.length){var s10=e[++i],l="exact",c=s10;s10.startsWith("+")?(l="more",c=s10.slice(1)):s10.startsWith("-")&&(l="less",c=s10.slice(1));var d=parseInt(c,10);Number.isNaN(d)||r.push({type:"expr",expr:{type:"mtime",days:d,comparison:l}})}else if(a==="-newer"&&i+1<e.length){var s11=e[++i];r.push({type:"expr",expr:{type:"newer",refPath:s11}})}else if(a==="-size"&&i+1<e.length){var s12=e[++i],l10="exact",c10=s12;s12.startsWith("+")?(l10="more",c10=s12.slice(1)):s12.startsWith("-")&&(l10="less",c10=s12.slice(1));var d10=c10.match(/^(\d+)([ckMGb])?$/);if(d10){var u=parseInt(d10[1],10),p=d10[2]||"b";r.push({type:"expr",expr:{type:"size",value:u,unit:p,comparison:l10}})}}else if(a==="-perm"&&i+1<e.length){var s13=e[++i],l11="exact",c11=s13;s13.startsWith("-")?(l11="all",c11=s13.slice(1)):s13.startsWith("/")&&(l11="any",c11=s13.slice(1));var d11=parseInt(c11,8);Number.isNaN(d11)||r.push({type:"expr",expr:{type:"perm",mode:d11,matchType:l11}})}else if(a==="-prune")r.push({type:"expr",expr:{type:"prune"}});else if(a==="-not"||a==="!")r.push({type:"not"});else if(a==="-o"||a==="-or")r.push({type:"op",op:"or"});else if(a==="-a"||a==="-and")r.push({type:"op",op:"and"});else if(a==="-maxdepth"||a==="-mindepth")i++;else if(a!=="-depth")if(a==="-exec"){var s14=[];for(i++;i<e.length&&e[i]!==";"&&e[i]!=="+";)s14.push(e[i]),i++;if(i>=e.length)return{expr:null,pathIndex:i,error:"find: missing argument to `-exec'\n",actions:[]};var l12=e[i]==="+";n.push({type:"exec",command:s14,batchMode:l12})}else if(a==="-print")r.push({type:"expr",expr:{type:"print"}}),n.push({type:"print"});else if(a==="-print0")n.push({type:"print0"});else if(a==="-printf"&&i+1<e.length){var s15=e[++i];n.push({type:"printf",format:s15})}else if(a==="-delete")n.push({type:"delete"});else{if(a.startsWith("-"))return{expr:null,pathIndex:i,error:"find: unknown predicate '".concat(a,"'\n"),actions:[]};if(r.length===0){i++;continue}break}i++}if(r.length===0)return{expr:null,pathIndex:i,actions:n};var o=ugt(r);return o.error?{expr:null,pathIndex:i,error:o.error,actions:n}:{expr:o.expr,pathIndex:i,actions:n}}function ugt(e){var t=0;function r(){var a=n();if(!a)return null;for(;t<e.length;){var s=e[t];if(s.type==="op"&&s.op==="or"){t++;var l=n();if(!l)return a;a={type:"or",left:a,right:l}}else break}return a}function n(){var a=i();if(!a)return null;for(;t<e.length;){var s=e[t];if(s.type==="op"&&s.op==="and"){t++;var l=i();if(!l)return a;a={type:"and",left:a,right:l}}else if(s.type==="expr"||s.type==="not"||s.type==="lparen"){var l10=i();if(!l10)return a;a={type:"and",left:a,right:l10}}else break}return a}function i(){if(t<e.length&&e[t].type==="not"){t++;var a=i();return a?{type:"not",expr:a}:null}return o()}function o(){if(t>=e.length)return null;var a=e[t];if(a.type==="lparen"){t++;var s=r();return t<e.length&&e[t].type==="rparen"&&t++,s}return a.type==="expr"?(t++,a.expr):(a.type,null)}return{expr:r()}}var cgt=se(function(){"use strict"}),H3e={};St(H3e,{findCommand:function(){return Z3e},flagsForFuzzing:function(){return K3e}});function dgt(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function pgt(e,t,r){e({category:"find",name:"summary",durationMs:r,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:r-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}function fgt(e,t){var r=qbe(e),n="",i=0;for(;i<r.length;)if(r[i]==="%"&&i+1<r.length){if(i++,r[i]==="%"){n+="%",i++;continue}var _ept=_sliced_to_array(ept(r,i),3),o=_ept[0],a=_ept[1],s=_ept[2];if(i+=s,i>=r.length){n+="%";break}var l=r[i],c=void 0;switch(l){case"f":c=t.name,i++;break;case"h":{var d=t.path.lastIndexOf("/");c=d>0?t.path.slice(0,d):".",i++;break}case"p":c=t.path,i++;break;case"P":{var d10=t.startingPoint;t.path===d10?c="":t.path.startsWith("".concat(d10,"/"))?c=t.path.slice(d10.length+1):d10==="."&&t.path.startsWith("./")?c=t.path.slice(2):c=t.path,i++;break}case"s":c=String(t.size),i++;break;case"d":c=String(t.depth),i++;break;case"m":c=(t.mode&511).toString(8),i++;break;case"M":c=nW(t.mode,t.isDirectory),i++;break;case"t":{var d11=new Date(t.mtime);c=mgt(d11),i++;break}case"T":{if(i+1<r.length){var d12=r[i+1],u=new Date(t.mtime);c=hgt(u,d12),i+=2}else c="%T",i++;break}default:n+="%".concat(o!==0||a!==-1?"".concat(o,".").concat(a):"").concat(l),i++;continue}n+=Bbe(c,o,a)}else n+=r[i],i++;return n}function mgt(e){var t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=t[e.getDay()],i=r[e.getMonth()],o=String(e.getDate()).padStart(2," "),a=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0"),c=e.getFullYear();return"".concat(n," ").concat(i," ").concat(o," ").concat(a,":").concat(s,":").concat(l," ").concat(c)}function hgt(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return"".concat(String(e.getHours()).padStart(2,"0"),":").concat(String(e.getMinutes()).padStart(2,"0"),":").concat(String(e.getSeconds()).padStart(2,"0"));case"F":return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"));default:return"%T".concat(t)}}var wq,uve,cve,Z3e,K3e,ggt=se(function(){"use strict";m_(),qwe(),jt(),Wbe(),sgt(),cgt(),wq=500,uve={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},cve=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),Z3e={name:"find",execute:function execute(e,t){return _async_to_generator(function(){var O,M,r,n,i,o,a,R,$,_lgt,s,l,c,d,u,p,m,h,g,x,v,y,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,R1,$1,z,z10,err,_,b,w,S,k,E,C,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_loop,_iterator1,_step1,err,I,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,R10,_10,$10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,z11,D,L,ee,err,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,$11,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_$1,$12,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator5,_step5,D10,z12,_loop1,_iterator6,_step6,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(uve)];r=[],n=null,i=null,o=!1,a=!1;for(R=0;R<e.length;R++){$=e[R];if($==="-maxdepth"&&R+1<e.length)a=!0,n=parseInt(e[++R],10);else if($==="-mindepth"&&R+1<e.length)a=!0,i=parseInt(e[++R],10);else if($==="-depth")a=!0,o=!0;else if($==="-exec")for(a=!0,R++;R<e.length&&e[R]!==";"&&e[R]!=="+";)R++;else!$.startsWith("-")&&$!==";"&&$!=="+"&&$!=="("&&$!==")"&&$!=="\\("&&$!=="\\)"&&$!=="!"?a||r.push($):cve.has($)?(a=!0,R++):($.startsWith("-")||$==="("||$==="\\("||$==="!")&&(a=!0)}r.length===0&&r.push(".");_lgt=lgt(e,0),s=_lgt.expr,l=_lgt.error,c=_lgt.actions;if(l)return[2,{stdout:"",stderr:l,exitCode:1}];d=c.some(function(R){return R.type==="print"}),u=c.length===0,p=[],m=c.some(function(R){return R.type==="printf"}),h=[],g="",x=0,v=ogt(s),y=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=v[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];R1=_step.value;$1=t.fs.resolvePath(t.cwd,R1);_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,t.fs.stat($1)];case 4:z=_state.sent();y.set(R1,(M=(O=z.mtime)==null?void 0:O.getTime())!=null?M:Date.now());return[3,6];case 5:z10=_state.sent();return[3,6];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:_=c.some(function(R){if(R.type!=="printf")return!1;var $=R.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test($)}),b=p9(s)||_,w=f9(s),S=rgt(s),k=h9(s),E=m9(s),C=typeof t.fs.readdirWithFileTypes=="function";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=11;case 11:_state.trys.push([11,16,17,18]);_loop=function(){var R,_p1,_h1,ee,pe,$,T,z,U,D,_$L,N,U1;return _ts_generator(this,function(_state){switch(_state.label){case 0:R=_step1.value;ee=function ee(U){return _async_to_generator(function(){var nt,gt,Ie,we,Oe,G,K,me,V,ie,re,Pe,Pe1,de,xe,Y,oe,H,J,j,Q,Fe,Pe2,tt,it,pt,Pe3,tt1;return _ts_generator(this,function(_state){switch(_state.label){case 0:G=U.path,K=U.depth,me=U.typeInfo;if(D.nodeCount++,K>(n!=null?n:256))return[2,null];if(!(me&&!b))return[3,1];V=me.isFile,ie=me.isDirectory;return[3,5];case 1:_state.trys.push([1,3,,4]);Pe=Date.now();return[4,t.fs.stat(G)];case 2:re=_state.sent(),D.statCalls++,D.statTime+=Date.now()-Pe;return[3,4];case 3:Pe1=_state.sent();return[2,null];case 4:if(!re)return[2,null];V=re.isFile,ie=re.isDirectory;_state.label=5;case 5:G===z?de=R.split("/").pop()||R:de=G.split("/").pop()||"";xe=G===z?R:R==="."?"./".concat(G.slice(z==="/"?z.length:z.length+1)):R+G.slice(z.length),Y=[],oe=null,H=null,J=!1;ie&&k&&!o&&(J=agt(s,{name:de,relativePath:xe,isFile:V,isDirectory:ie}).shouldPrune,J&&D.earlyPrunes++);j=K>=(n!=null?n:256),Q=S.terminalDirName!==null&&de===S.terminalDirName,Fe=!j&&!Q&&!J;if(!(ie&&(Fe||w||Q)&&!J))return[3,9];Pe2=Date.now();if(!(C&&t.fs.readdirWithFileTypes))return[3,7];return[4,t.fs.readdirWithFileTypes(G)];case 6:if(oe=_state.sent(),H=oe.map(function(tt){return tt.name}),D.readdirCalls++,D.readdirTime+=Date.now()-Pe2,Fe)Y=oe.map(function(tt,We){return{path:G==="/"?"/".concat(tt.name):"".concat(G,"/").concat(tt.name),depth:K+1,typeInfo:{isFile:tt.isFile,isDirectory:tt.isDirectory},resultIndex:We}});else if(Q){tt=S.requiredExtension;Y=oe.filter(function(We){return We.isFile&&(!tt||We.name.endsWith(tt))}).map(function(We,Ut){return{path:G==="/"?"/".concat(We.name):"".concat(G,"/").concat(We.name),depth:K+1,typeInfo:{isFile:We.isFile,isDirectory:We.isDirectory},resultIndex:Ut}})}return[3,9];case 7:return[4,t.fs.readdir(G)];case 8:H=_state.sent(),D.readdirCalls++,D.readdirTime+=Date.now()-Pe2,Fe&&(Y=H.map(function(tt,We){return{path:G==="/"?"/".concat(tt):"".concat(G,"/").concat(tt),depth:K+1,resultIndex:We}}));_state.label=9;case 9:it=V?((nt=re==null?void 0:re.size)!=null?nt:0)===0:H!==null&&H.length===0,pt=J;if(!o&&s!==null&&!J&&k){Pe3=Date.now(),tt1={name:de,relativePath:xe,isFile:V,isDirectory:ie,isEmpty:it,mtime:(Ie=(gt=re==null?void 0:re.mtime)==null?void 0:gt.getTime())!=null?Ie:Date.now(),size:(we=re==null?void 0:re.size)!=null?we:0,mode:(Oe=re==null?void 0:re.mode)!=null?Oe:420,newerRefTimes:y};pt=Yc(s,tt1).pruned,D.evalCalls++,D.evalTime+=Date.now()-Pe3}return[2,{relativePath:xe,name:de,isFile:V,isDirectory:ie,isEmpty:it,stat:re,depth:K,children:pt?[]:Y,pruned:pt}]}})})()};pe=function pe(){return _async_to_generator(function(){var U,me,G,V,ie,re,de,xe,Y,oe,H,J,j,Q,Q5,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,de1,xe1,_U_paths,_U_printfData,de2,me1,K,V10,ie1,re1,de3,xe2,Y5,oe1,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,H5,J5,j1,_$1,Q10,Fe,it,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,pt,nt;return _ts_generator(this,function(_state){switch(_state.label){case 0:U={paths:[],printfData:[]};if(!o)return[3,5];me=function me1(de){var xe={paths:[],printfData:[]},Y=V[de];if(!Y)return xe;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Y.childIndices[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var J=_step.value;var _xe_paths,_xe_printfData;var j=me(J);(_xe_paths=xe.paths).push.apply(_xe_paths,_to_consumable_array(j.paths)),(_xe_printfData=xe.printfData).push.apply(_xe_printfData,_to_consumable_array(j.printfData))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _$1=$(Y.node),oe=_$1.print,H=_$1.printfData;return oe&&(xe.paths.push(Y.node.relativePath),H&&xe.printfData.push(H)),xe};G=me;V=[],ie=[{item:{path:z,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],re=new Map;_state.label=1;case 1:if(!(ie.length>0))return[3,4];de=Date.now(),xe=ie.splice(0,wq);return[4,Promise.all(xe.map(function(oe){return ee(oe.item)}))];case 2:Y=_state.sent();D.batchCount++,D.batchTime+=Date.now()-de;for(oe=0;oe<xe.length;oe++){H=Y[oe],J=xe[oe];if(!H)continue;j=V.length;if(J.parentIndex>=0){Q=re.get(J.parentIndex)||[];Q.push(j),re.set(J.parentIndex,Q)}V.push({node:H,parentIndex:J.parentIndex,childIndices:[]});for(Q5=0;Q5<H.children.length;Q5++)ie.push({item:H.children[Q5],parentIndex:j,childOrderInParent:Q5})}_state.label=3;case 3:return[3,1];case 4:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=re[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),de1=_step_value[0],xe1=_step_value[1];de1>=0&&de1<V.length&&(V[de1].childIndices=xe1)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(V.length>0){;de2=me(0);(_U_paths=U.paths).push.apply(_U_paths,_to_consumable_array(de2.paths)),(_U_printfData=U.printfData).push.apply(_U_printfData,_to_consumable_array(de2.printfData))}return[3,10];case 5:me1=function me(xe){var Y=V10.get(xe);Y&&(U.paths.push(Y.path),Y.printfData&&U.printfData.push(Y.printfData));var oe=de3.get(xe);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(oe)try{for(var _iterator=oe[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var H=_step.value;me1(H)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};K=me1;V10=new Map,ie1=0,re1=[{item:{path:z,depth:0,resultIndex:0},orderIndex:ie1++}],de3=new Map;_state.label=6;case 6:if(!(re1.length>0))return[3,9];xe2=Date.now(),Y5=re1.splice(0,wq);return[4,Promise.all(Y5.map(function(param){var H=param.item,J=param.orderIndex;return _async_to_generator(function(){var j;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,ee(H)];case 1:j=_state.sent();return[2,j?{node:j,orderIndex:J}:null]}})})()}))];case 7:oe1=_state.sent();D.batchCount++,D.batchTime+=Date.now()-xe2;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=oe1[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){H5=_step1.value;if(!H5)continue;J5=H5.node,j1=H5.orderIndex,_$1=$(J5),Q10=_$1.print,Fe=_$1.printfData;if(Q10&&V10.set(j1,{path:J5.relativePath,printfData:Fe}),J5.children.length>0){it=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=J5.children[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){pt=_step2.value;nt=ie1++;it.push(nt),re1.push({item:pt,orderIndex:nt})}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}de3.set(j1,it)}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=8;case 8:return[3,6];case 9:me1(0);_state.label=10;case 10:return[2,U]}})})()};$=function $(U){var me,V,ie,re,de,xe,Y,oe,H,J,j,Q,Fe,it;var G=i===null||U.depth>=i,K=!1;if(G&&s!==null){var pt=Date.now(),nt;if(E)nt=Yv(s,U.name,U.relativePath,U.isFile,U.isDirectory);else{var gt={name:U.name,relativePath:U.relativePath,isFile:U.isFile,isDirectory:U.isDirectory,isEmpty:U.isEmpty,mtime:(ie=(V=(me=U.stat)==null?void 0:me.mtime)==null?void 0:V.getTime())!=null?ie:Date.now(),size:(de=(re=U.stat)==null?void 0:re.size)!=null?de:0,mode:(Y=(xe=U.stat)==null?void 0:xe.mode)!=null?Y:420,newerRefTimes:y};nt=Yc(s,gt)}G=nt.matches,K=d?nt.printed:G,D.evalCalls++,D.evalTime+=Date.now()-pt}else G&&(K=!0);return K?{print:!0,printfData:m?{path:U.relativePath,name:U.name,size:(H=(oe=U.stat)==null?void 0:oe.size)!=null?H:0,mtime:(Q=(j=(J=U.stat)==null?void 0:J.mtime)==null?void 0:j.getTime())!=null?Q:Date.now(),mode:(it=(Fe=U.stat)==null?void 0:Fe.mode)!=null?it:420,isDirectory:U.isDirectory,depth:U.depth,startingPoint:R}:null}:{print:!1,printfData:null}};T=$;R.length>1&&R.endsWith("/")&&(R=R.slice(0,-1));z=t.fs.resolvePath(t.cwd,R);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.stat(z)];case 2:_state.sent();return[3,4];case 3:U=_state.sent();g+="find: ".concat(R,": No such file or directory\n"),x=1;return[2,"continue"];case 4:D=dgt(),_$L=Date.now();return[4,pe()];case 5:N=_state.sent();if((_p1=p).push.apply(_p1,_to_consumable_array(N.paths)),(_h1=h).push.apply(_h1,_to_consumable_array(N.printfData)),t.trace){U1=Date.now()-_$L;pgt(t.trace,D,U1),t.trace({category:"find",name:"searchPath",durationMs:U1,details:{path:R,resultsFound:N.paths.length}})}return[2]}})};_iterator1=r[Symbol.iterator]();_state.label=12;case 12:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,15];return[5,_ts_values(_loop())];case 13:_state.sent();_state.label=14;case 14:_iteratorNormalCompletion1=true;return[3,12];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 18:I="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(!(c.length>0))return[3,50];_state.label=19;case 19:_state.trys.push([19,47,48,49]);_iterator2=c[Symbol.iterator]();_state.label=20;case 20:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,46];R10=_step2.value;_10=R10.type;switch(_10){case"print":return[3,21];case"print0":return[3,22];case"delete":return[3,23];case"printf":return[3,34];case"exec":return[3,35]}return[3,45];case 21:I+=p.length>0?"".concat(p.join("\n"),"\n"):"";return[3,45];case 22:I+=p.length>0?"".concat(p.join("\0"),"\0"):"";return[3,45];case 23:$10=_to_consumable_array(p).sort(function(z,D){return D.length-z.length});_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;_state.label=24;case 24:_state.trys.push([24,31,32,33]);_iterator3=$10[Symbol.iterator]();_state.label=25;case 25:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,30];z11=_step3.value;D=t.fs.resolvePath(t.cwd,z11);_state.label=26;case 26:_state.trys.push([26,28,,29]);return[4,t.fs.rm(D,{recursive:!1})];case 27:_state.sent();return[3,29];case 28:L=_state.sent();ee=_instanceof(L,Error)?L.message:String(L);g+="find: cannot delete '".concat(z11,"': ").concat(ee,"\n"),x=1;return[3,29];case 29:_iteratorNormalCompletion3=true;return[3,25];case 30:return[3,33];case 31:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,33];case 32:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 33:return[3,45];case 34:_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=h[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){$11=_step4.value;I+=fgt(R10.format,$11)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[3,45];case 35:if(!t.exec)return[2,{stdout:"",stderr:"find: -exec not supported in this context\n",exitCode:1}];_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;if(!R10.batchMode)return[3,37];$12=[];_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(_iterator5=R10.command[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step5=_iterator5.next()).done);_iteratorNormalCompletion6=true){D10=_step5.value;D10==="{}"?(_$1=$12).push.apply(_$1,_to_consumable_array(p)):$12.push(D10)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}return[4,t.exec(i1([$12[0]]),{cwd:t.cwd,signal:t.signal,args:$12.slice(1)})];case 36:z12=_state.sent();I+=z12.stdout,g+=z12.stderr,z12.exitCode!==0&&(x=z12.exitCode);return[3,44];case 37:_state.trys.push([37,42,43,44]);_loop1=function(){var $,z,D;return _ts_generator(this,function(_state){switch(_state.label){case 0:$=_step6.value;z=R10.command.map(function(L){return L==="{}"?$:L});return[4,t.exec(i1([z[0]]),{cwd:t.cwd,signal:t.signal,args:z.slice(1)})];case 1:D=_state.sent();I+=D.stdout,g+=D.stderr,D.exitCode!==0&&(x=D.exitCode);return[2]}})};_iterator6=p[Symbol.iterator]();_state.label=38;case 38:if(!!(_iteratorNormalCompletion5=(_step6=_iterator6.next()).done))return[3,41];return[5,_ts_values(_loop1())];case 39:_state.sent();_state.label=40;case 40:_iteratorNormalCompletion5=true;return[3,38];case 41:return[3,44];case 42:err=_state.sent();_didIteratorError5=true;_iteratorError5=err;return[3,44];case 43:try{if(!_iteratorNormalCompletion5&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}return[7];case 44:return[3,45];case 45:_iteratorNormalCompletion2=true;return[3,20];case 46:return[3,49];case 47:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,49];case 48:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 49:return[3,51];case 50:u&&(I=p.length>0?"".concat(p.join("\n"),"\n"):"");_state.label=51;case 51:return[2,{stdout:I,stderr:g,exitCode:x}]}})})()}},K3e={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0}}),Q3e={};St(Q3e,{basenameCommand:function(){return J3e},flagsForFuzzing:function(){return Y3e}});var dve,J3e,Y3e,xgt=se(function(){"use strict";jt(),dve={name:"basename",summary:"strip directory and suffix from filenames",usage:"basename NAME [SUFFIX]\nbasename OPTION... NAME...",options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},J3e={name:"basename",execute:function execute(e,t){return _async_to_generator(function(){var a,r,n,i,s,l,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s10,l10,c;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(dve)];r=!1,n="",i=[];for(s=0;s<e.length;s++){l=e[s];l==="-a"||l==="--multiple"?r=!0:l==="-s"&&s+1<e.length?(n=e[++s],r=!0):l.startsWith("--suffix=")?(n=l.slice(9),r=!0):l.startsWith("-")||i.push(l)}if(i.length===0)return[2,{stdout:"",stderr:"basename: missing operand\n",exitCode:1}];!r&&i.length>=2&&(n=(a=i.pop())!=null?a:"");o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s10=_step.value;l10=s10.replace(/\/+$/,""),c=l10.split("/").pop()||l10;n&&c.endsWith(n)&&(c=c.slice(0,-n.length)),o.push(c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:"".concat(o.join("\n"),"\n"),stderr:"",exitCode:0}]})})()}},Y3e={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0}}),X3e={};St(X3e,{dirnameCommand:function(){return e6e},flagsForFuzzing:function(){return t6e}});var pve,e6e,t6e,ygt=se(function(){"use strict";jt(),pve={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},e6e={name:"dirname",execute:function execute(e,t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(pve)];r=e.filter(function(i){return!i.startsWith("-")});if(r.length===0)return[2,{stdout:"",stderr:"dirname: missing operand\n",exitCode:1}];n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;o=i.replace(/\/+$/,""),a=o.lastIndexOf("/");a===-1?n.push("."):a===0?n.push("/"):n.push(o.slice(0,a))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:"".concat(n.join("\n"),"\n"),stderr:"",exitCode:0}]})})()}},t6e={name:"dirname",flags:[],needsArgs:!0}}),r6e={};St(r6e,{flagsForFuzzing:function(){return o6e},treeCommand:function(){return i6e}});function vgt(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,s10,c,d,_s1,u,p,l,c10,d10,u10,p10,m,h,g,x,g10,s11;return _ts_generator(this,function(_state){switch(_state.label){case 0:o={output:"",stderr:"",dirCount:0,fileCount:0},a=e.fs.resolvePath(e.cwd,t);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(a)];case 2:if(!_state.sent().isDirectory)return[2,(o.output="".concat(t,"\n"),o.fileCount=1,o)];return[3,4];case 3:s=_state.sent();return[2,(o.stderr="tree: ".concat(t,": No such file or directory\n"),o)];case 4:if(o.output="".concat(t,"\n"),r.maxDepth!==null&&i>=r.maxDepth)return[2,o];_state.label=5;case 5:_state.trys.push([5,19,,20]);s10=[];if(!e.fs.readdirWithFileTypes)return[3,7];return[4,e.fs.readdirWithFileTypes(a)];case 6:s10=_state.sent().map(function(c){return{name:c.name,isDirectory:c.isDirectory}});return[3,12];case 7:return[4,e.fs.readdir(a)];case 8:c=_state.sent();d=0;_state.label=9;case 9:if(!(d<c.length))return[3,12];u=c.slice(d,d+100);return[4,Promise.all(u.map(function(m){return _async_to_generator(function(){var h,g,g10;return _ts_generator(this,function(_state){switch(_state.label){case 0:h=a==="/"?"/".concat(m):"".concat(a,"/").concat(m);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(h)];case 2:g=_state.sent();return[2,{name:m,isDirectory:g.isDirectory}];case 3:g10=_state.sent();return[2,null];case 4:return[2]}})})()}))];case 10:p=_state.sent();(_s1=s10).push.apply(_s1,_to_consumable_array(p.filter(function(m){return m!==null})));_state.label=11;case 11:d+=100;return[3,9];case 12:l=s10.filter(function(c){return!(!r.showHidden&&c.name.startsWith(".")||r.directoriesOnly&&!c.isDirectory)});l.sort(function(c,d){return c.name.localeCompare(d.name)});c10=0;_state.label=13;case 13:if(!(c10<l.length))return[3,18];d10=l[c10],u10=a==="/"?"/".concat(d10.name):"".concat(a,"/").concat(d10.name),p10=c10===l.length-1,m=p10?"`-- ":"|-- ",h=n+(p10?" ":"| ");if(!d10.isDirectory)return[3,16];o.dirCount++;g=r.fullPath?u10:d10.name;if(!(o.output+="".concat(n+m+g,"\n"),r.maxDepth===null||i+1<r.maxDepth))return[3,15];return[4,n6e(e,u10,r,h,i+1)];case 14:x=_state.sent();o.output+=x.output,o.dirCount+=x.dirCount,o.fileCount+=x.fileCount;_state.label=15;case 15:return[3,17];case 16:o.fileCount++;g10=r.fullPath?u10:d10.name;o.output+="".concat(n+m+g10,"\n");_state.label=17;case 17:c10++;return[3,13];case 18:return[3,20];case 19:s11=_state.sent();o.stderr="tree: ".concat(t,": Permission denied\n");return[3,20];case 20:return[2,o]}})})()}function n6e(e,t,r,n,i){return _async_to_generator(function(){var o,a,l,c,_a1,d,u,s,l10,c10,d10,u10,p,m,h,g,h10,a9;return _ts_generator(this,function(_state){switch(_state.label){case 0:o={output:"",stderr:"",dirCount:0,fileCount:0};if(r.maxDepth!==null&&i>=r.maxDepth)return[2,o];_state.label=1;case 1:_state.trys.push([1,14,,15]);a=[];if(!e.fs.readdirWithFileTypes)return[3,3];return[4,e.fs.readdirWithFileTypes(t)];case 2:a=_state.sent().map(function(l){return{name:l.name,isDirectory:l.isDirectory}});return[3,8];case 3:return[4,e.fs.readdir(t)];case 4:l=_state.sent();c=0;_state.label=5;case 5:if(!(c<l.length))return[3,8];d=l.slice(c,c+100);return[4,Promise.all(d.map(function(p){return _async_to_generator(function(){var m,h,h10;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=t==="/"?"/".concat(p):"".concat(t,"/").concat(p);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(m)];case 2:h=_state.sent();return[2,{name:p,isDirectory:h.isDirectory}];case 3:h10=_state.sent();return[2,null];case 4:return[2]}})})()}))];case 6:u=_state.sent();(_a1=a).push.apply(_a1,_to_consumable_array(u.filter(function(p){return p!==null})));_state.label=7;case 7:c+=100;return[3,5];case 8:s=a.filter(function(l){return!(!r.showHidden&&l.name.startsWith(".")||r.directoriesOnly&&!l.isDirectory)});s.sort(function(l,c){return l.name.localeCompare(c.name)});l10=0;_state.label=9;case 9:if(!(l10<s.length))return[3,13];c10=s[l10],d10=t==="/"?"/".concat(c10.name):"".concat(t,"/").concat(c10.name),u10=l10===s.length-1,p=u10?"`-- ":"|-- ",m=n+(u10?" ":"| ");if(!c10.isDirectory)return[3,11];o.dirCount++;h=r.fullPath?d10:c10.name;o.output+="".concat(n+p+h,"\n");return[4,n6e(e,d10,r,m,i+1)];case 10:g=_state.sent();o.output+=g.output,o.dirCount+=g.dirCount,o.fileCount+=g.fileCount;return[3,12];case 11:o.fileCount++;h10=r.fullPath?d10:c10.name;o.output+="".concat(n+p+h10,"\n");_state.label=12;case 12:l10++;return[3,9];case 13:return[3,15];case 14:a9=_state.sent();return[3,15];case 15:return[2,o]}})})()}var fve,mve,i6e,o6e,_gt=se(function(){"use strict";zo(),n5(),jt(),fve={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},mve={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},i6e={name:"tree",execute:function execute(e,t){return _async_to_generator(function(){var c,r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(fve)];r=Fo("tree",e,mve);if(!r.ok)return[2,r.error];n={showHidden:r.result.flags.showHidden,directoriesOnly:r.result.flags.directoriesOnly,maxDepth:(c=r.result.flags.maxDepth)!=null?c:null,fullPath:r.result.flags.fullPath},i=r.result.positional;i.length===0&&i.push(".");o="",a="",s=0,l=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];d=_step.value;return[4,vgt(t,d,n,"",0)];case 3:u=_state.sent();o+=u.output,a+=u.stderr,s+=u.dirCount,l+=u.fileCount;_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,(o+="\n".concat(s," director").concat(s===1?"y":"ies"),n.directoriesOnly||(o+=", ".concat(l," file").concat(l===1?"":"s")),o+="\n",{stdout:o,stderr:a,exitCode:a?1:0})]}})})()}},o6e={name:"tree",flags:[{flag:"-a",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-L",type:"value",valueHint:"number"}],needsFiles:!0}}),a6e={};St(a6e,{duCommand:function(){return l6e},flagsForFuzzing:function(){return c6e}});function s6e(e,t,r,n,i){return _async_to_generator(function(){var a,o,s,l,c,_c1,p,m,h,g,_c2,x,v,p10,m10,_c3,h10,g10,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p11,m11,h11,u,p12,m12,h12,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,g11,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:o={output:"",totalSize:0,stderr:""};if(i>u6e)return[2,o];_state.label=1;case 1:_state.trys.push([1,18,,19]);return[4,e.fs.stat(t)];case 2:s=_state.sent();if(!s.isDirectory)return[2,(o.totalSize=s.size,(n.allFiles||i===0)&&(o.output=g9(s.size,n.humanReadable)+" "+r+"\n"),o)];l=0,c=[];if(!e.fs.readdirWithFileTypes)return[3,8];return[4,e.fs.readdirWithFileTypes(t)];case 3:p=_state.sent(),m=p.filter(function(g){return g.isFile}),h=p.filter(function(g){return g.isDirectory});g=0;_state.label=4;case 4:if(!(g<m.length))return[3,7];x=m.slice(g,g+100);return[4,Promise.all(x.map(function(y){return _async_to_generator(function(){var _,b,b10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=t==="/"?"/".concat(y.name):"".concat(t,"/").concat(y.name);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(_)];case 2:b=_state.sent();return[2,{name:y.name,isDirectory:!1,size:b.size}];case 3:b10=_state.sent();return[2,{name:y.name,isDirectory:!1,size:0}];case 4:return[2]}})})()}))];case 5:v=_state.sent();(_c2=c).push.apply(_c2,_to_consumable_array(v));_state.label=6;case 6:g+=100;return[3,4];case 7:(_c1=c).push.apply(_c1,_to_consumable_array(h.map(function(g){return{name:g.name,isDirectory:!0}})));return[3,13];case 8:return[4,e.fs.readdir(t)];case 9:p10=_state.sent();m10=0;_state.label=10;case 10:if(!(m10<p10.length))return[3,13];h10=p10.slice(m10,m10+100);return[4,Promise.all(h10.map(function(x){return _async_to_generator(function(){var v,y,y10;return _ts_generator(this,function(_state){switch(_state.label){case 0:v=t==="/"?"/".concat(x):"".concat(t,"/").concat(x);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(v)];case 2:y=_state.sent();return[2,{name:x,isDirectory:y.isDirectory,size:y.isDirectory?void 0:y.size}];case 3:y10=_state.sent();return[2,{name:x,isDirectory:!1,size:0}];case 4:return[2]}})})()}))];case 11:g10=_state.sent();(_c3=c).push.apply(_c3,_to_consumable_array(g10));_state.label=12;case 12:m10+=100;return[3,10];case 13:c.sort(function(p,m){return p.name.localeCompare(m.name)});d=c.filter(function(p){return!p.isDirectory});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=d[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){p11=_step.value;m11=(a=p11.size)!=null?a:0;if(l+=m11,n.allFiles&&!n.summarize){h11=r==="."?p11.name:"".concat(r,"/").concat(p11.name);o.output+=g9(m11,n.humanReadable)+" "+h11+"\n"}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}u=c.filter(function(p){return p.isDirectory});p12=0;_state.label=14;case 14:if(!(p12<u.length))return[3,17];m12=u.slice(p12,p12+100);return[4,Promise.all(m12.map(function(g){return _async_to_generator(function(){var x,v,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:x=t==="/"?"/".concat(g.name):"".concat(t,"/").concat(g.name),v=r==="."?g.name:"".concat(r,"/").concat(g.name);_tmp={name:g.name};return[4,s6e(e,x,v,n,i+1)];case 1:return[2,(_tmp.result=_state.sent(),_tmp)]}})})()}))];case 15:h12=_state.sent();h12.sort(function(g,x){return g.name.localeCompare(x.name)});_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=h12[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_step1.value,g11=_step_value.result;l+=g11.totalSize,n.summarize||(n.maxDepth===null||i+1<=n.maxDepth)&&(o.output+=g11.output)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=16;case 16:p12+=100;return[3,14];case 17:o.totalSize=l,(n.summarize||n.maxDepth===null||i<=n.maxDepth)&&(o.output+="".concat(g9(l,n.humanReadable)," ").concat(r,"\n"));return[3,19];case 18:s10=_state.sent();o.stderr="du: cannot read directory '".concat(r,"': Permission denied\n");return[3,19];case 19:return[2,o]}})})()}function g9(e,t){return t?e<1024?"".concat(e):e<1024*1024?"".concat((e/1024).toFixed(1),"K"):e<1024*1024*1024?"".concat((e/(1024*1024)).toFixed(1),"M"):"".concat((e/(1024*1024*1024)).toFixed(1),"G"):String(Math.ceil(e/1024)||1)}var hve,gve,l6e,u6e,c6e,bgt=se(function(){"use strict";zo(),n5(),jt(),hve={name:"du",summary:"estimate file space usage",usage:"du [OPTION]... [FILE]...",options:["-a write counts for all files, not just directories","-h print sizes in human readable format","-s display only a total for each argument","-c produce a grand total","--max-depth=N print total for directory only if N or fewer levels deep"," --help display this help and exit"]},gve={allFiles:{short:"a",type:"boolean"},humanReadable:{short:"h",type:"boolean"},summarize:{short:"s",type:"boolean"},grandTotal:{short:"c",type:"boolean"},maxDepth:{long:"max-depth",type:"number"}},l6e={name:"du",execute:function execute(e,t){return _async_to_generator(function(){var l,r,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,u,u10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(hve)];r=Fo("du",e,gve);if(!r.ok)return[2,r.error];n={allFiles:r.result.flags.allFiles,humanReadable:r.result.flags.humanReadable,summarize:r.result.flags.summarize,grandTotal:r.result.flags.grandTotal,maxDepth:(l=r.result.flags.maxDepth)!=null?l:null},i=r.result.positional;i.length===0&&i.push(".");o="",a="",s=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];c=_step.value;d=t.fs.resolvePath(t.cwd,c);_state.label=3;case 3:_state.trys.push([3,6,,7]);return[4,t.fs.stat(d)];case 4:_state.sent();return[4,s6e(t,d,c,n,0)];case 5:u=_state.sent();o+=u.output,s+=u.totalSize,a+=u.stderr;return[3,7];case 6:u10=_state.sent();a+="du: cannot access '".concat(c,"': No such file or directory\n");return[3,7];case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,(n.grandTotal&&i.length>0&&(o+="".concat(g9(s,n.humanReadable)," total\n")),{stdout:o,stderr:a,exitCode:a?1:0})]}})})()}},u6e=1e3,c6e={name:"du",flags:[{flag:"-a",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"--max-depth",type:"value",valueHint:"number"}],needsFiles:!0}}),pW={};St(pW,{envCommand:function(){return d6e},flagsForFuzzing:function(){return f6e},printenvCommand:function(){return p6e},printenvFlagsForFuzzing:function(){return m6e}});var xve,d6e,yve,p6e,f6e,m6e,vve=se(function(){"use strict";kr(),Vh(),jt(),xve={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},d6e={name:"env",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,d10,u,p,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value,l11,c10,l12,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,_step_value1,c11,d11,s;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(xve)];r=!1,n=[],i=new Map,o=-1;for(l=0;l<e.length;l++){c=e[l];if(c==="-i"||c==="--ignore-environment")r=!0;else if(c==="-u"&&l+1<e.length)n.push(e[++l]);else if(c.startsWith("-u"))n.push(c.slice(2));else if(c.startsWith("--unset="))n.push(c.slice(8));else{if(c.startsWith("--")&&c!=="--")return[2,fr("env",c)];if(c.startsWith("-")&&c!=="-"){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;if(d!=="i"&&d!=="u")return[2,fr("env","-".concat(d))]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}c.includes("i")&&(r=!0)}else if(c.includes("=")&&o===-1){d10=c.indexOf("="),u=c.slice(0,d10),p=c.slice(d10+1);i.set(u,p)}else{o=l;break}}}if(r)a=new Map(i);else{a=new Map(t.env);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=n[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){l10=_step1.value;a.delete(l10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=i[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_step_value=_sliced_to_array(_step2.value,2),l11=_step_value[0],c10=_step_value[1];a.set(l11,c10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}if(o===-1){l12=[];_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=a[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){_step_value1=_sliced_to_array(_step3.value,2),c11=_step_value1[0],d11=_step_value1[1];l12.push("".concat(c11,"=").concat(d11))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[2,{stdout:l12.join("\n")+(l12.length>0?"\n":""),stderr:"",exitCode:0}]}if(!t.exec)return[2,{stdout:"",stderr:"env: command execution not supported in this context\n",exitCode:1}];s=e.slice(o);return[2,t.exec("command",{cwd:t.cwd,env:Jc(a),replaceEnv:!0,stdin:t.stdin,stdinKind:"bytes",signal:t.signal,args:s})]})})()}},yve={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},p6e={name:"printenv",execute:function execute(e,t){return _async_to_generator(function(){var r,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,a,s,n,i,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,o10,a9;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(yve)];r=e.filter(function(o){return!o.startsWith("-")});if(r.length===0){o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t.env[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];o.push("".concat(a,"=").concat(s))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:o.join("\n")+(o.length>0?"\n":""),stderr:"",exitCode:0}]}n=[],i=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=r[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){o10=_step1.value;a9=t.env.get(o10);a9!==void 0?n.push(a9):i=1}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,{stdout:n.join("\n")+(n.length>0?"\n":""),stderr:"",exitCode:i}]})})()}},f6e={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},m6e={name:"printenv",flags:[]}}),fW={};St(fW,{aliasCommand:function(){return h6e},flagsForFuzzing:function(){return x6e},unaliasCommand:function(){return g6e},unaliasFlagsForFuzzing:function(){return y6e}});var _ve,U0,h6e,g6e,x6e,y6e,bve=se(function(){"use strict";jt(),_ve={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},U0="BASH_ALIAS_",h6e={name:"alias",execute:function execute(e,t){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,i,o,a,r,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,n10,i10,o10,o11,a9;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(_ve)];if(e.length===0){n="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t.env[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];if(i.startsWith(U0)){a=i.slice(U0.length);n+="alias ".concat(a,"='").concat(o,"'\n")}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:n,stderr:"",exitCode:0}]}r=e[0]==="--"?e.slice(1):e;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=r[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){n10=_step1.value;i10=n10.indexOf("=");if(i10===-1){o10=U0+n10;return[2,t.env.get(o10)?{stdout:"alias ".concat(n10,"='").concat(t.env.get(o10),"'\n"),stderr:"",exitCode:0}:{stdout:"",stderr:"alias: ".concat(n10,": not found\n"),exitCode:1}]}else{o11=n10.slice(0,i10),a9=n10.slice(i10+1);(a9.startsWith("'")&&a9.endsWith("'")||a9.startsWith('"')&&a9.endsWith('"'))&&(a9=a9.slice(1,-1)),t.env.set(U0+o11,a9)}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,{stdout:"",stderr:"",exitCode:0}]})})()}},g6e={name:"unalias",execute:function execute(e,t){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,r,n,i,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,o10,a;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]})];if(e.length===0)return[2,{stdout:"",stderr:"unalias: usage: unalias [-a] name [name ...]\n",exitCode:1}];if(e[0]==="-a"){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){o=_step.value;o.startsWith(U0)&&t.env.delete(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{stdout:"",stderr:"",exitCode:0}]}r=e[0]==="--"?e.slice(1):e,n=!1,i="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=r[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){o10=_step1.value;a=U0+o10;t.env.get(a)?t.env.delete(a):(i+="unalias: ".concat(o10,": not found\n"),n=!0)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,{stdout:"",stderr:i,exitCode:n?1:0}]})})()}},x6e={name:"alias",flags:[]},y6e={name:"unalias",flags:[{flag:"-a",type:"boolean"}]}}),v6e={};St(v6e,{flagsForFuzzing:function(){return b6e},historyCommand:function(){return _6e}});var wve,Sq,_6e,b6e,wgt=se(function(){"use strict";jt(),wve={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},Sq="BASH_HISTORY",_6e={name:"history",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(wve)];r=t.env.get(Sq)||"[]";try{n=JSON.parse(r)}catch(s){n=[]}if(e[0]==="-c")return[2,(t.env.set(Sq,"[]"),{stdout:"",stderr:"",exitCode:0})];i=n.length;e[0]&&/^\d+$/.test(e[0])&&(i=Math.min(parseInt(e[0],10),n.length));o=n.length-i,a="";for(s=o;s<n.length;s++){l=(s+1).toString().padStart(5," ");a+="".concat(l," ").concat(n[s],"\n")}return[2,{stdout:a,stderr:"",exitCode:0}]})})()}},b6e={name:"history",flags:[{flag:"-c",type:"boolean"}]}}),w6e={};St(w6e,{flagsForFuzzing:function(){return k6e},xargsCommand:function(){return S6e}});var Sve,S6e,k6e,Sgt=se(function(){"use strict";kr(),m_(),jt(),Sve={name:"xargs",summary:"build and execute command lines from standard input",usage:"xargs [OPTION]... [COMMAND [INITIAL-ARGS]]",options:["-I REPLACE replace occurrences of REPLACE with input","-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)","-n NUM use at most NUM arguments per command line","-P NUM run at most NUM processes at a time","-0, --null items are separated by null, not whitespace","-t, --verbose print commands before executing","-r, --no-run-if-empty do not run command if input is empty"," --help display this help and exit"]},S6e={name:"xargs",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,_,b,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,w,d,u,p,m,h,g,x,v,y,_10,_11,b10,w10,_12,b11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Sve)];r=null,n=null,i=null,o=null,a=!1,s=!1,l=!1,c=0;for(_=0;_<e.length;_++){b=e[_];if(b==="-I"&&_+1<e.length)r=e[++_],c=_+1;else if(b==="-d"&&_+1<e.length)n=e[++_].replace(/\\n/g,"\n").replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),c=_+1;else if(b==="-n"&&_+1<e.length)i=parseInt(e[++_],10),c=_+1;else if(b==="-P"&&_+1<e.length)o=parseInt(e[++_],10),c=_+1;else if(b==="-0"||b==="--null")a=!0,c=_+1;else if(b==="-t"||b==="--verbose")s=!0,c=_+1;else if(b==="-r"||b==="--no-run-if-empty")l=!0,c=_+1;else{if(b.startsWith("--"))return[2,fr("xargs",b)];if(b.startsWith("-")&&b.length>1){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=b.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){w=_step.value;if(!"0tr".includes(w))return[2,fr("xargs","-".concat(w))]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}b.includes("0")&&(a=!0),b.includes("t")&&(s=!0),b.includes("r")&&(l=!0),c=_+1}else if(!b.startsWith("-")){c=_;break}}}d=e.slice(c);d.length===0&&d.push("echo");u=Sn(t.stdin);if(a?p=u.split("\0").filter(function(_){return _.length>0}):n!==null?p=u.replace(/\n$/,"").split(n).filter(function(_){return _.length>0}):p=u.split(/\s+/).map(function(_){return _.trim()}).filter(function(_){return _.length>0}),p.length===0)return[2,l?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}];m="",h="",g=0,x=function(_){return/[\s"'\\$`!*?[\]{}();&|<>#]/.test(_)?'"'.concat(_.replace(/([\\"`$])/g,"\\$1"),'"'):_},v=function(_){return _async_to_generator(function(){var b;return _ts_generator(this,function(_state){if(s){b=_.map(x).join(" ");h+="".concat(b,"\n")}return[2,t.exec?t.exec(i1([_[0]]),{cwd:t.cwd,signal:t.signal,args:_.slice(1)}):{stdout:"".concat(_.map(x).join(" "),"\n"),stderr:"",exitCode:0}]})})()},y=function(_){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,b,w,S,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,k,_iterator1,_step1,b10,w10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!(o!==null&&o>1))return[3,5];b=0;_state.label=1;case 1:if(!(b<_.length))return[3,4];w=_.slice(b,b+o);return[4,Promise.all(w.map(v))];case 2:S=_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=S[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){k=_step.value;m+=k.stdout,h+=k.stderr,k.exitCode!==0&&(g=k.exitCode)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=3;case 3:b+=o;return[3,1];case 4:return[3,12];case 5:_state.trys.push([5,10,11,12]);_iterator1=_[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done))return[3,9];b10=_step1.value;return[4,v(b10)];case 7:w10=_state.sent();m+=w10.stdout,h+=w10.stderr,w10.exitCode!==0&&(g=w10.exitCode);_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2]}})})()};if(!(r!==null))return[3,2];_10=p.map(function(b){return d.map(function(w){return w.replaceAll(r,b)})});return[4,y(_10)];case 1:_state.sent();return[3,6];case 2:if(!(i!==null))return[3,4];_11=[];for(b10=0;b10<p.length;b10+=i){w10=p.slice(b10,b10+i);_11.push(_to_consumable_array(d).concat(_to_consumable_array(w10)))}return[4,y(_11)];case 3:_state.sent();return[3,6];case 4:_12=_to_consumable_array(d).concat(_to_consumable_array(p));return[4,v(_12)];case 5:b11=_state.sent();m+=b11.stdout,h+=b11.stderr,g=b11.exitCode;_state.label=6;case 6:return[2,{stdout:m,stderr:h,exitCode:g}]}})})()}},k6e={name:"xargs",flags:[{flag:"-I",type:"value",valueHint:"string"},{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-0",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-r",type:"boolean"}],stdinType:"text"}}),mW={};St(mW,{falseCommand:function(){return E6e},falseFlagsForFuzzing:function(){return A6e},flagsForFuzzing:function(){return T6e},trueCommand:function(){return C6e}});var C6e,E6e,T6e,A6e,kve=se(function(){"use strict";C6e={name:"true",execute:function execute(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,{stdout:"",stderr:"",exitCode:0}]})})()}},E6e={name:"false",execute:function execute(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,{stdout:"",stderr:"",exitCode:1}]})})()}},T6e={name:"true",flags:[]},A6e={name:"false",flags:[]}}),I6e={};St(I6e,{clearCommand:function(){return P6e},flagsForFuzzing:function(){return R6e}});var Cve,P6e,R6e,kgt=se(function(){"use strict";jt(),Cve={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},P6e={name:"clear",execute:function execute(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Vt(e)?Wt(Cve):{stdout:"\x1b[2J\x1b[H",stderr:"",exitCode:0}]})})()}},R6e={name:"clear",flags:[]}}),hW={};St(hW,{bashCommand:function(){return M6e},flagsForFuzzing:function(){return $6e},shCommand:function(){return O6e},shFlagsForFuzzing:function(){return N6e}});function Vv(e,t,r,n){return _async_to_generator(function(){var i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!n.exec)return[2,{stdout:"",stderr:"bash: internal error: exec function not available\n",exitCode:1}];i=I9(n.exportedEnv||{},{0:t,"#":String(r.length),"@":r.join(" "),"*":r.join(" ")});r.forEach(function(a,s){i[String(s+1)]=a});o=e;if(o.startsWith("#!")){a=o.indexOf("\n");a!==-1&&(o=o.slice(a+1))}return[4,n.exec(o,{env:i,cwd:n.cwd,stdin:n.stdin,stdinKind:"bytes",signal:n.signal})];case 1:return[2,_state.sent()]}})})()}var kq,M6e,O6e,$6e,N6e,Eve=se(function(){"use strict";kr(),Vh(),jt(),kq={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},M6e={name:"bash",execute:function execute(e,t){return _async_to_generator(function(){var i,o,a,i10,r,n,i11,o10,i12;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(kq)];if(e[0]==="-c"&&e.length>=2){i=e[1],o=e[2]||"bash",a=e.slice(3);return[2,Vv(i,o,a,t)]}if(e.length===0){i10=Sn(t.stdin);return[2,i10.trim()?Vv(i10,"bash",[],t):{stdout:"",stderr:"",exitCode:0}]}r=e[0],n=e.slice(1);_state.label=1;case 1:_state.trys.push([1,3,,4]);i11=t.fs.resolvePath(t.cwd,r);return[4,t.fs.readFile(i11)];case 2:o10=_state.sent();return[2,Vv(o10,r,n,t)];case 3:i12=_state.sent();return[2,{stdout:"",stderr:"bash: ".concat(r,": No such file or directory\n"),exitCode:127}];case 4:return[2]}})})()}},O6e={name:"sh",execute:function execute(e,t){return _async_to_generator(function(){var i,o,a,i10,r,n,i11,o10,i12;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(_object_spread_props(_object_spread({},kq),{name:"sh",summary:"execute shell commands or scripts (POSIX shell)"}))];if(e[0]==="-c"&&e.length>=2){i=e[1],o=e[2]||"sh",a=e.slice(3);return[2,Vv(i,o,a,t)]}if(e.length===0){i10=Sn(t.stdin);return[2,i10.trim()?Vv(i10,"sh",[],t):{stdout:"",stderr:"",exitCode:0}]}r=e[0],n=e.slice(1);_state.label=1;case 1:_state.trys.push([1,3,,4]);i11=t.fs.resolvePath(t.cwd,r);return[4,t.fs.readFile(i11)];case 2:o10=_state.sent();return[2,Vv(o10,r,n,t)];case 3:i12=_state.sent();return[2,{stdout:"",stderr:"sh: ".concat(r,": No such file or directory\n"),exitCode:127}];case 4:return[2]}})})()}},$6e={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},N6e={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"}});function Cgt(e,t,r,n,i,o,a,s,l,c){var d;switch(t){case"sort":return Array.isArray(e)?[_to_consumable_array(e).sort(a)]:[null];case"sort_by":return!Array.isArray(e)||r.length===0?[null]:[_to_consumable_array(e).sort(function(u,p){var m=i(u,r[0],n)[0],h=i(p,r[0],n)[0];return a(m,h)})];case"bsearch":{if(!Array.isArray(e)){var _$u=e===null?"null":(typeof e==="undefined"?"undefined":_type_of(e))=="object"?"object":typeof e==="undefined"?"undefined":_type_of(e);throw new Error("".concat(_$u," (").concat(JSON.stringify(e),") cannot be searched from"))}return r.length===0?[null]:i(e,r[0],n).map(function(u){var p=0,m=e.length;for(;p<m;){var h=p+m>>>1;a(e[h],u)<0?p=h+1:m=h}return p<e.length&&a(e[p],u)===0?p:-p-1})}case"unique_by":{if(!Array.isArray(e)||r.length===0)return[null];var _$u1=new Map;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;var h=i(m,r[0],n)[0],g=JSON.stringify(h);_$u1.has(g)||_$u1.set(g,{item:m,key:h})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var p=_to_consumable_array(_$u1.values());return p.sort(function(m,h){return a(m.key,h.key)}),[p.map(function(m){return m.item})]}case"group_by":{if(!Array.isArray(e)||r.length===0)return[null];var _$u2=new Map;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var p10=_step1.value;var m10=JSON.stringify(i(p10,r[0],n)[0]);_$u2.has(m10)||_$u2.set(m10,[]),(d=_$u2.get(m10))==null||d.push(p10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[_to_consumable_array(_$u2.values())]}case"max":return Array.isArray(e)&&e.length>0?[e.reduce(function(u,p){return a(u,p)>0?u:p})]:[null];case"max_by":return!Array.isArray(e)||e.length===0||r.length===0?[null]:[e.reduce(function(u,p){var m=i(u,r[0],n)[0],h=i(p,r[0],n)[0];return a(m,h)>0?u:p})];case"min":return Array.isArray(e)&&e.length>0?[e.reduce(function(u,p){return a(u,p)<0?u:p})]:[null];case"min_by":return!Array.isArray(e)||e.length===0||r.length===0?[null]:[e.reduce(function(u,p){var m=i(u,r[0],n)[0],h=i(p,r[0],n)[0];return a(m,h)<0?u:p})];case"add":{var _$u3=function(p){var m=p.filter(function(h){return h!==null});return m.length===0?null:m.every(function(h){return typeof h=="number"})?m.reduce(function(h,g){return h+g},0):m.every(function(h){return typeof h=="string"})?m.join(""):m.every(function(h){return Array.isArray(h)})?m.flat():m.every(function(h){return h&&(typeof h==="undefined"?"undefined":_type_of(h))=="object"&&!Array.isArray(h)})?I9.apply(void 0,_to_consumable_array(m)):null};if(r.length>=1){var p11=i(e,r[0],n);return[_$u3(p11)]}return Array.isArray(e)?[_$u3(e)]:[null]}case"any":{if(r.length>=2){try{var _$u4=o(e,r[0],n);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=_$u4[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var p12=_step2.value;if(i(p12,r[1],n).some(s))return[!0]}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}catch(u){if(_instanceof(u,c))throw u}return[!1]}return r.length===1?Array.isArray(e)?[e.some(function(u){return s(i(u,r[0],n)[0])})]:[!1]:Array.isArray(e)?[e.some(s)]:[!1]}case"all":{if(r.length>=2){try{var _$u5=o(e,r[0],n);var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=_$u5[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var p13=_step3.value;if(!i(p13,r[1],n).some(s))return[!1]}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}catch(u){if(_instanceof(u,c))throw u}return[!0]}return r.length===1?Array.isArray(e)?[e.every(function(u){return s(i(u,r[0],n)[0])})]:[!0]:Array.isArray(e)?[e.every(s)]:[!0]}case"select":return r.length===0?[e]:i(e,r[0],n).some(s)?[e]:[];case"map":return r.length===0||!Array.isArray(e)?[null]:[e.flatMap(function(u){return i(u,r[0],n)})];case"map_values":{if(r.length===0)return[null];if(Array.isArray(e))return[e.flatMap(function(u){return i(u,r[0],n)})];if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"){var _$u6=Object.create(null);var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=Object.entries(e)[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var _step_value=_sliced_to_array(_step4.value,2),p14=_step_value[0],m11=_step_value[1];if(!vi(p14))continue;var h10=i(m11,r[0],n);h10.length>0&&Zi(_$u6,p14,h10[0])}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[_$u6]}return[null]}case"has":{if(r.length===0)return[!1];var _$u7=i(e,r[0],n)[0];return Array.isArray(e)&&typeof _$u7=="number"?[_$u7>=0&&_$u7<e.length]:e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&typeof _$u7=="string"?[s_(e,_$u7)]:[!1]}case"in":{if(r.length===0)return[!1];var _$u8=i(e,r[0],n)[0];return Array.isArray(_$u8)&&typeof e=="number"?[e>=0&&e<_$u8.length]:_$u8&&(typeof _$u8==="undefined"?"undefined":_type_of(_$u8))=="object"&&typeof e=="string"?[s_(_$u8,e)]:[!1]}case"contains":{if(r.length===0)return[!1];var _$u9=i(e,r[0],n);return[l(e,_$u9[0])]}case"inside":{if(r.length===0)return[!1];var _$u10=i(e,r[0],n);return[l(_$u10[0],e)]}default:return null}}var Egt=se(function(){"use strict";Vh(),vp()});function Tgt(e,t,r,n,i,o,a,s){switch(t){case"first":if(r.length>0)try{var _$l=o(e,r[0],n);return _$l.length>0?[_$l[0]]:[]}catch(l){if(_instanceof(l,s))throw l;return[]}return Array.isArray(e)&&e.length>0?[e[0]]:[null];case"last":if(r.length>0){var _$l1=i(e,r[0],n);return _$l1.length>0?[_$l1[_$l1.length-1]]:[]}return Array.isArray(e)&&e.length>0?[e[e.length-1]]:[null];case"nth":{if(r.length<1)return[null];var _$l2=i(e,r[0],n);if(r.length>1){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_$l2[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _$d=_step.value;if(_$d<0)throw new Error("nth doesn't support negative indices")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var c;try{c=o(e,r[1],n)}catch(d){if(_instanceof(d,s))throw d;c=[]}return _$l2.flatMap(function(d){var u=d;return u<c.length?[c[u]]:[]})}return Array.isArray(e)?_$l2.flatMap(function(c){var _$d=c;if(_$d<0)throw new Error("nth doesn't support negative indices");return _$d<e.length?[e[_$d]]:[null]}):[null]}case"range":{if(r.length===0)return[];var _$l3=Math.max(n.limits.maxIterations*100,1e6),c10=function(h){return h.length>=_$l3},_$d1=i(e,r[0],n);if(r.length===1){var h=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=_$d1[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g=_step1.value;var x=g;for(var v=0;v<x;v++)if(h.push(v),c10(h))return h}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return h}var u=i(e,r[1],n);if(r.length===2){var h10=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined,_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator2=_$d1[Symbol.iterator](),_step2;!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){var g10=_step2.value;try{for(var _iterator3=u[Symbol.iterator](),_step3;!(_iteratorNormalCompletion2=(_step3=_iterator3.next()).done);_iteratorNormalCompletion2=true){var x10=_step3.value;var v10=g10,y=x10;for(var _=v10;_<y;_++)if(h10.push(_),c10(h10))return h10}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return h10}var p=i(e,r[2],n),m=[];var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined,_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined,_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(var _iterator4=_$d1[Symbol.iterator](),_step4;!(_iteratorNormalCompletion6=(_step4=_iterator4.next()).done);_iteratorNormalCompletion6=true){var h11=_step4.value;try{for(var _iterator5=u[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var g11=_step5.value;try{for(var _iterator6=p[Symbol.iterator](),_step6;!(_iteratorNormalCompletion4=(_step6=_iterator6.next()).done);_iteratorNormalCompletion4=true){var x11=_step6.value;var v11=h11,y10=g11,_10=x11;if(_10!==0){if(_10>0){for(var b=v11;b<y10;b+=_10)if(m.push(b),c10(m))return m}else for(var b10=v11;b10>y10;b10+=_10)if(m.push(b10),c10(m))return m}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}return m}case"limit":return r.length<2?[]:i(e,r[0],n).flatMap(function(l){var c=l;if(c<0)throw new Error("limit doesn't support negative count");if(c===0)return[];var _$d;try{_$d=o(e,r[1],n)}catch(u){if(_instanceof(u,s))throw u;_$d=[]}return _$d.slice(0,c)});case"isempty":{if(r.length<1)return[!0];try{return[o(e,r[0],n).length===0]}catch(l){if(_instanceof(l,s))throw l;return[!0]}}case"isvalid":{if(r.length<1)return[!0];try{return[i(e,r[0],n).length>0]}catch(l){if(_instanceof(l,s))throw l;return[!1]}}case"skip":return r.length<2?[]:i(e,r[0],n).flatMap(function(l){var c=l;if(c<0)throw new Error("skip doesn't support negative count");return i(e,r[1],n).slice(c)});case"until":{if(r.length<2)return[e];var _$l4=e,c11=n.limits.maxIterations;for(var _$d2=0;_$d2<c11;_$d2++){if(i(_$l4,r[0],n).some(a))return[_$l4];var u10=i(_$l4,r[1],n);if(u10.length===0)return[_$l4];_$l4=u10[0]}throw new s("jq until: too many iterations (".concat(c11,"), increase executionLimits.maxJqIterations"),"iterations")}case"while":{if(r.length<2)return[e];var _$l5=[],c12=e,_$d3=n.limits.maxIterations;for(var u11=0;u11<_$d3&&i(c12,r[0],n).some(a);u11++){_$l5.push(c12);var p10=i(c12,r[1],n);if(p10.length===0)break;c12=p10[0]}if(_$l5.length>=_$d3)throw new s("jq while: too many iterations (".concat(_$d3,"), increase executionLimits.maxJqIterations"),"iterations");return _$l5}case"repeat":{if(r.length===0)return[e];var _$l6=[],c13=e,_$d4=n.limits.maxIterations;for(var u12=0;u12<_$d4;u12++){_$l6.push(c13);var p11=i(c13,r[0],n);if(p11.length===0)break;c13=p11[0]}if(_$l6.length>=_$d4)throw new s("jq repeat: too many iterations (".concat(_$d4,"), increase executionLimits.maxJqIterations"),"iterations");return _$l6}default:return null}}var Agt=se(function(){"use strict"});function Igt(e,t,r,n,i){switch(t){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof e!="number")return[null];var o=new Date(e*1e3),a=o.getUTCFullYear(),s=o.getUTCMonth(),l=o.getUTCDate(),c=o.getUTCHours(),d=o.getUTCMinutes(),u=o.getUTCSeconds(),p=o.getUTCDay(),m=Date.UTC(a,0,1),h=Math.floor((o.getTime()-m)/(1440*60*1e3));return[[a,s,l,c,d,u,p,h]]}case"mktime":{if(!Array.isArray(e))throw new Error("mktime requires parsed datetime inputs");var _e1=_sliced_to_array(e,6),o10=_e1[0],a9=_e1[1],s10=_e1[2],tmp=_e1[3],l10=tmp===void 0?0:tmp,tmp1=_e1[4],c10=tmp1===void 0?0:tmp1,tmp2=_e1[5],d10=tmp2===void 0?0:tmp2;if(typeof o10!="number"||typeof a9!="number")throw new Error("mktime requires parsed datetime inputs");var u10=Date.UTC(o10,a9,s10!=null?s10:1,l10!=null?l10:0,c10!=null?c10:0,d10!=null?d10:0);return[Math.floor(u10/1e3)]}case"strftime":{if(r.length===0)return[null];var o11=i(e,r[0],n)[0];if(typeof o11!="string")throw new Error("strftime/1 requires a string format");var a10;if(typeof e=="number")a10=new Date(e*1e3);else if(Array.isArray(e)){var _e2=_sliced_to_array(e,6),d11=_e2[0],u11=_e2[1],p10=_e2[2],tmp3=_e2[3],m10=tmp3===void 0?0:tmp3,tmp4=_e2[4],h10=tmp4===void 0?0:tmp4,tmp5=_e2[5],g=tmp5===void 0?0:tmp5;if(typeof d11!="number"||typeof u11!="number")throw new Error("strftime/1 requires parsed datetime inputs");a10=new Date(Date.UTC(d11,u11,p10!=null?p10:1,m10!=null?m10:0,h10!=null?h10:0,g!=null?g:0))}else throw new Error("strftime/1 requires parsed datetime inputs");var s11=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l11=["January","February","March","April","May","June","July","August","September","October","November","December"],c11=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(d).padStart(u,"0")};return[o11.replace(/%Y/g,String(a10.getUTCFullYear())).replace(/%m/g,c11(a10.getUTCMonth()+1)).replace(/%d/g,c11(a10.getUTCDate())).replace(/%H/g,c11(a10.getUTCHours())).replace(/%M/g,c11(a10.getUTCMinutes())).replace(/%S/g,c11(a10.getUTCSeconds())).replace(/%A/g,s11[a10.getUTCDay()]).replace(/%B/g,l11[a10.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(r.length===0)return[null];if(typeof e!="string")throw new Error("strptime/1 requires a string input");var o12=i(e,r[0],n)[0];if(typeof o12!="string")throw new Error("strptime/1 requires a string format");if(o12==="%Y-%m-%dT%H:%M:%SZ"){var s12=e.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(s12){var _s_map=_sliced_to_array(s12.map(Number),7),l12=_s_map[1],c12=_s_map[2],d12=_s_map[3],u12=_s_map[4],p11=_s_map[5],m11=_s_map[6],h11=new Date(Date.UTC(l12,c12-1,d12,u12,p11,m11)),g10=h11.getUTCDay(),x=Date.UTC(l12,0,1),v=Math.floor((h11.getTime()-x)/(1440*60*1e3));return[[l12,c12-1,d12,u12,p11,m11,g10,v]]}}var a11=new Date(e);if(!Number.isNaN(a11.getTime())){var s13=a11.getUTCFullYear(),l13=a11.getUTCMonth(),c13=a11.getUTCDate(),d13=a11.getUTCHours(),u13=a11.getUTCMinutes(),p12=a11.getUTCSeconds(),m12=a11.getUTCDay(),h12=Date.UTC(s13,0,1),g11=Math.floor((a11.getTime()-h12)/(1440*60*1e3));return[[s13,l13,c13,d13,u13,p12,m12,g11]]}throw new Error("Cannot parse date: ".concat(e))}case"fromdate":{if(typeof e!="string")throw new Error("fromdate requires a string input");var o13=new Date(e);if(Number.isNaN(o13.getTime()))throw new Error('date "'.concat(e,'" does not match format "%Y-%m-%dT%H:%M:%SZ"'));return[Math.floor(o13.getTime()/1e3)]}case"todate":{if(typeof e!="number")throw new Error("todate requires a number input");return[new Date(e*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}var Pgt=se(function(){"use strict"});function ed(e){return e!==!1&&e!==null}function QS(e,t){return JSON.stringify(e)===JSON.stringify(t)}function YI(e,t){return typeof e=="number"&&typeof t=="number"?e-t:typeof e=="string"&&typeof t=="string"?e.localeCompare(t):0}function D6e(e,t){var r=ls(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.keys(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(!vi(n))continue;var i=s_(r,n)?Gi(r[n]):null,o=Gi(t[n]);i&&o?Zi(r,n,D6e(i,o)):Zi(r,n,t[n])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function hV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;var r=0,n=e;for(;r<t;)if(Array.isArray(n)){if(n.length===0)return r+1;n=n[0],r++}else if(n!==null&&(typeof n==="undefined"?"undefined":_type_of(n))=="object"){var i=Object.keys(n);if(i.length===0)return r+1;n=n[i[0]],r++}else return r;return r}function gW(e,t){var r=function(s){return s===null?0:typeof s=="boolean"?1:typeof s=="number"?2:typeof s=="string"?3:Array.isArray(s)?4:(typeof s==="undefined"?"undefined":_type_of(s))=="object"?5:6},n=r(e),i=r(t);if(n!==i)return n-i;if(typeof e=="number"&&typeof t=="number")return e-t;if(typeof e=="string"&&typeof t=="string")return e.localeCompare(t);if(typeof e=="boolean"&&typeof t=="boolean")return(e?1:0)-(t?1:0);if(Array.isArray(e)&&Array.isArray(t)){for(var s=0;s<Math.min(e.length,t.length);s++){var l=gW(e[s],t[s]);if(l!==0)return l}return e.length-t.length}var o=Gi(e),a=Gi(t);if(o&&a){var s10=Object.keys(o).sort(),l10=Object.keys(a).sort();for(var c=0;c<Math.min(s10.length,l10.length);c++){var d=s10[c].localeCompare(l10[c]);if(d!==0)return d}if(s10.length!==l10.length)return s10.length-l10.length;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s10[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c10=_step.value;var d10=gW(o[c10],a[c10]);if(d10!==0)return d10}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return 0}function xW(e,t){if(QS(e,t))return!0;if(typeof e=="string"&&typeof t=="string")return e.includes(t);if(Array.isArray(e)&&Array.isArray(t))return t.every(function(i){return e.some(function(o){return xW(o,i)})});var r=Gi(e),n=Gi(t);return r&&n?Object.keys(n).every(function(i){return s_(r,i)&&xW(r[i],n[i])}):!1}var gV=se(function(){"use strict";vp()});function Rgt(e,t,r){switch(t){case"@base64":return typeof e=="string"?(typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u"?[Buffer.from(e,"utf-8").toString("base64")]:[btoa(e)]:[null];case"@base64d":return typeof e=="string"?(typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u"?[Buffer.from(e,"base64").toString("utf-8")]:[atob(e)]:[null];case"@uri":return typeof e=="string"?[encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof e=="string"?[decodeURIComponent(e)]:[null];case"@csv":return Array.isArray(e)?[e.map(function(n){if(n===null)return"";if(typeof n=="boolean")return n?"true":"false";if(typeof n=="number")return String(n);var i=String(n);return i.includes(",")||i.includes('"')||i.includes("\n")||i.includes("\r")?'"'.concat(i.replace(/"/g,'""'),'"'):i}).join(",")]:[null];case"@tsv":return Array.isArray(e)?[e.map(function(n){return String(n!=null?n:"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")}).join(" ")]:[null];case"@json":{var n=r!=null?r:L6e;return hV(e,n+1)>n?[null]:[JSON.stringify(e)]}case"@html":return typeof e=="string"?[e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")]:[null];case"@sh":return typeof e=="string"?["'".concat(e.replace(/'/g,"'\\''"),"'")]:[null];case"@text":return typeof e=="string"?[e]:e==null?[""]:[String(e)];default:return null}}var L6e,Mgt=se(function(){"use strict";gV(),L6e=2e3});function Ogt(e,t,r,n,i,o){switch(t){case"index":return r.length===0?[null]:i(e,r[0],n).map(function(a){if(typeof e=="string"&&typeof a=="string"){if(a===""&&e==="")return null;var s=e.indexOf(a);return s>=0?s:null}if(Array.isArray(e)){if(Array.isArray(a)){for(var l=0;l<=e.length-a.length;l++){var c=!0;for(var d=0;d<a.length;d++)if(!o(e[l+d],a[d])){c=!1;break}if(c)return l}return null}var s10=e.findIndex(function(l){return o(l,a)});return s10>=0?s10:null}return null});case"rindex":return r.length===0?[null]:i(e,r[0],n).map(function(a){if(typeof e=="string"&&typeof a=="string"){var s=e.lastIndexOf(a);return s>=0?s:null}if(Array.isArray(e)){if(Array.isArray(a)){for(var s10=e.length-a.length;s10>=0;s10--){var l=!0;for(var c=0;c<a.length;c++)if(!o(e[s10+c],a[c])){l=!1;break}if(l)return s10}return null}for(var s11=e.length-1;s11>=0;s11--)if(o(e[s11],a))return s11;return null}return null});case"indices":return r.length===0?[[]]:i(e,r[0],n).map(function(a){var s=[];if(typeof e=="string"&&typeof a=="string"){var l=e.indexOf(a);for(;l!==-1;)s.push(l),l=e.indexOf(a,l+1)}else if(Array.isArray(e))if(Array.isArray(a)){var l10=a.length;if(l10===0)for(var c=0;c<=e.length;c++)s.push(c);else for(var c10=0;c10<=e.length-l10;c10++){var d=!0;for(var u=0;u<l10;u++)if(!o(e[c10+u],a[u])){d=!1;break}d&&s.push(c10)}}else for(var l11=0;l11<e.length;l11++)o(e[l11],a)&&s.push(l11);return s});default:return null}}var $gt=se(function(){"use strict"});function Ngt(e,t,r,n,i){switch(t){case"fabs":case"abs":return typeof e=="number"?[Math.abs(e)]:typeof e=="string"?[e]:[null];case"exp10":return typeof e=="number"?[Math.pow(10,e)]:[null];case"exp2":return typeof e=="number"?[Math.pow(2,e)]:[null];case"pow":{if(r.length<2)return[null];var o=i(e,r[0],n),a=i(e,r[1],n),s=o[0],l=a[0];return typeof s!="number"||typeof l!="number"?[null]:[Math.pow(s,l)]}case"atan2":{if(r.length<2)return[null];var o10=i(e,r[0],n),a9=i(e,r[1],n),s10=o10[0],l10=a9[0];return typeof s10!="number"||typeof l10!="number"?[null]:[Math.atan2(s10,l10)]}case"hypot":{if(typeof e!="number"||r.length===0)return[null];var o11=i(e,r[0],n)[0];return[Math.hypot(e,o11)]}case"fma":{if(typeof e!="number"||r.length<2)return[null];var o12=i(e,r[0],n)[0],a10=i(e,r[1],n)[0];return[e*o12+a10]}case"copysign":{if(typeof e!="number"||r.length===0)return[null];var o13=i(e,r[0],n)[0];return[Math.sign(o13)*Math.abs(e)]}case"drem":case"remainder":{if(typeof e!="number"||r.length===0)return[null];var o14=i(e,r[0],n)[0];return[e-Math.round(e/o14)*o14]}case"fdim":{if(typeof e!="number"||r.length===0)return[null];var o15=i(e,r[0],n)[0];return[Math.max(0,e-o15)]}case"fmax":{if(typeof e!="number"||r.length===0)return[null];var o16=i(e,r[0],n)[0];return[Math.max(e,o16)]}case"fmin":{if(typeof e!="number"||r.length===0)return[null];var o17=i(e,r[0],n)[0];return[Math.min(e,o17)]}case"ldexp":{if(typeof e!="number"||r.length===0)return[null];var o18=i(e,r[0],n)[0];return[e*Math.pow(2,o18)]}case"scalbn":case"scalbln":{if(typeof e!="number"||r.length===0)return[null];var o19=i(e,r[0],n)[0];return[e*Math.pow(2,o19)]}case"nearbyint":return typeof e=="number"?[Math.round(e)]:[null];case"logb":return typeof e=="number"?[Math.floor(Math.log2(Math.abs(e)))]:[null];case"significand":if(typeof e=="number"){var o20=Math.floor(Math.log2(Math.abs(e)));return[e/Math.pow(2,o20)]}return[null];case"frexp":if(typeof e=="number"){if(e===0)return[[0,0]];var o21=Math.floor(Math.log2(Math.abs(e)))+1;return[[e/Math.pow(2,o21),o21]]}return[null];case"modf":if(typeof e=="number"){var o22=Math.trunc(e);return[[e-o22,o22]]}return[null];default:return null}}var Dgt=se(function(){"use strict"});function Lgt(e,t,r,n,i,o,a,s){switch(t){case"recurse":{if(r.length===0){var m=[],h=function(g){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(m.push(g),Array.isArray(g))try{for(var _iterator=g[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var x=_step.value;h(x)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else if(g&&(typeof g==="undefined"?"undefined":_type_of(g))=="object")try{for(var _iterator1=Object.keys(g)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var x10=_step1.value;h(g[x10])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}};return h(e),m}var l=[],c=r.length>=2?r[1]:null,d=1e4,u=0,p=function(m){if(u++>d||c&&!i(m,c,n).some(o))return;l.push(m);var h=i(m,r[0],n);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;g!=null&&p(g)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return p(e),l}case"recurse_down":return s(e,"recurse",r,n);case"walk":{if(r.length===0)return[e];var l10=new WeakSet,c10=function(d){if(d&&(typeof d==="undefined"?"undefined":_type_of(d))=="object"){if(l10.has(d))return d;l10.add(d)}var u;if(Array.isArray(d))u=d.map(c10);else if(d&&(typeof d==="undefined"?"undefined":_type_of(d))=="object"){var p=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(d)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),m=_step_value[0],h=_step_value[1];vi(m)&&Zi(p,m,c10(h))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}u=p}else u=d;return i(u,r[0],n)[0]};return[c10(e)]}case"transpose":{var _loop=function(d10){c11.push(e.map(function(u){return Array.isArray(u)?u[d10]:null}))};var _Math;if(!Array.isArray(e))return[null];if(e.length===0)return[[]];var l11=(_Math=Math).max.apply(_Math,_to_consumable_array(e.map(function(d){return Array.isArray(d)?d.length:0}))),c11=[];for(var d10=0;d10<l11;d10++)_loop(d10);return[c11]}case"combinations":{if(r.length>0){var d11=i(e,r[0],n)[0];if(!Array.isArray(e)||d11<0)return[];if(d11===0)return[[]];var u10=[],p10=function(m,h){if(h===d11){u10.push(_to_consumable_array(m));return}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;m.push(g),p10(m,h+1),m.pop()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return p10([],0),u10}if(!Array.isArray(e))return[];if(e.length===0)return[[]];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d12=_step.value;if(!Array.isArray(d12))return[]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var l12=[],c12=function(d,u){if(d===e.length){l12.push(_to_consumable_array(u));return}var p=e[d];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=p[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;u.push(m),c12(d+1,u),u.pop()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return c12(0,[]),l12}case"parent":{if(n.root===void 0||n.currentPath===void 0)return[];var l13=n.currentPath;if(l13.length===0)return[];var c13=r.length>0?i(e,r[0],n)[0]:1;if(c13>=0){if(c13>l13.length)return[];var d13=l13.slice(0,l13.length-c13);return[a(n.root,d13)]}else{var d14=-c13-1;if(d14>=l13.length)return[e];var u11=l13.slice(0,d14);return[a(n.root,u11)]}}case"parents":{if(n.root===void 0||n.currentPath===void 0)return[[]];var l14=n.currentPath,c14=[];for(var d15=l14.length-1;d15>=0;d15--)c14.push(a(n.root,l14.slice(0,d15)));return[c14]}case"root":return n.root!==void 0?[n.root]:[];default:return null}}var Fgt=se(function(){"use strict";vp()});function zgt(e,t,r,n,i){var o,a,s,l,c,d,u,p,m,h;switch(t){case"keys":return Array.isArray(e)?[e.map(function(g,x){return x})]:e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"?[Object.keys(e).sort()]:[null];case"keys_unsorted":return Array.isArray(e)?[e.map(function(g,x){return x})]:e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"?[Object.keys(e)]:[null];case"length":return typeof e=="string"?[e.length]:Array.isArray(e)?[e.length]:e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"?[Object.keys(e).length]:e===null?[0]:typeof e=="number"?[Math.abs(e)]:[null];case"utf8bytelength":{if(typeof e=="string")return[new TextEncoder().encode(e).length];var g=e===null?"null":Array.isArray(e)?"array":typeof e==="undefined"?"undefined":_type_of(e),x=g==="array"||g==="object"?JSON.stringify(e):String(e);throw new Error("".concat(g," (").concat(x,") only strings have UTF-8 byte length"))}case"to_entries":{var g10=Gi(e);return g10?[Object.entries(g10).map(function(param){var _param=_sliced_to_array(param,2),x=_param[0],v=_param[1];return{key:x,value:v}})]:[null]}case"from_entries":if(Array.isArray(e)){var g11=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var x10=_step.value;var v=Gi(x10);if(v){var y=(l=(s=(a=(o=v.key)!=null?o:v.Key)!=null?a:v.name)!=null?s:v.Name)!=null?l:v.k,_=(d=(c=v.value)!=null?c:v.Value)!=null?d:v.v;if(y!==void 0){var b=String(y);vi(b)&&Zi(g11,b,_)}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[g11]}return[null];case"with_entries":{if(r.length===0)return[e];var g12=Gi(e);if(g12){var x11=Object.entries(g12).map(function(param){var _param=_sliced_to_array(param,2),y=_param[0],_=_param[1];return{key:y,value:_}}).flatMap(function(y){return i(y,r[0],n)}),v10=Object.create(null);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=x11[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var y10=_step1.value;var _10=Gi(y10);if(_10){var b10=(p=(u=_10.key)!=null?u:_10.name)!=null?p:_10.k,w=(m=_10.value)!=null?m:_10.v;if(b10!==void 0){var S=String(b10);vi(S)&&Zi(v10,S,w)}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[v10]}return[null]}case"reverse":return Array.isArray(e)?[_to_consumable_array(e).reverse()]:typeof e=="string"?[e.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(e)?(r.length>0?i(e,r[0],n):[Number.POSITIVE_INFINITY]).map(function(g){var x=g;if(x<0)throw new Error("flatten depth must not be negative");return e.flat(x)}):[null];case"unique":if(Array.isArray(e)){var g13=new Set,x12=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=e[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var v11=_step2.value;var y11=JSON.stringify(v11);g13.has(y11)||(g13.add(y11),x12.push(v11))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[x12]}return[null];case"tojson":case"tojsonstream":{var g14=(h=n.limits.maxDepth)!=null?h:F6e;return hV(e,g14+1)>g14?[null]:[JSON.stringify(e)]}case"fromjson":{if(typeof e=="string"){var g15=e.trim().toLowerCase();if(g15==="nan")return[Number.NaN];if(g15==="inf"||g15==="infinity")return[Number.POSITIVE_INFINITY];if(g15==="-inf"||g15==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[u9(JSON.parse(e))]}catch(x){throw new Error("Invalid JSON: ".concat(e))}}return[e]}case"tostring":return typeof e=="string"?[e]:[JSON.stringify(e)];case"tonumber":if(typeof e=="number")return[e];if(typeof e=="string"){var g16=Number(e);if(Number.isNaN(g16))throw new Error("".concat(JSON.stringify(e)," cannot be parsed as a number"));return[g16]}throw new Error("".concat(typeof e==="undefined"?"undefined":_type_of(e)," cannot be parsed as a number"));case"toboolean":{if(typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="true")return[!0];if(e==="false")return[!1];throw new Error("string (".concat(JSON.stringify(e),") cannot be parsed as a boolean"))}var g17=e===null?"null":Array.isArray(e)?"array":typeof e==="undefined"?"undefined":_type_of(e),x13=g17==="array"||g17==="object"?JSON.stringify(e):String(e);throw new Error("".concat(g17," (").concat(x13,") cannot be parsed as a boolean"))}case"tostream":{var g18=[],x14=function(v,y){if(v===null||(typeof v==="undefined"?"undefined":_type_of(v))!="object")g18.push([y,v]);else if(Array.isArray(v))if(v.length===0)g18.push([y,[]]);else for(var _=0;_<v.length;_++)x14(v[_],_to_consumable_array(y).concat([_]));else{var _10=Object.keys(v);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(_10.length===0)g18.push([y,Object.create(null)]);else try{for(var _iterator=_10[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var b=_step.value;x14(v[b],_to_consumable_array(y).concat([b]))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}};return x14(e,[]),g18.push([[]]),g18}case"fromstream":{if(r.length===0)return[e];var g19=i(e,r[0],n),x15=null;var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=g19[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var v12=_step3.value;if(!Array.isArray(v12)||v12.length===1&&Array.isArray(v12[0])&&v12[0].length===0||v12.length!==2)continue;var _v1=_sliced_to_array(v12,2),y12=_v1[0],_11=_v1[1];if(!Array.isArray(y12))continue;if(y12.length===0){x15=_11;continue}x15===null&&(x15=typeof y12[0]=="number"?[]:Object.create(null));var b11=x15;for(var S10=0;S10<y12.length-1;S10++){var k=y12[S10],E=y12[S10+1];if(Array.isArray(b11)&&typeof k=="number"){for(;b11.length<=k;)b11.push(null);b11[k]===null&&(b11[k]=typeof E=="number"?[]:Object.create(null)),b11=b11[k]}else{var C=Gi(b11);if(C){var T=String(k);if(!vi(T))continue;(C[T]===null||C[T]===void 0)&&Zi(C,T,typeof E=="number"?[]:Object.create(null)),b11=C[T]}}}var w10=y12[y12.length-1];if(Array.isArray(b11)&&typeof w10=="number"){for(;b11.length<=w10;)b11.push(null);b11[w10]=_11}else{var S11=Gi(b11);if(S11){var k10=String(w10);vi(k10)&&Zi(S11,k10,_11)}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[x15]}case"truncate_stream":{var g20=typeof e=="number"?Math.floor(e):0;if(r.length===0)return[];var x16=[],v13=i(e,r[0],n);var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=v13[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var y13=_step4.value;if(Array.isArray(y13)){if(y13.length===1&&Array.isArray(y13[0])){var _12=y13[0];_12.length>g20&&x16.push([_12.slice(g20)]);continue}if(y13.length===2&&Array.isArray(y13[0])){var _13=y13[0],b12=y13[1];_13.length>g20&&x16.push([_13.slice(g20),b12])}}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return x16}default:return null}}var F6e,jgt=se(function(){"use strict";vp(),gV(),F6e=2e3});function Ugt(e,t,r,n,i,o,a,s,l,c){switch(t){case"getpath":{if(r.length===0)return[null];var d=i(e,r[0],n),u=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=d[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;var m=p,h=e;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=m[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g=_step1.value;if(h==null){h=null;break}if(Array.isArray(h)&&typeof g=="number")h=h[g];else if(typeof g=="string"){var x=Gi(h);if(!x||!Object.hasOwn(x,g)){h=null;break}h=x[g]}else{h=null;break}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}u.push(h)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return u}case"setpath":{if(r.length<2)return[null];var d10=i(e,r[0],n)[0],u10=i(e,r[1],n)[0];return[a(e,d10,u10)]}case"delpaths":{if(r.length===0)return[e];var d11=i(e,r[0],n)[0],u11=e;var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=d11.sort(function(m,h){return h.length-m.length})[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var p10=_step2.value;u11=s(u11,p10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[u11]}case"path":{if(r.length===0)return[[]];var d12=[];return c(e,r[0],n,[],d12),d12}case"del":return r.length===0?[e]:[l(e,r[0],n)];case"pick":{if(r.length===0)return[null];var d13=[];var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=r[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var p11=_step3.value;c(e,p11,n,[],d13)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}var u12=null;var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=d13[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var p12=_step4.value;var _iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(var _iterator5=p12[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var h10=_step5.value;if(typeof h10=="number"&&h10<0)throw new Error("Out of bounds negative array index")}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}var m10=e;var _iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(var _iterator6=p12[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){var h11=_step6.value;if(m10==null)break;if(Array.isArray(m10)&&typeof h11=="number")m10=m10[h11];else if(typeof h11=="string"){var g10=Gi(m10);if(!g10||!Object.hasOwn(g10,h11)){m10=null;break}m10=g10[h11]}else{m10=null;break}}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}u12=a(u12,p12,m10)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[u12]}case"paths":{var d14=[],u13=function(p,m){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(p&&(typeof p==="undefined"?"undefined":_type_of(p))=="object")if(Array.isArray(p))for(var h=0;h<p.length;h++)d14.push(_to_consumable_array(m).concat([h])),u13(p[h],_to_consumable_array(m).concat([h]));else try{for(var _iterator=Object.keys(p)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h10=_step.value;d14.push(_to_consumable_array(m).concat([h10])),u13(p[h10],_to_consumable_array(m).concat([h10]))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return u13(e,[]),r.length>0?d14.filter(function(p){var m=e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=p[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;if(Array.isArray(m)&&typeof h=="number")m=m[h];else if(typeof h=="string"){var g=Gi(m);if(!g||!Object.hasOwn(g,h))return!1;m=g[h]}else return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i(m,r[0],n).some(o)}):d14}case"leaf_paths":{var d15=[],u14=function(p,m){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(p===null||(typeof p==="undefined"?"undefined":_type_of(p))!="object")d15.push(m);else if(Array.isArray(p))for(var h=0;h<p.length;h++)u14(p[h],_to_consumable_array(m).concat([h]));else try{for(var _iterator=Object.keys(p)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h10=_step.value;u14(p[h10],_to_consumable_array(m).concat([h10]))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return u14(e,[]),d15}default:return null}}var Bgt=se(function(){"use strict";vp()});function qgt(e,t,r,n,i,o){switch(t){case"IN":{if(r.length===0)return[!1];if(r.length===1){var c=i(e,r[0],n);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;if(o(e,d))return[!0]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[!1]}var a=i(e,r[0],n),s=i(e,r[1],n),l=new Set(s.map(function(c){return JSON.stringify(c)}));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var c10=_step1.value;if(l.has(JSON.stringify(c10)))return[!0]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[!1]}case"INDEX":{if(r.length===0)return[Object.create(null)];if(r.length===1){var l10=i(e,r[0],n),c11=Object.create(null);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=l10[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var d10=_step2.value;var u=String(d10);vi(u)&&Zi(c11,u,d10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[c11]}if(r.length===2){var l11=i(e,r[0],n),c12=Object.create(null);var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=l11[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var d11=_step3.value;var u10=i(d11,r[1],n);if(u10.length>0){var p=String(u10[0]);vi(p)&&Zi(c12,p,d11)}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[c12]}var a9=i(e,r[0],n),s10=Object.create(null);var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=a9[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var l12=_step4.value;var c13=i(l12,r[1],n),d12=i(l12,r[2],n);if(c13.length>0&&d12.length>0){var u11=String(c13[0]);vi(u11)&&Zi(s10,u11,d12[0])}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[s10]}case"JOIN":{if(r.length<2)return[null];var a10=Gi(i(e,r[0],n)[0]);if(!a10)return[null];if(!Array.isArray(e))return[null];var s11=[];var _iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(var _iterator5=e[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var l13=_step5.value;var c14=i(l13,r[1],n),d13=c14.length>0?String(c14[0]):"",u12=s_(a10,d13)?a10[d13]:null;s11.push([l13,u12])}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}return[s11]}default:return null}}var Wgt=se(function(){"use strict";vp()});function Vgt(e,t,r,n,i){switch(t){case"join":{if(!Array.isArray(e))return[null];var o=r.length>0?i(e,r[0],n):[""];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(Array.isArray(a)||a!==null&&(typeof a==="undefined"?"undefined":_type_of(a))=="object")throw new Error("cannot join: contains arrays or objects")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o.map(function(a){return e.map(function(s){return s===null?"":typeof s=="string"?s:String(s)}).join(String(a))})}case"split":{if(typeof e!="string"||r.length===0)return[null];var o10=i(e,r[0],n),a9=String(o10[0]);return[e.split(a9)]}case"splits":{if(typeof e!="string"||r.length===0)return[];var o11=i(e,r[0],n),a10=String(o11[0]);try{var s=r.length>1?String(i(e,r[1],n)[0]):"g";return ir(a10,s.includes("g")?s:"".concat(s,"g")).split(e)}catch(s){return[]}}case"scan":{if(typeof e!="string"||r.length===0)return[];var o12=i(e,r[0],n),a11=String(o12[0]);try{var s10=r.length>1?String(i(e,r[1],n)[0]):"";return _to_consumable_array(ir(a11,s10.includes("g")?s10:"".concat(s10,"g")).matchAll(e)).map(function(l){return l.length>1?l.slice(1):l[0]})}catch(s){return[]}}case"test":{if(typeof e!="string"||r.length===0)return[!1];var o13=i(e,r[0],n),a12=String(o13[0]);try{var s11=r.length>1?String(i(e,r[1],n)[0]):"";return[ir(a12,s11).test(e)]}catch(s){return[!1]}}case"match":{if(typeof e!="string"||r.length===0)return[null];var o14=i(e,r[0],n),a13=String(o14[0]);try{var s12=r.length>1?String(i(e,r[1],n)[0]):"",l=ir(a13,"".concat(s12,"d")).exec(e);if(!l)return[];var c=l.indices;return[{offset:l.index,length:l[0].length,string:l[0],captures:l.slice(1).map(function(d,u){var p,m,h;return{offset:(m=(p=c==null?void 0:c[u+1])==null?void 0:p[0])!=null?m:null,length:(h=d==null?void 0:d.length)!=null?h:0,string:d!=null?d:"",name:null}})}]}catch(s){return[null]}}case"capture":{if(typeof e!="string"||r.length===0)return[null];var o15=i(e,r[0],n),a14=String(o15[0]);try{var s13=r.length>1?String(i(e,r[1],n)[0]):"",l10=ir(a14,s13).match(e);return!l10||!l10.groups?[Object.create(null)]:[l10.groups]}catch(s){return[null]}}case"sub":{if(typeof e!="string"||r.length<2)return[null];var o16=i(e,r[0],n),a15=i(e,r[1],n),s14=String(o16[0]),l11=String(a15[0]);try{var c10=r.length>2?String(i(e,r[2],n)[0]):"";return[ir(s14,c10).replace(e,l11)]}catch(c){return[e]}}case"gsub":{if(typeof e!="string"||r.length<2)return[null];var o17=i(e,r[0],n),a16=i(e,r[1],n),s15=String(o17[0]),l12=String(a16[0]);try{var c11=r.length>2?String(i(e,r[2],n)[0]):"g",d=c11.includes("g")?c11:"".concat(c11,"g");return[ir(s15,d).replace(e,l12)]}catch(c){return[e]}}case"ascii_downcase":return typeof e=="string"?[e.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})]:[null];case"ascii_upcase":return typeof e=="string"?[e.replace(/[a-z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)-32)})]:[null];case"ltrimstr":{if(typeof e!="string"||r.length===0)return[e];var o18=i(e,r[0],n),a17=String(o18[0]);return[e.startsWith(a17)?e.slice(a17.length):e]}case"rtrimstr":{if(typeof e!="string"||r.length===0)return[e];var o19=i(e,r[0],n),a18=String(o19[0]);return a18===""?[e]:[e.endsWith(a18)?e.slice(0,-a18.length):e]}case"trimstr":{if(typeof e!="string"||r.length===0)return[e];var o20=i(e,r[0],n),a19=String(o20[0]);if(a19==="")return[e];var s16=e;return s16.startsWith(a19)&&(s16=s16.slice(a19.length)),s16.endsWith(a19)&&(s16=s16.slice(0,-a19.length)),[s16]}case"trim":if(typeof e=="string")return[e.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof e=="string")return[e.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof e=="string")return[e.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof e!="string"||r.length===0)return[!1];var o21=i(e,r[0],n);return[e.startsWith(String(o21[0]))]}case"endswith":{if(typeof e!="string"||r.length===0)return[!1];var o22=i(e,r[0],n);return[e.endsWith(String(o22[0]))]}case"ascii":return typeof e=="string"&&e.length>0?[e.charCodeAt(0)]:[null];case"explode":return typeof e=="string"?[Array.from(e).map(function(o){return o.codePointAt(0)})]:[null];case"implode":if(!Array.isArray(e))throw new Error("implode input must be an array");return[e.map(function(o){if(typeof o=="string")throw new Error("string (".concat(JSON.stringify(o),") can't be imploded, unicode codepoint needs to be numeric"));if(typeof o!="number"||Number.isNaN(o))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");var a=Math.trunc(o);return a<0||a>1114111||a>=55296&&a<=57343?String.fromCodePoint(65533):String.fromCodePoint(a)}).join("")];default:return null}}var Ggt=se(function(){"use strict";Ei()});function Hgt(e,t){switch(t){case"type":return e===null?["null"]:Array.isArray(e)?["array"]:typeof e=="boolean"?["boolean"]:typeof e=="number"?["number"]:typeof e=="string"?["string"]:(typeof e==="undefined"?"undefined":_type_of(e))=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof e=="number"&&!Number.isFinite(e)];case"isnan":return[typeof e=="number"&&Number.isNaN(e)];case"isnormal":return[typeof e=="number"&&Number.isFinite(e)&&e!==0];case"isfinite":return[typeof e=="number"&&Number.isFinite(e)];case"numbers":return typeof e=="number"?[e]:[];case"strings":return typeof e=="string"?[e]:[];case"booleans":return typeof e=="boolean"?[e]:[];case"nulls":return e===null?[e]:[];case"arrays":return Array.isArray(e)?[e]:[];case"objects":return e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)?[e]:[];case"iterables":return Array.isArray(e)||e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)?[e]:[];case"scalars":return!Array.isArray(e)&&!(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object")?[e]:[];case"values":return e===null?[]:[e];case"not":return e===!1||e===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}var Zgt=se(function(){"use strict"}),Kgt=se(function(){"use strict";Egt(),Agt(),Pgt(),Mgt(),$gt(),Dgt(),Fgt(),jgt(),Bgt(),Wgt(),Ggt(),Zgt()});function yW(e,t,r){if(t.length===0)return r;var _t1=_to_array(t),n=_t1[0],i=_t1.slice(1);if(typeof n=="number"){if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e))throw new Error("Cannot index object with number");if(n>0x1fffffff)throw new Error("Array index too large");if(n<0)throw new Error("Out of bounds negative array index");var l=Array.isArray(e)?_to_consumable_array(e):[];for(;l.length<=n;)l.push(null);return l[n]=yW(l[n],i,r),l}if(Array.isArray(e))throw new Error("Cannot index array with string");if(!vi(n))return e!=null?e:Object.create(null);var o=Gi(e),a=o?ls(o):Object.create(null),s=Object.hasOwn(a,n)?a[n]:void 0;return Zi(a,n,yW(s,i,r)),a}function vW(e,t){if(t.length===0)return null;if(t.length===1){var i=t[0];if(Array.isArray(e)&&typeof i=="number"){var o=_to_consumable_array(e);return o.splice(i,1),o}if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)){var o10=String(i);if(!vi(o10))return e;var a=ls(e);return delete a[o10],a}return e}var _t1=_to_array(t),r=_t1[0],n=_t1.slice(1);if(Array.isArray(e)&&typeof r=="number"){var i10=_to_consumable_array(e);return i10[r]=vW(i10[r],n),i10}if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)){var i11=String(r);if(!vi(i11))return e;var o11=ls(e);return Object.hasOwn(o11,i11)&&Zi(o11,i11,vW(o11[i11],n)),o11}return e}var Qgt=se(function(){"use strict";vp()});function Jgt(e){var t,r,n,i;return{vars:new Map,limits:{maxIterations:(r=(t=e==null?void 0:e.limits)==null?void 0:t.maxIterations)!=null?r:j6e,maxDepth:(i=(n=e==null?void 0:e.limits)==null?void 0:n.maxDepth)!=null?i:yV},env:e==null?void 0:e.env,coverage:e==null?void 0:e.coverage,requireDefenseContext:e==null?void 0:e.requireDefenseContext,defenseContextChecked:!1}}function R9(e,t,r){var n=new Map(e.vars);return n.set(t,r),{vars:n,limits:e.limits,env:e.env,requireDefenseContext:e.requireDefenseContext,defenseContextChecked:e.defenseContextChecked,root:e.root,currentPath:e.currentPath,funcs:e.funcs,labels:e.labels,coverage:e.coverage}}function VS(e,t,r){switch(t.type){case"var":return R9(e,t.name,r);case"array":{if(!Array.isArray(r))return null;var n=e;for(var i=0;i<t.elements.length;i++){var o=t.elements[i],a=i<r.length?r[i]:null,s=VS(n,o,a);if(s===null)return null;n=s}return n}case"object":{var n10=Gi(r);if(!n10)return null;var i10=e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.fields[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o10=_step.value;var a9=void 0;if(typeof o10.key=="string")a9=o10.key;else{var c=dt(r,o10.key,e);if(c.length===0)return null;a9=String(c[0])}var s10=s_(n10,a9)?n10[a9]:null;o10.keyVar&&(i10=R9(i10,o10.keyVar,s10));var l=VS(i10,o10.pattern,s10);if(l===null)return null;i10=l}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i10}}}function Ygt(e,t){var r=e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(r&&(typeof r==="undefined"?"undefined":_type_of(r))=="object")if(Array.isArray(r))if(typeof n=="number")r=r[n];else return;else{var i=Gi(r);if(i&&typeof n=="string"&&Object.hasOwn(i,n))r=i[n];else return}else return}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function Uh(e){if(e.type==="Identity")return[];if(e.type==="Field"){var t=e.base?Uh(e.base):[];return t===null?null:_to_consumable_array(t).concat([e.name])}if(e.type==="Index"&&e.index.type==="Literal"){var t10=e.base?Uh(e.base):[];if(t10===null)return null;var r=e.index.value;return typeof r=="number"||typeof r=="string"?_to_consumable_array(t10).concat([r]):null}if(e.type==="Pipe"){var t11=Uh(e.left);return t11===null?null:_W(t11,e.right)}if(e.type==="Call"){if(e.name==="parent"||e.name==="root")return null;if(e.name==="first"&&e.args.length===0)return[0];if(e.name==="last"&&e.args.length===0)return[-1]}return null}function _W(e,t){if(t.type==="Call"){if(t.name==="parent"){var r=1;if(t.args.length>0&&t.args[0].type==="Literal"){var n=t.args[0].value;typeof n=="number"&&(r=n)}if(r>=0)return e.slice(0,Math.max(0,e.length-r));{var n10=-r-1;return e.slice(0,Math.min(n10,e.length))}}if(t.name==="root")return[]}if(t.type==="Field"){var r10=Uh(t);if(r10!==null)return _to_consumable_array(e).concat(_to_consumable_array(r10))}if(t.type==="Index"&&t.index.type==="Literal"){var r11=Uh(t);if(r11!==null)return _to_consumable_array(e).concat(_to_consumable_array(r11))}if(t.type==="Pipe"){var r12=_W(e,t.left);return r12===null?null:_W(r12,t.right)}return t.type==="Identity"?e:null}function Tve(e,t,r){if(t.type==="Comma"){var n=[];try{var _n;(_n=n).push.apply(_n,_to_consumable_array(dt(e,t.left,r)))}catch(i){if(_instanceof(i,Qt))throw i;if(n.length>0)return n;throw new Error("evaluation failed")}try{var _n1;(_n1=n).push.apply(_n1,_to_consumable_array(dt(e,t.right,r)))}catch(i){if(_instanceof(i,Qt))throw i;return n}return n}return dt(e,t,r)}function dt(e,t,r){var i,o,a,s,l,c;var n=r&&"vars"in r?r:Jgt(r);switch(n.defenseContextChecked||(yl(n.requireDefenseContext,"query-engine","evaluation"),n=_object_spread_props(_object_spread({},n),{defenseContextChecked:!0})),n.root===void 0&&(n=_object_spread_props(_object_spread({},n),{root:e,currentPath:[]})),(i=n.coverage)==null||i.hit("jq:node:".concat(t.type)),t.type){case"Identity":return[e];case"Field":return(t.base?dt(e,t.base,n):[e]).flatMap(function(d){var u=Gi(d);if(u){if(!Object.hasOwn(u,t.name))return[null];var m=u[t.name];return[m===void 0?null:m]}if(d===null)return[null];var p=Array.isArray(d)?"array":typeof d==="undefined"?"undefined":_type_of(d);throw new Error("Cannot index ".concat(p,' with string "').concat(t.name,'"'))});case"Index":return(t.base?dt(e,t.base,n):[e]).flatMap(function(d){return dt(d,t.index,n).flatMap(function(u){if(typeof u=="number"&&Array.isArray(d)){if(Number.isNaN(u))return[null];var p=Math.trunc(u),m=p<0?d.length+p:p;return m>=0&&m<d.length?[d[m]]:[null]}if(typeof u=="string"){var p10=Gi(d);return!p10||!Object.hasOwn(p10,u)?[null]:[p10[u]]}return[null]})});case"Slice":return(t.base?dt(e,t.base,n):[e]).flatMap(function(d){if(d===null)return[null];if(!Array.isArray(d)&&typeof d!="string")throw new Error("Cannot slice ".concat(typeof d==="undefined"?"undefined":_type_of(d)," (").concat(JSON.stringify(d),")"));var u=d.length,p=t.start?dt(e,t.start,n):[0],m=t.end?dt(e,t.end,n):[u];return p.flatMap(function(h){return m.map(function(g){var x=h,v=g,y=Number.isNaN(x)?0:Number.isInteger(x)?x:Math.floor(x),_=Number.isNaN(v)?u:Number.isInteger(v)?v:Math.ceil(v),b=Ave(y,u),w=Ave(_,u);return Array.isArray(d),d.slice(b,w)})})});case"Iterate":return(t.base?dt(e,t.base,n):[e]).flatMap(function(d){return Array.isArray(d)?d:d&&(typeof d==="undefined"?"undefined":_type_of(d))=="object"?Object.values(d):[]});case"Pipe":{var _$d=dt(e,t.left,n),u=Uh(t.left),p=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_$d[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;try{var _p1;if(u!==null){var _p2;var _$h=_object_spread_props(_object_spread({},n),{currentPath:_to_consumable_array((o=n.currentPath)!=null?o:[]).concat(_to_consumable_array(u))});(_p2=p).push.apply(_p2,_to_consumable_array(dt(m,t.right,_$h)))}else(_p1=p).push.apply(_p1,_to_consumable_array(dt(m,t.right,n)))}catch(h){throw _instanceof(h,BS)?h.withPrependedResults(p):h}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return p}case"Comma":{var _$d1=dt(e,t.left,n),u10=dt(e,t.right,n);return _to_consumable_array(_$d1).concat(_to_consumable_array(u10))}case"Literal":return[t.value];case"Array":return t.elements?[dt(e,t.elements,n)]:[[]];case"Object":{var _$d2=[Object.create(null)];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=t.entries[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u11=_step1.value;var _d1;var p10=typeof u11.key=="string"?[u11.key]:dt(e,u11.key,n),m10=dt(e,u11.value,n),_$h1=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined,_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator2=_$d2[Symbol.iterator](),_step2;!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){var g=_step2.value;try{for(var _iterator3=p10[Symbol.iterator](),_step3;!(_iteratorNormalCompletion2=(_step3=_iterator3.next()).done);_iteratorNormalCompletion2=true){var x=_step3.value;if(typeof x!="string"){var v=x===null?"null":Array.isArray(x)?"array":typeof x==="undefined"?"undefined":_type_of(x);throw new Error("Cannot use ".concat(v," (").concat(JSON.stringify(x),") as object key"))}if(!vi(x)){var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=m10[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var v10=_step4.value;_$h1.push(ls(g))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}continue}var _iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(var _iterator5=m10[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var v11=_step5.value;var y=ls(g);Zi(y,x,v11),_$h1.push(y)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}_$d2.length=0,(_d1=_$d2).push.apply(_d1,_to_consumable_array(_$h1))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return _$d2}case"Paren":return dt(e,t.expr,n);case"BinaryOp":return t0t(e,t.op,t.left,t.right,n);case"UnaryOp":return dt(e,t.operand,n).map(function(d){if(t.op==="-"){if(typeof d=="number")return-d;if(typeof d=="string"){var u=function(p){return p.length>5?'"'.concat(p.slice(0,3),"..."):JSON.stringify(p)};throw new Error("string (".concat(u(d),") cannot be negated"))}return null}return t.op==="not"?!ed(d):null});case"Cond":return dt(e,t.cond,n).flatMap(function(d){if(ed(d))return dt(e,t.then,n);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.elifs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;if(dt(e,u.cond,n).some(ed))return dt(e,u.then,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.else?dt(e,t.else,n):[e]});case"Try":try{return dt(e,t.body,n)}catch(d){if(t.catch){var u12=_instanceof(d,xV)?d.value:_instanceof(d,Error)?d.message:String(d);return dt(u12,t.catch,n)}return[]}case"Call":return z6e(e,t.name,t.args,n);case"VarBind":return dt(e,t.value,n).flatMap(function(d){var _p1;var u=null,p=[];t.pattern?p.push(t.pattern):t.name&&p.push({type:"var",name:t.name}),t.alternatives&&(_p1=p).push.apply(_p1,_to_consumable_array(t.alternatives));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=p[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;if(u=VS(n,m,d),u!==null)break}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return u===null?[]:dt(e,t.body,u)});case"VarRef":{if(t.name==="$ENV")return[n.env?Jc(n.env):Object.create(null)];var _$d3=n.vars.get(t.name);return _$d3!==void 0?[_$d3]:[null]}case"Recurse":{var _$d4=[],u13=new WeakSet,p11=function(m){if(m&&(typeof m==="undefined"?"undefined":_type_of(m))=="object"){if(u13.has(m))return;u13.add(m)}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(_$d4.push(m),Array.isArray(m))try{for(var _iterator=m[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _$h=_step.value;p11(_$h)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else if(m&&(typeof m==="undefined"?"undefined":_type_of(m))=="object")try{for(var _iterator1=Object.keys(m)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _$h1=_step1.value;p11(m[_$h1])}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}};return p11(e),_$d4}case"Optional":try{return dt(e,t.expr,n)}catch(d){return[]}case"StringInterp":return[t.parts.map(function(d){return typeof d=="string"?d:dt(e,d,n).map(function(u){return typeof u=="string"?u:JSON.stringify(u)}).join("")}).join("")];case"UpdateOp":return[Xgt(e,t.path,t.op,t.value,n)];case"Reduce":{var _$d5=dt(e,t.expr,n),u14=dt(e,t.init,n)[0],p12=(a=n.limits.maxDepth)!=null?a:yV;var _iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(var _iterator6=_$d5[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){var m11=_step6.value;var _$h2=void 0;if(t.pattern){if(_$h2=VS(n,t.pattern,m11),_$h2===null)continue}else _$h2=R9(n,t.varName,m11);if(u14=dt(u14,t.update,_$h2)[0],hV(u14,p12+1)>p12)return[null]}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}return[u14]}case"Foreach":{var _$d6=dt(e,t.expr,n),u15=dt(e,t.init,n)[0],p13=[];var _iteratorNormalCompletion7=true,_didIteratorError7=false,_iteratorError7=undefined;try{for(var _iterator7=_$d6[Symbol.iterator](),_step7;!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=true){var m12=_step7.value;try{var _$h3=void 0;if(t.pattern){if(_$h3=VS(n,t.pattern,m12),_$h3===null)continue}else _$h3=R9(n,t.varName,m12);if(u15=dt(u15,t.update,_$h3)[0],t.extract){var _p3;var g10=dt(u15,t.extract,_$h3);(_p3=p13).push.apply(_p3,_to_consumable_array(g10))}else p13.push(u15)}catch(h){throw _instanceof(h,BS)?h.withPrependedResults(p13):h}}}catch(err){_didIteratorError7=true;_iteratorError7=err}finally{try{if(!_iteratorNormalCompletion7&&_iterator7.return!=null){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}}return p13}case"Label":try{return dt(e,t.body,_object_spread_props(_object_spread({},n),{labels:new Set(_to_consumable_array((s=n.labels)!=null?s:[]).concat([t.name]))}))}catch(d){if(_instanceof(d,BS)&&d.label===t.name)return d.partialResults;throw d}case"Break":throw new BS(t.name);case"Def":{var _$d7=new Map((l=n.funcs)!=null?l:[]),u16="".concat(t.name,"/").concat(t.params.length);_$d7.set(u16,{params:t.params,body:t.funcBody,closure:new Map((c=n.funcs)!=null?c:[])});var p14=_object_spread_props(_object_spread({},n),{funcs:_$d7});return dt(e,t.body,p14)}default:{var _$d8=t;throw new Error("Unknown AST node type: ".concat(_$d8.type))}}}function Ave(e,t){return e<0?Math.max(0,t+e):Math.min(e,t)}function Xgt(e,t,r,n,i){function o(s,l){var c;switch(r){case"=":return l;case"|=":return(c=dt(s,n,i)[0])!=null?c:null;case"+=":return typeof s=="number"&&typeof l=="number"||typeof s=="string"&&typeof l=="string"?s+l:Array.isArray(s)&&Array.isArray(l)?_to_consumable_array(s).concat(_to_consumable_array(l)):s&&l&&(typeof s==="undefined"?"undefined":_type_of(s))=="object"&&(typeof l==="undefined"?"undefined":_type_of(l))=="object"?s4e(s,l):l;case"-=":return typeof s=="number"&&typeof l=="number"?s-l:s;case"*=":return typeof s=="number"&&typeof l=="number"?s*l:s;case"/=":return typeof s=="number"&&typeof l=="number"?s/l:s;case"%=":return typeof s=="number"&&typeof l=="number"?s%l:s;case"//=":return s===null||s===!1?l:s;default:return l}}function a(s,l,c){switch(l.type){case"Identity":return c(s);case"Field":{if(!vi(l.name))return s;if(l.base)return a(s,l.base,function(d){if(d&&(typeof d==="undefined"?"undefined":_type_of(d))=="object"&&!Array.isArray(d)){var u=ls(d),p=Object.hasOwn(u,l.name)?u[l.name]:void 0;return Zi(u,l.name,c(p)),u}return d});if(s&&(typeof s==="undefined"?"undefined":_type_of(s))=="object"&&!Array.isArray(s)){var d=ls(s),u=Object.hasOwn(d,l.name)?d[l.name]:void 0;return Zi(d,l.name,c(u)),d}return s}case"Index":{var d10=dt(e,l.index,i)[0];if(typeof d10=="number"&&Number.isNaN(d10))throw new Error("Cannot set array element at NaN index");if(typeof d10=="number"&&!Number.isInteger(d10)&&(d10=Math.trunc(d10)),l.base)return a(s,l.base,function(u){if(typeof d10=="number"&&Array.isArray(u)){var p=_to_consumable_array(u),m=d10<0?p.length+d10:d10;if(m>=0){for(;p.length<=m;)p.push(null);p[m]=c(p[m])}return p}if(typeof d10=="string"&&u&&(typeof u==="undefined"?"undefined":_type_of(u))=="object"&&!Array.isArray(u)){if(!vi(d10))return u;var p10=ls(u),m10=Object.hasOwn(p10,d10)?p10[d10]:void 0;return Zi(p10,d10,c(m10)),p10}return u});if(typeof d10=="number"){if(d10>0x1fffffff)throw new Error("Array index too large");if(d10<0&&(!s||!Array.isArray(s)))throw new Error("Out of bounds negative array index");if(Array.isArray(s)){var u10=_to_consumable_array(s),p=d10<0?u10.length+d10:d10;if(p>=0){for(;u10.length<=p;)u10.push(null);u10[p]=c(u10[p])}return u10}if(s==null){var u11=[];for(;u11.length<=d10;)u11.push(null);return u11[d10]=c(null),u11}return s}if(typeof d10=="string"&&s&&(typeof s==="undefined"?"undefined":_type_of(s))=="object"&&!Array.isArray(s)){if(!vi(d10))return s;var u12=ls(s),p10=Object.hasOwn(u12,d10)?u12[d10]:void 0;return Zi(u12,d10,c(p10)),u12}return s}case"Iterate":{var d11=function(u){if(Array.isArray(u))return u.map(function(p){return c(p)});if(u&&(typeof u==="undefined"?"undefined":_type_of(u))=="object"){var p=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(u)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),m=_step_value[0],h=_step_value[1];vi(m)&&Zi(p,m,c(h))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return p}return u};return l.base?a(s,l.base,d11):d11(s)}case"Pipe":{var d12=a(s,l.left,function(u){return u});return a(d12,l.right,c)}default:return c(s)}}return a(e,t,function(s){var c;if(r==="|=")return o(s,s);var l=dt(e,n,i);return o(s,(c=l[0])!=null?c:null)})}function e0t(e,t,r){function n(o,a,s){switch(a.type){case"Identity":return s;case"Field":{if(!vi(a.name))return o;if(a.base){var l=dt(o,a.base,r)[0],c=n(l,{type:"Field",name:a.name},s);return n(o,a.base,c)}if(o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&!Array.isArray(o)){var l10=ls(o);return Zi(l10,a.name,s),l10}return o}case"Index":{if(a.base){var c10=dt(o,a.base,r)[0],d=n(c10,{type:"Index",index:a.index},s);return n(o,a.base,d)}var l11=dt(e,a.index,r)[0];if(typeof l11=="number"&&Array.isArray(o)){var c11=_to_consumable_array(o),d10=l11<0?c11.length+l11:l11;return d10>=0&&d10<c11.length&&(c11[d10]=s),c11}if(typeof l11=="string"&&o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&!Array.isArray(o)){if(!vi(l11))return o;var c12=ls(o);return Zi(c12,l11,s),c12}return o}default:return o}}function i(o,a){switch(a.type){case"Identity":return null;case"Field":{if(!vi(a.name))return o;if(a.base){var l=dt(o,a.base,r)[0];if(l==null)return o;var c=i(l,{type:"Field",name:a.name});return n(o,a.base,c)}if(o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&!Array.isArray(o)){if(!vi(a.name))return o;var l10=ls(o);return delete l10[a.name],l10}return o}case"Index":{if(a.base){var c10=dt(o,a.base,r)[0];if(c10==null)return o;var d=i(c10,{type:"Index",index:a.index});return n(o,a.base,d)}var l11=dt(e,a.index,r)[0];if(typeof l11=="number"&&Array.isArray(o)){var c11=_to_consumable_array(o),d10=l11<0?c11.length+l11:l11;return d10>=0&&d10<c11.length&&c11.splice(d10,1),c11}if(typeof l11=="string"&&o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"&&!Array.isArray(o)){if(!vi(l11))return o;var c12=ls(o);return delete c12[l11],c12}return o}case"Iterate":return Array.isArray(o)?[]:o&&(typeof o==="undefined"?"undefined":_type_of(o))=="object"?Object.create(null):o;case"Pipe":{var l12=function l(m,h,g){switch(h.type){case"Identity":return g;case"Field":{if(!vi(h.name))return m;if(m&&(typeof m==="undefined"?"undefined":_type_of(m))=="object"&&!Array.isArray(m)){var x=ls(m);return Zi(x,h.name,g),x}return m}case"Index":{var x10=dt(e,h.index,r)[0];if(typeof x10=="number"&&Array.isArray(m)){var v=_to_consumable_array(m),y=x10<0?v.length+x10:x10;return y>=0&&y<v.length&&(v[y]=g),v}if(typeof x10=="string"&&m&&(typeof m==="undefined"?"undefined":_type_of(m))=="object"&&!Array.isArray(m)){if(!vi(x10))return m;var v10=ls(m);return Zi(v10,x10,g),v10}return m}case"Pipe":{var x11=dt(m,h.left,r)[0],v11=l12(x11,h.right,g);return l12(m,h.left,v11)}default:return m}};var s=l12;var c13=a.left,d11=a.right,u=dt(o,c13,r)[0];if(u==null)return o;var p=i(u,d11);return l12(o,c13,p)}default:return o}}return i(e,t)}function t0t(e,t,r,n,i){if(t==="and")return dt(e,r,i).flatMap(function(s){return ed(s)?dt(e,n,i).map(function(l){return ed(l)}):[!1]});if(t==="or")return dt(e,r,i).flatMap(function(s){return ed(s)?[!0]:dt(e,n,i).map(function(l){return ed(l)})});if(t==="//"){var s=dt(e,r,i).filter(function(l){return l!=null&&l!==!1});return s.length>0?s:dt(e,n,i)}var o=dt(e,r,i),a=dt(e,n,i);return o.flatMap(function(s){return a.map(function(l){switch(t){case"+":return s===null?l:l===null?s:typeof s=="number"&&typeof l=="number"||typeof s=="string"&&typeof l=="string"?s+l:Array.isArray(s)&&Array.isArray(l)?_to_consumable_array(s).concat(_to_consumable_array(l)):s&&l&&(typeof s==="undefined"?"undefined":_type_of(s))=="object"&&(typeof l==="undefined"?"undefined":_type_of(l))=="object"&&!Array.isArray(s)&&!Array.isArray(l)?s4e(s,l):null;case"-":if(typeof s=="number"&&typeof l=="number")return s-l;if(Array.isArray(s)&&Array.isArray(l)){var c=new Set(l.map(function(d){return JSON.stringify(d)}));return s.filter(function(d){return!c.has(JSON.stringify(d))})}if(typeof s=="string"&&typeof l=="string"){var c10=function(d){return d.length>10?'"'.concat(d.slice(0,10),"..."):JSON.stringify(d)};throw new Error("string (".concat(c10(s),") and string (").concat(c10(l),") cannot be subtracted"))}return null;case"*":if(typeof s=="number"&&typeof l=="number")return s*l;if(typeof s=="string"&&typeof l=="number")return s.repeat(l);{var c11=Gi(s),d=Gi(l);if(c11&&d)return D6e(c11,d)}return null;case"/":if(typeof s=="number"&&typeof l=="number"){if(l===0)throw new Error("number (".concat(s,") and number (").concat(l,") cannot be divided because the divisor is zero"));return s/l}return typeof s=="string"&&typeof l=="string"?s.split(l):null;case"%":if(typeof s=="number"&&typeof l=="number"){if(l===0)throw new Error("number (".concat(s,") and number (").concat(l,") cannot be divided (remainder) because the divisor is zero"));return!Number.isFinite(s)&&!Number.isNaN(s)?!Number.isFinite(l)&&!Number.isNaN(l)&&s<0&&l>0?-1:0:s%l}return null;case"==":return QS(s,l);case"!=":return!QS(s,l);case"<":return YI(s,l)<0;case"<=":return YI(s,l)<=0;case">":return YI(s,l)>0;case">=":return YI(s,l)>=0;default:return null}})})}function z6e(e,t,r,n){var v,y,_;var i=U6e.get(t);if(i)return typeof e=="number"?[i(e)]:[null];var o=Ngt(e,t,r,n,dt);if(o!==null)return o;var a=Vgt(e,t,r,n,dt);if(a!==null)return a;var s=Igt(e,t,r,n,dt);if(s!==null)return s;var l=Rgt(e,t,n.limits.maxDepth);if(l!==null)return l;var c=Hgt(e,t);if(c!==null)return c;var d=zgt(e,t,r,n,dt);if(d!==null)return d;var u=Cgt(e,t,r,n,dt,Tve,gW,ed,xW,Qt);if(u!==null)return u;var p=Ugt(e,t,r,n,dt,ed,yW,vW,e0t,x9);if(p!==null)return p;var m=Ogt(e,t,r,n,dt,QS);if(m!==null)return m;var h=Tgt(e,t,r,n,dt,Tve,ed,Qt);if(h!==null)return h;var g=Lgt(e,t,r,n,dt,ed,Ygt,z6e);if(g!==null)return g;var x=qgt(e,t,r,n,dt,QS);if(x!==null)return x;switch(t){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{var b=r.length>0?dt(e,r[0],n)[0]:e;throw new xV(b)}case"env":return[n.env?Jc(n.env):Object.create(null)];case"debug":return[e];case"input_line_number":return[1];default:{var b10="".concat(t,"/").concat(r.length),w=(v=n.funcs)==null?void 0:v.get(b10);if(w){var S=(_=(y=w.closure)!=null?y:n.funcs)!=null?_:new Map,k=new Map(S);k.set(b10,w);for(var C=0;C<w.params.length;C++){var T=w.params[C],I=r[C];if(I){var O=dt(e,I,n),M=void 0;if(O.length===0)M={type:"Call",name:"empty",args:[]};else if(O.length===1)M={type:"Literal",value:O[0]};else{M={type:"Literal",value:O[O.length-1]};for(var R=O.length-2;R>=0;R--)M={type:"Comma",left:{type:"Literal",value:O[R]},right:M}}k.set("".concat(T,"/0"),{params:[],body:M})}}var E=_object_spread_props(_object_spread({},n),{funcs:k});return dt(e,w.body,E)}throw new Error("Unknown function: ".concat(t))}}}function x9(e,t,r,n,i){if(t.type==="Comma"){var a=t;x9(e,a.left,r,n,i),x9(e,a.right,r,n,i);return}var o=Uh(t);if(o!==null){i.push(_to_consumable_array(n).concat(_to_consumable_array(o)));return}if(t.type==="Iterate"){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(Array.isArray(e))for(var a9=0;a9<e.length;a9++)i.push(_to_consumable_array(n).concat([a9]));else if(e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object")try{for(var _iterator=Object.keys(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a10=_step.value;i.push(_to_consumable_array(n).concat([a10]))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return}if(t.type==="Recurse"){var a11=function(s,l){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(i.push(_to_consumable_array(n).concat(_to_consumable_array(l))),s&&(typeof s==="undefined"?"undefined":_type_of(s))=="object")if(Array.isArray(s))for(var c=0;c<s.length;c++)a11(s[c],_to_consumable_array(l).concat([c]));else try{for(var _iterator=Object.keys(s)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c10=_step.value;a11(s[c10],_to_consumable_array(l).concat([c10]))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};a11(e,[]);return}if(t.type==="Pipe"){var a12=Uh(t.left);if(a12!==null){var s=dt(e,t.left,r);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=s[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var l=_step1.value;x9(l,t.right,r,_to_consumable_array(n).concat(_to_consumable_array(a12)),i)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return}}dt(e,t,r).length>0&&i.push(n)}var BS,xV,j6e,yV,U6e,r0t=se(function(){"use strict";Vh(),jr(),Ff(),Kgt(),Qgt(),vp(),gV(),BS=/*#__PURE__*/function(Error1){_inherits(B6e,Error1);function B6e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];_class_call_check(this,B6e);var _this;_this=_call_super(this,B6e,["break ".concat(r)]);A(_this,"label");A(_this,"partialResults");_this.label=r,_this.partialResults=n,_this.name="BreakError";return _this}_create_class(B6e,[{key:"withPrependedResults",value:function withPrependedResults(r){return new B6e(this.label,_to_consumable_array(r).concat(_to_consumable_array(this.partialResults)))}}]);return B6e}(_wrap_native_super(Error)),xV=/*#__PURE__*/function(Error1){_inherits(xV1,Error1);function xV1(t){_class_call_check(this,xV1);var _this;_this=_call_super(this,xV1,[typeof t=="string"?t:JSON.stringify(t)]);A(_this,"value");_this.value=t,_this.name="JqError";return _this}return xV1}(_wrap_native_super(Error)),j6e=1e4,yV=2e3,U6e=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]])});function q6e(e){var t=[],r=0,n=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e[r+c]},i=function(){return e[r++]},o=function(){return r>=e.length},a=function(c){return c>="0"&&c<="9"},s=function(c){return c>="a"&&c<="z"||c>="A"&&c<="Z"||c==="_"},l=function(c){return s(c)||a(c)};for(;!o();){var c=r,d=i();if(!(d===" "||d===" "||d==="\n"||d==="\r")){if(d==="#"){for(;!o()&&n()!=="\n";)i();continue}if(d==="."&&n()==="."){i(),t.push({type:"DOTDOT",pos:c});continue}if(d==="="&&n()==="="){i(),t.push({type:"EQ",pos:c});continue}if(d==="!"&&n()==="="){i(),t.push({type:"NE",pos:c});continue}if(d==="<"&&n()==="="){i(),t.push({type:"LE",pos:c});continue}if(d===">"&&n()==="="){i(),t.push({type:"GE",pos:c});continue}if(d==="/"&&n()==="/"){i(),n()==="="?(i(),t.push({type:"UPDATE_ALT",pos:c})):t.push({type:"ALT",pos:c});continue}if(d==="+"&&n()==="="){i(),t.push({type:"UPDATE_ADD",pos:c});continue}if(d==="-"&&n()==="="){i(),t.push({type:"UPDATE_SUB",pos:c});continue}if(d==="*"&&n()==="="){i(),t.push({type:"UPDATE_MUL",pos:c});continue}if(d==="/"&&n()==="="){i(),t.push({type:"UPDATE_DIV",pos:c});continue}if(d==="%"&&n()==="="){i(),t.push({type:"UPDATE_MOD",pos:c});continue}if(d==="="&&n()!=="="){t.push({type:"ASSIGN",pos:c});continue}if(d==="."){t.push({type:"DOT",pos:c});continue}if(d==="|"){n()==="="?(i(),t.push({type:"UPDATE_PIPE",pos:c})):t.push({type:"PIPE",pos:c});continue}if(d===","){t.push({type:"COMMA",pos:c});continue}if(d===":"){t.push({type:"COLON",pos:c});continue}if(d===";"){t.push({type:"SEMICOLON",pos:c});continue}if(d==="("){t.push({type:"LPAREN",pos:c});continue}if(d===")"){t.push({type:"RPAREN",pos:c});continue}if(d==="["){t.push({type:"LBRACKET",pos:c});continue}if(d==="]"){t.push({type:"RBRACKET",pos:c});continue}if(d==="{"){t.push({type:"LBRACE",pos:c});continue}if(d==="}"){t.push({type:"RBRACE",pos:c});continue}if(d==="?"){t.push({type:"QUESTION",pos:c});continue}if(d==="+"){t.push({type:"PLUS",pos:c});continue}if(d==="-"){t.push({type:"MINUS",pos:c});continue}if(d==="*"){t.push({type:"STAR",pos:c});continue}if(d==="/"){t.push({type:"SLASH",pos:c});continue}if(d==="%"){t.push({type:"PERCENT",pos:c});continue}if(d==="<"){t.push({type:"LT",pos:c});continue}if(d===">"){t.push({type:"GT",pos:c});continue}if(a(d)){var u=d;for(;!o()&&(a(n())||n()==="."||n()==="e"||n()==="E");)(n()==="e"||n()==="E")&&(e[r+1]==="+"||e[r+1]==="-")&&(u+=i()),u+=i();t.push({type:"NUMBER",value:Number(u),pos:c});continue}if(d==='"'){var u10="";for(;!o()&&n()!=='"';)if(n()==="\\"){if(i(),o())break;var p=i();switch(p){case"n":u10+="\n";break;case"r":u10+="\r";break;case"t":u10+=" ";break;case"\\":u10+="\\";break;case'"':u10+='"';break;case"(":u10+="\\(";break;default:u10+=p}}else u10+=i();o()||i(),t.push({type:"STRING",value:u10,pos:c});continue}if(s(d)||d==="$"||d==="@"){var u11=d;for(;!o()&&l(n());)u11+=i();var p10=bW.get(u11);p10?t.push({type:p10,value:u11,pos:c}):t.push({type:"IDENT",value:u11,pos:c});continue}throw new Error("Unexpected character '".concat(d,"' at position ").concat(c))}}return t.push({type:"EOF",pos:r}),t}function n0t(e){var t=q6e(e);return new W6e(t).parse()}var bW,$S,W6e,i0t=se(function(){"use strict";bW=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),$S=new Set(bW.values()),W6e=/*#__PURE__*/function(){function V6e(t){_class_call_check(this,V6e);A(this,"tokens");A(this,"pos",0);this.tokens=t}_create_class(V6e,[{key:"peek",value:function peek(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var r;return(r=this.tokens[this.pos+t])!=null?r:{type:"EOF",pos:-1}}},{key:"advance",value:function advance(){return this.tokens[this.pos++]}},{key:"check",value:function check(t){return this.peek().type===t}},{key:"match",value:function match(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key]}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(this.check(r))return this.advance()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return null}},{key:"expect",value:function expect(t,r){if(!this.check(t))throw new Error("".concat(r," at position ").concat(this.peek().pos,", got ").concat(this.peek().type));return this.advance()}},{key:"isFieldNameAfterDot",value:function isFieldNameAfterDot(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;var r=this.peek(t),n=this.peek(t+1);return n.type==="STRING"?!0:n.type==="IDENT"||$S.has(n.type)?n.pos===r.pos+1:!1}},{key:"isIdentLike",value:function isIdentLike(){var t=this.peek().type;return t==="IDENT"||$S.has(t)}},{key:"consumeFieldNameAfterDot",value:function consumeFieldNameAfterDot(t){var r=this.peek();return r.type==="STRING"?this.advance().value:(r.type==="IDENT"||$S.has(r.type))&&r.pos===t.pos+1?this.advance().value:null}},{key:"parse",value:function parse(){var t=this.parseExpr();if(!this.check("EOF"))throw new Error("Unexpected token ".concat(this.peek().type," at position ").concat(this.peek().pos));return t}},{key:"parseExpr",value:function parseExpr(){return this.parsePipe()}},{key:"parsePattern",value:function parsePattern(){if(this.match("LBRACKET")){var n=[];if(!this.check("RBRACKET"))for(n.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)n.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:n}}if(this.match("LBRACE")){var n10=[];if(!this.check("RBRACE"))for(n10.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)n10.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:n10}}var t=this.expect("IDENT","Expected variable name in pattern"),r=t.value;if(!r.startsWith("$"))throw new Error("Variable name must start with $ at position ".concat(t.pos));return{type:"var",name:r}}},{key:"parsePatternField",value:function parsePatternField(){if(this.match("LPAREN")){var r=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");var n=this.parsePattern();return{key:r,pattern:n}}var t=this.peek();if(t.type==="IDENT"||$S.has(t.type)){var r10=t.value;if(r10.startsWith("$")){if(this.advance(),this.match("COLON")){var n10=this.parsePattern();return{key:r10.slice(1),pattern:n10,keyVar:r10}}return{key:r10.slice(1),pattern:{type:"var",name:r10}}}if(this.advance(),this.match("COLON")){var n11=this.parsePattern();return{key:r10,pattern:n11}}return{key:r10,pattern:{type:"var",name:"$".concat(r10)}}}throw new Error("Expected field name in object pattern at position ".concat(t.pos))}},{key:"parsePipe",value:function parsePipe(){var t=this.parseComma();for(;this.match("PIPE");){var r=this.parseComma();t={type:"Pipe",left:t,right:r}}return t}},{key:"parseComma",value:function parseComma(){var t=this.parseVarBind();for(;this.match("COMMA");){var r=this.parseVarBind();t={type:"Comma",left:t,right:r}}return t}},{key:"parseVarBind",value:function parseVarBind(){var r;var t=this.parseUpdate();if(this.match("AS")){var n=this.parsePattern(),i=[];for(;this.check("QUESTION")&&((r=this.peekAhead(1))==null?void 0:r.type)==="ALT";)this.advance(),this.advance(),i.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");var o=this.parseExpr();return n.type==="var"&&i.length===0?{type:"VarBind",name:n.name,value:t,body:o}:{type:"VarBind",name:n.type==="var"?n.name:"",value:t,body:o,pattern:n.type!=="var"?n:void 0,alternatives:i.length>0?i:void 0}}return t}},{key:"peekAhead",value:function peekAhead(t){var r=this.pos+t;return r<this.tokens.length?this.tokens[r]:void 0}},{key:"parseUpdate",value:function parseUpdate(){var t=this.parseAlt(),r=new Map([["ASSIGN","="],["UPDATE_ADD","+="],["UPDATE_SUB","-="],["UPDATE_MUL","*="],["UPDATE_DIV","/="],["UPDATE_MOD","%="],["UPDATE_ALT","//="],["UPDATE_PIPE","|="]]),n=this.match("ASSIGN","UPDATE_ADD","UPDATE_SUB","UPDATE_MUL","UPDATE_DIV","UPDATE_MOD","UPDATE_ALT","UPDATE_PIPE");if(n){var i=this.parseVarBind(),o=r.get(n.type);if(o)return{type:"UpdateOp",op:o,path:t,value:i}}return t}},{key:"parseAlt",value:function parseAlt(){var t=this.parseOr();for(;this.match("ALT");){var r=this.parseOr();t={type:"BinaryOp",op:"//",left:t,right:r}}return t}},{key:"parseOr",value:function parseOr(){var t=this.parseAnd();for(;this.match("OR");){var r=this.parseAnd();t={type:"BinaryOp",op:"or",left:t,right:r}}return t}},{key:"parseAnd",value:function parseAnd(){var t=this.parseNot();for(;this.match("AND");){var r=this.parseNot();t={type:"BinaryOp",op:"and",left:t,right:r}}return t}},{key:"parseNot",value:function parseNot(){return this.parseComparison()}},{key:"parseComparison",value:function parseComparison(){var t=this.parseAddSub(),r=new Map([["EQ","=="],["NE","!="],["LT","<"],["LE","<="],["GT",">"],["GE",">="]]),n=this.match("EQ","NE","LT","LE","GT","GE");if(n){var i=r.get(n.type);if(i){var o=this.parseAddSub();t={type:"BinaryOp",op:i,left:t,right:o}}}return t}},{key:"parseAddSub",value:function parseAddSub(){var t=this.parseMulDiv();for(;;)if(this.match("PLUS")){var r=this.parseMulDiv();t={type:"BinaryOp",op:"+",left:t,right:r}}else if(this.match("MINUS")){var r10=this.parseMulDiv();t={type:"BinaryOp",op:"-",left:t,right:r10}}else break;return t}},{key:"parseMulDiv",value:function parseMulDiv(){var t=this.parseUnary();for(;;)if(this.match("STAR")){var r=this.parseUnary();t={type:"BinaryOp",op:"*",left:t,right:r}}else if(this.match("SLASH")){var r10=this.parseUnary();t={type:"BinaryOp",op:"/",left:t,right:r10}}else if(this.match("PERCENT")){var r11=this.parseUnary();t={type:"BinaryOp",op:"%",left:t,right:r11}}else break;return t}},{key:"parseUnary",value:function parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}},{key:"parsePostfix",value:function parsePostfix(){var t=this.parsePrimary();for(;;)if(this.match("QUESTION"))t={type:"Optional",expr:t};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),t={type:"Field",name:this.advance().value,base:t};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))t={type:"Iterate",base:t};else if(this.check("COLON")){this.advance();var r=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),t={type:"Slice",end:r,base:t}}else{var r10=this.parseExpr();if(this.match("COLON")){var n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),t={type:"Slice",start:r10,end:n,base:t}}else this.expect("RBRACKET","Expected ']'"),t={type:"Index",index:r10,base:t}}else break;return t}},{key:"parsePrimary",value:function parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){var t=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();var i=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:i}}var n=this.parseExpr();if(this.match("COLON")){var i10=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:n,end:i10}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:n}}var r=this.consumeFieldNameAfterDot(t);return r!==null?{type:"Field",name:r}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){var t10=this.advance().value;return t10.includes("\\(")?this.parseStringInterpolation(t10):{type:"Literal",value:t10}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};var t11=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:t11}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){var t12=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:t12}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){var t13=this.parsePostfix(),r10;return this.match("CATCH")&&(r10=this.parsePostfix()),{type:"Try",body:t13,catch:r10}}if(this.match("REDUCE")){var t14=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");var r11=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");var n10=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");var i11=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");var o=r11.type==="var"?r11.name:"";return{type:"Reduce",expr:t14,varName:o,init:n10,update:i11,pattern:r11.type!=="var"?r11:void 0}}if(this.match("FOREACH")){var t15=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");var r12=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");var n11=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");var i12=this.parseExpr(),o10;this.match("SEMICOLON")&&(o10=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");var a=r12.type==="var"?r12.name:"";return{type:"Foreach",expr:t15,varName:a,init:n11,update:i12,extract:o10,pattern:r12.type!=="var"?r12:void 0}}if(this.match("LABEL")){var t16=this.expect("IDENT","Expected label name (e.g., $out)"),r13=t16.value;if(!r13.startsWith("$"))throw new Error("Label name must start with $ at position ".concat(t16.pos));this.expect("PIPE","Expected '|' after label name");var n12=this.parseExpr();return{type:"Label",name:r13,body:n12}}if(this.match("BREAK")){var t17=this.expect("IDENT","Expected label name to break to"),r14=t17.value;if(!r14.startsWith("$"))throw new Error("Break label must start with $ at position ".concat(t17.pos));return{type:"Break",name:r14}}if(this.match("DEF")){var t18=this.expect("IDENT","Expected function name after def").value,r15=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){var o11=this.expect("IDENT","Expected parameter name");for(r15.push(o11.value);this.match("SEMICOLON");){var a9=this.expect("IDENT","Expected parameter name");r15.push(a9.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");var n13=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");var i13=this.parseExpr();return{type:"Def",name:t18,params:r15,funcBody:n13,body:i13}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){var t19=this.advance().value;if(t19.startsWith("$"))return{type:"VarRef",name:t19};if(this.match("LPAREN")){var r16=[];if(!this.check("RPAREN"))for(r16.push(this.parseExpr());this.match("SEMICOLON");)r16.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:t19,args:r16}}return{type:"Call",name:t19,args:[]}}throw new Error("Unexpected token ".concat(this.peek().type," at position ").concat(this.peek().pos))}},{key:"parseObjectConstruction",value:function parseObjectConstruction(){var t=[];if(!this.check("RBRACE"))do{var r=void 0,n=void 0;if(this.match("LPAREN"))r=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else if(this.isIdentLike()){var i=this.advance().value;this.match("COLON")?(r=i,n=this.parseObjectValue()):(r=i,n={type:"Field",name:i})}else if(this.check("STRING"))r=this.advance().value,this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else throw new Error("Expected object key at position ".concat(this.peek().pos));t.push({key:r,value:n})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:t}}},{key:"parseObjectValue",value:function parseObjectValue(){var t=this.parseVarBind();for(;this.match("PIPE");){var r=this.parseVarBind();t={type:"Pipe",left:t,right:r}}return t}},{key:"parseIf",value:function parseIf(){var t=this.parseExpr();this.expect("THEN","Expected 'then'");var r=this.parseExpr(),n=[];for(;this.match("ELIF");){var o=this.parseExpr();this.expect("THEN","Expected 'then' after elif");var a=this.parseExpr();n.push({cond:o,then:a})}var i;return this.match("ELSE")&&(i=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:t,then:r,elifs:n,else:i}}},{key:"parseStringInterpolation",value:function parseStringInterpolation(t){var r=[],n="",i=0;for(;i<t.length;)if(t[i]==="\\"&&t[i+1]==="("){n&&(r.push(n),n=""),i+=2;var o=1,a="";for(;i<t.length&&o>0;)t[i]==="("?o++:t[i]===")"&&o--,o>0&&(a+=t[i]),i++;var s=q6e(a),l=new V6e(s);r.push(l.parse())}else n+=t[i],i++;return n&&r.push(n),{type:"StringInterp",parts:r}}}]);return V6e}()}),o0t=se(function(){"use strict";r0t(),i0t()}),G6e={};St(G6e,{flagsForFuzzing:function(){return Z6e},jqCommand:function(){return H6e}});function a0t(e){switch(e){case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\u".concat(e.charCodeAt(0).toString(16).padStart(4,"0"))}}function s0t(e){var t="",r=!1,n=!1;for(var i=0;i<e.length;i++){var o=e[i];if(n){t+=o,n=!1;continue}if(o==="\\"){t+=o,n=!0;continue}if(o==='"'){t+=o,r=!r;continue}if(r&&o.charCodeAt(0)<=31){t+=a0t(o);continue}t+=o}return t}function Cq(e,t,r){return JSON.parse(s0t(e.slice(t,r)))}function Ive(e){var t=[],r=0,n=e.length;for(;r<n;){for(;r<n&&/\s/.test(e[r]);)r++;if(r>=n)break;var i=r,o=e[r];if(o==="{"||o==="["){var a=o,s=o==="{"?"}":"]",l=1,c=!1,d=!1;for(r++;r<n&&l>0;){var u=e[r];d?d=!1:u==="\\"?d=!0:u==='"'?c=!c:c||(u===a?l++:u===s&&l--),r++}if(l!==0)throw new Error("Unexpected end of JSON input at position ".concat(r," (unclosed ").concat(a,")"));t.push(u9(Cq(e,i,r)))}else if(o==='"'){var a9=!1;for(r++;r<n;){var s10=e[r];if(a9)a9=!1;else if(s10==="\\")a9=!0;else if(s10==='"'){r++;break}r++}t.push(u9(Cq(e,i,r)))}else if(o==="-"||o>="0"&&o<="9"){for(;r<n&&/[\d.eE+-]/.test(e[r]);)r++;t.push(u9(Cq(e,i,r)))}else if(e.slice(r,r+4)==="true")t.push(!0),r+=4;else if(e.slice(r,r+5)==="false")t.push(!1),r+=5;else if(e.slice(r,r+4)==="null")t.push(null),r+=4;else{var a10=e.slice(r,r+10);throw new Error("Invalid JSON at position ".concat(i,": unexpected '").concat(a10.split(/\s/)[0],"'"))}}return t}function qS(e,t,r,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e==null)return"null";if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):"null";if(typeof e=="string")return r?e:JSON.stringify(e);var a=i?" ":" ";if(Array.isArray(e))return e.length===0?"[]":t?"[".concat(e.map(function(s){return qS(s,!0,!1,n,i)}).join(","),"]"):"[\n".concat(e.map(function(s){return a.repeat(o+1)+qS(s,!1,!1,n,i,o+1)}).join(",\n"),"\n").concat(a.repeat(o),"]");if((typeof e==="undefined"?"undefined":_type_of(e))=="object"){var s=Object.keys(e);return n&&(s=s.sort()),s.length===0?"{}":t?"{".concat(s.map(function(l){return"".concat(JSON.stringify(l),":").concat(qS(e[l],!0,!1,n,i))}).join(","),"}"):"{\n".concat(s.map(function(l){var c=qS(e[l],!1,!1,n,i,o+1);return"".concat(a.repeat(o+1)).concat(JSON.stringify(l),": ").concat(c)}).join(",\n"),"\n").concat(a.repeat(o),"}")}return String(e)}var Pve,H6e,Z6e,l0t=se(function(){"use strict";kr(),yp(),jr(),Ff(),td(),f_(),jt(),o0t(),vp(),Pve={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE...]",options:["-R, --raw-input read each line as string instead of JSON","-r, --raw-output output strings without quotes","-c, --compact-output compact instead of pretty-printed output","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]},H6e={name:"jq",execute:function execute(e,t){return _async_to_generator(function(){var x,r,n,i,o,a,s,l,c,d,u,p,m,h,_$v,y,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_,g,_$v1,_$v2,y10,_10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,C,_y1,C1,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator1,_step1,_step_value,T,_y2,I,O,M,C10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator2,_step2,_step_value1,T1,_C1,I1,_iterator3,_step3,_step_value2,C11,_y3,T10,I10,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,O1,b,w,S,k,E,y11;return _ts_generator(this,function(_state){switch(_state.label){case 0:yl(t.requireDefenseContext,"jq","execution entry");r=function(v,y){return Wh(t.requireDefenseContext,"jq",v,y)};if(Vt(e))return[2,Wt(Pve)];n=!1,i=!1,o=!1,a=!1,s=!1,l=!1,c=!1,d=!1,u=!1,p=".",m=!1,h=[];for(_$v=0;_$v<e.length;_$v++){y=e[_$v];if(y==="-R"||y==="--raw-input")i=!0;else if(y==="-r"||y==="--raw-output")n=!0;else if(y==="-c"||y==="--compact-output")o=!0;else if(y==="-e"||y==="--exit-status")a=!0;else if(y==="-s"||y==="--slurp")s=!0;else if(y==="-n"||y==="--null-input")l=!0;else if(y==="-j"||y==="--join-output")c=!0;else if(!(y==="-a"||y==="--ascii")){if(y==="-S"||y==="--sort-keys")d=!0;else if(!(y==="-C"||y==="--color")&&!(y==="-M"||y==="--monochrome"))if(y==="--tab")u=!0;else if(y==="-")h.push("-");else{if(y.startsWith("--"))return[2,fr("jq",y)];if(y.startsWith("-")){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=y.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_=_step.value;if(_==="R")i=!0;else if(_==="r")n=!0;else if(_==="c")o=!0;else if(_==="e")a=!0;else if(_==="s")s=!0;else if(_==="n")l=!0;else if(_==="j")c=!0;else if(_!=="a"){if(_==="S")d=!0;else if(_!=="C"&&_!=="M")return[2,fr("jq","-".concat(_))]}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else m?h.push(y):(p=y,m=!0)}}}g=[];if(!!l)return[3,3];if(!(h.length===0||h.length===1&&h[0]==="-"))return[3,1];g.push({source:"stdin",content:Sn(t.stdin)});return[3,3];case 1:return[4,r("file read",function(){return W9(t,h,{cmdName:"jq",stopOnError:!0})})];case 2:_$v1=_state.sent();if(_$v1.exitCode!==0)return[2,{stdout:"",stderr:_$v1.stderr,exitCode:2}];g=_$v1.files.map(function(y){return{source:y.filename||"stdin",content:Sn(y.content)}});_state.label=3;case 3:try{_$v2=n0t(p),y10=[],_10={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0,env:t.env,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext};_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(l)y10=dt(null,_$v2,_10);else if(i&&s){C=g.map(function(param){var T=param.content;return T}).join("");y10=dt(C,_$v2,_10)}else if(i){;C1="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator1=g[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step1=_iterator1.next()).done);_iteratorNormalCompletion2=true){_step_value=_step1.value,T=_step_value.content;I=C1+T,O=0,M=I.indexOf("\n",O);for(;M!==-1;)(_y2=y10).push.apply(_y2,_to_consumable_array(dt(I.slice(O,M),_$v2,_10))),O=M+1,M=I.indexOf("\n",O);C1=I.slice(O)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}C1!==""&&(_y1=y10).push.apply(_y1,_to_consumable_array(dt(C1,_$v2,_10)))}else if(s){C10=[];_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator2=g[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){_step_value1=_step2.value,T1=_step_value1.content;I1=T1.trim();I1&&(_C1=C10).push.apply(_C1,_to_consumable_array(Ive(I1)))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}y10=dt(C10,_$v2,_10)}else try{for(_iterator3=g[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step3=_iterator3.next()).done);_iteratorNormalCompletion1=true){_step_value2=_step3.value,C11=_step_value2.content;T10=C11.trim();if(!T10)continue;I10=Ive(T10);_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=I10[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){O1=_step4.value;(_y3=y10).push.apply(_y3,_to_consumable_array(dt(O1,_$v2,_10)))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}b=y10.map(function(C){return qS(C,o,n,d,u)}),w=c?"":"\n",S=b.join(w),k=(x=t.limits)==null?void 0:x.maxStringLength;if(k!==void 0&&k>0&&S.length>k)throw new Qt("jq: output size limit exceeded (".concat(k," bytes)"),"string_length");E=a&&(y10.length===0||y10.every(function(C){return C==null||C===!1}))?1:0;return[2,{stdout:S?c?S:"".concat(S,"\n"):"",stderr:"",exitCode:E}]}catch(v){if(_instanceof(v,nn))throw v;if(_instanceof(v,Qt))return[2,{stdout:"",stderr:"jq: ".concat(la(v.message),"\n"),exitCode:Qt.EXIT_CODE}];y11=la(v.message);return[2,y11.includes("Unknown function")?{stdout:"",stderr:"jq: error: ".concat(y11,"\n"),exitCode:3}:{stdout:"",stderr:"jq: parse error: ".concat(y11,"\n"),exitCode:5}]}return[2]}})})()}},Z6e={name:"jq",flags:[{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0}}),K6e={};St(K6e,{base64Command:function(){return Q6e},flagsForFuzzing:function(){return J6e}});function Rve(e,t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,c,l10,err,i,o,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length===0||t.length===1&&t[0]==="-")return[2,{ok:!0,data:Uint8Array.from(e.stdin,function(s){return s.charCodeAt(0)})}];n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];s=_step.value;if(s==="-"){n.push(Uint8Array.from(e.stdin,function(l){return l.charCodeAt(0)}));return[3,6]}_state.label=3;case 3:_state.trys.push([3,5,,6]);l=e.fs.resolvePath(e.cwd,s);return[4,e.fs.readFileBuffer(l)];case 4:c=_state.sent();n.push(c);return[3,6];case 5:l10=_state.sent();return[2,{ok:!1,error:{stdout:"",stderr:"".concat(r,": ").concat(s,": No such file or directory\n"),exitCode:1}}];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:i=n.reduce(function(s,l){return s+l.length},0),o=new Uint8Array(i),a=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=n[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){s10=_step1.value;o.set(s10,a),a+=s10.length}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,{ok:!0,data:o}]}})})()}var Mve,Ove,Q6e,J6e,u0t=se(function(){"use strict";kr(),zo(),jt(),Mve={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},Ove={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}},Q6e={name:"base64",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,_String,_String1,l,d,c,a,s,l10,c10,a9;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Mve)];r=Fo("base64",e,Ove);if(!r.ok)return[2,r.error];n=r.result.flags.decode,i=r.result.flags.wrap,o=r.result.positional;_state.label=1;case 1:_state.trys.push([1,5,,6]);if(!n)return[3,3];return[4,Rve(t,o,"base64")];case 2:l=_state.sent();if(!l.ok)return[2,l.error];if((typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u"){d=Buffer.from(l.data).toString("utf8").replace(/\s/g,"");return[2,{stdout:Buffer.from(d,"base64").toString("latin1"),stderr:"",exitCode:0,stdoutEncoding:"binary"}]}c=(_String1=String).fromCharCode.apply(_String1,_to_consumable_array(l.data)).replace(/\s/g,"");return[2,{stdout:atob(c),stderr:"",exitCode:0,stdoutEncoding:"binary"}];case 3:return[4,Rve(t,o,"base64")];case 4:a=_state.sent();if(!a.ok)return[2,a.error];if((typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u"?s=Buffer.from(a.data).toString("base64"):s=btoa((_String=String).fromCharCode.apply(_String,_to_consumable_array(a.data))),i>0){l10=[];for(c10=0;c10<s.length;c10+=i)l10.push(s.slice(c10,c10+i));s=l10.join("\n")+(s.length>0?"\n":"")}return[2,{stdout:s,stderr:"",exitCode:0}];case 5:a9=_state.sent();return[2,{stdout:"",stderr:"base64: invalid input\n",exitCode:1}];case 6:return[2]}})})()}},J6e={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}}),Y6e={};St(Y6e,{diffCommand:function(){return X6e},flagsForFuzzing:function(){return eSe}});var $ve,Nve,X6e,eSe,c0t=se(function(){"use strict";kr(),zo(),jt(),$ve={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},Nve={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},X6e={name:"diff",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,_a1,c,d,_tmp,m,_tmp1,m10,u,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt($ve)];r=Fo("diff",e,Nve);if(!r.ok)return[2,r.error];n=r.result.flags.brief,i=r.result.flags.reportSame,o=r.result.flags.ignoreCase,a=r.result.positional;if(r.result.flags.unified,a.length<2)return[2,{stdout:"",stderr:"diff: missing operand\n",exitCode:2}];_a1=_sliced_to_array(a,2),c=_a1[0],d=_a1[1];_state.label=1;case 1:_state.trys.push([1,5,,6]);if(!(c==="-"))return[3,2];_tmp=Sn(t.stdin);return[3,4];case 2:return[4,t.fs.readFile(t.fs.resolvePath(t.cwd,c))];case 3:_tmp=_state.sent();_state.label=4;case 4:s=_tmp;return[3,6];case 5:m=_state.sent();return[2,{stdout:"",stderr:"diff: ".concat(c,": No such file or directory\n"),exitCode:2}];case 6:_state.trys.push([6,10,,11]);if(!(d==="-"))return[3,7];_tmp1=Sn(t.stdin);return[3,9];case 7:return[4,t.fs.readFile(t.fs.resolvePath(t.cwd,d))];case 8:_tmp1=_state.sent();_state.label=9;case 9:l=_tmp1;return[3,11];case 10:m10=_state.sent();return[2,{stdout:"",stderr:"diff: ".concat(d,": No such file or directory\n"),exitCode:2}];case 11:u=s,p=l;return[2,(o&&(u=u.toLowerCase(),p=p.toLowerCase()),u===p?i?{stdout:"Files ".concat(c," and ").concat(d," are identical\n"),stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:n?{stdout:"Files ".concat(c," and ").concat(d," differ\n"),stderr:"",exitCode:1}:{stdout:OB(c,d,s,l,"","",{context:3}),stderr:"",exitCode:1})]}})})()}},eSe={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2}}),tSe={};St(tSe,{dateCommand:function(){return rSe},flagsForFuzzing:function(){return nSe}});function d0t(e){try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch(t){return!1}}function p0t(e,t){var r=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),n=function(a){var s,l;return(l=(s=r.find(function(c){return c.type===a}))==null?void 0:s.value)!=null?l:"00"},i=Number.parseInt(n("hour"),10)%24,o=new Date("".concat(n("year"),"-").concat(n("month"),"-").concat(n("day"),"T").concat(String(i).padStart(2,"0"),":").concat(n("minute"),":").concat(n("second"),"Z"));return Number.isNaN(o.getTime())?null:o}function f0t(e,t){var r=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/);if(!r)return null;var _r1=_sliced_to_array(r,7),n=_r1[1],i=_r1[2],o=_r1[3],tmp=_r1[4],a=tmp===void 0?"00":tmp,tmp1=_r1[5],s=tmp1===void 0?"00":tmp1,tmp2=_r1[6],l=tmp2===void 0?"00":tmp2,c=new Date("".concat(n,"-").concat(i,"-").concat(o,"T").concat(a,":").concat(s,":").concat(l,"Z"));if(Number.isNaN(c.getTime()))return null;try{var d=c;for(var u=0;u<3;u++){var p=p0t(d,t);if(p===null)return null;var m=p.getTime()-c.getTime();if(m===0)return d;d=new Date(d.getTime()-m)}return d}catch(d){return null}}function m0t(e,t){if(e.startsWith("@")){var i=e.slice(1);return/^-?\d+$/.test(i)?new Date(Number.parseInt(i,10)*1e3):null}var r=e.toLowerCase().trim();if(r==="now"||r==="today")return new Date;if(r==="yesterday")return new Date(Date.now()-864e5);if(r==="tomorrow")return new Date(Date.now()+864e5);if(t&&!/Z$/i.test(e)&&!/[+-]\d{2}:?\d{2}$/.test(e)){var i10=f0t(e,t);if(i10)return i10}var n=new Date(e);return Number.isNaN(n.getTime())?null:n}var Dve,rSe,nSe,h0t=se(function(){"use strict";jt(),Gbe(),Dve={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING, not 'now'","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]},rSe={name:"date",execute:function execute(e,t){return _async_to_generator(function(){var p,r,n,i,o,a,m,h,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g,s,l,c,d,u;return _ts_generator(this,function(_state){if(Vt(e))return[2,Wt(Dve)];r=!1,n=null,i=null,o=!1,a=!1;for(m=0;m<e.length;m++){h=e[m];if(h==="-u"||h==="--utc")r=!0;else if(h==="-d"||h==="--date")n=(p=e[++m])!=null?p:"";else if(h.startsWith("--date="))n=h.slice(7);else if(h==="-I"||h==="--iso-8601")o=!0;else if(h==="-R"||h==="--rfc-email")a=!0;else if(h.startsWith("+"))i=h.slice(1);else{if(h.startsWith("--"))return[2,fr("date",h)];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(h.startsWith("-"))try{for(_iterator=h.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){g=_step.value;if(g==="u")r=!0;else if(g==="I")o=!0;else if(g==="R")a=!0;else return[2,fr("date","-".concat(g))]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}s=t.env.get("TZ");s&&!d0t(s)&&(s=void 0);l=r?"UTC":s!=null?s:"UTC",c=n!==null?m0t(n,s):new Date;if(!c)return[2,{stdout:"",stderr:"date: invalid date '".concat(n,"'\n"),exitCode:1}];d=Math.floor(c.getTime()/1e3);return[2,(i?u=jS(i,d,l):o?u=jS("%Y-%m-%dT%H:%M:%S%z",d,l):a?u=jS("%a, %d %b %Y %H:%M:%S %z",d,l):u=jS("%a %b %e %H:%M:%S %Z %Y",d,l),{stdout:"".concat(u,"\n"),stderr:"",exitCode:0})]})})()}},nSe={name:"date",flags:[{flag:"-d",type:"value",valueHint:"string"},{flag:"-u",type:"boolean"},{flag:"-I",type:"boolean"},{flag:"-R",type:"boolean"}]}});function iSe(e){var t=e.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!t)return null;var r=parseFloat(t[1]);switch(t[2]||"s"){case"s":return r*1e3;case"m":return r*60*1e3;case"h":return r*60*60*1e3;case"d":return r*24*60*60*1e3;default:return null}}var oSe=se(function(){"use strict"}),aSe={};St(aSe,{flagsForFuzzing:function(){return lSe},sleepCommand:function(){return sSe}});var Lve,Eq,sSe,lSe,g0t=se(function(){"use strict";q9(),oSe(),jt(),Lve={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:"Pause for NUMBER seconds. SUFFIX may be:\n s - seconds (default)\n m - minutes\n h - hours\n d - days\n\nNUMBER may be a decimal number.",options:[" --help display this help and exit"]},Eq=36e5,sSe={name:"sleep",execute:function execute(e,t){return _async_to_generator(function(){var n,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,_tmp,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Lve)];if(e.length===0)return[2,{stdout:"",stderr:"sleep: missing operand\n",exitCode:1}];r=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;o=iSe(i);if(o===null)return[2,{stdout:"",stderr:"sleep: invalid time interval '".concat(i,"'\n"),exitCode:1}];r+=o}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r>Eq&&(r=Eq);if(!((n=t.signal)!=null&&n.aborted))return[3,1];_tmp={stdout:"",stderr:"",exitCode:0};return[3,9];case 1:if(!t.sleep)return[3,3];return[4,t.sleep(r)];case 2:_tmp1=_state.sent();return[3,8];case 3:if(!t.signal)return[3,5];return[4,new Promise(function(i){var s;var o=function(){B9(a),i()},a=KS(function(){var l;(l=t.signal)==null||l.removeEventListener("abort",o),i()},r);(s=t.signal)==null||s.addEventListener("abort",o,{once:!0})})];case 4:_tmp2=_state.sent();return[3,7];case 5:return[4,new Promise(function(i){return KS(i,r)})];case 6:_tmp2=_state.sent();_state.label=7;case 7:_tmp1=_tmp2;_state.label=8;case 8:_tmp=(_tmp1,{stdout:"",stderr:"",exitCode:0});_state.label=9;case 9:return[2,_tmp]}})})()}},lSe={name:"sleep",flags:[],needsArgs:!0}}),uSe={};St(uSe,{flagsForFuzzing:function(){return dSe},timeoutCommand:function(){return cSe}});var Fve,cSe,dSe,x0t=se(function(){"use strict";kr(),m_(),q9(),oSe(),jt(),Fve={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:"Start COMMAND, and kill it if still running after DURATION.\n\nDURATION is a number with optional suffix:\n s - seconds (default)\n m - minutes\n h - hours\n d - days",options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]},cSe={name:"timeout",execute:function execute(e,t){return _async_to_generator(function(){var r,c,d,n,i,o,a,s,l,c10,d10,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Fve)];r=0;for(c=0;c<e.length;c++){d=e[c];if(d==="--preserve-status")r=c+1;else if(d==="--foreground")r=c+1;else if(d==="-k"||d==="--kill-after")c++,r=c+1;else if(d.startsWith("--kill-after="))r=c+1;else if(d==="-s"||d==="--signal")c++,r=c+1;else if(d.startsWith("--signal="))r=c+1;else{if(d.startsWith("--")&&d!=="--")return[2,fr("timeout",d)];if(d.startsWith("-")&&d.length>1&&d!=="--")if(d.startsWith("-k"))r=c+1;else if(d.startsWith("-s"))r=c+1;else return[2,fr("timeout",d)];else{r=c;break}}}n=e.slice(r);if(n.length===0)return[2,{stdout:"",stderr:"timeout: missing operand\n",exitCode:1}];i=n[0],o=iSe(i);if(o===null)return[2,{stdout:"",stderr:"timeout: invalid time interval '".concat(i,"'\n"),exitCode:1}];a=n.slice(1);if(a.length===0)return[2,{stdout:"",stderr:"timeout: missing operand\n",exitCode:1}];if(!t.exec)return[2,{stdout:"",stderr:"timeout: exec not available\n",exitCode:1}];s=new AbortController;_state.label=1;case 1:_state.trys.push([1,,3,4]);c10=new Promise(function(p){l=KS(function(){s.abort(),p({timedOut:!0})},o)}),d10=t.exec(i1([a[0]]),{cwd:t.cwd,signal:s.signal,stdin:t.stdin,stdinKind:"bytes",args:a.slice(1)}).then(function(p){return{timedOut:!1,result:p}});return[4,Promise.race([c10,d10])];case 2:u=_state.sent();return[2,u.timedOut?{stdout:"",stderr:"",exitCode:124}:u.result];case 3:l!==void 0&&B9(l);return[7];case 4:return[2]}})})()}},dSe={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2}}),y0t,v0t,JS,vV,K9=se(function(){"use strict";y0t=globalThis.SharedArrayBuffer,v0t=globalThis.Atomics,JS=performance.now.bind(performance),vV=globalThis.Headers}),pSe={};St(pSe,{flagsForFuzzing:function(){return mSe},timeCommand:function(){return fSe}});function _0t(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%60;return t>0?"".concat(t,":").concat(r.toString().padStart(2,"0"),":").concat(n.toFixed(2).padStart(5,"0")):"".concat(r,":").concat(n.toFixed(2).padStart(5,"0"))}var fSe,mSe,b0t=se(function(){"use strict";kr(),yp(),Vh(),m_(),K9(),fSe={name:"time",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,_$m,s,l,c,d,m,u,p,_$m1,_tmp,h,m10,h10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="%e %M",n=null,i=!1,o=!1,a=0;for(;a<e.length;){_$m=e[a];if(_$m==="-f"||_$m==="--format"){if(a++,a>=e.length)return[2,{stdout:"",stderr:"time: missing argument to '-f'\n",exitCode:1}];r=e[a],a++}else if(_$m==="-o"||_$m==="--output"){if(a++,a>=e.length)return[2,{stdout:"",stderr:"time: missing argument to '-o'\n",exitCode:1}];n=e[a],a++}else if(_$m==="-a"||_$m==="--append")i=!0,a++;else if(_$m==="-v"||_$m==="--verbose")r="Command being timed: %C\nElapsed (wall clock) time: %e seconds\nMaximum resident set size (kbytes): %M",a++;else if(_$m==="-p"||_$m==="--portability")o=!0,a++;else if(_$m==="--"){a++;break}else if(_$m.startsWith("-"))a++;else break}s=e.slice(a);if(s.length===0)return[2,{stdout:"",stderr:"",exitCode:0}];l=JS(),c=s.join(" ");_state.label=1;case 1:_state.trys.push([1,3,,4]);if(!t.exec)return[2,{stdout:"",stderr:"time: exec not available\n",exitCode:1}];return[4,t.exec(i1([s[0]]),{env:Jc(t.env),cwd:t.cwd,stdin:t.stdin,stdinKind:"bytes",signal:t.signal,args:s.slice(1)})];case 2:d=_state.sent();return[3,4];case 3:m=_state.sent();d={stdout:"",stderr:"time: ".concat(la(m.message),"\n"),exitCode:127};return[3,4];case 4:u=(JS()-l)/1e3;if(!(o?p="real ".concat(u.toFixed(2),"\nuser 0.00\nsys 0.00\n"):(p=r.replace(/%e/g,u.toFixed(2)).replace(/%E/g,_0t(u)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,c),p.endsWith("\n")||(p+="\n")),n))return[3,15];_state.label=5;case 5:_state.trys.push([5,13,,14]);_$m1=t.fs.resolvePath(t.cwd,n);_tmp=i;if(!_tmp)return[3,7];return[4,t.fs.exists(_$m1)];case 6:_tmp=_state.sent();_state.label=7;case 7:if(!_tmp)return[3,10];return[4,t.fs.readFile(_$m1)];case 8:h=_state.sent();return[4,t.fs.writeFile(_$m1,h+p)];case 9:_state.sent();return[3,12];case 10:return[4,t.fs.writeFile(_$m1,p)];case 11:_state.sent();_state.label=12;case 12:return[3,14];case 13:m10=_state.sent();h10=la(m10.message);return[2,{stdout:d.stdout,stderr:d.stderr+"time: cannot write to '".concat(n,"': ").concat(h10,"\n"),exitCode:d.exitCode}];case 14:return[3,16];case 15:d=_object_spread_props(_object_spread({},d),{stderr:d.stderr+p});_state.label=16;case 16:return[2,d]}})})()}},mSe={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0}}),hSe={};St(hSe,{flagsForFuzzing:function(){return xSe},seqCommand:function(){return gSe}});var gSe,xSe,w0t=se(function(){"use strict";gSe={name:"seq",execute:function execute(e){return _async_to_generator(function(){var t,r,n,i,h,o,a,s,l,c,d,u,p,h10,h11,_Math,h12,g,x,v,m;return _ts_generator(this,function(_state){t="\n",r=!1,n=[],i=0;for(;i<e.length;){h=e[i];if(h==="-s"&&i+1<e.length){t=e[i+1],i+=2;continue}if(h==="-w"){r=!0,i++;continue}if(h==="--"){i++;break}if(h.startsWith("-")&&h!=="-"){if(h.startsWith("-s")&&h.length>2){t=h.slice(2),i++;continue}if((h==="-ws"||h==="-sw")&&(r=!0,i+1<e.length)){t=e[i+1],i+=2;continue}}n.push(h),i++}for(;i<e.length;)n.push(e[i]),i++;if(n.length===0)return[2,{stdout:"",stderr:"seq: missing operand\n",exitCode:1}];o=1,a=1;if(n.length===1?s=parseFloat(n[0]):n.length===2?(o=parseFloat(n[0]),s=parseFloat(n[1])):(o=parseFloat(n[0]),a=parseFloat(n[1]),s=parseFloat(n[2])),Number.isNaN(o)||Number.isNaN(a)||Number.isNaN(s))return[2,{stdout:"",stderr:"seq: invalid floating point argument: '".concat(n.find(function(h){return Number.isNaN(parseFloat(h))}),"'\n"),exitCode:1}];if(a===0)return[2,{stdout:"",stderr:"seq: invalid Zero increment value: '0'\n",exitCode:1}];l=[],c=function(h){var g=String(h),x=g.indexOf(".");return x===-1?0:g.length-x-1},d=Math.max(c(o),c(a),c(s)),u=1e5,p=0;if(a>0)for(h10=o;h10<=s+1e-10&&!(p++>u);h10+=a)l.push(d>0?h10.toFixed(d):String(Math.round(h10)));else for(h11=o;h11>=s-1e-10&&!(p++>u);h11+=a)l.push(d>0?h11.toFixed(d):String(Math.round(h11)));if(r&&l.length>0){;h12=(_Math=Math).max.apply(_Math,_to_consumable_array(l.map(function(g){return g.replace("-","").length})));for(g=0;g<l.length;g++){x=l[g].startsWith("-"),v=(x?l[g].slice(1):l[g]).padStart(h12,"0");l[g]=x?"-".concat(v):v}}m=l.join(t);return[2,{stdout:m?"".concat(m,"\n"):"",stderr:"",exitCode:0}]})})()}},xSe={name:"seq",flags:[{flag:"-s",type:"value",valueHint:"string"},{flag:"-w",type:"boolean"}],needsArgs:!0}}),ySe={};St(ySe,{exprCommand:function(){return vSe},flagsForFuzzing:function(){return _Se}});function S0t(e){if(e.length===1)return e[0];var t=0;function r(){var c=n();for(;t<e.length&&e[t]==="|";){t++;var d=n();if(c!=="0"&&c!=="")return c;c=d}return c}function n(){var c=i();for(;t<e.length&&e[t]==="&";){t++;var d=i();(c==="0"||c===""||d==="0"||d==="")&&(c="0")}return c}function i(){var c=o();for(;t<e.length;){var d=e[t];if(["=","!=","<",">","<=",">="].includes(d)){t++;var u=o(),p=parseInt(c,10),m=parseInt(u,10),h=!Number.isNaN(p)&&!Number.isNaN(m),g=void 0;d==="="?g=h?p===m:c===u:d==="!="?g=h?p!==m:c!==u:d==="<"?g=h?p<m:c<u:d===">"?g=h?p>m:c>u:d==="<="?g=h?p<=m:c<=u:g=h?p>=m:c>=u,c=g?"1":"0"}else break}return c}function o(){var c=a();for(;t<e.length;){var d=e[t];if(d==="+"||d==="-"){t++;var u=a(),p=parseInt(c,10),m=parseInt(u,10);if(Number.isNaN(p)||Number.isNaN(m))throw new Error("non-integer argument");c=String(d==="+"?p+m:p-m)}else break}return c}function a(){var c=s();for(;t<e.length;){var d=e[t];if(d==="*"||d==="/"||d==="%"){t++;var u=s(),p=parseInt(c,10),m=parseInt(u,10);if(Number.isNaN(p)||Number.isNaN(m))throw new Error("non-integer argument");if((d==="/"||d==="%")&&m===0)throw new Error("division by zero");d==="*"?c=String(p*m):d==="/"?c=String(Math.trunc(p/m)):c=String(p%m)}else break}return c}function s(){var c=l();for(;t<e.length&&e[t]===":";){t++;var d=l(),u=ir("^".concat(d)).match(c);u?c=u[1]!==void 0?u[1]:String(u[0].length):c="0"}return c}function l(){if(t>=e.length)throw new Error("syntax error");var c=e[t];if(c==="match"){t++;var d=l(),u=l(),p=ir(u).match(d);return p?p[1]!==void 0?p[1]:String(p[0].length):"0"}if(c==="substr"){t++;var d10=l(),u10=parseInt(l(),10),p10=parseInt(l(),10);if(Number.isNaN(u10)||Number.isNaN(p10))throw new Error("non-integer argument");return d10.substring(u10-1,u10-1+p10)}if(c==="index"){t++;var d11=l(),u11=l();for(var p11=0;p11<d11.length;p11++)if(u11.includes(d11[p11]))return String(p11+1);return"0"}if(c==="length"){t++;var d12=l();return String(d12.length)}if(c==="("){t++;var d13=r();if(t>=e.length||e[t]!==")")throw new Error("syntax error");return t++,d13}return t++,c}return r()}var vSe,_Se,k0t=se(function(){"use strict";yp(),Ei(),vSe={name:"expr",execute:function execute(e,t){return _async_to_generator(function(){var _$r,n;return _ts_generator(this,function(_state){if(e.length===0)return[2,{stdout:"",stderr:"expr: missing operand\n",exitCode:2}];try{_$r=S0t(e),n=_$r==="0"||_$r===""?1:0;return[2,{stdout:"".concat(_$r,"\n"),stderr:"",exitCode:n}]}catch(r){return[2,{stdout:"",stderr:"expr: ".concat(la(r.message),"\n"),exitCode:2}]}return[2]})})()}},_Se={name:"expr",flags:[],needsArgs:!0}});function C0t(e){function t(m,h){return m<<h|m>>>32-h}var r=new Uint32Array([0xd76aa478,0xe8c7b756,0x242070db,0xc1bdceee,0xf57c0faf,0x4787c62a,0xa8304613,0xfd469501,0x698098d8,0x8b44f7af,0xffff5bb1,0x895cd7be,0x6b901122,0xfd987193,0xa679438e,0x49b40821,0xf61e2562,0xc040b340,0x265e5a51,0xe9b6c7aa,0xd62f105d,0x2441453,0xd8a1e681,0xe7d3fbc8,0x21e1cde6,0xc33707d6,0xf4d50d87,0x455a14ed,0xa9e3e905,0xfcefa3f8,0x676f02d9,0x8d2a4c8a,0xfffa3942,0x8771f681,0x6d9d6122,0xfde5380c,0xa4beea44,0x4bdecfa9,0xf6bb4b60,0xbebfbc70,0x289b7ec6,0xeaa127fa,0xd4ef3085,0x4881d05,0xd9d4d039,0xe6db99e5,0x1fa27cf8,0xc4ac5665,0xf4292244,0x432aff97,0xab9423a7,0xfc93a039,0x655b59c3,0x8f0ccc92,0xffeff47d,0x85845dd1,0x6fa87e4f,0xfe2ce6e0,0xa3014314,0x4e0811a1,0xf7537e82,0xbd3af235,0x2ad7d2bb,0xeb86d391]),n=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],i=e.length*8,o=(e.length%64<56?56:120)-e.length%64,a=new Uint8Array(e.length+o+8);a.set(e),a[e.length]=128;var s=new DataView(a.buffer);s.setUint32(a.length-8,i>>>0,!0),s.setUint32(a.length-4,Math.floor(i/0x100000000),!0);var l=0x67452301,c=0xefcdab89,d=0x98badcfe,u=0x10325476;for(var m=0;m<a.length;m+=64){var h=new Uint32Array(16);for(var _=0;_<16;_++)h[_]=s.getUint32(m+_*4,!0);var g=l,x=c,v=d,y=u;for(var _10=0;_10<64;_10++){var b=void 0,w=void 0;_10<16?(b=x&v|~x&y,w=_10):_10<32?(b=y&x|~y&v,w=(5*_10+1)%16):_10<48?(b=x^v^y,w=(3*_10+5)%16):(b=v^(x|~y),w=7*_10%16),b=b+g+r[_10]+h[w]>>>0,g=y,y=v,v=x,x=x+t(b,n[_10])>>>0}l=l+g>>>0,c=c+x>>>0,d=d+v>>>0,u=u+y>>>0}var p=new Uint8Array(16);return new DataView(p.buffer).setUint32(0,l,!0),new DataView(p.buffer).setUint32(4,c,!0),new DataView(p.buffer).setUint32(8,d,!0),new DataView(p.buffer).setUint32(12,u,!0),Array.from(p).map(function(m){return m.toString(16).padStart(2,"0")}).join("")}function zve(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e==="md5")return[2,C0t(t)];r=bSe.get(e);if(!r)throw new Error("Unknown algorithm: ".concat(e));return[4,globalThis.crypto.subtle.digest(r,new Uint8Array(t).buffer)];case 1:n=_state.sent();return[2,Array.from(new Uint8Array(n)).map(function(i){return i.toString(16).padStart(2,"0")}).join("")]}})})()}function _V(e,t,r){var n={name:e,summary:r,usage:"".concat(e," [OPTION]... [FILE]..."),options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:e,execute:function execute(i,o){return _async_to_generator(function(){var a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u,l,u10,p,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m,h,_tmp,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,g,x,_x1,v,y,_,b,err,err,c,d,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,u11,p10,_10,_11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(i))return[2,Wt(n)];a=!1,s=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u=_step.value;if(u==="-c"||u==="--check")a=!0;else if(!(u==="-b"||u==="-t"||u==="--binary"||u==="--text")){if(u.startsWith("-")&&u!=="-")return[2,fr(e,u)];s.push(u)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}s.length===0&&s.push("-");l=function(u){return _async_to_generator(function(){var p;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(u==="-")return[2,Uint8Array.from(o.stdin,function(p){return p.charCodeAt(0)})];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,o.fs.readFileBuffer(o.fs.resolvePath(o.cwd,u))];case 2:return[2,_state.sent()];case 3:p=_state.sent();return[2,null];case 4:return[2]}})})()};if(!a)return[3,19];u10=0,p="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,16,17,18]);_iterator1=s[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,15];m=_step1.value;if(!(m==="-"))return[3,3];_tmp=Sn(o.stdin);return[3,5];case 3:return[4,o.fs.readFile(o.fs.resolvePath(o.cwd,m)).catch(function(){return null})];case 4:_tmp=_state.sent();_state.label=5;case 5:h=_tmp;if(h===null)return[2,{stdout:"",stderr:"".concat(e,": ").concat(m,": No such file or directory\n"),exitCode:1}];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=6;case 6:_state.trys.push([6,12,13,14]);_iterator2=h.split("\n")[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,11];g=_step2.value;x=g.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!x)return[3,10];_x1=_sliced_to_array(x,3),v=_x1[1],y=_x1[2];return[4,l(y)];case 8:_=_state.sent();if(_===null){p+="".concat(y,": FAILED open or read\n"),u10++;return[3,10]}return[4,zve(t,_)];case 9:b=_state.sent()===v.toLowerCase();p+="".concat(y,": ").concat(b?"OK":"FAILED","\n"),b||u10++;_state.label=10;case 10:_iteratorNormalCompletion2=true;return[3,7];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 14:_iteratorNormalCompletion1=true;return[3,2];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 18:return[2,(u10>0&&(p+="".concat(e,": WARNING: ").concat(u10," computed checksum").concat(u10>1?"s":""," did NOT match\n")),{stdout:p,stderr:"",exitCode:u10>0?1:0})];case 19:c="",d=0;_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;_state.label=20;case 20:_state.trys.push([20,26,27,28]);_iterator3=s[Symbol.iterator]();_state.label=21;case 21:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,25];u11=_step3.value;return[4,l(u11)];case 22:p10=_state.sent();if(p10===null){c+="".concat(e,": ").concat(u11,": No such file or directory\n"),d=1;return[3,24]}_11=(_10="").concat;return[4,zve(t,p10)];case 23:c=c+_11.apply(_10,[_state.sent()," "]).concat(u11,"\n");_state.label=24;case 24:_iteratorNormalCompletion3=true;return[3,21];case 25:return[3,28];case 26:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,28];case 27:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 28:return[2,{stdout:c,stderr:"",exitCode:d}]}})})()}}}var bSe,bV=se(function(){"use strict";kr(),jt(),bSe=new Map([["sha1","SHA-1"],["sha256","SHA-256"]])}),wSe={};St(wSe,{flagsForFuzzing:function(){return kSe},md5sumCommand:function(){return SSe}});var SSe,kSe,E0t=se(function(){"use strict";bV(),SSe=_V("md5sum","md5","compute MD5 message digest"),kSe={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}}),CSe={};St(CSe,{flagsForFuzzing:function(){return TSe},sha1sumCommand:function(){return ESe}});var ESe,TSe,T0t=se(function(){"use strict";bV(),ESe=_V("sha1sum","sha1","compute SHA1 message digest"),TSe={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}}),ASe={};St(ASe,{flagsForFuzzing:function(){return PSe},sha256sumCommand:function(){return ISe}});var ISe,PSe,A0t=se(function(){"use strict";bV(),ISe=_V("sha256sum","sha256","compute SHA256 message digest"),PSe={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0}}),I0t=U9(function(e){e.read=function(t,r,n,i,o){var a,s,l=o*8-i-1,c=(1<<l)-1,d=c>>1,u=-7,p=n?o-1:0,m=n?-1:1,h=t[r+p];for(p+=m,a=h&(1<<-u)-1,h>>=-u,u+=l;u>0;a=a*256+t[r+p],p+=m,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=i;u>0;s=s*256+t[r+p],p+=m,u-=8);if(a===0)a=1-d;else{if(a===c)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,i),a=a-d}return(h?-1:1)*s*Math.pow(2,a-i)},e.write=function(t,r,n,i,o,a){var s,l,c,d=a*8-o-1,u=(1<<d)-1,p=u>>1,m=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:a-1,g=i?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,s=u):(s=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?r+=m/c:r+=m*Math.pow(2,1-p),r*c>=2&&(s++,c/=2),s+p>=u?(l=0,s=u):s+p>=1?(l=(r*c-1)*Math.pow(2,o),s=s+p):(l=r*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;t[n+h]=l&255,h+=g,l/=256,o-=8);for(s=s<<o|l,d+=o;d>0;t[n+h]=s&255,h+=g,s/=256,d-=8);t[n+h-g]|=x*128}});function P0t(){if(!(_type_of(globalThis.TextDecoder)>"u"))return XI!=null?XI:XI=new globalThis.TextDecoder("utf-8")}function R0t(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"utf-8";switch(t.toLowerCase()){case"utf-8":case"utf8":{var r=P0t();return r?r.decode(e):O0t(e)}case"utf-16le":return $0t(e);case"us-ascii":case"ascii":return N0t(e);case"latin1":case"iso-8859-1":return D0t(e);case"windows-1252":return L0t(e);default:throw new RangeError("Encoding '".concat(t,"' not supported"))}}function wV(e,t){t.length!==0&&(e.push(String.fromCharCode.apply(null,t)),t.length=0)}function Lo(e,t,r){t.push(r),t.length>=a1&&wV(e,t)}function M0t(e,t,r){if(r<=65535){Lo(e,t,r);return}r-=65536,Lo(e,t,55296+(r>>10)),Lo(e,t,56320+(r&1023))}function O0t(e){var t=[],r=[],n=0;for(e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191&&(n=3);n<e.length;){var i=e[n];if(i<=127){Lo(t,r,i),n++;continue}if(i<194||i>244){Lo(t,r,Yu),n++;continue}if(i<=223){if(n+1>=e.length){Lo(t,r,Yu),n++;continue}var c=e[n+1];if((c&192)!==128){Lo(t,r,Yu),n++;continue}var d=(i&31)<<6|c&63;Lo(t,r,d),n+=2;continue}if(i<=239){if(n+2>=e.length){Lo(t,r,Yu),n++;continue}var c10=e[n+1],d10=e[n+2];if(!((c10&192)===128&&(d10&192)===128&&!(i===224&&c10<160)&&!(i===237&&c10>=160))){Lo(t,r,Yu),n++;continue}var u=(i&15)<<12|(c10&63)<<6|d10&63;Lo(t,r,u),n+=3;continue}if(n+3>=e.length){Lo(t,r,Yu),n++;continue}var o=e[n+1],a=e[n+2],s=e[n+3];if(!((o&192)===128&&(a&192)===128&&(s&192)===128&&!(i===240&&o<144)&&!(i===244&&o>143))){Lo(t,r,Yu),n++;continue}var l=(i&7)<<18|(o&63)<<12|(a&63)<<6|s&63;M0t(t,r,l),n+=4}return wV(t,r),t.join("")}function $0t(e){var t=[],r=[],n=e.length,i=0;for(;i+1<n;){var o=e[i]|e[i+1]<<8;if(i+=2,o>=55296&&o<=56319){if(i+1<n){var a=e[i]|e[i+1]<<8;a>=56320&&a<=57343?(Lo(t,r,o),Lo(t,r,a),i+=2):Lo(t,r,Yu)}else Lo(t,r,Yu);continue}if(o>=56320&&o<=57343){Lo(t,r,Yu);continue}Lo(t,r,o)}return i<n&&Lo(t,r,Yu),wV(t,r),t.join("")}function N0t(e){var t=[];for(var r=0;r<e.length;r+=a1){var n=Math.min(e.length,r+a1),i=new Array(n-r);for(var o=r,a=0;o<n;o++,a++)i[a]=e[o]&127;t.push(String.fromCharCode.apply(null,i))}return t.join("")}function D0t(e){var t=[];for(var r=0;r<e.length;r+=a1){var n=Math.min(e.length,r+a1),i=new Array(n-r);for(var o=r,a=0;o<n;o++,a++)i[a]=e[o];t.push(String.fromCharCode.apply(null,i))}return t.join("")}function L0t(e){var t=[],r="";for(var n=0;n<e.length;n++){var i=e[n],o=i>=128&&i<=159?wW[i]:void 0;r+=o!=null?o:String.fromCharCode(i),r.length>=a1&&(t.push(r),r="")}return r&&t.push(r),t.join("")}var wW,jve,XI,a1,Yu,F0t=se(function(){wW={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},jve={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(wW)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),e=_step_value[0],t=_step_value[1];jve[t]=Number.parseInt(e,10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}a1=32*1024,Yu=65533});function xl(e){return new DataView(e.buffer,e.byteOffset)}var z0t,RSe,to,G0,ro,SW,MSe,OSe,mp,Q9=se(function(){z0t=Pbe(I0t(),1),F0t(),RSe={len:1,get:function get1(e,t){return xl(e).getUint8(t)},put:function put1(e,t,r){return xl(e).setUint8(t,r),t+1}},to={len:2,get:function get1(e,t){return xl(e).getUint16(t,!0)},put:function put1(e,t,r){return xl(e).setUint16(t,r,!0),t+2}},G0={len:2,get:function get1(e,t){return xl(e).getUint16(t)},put:function put1(e,t,r){return xl(e).setUint16(t,r),t+2}},ro={len:4,get:function get1(e,t){return xl(e).getUint32(t,!0)},put:function put1(e,t,r){return xl(e).setUint32(t,r,!0),t+4}},SW={len:4,get:function get1(e,t){return xl(e).getUint32(t)},put:function put1(e,t,r){return xl(e).setUint32(t,r),t+4}},MSe={len:4,get:function get1(e,t){return xl(e).getInt32(t)},put:function put1(e,t,r){return xl(e).setInt32(t,r),t+4}},OSe={len:8,get:function get1(e,t){return xl(e).getBigUint64(t,!0)},put:function put1(e,t,r){return xl(e).setBigUint64(t,r,!0),t+8}},mp=/*#__PURE__*/function(){"use strict";function mp1(e,t){_class_call_check(this,mp1);this.len=e,this.encoding=t}_create_class(mp1,[{key:"get",value:function get1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var r=e.subarray(t,t+this.len);return R0t(r,this.encoding)}}]);return mp1}()}),Uve,yo,$Se,J9=se(function(){Uve="End-Of-Stream",yo=/*#__PURE__*/function(Error1){"use strict";_inherits(yo1,Error1);function yo1(){_class_call_check(this,yo1);var _this;_this=_call_super(this,yo1,[Uve]),_this.name="EndOfStreamError";return _this}return yo1}(_wrap_native_super(Error)),$Se=/*#__PURE__*/function(Error1){"use strict";_inherits($Se1,Error1);function $Se1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"The operation was aborted";_class_call_check(this,$Se1);var _this;_this=_call_super(this,$Se1,[e]),_this.name="AbortError";return _this}return $Se1}(_wrap_native_super(Error))}),j0t=se(function(){}),SV,kV=se(function(){J9(),SV=/*#__PURE__*/function(){"use strict";function SV1(){_class_call_check(this,SV1);this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}_create_class(SV1,[{key:"peek",value:function peek(_01){return _async_to_generator(function(e){var t,r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:!1;return[4,this.read(e,t)];case 1:r=_state.sent();return[2,(this.peekQueue.push(e.subarray(0,r)),r)]}})}).apply(this,arguments)}},{key:"read",value:function read(_01){return _async_to_generator(function(e){var t,r,_tmp;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:!1;if(e.length===0)return[2,0];r=this.readFromPeekBuffer(e);_tmp=this.endOfStream;if(_tmp)return[3,2];return[4,this.readRemainderFromStream(e.subarray(r),t)];case 1:_tmp=r=r+_state.sent();_state.label=2;case 2:if(_tmp,r===0&&!t)throw new yo;return[2,r]}})}).apply(this,arguments)}},{key:"readFromPeekBuffer",value:function readFromPeekBuffer(e){var t=e.length,r=0;for(;this.peekQueue.length>0&&t>0;){var n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");var i=Math.min(n.length,t);e.set(n.subarray(0,i),r),r+=i,t-=i,i<n.length&&this.peekQueue.push(n.subarray(i))}return r}},{key:"readRemainderFromStream",value:function readRemainderFromStream(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=0;_state.label=1;case 1:if(!(r<e.length&&!this.endOfStream))return[3,4];if(this.interrupted)throw new $Se;return[4,this.readFromStream(e.subarray(r),t)];case 2:n=_state.sent();if(n===0)return[3,4];r+=n;_state.label=3;case 3:return[3,1];case 4:if(!t&&r<e.length)throw new yo;return[2,r]}})}).call(this)}}]);return SV1}()}),U0t=se(function(){J9(),j0t(),kV()}),NSe,B0t=se(function(){kV(),NSe=/*#__PURE__*/function(SV1){"use strict";_inherits(NSe1,SV1);function NSe1(e){_class_call_check(this,NSe1);var _this;_this=_call_super(this,NSe1),_this.reader=e;return _this}_create_class(NSe1,[{key:"abort",value:function abort(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.close()]})}).call(this)}},{key:"close",value:function close(){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.reader.releaseLock();return[2]})}).call(this)}}]);return NSe1}(SV)}),DSe,LSe=se(function(){B0t(),DSe=/*#__PURE__*/function(NSe1){"use strict";_inherits(DSe1,NSe1);function DSe1(){_class_call_check(this,DSe1);return _call_super(this,DSe1,arguments)}_create_class(DSe1,[{key:"readFromStream",value:function readFromStream(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length===0)return[2,0];return[4,this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length})];case 1:r=_state.sent();return[2,(r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value),r.value.length):0)]}})}).call(this)}}]);return DSe1}(NSe)}),kW,FSe=se(function(){J9(),kV(),kW=/*#__PURE__*/function(SV1){"use strict";_inherits(kW1,SV1);function kW1(e){_class_call_check(this,kW1);var _this;_this=_call_super(this,kW1),_this.reader=e,_this.buffer=null;return _this}_create_class(kW1,[{key:"writeChunk",value:function writeChunk(e,t){var r=Math.min(t.length,e.length);return e.set(t.subarray(0,r)),r<t.length?this.buffer=t.subarray(r):this.buffer=null,r}},{key:"readFromStream",value:function readFromStream(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.length===0)return[2,0];r=0;this.buffer&&(r+=this.writeChunk(e,this.buffer));_state.label=1;case 1:if(!(r<e.length&&!this.endOfStream))return[3,4];return[4,this.reader.read()];case 2:n=_state.sent();if(n.done){this.endOfStream=!0;return[3,4]}n.value&&(r+=this.writeChunk(e.subarray(r),n.value));_state.label=3;case 3:return[3,1];case 4:if(!t&&r===0&&this.endOfStream)throw new yo;return[2,r]}})}).call(this)}},{key:"abort",value:function abort(){return this.interrupted=!0,this.reader.cancel()}},{key:"close",value:function close(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.abort()];case 1:_state.sent(),this.reader.releaseLock();return[2]}})}).call(this)}}]);return kW1}(SV)});function q0t(e){try{var _$t=e.getReader({mode:"byob"});return _instanceof(_$t,ReadableStreamDefaultReader)?new kW(_$t):new DSe(_$t)}catch(t){if(_instanceof(t,TypeError))return new kW(e.getReader());throw t}}var W0t=se(function(){LSe(),FSe()}),l_=se(function(){J9(),U0t(),LSe(),FSe(),W0t()}),Y9,X9=se(function(){l_(),Y9=/*#__PURE__*/function(){"use strict";function Y91(e){var _this=this;_class_call_check(this,Y91);this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e==null?void 0:e.onClose,e!=null&&e.abortSignal&&e.abortSignal.addEventListener("abort",function(){_this.abort()})}_create_class(Y91,[{key:"readToken",value:function readToken(_01){return _async_to_generator(function(e){var t,r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:this.position;r=new Uint8Array(e.len);return[4,this.readBuffer(r,{position:t})];case 1:if(_state.sent()<e.len)throw new yo;return[2,e.get(r,0)]}})}).apply(this,arguments)}},{key:"peekToken",value:function peekToken(_01){return _async_to_generator(function(e){var t,r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:this.position;r=new Uint8Array(e.len);return[4,this.peekBuffer(r,{position:t})];case 1:if(_state.sent()<e.len)throw new yo;return[2,e.get(r,0)]}})}).apply(this,arguments)}},{key:"readNumber",value:function readNumber(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readBuffer(this.numBuffer,{length:e.len})];case 1:if(_state.sent()<e.len)throw new yo;return[2,e.get(this.numBuffer,0)]}})}).call(this)}},{key:"peekNumber",value:function peekNumber(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.peekBuffer(this.numBuffer,{length:e.len})];case 1:if(_state.sent()<e.len)throw new yo;return[2,e.get(this.numBuffer,0)]}})}).call(this)}},{key:"ignore",value:function ignore(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){if(e<0)throw new RangeError("ignore length must be ≥ 0 bytes");if(this.fileInfo.size!==void 0){t=this.fileInfo.size-this.position;if(e>t)return[2,(this.position+=t,t)]}return[2,(this.position+=e,e)]})}).call(this)}},{key:"close",value:function close(){return _async_to_generator(function(){var e;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.abort()];case 1:_state.sent();return[4,(e=this.onClose)==null?void 0:e.call(this)];case 2:_state.sent();return[2]}})}).call(this)}},{key:"normalizeOptions",value:function normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return _object_spread({mayBeLess:!1,offset:0,length:e.length,position:this.position},t)}},{key:"abort",value:function abort(){return Promise.resolve()}}]);return Y91}()}),Bve,zSe,V0t=se(function(){X9(),l_(),Bve=256e3,zSe=/*#__PURE__*/function(Y91){"use strict";_inherits(zSe1,Y91);function zSe1(e,t){_class_call_check(this,zSe1);var _this;var r;_this=_call_super(this,zSe1,[t]),_this.streamReader=e,_this.fileInfo=(r=t==null?void 0:t.fileInfo)!=null?r:{};return _this}_create_class(zSe1,[{key:"readBuffer",value:function readBuffer(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.normalizeOptions(e,t),n=r.position-this.position;if(!(n>0))return[3,2];return[4,this.ignore(n)];case 1:return[2,(_state.sent(),this.readBuffer(e,t))];case 2:if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return[2,0];return[4,this.streamReader.read(e.subarray(0,r.length),r.mayBeLess)];case 3:i=_state.sent();if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new yo;return[2,i]}})}).call(this)}},{key:"peekBuffer",value:function peekBuffer(e,t){return _async_to_generator(function(){var r,n,_$i,o,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.normalizeOptions(e,t),n=0;if(!r.position)return[3,3];_$i=r.position-this.position;if(!(_$i>0))return[3,2];o=new Uint8Array(r.length+_$i);return[4,this.peekBuffer(o,{mayBeLess:r.mayBeLess})];case 1:return[2,(n=_state.sent(),e.set(o.subarray(_$i)),n-_$i)];case 2:if(_$i<0)throw new Error("Cannot peek from a negative offset in a stream");_state.label=3;case 3:if(!(r.length>0))return[3,8];_state.label=4;case 4:_state.trys.push([4,6,,7]);return[4,this.streamReader.peek(e.subarray(0,r.length),r.mayBeLess)];case 5:n=_state.sent();return[3,7];case 6:i=_state.sent();if(t!=null&&t.mayBeLess&&_instanceof(i,yo))return[2,0];throw i;case 7:if(!r.mayBeLess&&n<r.length)throw new yo;_state.label=8;case 8:return[2,n]}})}).call(this)}},{key:"ignore",value:function ignore(e){return _async_to_generator(function(){var t,r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e<0)throw new RangeError("ignore length must be ≥ 0 bytes");t=Math.min(Bve,e),r=new Uint8Array(t),n=0;_state.label=1;case 1:if(!(n<e))return[3,4];i=e-n;return[4,this.readBuffer(r,{length:Math.min(t,i)})];case 2:o=_state.sent();if(o<0)return[2,o];n+=o;_state.label=3;case 3:return[3,1];case 4:return[2,n]}})}).call(this)}},{key:"abort",value:function abort(){return this.streamReader.abort()}},{key:"close",value:function close(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.streamReader.close()]})}).call(this)}},{key:"supportsRandomAccess",value:function supportsRandomAccess(){return!1}}]);return zSe1}(Y9)}),jSe,G0t=se(function(){l_(),X9(),jSe=/*#__PURE__*/function(Y91){"use strict";_inherits(jSe1,Y91);function jSe1(e,t){_class_call_check(this,jSe1);var _this;var r;_this=_call_super(this,jSe1,[t]),_this.uint8Array=e,_this.fileInfo=_object_spread_props(_object_spread({},(r=t==null?void 0:t.fileInfo)!=null?r:{}),{size:e.length});return _this}_create_class(jSe1,[{key:"readBuffer",value:function readBuffer(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:t!=null&&t.position&&(this.position=t.position);return[4,this.peekBuffer(e,t)];case 1:r=_state.sent();return[2,(this.position+=r,r)]}})}).call(this)}},{key:"peekBuffer",value:function peekBuffer(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new yo;return[2,(e.set(this.uint8Array.subarray(r.position,r.position+n)),n)]})}).call(this)}},{key:"close",value:function close(){return _get(_get_prototype_of(jSe1.prototype),"close",this).call(this)}},{key:"supportsRandomAccess",value:function supportsRandomAccess(){return!0}},{key:"setPosition",value:function setPosition(e){this.position=e}}]);return jSe1}(Y9)}),USe,H0t=se(function(){l_(),X9(),USe=/*#__PURE__*/function(Y91){"use strict";_inherits(USe1,Y91);function USe1(e,t){_class_call_check(this,USe1);var _this;var r;_this=_call_super(this,USe1,[t]),_this.blob=e,_this.fileInfo=_object_spread_props(_object_spread({},(r=t==null?void 0:t.fileInfo)!=null?r:{}),{size:e.size,mimeType:e.type});return _this}_create_class(USe1,[{key:"readBuffer",value:function readBuffer(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:t!=null&&t.position&&(this.position=t.position);return[4,this.peekBuffer(e,t)];case 1:r=_state.sent();return[2,(this.position+=r,r)]}})}).call(this)}},{key:"peekBuffer",value:function peekBuffer(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.normalizeOptions(e,t),n=Math.min(this.blob.size-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new yo;return[4,this.blob.slice(r.position,r.position+n).arrayBuffer()];case 1:i=_state.sent();return[2,(e.set(new Uint8Array(i)),n)]}})}).call(this)}},{key:"close",value:function close(){return _get(_get_prototype_of(USe1.prototype),"close",this).call(this)}},{key:"supportsRandomAccess",value:function supportsRandomAccess(){return!0}},{key:"setPosition",value:function setPosition(e){this.position=e}}]);return USe1}(Y9)});function Z0t(e,t){var r=q0t(e),n=t!=null?t:{},i=n.onClose;return n.onClose=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.close()];case 1:if(_state.sent(),i)return[2,i()];return[2]}})})()},new zSe(r,n)}function K0t(e,t){return new jSe(e,t)}function Q0t(e,t){return new USe(e,t)}var J0t=se(function(){l_(),V0t(),G0t(),H0t(),l_(),X9()}),Y0t=U9(function(e,t){var l=function l(p){if(p=String(p),!(p.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(m){var h=parseFloat(m[1]),g=(m[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*a;case"days":case"day":case"d":return h*o;case"hours":case"hour":case"hrs":case"hr":case"h":return h*i;case"minutes":case"minute":case"mins":case"min":case"m":return h*n;case"seconds":case"second":case"secs":case"sec":case"s":return h*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}};var c=function c(p){var m=Math.abs(p);return m>=o?Math.round(p/o)+"d":m>=i?Math.round(p/i)+"h":m>=n?Math.round(p/n)+"m":m>=r?Math.round(p/r)+"s":p+"ms"};var d=function d(p){var m=Math.abs(p);return m>=o?u(p,m,o,"day"):m>=i?u(p,m,i,"hour"):m>=n?u(p,m,n,"minute"):m>=r?u(p,m,r,"second"):p+" ms"};var u=function u(p,m,h,g){var x=m>=h*1.5;return Math.round(p/h)+" "+g+(x?"s":"")};var r=1e3,n=r*60,i=n*60,o=i*24,a=o*7,s=o*365.25;t.exports=function(p,m){m=m||{};var h=typeof p==="undefined"?"undefined":_type_of(p);if(h==="string"&&p.length>0)return l(p);if(h==="number"&&isFinite(p))return m.long?d(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))}}),X0t=U9(function(e,t){var r=function r(n){o.debug=o,o.default=o,o.coerce=u,o.disable=c,o.enable=s,o.enabled=d,o.humanize=Y0t(),o.destroy=p,Object.keys(n).forEach(function(m){o[m]=n[m]}),o.names=[],o.skips=[],o.formatters={};function i(m){var h=0;for(var g=0;g<m.length;g++)h=(h<<5)-h+m.charCodeAt(g),h|=0;return o.colors[Math.abs(h)%o.colors.length]}o.selectColor=i;function o(m){var h,g=null,x,v;function y(){for(var _len=arguments.length,_=new Array(_len),_key=0;_key<_len;_key++){_[_key]=arguments[_key]}if(!y.enabled)return;var b=y,w=Number(new Date),S=w-(h||w);b.diff=S,b.prev=h,b.curr=w,h=w,_[0]=o.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");var k=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,function(E,C){if(E==="%%")return"%";k++;var T=o.formatters[C];if(typeof T=="function"){var I=_[k];E=T.call(b,I),_.splice(k,1),k--}return E}),o.formatArgs.call(b,_),(b.log||o.log).apply(b,_)}return y.namespace=m,y.useColors=o.useColors(),y.color=o.selectColor(m),y.extend=a,y.destroy=o.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:function(){return g!==null?g:(x!==o.namespaces&&(x=o.namespaces,v=o.enabled(m)),v)},set:function(_){g=_}}),typeof o.init=="function"&&o.init(y),y}function a(m,h){var g=o(this.namespace+((typeof h==="undefined"?"undefined":_type_of(h))>"u"?":":h)+m);return g.log=this.log,g}function s(m){o.save(m),o.namespaces=m,o.names=[],o.skips=[];var h=(typeof m=="string"?m:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;g[0]==="-"?o.skips.push(g.slice(1)):o.names.push(g)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function l(m,h){var g=0,x=0,v=-1,y=0;for(;g<m.length;)if(x<h.length&&(h[x]===m[g]||h[x]==="*"))h[x]==="*"?(v=x,y=g,x++):(g++,x++);else if(v!==-1)x=v+1,y++,g=y;else return!1;for(;x<h.length&&h[x]==="*";)x++;return x===h.length}function c(){var m=_to_consumable_array(o.names).concat(_to_consumable_array(o.skips.map(function(h){return"-"+h}))).join(",");return o.enable(""),m}function d(m){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o.skips[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;if(l(m,h))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o.names[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var h10=_step1.value;if(l(m,h10))return!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return!1}function u(m){return _instanceof(m,Error)?m.stack||m.message:m}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o};t.exports=r}),e1t=U9(function(e,t){var r=function r(){if((typeof window==="undefined"?"undefined":_type_of(window))<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if((typeof navigator==="undefined"?"undefined":_type_of(navigator))<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;var l;return(typeof document==="undefined"?"undefined":_type_of(document))<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||(typeof window==="undefined"?"undefined":_type_of(window))<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||(typeof navigator==="undefined"?"undefined":_type_of(navigator))<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||(typeof navigator==="undefined"?"undefined":_type_of(navigator))<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)};var n=function n(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;var c="color: "+this.color;l.splice(1,0,c,"color: inherit");var d=0,u=0;l[0].replace(/%[a-zA-Z%]/g,function(p){p!=="%%"&&(d++,p==="%c"&&(u=d))}),l.splice(u,0,c)};var i=function i(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch(c){}};var o=function o(){var l;try{l=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(c){}return!l&&(typeof process==="undefined"?"undefined":_type_of(process))<"u"&&"env"in process&&(l=process.env.DEBUG),l};var a=function a(){try{return localStorage}catch(l){}};e.formatArgs=n,e.save=i,e.load=o,e.useColors=r,e.storage=a(),e.destroy=function(){var l=!1;return function(){l||(l=!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`."))}}(),e.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"];e.log=console.debug||console.log||function(){};t.exports=X0t()(e);var _t_exports=t.exports,s=_t_exports.formatters;s.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}),H0,CW,BSe,qSe,WSe,t1t=se(function(){Q9(),H0={LocalFileHeader:0x4034b50,DataDescriptor:0x8074b50,CentralFileHeader:0x2014b50,EndOfCentralDirectory:0x6054b50},CW={get:function get1(e){return{signature:ro.get(e,0),compressedSize:ro.get(e,8),uncompressedSize:ro.get(e,12)}},len:16},BSe={get:function get1(e){var t=to.get(e,6);return{signature:ro.get(e,0),minVersion:to.get(e,4),dataDescriptor:!!(t&8),compressedMethod:to.get(e,8),compressedSize:ro.get(e,18),uncompressedSize:ro.get(e,22),filenameLength:to.get(e,26),extraFieldLength:to.get(e,28),filename:null}},len:30},qSe={get:function get1(e){return{signature:ro.get(e,0),nrOfThisDisk:to.get(e,4),nrOfThisDiskWithTheStart:to.get(e,6),nrOfEntriesOnThisDisk:to.get(e,8),nrOfEntriesOfSize:to.get(e,10),sizeOfCd:ro.get(e,12),offsetOfStartOfCd:ro.get(e,16),zipFileCommentLength:to.get(e,20)}},len:22},WSe={get:function get1(e){var t=to.get(e,8);return{signature:ro.get(e,0),minVersion:to.get(e,6),dataDescriptor:!!(t&8),compressedMethod:to.get(e,10),compressedSize:ro.get(e,20),uncompressedSize:ro.get(e,24),filenameLength:to.get(e,28),extraFieldLength:to.get(e,30),fileCommentLength:to.get(e,32),relativeOffsetOfLocalHeader:ro.get(e,42),filename:null}},len:46}});function qve(e){var t=new Uint8Array(ro.len);return ro.put(t,0,e),t}function r1t(e,t){var r=e.length,n=t.length;if(n>r)return-1;for(var i=0;i<=r-n;i++){var o=!0;for(var a=0;a<n;a++)if(e[i+a]!==t[a]){o=!1;break}if(o)return i}return-1}function n1t(e){var t=e.reduce(function(i,o){return i+o.length},0),r=new Uint8Array(t),n=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.set(i,n),n+=i.length}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}var Wve,Hc,e9,Vve,NS,y9,i1t=se(function(){Q9(),Wve=Pbe(e1t(),1),t1t(),Hc=(0,Wve.default)("tokenizer:inflate"),e9=256*1024,Vve=qve(H0.DataDescriptor),NS=qve(H0.EndOfCentralDirectory),y9=/*#__PURE__*/function(){"use strict";function VSe(t){_class_call_check(this,VSe);this.tokenizer=t,this.syncBuffer=new Uint8Array(e9)}_create_class(VSe,[{key:"isZip",value:function isZip(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.peekSignature()];case 1:return[2,_state.sent()===H0.LocalFileHeader]}})}).call(this)}},{key:"peekSignature",value:function peekSignature(){return this.tokenizer.peekToken(ro)}},{key:"findEndOfCentralDirectoryLocator",value:function findEndOfCentralDirectoryLocator(){return _async_to_generator(function(){var t,r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=this.tokenizer,r=Math.min(16*1024,t.fileInfo.size),n=this.syncBuffer.subarray(0,r);return[4,this.tokenizer.readBuffer(n,{position:t.fileInfo.size-r})];case 1:_state.sent();for(i=n.length-4;i>=0;i--)if(n[i]===NS[0]&&n[i+1]===NS[1]&&n[i+2]===NS[2]&&n[i+3]===NS[3])return[2,t.fileInfo.size-r+i];return[2,-1]}})}).call(this)}},{key:"readCentralDirectory",value:function readCentralDirectory(){return _async_to_generator(function(){var t,r,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.tokenizer.supportsRandomAccess()){Hc("Cannot reading central-directory without random-read support");return[2]}Hc("Reading central-directory...");t=this.tokenizer.position;return[4,this.findEndOfCentralDirectoryLocator()];case 1:r=_state.sent();if(!(r>0))return[3,10];Hc("Central-directory 32-bit signature found");return[4,this.tokenizer.readToken(qSe,r)];case 2:n=_state.sent(),i=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);o=0;_state.label=3;case 3:if(!(o<n.nrOfEntriesOfSize))return[3,9];return[4,this.tokenizer.readToken(WSe)];case 4:a=_state.sent();if(a.signature!==H0.CentralFileHeader)throw new Error("Expected Central-File-Header signature");return[4,this.tokenizer.readToken(new mp(a.filenameLength,"utf-8"))];case 5:a.filename=_state.sent();return[4,this.tokenizer.ignore(a.extraFieldLength)];case 6:_state.sent();return[4,this.tokenizer.ignore(a.fileCommentLength)];case 7:_state.sent(),i.push(a),Hc("Add central-directory file-entry: n=".concat(o+1,"/").concat(i.length,": filename=").concat(i[o].filename));_state.label=8;case 8:++o;return[3,3];case 9:return[2,(this.tokenizer.setPosition(t),i)];case 10:this.tokenizer.setPosition(t);return[2]}})}).call(this)}},{key:"unzip",value:function unzip(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,_tmp,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readCentralDirectory()];case 1:r=_state.sent();if(r)return[2,this.iterateOverCentralDirectory(r,t)];n=!1;_state.label=2;case 2:return[4,this.readLocalFileHeader()];case 3:i=_state.sent();if(!i)return[3,24];o=t(i);n=!!o.stop;a=void 0;return[4,this.tokenizer.ignore(i.extraFieldLength)];case 4:if(!(_state.sent(),i.dataDescriptor&&i.compressedSize===0))return[3,14];s=[],l=e9;Hc("Compressed-file-size unknown, scanning for next data-descriptor-signature....");c=-1;_state.label=5;case 5:if(!(c<0&&l===e9))return[3,11];return[4,this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0})];case 6:l=_state.sent(),c=r1t(this.syncBuffer.subarray(0,l),Vve);d=c>=0?c:l;if(!o.handler)return[3,8];u=new Uint8Array(d);return[4,this.tokenizer.readBuffer(u)];case 7:_state.sent(),s.push(u);return[3,10];case 8:return[4,this.tokenizer.ignore(d)];case 9:_state.sent();_state.label=10;case 10:return[3,5];case 11:Hc("Found data-descriptor-signature at pos=".concat(this.tokenizer.position));_tmp=o.handler;if(!_tmp)return[3,13];return[4,this.inflate(i,n1t(s),o.handler)];case 12:_tmp=_state.sent();_state.label=13;case 13:_tmp;return[3,20];case 14:if(!o.handler)return[3,17];Hc("Reading compressed-file-data: ".concat(i.compressedSize," bytes")),a=new Uint8Array(i.compressedSize);return[4,this.tokenizer.readBuffer(a)];case 15:_state.sent();return[4,this.inflate(i,a,o.handler)];case 16:_tmp1=_state.sent();return[3,19];case 17:Hc("Ignoring compressed-file-data: ".concat(i.compressedSize," bytes"));return[4,this.tokenizer.ignore(i.compressedSize)];case 18:_tmp1=_state.sent();_state.label=19;case 19:_tmp1;_state.label=20;case 20:Hc("Reading data-descriptor at pos=".concat(this.tokenizer.position));_tmp2=i.dataDescriptor;if(!_tmp2)return[3,22];return[4,this.tokenizer.readToken(CW)];case 21:_tmp2=_state.sent().signature!==0x8074b50;_state.label=22;case 22:if(_tmp2)throw new Error("Expected data-descriptor-signature at position ".concat(this.tokenizer.position-CW.len));_state.label=23;case 23:if(!n)return[3,2];_state.label=24;case 24:return[2]}})}).call(this)}},{key:"iterateOverCentralDirectory",value:function iterateOverCentralDirectory(t,r){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,i,o,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];n=_step.value;i=r(n);if(!i.handler)return[3,7];this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);return[4,this.readLocalFileHeader()];case 3:o=_state.sent();if(!o)return[3,7];return[4,this.tokenizer.ignore(o.extraFieldLength)];case 4:_state.sent();a=new Uint8Array(n.compressedSize);return[4,this.tokenizer.readBuffer(a)];case 5:_state.sent();return[4,this.inflate(o,a,i.handler)];case 6:_state.sent();_state.label=7;case 7:if(i.stop)return[3,9];_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2]}})}).call(this)}},{key:"inflate",value:function inflate(t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.compressedMethod===0)return[2,n(r)];if(t.compressedMethod!==8)throw new Error("Unsupported ZIP compression method: ".concat(t.compressedMethod));Hc("Decompress filename=".concat(t.filename,", compressed-size=").concat(r.length));return[4,VSe.decompressDeflateRaw(r)];case 1:i=_state.sent();return[2,n(i)]}})})()}},{key:"readLocalFileHeader",value:function readLocalFileHeader(){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.tokenizer.peekToken(ro)];case 1:t=_state.sent();if(!(t===H0.LocalFileHeader))return[3,4];return[4,this.tokenizer.readToken(BSe)];case 2:r=_state.sent();return[4,this.tokenizer.readToken(new mp(r.filenameLength,"utf-8"))];case 3:return[2,(r.filename=_state.sent(),r)];case 4:if(t===H0.CentralFileHeader)return[2,!1];throw t===0xe011cfd0?new Error("Encrypted ZIP"):new Error("Unexpected signature")}})}).call(this)}}],[{key:"decompressDeflateRaw",value:function decompressDeflateRaw(t){return _async_to_generator(function(){var r,n,i,_$o,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new ReadableStream({start:function start(o){o.enqueue(t),o.close()}}),n=new DecompressionStream("deflate-raw"),i=r.pipeThrough(n);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,new Response(i).arrayBuffer()];case 2:_$o=_state.sent();return[2,new Uint8Array(_$o)];case 3:o=_state.sent();a=_instanceof(o,Error)?"Failed to deflate ZIP entry: ".concat(o.message):"Unknown decompression error in ZIP entry";throw new TypeError(a);case 4:return[2]}})})()}}]);return VSe}()}),GSe,o1t=se(function(){GSe=/*#__PURE__*/function(){"use strict";function GSe1(e){_class_call_check(this,GSe1);this.tokenizer=e}_create_class(GSe1,[{key:"inflate",value:function inflate(){var e=this.tokenizer;return new ReadableStream({pull:function pull(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Uint8Array(1024);return[4,e.readBuffer(r,{mayBeLess:!0})];case 1:n=_state.sent();if(n===0){t.close();return[2]}t.enqueue(r.subarray(0,n));return[2]}})})()}}).pipeThrough(new DecompressionStream("gzip"))}}]);return GSe1}()}),a1t=se(function(){i1t(),o1t()});function Gve(e){var t=e.byteLength;if(t===6)return e.getUint16(0)*Math.pow(2,32)+e.getUint32(2);if(t===5)return e.getUint8(0)*Math.pow(2,32)+e.getUint32(1);if(t===4)return e.getUint32(0);if(t===3)return e.getUint8(0)*Math.pow(2,16)+e.getUint16(1);if(t===2)return e.getUint16(0);if(t===1)return e.getUint8(0)}var s1t,l1t,u1t,c1t=se(function(){s1t={utf8:new globalThis.TextDecoder("utf8")},l1t=new globalThis.TextEncoder,u1t=Array.from({length:256},function(e,t){return t.toString(16).padStart(2,"0")})});function d1t(e,t){if(t==="utf-16le"){var r=[];for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);r.push(i&255,i>>8&255)}return r}if(t==="utf-16be"){var r10=[];for(var n10=0;n10<e.length;n10++){var i10=e.charCodeAt(n10);r10.push(i10>>8&255,i10&255)}return r10}return _to_consumable_array(e).map(function(r){return r.charCodeAt(0)})}function p1t(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var r=Number.parseInt(new mp(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;var n=256;for(var i=t;i<t+148;i++)n+=e[i];for(var i10=t+156;i10<t+512;i10++)n+=e[i10];return r===n}var HSe,f1t=se(function(){Q9(),HSe={get:function(e,t){return e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21},len:4}}),ZSe,KSe,m1t=se(function(){ZSe=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],KSe=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function h1t(e){var i;var t=e==null?void 0:e.streamReader;if(((i=t==null?void 0:t.constructor)==null?void 0:i.name)!=="WebStreamByobReader")return e;var r=t.reader,n=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.cancel()];case 1:_state.sent(),r.releaseLock();return[2]}})})()};return t.close=n,t.abort=function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:t.interrupted=!0;return[4,n()];case 1:_state.sent();return[2]}})})()},e}function CV(e,t,r){if(!Number.isFinite(e)||e<0||e>t)throw new zh("".concat(r," has invalid size ").concat(e," (maximum ").concat(t," bytes)"));return e}function Fh(_01,_11){return _async_to_generator(function(e,t){var _ref,tmp,r,tmp1,n,i;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{},tmp=_ref.maximumLength,r=tmp===void 0?ou:tmp,tmp1=_ref.reason,n=tmp1===void 0?"skip":tmp1;i=CV(t,r,n);return[4,e.ignore(i)];case 1:_state.sent();return[2]}})}).apply(this,arguments)}function Tq(_01,_11,_21){return _async_to_generator(function(e,t,r){var _ref,tmp,n,tmp1,i,s,o,a;var _arguments=arguments;return _ts_generator(this,function(_state){_ref=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:{},tmp=_ref.maximumLength,n=tmp===void 0?t.length:tmp,tmp1=_ref.reason,i=tmp1===void 0?"read":tmp1;o=(s=r==null?void 0:r.length)!=null?s:t.length,a=CV(o,n,i);return[2,e.readBuffer(t,_object_spread_props(_object_spread({},r),{length:a}))]})}).apply(this,arguments)}function g1t(_01){return _async_to_generator(function(e){var _ref,tmp,t,r,n,i,_ref1,s,l,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s10;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{},tmp=_ref.maximumLength,t=tmp===void 0?Xc:tmp;r=new ReadableStream({start:function start(s){s.enqueue(e),s.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),n=[],i=0;_state.label=1;case 1:_state.trys.push([1,,8,9]);_state.label=2;case 2:return[4,r.read()];case 3:_ref1=_state.sent(),s=_ref1.done,l=_ref1.value;if(s)return[3,7];if(!(i+=l.length,i>t))return[3,5];return[4,r.cancel()];case 4:throw _state.sent(),new Error("ZIP entry decompressed data exceeds ".concat(t," bytes"));case 5:n.push(l);_state.label=6;case 6:return[3,2];case 7:return[3,9];case 8:r.releaseLock();return[7];case 9:o=new Uint8Array(i),a=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=n[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s10=_step.value;o.set(s10,a),a+=s10.length}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,o]}})}).apply(this,arguments)}function x1t(e,t){if(e.length<GS)return-1;var r=e.length-GS;for(var n=0;n<=r;n++)if(ro.get(e,n)===EW&&ro.get(e,n+8)===t+n)return n;return-1}function y1t(e){return(e.codePointAt(0)&32)!==0}function v1t(e,t){var r=new Uint8Array(t),n=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.set(i,n),n+=i.length}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function _1t(_01){return _async_to_generator(function(e){var _ref,t,tmp,r,n,i,o,a,s,l,c,d,u;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{},t=_ref.shouldBuffer,tmp=_ref.maximumLength,r=tmp===void 0?Xc:tmp;n=e.syncBuffer,i=n.length,o=[],a=0;_state.label=1;case 1:return[4,e.tokenizer.peekBuffer(n,{mayBeLess:!0})];case 2:s=_state.sent(),l=x1t(n.subarray(0,s),a),c=l>=0?0:s===i?Math.min(t5e,s-1):0,d=l>=0?l:s-c;if(d===0)return[3,8];if(a+=d,a>r)throw new Error("ZIP entry compressed data exceeds ".concat(r," bytes"));if(!t)return[3,4];u=new Uint8Array(d);return[4,e.tokenizer.readBuffer(u)];case 3:_state.sent(),o.push(u);return[3,6];case 4:return[4,e.tokenizer.ignore(d)];case 5:_state.sent();_state.label=6;case 6:if(l>=0)return[3,8];_state.label=7;case 7:return[3,1];case 8:if(Rs(e.tokenizer)||(e.knownSizeDescriptorScannedBytes+=a),!!t)return[2,v1t(o,a)];return[2]}})}).apply(this,arguments)}function b1t(e,t){return Rs(e.tokenizer)?Math.max(0,ou-(e.tokenizer.position-t)):Math.max(0,Xc-e.knownSizeDescriptorScannedBytes)}function w1t(_01,_11){return _async_to_generator(function(e,t){var _ref,r,tmp,n,i,o;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{},r=_ref.shouldBuffer,tmp=_ref.maximumDescriptorLength,n=tmp===void 0?Xc:tmp;if(t.dataDescriptor&&t.compressedSize===0)return[2,_1t(e,{shouldBuffer:r,maximumLength:n})];if(!!r)return[3,2];return[4,Fh(e.tokenizer,t.compressedSize,{maximumLength:Rs(e.tokenizer)?Xc:e.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"})];case 1:_state.sent();return[2];case 2:i=I1t(e.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>i)throw new Error("ZIP entry compressed data exceeds ".concat(i," bytes"));o=new Uint8Array(t.compressedSize);return[4,e.tokenizer.readBuffer(o)];case 3:return[2,(_state.sent(),o)]}})}).apply(this,arguments)}function S1t(e,t){var r=e.getReader(),n=0,i=!1,o=!1,a=function(s){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=i||o;if(_tmp)return[3,2];o=!0;return[4,r.cancel(s)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()};return new ReadableStream({pull:function pull(s){return _async_to_generator(function(){var _ref,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(n>=t))return[3,2];s.close();return[4,a()];case 1:_state.sent();return[2];case 2:return[4,r.read()];case 3:_ref=_state.sent(),l=_ref.done,c=_ref.value;if(l||!c){i=!0,s.close();return[2]}d=t-n;if(!(c.length>d))return[3,5];s.enqueue(c.subarray(0,d)),n+=d,s.close();return[4,a()];case 4:_state.sent();return[2];case 5:s.enqueue(c),n+=c.length;return[2]}})})()},cancel:function cancel(s){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,a(s)];case 1:_state.sent();return[2]}})})()}})}function k1t(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,new r5e(t).fromBuffer(e)]})})()}function Hve(e){switch(e=e.toLowerCase(),e){case"application/epub+zip":return{ext:"epub",mime:e};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:e};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:e};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:e};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:e};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:e};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:e};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:e};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:e};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:e};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:e};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:e};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:e};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:e};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:e};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:e};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function pp(e,t,r){r=_object_spread({offset:0},r);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}function C1t(e){return Number.isFinite(e)?Math.max(1,Math.trunc(e)):Xv}function E1t(e,t,r){return r===void 0?e.read(t):(r.throwIfAborted(),new Promise(function(n,i){var o=function(){r.removeEventListener("abort",a)},a=function(){var s=r.reason;o(),function(){return _async_to_generator(function(){var l;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.cancel(s)];case 1:_state.sent();return[3,3];case 2:l=_state.sent();return[3,3];case 3:return[2]}})})()}(),i(s)};r.addEventListener("abort",a,{once:!0}),function(){return _async_to_generator(function(){var _$s,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.read(t)];case 1:_$s=_state.sent();o(),n(_$s);return[3,3];case 2:s=_state.sent();o(),i(s);return[3,3];case 3:return[2]}})})()}()}))}function T1t(e){return Number.isFinite(e)?Math.max(0,Math.min(QSe,Math.trunc(e))):0}function A1t(e){return Number.isFinite(e)?Math.max(0,e):Number.MAX_SAFE_INTEGER}function Rs(e){var t=e.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function DS(e,t,r){return Rs(e)&&e.position-t>r}function I1t(e){var t=e.fileInfo.size,r=Number.isFinite(t)?Math.max(0,t-e.position):Number.MAX_SAFE_INTEGER;return Math.min(r,JSe)}function P1t(e){if(_instanceof(e,yo)||_instanceof(e,zh))return!0;if(!_instanceof(e,Error))return!1;if(YSe.has(e.message)||e5e.has(e.code))return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=XSe[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(e.message.startsWith(t))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function Zve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xc;var r=[e.compressedSize,e.uncompressedSize];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(!Number.isFinite(n)||n<0||n>t)return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}function R1t(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function M1t(e,t){t.startsWith("word/")&&(e.hasWordDirectory=!0),t.startsWith("ppt/")&&(e.hasPresentationDirectory=!0),t.startsWith("xl/")&&(e.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(e.hasThreeDimensionalModelEntry=!0)}function Kve(e){if(!(!e.hasContentTypesEntry||e.hasUnparseableContentTypes||e.isParsingContentTypes||e.hasParsedContentTypesEntry)){if(e.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(e.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(e.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(e.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function O1t(e){var t=e.indexOf('.main+xml"');if(t===-1){var i="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return e.includes('ContentType="'.concat(i,'"'))?i:void 0}var r=e.slice(0,t),n=r.lastIndexOf('"');return r.slice(n+1)}var Xv,QSe,Xc,Aq,JSe,ou,LS,Iq,Qve,Jve,Pq,t9,Rq,Mq,Yve,Xve,e_e,t_e,r_e,Oq,$q,Nq,n_e,Dq,YSe,XSe,e5e,zh,EW,GS,t5e,r5e,$1t,N1t,D1t=se(function(){Q9(),J0t(),a1t(),c1t(),f1t(),m1t(),Xv=4100,QSe=Xv-2,Xc=1024*1024,Aq=1024,JSe=Math.pow(2,31)-1,ou=16*1024*1024,LS=Xc,Iq=Xc,Qve=ou,Jve=1,Pq=100,t9=ou,Rq=64,Mq=LS,Yve=256,Xve=512,e_e=ou,t_e=512,r_e=512,Oq=256,$q=LS,Nq=LS,n_e=LS,Dq=ou,YSe=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),XSe=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],e5e=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),zh=/*#__PURE__*/function(Error1){"use strict";_inherits(zh1,Error1);function zh1(){_class_call_check(this,zh1);return _call_super(this,zh1,arguments)}return zh1}(_wrap_native_super(Error)),EW=0x8074b50,GS=16,t5e=GS-1,y9.prototype.inflate=function(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.compressedMethod===0)return[2,r(t)];if(e.compressedMethod!==8)throw new Error("Unsupported ZIP compression method: ".concat(e.compressedMethod));return[4,g1t(t,{maximumLength:Xc})];case 1:n=_state.sent();return[2,r(n)]}})})()},y9.prototype.unzip=function(e){return _async_to_generator(function(){var t,r,n,i,o,a,_tmp,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=!1,r=0,n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;_state.label=1;case 1:if(DS(this.tokenizer,n,ou))throw new zh("ZIP stream probing exceeds ".concat(ou," bytes"));return[4,this.readLocalFileHeader()];case 2:i=_state.sent();if(!i)return[3,10];if(r++,r>Aq)throw new Error("ZIP entry count exceeds ".concat(Aq));o=e(i);t=!!o.stop;return[4,this.tokenizer.ignore(i.extraFieldLength)];case 3:_state.sent();return[4,w1t(this,i,{shouldBuffer:!!o.handler,maximumDescriptorLength:Math.min(Xc,b1t(this,n))})];case 4:a=_state.sent();_tmp=o.handler;if(!_tmp)return[3,6];return[4,this.inflate(i,a,o.handler)];case 5:_tmp=_state.sent();_state.label=6;case 6:if(!(_tmp,i.dataDescriptor))return[3,8];s=new Uint8Array(GS);return[4,this.tokenizer.readBuffer(s)];case 7:if(_state.sent(),ro.get(s,0)!==EW)throw new Error("Expected data-descriptor-signature at position ".concat(this.tokenizer.position-s.length));_state.label=8;case 8:if(DS(this.tokenizer,n,ou))throw new zh("ZIP stream probing exceeds ".concat(ou," bytes"));_state.label=9;case 9:if(!t)return[3,1];_state.label=10;case 10:return[2]}})}).call(this)},r5e=/*#__PURE__*/function(){"use strict";function n5e(t){var _this=this;_class_call_check(this,n5e);A(this,"detectConfident",function(t){return _async_to_generator(function(){var _this,r,_tmp,_tmp1,n,_$i,o,n10,_$i1,o10,n11,n12,n13,n14,_$i2,_$o,a,s,n15,_$i3,n16,_$o1,n17,_$i4,a9,s10,l,c,d,u,_,p,n18,n19,_$i5,_$o2,a10,s11,l10,c10,d10,u10,i,n20,_$i6,n21;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.buffer=new Uint8Array(Xv),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t;_tmp=Rs(t);if(!_tmp)return[3,2];return[4,t.peekBuffer(this.buffer,{length:3,mayBeLess:!0})];case 1:_tmp=(_state.sent(),this.check([31,139,8]));_state.label=2;case 2:if(_tmp)return[2,this.detectGzip(t)];return[4,t.peekBuffer(this.buffer,{length:32,mayBeLess:!0})];case 3:if(_state.sent(),this.check([66,77]))return[2,{ext:"bmp",mime:"image/bmp"}];if(this.check([11,119]))return[2,{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"}];if(this.check([120,1]))return[2,{ext:"dmg",mime:"application/x-apple-diskimage"}];if(this.check([77,90]))return[2,{ext:"exe",mime:"application/x-msdownload"}];if(!this.check([37,33]))return[3,5];return[4,t.peekBuffer(this.buffer,{length:24,mayBeLess:!0})];case 4:return[2,(_state.sent(),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"})];case 5:if(this.check([31,160])||this.check([31,157]))return[2,{ext:"Z",mime:"application/x-compress"}];if(this.check([199,113]))return[2,{ext:"cpio",mime:"application/x-cpio"}];if(this.check([96,234]))return[2,{ext:"arj",mime:"application/x-arj"}];if(!this.check([239,187,191]))return[3,9];if(!(this.detectionReentryCount>=Oq))return[3,6];_tmp1=void 0;return[3,8];case 6:this.detectionReentryCount++;return[4,this.tokenizer.ignore(3)];case 7:_tmp1=(_state.sent(),this.detectConfident(t));_state.label=8;case 8:return[2,_tmp1];case 9:if(this.check([71,73,70]))return[2,{ext:"gif",mime:"image/gif"}];if(this.check([73,73,188]))return[2,{ext:"jxr",mime:"image/vnd.ms-photo"}];if(this.check([31,139,8]))return[2,this.detectGzip(t)];if(this.check([66,90,104]))return[2,{ext:"bz2",mime:"application/x-bzip2"}];if(!this.checkString("ID3"))return[3,16];return[4,Fh(t,6,{maximumLength:6,reason:"ID3 header prefix"})];case 10:_state.sent();return[4,t.readToken(HSe)];case 11:n=_state.sent(),_$i=Rs(t);if(!Number.isFinite(n)||n<0||_$i&&(n>t9||t.position+n>t9))return[2];if(t.position+n>t.fileInfo.size)return[2,_$i?void 0:{ext:"mp3",mime:"audio/mpeg"}];_state.label=12;case 12:_state.trys.push([12,14,,15]);return[4,Fh(t,n,{maximumLength:_$i?t9:t.fileInfo.size,reason:"ID3 payload"})];case 13:_state.sent();return[3,15];case 14:o=_state.sent();if(_instanceof(o,yo))return[2];throw o;case 15:return[2,this.detectionReentryCount>=Oq?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))];case 16:if(this.checkString("MP+"))return[2,{ext:"mpc",mime:"audio/x-musepack"}];if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return[2,{ext:"swf",mime:"application/x-shockwave-flash"}];if(this.check([255,216,255]))return[2,this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"}];if(this.check([79,98,106,1]))return[2,{ext:"avro",mime:"application/avro"}];if(this.checkString("FLIF"))return[2,{ext:"flif",mime:"image/flif"}];if(this.checkString("8BPS"))return[2,{ext:"psd",mime:"image/vnd.adobe.photoshop"}];if(this.checkString("MPCK"))return[2,{ext:"mpc",mime:"audio/x-musepack"}];if(this.checkString("FORM"))return[2,{ext:"aif",mime:"audio/aiff"}];if(this.checkString("icns",{offset:0}))return[2,{ext:"icns",mime:"image/icns"}];if(!this.check([80,75,3,4]))return[3,21];_$i1=R1t();_state.label=17;case 17:_state.trys.push([17,19,,20]);return[4,new y9(t).unzip(function(o){M1t(_$i1,o.filename);var a=o.filename==="[Content_Types].xml",s=Kve(_$i1);if(!a&&s)return n10=s,{stop:!0};switch(o.filename){case"META-INF/mozilla.rsa":return n10={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return n10={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Zve(o,Iq)?{handler:function handler(l){return _async_to_generator(function(){var c;return _ts_generator(this,function(_state){c=new TextDecoder("utf-8").decode(l).trim();n10=Hve(c);return[2]})})()},stop:!0}:{};case"[Content_Types].xml":return _$i1.hasContentTypesEntry=!0,Zve(o,Iq)?(_$i1.isParsingContentTypes=!0,{handler:function handler(l){return _async_to_generator(function(){var c,d;return _ts_generator(this,function(_state){c=new TextDecoder("utf-8").decode(l),d=O1t(c);d&&(n10=Hve(d)),_$i1.hasParsedContentTypesEntry=!0,_$i1.isParsingContentTypes=!1;return[2]})})()},stop:!0}):(_$i1.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(o.filename)?(n10={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})];case 18:_state.sent();return[3,20];case 19:o10=_state.sent();if(!P1t(o10))throw o10;_$i1.isParsingContentTypes&&(_$i1.isParsingContentTypes=!1,_$i1.hasUnparseableContentTypes=!0);return[3,20];case 20:return[2,(r=n10!=null?n10:Kve(_$i1))!=null?r:{ext:"zip",mime:"application/zip"}];case 21:if(!this.checkString("OggS"))return[3,24];return[4,t.ignore(28)];case 22:_state.sent();n11=new Uint8Array(8);return[4,t.readBuffer(n11)];case 23:return[2,(_state.sent(),pp(n11,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:pp(n11,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:pp(n11,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:pp(n11,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:pp(n11,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:pp(n11,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"})];case 24:if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return[2,{ext:"zip",mime:"application/zip"}];if(this.checkString("MThd"))return[2,{ext:"mid",mime:"audio/midi"}];if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return[2,{ext:"woff",mime:"font/woff"}];if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return[2,{ext:"woff2",mime:"font/woff2"}];if(this.check([212,195,178,161])||this.check([161,178,195,212]))return[2,{ext:"pcap",mime:"application/vnd.tcpdump.pcap"}];if(this.checkString("DSD "))return[2,{ext:"dsf",mime:"audio/x-dsf"}];if(this.checkString("LZIP"))return[2,{ext:"lz",mime:"application/x-lzip"}];if(this.checkString("fLaC"))return[2,{ext:"flac",mime:"audio/flac"}];if(this.check([66,80,71,251]))return[2,{ext:"bpg",mime:"image/bpg"}];if(this.checkString("wvpk"))return[2,{ext:"wv",mime:"audio/wavpack"}];if(this.checkString("%PDF"))return[2,{ext:"pdf",mime:"application/pdf"}];if(this.check([0,97,115,109]))return[2,{ext:"wasm",mime:"application/wasm"}];if(!this.check([73,73]))return[3,26];return[4,this.readTiffHeader(!1)];case 25:n12=_state.sent();if(n12)return[2,n12];_state.label=26;case 26:if(!this.check([77,77]))return[3,28];return[4,this.readTiffHeader(!0)];case 27:n13=_state.sent();if(n13)return[2,n13];_state.label=28;case 28:if(this.checkString("MAC "))return[2,{ext:"ape",mime:"audio/ape"}];if(!this.check([26,69,223,163]))return[3,31];n14=function n14(){return _async_to_generator(function(){var l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.peekNumber(RSe)];case 1:l=_state.sent(),c=128,d=0;for(;!(l&c)&&c!==0;)++d,c>>=1;u=new Uint8Array(d+1);return[4,Tq(t,u,void 0,{maximumLength:u.length,reason:"EBML field"})];case 2:return[2,(_state.sent(),u)]}})})()};_$i2=function _$i2(){return _async_to_generator(function(){var l,c,d,u,_$p;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n14()];case 1:l=_state.sent();return[4,n14()];case 2:c=_state.sent();c[0]^=128>>c.length-1;d=Math.min(6,c.length),u=new DataView(l.buffer),_$p=new DataView(c.buffer,c.length-d,d);return[2,{id:Gve(u),len:Gve(_$p)}]}})})()};_$o=function _$o(l){return _async_to_generator(function(){var c,d,u,_$p,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=0;_state.label=1;case 1:if(!(l>0))return[3,8];if(c++,c>Yve||DS(t,s,ou))return[2];d=t.position;return[4,_$i2()];case 2:u=_state.sent();if(!(u.id===17026))return[3,4];if(u.len>Rq)return[2];_$p=CV(u.len,Rq,"EBML DocType");return[4,t.readToken(new mp(_$p))];case 3:return[2,_state.sent().replaceAll(/\00.*$/g,"")];case 4:_tmp=Rs(t)&&(!Number.isFinite(u.len)||u.len<0||u.len>Mq);if(_tmp)return[3,6];return[4,Fh(t,u.len,{maximumLength:Rs(t)?Mq:t.fileInfo.size,reason:"EBML payload"})];case 5:_tmp=(_state.sent(),--l,t.position<=d);_state.label=6;case 6:if(_tmp)return[2];_state.label=7;case 7:return[3,1];case 8:return[2]}})})()};return[4,_$i2()];case 29:a=_state.sent(),s=t.position;return[4,_$o(a.len)];case 30:switch(_state.sent()){case"webm":return[2,{ext:"webm",mime:"video/webm"}];case"matroska":return[2,{ext:"mkv",mime:"video/matroska"}];default:return[2]}_state.label=31;case 31:if(this.checkString("SQLi"))return[2,{ext:"sqlite",mime:"application/x-sqlite3"}];if(this.check([78,69,83,26]))return[2,{ext:"nes",mime:"application/x-nintendo-nes-rom"}];if(this.checkString("Cr24"))return[2,{ext:"crx",mime:"application/x-google-chrome-extension"}];if(this.checkString("MSCF")||this.checkString("ISc("))return[2,{ext:"cab",mime:"application/vnd.ms-cab-compressed"}];if(this.check([237,171,238,219]))return[2,{ext:"rpm",mime:"application/x-rpm"}];if(this.check([197,208,211,198]))return[2,{ext:"eps",mime:"application/eps"}];if(this.check([40,181,47,253]))return[2,{ext:"zst",mime:"application/zstd"}];if(this.check([127,69,76,70]))return[2,{ext:"elf",mime:"application/x-elf"}];if(this.check([33,66,68,78]))return[2,{ext:"pst",mime:"application/vnd.ms-outlook"}];if(this.checkString("PAR1")||this.checkString("PARE"))return[2,{ext:"parquet",mime:"application/vnd.apache.parquet"}];if(this.checkString("ttcf"))return[2,{ext:"ttc",mime:"font/collection"}];if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return[2,{ext:"macho",mime:"application/x-mach-binary"}];if(this.check([4,34,77,24]))return[2,{ext:"lz4",mime:"application/x-lz4"}];if(this.checkString("regf"))return[2,{ext:"dat",mime:"application/x-ft-windows-registry-hive"}];if(this.checkString("$FL2")||this.checkString("$FL3"))return[2,{ext:"sav",mime:"application/x-spss-sav"}];if(this.check([79,84,84,79,0]))return[2,{ext:"otf",mime:"font/otf"}];if(this.checkString("#!AMR"))return[2,{ext:"amr",mime:"audio/amr"}];if(this.checkString("{\\rtf"))return[2,{ext:"rtf",mime:"application/rtf"}];if(this.check([70,76,86,1]))return[2,{ext:"flv",mime:"video/x-flv"}];if(this.checkString("IMPM"))return[2,{ext:"it",mime:"audio/x-it"}];if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return[2,{ext:"lzh",mime:"application/x-lzh-compressed"}];if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return[2,{ext:"mpg",mime:"video/MP1S"}];if(this.check([68],{offset:4,mask:[196]}))return[2,{ext:"mpg",mime:"video/MP2P"}]}if(this.checkString("ITSF"))return[2,{ext:"chm",mime:"application/vnd.ms-htmlhelp"}];if(this.check([202,254,186,190])){n15=SW.get(this.buffer,4),_$i3=G0.get(this.buffer,6);if(n15>0&&n15<=30)return[2,{ext:"macho",mime:"application/x-mach-binary"}];if(_$i3>30)return[2,{ext:"class",mime:"application/java-vm"}]}if(this.checkString(".RMF"))return[2,{ext:"rm",mime:"application/vnd.rn-realmedia"}];if(this.checkString("DRACO"))return[2,{ext:"drc",mime:"application/vnd.google.draco"}];if(this.check([253,55,122,88,90,0]))return[2,{ext:"xz",mime:"application/x-xz"}];if(this.checkString("<?xml "))return[2,{ext:"xml",mime:"application/xml"}];if(this.check([55,122,188,175,39,28]))return[2,{ext:"7z",mime:"application/x-7z-compressed"}];if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return[2,{ext:"rar",mime:"application/x-rar-compressed"}];if(this.checkString("solid "))return[2,{ext:"stl",mime:"model/stl"}];if(this.checkString("AC")){n16=new mp(4,"latin1").get(this.buffer,2);if(n16.match("^d*")&&n16>=1e3&&n16<=1050)return[2,{ext:"dwg",mime:"image/vnd.dwg"}]}if(this.checkString("070707"))return[2,{ext:"cpio",mime:"application/x-cpio"}];if(this.checkString("BLENDER"))return[2,{ext:"blend",mime:"application/x-blender"}];if(!this.checkString("!<arch>"))return[3,34];return[4,t.ignore(8)];case 32:_state.sent();return[4,t.readToken(new mp(13,"ascii"))];case 33:return[2,_state.sent()==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}];case 34:if(this.checkString("WEBVTT")&&["\n","\r"," "," ","\0"].some(function(n){return _this.checkString(n,{offset:6})}))return[2,{ext:"vtt",mime:"text/vtt"}];if(!this.check([137,80,78,71,13,10,26,10]))return[3,47];_$o1=function _$o1(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp={};return[4,t.readToken(MSe)];case 1:_tmp.length=_state.sent();return[4,t.readToken(new mp(4,"latin1"))];case 2:return[2,(_tmp.type=_state.sent(),_tmp)]}})})()};n17={ext:"png",mime:"image/png"},_$i4={ext:"apng",mime:"image/apng"};return[4,t.ignore(8)];case 35:_state.sent();a9=Rs(t),s10=t.position,l=0,c=!1;_state.label=36;case 36:if(l++,l>Xve||DS(t,s10,e_e))return[3,46];d=t.position;return[4,_$o1()];case 37:u=_state.sent();if(u.length<0)return[2];if(u.type==="IHDR"){if(u.length!==13)return[2];c=!0}_=u.type;switch(_){case"IDAT":return[3,38];case"acTL":return[3,39]}return[3,40];case 38:return[2,n17];case 39:return[2,_$i4];case 40:if(!c&&u.type!=="CgBI")return[2];if(a9&&u.length>$q)return[2,c&&y1t(u.type)?n17:void 0];_state.label=41;case 41:_state.trys.push([41,43,,44]);return[4,Fh(t,u.length+4,{maximumLength:a9?$q+4:t.fileInfo.size,reason:"PNG chunk payload"})];case 42:_state.sent();return[3,44];case 43:p=_state.sent();if(!a9&&(_instanceof(p,zh)||_instanceof(p,yo)))return[2,n17];throw p;case 44:if(t.position<=d)return[3,46];_state.label=45;case 45:if(t.position+8<t.fileInfo.size)return[3,36];_state.label=46;case 46:return[2,n17];case 47:if(this.check([65,82,82,79,87,49,0,0]))return[2,{ext:"arrow",mime:"application/vnd.apache.arrow.file"}];if(this.check([103,108,84,70,2,0,0,0]))return[2,{ext:"glb",mime:"model/gltf-binary"}];if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return[2,{ext:"mov",mime:"video/quicktime"}];if(this.check([73,73,82,79,8,0,0,0,24]))return[2,{ext:"orf",mime:"image/x-olympus-orf"}];if(this.checkString("gimp xcf "))return[2,{ext:"xcf",mime:"image/x-xcf"}];if(this.checkString("ftyp",{offset:4})&&this.buffer[8]&96){n18=new mp(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(n18){case"avif":case"avis":return[2,{ext:"avif",mime:"image/avif"}];case"mif1":return[2,{ext:"heic",mime:"image/heif"}];case"msf1":return[2,{ext:"heic",mime:"image/heif-sequence"}];case"heic":case"heix":return[2,{ext:"heic",mime:"image/heic"}];case"hevc":case"hevx":return[2,{ext:"heic",mime:"image/heic-sequence"}];case"qt":return[2,{ext:"mov",mime:"video/quicktime"}];case"M4V":case"M4VH":case"M4VP":return[2,{ext:"m4v",mime:"video/x-m4v"}];case"M4P":return[2,{ext:"m4p",mime:"video/mp4"}];case"M4B":return[2,{ext:"m4b",mime:"audio/mp4"}];case"M4A":return[2,{ext:"m4a",mime:"audio/x-m4a"}];case"F4V":return[2,{ext:"f4v",mime:"video/mp4"}];case"F4P":return[2,{ext:"f4p",mime:"video/mp4"}];case"F4A":return[2,{ext:"f4a",mime:"audio/mp4"}];case"F4B":return[2,{ext:"f4b",mime:"audio/mp4"}];case"crx":return[2,{ext:"cr3",mime:"image/x-canon-cr3"}];default:return[2,n18.startsWith("3g")?n18.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}]}}if(this.checkString("REGEDIT4\r\n"))return[2,{ext:"reg",mime:"application/x-ms-regedit"}];if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return[2,{ext:"webp",mime:"image/webp"}];if(this.check([65,86,73],{offset:8}))return[2,{ext:"avi",mime:"video/vnd.avi"}];if(this.check([87,65,86,69],{offset:8}))return[2,{ext:"wav",mime:"audio/wav"}];if(this.check([81,76,67,77],{offset:8}))return[2,{ext:"qcp",mime:"audio/qcelp"}]}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return[2,{ext:"rw2",mime:"image/x-panasonic-rw2"}];if(!this.check([48,38,178,117,142,102,207,17,166,217]))return[3,59];n19=!1;_state.label=48;case 48:_state.trys.push([48,57,,58]);_$i5=function _$i5(){return _async_to_generator(function(){var l,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:l=new Uint8Array(16);return[4,Tq(t,l,void 0,{maximumLength:l.length,reason:"ASF header GUID"})];case 1:_state.sent();_tmp={id:l};return[4,t.readToken(OSe)];case 2:return[2,(_tmp.size=Number.apply(void 0,[_state.sent()]),_tmp)]}})})()};return[4,Fh(t,30,{maximumLength:30,reason:"ASF header prelude"})];case 49:_state.sent();_$o2=Rs(t),a10=t.position,s11=0;_state.label=50;case 50:if(!(t.position+24<t.fileInfo.size&&(s11++,!(s11>t_e||DS(t,a10,ou)))))return[3,56];l10=t.position;return[4,_$i5()];case 51:c10=_state.sent(),d10=c10.size-24;if(!Number.isFinite(d10)||d10<0){n19=!0;return[3,56]}if(!pp(c10.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101]))return[3,53];u10=new Uint8Array(16);return[4,Tq(t,u10,void 0,{maximumLength:u10.length,reason:"ASF stream type GUID"})];case 52:if(d10=d10-_state.sent(),pp(u10,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return[2,{ext:"asf",mime:"audio/x-ms-asf"}];if(pp(u10,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return[2,{ext:"asf",mime:"video/x-ms-asf"}];return[3,56];case 53:if(_$o2&&d10>Nq){n19=!0;return[3,56]}return[4,Fh(t,d10,{maximumLength:_$o2?Nq:t.fileInfo.size,reason:"ASF header payload"})];case 54:if(_state.sent(),t.position<=l10){n19=!0;return[3,56]}_state.label=55;case 55:return[3,50];case 56:return[3,58];case 57:i=_state.sent();if(_instanceof(i,yo)||_instanceof(i,zh))Rs(t)&&(n19=!0);else throw i;return[3,58];case 58:return[2,n19?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}];case 59:if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return[2,{ext:"ktx",mime:"image/ktx"}];if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return[2,{ext:"mie",mime:"application/x-mie"}];if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return[2,{ext:"shp",mime:"application/x-esri-shape"}];if(this.check([255,79,255,81]))return[2,{ext:"j2c",mime:"image/j2c"}];if(!this.check([0,0,0,12,106,80,32,32,13,10,135,10]))return[3,62];return[4,t.ignore(20)];case 60:_state.sent();return[4,t.readToken(new mp(4,"ascii"))];case 61:switch(_state.sent()){case"jp2 ":return[2,{ext:"jp2",mime:"image/jp2"}];case"jpx ":return[2,{ext:"jpx",mime:"image/jpx"}];case"jpm ":return[2,{ext:"jpm",mime:"image/jpm"}];case"mjp2":return[2,{ext:"mj2",mime:"image/mj2"}];default:return[2]}_state.label=62;case 62:if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return[2,{ext:"jxl",mime:"image/jxl"}];if(this.check([254,255]))return[2,this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0];if(this.check([208,207,17,224,161,177,26,225]))return[2,{ext:"cfb",mime:"application/x-cfb"}];return[4,t.peekBuffer(this.buffer,{length:Math.min(256,t.fileInfo.size),mayBeLess:!0})];case 63:if(_state.sent(),this.check([97,99,115,112],{offset:36}))return[2,{ext:"icc",mime:"application/vnd.iccprofile"}];if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return[2,{ext:"ace",mime:"application/x-ace-compressed"}];if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return[2,{ext:"vcf",mime:"text/vcard"}];if(this.checkString("VCALENDAR",{offset:6}))return[2,{ext:"ics",mime:"text/calendar"}]}if(this.checkString("FUJIFILMCCD-RAW"))return[2,{ext:"raf",mime:"image/x-fujifilm-raf"}];if(this.checkString("Extended Module:"))return[2,{ext:"xm",mime:"audio/x-xm"}];if(this.checkString("Creative Voice File"))return[2,{ext:"voc",mime:"audio/x-voc"}];if(this.check([4,0,0,0])&&this.buffer.length>=16){n20=new DataView(this.buffer.buffer).getUint32(12,!0);if(n20>12&&this.buffer.length>=n20+16)try{_$i6=new TextDecoder().decode(this.buffer.subarray(16,n20+16));if(JSON.parse(_$i6).files)return[2,{ext:"asar",mime:"application/x-asar"}]}catch(i){}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return[2,{ext:"mxf",mime:"application/mxf"}];if(this.checkString("SCRM",{offset:44}))return[2,{ext:"s3m",mime:"audio/x-s3m"}];if(this.check([71])&&this.check([71],{offset:188}))return[2,{ext:"mts",mime:"video/mp2t"}];if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return[2,{ext:"mts",mime:"video/mp2t"}];if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return[2,{ext:"mobi",mime:"application/x-mobipocket-ebook"}];if(this.check([68,73,67,77],{offset:128}))return[2,{ext:"dcm",mime:"application/dicom"}];if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return[2,{ext:"lnk",mime:"application/x.ms.shortcut"}];if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return[2,{ext:"alias",mime:"application/x.apple.alias"}];if(this.checkString("Kaydara FBX Binary \0"))return[2,{ext:"fbx",mime:"application/x.autodesk.fbx"}];if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return[2,{ext:"eot",mime:"application/vnd.ms-fontobject"}];if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return[2,{ext:"indd",mime:"application/x-indesign"}];if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return[2,{ext:"jmp",mime:"application/x-jmp-data"}];return[4,t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0})];case 64:if(_state.sent(),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&p1t(this.buffer))return[2,{ext:"tar",mime:"application/x-tar"}];if(this.check([255,254])){n21="utf-16le";return[2,this.checkString("<?xml ",{offset:2,encoding:n21})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:n21})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString("Windows Registry Editor Version 5.00\r\n",{offset:2,encoding:n21})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0]}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return[2,{ext:"pgp",mime:"application/pgp-encrypted"}];return[2]}})}).call(_this)});A(this,"detectImprecise",function(t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.buffer=new Uint8Array(Xv);r=A1t(t.fileInfo.size);return[4,t.peekBuffer(this.buffer,{length:Math.min(8,r),mayBeLess:!0})];case 1:if(_state.sent(),this.check([0,0,1,186])||this.check([0,0,1,179]))return[2,{ext:"mpg",mime:"video/mpeg"}];if(this.check([0,1,0,0,0]))return[2,{ext:"ttf",mime:"font/ttf"}];if(this.check([0,0,1,0]))return[2,{ext:"ico",mime:"image/x-icon"}];if(this.check([0,0,2,0]))return[2,{ext:"cur",mime:"image/x-icon"}];return[4,t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,r),mayBeLess:!0})];case 2:if(_state.sent(),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(n=0;n<=this.options.mpegOffsetTolerance;++n){i=this.scanMpeg(n);if(i)return[2,i]}return[2]}})}).call(_this)});var n;var r=T1t(t==null?void 0:t.mpegOffsetTolerance);this.options=_object_spread_props(_object_spread({},t),{mpegOffsetTolerance:r}),this.detectors=_to_consumable_array((n=this.options.customDetectors)!=null?n:[]).concat([{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}]),this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}_create_class(n5e,[{key:"getTokenizerOptions",value:function getTokenizerOptions(){return _object_spread({},this.tokenizerOptions)}},{key:"createTokenizerFromWebStream",value:function createTokenizerFromWebStream(t){return h1t(Z0t(t,this.getTokenizerOptions()))}},{key:"parseTokenizer",value:function parseTokenizer(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.detectionReentryCount=r;n=t.position;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,9,10,11]);_iterator=this.detectors[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];i=_step.value;o=void 0;_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,i.detect(t)];case 4:o=_state.sent();return[3,6];case 5:a=_state.sent();if(_instanceof(a,yo)||_instanceof(a,zh))return[2];throw a;case 6:if(o)return[2,o];if(n!==t.position)return[2];_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,2];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2]}})}).call(this)}},{key:"fromTokenizer",value:function fromTokenizer(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,,2,4]);return[4,this.parseTokenizer(t)];case 1:return[2,_state.sent()];case 2:return[4,t.close()];case 3:_state.sent();return[7];case 4:return[2]}})}).call(this)}},{key:"fromBuffer",value:function fromBuffer(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){if(!(_instanceof(t,Uint8Array)||_instanceof(t,ArrayBuffer)))throw new TypeError("Expected the `input` argument to be of type `Uint8Array` or `ArrayBuffer`, got `".concat(typeof t==="undefined"?"undefined":_type_of(t),"`"));r=_instanceof(t,Uint8Array)?t:new Uint8Array(t);if((r==null?void 0:r.length)>1)return[2,this.fromTokenizer(K0t(r,this.getTokenizerOptions()))];return[2]})}).call(this)}},{key:"fromBlob",value:function fromBlob(t){return _async_to_generator(function(){var n,r;return _ts_generator(this,function(_state){(n=this.options.signal)==null||n.throwIfAborted();r=Q0t(t,this.getTokenizerOptions());return[2,this.fromTokenizer(r)]})}).call(this)}},{key:"fromStream",value:function fromStream(t){return _async_to_generator(function(){var n,r;return _ts_generator(this,function(_state){(n=this.options.signal)==null||n.throwIfAborted();r=this.createTokenizerFromWebStream(t);return[2,this.fromTokenizer(r)]})}).call(this)}},{key:"toDetectionStream",value:function toDetectionStream(t,r){return _async_to_generator(function(){var c,n,i,o,a,_ref,d,u,p,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=C1t((c=r==null?void 0:r.sampleSize)!=null?c:Xv),a=t.getReader({mode:"byob"});_state.label=1;case 1:_state.trys.push([1,,7,8]);return[4,E1t(a,new Uint8Array(n),this.options.signal)];case 2:_ref=_state.sent(),d=_ref.value,u=_ref.done;if(!(o=d,!u&&d))return[3,6];_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,this.fromBuffer(d.subarray(0,n))];case 4:i=_state.sent();return[3,6];case 5:p=_state.sent();if(!_instanceof(p,yo))throw p;i=void 0;return[3,6];case 6:o=d;return[3,8];case 7:a.releaseLock();return[7];case 8:s=new TransformStream({start:function start(d){return _async_to_generator(function(){return _ts_generator(this,function(_state){d.enqueue(o);return[2]})})()},transform:function transform(d,u){u.enqueue(d)}}),l=t.pipeThrough(s);return[2,(l.fileType=i,l)]}})}).call(this)}},{key:"detectGzip",value:function detectGzip(t){return _async_to_generator(function(){var c,r,n,i,o,a,s,l,_$d,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.gzipProbeDepth>=Jve)return[2,{ext:"gz",mime:"application/gzip"}];r=new GSe(t),n=S1t(r.inflate(),Qve),i=Rs(t);if(i){_$d=new AbortController;o=setTimeout(function(){_$d.abort(new DOMException("Operation timed out after ".concat(Pq," ms"),"TimeoutError"))},Pq),a=this.options.signal===void 0?_$d.signal:AbortSignal.any([this.options.signal,_$d.signal]),s=new n5e(_object_spread_props(_object_spread({},this.options),{signal:a})),s.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;_state.label=1;case 1:_state.trys.push([1,3,4,5]);return[4,(s!=null?s:this).fromStream(n)];case 2:l=_state.sent();return[3,5];case 3:d=_state.sent();if((d==null?void 0:d.name)==="AbortError"&&((c=a==null?void 0:a.reason)==null?void 0:c.name)!=="TimeoutError")throw d;return[3,5];case 4:clearTimeout(o),i||this.gzipProbeDepth--;return[7];case 5:return[2,(l==null?void 0:l.ext)==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}]}})}).call(this)}},{key:"check",value:function check(t,r){return pp(this.buffer,t,r)}},{key:"checkString",value:function checkString(t,r){return this.check(d1t(t,r==null?void 0:r.encoding),r)}},{key:"readTiffTag",value:function readTiffTag(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.tokenizer.readToken(t?G0:to)];case 1:r=_state.sent();return[4,this.tokenizer.ignore(10)];case 2:switch(_state.sent(),r){case 50341:return[2,{ext:"arw",mime:"image/x-sony-arw"}];case 50706:return[2,{ext:"dng",mime:"image/x-adobe-dng"}];default:}return[2]}})}).call(this)}},{key:"readTiffIFD",value:function readTiffIFD(t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.tokenizer.readToken(t?G0:to)];case 1:r=_state.sent();if(!(!(r>r_e)&&!(Rs(this.tokenizer)&&2+r*12>Dq)))return[3,5];n=0;_state.label=2;case 2:if(!(n<r))return[3,5];return[4,this.readTiffTag(t)];case 3:i=_state.sent();if(i)return[2,i];_state.label=4;case 4:++n;return[3,2];case 5:return[2]}})}).call(this)}},{key:"readTiffHeader",value:function readTiffHeader(t){return _async_to_generator(function(){var r,n,i,_$s,l,o,s,a,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r={ext:"tif",mime:"image/tiff"},n=(t?G0:to).get(this.buffer,2),i=(t?SW:ro).get(this.buffer,4);if(!(n===42))return[3,8];if(i>=6){if(this.checkString("CR",{offset:8}))return[2,{ext:"cr2",mime:"image/x-canon-cr2"}];if(i>=8){_$s=(t?G0:to).get(this.buffer,8),l=(t?G0:to).get(this.buffer,10);if(_$s===28&&l===254||_$s===31&&l===11)return[2,{ext:"nef",mime:"image/x-nikon-nef"}]}}if(Rs(this.tokenizer)&&i>n_e)return[2,r];o=Rs(this.tokenizer)?Dq:this.tokenizer.fileInfo.size;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,Fh(this.tokenizer,i,{maximumLength:o,reason:"TIFF IFD offset"})];case 2:_state.sent();return[3,4];case 3:s=_state.sent();if(_instanceof(s,yo))return[2];throw s;case 4:_state.trys.push([4,6,,7]);return[4,this.readTiffIFD(t)];case 5:a=_state.sent();return[3,7];case 6:s10=_state.sent();if(_instanceof(s10,yo))return[2];throw s10;case 7:return[2,a!=null?a:r];case 8:if(n===43)return[2,r];return[2]}})}).call(this)}},{key:"scanMpeg",value:function scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}]);return n5e}(),$1t=new Set(ZSe),N1t=new Set(KSe)}),i5e={};St(i5e,{fileCommand:function(){return s5e},flagsForFuzzing:function(){return l5e}});function L1t(e,t){var a;var r=a5e.get(e);if(r)return r;var _t_split=_sliced_to_array(t.split("/"),2),n=_t_split[0],i=_t_split[1],o=((a=i==null?void 0:i.split("+")[0])==null?void 0:a.replace(/-/g," "))||e;switch(n){case"image":return"".concat(o.toUpperCase()," image data");case"audio":return"".concat(o.toUpperCase()," audio");case"video":return"".concat(o.toUpperCase()," video");case"font":return"".concat(o," font");case"model":return"".concat(o," 3D model");case"application":return i!=null&&i.includes("zip")||i!=null&&i.includes("compressed")?"".concat(o," archive data"):i!=null&&i.includes("executable")?"".concat(o," executable"):"".concat(e.toUpperCase()," data");default:return"".concat(e.toUpperCase()," data")}}function F1t(e){var t=e.split("/").pop()||e;if(t.startsWith(".")&&!t.includes(".",1))return t;var r=t.lastIndexOf(".");return r===-1||r===0?"":t.slice(r).toLowerCase()}function z1t(e,t){if(e.startsWith("#!")){var c=e.split("\n")[0];return c.includes("python")?{description:"Python script, ASCII text executable",mime:"text/x-python"}:c.includes("node")||c.includes("bun")||c.includes("deno")?{description:"JavaScript script, ASCII text executable",mime:"text/javascript"}:c.includes("bash")?{description:"Bourne-Again shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("sh")?{description:"POSIX shell script, ASCII text executable",mime:"text/x-shellscript"}:c.includes("ruby")?{description:"Ruby script, ASCII text executable",mime:"text/x-ruby"}:c.includes("perl")?{description:"Perl script, ASCII text executable",mime:"text/x-perl"}:{description:"script, ASCII text executable",mime:"text/plain"}}var r=e.trimStart();if(r.startsWith("<?xml"))return{description:"XML document",mime:"application/xml"};if(r.startsWith("<!DOCTYPE html")||r.toLowerCase().startsWith("<html"))return{description:"HTML document",mime:"text/html"};var n=e.includes("\r\n"),i=e.includes("\r")&&!n,o="";n?o=", with CRLF line terminators":i&&(o=", with CR line terminators");var a=F1t(t),s=a?o5e.get(a):void 0;if(s)return s.mime.startsWith("text/")&&o?{description:"".concat(s.description).concat(o),mime:s.mime}:s;var l=!1;for(var c10=0;c10<Math.min(e.length,8192);c10++)if(e.charCodeAt(c10)>127){l=!0;break}return l?{description:"UTF-8 Unicode text".concat(o),mime:"text/plain; charset=utf-8"}:{description:"ASCII text".concat(o),mime:"text/plain"}}function j1t(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length===0)return[2,{description:"empty",mime:"inode/x-empty"}];return[4,k1t(t)];case 1:r=_state.sent();if(r)return[2,{description:L1t(r.ext,r.mime),mime:r.mime}];n=new TextDecoder("utf-8",{fatal:!1}).decode(t);return[2,z1t(n,e)]}})})()}var i_e,o5e,a5e,s5e,l5e,U1t=se(function(){"use strict";D1t(),jt(),i_e={name:"file",summary:"determine file type",usage:"file [OPTION]... FILE...",options:["-b, --brief do not prepend filenames to output","-i, --mime output MIME type strings","-L, --dereference follow symlinks"," --help display this help and exit"]},o5e=new Map([[".js",{description:"JavaScript source",mime:"text/javascript"}],[".mjs",{description:"JavaScript module",mime:"text/javascript"}],[".cjs",{description:"CommonJS module",mime:"text/javascript"}],[".ts",{description:"TypeScript source",mime:"text/typescript"}],[".tsx",{description:"TypeScript JSX source",mime:"text/typescript"}],[".jsx",{description:"JavaScript JSX source",mime:"text/javascript"}],[".py",{description:"Python script",mime:"text/x-python"}],[".rb",{description:"Ruby script",mime:"text/x-ruby"}],[".go",{description:"Go source",mime:"text/x-go"}],[".rs",{description:"Rust source",mime:"text/x-rust"}],[".c",{description:"C source",mime:"text/x-c"}],[".h",{description:"C header",mime:"text/x-c"}],[".cpp",{description:"C++ source",mime:"text/x-c++"}],[".hpp",{description:"C++ header",mime:"text/x-c++"}],[".java",{description:"Java source",mime:"text/x-java"}],[".sh",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".bash",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".zsh",{description:"Zsh shell script",mime:"text/x-shellscript"}],[".json",{description:"JSON data",mime:"application/json"}],[".yaml",{description:"YAML data",mime:"text/yaml"}],[".yml",{description:"YAML data",mime:"text/yaml"}],[".xml",{description:"XML document",mime:"application/xml"}],[".csv",{description:"CSV text",mime:"text/csv"}],[".toml",{description:"TOML data",mime:"text/toml"}],[".html",{description:"HTML document",mime:"text/html"}],[".htm",{description:"HTML document",mime:"text/html"}],[".css",{description:"CSS stylesheet",mime:"text/css"}],[".svg",{description:"SVG image",mime:"image/svg+xml"}],[".md",{description:"Markdown document",mime:"text/markdown"}],[".markdown",{description:"Markdown document",mime:"text/markdown"}],[".txt",{description:"ASCII text",mime:"text/plain"}],[".rst",{description:"reStructuredText",mime:"text/x-rst"}],[".env",{description:"ASCII text",mime:"text/plain"}],[".gitignore",{description:"ASCII text",mime:"text/plain"}],[".dockerignore",{description:"ASCII text",mime:"text/plain"}]]),a5e=new Map([["jpg","JPEG image data"],["jpeg","JPEG image data"],["png","PNG image data"],["gif","GIF image data"],["webp","WebP image data"],["bmp","PC bitmap"],["ico","MS Windows icon resource"],["tif","TIFF image data"],["tiff","TIFF image data"],["psd","Adobe Photoshop Document"],["avif","AVIF image"],["heic","HEIC image"],["heif","HEIF image"],["jxl","JPEG XL image"],["icns","Mac OS X icon"],["svg","SVG Scalable Vector Graphics image"],["pdf","PDF document"],["epub","EPUB document"],["mobi","Mobipocket E-book"],["djvu","DjVu document"],["zip","Zip archive data"],["gz","gzip compressed data"],["gzip","gzip compressed data"],["bz2","bzip2 compressed data"],["xz","XZ compressed data"],["tar","POSIX tar archive"],["rar","RAR archive data"],["7z","7-zip archive data"],["lz","lzip compressed data"],["lzma","LZMA compressed data"],["zst","Zstandard compressed data"],["cab","Microsoft Cabinet archive"],["ar","Unix ar archive"],["rpm","RPM package"],["deb","Debian binary package"],["apk","Android Package"],["dmg","Apple disk image"],["iso","ISO 9660 CD-ROM filesystem data"],["vhd","Microsoft Virtual Hard Disk"],["vhdx","Microsoft Virtual Hard Disk (new format)"],["qcow2","QEMU QCOW Image"],["mp3","Audio file with ID3"],["m4a","MPEG-4 audio"],["aac","AAC audio"],["wav","RIFF (little-endian) data, WAVE audio"],["flac","FLAC audio bitstream data"],["ogg","Ogg data"],["oga","Ogg audio"],["opus","Ogg Opus audio"],["aiff","AIFF audio"],["wma","Windows Media Audio"],["amr","AMR audio"],["mid","MIDI audio"],["midi","MIDI audio"],["ape","Monkey's Audio"],["mp4","ISO Media, MPEG-4"],["m4v","MPEG-4 video"],["webm","WebM"],["avi","RIFF (little-endian) data, AVI"],["mov","ISO Media, Apple QuickTime movie"],["mkv","Matroska data"],["wmv","Windows Media Video"],["flv","Flash Video"],["3gp","3GPP multimedia"],["3g2","3GPP2 multimedia"],["ogv","Ogg video"],["mts","MPEG transport stream"],["m2ts","MPEG transport stream"],["ts","MPEG transport stream"],["mpg","MPEG video"],["mpeg","MPEG video"],["exe","PE32 executable"],["dll","PE32 DLL"],["elf","ELF executable"],["mach","Mach-O executable"],["wasm","WebAssembly (wasm) binary module"],["dex","Android Dalvik executable"],["class","Java class file"],["swf","Adobe Flash"],["doc","Microsoft Word Document"],["docx","Microsoft Word 2007+ Document"],["xls","Microsoft Excel Spreadsheet"],["xlsx","Microsoft Excel 2007+ Spreadsheet"],["ppt","Microsoft PowerPoint Presentation"],["pptx","Microsoft PowerPoint 2007+ Presentation"],["odt","OpenDocument Text"],["ods","OpenDocument Spreadsheet"],["odp","OpenDocument Presentation"],["ttf","TrueType Font"],["otf","OpenType Font"],["woff","Web Open Font Format"],["woff2","Web Open Font Format 2"],["eot","Embedded OpenType font"],["stl","Stereolithography CAD"],["obj","Wavefront 3D Object"],["gltf","GL Transmission Format"],["glb","GL Transmission Format (binary)"],["sqlite","SQLite 3.x database"],["mdb","Microsoft Access Database"],["xml","XML document"],["json","JSON data"],["macho","Mach-O binary"],["ics","iCalendar data"],["vcf","vCard data"],["msi","Microsoft Installer"],["ps","PostScript"],["ai","Adobe Illustrator"],["indd","Adobe InDesign"],["sketch","Sketch design file"],["fig","Figma design file"],["xd","Adobe XD"],["blend","Blender"],["fbx","Autodesk FBX"],["lnk","MS Windows shortcut"],["alias","Mac OS alias"],["torrent","BitTorrent file"],["pcap","pcap capture file"],["arrow","Apache Arrow"],["parquet","Apache Parquet"]]),s5e={name:"file",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l,o,a,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,s10,l10,p,c,d,u,l11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(i_e)];r=!1,n=!1,i=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s=_step.value;if(s.startsWith("--")){if(s==="--brief")r=!0;else if(s==="--mime"||s==="--mime-type")n=!0;else if(s!=="--dereference")return[2,fr("file",s)]}else if(s.startsWith("-")&&s!=="-"){_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=s.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){l=_step1.value;if(l==="b")r=!0;else if(l==="i")n=!0;else if(l!=="L")return[2,fr("file","-".concat(l))]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else i.push(s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(i.length===0)return[2,{stdout:"",stderr:"Usage: file [-bLi] FILE...\n",exitCode:1}];o="",a=0;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator2=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,9];s10=_step2.value;_state.label=3;case 3:_state.trys.push([3,7,,8]);l10=t.fs.resolvePath(t.cwd,s10);return[4,t.fs.stat(l10)];case 4:if(_state.sent().isDirectory){p=n?"inode/directory":"directory";o+=r?"".concat(p,"\n"):"".concat(s10,": ").concat(p,"\n");return[3,8]}return[4,t.fs.readFileBuffer(l10)];case 5:c=_state.sent();return[4,j1t(s10,c)];case 6:d=_state.sent(),u=n?d.mime:d.description;o+=r?"".concat(u,"\n"):"".concat(s10,": ").concat(u,"\n");return[3,8];case 7:l11=_state.sent();o+=r?"cannot open\n":"".concat(s10,": cannot open (No such file or directory)\n"),a=1;return[3,8];case 8:_iteratorNormalCompletion2=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 12:return[2,{stdout:o,stderr:"",exitCode:a}]}})})()}},l5e={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0}}),u5e={};St(u5e,{flagsForFuzzing:function(){return d5e},htmlToMarkdownCommand:function(){return c5e}});var o_e,c5e,d5e,B1t=se(function(){"use strict";kr(),jt(),o_e={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) → # Markdown headings"," - Paragraphs (p) → Plain text with blank lines"," - Links (a) → [text](url)"," - Images (img) → "," - Bold/Strong → **text**"," - Italic/Em → _text_"," - Code (code, pre) → `inline` or fenced blocks"," - Lists (ul, ol, li) → - or 1. items"," - Blockquotes → > quoted text"," - Horizontal rules (hr) → ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},c5e={name:"html-to-markdown",execute:function execute(e,t){return _async_to_generator(function(){var l,c,d,r,n,i,o,a,_$u,p,m,s,_$u1,u,_$u2;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(o_e)];r="-",n="```",i="---",o="atx",a=[];for(_$u=0;_$u<e.length;_$u++){p=e[_$u];if(p==="-b"||p==="--bullet")r=(l=e[++_$u])!=null?l:"-";else if(p.startsWith("--bullet="))r=p.slice(9);else if(p==="-c"||p==="--code")n=(c=e[++_$u])!=null?c:"```";else if(p.startsWith("--code="))n=p.slice(7);else if(p==="-r"||p==="--hr")i=(d=e[++_$u])!=null?d:"---";else if(p.startsWith("--hr="))i=p.slice(5);else if(p.startsWith("--heading-style=")){m=p.slice(16);(m==="setext"||m==="atx")&&(o=m)}else if(p==="-")a.push("-");else{if(p.startsWith("--")||p.startsWith("-"))return[2,fr("html-to-markdown",p)];a.push(p)}}if(!(a.length===0||a.length===1&&a[0]==="-"))return[3,1];s=Sn(t.stdin);return[3,4];case 1:_state.trys.push([1,3,,4]);_$u1=t.fs.resolvePath(t.cwd,a[0]);return[4,t.fs.readFile(_$u1)];case 2:s=_state.sent();return[3,4];case 3:u=_state.sent();return[2,{stdout:"",stderr:"html-to-markdown: ".concat(a[0],": No such file or directory\n"),exitCode:1}];case 4:if(!s.trim())return[2,{stdout:"",stderr:"",exitCode:0}];try{_$u2=new PS({bulletListMarker:r,codeBlockStyle:"fenced",fence:n,hr:i,headingStyle:o});return[2,(_$u2.remove(["script","style","footer"]),{stdout:"".concat(_$u2.turndown(s).trim(),"\n"),stderr:"",exitCode:0})]}catch(u){return[2,{stdout:"",stderr:"html-to-markdown: conversion error: ".concat(u.message,"\n"),exitCode:1}]}return[2]}})})()}},d5e={name:"html-to-markdown",flags:[],stdinType:"text"}}),p5e={};St(p5e,{flagsForFuzzing:function(){return h5e},helpCommand:function(){return m5e}});function q1t(e){var t=[],r=new Set(e);t.push("Available commands:\n");var n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=f5e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];var a=o.filter(function(s){return r.has(s)});if(a.length>0){t.push(" ".concat(i,":")),t.push(" ".concat(a.join(", "),"\n"));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var s=_step1.value;r.delete(s)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=r[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var i10=_step2.value;n.push(i10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return n.length>0&&(t.push(" Other:"),t.push(" ".concat(n.sort().join(", "),"\n"))),t.push("Use '<command> --help' for details on a specific command."),"".concat(t.join("\n"),"\n")}var f5e,m5e,h5e,W1t=se(function(){"use strict";m_(),f5e=new Map([["File operations",["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"]],["Text processing",["grep","sed","awk","sort","uniq","cut","tr","tee","diff"]],["Search",["find"]],["Navigation & paths",["pwd","basename","dirname","tree","du"]],["Environment & shell",["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"]],["Data processing",["xargs","jq","base64","date"]],["Network",["curl","html-to-markdown"]]]),m5e={name:"help",execute:function execute(e,t){return _async_to_generator(function(){var n,i,o,r;return _ts_generator(this,function(_state){if(e.includes("--help")||e.includes("-h"))return[2,{stdout:"help - display available commands\n\nUsage: help [command]\n\nOptions:\n -h, --help Show this help message\n\nIf a command name is provided, shows help for that command.\nOtherwise, lists all available commands.\n",stderr:"",exitCode:0}];if(e.length>0&&t.exec){o=e[0];return[2,t.exec(i1([o]),{cwd:t.cwd,signal:t.signal,args:["--help"]})]}r=(i=(n=t.getRegisteredCommands)==null?void 0:n.call(t))!=null?i:[];return[2,{stdout:q1t(r),stderr:"",exitCode:0}]})})()}},h5e={name:"help",flags:[]}}),g5e={};St(g5e,{flagsForFuzzing:function(){return y5e},whichCommand:function(){return x5e}});var a_e,s_e,x5e,y5e,V1t=se(function(){"use strict";zo(),jt(),a_e={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},s_e={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},x5e={name:"which",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,u,p,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(a_e)];r=Fo("which",e,s_e);if(!r.ok)return[2,r.error];n=r.result.flags.showAll,i=r.result.flags.silent,o=r.result.positional;if(o.length===0)return[2,{stdout:"",stderr:"",exitCode:1}];a=(t.env.get("PATH")||"/usr/bin:/bin").split(":"),s="",l=!0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];c=_step.value;d=!1;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator1=a[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,7];u=_step1.value;if(!u)return[3,6];p=t.fs.resolvePath(u,c);return[4,t.fs.exists(p)];case 5:if(_state.sent()&&(d=!0,i||(s+="".concat(p,"\n")),!n))return[3,7];_state.label=6;case 6:_iteratorNormalCompletion1=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 10:d||(l=!1);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:return[2,{stdout:s,stderr:"",exitCode:l?0:1}]}})})()}},y5e={name:"which",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"boolean"}],needsArgs:!0}}),v5e={};St(v5e,{flagsForFuzzing:function(){return b5e},tac:function(){return _5e}});function G1t(e,t){return _async_to_generator(function(){var i,o,a,o10,r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(e.length>0&&e[0]!=="-"))return[3,4];i=t.fs.resolvePath(t.cwd,e[0]);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,t.fs.readFile(i)];case 2:o=_state.sent().split("\n");o[o.length-1]===""&&o.pop();a=o.reverse();return[2,{stdout:a.length>0?"".concat(a.join("\n"),"\n"):"",stderr:"",exitCode:0}];case 3:o10=_state.sent();return[2,{stdout:"",stderr:"tac: ".concat(e[0],": No such file or directory\n"),exitCode:1}];case 4:r=t.stdin.split("\n");r[r.length-1]===""&&r.pop();n=r.reverse();return[2,{stdout:n.length>0?"".concat(n.join("\n"),"\n"):"",stderr:"",exitCode:0,stdoutKind:"bytes"}]}})})()}var _5e,b5e,H1t=se(function(){"use strict";kr(),_5e={name:"tac",execute:G1t},b5e={name:"tac",flags:[],stdinType:"text",needsFiles:!0}}),w5e={};St(w5e,{flagsForFuzzing:function(){return k5e},hostname:function(){return S5e}});function Z1t(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,{stdout:"localhost\n",stderr:"",exitCode:0}]})})()}var S5e,k5e,K1t=se(function(){"use strict";S5e={name:"hostname",execute:Z1t},k5e={name:"hostname",flags:[]}}),C5e={};St(C5e,{flagsForFuzzing:function(){return T5e},whoami:function(){return E5e}});function Q1t(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,{stdout:"user\n",stderr:"",exitCode:0}]})})()}var E5e,T5e,J1t=se(function(){"use strict";E5e={name:"whoami",execute:Q1t},T5e={name:"whoami",flags:[]}}),A5e={};St(A5e,{flagsForFuzzing:function(){return P5e},od:function(){return I5e}});function Y1t(e,t){return _async_to_generator(function(){var r,n,i,m,h,g,o,m10,h10,a,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m11,u,p,m12,h11,g10,x,v,y;function s(m){return m===0?" \\0":m===7?" \\a":m===8?" \\b":m===9?" \\t":m===10?" \\n":m===11?" \\v":m===12?" \\f":m===13?" \\r":m>=32&&m<127?" ".concat(String.fromCharCode(m)):" ".concat(m.toString(8).padStart(3,"0"))}function l(m){return a?" ".concat(m.toString(16).padStart(2,"0")):" ".concat(m.toString(16).padStart(2,"0"))}function c(m){return" ".concat(m.toString(8).padStart(3,"0"))}return _ts_generator(this,function(_state){switch(_state.label){case 0:r="octal",n=[],i=[];for(m=0;m<e.length;m++){h=e[m];if(h==="-c")n.push("char");else if(h==="-An"||h==="-A"&&e[m+1]==="n")r="none",h==="-A"&&m++;else if(h==="-t"&&e[m+1]){g=e[++m];g==="x1"?n.push("hex"):g==="c"?n.push("char"):g.startsWith("o")&&n.push("octal")}else(!h.startsWith("-")||h==="-")&&i.push(h)}n.length===0&&n.push("octal");o=t.stdin;if(!(i.length>0&&i[0]!=="-"))return[3,4];m10=i[0].startsWith("/")?i[0]:"".concat(t.cwd,"/").concat(i[0]);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,p_(t.fs,m10)];case 2:o=_state.sent();return[3,4];case 3:h10=_state.sent();return[2,{stdout:"",stderr:"od: ".concat(i[0],": No such file or directory\n"),exitCode:1}];case 4:a=n.includes("char");d=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=o[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){m11=_step.value;d.push(m11.charCodeAt(0))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}u=16,p=[];for(m12=0;m12<d.length;m12+=u){h11=d.slice(m12,m12+u);for(g10=0;g10<n.length;g10++){x=n[g10],v=void 0;x==="char"?v=h11.map(s):x==="hex"?v=h11.map(l):v=h11.map(c);y="";g10===0&&r!=="none"?y="".concat(m12.toString(8).padStart(7,"0")," "):(g10>0||r==="none")&&(y=r==="none"?"":" "),p.push(y+v.join(""))}}return[2,(r!=="none"&&d.length>0&&p.push(d.length.toString(8).padStart(7,"0")),{stdout:p.length>0?"".concat(p.join("\n"),"\n"):"",stderr:"",exitCode:0})]}})})()}var I5e,P5e,X1t=se(function(){"use strict";kr(),I5e={name:"od",execute:Y1t},P5e={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0}}),v9={};St(v9,{flagsForFuzzing:function(){return q5e},gunzipCommand:function(){return U5e},gunzipFlagsForFuzzing:function(){return W5e},gzipCommand:function(){return j5e},zcatCommand:function(){return B5e},zcatFlagsForFuzzing:function(){return V5e}});function l_e(e){return e.best?TS.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?TS.Z_BEST_SPEED:TS.Z_DEFAULT_COMPRESSION}function R5e(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};var t=e[3],r=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n=10;if(t&4){if(n+2>e.length)return{originalName:null,mtime:null,headerSize:0};var o=e[n]|e[n+1]<<8;n+=2+o}var i=null;if(t&8){var o10=n;for(;n<e.length&&e[n]!==0;)n++;n<e.length&&(i=new TextDecoder().decode(e.slice(o10,n)),n++)}if(t&16){for(;n<e.length&&e[n]!==0;)n++;n++}return t&2&&(n+=2),{originalName:i,mtime:r>0?new Date(r*1e3):null,headerSize:n}}function M5e(e){if(e.length<4)return 0;var t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function M9(e){return e.length>=2&&e[0]===31&&e[1]===139}function r9(e){return Buffer.from(e).toString("latin1")}function O5e(e){var t,r;return(r=(t=e.limits)==null?void 0:t.maxOutputSize)!=null?r:0}function TW(e,t){if(t>0){if(M5e(e)>t)throw new Error("decompressed data exceeds limit (".concat(t," bytes)"));return AS(e,{maxOutputLength:t})}return AS(e)}function $5e(e,t,r,n,i,o){return _async_to_generator(function(){var a,s,l,c,d,_$u,_$p,_$u1,_$p1,_tmp,u,u10,_$u2,_$m,_$p2,p,_tmp1,_$p3,_$u3,_$p4,h,m,_tmp2,_$m1;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=r.suffix,d=O5e(e);if(t==="-"||t==="")if(c=Uint8Array.from(e.stdin,function(u){return u.charCodeAt(0)}),i){if(!M9(c))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": stdin: not in gzip format\n"),exitCode:1}];try{_$u=TW(c,d);return[2,{stdout:r9(_$u),stderr:"",exitCode:0}]}catch(u){_$p=_instanceof(u,Error)?u.message:"unknown error";return[2,{stdout:"",stderr:"".concat(n,": stdin: ").concat(_$p,"\n"),exitCode:1}]}}else{_$u1=l_e(r),_$p1=IB(c,{level:_$u1});return[2,{stdout:r9(_$p1),stderr:"",exitCode:0}]}s=e.fs.resolvePath(e.cwd,t);_state.label=1;case 1:_state.trys.push([1,7,,8]);return[4,e.fs.stat(s)];case 2:if(!_state.sent().isDirectory)return[3,6];if(!r.recursive)return[3,4];return[4,N5e(e,s,r,n,i,o)];case 3:_tmp=_state.sent();return[3,5];case 4:_tmp=r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t,": is a directory -- ignored\n"),exitCode:1};_state.label=5;case 5:return[2,_tmp];case 6:return[3,8];case 7:u=_state.sent();return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": No such file or directory\n"),exitCode:1}];case 8:_state.trys.push([8,10,,11]);return[4,e.fs.readFileBuffer(s)];case 9:c=_state.sent();return[3,11];case 10:u10=_state.sent();return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": No such file or directory\n"),exitCode:1}];case 11:if(!i)return[3,19];if(!t.endsWith(a))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t,": unknown suffix -- ignored\n"),exitCode:1}];if(!M9(c))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t,": not in gzip format\n"),exitCode:1}];try{_$u2=TW(c,d)}catch(p){_$m=_instanceof(p,Error)?p.message:"unknown error";return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": ").concat(_$m,"\n"),exitCode:1}]}if(o)return[2,{stdout:r9(_$u2),stderr:"",exitCode:0}];if(r.name){_$p2=R5e(c);_$p2.originalName?l=e.fs.resolvePath(e.cwd,_$p2.originalName):l=s.slice(0,-a.length)}else l=s.slice(0,-a.length);if(!!r.force)return[3,15];_state.label=12;case 12:_state.trys.push([12,14,,15]);return[4,e.fs.stat(l)];case 13:return[2,(_state.sent(),{stdout:"",stderr:"".concat(n,": ").concat(l," already exists; not overwritten\n"),exitCode:1})];case 14:p=_state.sent();return[3,15];case 15:return[4,e.fs.writeFile(l,_$u2)];case 16:_state.sent();_tmp1=!r.keep&&!o;if(!_tmp1)return[3,18];return[4,e.fs.rm(s)];case 17:_tmp1=_state.sent();_state.label=18;case 18:if(_tmp1,r.verbose){_$p3=c.length>0?((1-c.length/_$u2.length)*100).toFixed(1):"0.0";return[2,{stdout:"",stderr:"".concat(t,": ").concat(_$p3,"% -- replaced with ").concat(l.split("/").pop(),"\n"),exitCode:0}]}return[2,{stdout:"",stderr:"",exitCode:0}];case 19:if(t.endsWith(a))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t," already has ").concat(a," suffix -- unchanged\n"),exitCode:1}];_$u3=l_e(r);try{_$p4=IB(c,{level:_$u3})}catch(m){h=_instanceof(m,Error)?m.message:"unknown error";return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": ").concat(h,"\n"),exitCode:1}]}if(o)return[2,{stdout:r9(_$p4),stderr:"",exitCode:0}];if(!(l=s+a,!r.force))return[3,23];_state.label=20;case 20:_state.trys.push([20,22,,23]);return[4,e.fs.stat(l)];case 21:return[2,(_state.sent(),{stdout:"",stderr:"".concat(n,": ").concat(l," already exists; not overwritten\n"),exitCode:1})];case 22:m=_state.sent();return[3,23];case 23:return[4,e.fs.writeFile(l,_$p4)];case 24:_state.sent();_tmp2=!r.keep&&!o;if(!_tmp2)return[3,26];return[4,e.fs.rm(s)];case 25:_tmp2=_state.sent();_state.label=26;case 26:if(_tmp2,r.verbose){_$m1=c.length>0?((1-_$p4.length/c.length)*100).toFixed(1):"0.0";return[2,{stdout:"",stderr:"".concat(t,": ").concat(_$m1,"% -- replaced with ").concat(l.split("/").pop(),"\n"),exitCode:0}]}return[2,{stdout:"",stderr:"",exitCode:0}];case 27:return[2]}})})()}function N5e(e,t,r,n,i,o){return _async_to_generator(function(){var a,s,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,m,m10,h,g,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.fs.readdir(t)];case 1:a=_state.sent(),s="",l="",c=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,10,11,12]);_iterator=a[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];d=_step.value;u=e.fs.resolvePath(t,d);return[4,e.fs.stat(u)];case 4:p=_state.sent();if(!p.isDirectory)return[3,6];return[4,N5e(e,u,r,n,i,o)];case 5:m=_state.sent();s+=m.stdout,l+=m.stderr,m.exitCode!==0&&(c=m.exitCode);return[3,8];case 6:if(!p.isFile)return[3,8];m10=r.suffix;if(i&&!d.endsWith(m10)||!i&&d.endsWith(m10))return[3,8];h=u.startsWith("".concat(e.cwd,"/"))?u.slice(e.cwd.length+1):u;return[4,$5e(e,h,r,n,i,o)];case 7:g=_state.sent();s+=g.stdout,l+=g.stderr,g.exitCode!==0&&(c=g.exitCode);_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,3];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2,{stdout:s,stderr:l,exitCode:c}]}})})()}function ext(e,t,r,n){return _async_to_generator(function(){var i,c,d,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(t==="-"||t===""))return[3,1];i=Uint8Array.from(e.stdin,function(c){return c.charCodeAt(0)});return[3,5];case 1:c=e.fs.resolvePath(e.cwd,t);_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,e.fs.readFileBuffer(c)];case 3:i=_state.sent();return[3,5];case 4:d=_state.sent();return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": No such file or directory\n"),exitCode:1}];case 5:if(!M9(i))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t,": not in gzip format\n"),exitCode:1}];o=i.length,a=M5e(i),s=a>0?((1-o/a)*100).toFixed(1):"0.0",l=R5e(i).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return[2,{stdout:"".concat(o.toString().padStart(10)," ").concat(a.toString().padStart(10)," ").concat(s.padStart(5),"% ").concat(l,"\n"),stderr:"",exitCode:0}]}})})()}function txt(e,t,r,n){return _async_to_generator(function(){var i,_$o,a,a9;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(t==="-"||t===""))return[3,1];i=Uint8Array.from(e.stdin,function(o){return o.charCodeAt(0)});return[3,5];case 1:_$o=e.fs.resolvePath(e.cwd,t);_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,e.fs.readFileBuffer(_$o)];case 3:i=_state.sent();return[3,5];case 4:a=_state.sent();return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": No such file or directory\n"),exitCode:1}];case 5:if(!M9(i))return[2,r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:"".concat(n,": ").concat(t,": not in gzip format\n"),exitCode:1}];try{return[2,(TW(i,O5e(e)),r.verbose?{stdout:"",stderr:"".concat(t,": OK\n"),exitCode:0}:{stdout:"",stderr:"",exitCode:0})]}catch(o){a9=_instanceof(o,Error)?o.message:"invalid";return[2,{stdout:"",stderr:"".concat(n,": ").concat(t,": ").concat(a9,"\n"),exitCode:1}]}return[2]}})})()}function Lq(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l,p,m,h,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g,x,err,p10,m10,h10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,g10,x10,err,c,d,u,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,p11,m11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r==="zcat"?F5e:r==="gunzip"?L5e:D5e;if(Vt(e))return[2,Wt(n)];i=Fo(r,e,z5e);if(!i.ok)return[2,(i.error.stderr.includes("unrecognized option"),i.error)];o=i.result.flags,a=i.result.positional,s=r==="gunzip"||r==="zcat"||o.decompress||o.uncompress,l=r==="zcat"||o.stdout||o.toStdout;if(!o.list)return[3,9];a.length===0&&(a=["-"]);p=" compressed uncompressed ratio uncompressed_name\n",m="",h=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=a[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];g=_step.value;return[4,ext(t,g,o,r)];case 3:x=_state.sent();p+=x.stdout,m+=x.stderr,x.exitCode!==0&&(h=x.exitCode);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,{stdout:p,stderr:m,exitCode:h}];case 9:if(!o.test)return[3,18];a.length===0&&(a=["-"]);p10="",m10="",h10=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=10;case 10:_state.trys.push([10,15,16,17]);_iterator1=a[Symbol.iterator]();_state.label=11;case 11:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,14];g10=_step1.value;return[4,txt(t,g10,o,r)];case 12:x10=_state.sent();p10+=x10.stdout,m10+=x10.stderr,x10.exitCode!==0&&(h10=x10.exitCode);_state.label=13;case 13:_iteratorNormalCompletion1=true;return[3,11];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 17:return[2,{stdout:p10,stderr:m10,exitCode:h10}];case 18:a.length===0&&(a=["-"]);c="",d="",u=0;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=19;case 19:_state.trys.push([19,24,25,26]);_iterator2=a[Symbol.iterator]();_state.label=20;case 20:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,23];p11=_step2.value;return[4,$5e(t,p11,o,r,s,l)];case 21:m11=_state.sent();c+=m11.stdout,d+=m11.stderr,m11.exitCode!==0&&(u=m11.exitCode);_state.label=22;case 22:_iteratorNormalCompletion2=true;return[3,20];case 23:return[3,26];case 24:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,26];case 25:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 26:return[2,{stdout:c,stderr:d,exitCode:u}]}})})()}var D5e,L5e,F5e,z5e,j5e,U5e,B5e,q5e,W5e,V5e,Fq=se(function(){"use strict";kr(),zo(),jt(),D5e={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:"Compress FILEs (by default, in-place).\n\nWhen no FILE is given, or when FILE is -, read from standard input.\n\nWith -d, decompress instead.",options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},L5e={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:"Decompress FILEs (by default, in-place).\n\nWhen no FILE is given, or when FILE is -, read from standard input.",options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},F5e={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:"Decompress FILEs to standard output.\n\nWhen no FILE is given, or when FILE is -, read from standard input.",options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},z5e={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}},j5e={name:"gzip",execute:function execute(e,t){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[{}];return[4,Lq(e,t,"gzip")];case 1:return[2,_object_spread_props.apply(void 0,[_object_spread.apply(void 0,_tmp.concat([_state.sent()])),{stdoutEncoding:"binary"}])]}})})()}},U5e={name:"gunzip",execute:function execute(e,t){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[{}];return[4,Lq(e,t,"gunzip")];case 1:return[2,_object_spread_props.apply(void 0,[_object_spread.apply(void 0,_tmp.concat([_state.sent()])),{stdoutEncoding:"binary"}])]}})})()}},B5e={name:"zcat",execute:function execute(e,t){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[{}];return[4,Lq(e,t,"zcat")];case 1:return[2,_object_spread_props.apply(void 0,[_object_spread.apply(void 0,_tmp.concat([_state.sent()])),{stdoutEncoding:"binary"}])]}})})()}},q5e={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},W5e={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},V5e={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0}});function u_e(e,t){if(_instanceof(e,Uint8Array))return e;if(t==="base64")return Uint8Array.from(atob(e),function(r){return r.charCodeAt(0)});if(t==="hex"){var r=new Uint8Array(e.length/2);for(var n=0;n<e.length;n+=2)r[n/2]=parseInt(e.slice(n,n+2),16);return r}if(t==="binary"||t==="latin1"){if(e.length<=65536)return Uint8Array.from(e,function(n){return n.charCodeAt(0)});var r10=new Uint8Array(e.length);for(var n10=0;n10<e.length;n10++)r10[n10]=e.charCodeAt(n10);return r10}return G5e.encode(e)}function AW(e,t){if(t==="base64"){if((typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u")return Buffer.from(e).toString("base64");var r=65536,n="";for(var i=0;i<e.length;i+=r){var _String;var o=e.subarray(i,i+r);n+=(_String=String).fromCharCode.apply(_String,_to_consumable_array(o))}return btoa(n)}if(t==="hex")return Array.from(e).map(function(r){return r.toString(16).padStart(2,"0")}).join("");if(t==="binary"||t==="latin1"){var _String1;if((typeof Buffer==="undefined"?"undefined":_type_of(Buffer))<"u")return Buffer.from(e).toString(t);var r10=65536;if(e.length<=r10)return(_String1=String).fromCharCode.apply(_String1,_to_consumable_array(e));var n10="";for(var i10=0;i10<e.length;i10+=r10){var _String2;var o10=e.subarray(i10,i10+r10);n10+=(_String2=String).fromCharCode.apply(_String2,_to_consumable_array(o10))}return n10}return H5e.decode(e)}function zq(e){var t;if(e!=null)return typeof e=="string"?e:(t=e.encoding)!=null?t:void 0}var G5e,H5e,Z5e=se(function(){"use strict";G5e=new TextEncoder,H5e=new TextDecoder});function rxt(e){var t=e.indexOf("=");if(t>=0){var r=e.slice(0,t),n=e.slice(t+1);return r?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n)):encodeURIComponent(n)}return encodeURIComponent(e)}function c_e(e){var t=e.indexOf("=");if(t<0)return null;var r=e.slice(0,t),n=e.slice(t+1),i,o,a=n.match(/;type=([^;]+)$/);a&&(o=a[1],n=n.slice(0,-a[0].length));var s=n.match(/;filename=([^;]+)/);return s&&(i=s[1],n=n.replace(s[0],"")),(n.startsWith("@")||n.startsWith("<"))&&(i=i!=null?i:n.slice(1).split("/").pop()),{name:r,value:n,filename:i,contentType:o}}function nxt(e,t){var i;var r="----CurlFormBoundary".concat(Date.now().toString(36)),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=o.value;if(a.startsWith("@")||a.startsWith("<")){var l=a.slice(1);a=(i=t.get(l))!=null?i:""}var s="--".concat(r,"\r\n");o.filename?(s+='Content-Disposition: form-data; name="'.concat(o.name,'"; filename="').concat(o.filename,'"\r\n'),o.contentType&&(s+="Content-Type: ".concat(o.contentType,"\r\n"))):s+='Content-Disposition: form-data; name="'.concat(o.name,'"\r\n'),s+="\r\n".concat(a,"\r\n"),n.push(s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n.push("--".concat(r,"--\r\n")),{body:n.join(""),boundary:r}}var K5e=se(function(){"use strict"}),Q5e,ixt=se(function(){"use strict";Q5e={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data (DATA=@file reads from file, strips newlines)"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data (DATA=@file reads file verbatim)"," --data-urlencode DATA URL-encode and POST data (supports @file and name@file)","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]}});function B0(e,t,r){r.allowFile&&t.startsWith("@")?(e.dataFile={mode:r.binary?"binary":"ascii",path:t.slice(1)},e.data=void 0):(e.data=t,e.dataFile=void 0),r.binary&&(e.dataBinary=!0)}function d_e(e,t){if(t.startsWith("@")){e.urlencodeFiles.push({path:t.slice(1)});return}var r=t.indexOf("@"),n=t.indexOf("=");if(r>0&&(n<0||r<n)){e.urlencodeFiles.push({name:t.slice(0,r),path:t.slice(r+1)});return}e.data=(e.data?"".concat(e.data,"&"):"")+rxt(t)}function oxt(e){var n,i,o,a,s,l,c,d,u,p,m;var t={method:"GET",headers:new vV,dataBinary:!1,urlencodeFiles:[],formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},r=!1;for(var h=0;h<e.length;h++){var g=e[h];if(g==="-X"||g==="--request")t.method=(n=e[++h])!=null?n:"GET";else if(g.startsWith("-X"))t.method=g.slice(2);else if(g.startsWith("--request="))t.method=g.slice(10);else if(g==="-H"||g==="--header"){var x=e[++h];if(x){var v=x.indexOf(":");if(v>0){var y=x.slice(0,v).trim(),_=x.slice(v+1).trim();t.headers.append(y,_)}}}else if(g.startsWith("--header=")){var x10=g.slice(9),v10=x10.indexOf(":");if(v10>0){var y10=x10.slice(0,v10).trim(),_10=x10.slice(v10+1).trim();t.headers.append(y10,_10)}}else if(g==="-d"||g==="--data")B0(t,(i=e[++h])!=null?i:"",{binary:!1,allowFile:!0}),r=!0;else if(g==="--data-raw")B0(t,(o=e[++h])!=null?o:"",{binary:!1,allowFile:!1}),r=!0;else if(g.startsWith("-d"))B0(t,g.slice(2),{binary:!1,allowFile:!0}),r=!0;else if(g.startsWith("--data="))B0(t,g.slice(7),{binary:!1,allowFile:!0}),r=!0;else if(g.startsWith("--data-raw="))B0(t,g.slice(11),{binary:!1,allowFile:!1}),r=!0;else if(g==="--data-binary")B0(t,(a=e[++h])!=null?a:"",{binary:!0,allowFile:!0}),r=!0;else if(g.startsWith("--data-binary="))B0(t,g.slice(14),{binary:!0,allowFile:!0}),r=!0;else if(g==="--data-urlencode")d_e(t,(s=e[++h])!=null?s:""),r=!0;else if(g.startsWith("--data-urlencode="))d_e(t,g.slice(17)),r=!0;else if(g==="-F"||g==="--form"){var x11=(l=e[++h])!=null?l:"",v11=c_e(x11);v11&&t.formFields.push(v11),r=!0}else if(g.startsWith("--form=")){var x12=g.slice(7),v12=c_e(x12);v12&&t.formFields.push(v12),r=!0}else if(g==="-u"||g==="--user")t.user=e[++h];else if(g.startsWith("-u"))t.user=g.slice(2);else if(g.startsWith("--user="))t.user=g.slice(7);else if(g==="-A"||g==="--user-agent")t.headers.set("User-Agent",(c=e[++h])!=null?c:"");else if(g.startsWith("-A"))t.headers.set("User-Agent",g.slice(2));else if(g.startsWith("--user-agent="))t.headers.set("User-Agent",g.slice(13));else if(g==="-e"||g==="--referer")t.headers.set("Referer",(d=e[++h])!=null?d:"");else if(g.startsWith("-e"))t.headers.set("Referer",g.slice(2));else if(g.startsWith("--referer="))t.headers.set("Referer",g.slice(10));else if(g==="-b"||g==="--cookie")t.headers.set("Cookie",(u=e[++h])!=null?u:"");else if(g.startsWith("-b"))t.headers.set("Cookie",g.slice(2));else if(g.startsWith("--cookie="))t.headers.set("Cookie",g.slice(9));else if(g==="-c"||g==="--cookie-jar")t.cookieJar=e[++h];else if(g.startsWith("--cookie-jar="))t.cookieJar=g.slice(13);else if(g==="-T"||g==="--upload-file")t.uploadFile=e[++h],t.method==="GET"&&(t.method="PUT");else if(g.startsWith("--upload-file="))t.uploadFile=g.slice(14),t.method==="GET"&&(t.method="PUT");else if(g==="-m"||g==="--max-time"){var x13=parseFloat((p=e[++h])!=null?p:"0");!Number.isNaN(x13)&&x13>0&&(t.timeoutMs=x13*1e3)}else if(g.startsWith("--max-time=")){var x14=parseFloat(g.slice(11));!Number.isNaN(x14)&&x14>0&&(t.timeoutMs=x14*1e3)}else if(g==="--connect-timeout"){var x15=parseFloat((m=e[++h])!=null?m:"0");!Number.isNaN(x15)&&x15>0&&t.timeoutMs===void 0&&(t.timeoutMs=x15*1e3)}else if(g.startsWith("--connect-timeout=")){var x16=parseFloat(g.slice(18));!Number.isNaN(x16)&&x16>0&&t.timeoutMs===void 0&&(t.timeoutMs=x16*1e3)}else if(g==="-o"||g==="--output")t.outputFile=e[++h];else if(g.startsWith("--output="))t.outputFile=g.slice(9);else if(g==="-O"||g==="--remote-name")t.useRemoteName=!0;else if(g==="-I"||g==="--head")t.headOnly=!0,t.method="HEAD";else if(g==="-i"||g==="--include")t.includeHeaders=!0;else if(g==="-s"||g==="--silent")t.silent=!0;else if(g==="-S"||g==="--show-error")t.showError=!0;else if(g==="-f"||g==="--fail")t.failSilently=!0;else if(g==="-L"||g==="--location")t.followRedirects=!0;else if(g==="--max-redirs")h++;else if(!g.startsWith("--max-redirs="))if(g==="-w"||g==="--write-out")t.writeOut=e[++h];else if(g.startsWith("--write-out="))t.writeOut=g.slice(12);else if(g==="-v"||g==="--verbose")t.verbose=!0;else{if(g.startsWith("--")&&g!=="--")return fr("curl",g);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(g.startsWith("-")&&g!=="-")try{for(var _iterator=g.slice(1)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var x17=_step.value;switch(x17){case"s":t.silent=!0;break;case"S":t.showError=!0;break;case"f":t.failSilently=!0;break;case"L":t.followRedirects=!0;break;case"I":t.headOnly=!0,t.method="HEAD";break;case"i":t.includeHeaders=!0;break;case"O":t.useRemoteName=!0;break;case"v":t.verbose=!0;break;default:return fr("curl","-".concat(x17))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else g.startsWith("-")||(t.url=g)}}return r&&t.method==="GET"&&(t.method="POST"),t}var axt=se(function(){"use strict";K9(),jt(),K5e()});function p_e(e){return Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return"".concat(t,": ").concat(r)}).join("\r\n")}function sxt(e){try{return new URL(e).pathname.split("/").pop()||"index.html"}catch(t){return"index.html"}}function J5e(e,t){var r=e;return r=r.replace(/%\{http_code\}/g,String(t.status)),r=r.replace(/%\{content_type\}/g,t.headers["content-type"]||""),r=r.replace(/%\{url_effective\}/g,t.url),r=r.replace(/%\{size_download\}/g,String(t.bodyLength)),r=r.replace(/\\n/g,"\n"),r}var lxt=se(function(){"use strict"}),Y5e={};St(Y5e,{curlCommand:function(){return X5e}});function uxt(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.dataFile)return[3,2];r=t.fs.resolvePath(t.cwd,e.dataFile.path);return[4,t.fs.readFile(r)];case 1:n=_state.sent();return[2,(e.dataFile.mode==="ascii"&&(n=n.replace(/[\r\n]/g,"")),e.data?"".concat(n,"&").concat(e.data):n)];case 2:return[2,e.data]}})})()}function cxt(e,t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.urlencodeFiles.length===0)return[2,r];n=r?[r]:[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=e.urlencodeFiles[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];i=_step.value;o=t.fs.resolvePath(t.cwd,i.path);return[4,t.fs.readFile(o)];case 3:a=_state.sent(),s=encodeURIComponent(a);n.push(i.name?"".concat(encodeURIComponent(i.name),"=").concat(s):s);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,n.join("&")]}})})()}function dxt(e,t){return _async_to_generator(function(){var n,_tmp,n10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,s,l,l10,err,_nxt,i,o,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.uploadFile)return[3,2];n=t.fs.resolvePath(t.cwd,e.uploadFile);_tmp={};return[4,t.fs.readFile(n)];case 1:return[2,(_tmp.body=_state.sent(),_tmp)];case 2:if(!(e.formFields.length>0))return[3,13];n10=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,10,11,12]);_iterator=e.formFields[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];a=_step.value;if(!(a.value.startsWith("@")||a.value.startsWith("<")))return[3,8];s=t.fs.resolvePath(t.cwd,a.value.slice(1));_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,t.fs.readFile(s)];case 6:l=_state.sent();n10.set(a.value.slice(1),l);return[3,8];case 7:l10=_state.sent();n10.set(a.value.slice(1),"");return[3,8];case 8:_iteratorNormalCompletion=true;return[3,4];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:_nxt=nxt(e.formFields,n10),i=_nxt.body,o=_nxt.boundary;return[2,{body:i,contentType:"multipart/form-data; boundary=".concat(o)}];case 13:return[4,uxt(e,t)];case 14:r=_state.sent();return[4,cxt(e,t,r)];case 15:return[2,(r=_state.sent(),r!==void 0?{body:r}:{})]}})})()}function pxt(e,t){var r=new vV(e.headers);if(e.user){var n=Buffer.from(e.user).toString("base64");r.set("Authorization","Basic ".concat(n))}return t&&!r.has("Content-Type")&&r.set("Content-Type",t),r}function fxt(e,t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.cookieJar)return[2];n=t["set-cookie"];if(!n)return[2];i=r.fs.resolvePath(r.cwd,e.cookieJar);return[4,r.fs.writeFile(i,n)];case 1:_state.sent();return[2]}})})()}function mxt(e){return AW(e,"binary")}function hxt(e,t,r){var n="";if(e.verbose){n+="> ".concat(e.method," ").concat(r,"\n");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.headers[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];n+="> ".concat(i,": ").concat(o,"\n")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n+=">\n",n+="< HTTP/1.1 ".concat(t.status," ").concat(t.statusText,"\n");var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries(t.headers)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,2),i10=_step_value1[0],o10=_step_value1[1];n+="< ".concat(i10,": ").concat(o10,"\n")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}n+="<\n"}return e.includeHeaders&&!e.verbose&&(n+="HTTP/1.1 ".concat(t.status," ").concat(t.statusText,"\r\n"),n+=p_e(t.headers),n+="\r\n\r\n"),e.headOnly?e.includeHeaders||e.verbose||(n+="HTTP/1.1 ".concat(t.status," ").concat(t.statusText,"\r\n"),n+=p_e(t.headers),n+="\r\n"):n+=mxt(t.body),e.writeOut&&(n+=J5e(e.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.byteLength})),n}var X5e,gxt=se(function(){"use strict";Z5e(),ic(),K9(),jt(),K5e(),ixt(),axt(),lxt(),X5e={name:"curl",execute:function execute(e,t){return _async_to_generator(function(){var r,n,i,_ref,_$o,a,s,l,c,d,u,o,a9,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(Vt(e))return[2,Wt(Q5e)];r=oxt(e);if("exitCode"in r)return[2,r];n=r;if(!n.url)return[2,{stdout:"",stderr:"curl: no URL specified\n",exitCode:2}];if(!t.fetch)return[2,{stdout:"",stderr:"curl: internal error: fetch not available\n",exitCode:1}];i=n.url;i.match(/^https?:\/\//)||(i="https://".concat(i));_state.label=1;case 1:_state.trys.push([1,7,,8]);return[4,dxt(n,t)];case 2:_ref=_state.sent(),_$o=_ref.body,a=_ref.contentType,s=pxt(n,a);return[4,t.fetch(i,{method:n.method,headers:s,body:_$o,followRedirects:n.followRedirects,timeoutMs:n.timeoutMs})];case 3:l=_state.sent();return[4,fxt(n,l.headers,t)];case 4:if(_state.sent(),n.failSilently&&l.status>=400)return[2,{stdout:"",stderr:n.showError||!n.silent?"curl: (22) The requested URL returned error: ".concat(l.status,"\n"):"",exitCode:22}];c=hxt(n,l,i);if(!(n.outputFile||n.useRemoteName))return[3,6];d=n.outputFile||sxt(i),u=t.fs.resolvePath(t.cwd,d);return[4,t.fs.writeFile(u,n.headOnly?"":l.body)];case 5:_state.sent(),n.verbose||(c=""),n.writeOut&&(c=J5e(n.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength}));_state.label=6;case 6:return[2,{stdout:c,stderr:"",exitCode:0,stdoutKind:"bytes"}];case 7:o=_state.sent();a9=cu(o),s10=1;return[2,(a9.includes("Network access denied")?s10=7:a9.includes("HTTP method")&&a9.includes("not allowed")?s10=3:a9.includes("Redirect target not in allow-list")||a9.includes("Too many redirects")?s10=47:a9.includes("aborted")&&(s10=28),{stdout:"",stderr:!n.silent||n.showError?"curl: (".concat(s10,") ").concat(a9,"\n"):"",exitCode:s10})];case 8:return[2]}})})()}}});function f_e(e){var t=e.pid,r=e.ppid,n=e.uid,i=e.gid;return"Name: bash\nState: R (running)\nPid: ".concat(t,"\nPPid: ").concat(r,"\nUid: ").concat(n," ").concat(n," ").concat(n," ").concat(n,"\nGid: ").concat(i," ").concat(i," ").concat(i," ").concat(i,"\n")}var eke,tke,rke=se(function(){"use strict";eke="5.1.0(1)-release",tke="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT"}),Pt,h_=se(function(){"use strict";Pt={script:function script(e){return{type:"Script",statements:e}},statement:function statement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;var o={type:"Statement",pipelines:e,operators:t,background:r};return n&&(o.deferredError=n),i!==void 0&&(o.sourceText=i),o},pipeline:function pipeline(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4?arguments[4]:void 0;return{type:"Pipeline",commands:e,negated:t,timed:r,timePosix:n,pipeStderr:i}},simpleCommand:function simpleCommand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return{type:"SimpleCommand",name:e,args:t,assignments:r,redirections:n}},word:function word(e){return{type:"Word",parts:e}},literal:function literal(e){return{type:"Literal",value:e}},singleQuoted:function singleQuoted(e){return{type:"SingleQuoted",value:e}},doubleQuoted:function doubleQuoted(e){return{type:"DoubleQuoted",parts:e}},escaped:function escaped(e){return{type:"Escaped",value:e}},parameterExpansion:function parameterExpansion(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return{type:"ParameterExpansion",parameter:e,operation:t}},commandSubstitution:function commandSubstitution(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{type:"CommandSubstitution",body:e,legacy:t}},arithmeticExpansion:function arithmeticExpansion(e){return{type:"ArithmeticExpansion",expression:e}},assignment:function assignment(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return{type:"Assignment",name:e,value:t,append:r,array:n}},redirection:function redirection(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;var i={type:"Redirection",fd:r,operator:e,target:t};return n&&(i.fdVariable=n),i},hereDoc:function hereDoc(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return{type:"HereDoc",delimiter:e,content:t,stripTabs:r,quoted:n}},ifNode:function ifNode(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return{type:"If",clauses:e,elseBody:t,redirections:r}},forNode:function forNode(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return{type:"For",variable:e,words:t,body:r,redirections:n}},whileNode:function whileNode(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return{type:"While",condition:e,body:t,redirections:r}},untilNode:function untilNode(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return{type:"Until",condition:e,body:t,redirections:r}},caseNode:function caseNode(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return{type:"Case",word:e,items:t,redirections:r}},caseItem:function caseItem(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:";;";return{type:"CaseItem",patterns:e,body:t,terminator:r}},subshell:function subshell(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return{type:"Subshell",body:e,redirections:t}},group:function group(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return{type:"Group",body:e,redirections:t}},functionDef:function functionDef(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;return{type:"FunctionDef",name:e,body:t,redirections:r,sourceFile:n}},conditionalCommand:function conditionalCommand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return{type:"ConditionalCommand",expression:e,redirections:t,line:r}},arithmeticCommand:function arithmeticCommand(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return{type:"ArithmeticCommand",expression:e,redirections:t,line:r}}}});function xxt(e,t){var r=e.length,n=t+3,i=2,o=!1,a=!1;for(;n<r&&i>0;){var s=e[n];if(o){s==="'"&&(o=!1),n++;continue}if(a){if(s==="\\"){n+=2;continue}s==='"'&&(a=!1),n++;continue}if(s==="'"){o=!0,n++;continue}if(s==='"'){a=!0,n++;continue}if(s==="\\"){n+=2;continue}if(s==="("){i++,n++;continue}if(s===")"){if(i--,i===1){var l=n+1;return!(l<r&&e[l]===")")}if(i===0)return!1;n++;continue}if(i===1&&(s==="|"&&n+1<r&&e[n+1]==="|"||s==="&"&&n+1<r&&e[n+1]==="&"||s==="|"&&n+1<r&&e[n+1]!=="|"))return!0;n++}return!1}function nke(e,t){var r="",n=t,i=function(o){return o===" "||o===" "||o==="\n"||o===";"||o==="&"||o==="|"||o==="<"||o===">"||o==="("||o===")"};for(;n<e.length;){var o=e[n];if(o==="'"){for(n++;n<e.length&&e[n]!=="'";)r+=e[n],n++;n<e.length&&n++;continue}if(o==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&n+1<e.length&&n++,r+=e[n],n++;n<e.length&&n++;continue}if(o==="\\"&&n+1<e.length){r+=e[n+1],n+=2;continue}if(i(o))break;r+=o,n++}return{delim:r,endPos:n}}function yxt(e,t,r){var n=t+1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,i=_step_value.delim,o=_step_value.stripTabs;for(;;){if(n>=e.length)return e.length;var a=e.indexOf("\n",n);a===-1&&(a=e.length);var s=e.slice(n,a);if(o&&(s=s.replace(/^\t+/,"")),s===i){n=a+1;break}if(a>=e.length)return e.length;n=a+1}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Math.min(n,e.length)}function vxt(e,t,r,n){var i=t+2,o=1,a=i,s=!1,l=!1,c=0,d=!1,u="",p=[],m=0;for(;a<e.length&&o>0;){var x=e[a];if(s)x==="'"&&(s=!1);else if(l)x==="\\"&&a+1<e.length?a++:x==='"'&&(l=!1);else{if(x==="("&&e[a+1]==="("?m++:x===")"&&e[a+1]===")"&&m>0&&m--,m===0&&x==="<"&&e[a+1]==="<"&&e[a+2]!=="<"){var v=a+2,y=!1;for(e[v]==="-"&&(y=!0,v++);e[v]===" "||e[v]===" ";)v++;var _nke=nke(e,v),_=_nke.delim,b=_nke.endPos;if(_.length>0){p.push({delim:_,stripTabs:y}),u="",a=b;continue}}if(x==="\n"&&p.length>0){var v10=yxt(e,a,p);p.length=0,u="",a=v10;continue}x==="'"?(s=!0,u=""):x==='"'?(l=!0,u=""):x==="\\"&&a+1<e.length?(a++,u=""):/[a-zA-Z_]/.test(x)?u+=x:(u==="case"?(c++,d=!1):u==="in"&&c>0?d=!0:u==="esac"&&c>0&&(c--,d=!1),u="",x==="("?a>0&&e[a-1]==="$"?o++:d||o++:x===")"?d?d=!1:o--:x===";"&&c>0&&a+1<e.length&&e[a+1]===";"&&(d=!0))}o>0&&a++}o>0&&n("unexpected EOF while looking for matching `)'");var h=e.slice(i,a),g=r().parse(h);return{part:Pt.commandSubstitution(g,!1),endIndex:a+1}}function _xt(e,t,r,n,i){var o=t+1,a="";for(;o<e.length&&e[o]!=="`";)if(e[o]==="\\"){var l=e[o+1];l==="$"||l==="`"||l==="\\"||l==="\n"||r&&l==='"'?(l!=="\n"&&(a+=l),o+=2):(a+=e[o],o++)}else a+=e[o],o++;o>=e.length&&i("unexpected EOF while looking for matching ``'");var s=n().parse(a);return{part:Pt.commandSubstitution(s,!0),endIndex:o+1}}var ike=se(function(){"use strict";h_()});function m_e(e){var t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return!1;var r=e.slice(t[0].length);if(r===""||r==="+")return!0;if(r[0]==="["){var n=0,i=0;for(;i<r.length;i++)if(r[i]==="[")n++;else if(r[i]==="]"&&(n--,n===0))break;if(n!==0||i>=r.length)return!1;var o=r.slice(i+1);return o===""||o==="+"}return!1}function h_e(e){var t=0;for(var r=0;r<e.length;r++){var n=e[r];if(n==="[")t++;else if(n==="]")t--;else{if(t===0&&n==="=")return r;if(t===0&&n==="+"&&e[r+1]==="=")return r+1}}return-1}function bxt(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function g_e(e){return e===" "||e===" "||e==="\n"||e===";"||e==="&"||e==="|"||e==="("||e===")"||e==="<"||e===">"}var x_e,F,e_,jq,y_e,v_e,__e,oke,d1=se(function(){"use strict";ike(),x_e=0xa00000,function(e){e.EOF="EOF",e.NEWLINE="NEWLINE",e.SEMICOLON="SEMICOLON",e.AMP="AMP",e.PIPE="PIPE",e.PIPE_AMP="PIPE_AMP",e.AND_AND="AND_AND",e.OR_OR="OR_OR",e.BANG="BANG",e.LESS="LESS",e.GREAT="GREAT",e.DLESS="DLESS",e.DGREAT="DGREAT",e.LESSAND="LESSAND",e.GREATAND="GREATAND",e.LESSGREAT="LESSGREAT",e.DLESSDASH="DLESSDASH",e.CLOBBER="CLOBBER",e.TLESS="TLESS",e.AND_GREAT="AND_GREAT",e.AND_DGREAT="AND_DGREAT",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.DSEMI="DSEMI",e.SEMI_AND="SEMI_AND",e.SEMI_SEMI_AND="SEMI_SEMI_AND",e.DBRACK_START="DBRACK_START",e.DBRACK_END="DBRACK_END",e.DPAREN_START="DPAREN_START",e.DPAREN_END="DPAREN_END",e.IF="IF",e.THEN="THEN",e.ELSE="ELSE",e.ELIF="ELIF",e.FI="FI",e.FOR="FOR",e.WHILE="WHILE",e.UNTIL="UNTIL",e.DO="DO",e.DONE="DONE",e.CASE="CASE",e.ESAC="ESAC",e.IN="IN",e.FUNCTION="FUNCTION",e.SELECT="SELECT",e.TIME="TIME",e.COPROC="COPROC",e.WORD="WORD",e.NAME="NAME",e.NUMBER="NUMBER",e.ASSIGNMENT_WORD="ASSIGNMENT_WORD",e.FD_VARIABLE="FD_VARIABLE",e.COMMENT="COMMENT",e.HEREDOC_CONTENT="HEREDOC_CONTENT"}(F||(F={})),e_=/*#__PURE__*/function(Error1){_inherits(e_1,Error1);function e_1(t,r,n){_class_call_check(this,e_1);var _this;_this=_call_super(this,e_1,["line ".concat(r,": ").concat(t)]);A(_this,"line");A(_this,"column");_this.line=r,_this.column=n,_this.name="LexerError";return _this}return e_1}(_wrap_native_super(Error)),jq=new Map([["if",F.IF],["then",F.THEN],["else",F.ELSE],["elif",F.ELIF],["fi",F.FI],["for",F.FOR],["while",F.WHILE],["until",F.UNTIL],["do",F.DO],["done",F.DONE],["case",F.CASE],["esac",F.ESAC],["in",F.IN],["function",F.FUNCTION],["select",F.SELECT],["time",F.TIME],["coproc",F.COPROC]]),y_e=[[";",";","&",F.SEMI_SEMI_AND],["<","<","<",F.TLESS],["&",">",">",F.AND_DGREAT]],v_e=[["[","[",F.DBRACK_START],["]","]",F.DBRACK_END],["(","(",F.DPAREN_START],[")",")",F.DPAREN_END],["&","&",F.AND_AND],["|","|",F.OR_OR],[";",";",F.DSEMI],[";","&",F.SEMI_AND],["|","&",F.PIPE_AMP],[">",">",F.DGREAT],["<","&",F.LESSAND],[">","&",F.GREATAND],["<",">",F.LESSGREAT],[">","|",F.CLOBBER],["&",">",F.AND_GREAT]],__e=new Map([["|",F.PIPE],["&",F.AMP],[";",F.SEMICOLON],["(",F.LPAREN],[")",F.RPAREN],["<",F.LESS],[">",F.GREAT]]),oke=/*#__PURE__*/function(){function oke1(e,t){_class_call_check(this,oke1);A(this,"input");A(this,"pos",0);A(this,"line",1);A(this,"column",1);A(this,"tokens",[]);A(this,"pendingHeredocs",[]);A(this,"dparenDepth",0);A(this,"maxHeredocSize");var r;this.input=e,this.maxHeredocSize=(r=t==null?void 0:t.maxHeredocSize)!=null?r:x_e}_create_class(oke1,[{key:"tokenize",value:function tokenize(){var e=this.input.length,t=this.tokens,r=this.pendingHeredocs;for(;this.pos<e;){if(r.length>0&&t.length>0&&t[t.length-1].type===F.NEWLINE){this.readHeredocContent();continue}if(this.skipWhitespace(),this.pos>=e)break;var n=this.nextToken();n&&t.push(n)}return t.push({type:F.EOF,value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),t}},{key:"skipWhitespace",value:function skipWhitespace(){var e=this.input,t=e.length,r=this.pos,n=this.column,i=this.line;for(;r<t;){var o=e[r];if(o===" "||o===" ")r++,n++;else if(o==="\\"&&e[r+1]==="\n")r+=2,i++,n=1;else break}this.pos=r,this.column=n,this.line=i}},{key:"nextToken",value:function nextToken(){var e=this.input,t=this.pos,r=this.line,n=this.column,i=e[t],o=e[t+1],a=e[t+2];if(i==="#"&&this.dparenDepth===0)return this.readComment(t,r,n);if(i==="\n")return this.pos=t+1,this.line++,this.column=1,{type:F.NEWLINE,value:"\n",start:t,end:t+1,line:r,column:n};if(i==="<"&&o==="<"&&a==="-")return this.pos=t+3,this.column=n+3,this.registerHeredocFromLookahead(!0),this.makeToken(F.DLESSDASH,"<<-",t,r,n);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=y_e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,4),l=_step_value[0],c=_step_value[1],d=_step_value[2],u=_step_value[3];if(i===l&&o===c&&a===d)return this.pos=t+3,this.column=n+3,this.makeToken(u,l+c+d,t,r,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(i==="<"&&o==="<")return this.pos=t+2,this.column=n+2,this.registerHeredocFromLookahead(!1),this.makeToken(F.DLESS,"<<",t,r,n);if(i==="("&&o==="(")return this.dparenDepth>0?(this.pos=t+1,this.column=n+1,this.dparenDepth++,this.makeToken(F.LPAREN,"(",t,r,n)):this.looksLikeNestedSubshells(t+2)||this.dparenClosesWithSpacedParens(t+2)?(this.pos=t+1,this.column=n+1,this.makeToken(F.LPAREN,"(",t,r,n)):(this.pos=t+2,this.column=n+2,this.dparenDepth=1,this.makeToken(F.DPAREN_START,"((",t,r,n));if(i===")"&&o===")")return this.dparenDepth===1?(this.pos=t+2,this.column=n+2,this.dparenDepth=0,this.makeToken(F.DPAREN_END,"))",t,r,n)):this.dparenDepth>1?(this.pos=t+1,this.column=n+1,this.dparenDepth--,this.makeToken(F.RPAREN,")",t,r,n)):(this.pos=t+1,this.column=n+1,this.makeToken(F.RPAREN,")",t,r,n));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=v_e[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,3),l10=_step_value1[0],c10=_step_value1[1],d10=_step_value1[2];if(!(l10==="("&&c10==="("||l10===")"&&c10===")")&&!(this.dparenDepth>0&&l10===";"&&(d10===F.DSEMI||d10===F.SEMI_AND||d10===F.SEMI_SEMI_AND))&&i===l10&&o===c10){if(d10===F.DBRACK_START||d10===F.DBRACK_END){var u10=e[t+2];if(u10!==void 0&&u10!==" "&&u10!==" "&&u10!=="\n"&&u10!==";"&&u10!=="&"&&u10!=="|"&&u10!=="("&&u10!==")"&&u10!=="<"&&u10!==">")break}return this.pos=t+2,this.column=n+2,this.makeToken(d10,l10+c10,t,r,n)}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(i==="("&&this.dparenDepth>0)return this.pos=t+1,this.column=n+1,this.dparenDepth++,this.makeToken(F.LPAREN,"(",t,r,n);if(i===")"&&this.dparenDepth>1)return this.pos=t+1,this.column=n+1,this.dparenDepth--,this.makeToken(F.RPAREN,")",t,r,n);var s=__e.get(i);if(s!==void 0)return this.pos=t+1,this.column=n+1,this.makeToken(s,i,t,r,n);if(i==="{"){var l11=this.scanFdVariable(t);return l11!==null?(this.pos=l11.end,this.column=n+(l11.end-t),{type:F.FD_VARIABLE,value:l11.varname,start:t,end:l11.end,line:r,column:n}):o==="}"?(this.pos=t+2,this.column=n+2,{type:F.WORD,value:"{}",start:t,end:t+2,line:r,column:n,quoted:!1,singleQuoted:!1}):this.scanBraceExpansion(t)!==null?this.readWordWithBraceExpansion(t,r,n):this.scanLiteralBraceWord(t)!==null?this.readWordWithBraceExpansion(t,r,n):o!==void 0&&o!==" "&&o!==" "&&o!=="\n"?this.readWord(t,r,n):(this.pos=t+1,this.column=n+1,this.makeToken(F.LBRACE,"{",t,r,n))}return i==="}"?this.isWordCharFollowing(t+1)?this.readWord(t,r,n):(this.pos=t+1,this.column=n+1,this.makeToken(F.RBRACE,"}",t,r,n)):i==="!"?o==="="?(this.pos=t+2,this.column=n+2,this.makeToken(F.WORD,"!=",t,r,n)):(this.pos=t+1,this.column=n+1,this.makeToken(F.BANG,"!",t,r,n)):this.readWord(t,r,n)}},{key:"looksLikeNestedSubshells",value:function looksLikeNestedSubshells(e){var t=this.input,r=t.length,n=e;for(;n<r&&(t[n]===" "||t[n]===" ");)n++;if(n>=r)return!1;var i=t[n];if(i==="(")return this.looksLikeNestedSubshells(n+1);var o=/[a-zA-Z_]/.test(i),a=i==="!"||i==="[";if(!o&&!a)return!1;var s=n;for(;s<r&&/[a-zA-Z0-9_\-.]/.test(t[s]);)s++;if(s===n)return a;var l=s;for(;l<r&&(t[l]===" "||t[l]===" ");)l++;if(l>=r)return!1;var c=t[l];if(c==="="&&t[l+1]!=="="||c==="\n"||s===l&&/[+\-*/%<>&|^!~?:]/.test(c)&&c!=="-"||c===")"&&t[l+1]===")")return!1;if(l>s&&(c==="-"||c==='"'||c==="'"||c==="$"||/[a-zA-Z_/.]/.test(c))){var d=l;for(;d<r&&t[d]!=="\n";){if(t[d]===")")return!0;d++}return!1}if(c===")"){var d10=l+1;for(;d10<r&&(t[d10]===" "||t[d10]===" ");)d10++;if(t[d10]==="|"&&t[d10+1]==="|"||t[d10]==="&"&&t[d10+1]==="&"||t[d10]===";"||t[d10]==="|"&&t[d10+1]!=="|")return!0}return!1}},{key:"makeToken",value:function makeToken(e,t,r,n,i){return{type:e,value:t,start:r,end:this.pos,line:n,column:i}}},{key:"readComment",value:function readComment(e,t,r){var n=this.input,i=n.length,o=this.pos;for(;o<i&&n[o]!=="\n";)o++;var a=n.slice(e,o);return this.pos=o,this.column=r+(o-e),{type:F.COMMENT,value:a,start:e,end:o,line:t,column:r}}},{key:"readWord",value:function readWord(e,t,r){var n=this.input,i=n.length,o=this.pos,a=o;for(;o<i;){var y=n[o];if(y===" "||y===" "||y==="\n"||y===";"||y==="&"||y==="|"||y==="("||y===")"||y==="<"||y===">"||y==="'"||y==='"'||y==="\\"||y==="$"||y==="`"||y==="{"||y==="}"||y==="~"||y==="*"||y==="?"||y==="[")break;o++}if(o>a){var y10=n[o];if(!(y10==="("&&o>a&&"@*+?!".includes(n[o-1]))&&(o>=i||y10===" "||y10===" "||y10==="\n"||y10===";"||y10==="&"||y10==="|"||y10==="("||y10===")"||y10==="<"||y10===">")){var _=n.slice(a,o);this.pos=o,this.column=r+(o-a);var b=jq.get(_);if(b!==void 0)return{type:b,value:_,start:e,end:o,line:t,column:r};var w=h_e(_);return w>0&&m_e(_.slice(0,w))?{type:F.ASSIGNMENT_WORD,value:_,start:e,end:o,line:t,column:r}:/^[0-9]+$/.test(_)?{type:F.NUMBER,value:_,start:e,end:o,line:t,column:r}:/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(_)?{type:F.NAME,value:_,start:e,end:o,line:t,column:r,quoted:!1,singleQuoted:!1}:{type:F.WORD,value:_,start:e,end:o,line:t,column:r,quoted:!1,singleQuoted:!1}}}o=this.pos;var s=this.column,l=this.line,c="",d=!1,u=!1,p=!1,m=!1,h=n[o]==='"'||n[o]==="'",g=!1,x=0;for(;o<i;){var y11=n[o];if(!p&&!m){if(y11==="("&&c.length>0&&"@*+?!".includes(c[c.length-1])){var _10=this.scanExtglobPattern(o);if(_10!==null){c+=_10.content,o=_10.end,s+=_10.content.length;continue}}if(y11==="["&&x===0){if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c)){var _11=o+1<i?n[o+1]:"";if(_11==="^"||_11==="!"){c+=y11,o++,s++;continue}x=1,c+=y11,o++,s++;continue}}else if(y11==="["&&x>0){c.length>0&&c[c.length-1]!=="\\"&&x++,c+=y11,o++,s++;continue}else if(y11==="]"&&x>0){c.length>0&&c[c.length-1]!=="\\"&&x--,c+=y11,o++,s++;continue}if(x>0){if(y11==="\n")break;c+=y11,o++,s++;continue}if(y11===" "||y11===" "||y11==="\n"||y11===";"||y11==="&"||y11==="|"||y11==="("||y11===")"||y11==="<"||y11===">")break}if(y11==="$"&&o+1<i&&n[o+1]==="'"&&!p&&!m){for(c+="$'",o+=2,s+=2;o<i&&n[o]!=="'";)n[o]==="\\"&&o+1<i?(c+=n[o]+n[o+1],o+=2,s+=2):(c+=n[o],o++,s++);o<i&&(c+="'",o++,s++);continue}if(y11==="$"&&o+1<i&&n[o+1]==='"'&&!p&&!m){o++,s++,m=!0,d=!0,c===""&&(h=!0),o++,s++;continue}if(y11==="'"&&!m){if(p)if(p=!1,!h||g)c+=y11;else{var _12=o+1<i?n[o+1]:"";_12&&!g_e(_12)&&_12!=="'"&&(_12==='"'?(g=!0,c+=y11,u=!1,d=!1):(g=!0,c+=y11))}else p=!0,h&&!g?(u=!0,d=!0):c+=y11;o++,s++;continue}if(y11==='"'&&!p){if(m)if(m=!1,!h||g)c+=y11;else{var _13=o+1<i?n[o+1]:"";_13&&!g_e(_13)&&_13!=='"'&&(_13==="'"?(g=!0,c+=y11,u=!1,d=!1):(g=!0,c+=y11))}else m=!0,h&&!g?d=!0:c+=y11;o++,s++;continue}if(y11==="\\"&&!p&&o+1<i){var _14=n[o+1];if(_14==="\n"){o+=2,l++,s=1;continue}if(m){if(_14==='"'||_14==="\\"||_14==="$"||_14==="`"||_14==="\n"){if(_14==="\n"){o+=2,s=1,l++;continue}c+=y11+_14,o+=2,s+=2;continue}}else{_14==="\\"||_14==='"'||_14==="'"||_14==="`"||_14==="*"||_14==="?"||_14==="["||_14==="]"||_14==="("||_14===")"||_14==="$"||_14==="-"||_14==="."||_14==="^"||_14==="+"||_14==="{"||_14==="}"?c+=y11+_14:c+=_14,o+=2,s+=2;continue}}if(y11==="$"&&o+1<i&&n[o+1]==="("&&!p){c+=y11,o++,s++,c+=n[o],o++,s++;var _15=1,b10=!1,w10=!1,S=0,k=!1,E="",C=[],T=n[o]==="("&&!this.dollarDparenIsSubshell(o),I=T?1:0;for(;_15>0&&o<i;){var O=n[o];if(c+=O,b10)O==="'"&&(b10=!1);else if(w10)O==="\\"&&o+1<i?(c+=n[o+1],o++,s++):O==='"'&&(w10=!1);else{if(O==="("&&n[o+1]==="("?I++:O===")"&&n[o+1]===")"&&I>0&&I--,I===0&&O==="<"&&n[o+1]==="<"&&n[o+2]!=="<"){var M=o+2,R=!1;for(n[M]==="-"&&(R=!0,M++);n[M]===" "||n[M]===" ";)M++;var _nke=nke(n,M),$=_nke.delim,z=_nke.endPos;if($.length>0){c+=n.slice(o+1,z),s+=z-o,C.push({delim:$,stripTabs:R}),o=z;continue}}if(O==="\n"&&C.length>0){l++,s=0;var M1=o+1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=C[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,R1=_step_value.delim,$1=_step_value.stripTabs;for(;!(M1>=i);){var z10=n.indexOf("\n",M1);z10===-1&&(z10=i);var D=n.slice(M1,z10),L=$1?D.replace(/^\t+/,""):D;c+=n.slice(M1,Math.min(z10+1,i)),z10<i&&l++;var ee=z10>=i;if(M1=z10+1,L===R1||ee)break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}C.length=0,s=0,o=Math.min(M1,i);continue}if(O==="'")b10=!0,E="";else if(O==='"')w10=!0,E="";else if(O==="\\"&&o+1<i)c+=n[o+1],o++,s++,E="";else if(O==="$"&&o+1<i&&n[o+1]==="{"){o++,s++,c+=n[o],o++,s++;var M10=1,R10=!1,$10=!1;for(;M10>0&&o<i;){var z11=n[o];if(z11==="\\"&&o+1<i&&!R10){c+=z11,o++,s++,c+=n[o],o++,s++;continue}c+=z11,R10?z11==="'"&&(R10=!1):$10?z11==='"'&&($10=!1):z11==="'"?R10=!0:z11==='"'?$10=!0:z11==="{"?M10++:z11==="}"&&M10--,z11==="\n"?(l++,s=0):s++,o++}E="";continue}else if(O==="#"&&!T&&(E===""||/\s/.test(n[o-1]||""))){for(;o+1<i&&n[o+1]!=="\n";)o++,s++,c+=n[o];E=""}else/[a-zA-Z_]/.test(O)?E+=O:(E==="case"?(S++,k=!1):E==="in"&&S>0?k=!0:E==="esac"&&S>0&&(S--,k=!1),E="",O==="("?o>0&&n[o-1]==="$"?_15++:k||_15++:O===")"?k?k=!1:_15--:O===";"&&S>0&&(o+1<i&&n[o+1]===";"||o+1<i&&n[o+1]==="&")&&(k=!0))}O==="\n"&&(l++,s=0,E=""),o++,s++}continue}if(y11==="$"&&o+1<i&&n[o+1]==="["&&!p){c+=y11,o++,s++,c+=n[o],o++,s++;var _16=1;for(;_16>0&&o<i;){var b11=n[o];c+=b11,b11==="["?_16++:b11==="]"?_16--:b11==="\n"&&(l++,s=0),o++,s++}continue}if(y11==="$"&&o+1<i&&n[o+1]==="{"&&!p){c+=y11,o++,s++,c+=n[o],o++,s++;var _17=1,b12=!1,w11=!1,S10=l,k10=s,E1=l,C1=s;for(;_17>0&&o<i;){var T1=n[o];if(T1==="\\"&&o+1<i&&n[o+1]==="\n"){o+=2,l++,s=1;continue}if(T1==="\\"&&o+1<i&&!b12){c+=T1,o++,s++,c+=n[o],o++,s++;continue}c+=T1,b12?T1==="'"&&(b12=!1):w11?T1==='"'&&(w11=!1):T1==="'"?(b12=!0,S10=l,k10=s):T1==='"'?(w11=!0,E1=l,C1=s):T1==="{"?_17++:T1==="}"&&_17--,T1==="\n"&&(l++,s=0),o++,s++}if(b12)throw new e_("unexpected EOF while looking for matching `''",S10,k10);if(w11)throw new e_("unexpected EOF while looking for matching `\"'",E1,C1);continue}if(y11==="$"&&o+1<i&&!p){var _18=n[o+1];if(_18==="#"||_18==="?"||_18==="$"||_18==="!"||_18==="@"||_18==="*"||_18==="-"||_18>="0"&&_18<="9"){c+=y11+_18,o+=2,s+=2;continue}}if(y11==="`"&&!p){for(c+=y11,o++,s++;o<i&&n[o]!=="`";){var _19=n[o];c+=_19,_19==="\\"&&o+1<i&&(c+=n[o+1],o++,s++),_19==="\n"&&(l++,s=0),o++,s++}o<i&&(c+=n[o],o++,s++);continue}c+=y11,o++,y11==="\n"?(l++,s=1):s++}if(this.pos=o,this.column=s,this.line=l,g&&h&&(c=n[e]+c,d=!1,u=!1),p||m){var y12=p?"'":'"';throw new e_("unexpected EOF while looking for matching `".concat(y12,"'"),t,r)}if(!h&&c.length>=2){if(c[0]==="'"&&c[c.length-1]==="'"){var y13=c.slice(1,-1);!y13.includes("'")&&!y13.includes('"')&&(c=y13,d=!0,u=!0)}else if(c[0]==='"'&&c[c.length-1]==='"'){var y14=c.slice(1,-1),_20=!1;for(var b13=0;b13<y14.length;b13++){if(y14[b13]==='"'){_20=!0;break}y14[b13]==="\\"&&b13+1<y14.length&&b13++}_20||(c=y14,d=!0,u=!1)}}if(c==="")return{type:F.WORD,value:"",start:e,end:o,line:t,column:r,quoted:d,singleQuoted:u};var v=jq.get(c);if(!d&&v!==void 0)return{type:v,value:c,start:e,end:o,line:t,column:r};if(!h){var y15=h_e(c);if(y15>0&&m_e(c.slice(0,y15)))return{type:F.ASSIGNMENT_WORD,value:c,start:e,end:o,line:t,column:r,quoted:d,singleQuoted:u}}return/^[0-9]+$/.test(c)?{type:F.NUMBER,value:c,start:e,end:o,line:t,column:r}:bxt(c)?{type:F.NAME,value:c,start:e,end:o,line:t,column:r,quoted:d,singleQuoted:u}:{type:F.WORD,value:c,start:e,end:o,line:t,column:r,quoted:d,singleQuoted:u}}},{key:"readHeredocContent",value:function readHeredocContent(){for(;this.pendingHeredocs.length>0;){var e=this.pendingHeredocs.shift();if(!e)break;var t=this.pos,r=this.line,n=this.column,i="";for(;this.pos<this.input.length;){var o="";for(;this.pos<this.input.length&&this.input[this.pos]!=="\n";)o+=this.input[this.pos],this.pos++,this.column++;if((e.stripTabs?o.replace(/^\t+/,""):o)===e.delimiter){this.pos<this.input.length&&this.input[this.pos]==="\n"&&(this.pos++,this.line++,this.column=1);break}if(i+=o,i.length>this.maxHeredocSize)throw new e_("Heredoc size limit exceeded (".concat(this.maxHeredocSize," bytes)"),r,n);this.pos<this.input.length&&this.input[this.pos]==="\n"&&(i+="\n",this.pos++,this.line++,this.column=1)}this.tokens.push({type:F.HEREDOC_CONTENT,value:i,start:t,end:this.pos,line:r,column:n})}}},{key:"addPendingHeredoc",value:function addPendingHeredoc(e,t,r){this.pendingHeredocs.push({delimiter:e,stripTabs:t,quoted:r})}},{key:"registerHeredocFromLookahead",value:function registerHeredocFromLookahead(e){var t=this.pos,r=this.column;for(;this.pos<this.input.length&&(this.input[this.pos]===" "||this.input[this.pos]===" ");)this.pos++,this.column++;var n="",i=!1;for(;this.pos<this.input.length;){var o=this.input[this.pos];if(/[\s;<>&|()]/.test(o))break;if(o==="'"||o==='"'){i=!0;var a=o;for(this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]!==a;)n+=this.input[this.pos],this.pos++,this.column++;this.pos<this.input.length&&this.input[this.pos]===a&&(this.pos++,this.column++)}else o==="\\"?(i=!0,this.pos++,this.column++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++,this.column++)):(n+=o,this.pos++,this.column++)}this.pos=t,this.column=r,n&&this.pendingHeredocs.push({delimiter:n,stripTabs:e,quoted:i})}},{key:"isWordCharFollowing",value:function isWordCharFollowing(e){if(e>=this.input.length)return!1;var t=this.input[e];return!(t===" "||t===" "||t==="\n"||t===";"||t==="&"||t==="|"||t==="("||t===")"||t==="<"||t===">")}},{key:"readWordWithBraceExpansion",value:function readWordWithBraceExpansion(e,t,r){var n=this.input,i=n.length,o=e,a=r;for(;o<i;){var l=n[o];if(l===" "||l===" "||l==="\n"||l===";"||l==="&"||l==="|"||l==="("||l===")"||l==="<"||l===">")break;if(l==="{"){if(this.scanBraceExpansion(o)!==null){var c=1;for(o++,a++;o<i&&c>0;)n[o]==="{"?c++:n[o]==="}"&&c--,o++,a++;continue}o++,a++;continue}if(l==="}"){o++,a++;continue}if(l==="$"&&o+1<i&&n[o+1]==="("){o++,a++,o++,a++;var c10=1;for(;c10>0&&o<i;)n[o]==="("?c10++:n[o]===")"&&c10--,o++,a++;continue}if(l==="$"&&o+1<i&&n[o+1]==="{"){o++,a++,o++,a++;var c11=1;for(;c11>0&&o<i;)n[o]==="{"?c11++:n[o]==="}"&&c11--,o++,a++;continue}if(l==="`"){for(o++,a++;o<i&&n[o]!=="`";)n[o]==="\\"&&o+1<i?(o+=2,a+=2):(o++,a++);o<i&&(o++,a++);continue}o++,a++}var s=n.slice(e,o);return this.pos=o,this.column=a,{type:F.WORD,value:s,start:e,end:o,line:t,column:r,quoted:!1,singleQuoted:!1}}},{key:"scanBraceExpansion",value:function scanBraceExpansion(e){var t=this.input,r=t.length,n=e+1,i=1,o=!1,a=!1;for(;n<r&&i>0;){var s=t[n];if(s==="{")i++,n++;else if(s==="}")i--,n++;else if(s===","&&i===1)o=!0,n++;else if(s==="."&&n+1<r&&t[n+1]===".")a=!0,n+=2;else{if(s===" "||s===" "||s==="\n"||s===";"||s==="&"||s==="|")return null;n++}}return i===0&&(o||a)?t.slice(e,n):null}},{key:"scanLiteralBraceWord",value:function scanLiteralBraceWord(e){var t=this.input,r=t.length,n=e+1,i=1;for(;n<r&&i>0;){var o=t[n];if(o==="{")i++,n++;else if(o==="}"){if(i--,i===0)return t.slice(e,n+1);n++}else{if(o===" "||o===" "||o==="\n"||o===";"||o==="&"||o==="|")return null;n++}}return null}},{key:"scanExtglobPattern",value:function scanExtglobPattern(e){var t=this.input,r=t.length,n=e+1,i=1;for(;n<r&&i>0;){var o=t[n];if(o==="\\"&&n+1<r){n+=2;continue}if("@*+?!".includes(o)&&n+1<r&&t[n+1]==="("){n++,i++,n++;continue}if(o==="(")i++,n++;else if(o===")")i--,n++;else{if(o==="\n")return null;n++}}return i===0?{content:t.slice(e,n),end:n}:null}},{key:"scanFdVariable",value:function scanFdVariable(e){var t=this.input,r=t.length,n=e+1,i=n;for(;n<r;){var l=t[n];if(n===i){if(!(l>="a"&&l<="z"||l>="A"&&l<="Z"||l==="_"))return null}else if(!(l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||l==="_"))break;n++}if(n===i)return null;var o=t.slice(i,n);if(n>=r||t[n]!=="}"||(n++,n>=r))return null;var a=t[n],s=n+1<r?t[n+1]:"";return a===">"||a==="<"||a==="&"&&(s===">"||s==="<")?{varname:o,end:n}:null}},{key:"dollarDparenIsSubshell",value:function dollarDparenIsSubshell(e){var t=this.input,r=t.length,n=e+1,i=2,o=!1,a=!1,s=!1;for(;n<r&&i>0;){var l=t[n];if(o){l==="'"&&(o=!1),l==="\n"&&(s=!0),n++;continue}if(a){if(l==="\\"){n+=2;continue}l==='"'&&(a=!1),l==="\n"&&(s=!0),n++;continue}if(l==="'"){o=!0,n++;continue}if(l==='"'){a=!0,n++;continue}if(l==="\\"){n+=2;continue}if(l==="\n"&&(s=!0),l==="("){i++,n++;continue}if(l===")"){if(i--,i===1){var c=n+1;if(c<r&&t[c]===")")return!1;var d=c,u=!1;for(;d<r&&(t[d]===" "||t[d]===" "||t[d]==="\n");)u=!0,d++;if(u&&d<r&&t[d]===")"||s)return!0}if(i===0)return!1;n++;continue}n++}return!1}},{key:"dparenClosesWithSpacedParens",value:function dparenClosesWithSpacedParens(e){var t=this.input,r=t.length,n=e,i=2,o=!1,a=!1;for(;n<r&&i>0;){var s=t[n];if(o){s==="'"&&(o=!1),n++;continue}if(a){if(s==="\\"){n+=2;continue}s==='"'&&(a=!1),n++;continue}if(s==="'"){o=!0,n++;continue}if(s==='"'){a=!0,n++;continue}if(s==="\\"){n+=2;continue}if(s==="("){i++,n++;continue}if(s===")"){if(i--,i===1){var l=n+1;if(l<r&&t[l]===")")return!1;var c=l,d=!1;for(;c<r&&(t[c]===" "||t[c]===" "||t[c]==="\n");)d=!0,c++;if(d&&c<r&&t[c]===")")return!0}if(i===0)return!1;n++;continue}if(i===1&&(s==="|"&&n+1<r&&t[n+1]==="|"||s==="&"&&n+1<r&&t[n+1]==="&"||s==="|"&&n+1<r&&t[n+1]!=="|"))return!0;n++}return!1}}]);return oke1}()}),IW,PW,ake,RW,ske,lke,uke,Xu,u_=se(function(){"use strict";d1(),IW=1e6,PW=1e5,ake=1e6,RW=200,ske=new Set([F.LESS,F.GREAT,F.DLESS,F.DGREAT,F.LESSAND,F.GREATAND,F.LESSGREAT,F.DLESSDASH,F.CLOBBER,F.TLESS,F.AND_GREAT,F.AND_DGREAT]),lke=new Set([F.LESS,F.GREAT,F.DLESS,F.DGREAT,F.LESSAND,F.GREATAND,F.LESSGREAT,F.DLESSDASH,F.CLOBBER,F.TLESS]),uke=new Set([F.LESS,F.GREAT,F.DLESS,F.DGREAT,F.LESSAND,F.GREATAND,F.LESSGREAT,F.DLESSDASH,F.CLOBBER,F.TLESS,F.AND_GREAT,F.AND_DGREAT]),Xu=/*#__PURE__*/function(Error1){_inherits(Xu1,Error1);function Xu1(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:void 0;_class_call_check(this,Xu1);var _this;_this=_call_super(this,Xu1,["Parse error at ".concat(r,":").concat(n,": ").concat(t)]);A(_this,"line");A(_this,"column");A(_this,"token");_this.line=r,_this.column=n,_this.token=i,_this.name="ParseException";return _this}return Xu1}(_wrap_native_super(Error))});function Ni(e,t){for(;t<e.length;){if(e[t]==="\\"&&e[t+1]==="\n"){t+=2;continue}if(/\s/.test(e[t])){t++;continue}break}return t}function MW(e){if(e.includes("#")){var _e_split=_sliced_to_array(e.split("#"),2),r=_e_split[0],n=_e_split[1],i=Number.parseInt(r,10);if(i<2||i>64)return Number.NaN;if(i<=36){var a=Number.parseInt(n,i);return a>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:a}var o=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a9=_step.value;var s=void 0;if(/[0-9]/.test(a9))s=a9.charCodeAt(0)-48;else if(/[a-z]/.test(a9))s=a9.charCodeAt(0)-97+10;else if(/[A-Z]/.test(a9))s=a9.charCodeAt(0)-65+36;else if(a9==="@")s=62;else if(a9==="_")s=63;else return Number.NaN;if(s>=i)return Number.NaN;if(o=o*i+s,o>Number.MAX_SAFE_INTEGER)return Number.MAX_SAFE_INTEGER}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o}if(e.startsWith("0x")||e.startsWith("0X")){var r10=Number.parseInt(e.slice(2),16);return r10>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:r10}if(e.startsWith("0")&&e.length>1&&/^[0-9]+$/.test(e)){if(/[89]/.test(e))return Number.NaN;var r11=Number.parseInt(e,8);return r11>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:r11}var t=Number.parseInt(e,10);return t>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t}function wxt(e,t,r,n){if(r.slice(n,n+3)!=="$((")return null;var i=n+3,o=1,a=i;for(;i<r.length-1&&o>0;)r[i]==="("&&r[i+1]==="("?(o++,i+=2):r[i]===")"&&r[i+1]===")"?(o--,o>0&&(i+=2)):i++;var s=r.slice(a,i),_e1=e(t,s,0),l=_e1.expr;return i+=2,{expr:{type:"ArithNested",expression:l},pos:i}}function Sxt(e,t){if(e.slice(t,t+2)!=="$'")return null;var r=t+2,n="";for(;r<e.length&&e[r]!=="'";)if(e[r]==="\\"&&r+1<e.length){var o=e[r+1];switch(o){case"n":n+="\n";break;case"t":n+=" ";break;case"r":n+="\r";break;case"\\":n+="\\";break;case"'":n+="'";break;default:n+=o}r+=2}else n+=e[r],r++;e[r]==="'"&&r++;var i=Number.parseInt(n,10);return{expr:{type:"ArithNumber",value:Number.isNaN(i)?0:i},pos:r}}function kxt(e,t){if(e.slice(t,t+2)!=='$"')return null;var r=t+2,n="";for(;r<e.length&&e[r]!=='"';)e[r]==="\\"&&r+1<e.length?(n+=e[r+1],r+=2):(n+=e[r],r++);e[r]==='"'&&r++;var i=Number.parseInt(n,10);return{expr:{type:"ArithNumber",value:Number.isNaN(i)?0:i},pos:r}}var O9,Cxt=se(function(){"use strict";O9=["=","+=","-=","*=","/=","%=","<<=",">>=","&=","|=","^="]});function Ext(e){var t="",r=0;for(;r<e.length;)if(e[r]==='"'){for(r++;r<e.length&&e[r]!=='"';)e[r]==="\\"&&r+1<e.length?(t+=e[r+1],r+=2):(t+=e[r],r++);r<e.length&&r++}else t+=e[r],r++;return t}function Ki(e,t){var r=Ext(t),_tc=tc(e,r,0),n=_tc.expr,i=_tc.pos,o=Ni(r,i);if(o<r.length){var a=t.slice(o).trim();if(a)return{type:"ArithmeticExpression",originalText:t,expression:{type:"ArithSyntaxError",errorToken:a,message:"".concat(a,': syntax error: invalid arithmetic operator (error token is "').concat(a,'")')}}}return{type:"ArithmeticExpression",expression:n,originalText:t}}function vl(e,t){return{expr:{type:"ArithSyntaxError",errorToken:e,message:'syntax error: operand expected (error token is "'.concat(e,'")')},pos:t}}function _l(e,t){return Ni(e,t)>=e.length}function tc(e,t,r){return Txt(e,t,r)}function Txt(e,t,r){var _YS=YS(e,t,r),n=_YS.expr,i=_YS.pos;for(i=Ni(t,i);t[i]===",";){if(i++,_l(t,i))return vl(",",i);var _YS1=YS(e,t,i),o=_YS1.expr,a=_YS1.pos;n={type:"ArithBinary",operator:",",left:n,right:o},i=Ni(t,a)}return{expr:n,pos:i}}function YS(e,t,r){var _Axt=Axt(e,t,r),n=_Axt.expr,i=_Axt.pos;if(i=Ni(t,i),t[i]==="?"){i++;var _tc=tc(e,t,i),o=_tc.expr,a=_tc.pos;if(i=Ni(t,a),t[i]===":"){i++;var _tc1=tc(e,t,i),s=_tc1.expr,l=_tc1.pos;return{expr:{type:"ArithTernary",condition:n,consequent:o,alternate:s},pos:l}}}return{expr:n,pos:i}}function Axt(e,t,r){var _b_e=b_e(e,t,r),n=_b_e.expr,i=_b_e.pos;for(;i=Ni(t,i),t.slice(i,i+2)==="||";){if(i+=2,_l(t,i))return vl("||",i);var _b_e1=b_e(e,t,i),o=_b_e1.expr,a=_b_e1.pos;n={type:"ArithBinary",operator:"||",left:n,right:o},i=a}return{expr:n,pos:i}}function b_e(e,t,r){var _w_e=w_e(e,t,r),n=_w_e.expr,i=_w_e.pos;for(;i=Ni(t,i),t.slice(i,i+2)==="&&";){if(i+=2,_l(t,i))return vl("&&",i);var _w_e1=w_e(e,t,i),o=_w_e1.expr,a=_w_e1.pos;n={type:"ArithBinary",operator:"&&",left:n,right:o},i=a}return{expr:n,pos:i}}function w_e(e,t,r){var _S_e=S_e(e,t,r),n=_S_e.expr,i=_S_e.pos;for(;i=Ni(t,i),t[i]==="|"&&t[i+1]!=="|";){if(i++,_l(t,i))return vl("|",i);var _S_e1=S_e(e,t,i),o=_S_e1.expr,a=_S_e1.pos;n={type:"ArithBinary",operator:"|",left:n,right:o},i=a}return{expr:n,pos:i}}function S_e(e,t,r){var _k_e=k_e(e,t,r),n=_k_e.expr,i=_k_e.pos;for(;i=Ni(t,i),t[i]==="^";){if(i++,_l(t,i))return vl("^",i);var _k_e1=k_e(e,t,i),o=_k_e1.expr,a=_k_e1.pos;n={type:"ArithBinary",operator:"^",left:n,right:o},i=a}return{expr:n,pos:i}}function k_e(e,t,r){var _C_e=C_e(e,t,r),n=_C_e.expr,i=_C_e.pos;for(;i=Ni(t,i),t[i]==="&"&&t[i+1]!=="&";){if(i++,_l(t,i))return vl("&",i);var _C_e1=C_e(e,t,i),o=_C_e1.expr,a=_C_e1.pos;n={type:"ArithBinary",operator:"&",left:n,right:o},i=a}return{expr:n,pos:i}}function C_e(e,t,r){var _E_e=E_e(e,t,r),n=_E_e.expr,i=_E_e.pos;for(;i=Ni(t,i),t.slice(i,i+2)==="=="||t.slice(i,i+2)==="!=";){var o=t.slice(i,i+2);if(i+=2,_l(t,i))return vl(o,i);var _E_e1=E_e(e,t,i),a=_E_e1.expr,s=_E_e1.pos;n={type:"ArithBinary",operator:o,left:n,right:a},i=s}return{expr:n,pos:i}}function E_e(e,t,r){var _Uq=Uq(e,t,r),n=_Uq.expr,i=_Uq.pos;for(;;)if(i=Ni(t,i),t.slice(i,i+2)==="<="||t.slice(i,i+2)===">="){var o=t.slice(i,i+2);if(i+=2,_l(t,i))return vl(o,i);var _Uq1=Uq(e,t,i),a=_Uq1.expr,s=_Uq1.pos;n={type:"ArithBinary",operator:o,left:n,right:a},i=s}else if(t[i]==="<"||t[i]===">"){var o10=t[i];if(i++,_l(t,i))return vl(o10,i);var _Uq2=Uq(e,t,i),a9=_Uq2.expr,s10=_Uq2.pos;n={type:"ArithBinary",operator:o10,left:n,right:a9},i=s10}else break;return{expr:n,pos:i}}function Uq(e,t,r){var _T_e=T_e(e,t,r),n=_T_e.expr,i=_T_e.pos;for(;i=Ni(t,i),t.slice(i,i+2)==="<<"||t.slice(i,i+2)===">>";){var o=t.slice(i,i+2);if(i+=2,_l(t,i))return vl(o,i);var _T_e1=T_e(e,t,i),a=_T_e1.expr,s=_T_e1.pos;n={type:"ArithBinary",operator:o,left:n,right:a},i=s}return{expr:n,pos:i}}function T_e(e,t,r){var _A_e=A_e(e,t,r),n=_A_e.expr,i=_A_e.pos;for(;i=Ni(t,i),(t[i]==="+"||t[i]==="-")&&t[i+1]!==t[i];){var o=t[i];if(i++,_l(t,i))return vl(o,i);var _A_e1=A_e(e,t,i),a=_A_e1.expr,s=_A_e1.pos;n={type:"ArithBinary",operator:o,left:n,right:a},i=s}return{expr:n,pos:i}}function A_e(e,t,r){var _$_9=_9(e,t,r),n=_$_9.expr,i=_$_9.pos;for(;;)if(i=Ni(t,i),t[i]==="*"&&t[i+1]!=="*"){if(i++,_l(t,i))return vl("*",i);var _$_91=_9(e,t,i),o=_$_91.expr,a=_$_91.pos;n={type:"ArithBinary",operator:"*",left:n,right:o},i=a}else if(t[i]==="/"||t[i]==="%"){var o10=t[i];if(i++,_l(t,i))return vl(o10,i);var _$_92=_9(e,t,i),a9=_$_92.expr,s=_$_92.pos;n={type:"ArithBinary",operator:o10,left:n,right:a9},i=s}else break;return{expr:n,pos:i}}function _9(e,t,r){var _OW=OW(e,t,r),n=_OW.expr,i=_OW.pos,o=Ni(t,i);if(t.slice(o,o+2)==="**"){if(o+=2,_l(t,o))return vl("**",o);var _$_9=_9(e,t,o),a=_$_9.expr,s=_$_9.pos;return{expr:{type:"ArithBinary",operator:"**",left:n,right:a},pos:s}}return{expr:n,pos:i}}function OW(e,t,r){var n=Ni(t,r);if(t.slice(n,n+2)==="++"||t.slice(n,n+2)==="--"){var i=t.slice(n,n+2);n+=2;var _OW=OW(e,t,n),o=_OW.expr,a=_OW.pos;return{expr:{type:"ArithUnary",operator:i,operand:o,prefix:!0},pos:a}}if(t[n]==="+"||t[n]==="-"||t[n]==="!"||t[n]==="~"){var i10=t[n];n++;var _OW1=OW(e,t,n),o10=_OW1.expr,a9=_OW1.pos;return{expr:{type:"ArithUnary",operator:i10,operand:o10,prefix:!0},pos:a9}}return Pxt(e,t,n)}function Ixt(e,t){var r=e[t];return r==="$"||r==="`"}function Pxt(e,t,r){var _I_e=I_e(e,t,r,!1),n=_I_e.expr,i=_I_e.pos,o=[n];for(;Ixt(t,i);){var _I_e1=I_e(e,t,i,!0),s=_I_e1.expr,l=_I_e1.pos;o.push(s),i=l}o.length>1&&(n={type:"ArithConcat",parts:o});var a;if(t[i]==="["&&n.type==="ArithConcat"){i++;var _tc=tc(e,t,i),s10=_tc.expr,l10=_tc.pos;a=s10,i=l10,t[i]==="]"&&i++}if(a&&n.type==="ArithConcat"&&(n={type:"ArithDynamicElement",nameExpr:n,subscript:a},a=void 0),i=Ni(t,i),n.type==="ArithConcat"||n.type==="ArithVariable"||n.type==="ArithDynamicElement"){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=O9[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s11=_step.value;if(t.slice(i,i+s11.length)===s11&&t.slice(i,i+s11.length+1)!=="=="){i+=s11.length;var _YS=YS(e,t,i),l11=_YS.expr,c=_YS.pos;return n.type==="ArithDynamicElement"?{expr:{type:"ArithDynamicAssignment",operator:s11,target:n.nameExpr,subscript:n.subscript,value:l11},pos:c}:n.type==="ArithConcat"?{expr:{type:"ArithDynamicAssignment",operator:s11,target:n,value:l11},pos:c}:{expr:{type:"ArithAssignment",operator:s11,variable:n.name,value:l11},pos:c}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(t.slice(i,i+2)==="++"||t.slice(i,i+2)==="--"){var s12=t.slice(i,i+2);return i+=2,{expr:{type:"ArithUnary",operator:s12,operand:n,prefix:!1},pos:i}}return{expr:n,pos:i}}function I_e(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;var i=Ni(t,r),o=wxt(tc,e,t,i);if(o)return o;var a=Sxt(t,i);if(a)return a;var s=kxt(t,i);if(s)return s;if(t.slice(i,i+2)==="$("&&t[i+2]!=="("){i+=2;var c=1,d=i;for(;i<t.length&&c>0;)t[i]==="("?c++:t[i]===")"&&c--,c>0&&i++;var u=t.slice(d,i);return i++,{expr:{type:"ArithCommandSubst",command:u},pos:i}}if(t[i]==="`"){i++;var c10=i;for(;i<t.length&&t[i]!=="`";)i++;var d10=t.slice(c10,i);return t[i]==="`"&&i++,{expr:{type:"ArithCommandSubst",command:d10},pos:i}}if(t[i]==="("){i++;var _tc=tc(e,t,i),c11=_tc.expr,d11=_tc.pos;return i=Ni(t,d11),t[i]===")"&&i++,{expr:{type:"ArithGroup",expression:c11},pos:i}}if(t[i]==="'"){i++;var c12="";for(;i<t.length&&t[i]!=="'";)c12+=t[i],i++;t[i]==="'"&&i++;var d12=Number.parseInt(c12,10);return{expr:{type:"ArithSingleQuote",content:c12,value:Number.isNaN(d12)?0:d12},pos:i}}if(t[i]==='"'){i++;var c13="";for(;i<t.length&&t[i]!=='"';)t[i]==="\\"&&i+1<t.length?(c13+=t[i+1],i+=2):(c13+=t[i],i++);t[i]==='"'&&i++;var d13=c13.trim();if(!d13)return{expr:{type:"ArithNumber",value:0},pos:i};var _tc1=tc(e,d13,0),u10=_tc1.expr;return{expr:u10,pos:i}}if(/[0-9]/.test(t[i])){var c14="",d14=!1,u11=!1;for(;i<t.length;){var p=t[i];if(d14)if(/[0-9a-zA-Z@_]/.test(p))c14+=p,i++;else break;else if(p==="#")d14=!0,c14+=p,i++;else if(c14==="0"&&(p==="x"||p==="X")&&i+1<t.length&&/[0-9a-fA-F]/.test(t[i+1]))u11=!0,c14+=p,i++;else if(u11&&/[0-9a-fA-F]/.test(p))c14+=p,i++;else if(!u11&&/[0-9]/.test(p))c14+=p,i++;else break}if(i<t.length&&/[a-zA-Z_]/.test(t[i])){var p10=c14;for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)p10+=t[i],i++;return{expr:{type:"ArithSyntaxError",errorToken:p10,message:"".concat(p10,': value too great for base (error token is "').concat(p10,'")')},pos:i}}if(t[i]==="."&&/[0-9]/.test(t[i+1]))throw new Hi("".concat(c14,".").concat(t[i+1],"...: syntax error: invalid arithmetic operator"));if(t[i]==="["){var p11=t.slice(i).trim();return{expr:{type:"ArithNumberSubscript",number:c14,errorToken:p11},pos:t.length}}return{expr:{type:"ArithNumber",value:MW(c14)},pos:i}}if(t[i]==="$"&&t[i+1]==="{"){var c15=i+2,d15=1,u12=c15;for(;u12<t.length&&d15>0;)t[u12]==="{"?d15++:t[u12]==="}"&&d15--,d15>0&&u12++;var p12=t.slice(c15,u12),m=u12+1;if(t[m]==="#"){var h=m+1;for(;h<t.length&&/[0-9a-zA-Z@_]/.test(t[h]);)h++;var g=t.slice(m+1,h);return{expr:{type:"ArithDynamicBase",baseExpr:p12,value:g},pos:h}}if(/[0-9]/.test(t[m])||t[m]==="x"||t[m]==="X"){var h10=m;if(t[m]==="x"||t[m]==="X")for(h10++;h10<t.length&&/[0-9a-fA-F]/.test(t[h10]);)h10++;else for(;h10<t.length&&/[0-9]/.test(t[h10]);)h10++;var g10=t.slice(m,h10);return{expr:{type:"ArithDynamicNumber",prefix:p12,suffix:g10},pos:h10}}return i=m,{expr:{type:"ArithBracedExpansion",content:p12},pos:i}}if(t[i]==="$"&&i+1<t.length&&/[0-9]/.test(t[i+1])){i++;var c16="";for(;i<t.length&&/[0-9]/.test(t[i]);)c16+=t[i],i++;return{expr:{type:"ArithVariable",name:c16,hasDollarPrefix:!0},pos:i}}if(t[i]==="$"&&i+1<t.length&&/[*@#?\-!$]/.test(t[i+1])){var c17=t[i+1];return i+=2,{expr:{type:"ArithSpecialVar",name:c17},pos:i}}var l=!1;if(t[i]==="$"&&i+1<t.length&&/[a-zA-Z_]/.test(t[i+1])&&(l=!0,i++),i<t.length&&/[a-zA-Z_]/.test(t[i])){var c18="";for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)c18+=t[i],i++;if(t[i]==="["&&!n){i++;var d16;if(t[i]==="'"||t[i]==='"'){var p13=t[i];for(i++,d16="";i<t.length&&t[i]!==p13;)d16+=t[i],i++;t[i]===p13&&i++,i=Ni(t,i),t[i]==="]"&&i++}var u13;if(d16===void 0){var _tc2=tc(e,t,i),p14=_tc2.expr,m10=_tc2.pos;u13=p14,i=m10,t[i]==="]"&&i++}if(i=Ni(t,i),t[i]==="["&&u13)return{expr:{type:"ArithDoubleSubscript",array:c18,index:u13},pos:i};if(!n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=O9[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p15=_step.value;if(t.slice(i,i+p15.length)===p15&&t.slice(i,i+p15.length+1)!=="=="){i+=p15.length;var _YS=YS(e,t,i),m11=_YS.expr,h11=_YS.pos;return{expr:{type:"ArithAssignment",operator:p15,variable:c18,subscript:u13,stringKey:d16,value:m11},pos:h11}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return{expr:{type:"ArithArrayElement",array:c18,index:u13,stringKey:d16},pos:i}}if(i=Ni(t,i),!n){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=O9[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d17=_step1.value;if(t.slice(i,i+d17.length)===d17&&t.slice(i,i+d17.length+1)!=="=="){i+=d17.length;var _YS1=YS(e,t,i),u14=_YS1.expr,p16=_YS1.pos;return{expr:{type:"ArithAssignment",operator:d17,variable:c18,value:u14},pos:p16}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}return{expr:{type:"ArithVariable",name:c18,hasDollarPrefix:l},pos:i}}if(t[i]==="#"){var c19=i+1;for(;c19<t.length&&t[c19]!=="\n";)c19++;var d18=t.slice(i,c19).trim()||"#";return{expr:{type:"ArithSyntaxError",errorToken:d18,message:"".concat(d18,': syntax error: invalid arithmetic operator (error token is "').concat(d18,'")')},pos:t.length}}return{expr:{type:"ArithNumber",value:0},pos:i}}var Ns=se(function(){"use strict";jr(),Cxt()});function Rxt(e){var t="",r=0;for(;r<e.length;){var n=e[r];if(n<128){t+=String.fromCharCode(n),r++;continue}if((n&224)===192){if(r+1<e.length&&(e[r+1]&192)===128&&n>=194){var i=(n&31)<<6|e[r+1]&63;t+=String.fromCharCode(i),r+=2;continue}t+=String.fromCharCode(n),r++;continue}if((n&240)===224){if(r+2<e.length&&(e[r+1]&192)===128&&(e[r+2]&192)===128){if(n===224&&e[r+1]<160){t+=String.fromCharCode(n),r++;continue}var i10=(n&15)<<12|(e[r+1]&63)<<6|e[r+2]&63;if(i10>=55296&&i10<=57343){t+=String.fromCharCode(n),r++;continue}t+=String.fromCharCode(i10),r+=3;continue}t+=String.fromCharCode(n),r++;continue}if((n&248)===240&&n<=244){if(r+3<e.length&&(e[r+1]&192)===128&&(e[r+2]&192)===128&&(e[r+3]&192)===128){if(n===240&&e[r+1]<144){t+=String.fromCharCode(n),r++;continue}var i11=(n&7)<<18|(e[r+1]&63)<<12|(e[r+2]&63)<<6|e[r+3]&63;if(i11>1114111){t+=String.fromCharCode(n),r++;continue}t+=String.fromCodePoint(i11),r+=4;continue}t+=String.fromCharCode(n),r++;continue}t+=String.fromCharCode(n),r++}return t}function Mxt(e,t,r){var n=r+1;for(;n<t.length&&/[a-zA-Z0-9_-]/.test(t[n]);)n++;return n}function cke(e,t,r,n,i){var o=1,a=r+1;for(;a<t.length&&o>0;)t[a]===n?o++:t[a]===i&&o--,o>0&&a++;return o===0?a:-1}function Gv(e,t,r){var n=r,i=1;for(;n<t.length&&i>0;){var o=t[n];if(o==="\\"&&n+1<t.length){n+=2;continue}if(o==="'"){var a=t.indexOf("'",n+1);if(a!==-1){n=a+1;continue}}if(o==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&n+1<t.length?n+=2:n++;n<t.length&&n++;continue}o==="{"?i++:o==="}"&&i--,i>0&&n++}return n}function Oxt(e,t,r){var n=r,i=!1;for(;n<t.length;){var o=t[n];if(o==="/"&&i||o==="}")break;if(o==="'"){var a=t.indexOf("'",n+1);if(a!==-1){n=a+1,i=!0;continue}}if(o==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&n+1<t.length?n+=2:n++;n<t.length&&n++,i=!0;continue}o==="\\"?(n+=2,i=!0):(n++,i=!0)}return n}function $xt(e,t,r){var n=r,i="";for(;n<t.length;){var o=t[n];if(o==="*"||o==="?")i+=o,n++;else if(o==="["){var a=Nxt(t,n);a===-1?(i+=o,n++):(i+=t.slice(n,a+1),n=a+1)}else break}return{pattern:i,endIndex:n}}function Nxt(e,t){var r=t+1;for(r<e.length&&e[r]==="^"&&r++,r<e.length&&e[r]==="]"&&r++;r<e.length;){var n=e[r];if(n==="\\"&&r+1<e.length){var i=e[r+1];if(i==='"'||i==="'")return-1;r+=2;continue}if(n==="]")return r;if(n==='"'||n==="$"||n==="`")return-1;if(n==="'"){var i10=e.indexOf("'",r+1);if(i10!==-1){r=i10+1;continue}}if(n==="["&&r+1<e.length&&e[r+1]===":"){var i11=e.indexOf(":]",r+2);if(i11!==-1){r=i11+2;continue}}if(n==="["&&r+1<e.length&&(e[r+1]==="."||e[r+1]==="=")){var i12="".concat(e[r+1],"]"),o=e.indexOf(i12,r+2);if(o!==-1){r=o+2;continue}}r++}return-1}function Dxt(e,t,r){var n="",i=r;for(;i<t.length&&t[i]!=="'";){var o=t[i];if(o==="\\"&&i+1<t.length)switch(t[i+1]){case"n":n+="\n",i+=2;break;case"t":n+=" ",i+=2;break;case"r":n+="\r",i+=2;break;case"\\":n+="\\",i+=2;break;case"'":n+="'",i+=2;break;case'"':n+='"',i+=2;break;case"a":n+="\x07",i+=2;break;case"b":n+="\b",i+=2;break;case"e":case"E":n+="\x1b",i+=2;break;case"f":n+="\f",i+=2;break;case"v":n+="\v",i+=2;break;case"x":{var a=[],s=i;for(;s+1<t.length&&t[s]==="\\"&&t[s+1]==="x";){var l=t.slice(s+2,s+4),c=parseInt(l,16);if(!Number.isNaN(c)&&l.length>0)a.push(c),s+=2+l.length;else break}a.length>0?(n+=Rxt(a),i=s):(n+="\\x",i+=2);break}case"u":{var a9=t.slice(i+2,i+6),s10=parseInt(a9,16);Number.isNaN(s10)?(n+="\\u",i+=2):(n+=String.fromCharCode(s10),i+=6);break}case"c":{if(i+2<t.length){var a10=t[i+2].charCodeAt(0)&31;n+=String.fromCharCode(a10),i+=3}else n+="\\c",i+=2;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{var a11="",s11=i+1;for(;s11<t.length&&s11<i+4&&/[0-7]/.test(t[s11]);)a11+=t[s11],s11++;var l10=parseInt(a11,8);n+=String.fromCharCode(l10),i=s11;break}default:n+=o,i++}else n+=o,i++}return i<t.length&&t[i]==="'"&&i++,{part:Pt.literal(n),endIndex:i}}function P_e(e,t){var r=t.trim();return r===""?{type:"ArithmeticExpression",expression:{type:"ArithNumber",value:0}}:Ki(e,r)}function R_e(e){var t=[],r="",n=0;for(var i=0;i<e.length;i++){var o=e[i];o==="{"?(n++,r+=o):o==="}"?(n--,r+=o):o===","&&n===0?(t.push(r),r=""):r+=o}return t.push(r),t}function Lxt(e,t,r,n){var i=cke(e,t,r,"{","}");if(i===-1)return null;var o=t.slice(r+1,i),a=o.match(/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/);if(a)return{part:{type:"BraceExpansion",items:[{type:"Range",start:Number.parseInt(a[1],10),end:Number.parseInt(a[2],10),step:a[3]?Number.parseInt(a[3],10):void 0,startStr:a[1],endStr:a[2]}]},endIndex:i+1};var s=o.match(/^([a-zA-Z])\.\.([a-zA-Z])(?:\.\.(-?\d+))?$/);return s?{part:{type:"BraceExpansion",items:[{type:"Range",start:s[1],end:s[2],step:s[3]?Number.parseInt(s[3],10):void 0}]},endIndex:i+1}:o.includes(",")&&n?{part:{type:"BraceExpansion",items:R_e(o).map(function(l){return{type:"Word",word:Pt.word(n(e,l,!1,!1,!1))}})},endIndex:i+1}:o.includes(",")?{part:{type:"BraceExpansion",items:R_e(o).map(function(l){return{type:"Word",word:Pt.word([Pt.literal(l)])}})},endIndex:i+1}:null}function dke(e,t){var n,i;var r="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;switch(o.type){case"Literal":r+=o.value;break;case"SingleQuoted":r+="'".concat(o.value,"'");break;case"Escaped":r+=o.value;break;case"DoubleQuoted":r+='"';var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o.parts[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var a=_step1.value;a.type==="Literal"||a.type==="Escaped"?r+=a.value:a.type==="ParameterExpansion"&&(r+="${".concat(a.parameter,"}"))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}r+='"';break;case"ParameterExpansion":r+="${".concat(o.parameter,"}");break;case"Glob":r+=o.pattern;break;case"TildeExpansion":r+="~",o.user&&(r+=o.user);break;case"BraceExpansion":{r+="{";var a9=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=o.items[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var s=_step2.value;if(s.type==="Range"){var l=(n=s.startStr)!=null?n:String(s.start),c=(i=s.endStr)!=null?i:String(s.end);s.step!==void 0?a9.push("".concat(l,"..").concat(c,"..").concat(s.step)):a9.push("".concat(l,"..").concat(c))}else a9.push(dke(e,s.word))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}a9.length===1&&o.items[0].type==="Range"?r+=a9[0]:r+=a9.join(","),r+="}";break}default:r+=o.type}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function Fxt(e,t){var _obj;return(_obj={},_define_property(_obj,F.LESS,"<"),_define_property(_obj,F.GREAT,">"),_define_property(_obj,F.DGREAT,">>"),_define_property(_obj,F.LESSAND,"<&"),_define_property(_obj,F.GREATAND,">&"),_define_property(_obj,F.LESSGREAT,"<>"),_define_property(_obj,F.CLOBBER,">|"),_define_property(_obj,F.TLESS,"<<<"),_define_property(_obj,F.AND_GREAT,"&>"),_define_property(_obj,F.AND_DGREAT,"&>>"),_define_property(_obj,F.DLESS,"<"),_define_property(_obj,F.DLESSDASH,"<"),_obj)[t]||">"}var pke=se(function(){"use strict";h_(),Ns(),d1()});function $W(e){var t=e.current(),r=t.type;if(r===F.NUMBER){var n=e.peek(1);return t.end!==n.start?!1:lke.has(n.type)}if(r===F.FD_VARIABLE){var n10=e.peek(1);return uke.has(n10.type)}return ske.has(r)}function NW(e){var t=null,r;e.check(F.NUMBER)?t=Number.parseInt(e.advance().value,10):e.check(F.FD_VARIABLE)&&(r=e.advance().value);var n=e.advance(),i=Fxt(e,n.type);if(n.type===F.DLESS||n.type===F.DLESSDASH)return zxt(e,i,t,n.type===F.DLESSDASH);e.isWord()||e.error("Expected redirection target");var o=e.parseWord();return Pt.redirection(i,o,t,r)}function zxt(e,t,r,n){e.isWord()||e.error("Expected here-document delimiter");var i=e.advance(),o=i.value,a=i.quoted||!1;(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))&&(o=o.slice(1,-1));var s=Pt.redirection(n?"<<-":"<<",Pt.hereDoc(o,Pt.word([]),n,a),r);return e.addPendingHeredoc(s,o,n,a),s}function jxt(e){var t=e.current().line,r=[],n=null,i=[],o=[];for(;e.check(F.ASSIGNMENT_WORD)||$W(e);)e.checkIterationLimit(),e.check(F.ASSIGNMENT_WORD)?r.push(Uxt(e)):o.push(NW(e));if(e.isWord())n=e.parseWord();else if(r.length>0&&(e.check(F.DBRACK_START)||e.check(F.DPAREN_START))){var s=e.advance();n=Pt.word([Pt.literal(s.value)])}for(;(!e.isStatementEnd()||e.check(F.RBRACE))&&!e.check(F.PIPE,F.PIPE_AMP);)if(e.checkIterationLimit(),$W(e))o.push(NW(e));else if(e.check(F.RBRACE)){var s10=e.advance();i.push(e.parseWordFromString(s10.value,!1,!1))}else if(e.check(F.LBRACE)){var s11=e.advance();i.push(e.parseWordFromString(s11.value,!1,!1))}else if(e.check(F.DBRACK_END)){var s12=e.advance();i.push(e.parseWordFromString(s12.value,!1,!1))}else if(e.isWord())i.push(e.parseWord());else if(e.check(F.ASSIGNMENT_WORD)){var s13=e.advance(),l=s13.value,c=l.endsWith("="),d=l.endsWith("=(");if((c||d)&&(d||e.check(F.LPAREN))){var u=d?l.slice(0,-2):l.slice(0,-1);d||e.expect(F.LPAREN);var p=DW(e);e.expect(F.RPAREN);var m=p.map(function(g){return dke(e,g)}),h="".concat(u,"=(").concat(m.join(" "),")");i.push(e.parseWordFromString(h,!1,!1))}else i.push(e.parseWordFromString(l,s13.quoted,s13.singleQuoted))}else if(e.check(F.LPAREN))e.error("syntax error near unexpected token `('");else break;var a=Pt.simpleCommand(n,i,r,o);return a.line=t,a}function Uxt(e){var t=e.expect(F.ASSIGNMENT_WORD),r=t.value,n=r.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);n||e.error("Invalid assignment: ".concat(r));var i=n[0],o,a=i.length;if(r[a]==="["){var u=0,p=a+1;for(;a<r.length;a++)if(r[a]==="[")u++;else if(r[a]==="]"&&(u--,u===0))break;u!==0&&e.error("Invalid assignment: ".concat(r)),o=r.slice(p,a),a++}var s=r[a]==="+";s&&a++,r[a]!=="="&&e.error("Invalid assignment: ".concat(r)),a++;var l=r.slice(a);if(l==="("){var u10=DW(e);e.expect(F.RPAREN);var p10=o!==void 0?"".concat(i,"[").concat(o,"]"):i;return Pt.assignment(p10,null,s,u10)}if(l===""&&e.check(F.LPAREN)){var u11=e.current();if(t.end===u11.start){e.advance();var p11=DW(e);e.expect(F.RPAREN);var m=o!==void 0?"".concat(i,"[").concat(o,"]"):i;return Pt.assignment(m,null,s,p11)}}var c=l?e.parseWordFromString(l,t.quoted,t.singleQuoted,!0):null,d=o!==void 0?"".concat(i,"[").concat(o,"]"):i;return Pt.assignment(d,c,s,null)}function DW(e){var t=[];for(e.skipNewlines();!e.check(F.RPAREN,F.EOF);)e.checkIterationLimit(),e.isWord()?t.push(e.parseWord()):fke.has(e.current().type)?e.error("syntax error near unexpected token `".concat(e.current().value,"'")):e.advance(),e.skipNewlines();return t}var fke,Bxt=se(function(){"use strict";h_(),d1(),u_(),pke(),fke=new Set([F.AMP,F.PIPE,F.PIPE_AMP,F.SEMICOLON,F.AND_AND,F.OR_OR,F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND])});function M_e(e,t){e.expect(F.IF);var r=[],n=e.parseCompoundList();e.expect(F.THEN);var i=e.parseCompoundList();if(i.length===0){var s=e.check(F.FI)?"fi":e.check(F.ELSE)?"else":e.check(F.ELIF)?"elif":"fi";e.error("syntax error near unexpected token `".concat(s,"'"))}for(r.push({condition:n,body:i});e.check(F.ELIF);){e.advance();var s10=e.parseCompoundList();e.expect(F.THEN);var l=e.parseCompoundList();if(l.length===0){var c=e.check(F.FI)?"fi":e.check(F.ELSE)?"else":e.check(F.ELIF)?"elif":"fi";e.error("syntax error near unexpected token `".concat(c,"'"))}r.push({condition:s10,body:l})}var o=null;e.check(F.ELSE)&&(e.advance(),o=e.parseCompoundList(),o.length===0&&e.error("syntax error near unexpected token `fi'")),e.expect(F.FI);var a=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.ifNode(r,o,a)}function O_e(e,t){var r=e.expect(F.FOR);if(e.check(F.DPAREN_START))return qxt(e,t,r.line);e.isWord()||e.error("Expected variable name in for loop");var n=e.advance().value,i=null;if(e.skipNewlines(),e.check(F.IN))for(e.advance(),i=[];!e.check(F.SEMICOLON,F.NEWLINE,F.DO,F.EOF)&&e.isWord();)i.push(e.parseWord());e.check(F.SEMICOLON)&&e.advance(),e.skipNewlines(),e.expect(F.DO);var o=e.parseCompoundList();e.expect(F.DONE);var a=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.forNode(n,i,o,a)}function qxt(e,t,r){e.expect(F.DPAREN_START);var n=null,i=null,o=null,a=["","",""],s=0,l=0;for(;!e.check(F.DPAREN_END,F.EOF);){var u=e.advance();if(u.type===F.SEMICOLON&&l===0){if(s++,s>2)break}else u.value==="("&&l++,u.value===")"&&l--,a[s]+=u.value}e.expect(F.DPAREN_END),a[0].trim()&&(n=Ki(e,a[0].trim())),a[1].trim()&&(i=Ki(e,a[1].trim())),a[2].trim()&&(o=Ki(e,a[2].trim())),e.skipNewlines(),e.check(F.SEMICOLON)&&e.advance(),e.skipNewlines();var c;e.check(F.LBRACE)?(e.advance(),c=e.parseCompoundList(),e.expect(F.RBRACE)):(e.expect(F.DO),c=e.parseCompoundList(),e.expect(F.DONE));var d=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return{type:"CStyleFor",init:n,condition:i,update:o,body:c,redirections:d,line:r}}function $_e(e,t){e.expect(F.WHILE);var r=e.parseCompoundList();e.expect(F.DO);var n=e.parseCompoundList();n.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(F.DONE);var i=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.whileNode(r,n,i)}function N_e(e,t){e.expect(F.UNTIL);var r=e.parseCompoundList();e.expect(F.DO);var n=e.parseCompoundList();n.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(F.DONE);var i=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.untilNode(r,n,i)}function D_e(e,t){e.expect(F.CASE),e.isWord()||e.error("Expected word after 'case'");var r=e.parseWord();e.skipNewlines(),e.expect(F.IN),e.skipNewlines();var n=[];for(;!e.check(F.ESAC,F.EOF);){e.checkIterationLimit();var o=e.getPos(),a=Wxt(e);if(a&&n.push(a),e.skipNewlines(),e.getPos()===o&&!a)break}e.expect(F.ESAC);var i=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.caseNode(r,n,i)}function Wxt(e){e.check(F.LPAREN)&&e.advance();var t=[];for(;e.isWord()&&(t.push(e.parseWord()),e.check(F.PIPE));)e.advance();if(t.length===0)return null;e.expect(F.RPAREN),e.skipNewlines();var r=[];for(;!e.check(F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND,F.ESAC,F.EOF);){e.checkIterationLimit(),e.isWord()&&e.peek(1).type===F.RPAREN&&e.error("syntax error near unexpected token `)'"),e.check(F.LPAREN)&&e.peek(1).type===F.WORD&&e.error("syntax error near unexpected token `".concat(e.peek(1).value,"'"));var i=e.getPos(),o=e.parseStatement();if(o&&r.push(o),e.skipSeparators(!1),e.getPos()===i&&!o)break}var n=";;";return e.check(F.DSEMI)?(e.advance(),n=";;"):e.check(F.SEMI_AND)?(e.advance(),n=";&"):e.check(F.SEMI_SEMI_AND)&&(e.advance(),n=";;&"),Pt.caseItem(t,r,n)}function L_e(e,t){e.expect(F.LPAREN);var r=e.parseCompoundList();e.expect(F.RPAREN);var n=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.subshell(r,n)}function F_e(e,t){e.expect(F.LBRACE);var r=e.parseCompoundList();e.expect(F.RBRACE);var n=t!=null&&t.skipRedirections?[]:e.parseOptionalRedirections();return Pt.group(r,n)}var Vxt=se(function(){"use strict";h_(),Ns(),d1()});function z_e(e){return e.isWord()||e.check(F.LBRACE)||e.check(F.RBRACE)||e.check(F.ASSIGNMENT_WORD)}function j_e(e){if(e.check(F.BANG)&&e.peek(1).type===F.LPAREN){e.advance(),e.advance();var t=1,r="!(";for(;t>0&&!e.check(F.EOF);)if(e.check(F.LPAREN))t++,r+="(",e.advance();else if(e.check(F.RPAREN))t--,t>0&&(r+=")"),e.advance();else if(e.isWord())r+=e.advance().value;else if(e.check(F.PIPE))r+="|",e.advance();else break;return r+=")",e.parseWordFromString(r,!1,!1,!1,!1,!0)}return e.parseWordNoBraceExpansion()}function mke(e){return e.skipNewlines(),Gxt(e)}function Gxt(e){var t=U_e(e);for(e.skipNewlines();e.check(F.OR_OR);){e.advance(),e.skipNewlines();var r=U_e(e);t={type:"CondOr",left:t,right:r},e.skipNewlines()}return t}function U_e(e){var t=LW(e);for(e.skipNewlines();e.check(F.AND_AND);){e.advance(),e.skipNewlines();var r=LW(e);t={type:"CondAnd",left:t,right:r},e.skipNewlines()}return t}function LW(e){return e.skipNewlines(),e.check(F.BANG)?(e.advance(),e.skipNewlines(),{type:"CondNot",operand:LW(e)}):Hxt(e)}function Hxt(e){if(e.check(F.LPAREN)){e.advance();var t=mke(e);return e.expect(F.RPAREN),{type:"CondGroup",expression:t}}if(z_e(e)){var t10=e.current(),r=t10.value;if(hke.includes(r)&&!t10.quoted){if(e.advance(),e.check(F.DBRACK_END)&&e.error("Expected operand after ".concat(r)),z_e(e)){var o=e.parseWordNoBraceExpansion();return{type:"CondUnary",operator:r,operand:o}}var i=e.current();e.error("unexpected argument `".concat(i.value,"' to conditional unary operator"))}var n=e.parseWordNoBraceExpansion();if(e.isWord()&&gke.includes(e.current().value)){var i10=e.advance().value,o10;return i10==="=~"?o10=Zxt(e):i10==="=="||i10==="!="?o10=j_e(e):o10=e.parseWordNoBraceExpansion(),{type:"CondBinary",operator:i10,left:n,right:o10}}if(e.check(F.LESS)){e.advance();var i11=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:"<",left:n,right:i11}}if(e.check(F.GREAT)){e.advance();var i12=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:">",left:n,right:i12}}if(e.isWord()&&e.current().value==="="){e.advance();var i13=j_e(e);return{type:"CondBinary",operator:"==",left:n,right:i13}}return{type:"CondWord",word:n}}e.error("Expected conditional expression")}function Zxt(e){var t=[],r=0,n=-1,i=e.getInput(),o=function(){return e.check(F.DBRACK_END)||e.check(F.AND_AND)||e.check(F.OR_OR)||e.check(F.NEWLINE)||e.check(F.EOF)};for(;!o();){var a=e.current(),s=n>=0&&a.start>n;if(r===0&&s)break;if(r>0&&s){var l=i.slice(n,a.start);t.push({type:"Literal",value:l})}if(e.isWord()||e.check(F.ASSIGNMENT_WORD)){var _t1;var l10=e.parseWordForRegex();(_t1=t).push.apply(_t1,_to_consumable_array(l10.parts)),n=e.peek(-1).end}else if(e.check(F.LPAREN)){var l11=e.advance();t.push({type:"Literal",value:"("}),r++,n=l11.end}else if(e.check(F.DPAREN_START)){var l12=e.advance();t.push({type:"Literal",value:"(("}),r+=2,n=l12.end}else if(e.check(F.DPAREN_END))if(r>=2){var l13=e.advance();t.push({type:"Literal",value:"))"}),r-=2,n=l13.end}else{if(r===1)break;break}else if(e.check(F.RPAREN))if(r>0){var l14=e.advance();t.push({type:"Literal",value:")"}),r--,n=l14.end}else break;else if(e.check(F.PIPE)){var l15=e.advance();t.push({type:"Literal",value:"|"}),n=l15.end}else if(e.check(F.SEMICOLON))if(r>0){var l16=e.advance();t.push({type:"Literal",value:";"}),n=l16.end}else break;else if(r>0&&e.check(F.LESS)){var l17=e.advance();t.push({type:"Literal",value:"<"}),n=l17.end}else if(r>0&&e.check(F.GREAT)){var l18=e.advance();t.push({type:"Literal",value:">"}),n=l18.end}else if(r>0&&e.check(F.DGREAT)){var l19=e.advance();t.push({type:"Literal",value:">>"}),n=l19.end}else if(r>0&&e.check(F.DLESS)){var l20=e.advance();t.push({type:"Literal",value:"<<"}),n=l20.end}else if(r>0&&e.check(F.LESSAND)){var l21=e.advance();t.push({type:"Literal",value:"<&"}),n=l21.end}else if(r>0&&e.check(F.GREATAND)){var l22=e.advance();t.push({type:"Literal",value:">&"}),n=l22.end}else if(r>0&&e.check(F.LESSGREAT)){var l23=e.advance();t.push({type:"Literal",value:"<>"}),n=l23.end}else if(r>0&&e.check(F.CLOBBER)){var l24=e.advance();t.push({type:"Literal",value:">|"}),n=l24.end}else if(r>0&&e.check(F.TLESS)){var l25=e.advance();t.push({type:"Literal",value:"<<<"}),n=l25.end}else if(r>0&&e.check(F.AMP)){var l26=e.advance();t.push({type:"Literal",value:"&"}),n=l26.end}else if(r>0&&e.check(F.LBRACE)){var l27=e.advance();t.push({type:"Literal",value:"{"}),n=l27.end}else if(r>0&&e.check(F.RBRACE)){var l28=e.advance();t.push({type:"Literal",value:"}"}),n=l28.end}else break}return t.length===0&&e.error("Expected regex pattern after =~"),{type:"Word",parts:t}}var hke,gke,Kxt=se(function(){"use strict";d1(),hke=["-a","-b","-c","-d","-e","-f","-g","-h","-k","-p","-r","-s","-t","-u","-w","-x","-G","-L","-N","-O","-S","-z","-n","-o","-v","-R"],gke=["==","!=","=~","<",">","-eq","-ne","-lt","-le","-gt","-ge","-nt","-ot","-ef"]});function FS(e){return e.length>0?e:[Pt.literal("")]}function Qxt(e,t){var r=1,n=t+1;for(;n<e.length&&r>0;){var i=e[n];if(i==="\\"){n+=2;continue}if("@*+?!".includes(i)&&n+1<e.length&&e[n+1]==="("){n++,r++,n++;continue}if(i==="(")r++;else if(i===")"&&(r--,r===0))return n;n++}return-1}function Jxt(e,t,r){var n=r+1,i=t[n];if("@*#?$!-0123456789".includes(i))return{part:Pt.parameterExpansion(i),endIndex:n+1};var o="";for(;n<t.length&&/[a-zA-Z0-9_]/.test(t[n]);)o+=t[n],n++;return{part:Pt.parameterExpansion(o),endIndex:n}}function Yxt(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;var i=r+2,o=!1;t[i]==="!"&&(o=!0,i++);var a=!1;t[i]==="#"&&!/[}:#%/^,]/.test(t[i+1]||"}")&&(a=!0,i++);var s="",l=t[i];if(/[@*#?$!-]/.test(l)&&!/[a-zA-Z0-9_]/.test(t[i+1]||""))s=l,i++;else for(;i<t.length&&/[a-zA-Z0-9_]/.test(t[i]);)s+=t[i],i++;if(t[i]==="["){var d=cke(e,t,i,"[","]");if(s+=t.slice(i,d+1),i=d+1,t[i]==="["){var u=1,p=i;for(;p<t.length&&u>0;)t[p]==="{"?u++:t[p]==="}"&&u--,u>0&&p++;var m=t.slice(r+2,p);return{part:Pt.parameterExpansion("",{type:"BadSubstitution",text:m}),endIndex:p+1}}}if(s===""&&!o&&!a&&t[i]!=="}"){var d10=1,u10=i;for(;u10<t.length&&d10>0;)t[u10]==="{"?d10++:t[u10]==="}"&&d10--,d10>0&&u10++;if(d10>0)throw new Xu("unexpected EOF while looking for matching '}'",0,0);var p10=t.slice(r+2,u10);return{part:Pt.parameterExpansion("",{type:"BadSubstitution",text:p10}),endIndex:u10+1}}var c=null;if(o){var d11=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(d11)if(i<t.length&&t[i]!=="}"&&/[:=\-+?#%/^,@]/.test(t[i])){var u11=Bq(e,t,i,s,n);u11.operation?(c={type:"Indirection",innerOp:u11.operation},i=u11.endIndex):(c={type:"ArrayKeys",array:d11[1],star:d11[2]==="*"},s="")}else c={type:"ArrayKeys",array:d11[1],star:d11[2]==="*"},s="";else if(t[i]==="*"||t[i]==="@"&&!/[QPaAEKkuUL]/.test(t[i+1]||"")){var u12=t[i];i++,c={type:"VarNamePrefix",prefix:s,star:u12==="*"},s=""}else if(i<t.length&&t[i]!=="}"&&/[:=\-+?#%/^,@]/.test(t[i])){var u13=Bq(e,t,i,s,n);u13.operation?(c={type:"Indirection",innerOp:u13.operation},i=u13.endIndex):c={type:"Indirection"}}else c={type:"Indirection"}}else if(a)if(t[i]===":")for(c={type:"LengthSliceError"};i<t.length&&t[i]!=="}";)i++;else t[i]!=="}"&&/[-+=?]/.test(t[i])?e.error("${#".concat(s).concat(t.slice(i,t.indexOf("}",i)),"}: bad substitution")):t[i]==="/"?e.error("${#".concat(s).concat(t.slice(i,t.indexOf("}",i)),"}: bad substitution")):c={type:"Length"};if(!c&&i<t.length&&t[i]!=="}"){var d12=Bq(e,t,i,s,n);c=d12.operation,i=d12.endIndex}if(i<t.length&&t[i]!=="}"){var d13=t[i];if(!/[:\-+=?#%/^,@[]/.test(d13)){var u14=i;for(;u14<t.length&&t[u14]!=="}";)u14++;var p11=t.slice(r,u14+1);e.error("${".concat(p11.slice(2,-1),"}: bad substitution"))}}for(;i<t.length&&t[i]!=="}";)i++;if(i>=t.length)throw new Xu("unexpected EOF while looking for matching '}'",0,0);return{part:Pt.parameterExpansion(s,c),endIndex:i+1}}function Bq(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;var o=r,a=t[o],s=t[o+1]||"";if(a===":"){var l=s;if("-=?+".includes(l)){o+=2;var x=Gv(e,t,o),v=t.slice(o,x),y=Q0(e,v,!1,!1,!0,!1,i,!1,!1,!0),_=Pt.word(FS(y));if(l==="-")return{operation:{type:"DefaultValue",word:_,checkEmpty:!0},endIndex:x};if(l==="=")return{operation:{type:"AssignDefault",word:_,checkEmpty:!0},endIndex:x};if(l==="?")return{operation:{type:"ErrorIfUnset",word:_,checkEmpty:!0},endIndex:x};if(l==="+")return{operation:{type:"UseAlternative",word:_,checkEmpty:!0},endIndex:x}}o++;var c=Gv(e,t,o),d=t.slice(o,c),u=-1,p=0,m=0;for(var x10=0;x10<d.length;x10++){var v10=d[x10];if(v10==="("||v10==="[")p++;else if(v10===")"||v10==="]")p--;else if(v10==="?"&&p===0)m++;else if(v10===":"&&p===0)if(m>0)m--;else{u=x10;break}}var h=u>=0?d.slice(0,u):d,g=u>=0?d.slice(u+1):null;return{operation:{type:"Substring",offset:P_e(e,h),length:g!==null?P_e(e,g):null},endIndex:c}}if("-=?+".includes(a)){o++;var l10=Gv(e,t,o),c10=t.slice(o,l10),d10=Q0(e,c10,!1,!1,!0,!1,i,!1,!1,!0),u10=Pt.word(FS(d10));if(a==="-")return{operation:{type:"DefaultValue",word:u10,checkEmpty:!1},endIndex:l10};if(a==="=")return{operation:{type:"AssignDefault",word:u10,checkEmpty:!1},endIndex:l10};if(a==="?")return{operation:{type:"ErrorIfUnset",word:c10?u10:null,checkEmpty:!1},endIndex:l10};if(a==="+")return{operation:{type:"UseAlternative",word:u10,checkEmpty:!1},endIndex:l10}}if(a==="#"||a==="%"){var l11=s===a,c11=a==="#"?"prefix":"suffix";o+=l11?2:1;var d11=Gv(e,t,o),u11=t.slice(o,d11),p10=Q0(e,u11,!1,!1,!1);return{operation:{type:"PatternRemoval",pattern:Pt.word(FS(p10)),side:c11,greedy:l11},endIndex:d11}}if(a==="/"){var l12=s==="/";o+=l12?2:1;var c12=null;t[o]==="#"?(c12="start",o++):t[o]==="%"&&(c12="end",o++);var d12;c12!==null&&(t[o]==="/"||t[o]==="}")?d12=o:d12=Oxt(e,t,o);var u12=t.slice(o,d12),p11=Q0(e,u12,!1,!1,!1),m10=Pt.word(FS(p11)),h10=null,g10=d12;if(t[d12]==="/"){var x11=d12+1,v11=Gv(e,t,x11),y10=t.slice(x11,v11),_10=Q0(e,y10,!1,!1,!1);h10=Pt.word(FS(_10)),g10=v11}return{operation:{type:"PatternReplacement",pattern:m10,replacement:h10,all:l12,anchor:c12},endIndex:g10}}if(a==="^"||a===","){var l13=s===a,c13=a==="^"?"upper":"lower";o+=l13?2:1;var d13=Gv(e,t,o),u13=t.slice(o,d13),p12=u13?Pt.word([Pt.literal(u13)]):null;return{operation:{type:"CaseModification",direction:c13,all:l13,pattern:p12},endIndex:d13}}return a==="@"&&/[QPaAEKkuUL]/.test(s)?{operation:{type:"Transform",operator:s},endIndex:o+2}:{operation:null,endIndex:o}}function EV(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;var i=r+1;if(i>=t.length)return{part:Pt.literal("$"),endIndex:i};var o=t[i];if(o==="("&&t[i+1]==="(")return e.isDollarDparenSubshell(t,r)?e.parseCommandSubstitution(t,r):e.parseArithmeticExpansion(t,r);if(o==="["){var a=1,s=i+1;for(;s<t.length&&a>0;)t[s]==="["?a++:t[s]==="]"&&a--,a>0&&s++;if(a===0){var l=t.slice(i+1,s),c=Ki(e,l);return{part:Pt.arithmeticExpansion(c),endIndex:s+1}}}return o==="("?e.parseCommandSubstitution(t,r):o==="{"?Yxt(e,t,r,n):/[a-zA-Z_0-9@*#?$!-]/.test(o)?Jxt(e,t,r):{part:Pt.literal("$"),endIndex:i}}function B_e(e,t){var r=[],n=0,i="",o=function(){i&&(r.push(Pt.literal(i)),i="")};for(;n<t.length;){var a=t[n];if(a==="\\"&&n+1<t.length){var s=t[n+1];if(s==="$"||s==="`"||s==='"'||s==="\\"){i+=s,n+=2;continue}i+=a,n++;continue}if(a==="$"){o();var _EV=EV(e,t,n,!0),s10=_EV.part,l=_EV.endIndex;s10&&r.push(s10),n=l;continue}if(a==="`"){o();var _e_parseBacktickSubstitution=e.parseBacktickSubstitution(t,n,!0),s11=_e_parseBacktickSubstitution.part,l10=_e_parseBacktickSubstitution.endIndex;r.push(s11),n=l10;continue}i+=a,n++}return o(),r}function Xxt(e,t,r){var n=[],i=r,o="",a=function(){o&&(n.push(Pt.literal(o)),o="")};for(;i<t.length&&t[i]!=='"';){var s=t[i];if(s==="\\"&&i+1<t.length){var l=t[i+1];if('"\\$`\n'.includes(l)){o+=l,i+=2;continue}o+=s,i++;continue}if(s==="$"){a();var _EV=EV(e,t,i,!0),l10=_EV.part,c=_EV.endIndex;l10&&n.push(l10),i=c;continue}if(s==="`"){a();var _e_parseBacktickSubstitution=e.parseBacktickSubstitution(t,i,!0),l11=_e_parseBacktickSubstitution.part,c10=_e_parseBacktickSubstitution.endIndex;n.push(l11),i=c10;continue}o+=s,i++}return a(),{part:Pt.doubleQuoted(n),endIndex:i}}function Q0(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:!1;if(n)return[Pt.singleQuoted(t)];if(r){var h=B_e(e,t);return[Pt.doubleQuoted(h)]}if(t.length>=2&&t[0]==='"'&&t[t.length-1]==='"'){var h10=t.slice(1,-1),g=!1;for(var x=0;x<h10.length;x++){if(h10[x]==='"'){g=!0;break}h10[x]==="\\"&&x+1<h10.length&&x++}if(!g){var x10=B_e(e,h10);return[Pt.doubleQuoted(x10)]}}var d=[],u=0,p="",m=function(){p&&(d.push(Pt.literal(p)),p="")};for(;u<t.length;){var h11=t[u];if(h11==="\\"&&u+1<t.length){var g10=t[u+1];if(l){m(),d.push(Pt.escaped(g10)),u+=2;continue}var x11=o?g10==="$"||g10==="`"||g10==="\n":g10==="$"||g10==="`"||g10==='"'||g10==="'"||g10==="\n"||c&&g10==="}",v=a?"*?[]\\".includes(g10):"*?[]\\(){}.^+".includes(g10);x11?p+=g10:v?(m(),d.push(Pt.escaped(g10))):p+="\\".concat(g10),u+=2;continue}if(h11==="'"&&!a&&!o){m();var g11=t.indexOf("'",u+1);if(g11===-1){p+=t.slice(u);break}d.push(Pt.singleQuoted(t.slice(u+1,g11))),u=g11+1;continue}if(h11==='"'&&!o){m();var _Xxt=Xxt(e,t,u+1),g12=_Xxt.part,x12=_Xxt.endIndex;d.push(g12),u=x12+1;continue}if(h11==="$"&&t[u+1]==="'"){m();var _Dxt=Dxt(e,t,u+2),g13=_Dxt.part,x13=_Dxt.endIndex;d.push(g13),u=x13;continue}if(h11==="$"){m();var _EV=EV(e,t,u),g14=_EV.part,x14=_EV.endIndex;g14&&d.push(g14),u=x14;continue}if(h11==="`"){m();var _e_parseBacktickSubstitution=e.parseBacktickSubstitution(t,u),g15=_e_parseBacktickSubstitution.part,x15=_e_parseBacktickSubstitution.endIndex;d.push(g15),u=x15;continue}if(h11==="~"){var g16=u>0?t[u-1]:"";if(u===0||g16==="="||i&&g16===":"){var x16=Mxt(e,t,u),v10=t[x16];if(v10===void 0||v10==="/"||v10===":"){m();var y=t.slice(u+1,x16)||null;d.push({type:"TildeExpansion",user:y}),u=x16;continue}}}if("@*+?!".includes(h11)&&u+1<t.length&&t[u+1]==="("){var g17=Qxt(t,u+1);if(g17!==-1){m();var x17=t.slice(u,g17+1);d.push({type:"Glob",pattern:x17}),u=g17+1;continue}}if(h11==="*"||h11==="?"||h11==="["){m();var _$xt=$xt(e,t,u),g18=_$xt.pattern,x18=_$xt.endIndex;d.push({type:"Glob",pattern:g18}),u=x18;continue}if(h11==="{"&&!i&&!s&&!o){var g19=Lxt(e,t,u,Q0);if(g19){m(),d.push(g19.part),u=g19.endIndex;continue}}p+=h11,u++}return m(),d}var eyt=se(function(){"use strict";h_(),Ns(),u_(),pke()});function c_(e,t){return new Pn().parse(e,t)}var Pn,jo=se(function(){"use strict";h_(),Ns(),Bxt(),Vxt(),Kxt(),eyt(),d1(),ike(),u_(),u_(),Pn=/*#__PURE__*/function(){function FW(){_class_call_check(this,FW);A(this,"tokens",[]);A(this,"pos",0);A(this,"pendingHeredocs",[]);A(this,"parseIterations",0);A(this,"parseDepth",0);A(this,"_input","")}_create_class(FW,[{key:"getInput",value:function getInput(){return this._input}},{key:"checkIterationLimit",value:function checkIterationLimit(){if(this.parseIterations++,this.parseIterations>ake)throw new Xu("Maximum parse iterations exceeded (possible infinite loop)",this.current().line,this.current().column)}},{key:"enterDepth",value:function enterDepth(){var _this=this;if(this.parseDepth++,this.parseDepth>RW)throw new Xu("Maximum parser nesting depth exceeded (".concat(RW,")"),this.current().line,this.current().column);return function(){_this.parseDepth--}}},{key:"parse",value:function parse(t,r){if(t.length>IW)throw new Xu("Input too large: ".concat(t.length," bytes exceeds limit of ").concat(IW),1,1);this._input=t;var n=new oke(t,r);if(this.tokens=n.tokenize(),this.tokens.length>PW)throw new Xu("Too many tokens: ".concat(this.tokens.length," exceeds limit of ").concat(PW),1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}},{key:"parseTokens",value:function parseTokens(t){return this.tokens=t,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}},{key:"current",value:function current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}},{key:"peek",value:function peek(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.tokens[this.pos+t]||this.tokens[this.tokens.length-1]}},{key:"advance",value:function advance(){var t=this.current();return this.pos<this.tokens.length-1&&this.pos++,t}},{key:"getPos",value:function getPos(){return this.pos}},{key:"check",value:function check(t,r,n,i){for(var _len=arguments.length,o=new Array(_len>4?_len-4:0),_key=4;_key<_len;_key++){o[_key-4]=arguments[_key]}var s;var a=(s=this.tokens[this.pos])==null?void 0:s.type;return a===t||r!==void 0&&a===r||n!==void 0&&a===n||i!==void 0&&a===i?!0:o.length>0?o.includes(a):!1}},{key:"expect",value:function expect(t,r){if(this.check(t))return this.advance();var n=this.current();throw new Xu(r||"Expected ".concat(t,", got ").concat(n.type),n.line,n.column,n)}},{key:"error",value:function error(t){var r=this.current();throw new Xu(t,r.line,r.column,r)}},{key:"skipNewlines",value:function skipNewlines(){for(;this.check(F.NEWLINE,F.COMMENT);)this.check(F.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}},{key:"skipSeparators",value:function skipSeparators(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;for(;;){if(this.check(F.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(F.SEMICOLON,F.COMMENT)){this.advance();continue}if(t&&this.check(F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND)){this.advance();continue}break}}},{key:"addPendingHeredoc",value:function addPendingHeredoc(t,r,n,i){this.pendingHeredocs.push({redirect:t,delimiter:r,stripTabs:n,quoted:i})}},{key:"processHeredocs",value:function processHeredocs(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.pendingHeredocs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(this.check(F.HEREDOC_CONTENT)){var r=this.advance(),n=void 0;t.quoted?n=Pt.word([Pt.literal(r.value)]):n=this.parseWordFromString(r.value,!1,!1,!1,!0),t.redirect.target=Pt.hereDoc(t.delimiter,n,t.stripTabs,t.quoted)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.pendingHeredocs=[]}},{key:"isStatementEnd",value:function isStatementEnd(){return this.check(F.EOF,F.NEWLINE,F.SEMICOLON,F.AMP,F.AND_AND,F.OR_OR,F.RPAREN,F.RBRACE,F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND)}},{key:"isCommandStart",value:function isCommandStart(){var t=this.current().type;return t===F.WORD||t===F.NAME||t===F.NUMBER||t===F.ASSIGNMENT_WORD||t===F.IF||t===F.FOR||t===F.WHILE||t===F.UNTIL||t===F.CASE||t===F.LPAREN||t===F.LBRACE||t===F.DPAREN_START||t===F.DBRACK_START||t===F.FUNCTION||t===F.BANG||t===F.TIME||t===F.IN||t===F.LESS||t===F.GREAT||t===F.DLESS||t===F.DGREAT||t===F.LESSAND||t===F.GREATAND||t===F.LESSGREAT||t===F.DLESSDASH||t===F.CLOBBER||t===F.TLESS||t===F.AND_GREAT||t===F.AND_DGREAT}},{key:"parseScript",value:function parseScript(){var t=[],r=0;for(this.skipNewlines();!this.check(F.EOF);){r++,r>1e4&&this.error("Parser stuck: too many iterations (>10000)");var n=this.checkUnexpectedToken();if(n){t.push(n),this.skipSeparators(!1);continue}var i=this.pos,o=this.parseStatement();o&&t.push(o),this.skipSeparators(!1),this.check(F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND)&&this.error("syntax error near unexpected token `".concat(this.current().value,"'")),this.pos===i&&!this.check(F.EOF)&&this.advance()}return Pt.script(t)}},{key:"checkUnexpectedToken",value:function checkUnexpectedToken(){var t=this.current().type,r=this.current().value;if((t===F.DO||t===F.DONE||t===F.THEN||t===F.ELSE||t===F.ELIF||t===F.FI||t===F.ESAC)&&this.error("syntax error near unexpected token `".concat(r,"'")),t===F.RBRACE||t===F.RPAREN){var n="syntax error near unexpected token `".concat(r,"'");return this.advance(),Pt.statement([Pt.pipeline([Pt.simpleCommand(null,[],[],[])])],[],!1,{message:n,token:r})}return(t===F.DSEMI||t===F.SEMI_AND||t===F.SEMI_SEMI_AND)&&this.error("syntax error near unexpected token `".concat(r,"'")),t===F.SEMICOLON&&this.error("syntax error near unexpected token `".concat(r,"'")),(t===F.PIPE||t===F.PIPE_AMP)&&this.error("syntax error near unexpected token `".concat(r,"'")),null}},{key:"parseStatement",value:function parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;var t=this.current().start,r=[],n=[],i=!1,o=this.parsePipeline();for(r.push(o);this.check(F.AND_AND,F.OR_OR);){var l=this.advance();n.push(l.type===F.AND_AND?"&&":"||"),this.skipNewlines();var c=this.parsePipeline();r.push(c)}this.check(F.AMP)&&(this.advance(),i=!0);var a=this.pos>0?this.tokens[this.pos-1].end:t,s=this._input.slice(t,a);return Pt.statement(r,n,i,void 0,s)}},{key:"parsePipeline",value:function parsePipeline(){var t=!1,r=!1;this.check(F.TIME)&&(this.advance(),t=!0,this.check(F.WORD,F.NAME)&&this.current().value==="-p"&&(this.advance(),r=!0));var n=0;for(;this.check(F.BANG);)this.advance(),n++;var i=n%2===1,o=[],a=[],s=this.parseCommand();for(o.push(s);this.check(F.PIPE,F.PIPE_AMP);){var l=this.advance();this.skipNewlines(),a.push(l.type===F.PIPE_AMP);var c=this.parseCommand();o.push(c)}return Pt.pipeline(o,i,t,r,a.length>0?a:void 0)}},{key:"parseCommand",value:function parseCommand(){return this.check(F.IF)?M_e(this):this.check(F.FOR)?O_e(this):this.check(F.WHILE)?$_e(this):this.check(F.UNTIL)?N_e(this):this.check(F.CASE)?D_e(this):this.check(F.LPAREN)?L_e(this):this.check(F.LBRACE)?F_e(this):this.check(F.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(F.DBRACK_START)?this.parseConditionalCommand():this.check(F.FUNCTION)?this.parseFunctionDef():this.check(F.NAME,F.WORD)&&this.peek(1).type===F.LPAREN&&this.peek(2).type===F.RPAREN?this.parseFunctionDef():jxt(this)}},{key:"dparenClosesWithSpacedParens",value:function dparenClosesWithSpacedParens(){var t=1,r=1;for(;r<this.tokens.length-this.pos;){var n=this.peek(r);if(n.type===F.EOF)return!1;if(n.type===F.DPAREN_START||n.type===F.LPAREN)t++;else if(n.type===F.DPAREN_END){if(t-=2,t<=0)return!1}else if(n.type===F.RPAREN&&(t--,t===0&&this.peek(r+1).type===F.RPAREN))return!0;r++}return!1}},{key:"parseNestedSubshellsFromDparen",value:function parseNestedSubshellsFromDparen(){this.advance();var t=this.parseCompoundList();this.expect(F.RPAREN),this.expect(F.RPAREN);var r=this.parseOptionalRedirections(),n=Pt.subshell(t,[]);return Pt.subshell([Pt.statement([Pt.pipeline([n],!1,!1,!1)])],r)}},{key:"isWord",value:function isWord(){var t=this.current().type;return t===F.WORD||t===F.NAME||t===F.NUMBER||t===F.IF||t===F.FOR||t===F.WHILE||t===F.UNTIL||t===F.CASE||t===F.FUNCTION||t===F.ELSE||t===F.ELIF||t===F.FI||t===F.THEN||t===F.DO||t===F.DONE||t===F.ESAC||t===F.IN||t===F.SELECT||t===F.TIME||t===F.COPROC||t===F.BANG}},{key:"parseWord",value:function parseWord(){var t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted)}},{key:"parseWordNoBraceExpansion",value:function parseWordNoBraceExpansion(){var t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted,!1,!1,!0)}},{key:"parseWordForRegex",value:function parseWordForRegex(){var t=this.advance();return this.parseWordFromString(t.value,t.quoted,t.singleQuoted,!1,!1,!0,!0)}},{key:"parseWordFromString",value:function parseWordFromString(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1;var l=Q0(this,t,r,n,i,o,!1,a,s);return Pt.word(l)}},{key:"parseCommandSubstitution",value:function parseCommandSubstitution(t,r){var _this=this;return vxt(t,r,function(){return new FW},function(n){return _this.error(n)})}},{key:"parseBacktickSubstitution",value:function parseBacktickSubstitution(t,r){var _this=this;var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return _xt(t,r,n,function(){return new FW},function(i){return _this.error(i)})}},{key:"isDollarDparenSubshell",value:function isDollarDparenSubshell(t,r){return xxt(t,r)}},{key:"parseArithmeticExpansion",value:function parseArithmeticExpansion(t,r){var n=r+3,i=1,o=0,a=n;for(;a<t.length-1&&i>0;)t[a]==="$"&&t[a+1]==="("?t[a+2]==="("?(i++,a+=3):(o++,a+=2):t[a]==="("&&t[a+1]==="("?(i++,a+=2):t[a]===")"&&t[a+1]===")"?o>0?(o--,a++):(i--,i>0&&(a+=2)):t[a]==="("?(o++,a++):(t[a]===")"&&o>0&&o--,a++);var s=t.slice(n,a),l=this.parseArithmeticExpression(s);return{part:Pt.arithmeticExpansion(l),endIndex:a+2}}},{key:"parseArithmeticCommand",value:function parseArithmeticCommand(){var t=this.expect(F.DPAREN_START),r="",n=1,i=0,o=!1,a=!1;for(;n>0&&!this.check(F.EOF);){if(o){if(o=!1,i>0){i--,r+=")";continue}if(this.check(F.RPAREN)){n--,a=!0,this.advance();continue}if(this.check(F.DPAREN_END)){n--,a=!0;continue}r+=")";continue}if(this.check(F.DPAREN_START))n++,r+="((",this.advance();else if(this.check(F.DPAREN_END))i>=2?(i-=2,r+="))",this.advance()):i===1?(i--,r+=")",o=!0,this.advance()):(n--,a=!0,n>0&&(r+="))"),this.advance());else if(this.check(F.LPAREN))i++,r+="(",this.advance();else if(this.check(F.RPAREN))i>0&&i--,r+=")",this.advance();else{var c=this.current().value,d=r.length>0?r[r.length-1]:"";r.length>0&&!r.endsWith(" ")&&!(c==="="&&/[|&^+\-*/%<>]$/.test(r))&&!(c==="<"&&d==="<")&&!(c===">"&&d===">")&&(r+=" "),r+=c,this.advance()}}a||this.expect(F.DPAREN_END);var s=this.parseArithmeticExpression(r.trim()),l=this.parseOptionalRedirections();return Pt.arithmeticCommand(s,l,t.line)}},{key:"parseConditionalCommand",value:function parseConditionalCommand(){var t=this.expect(F.DBRACK_START),r=mke(this);this.expect(F.DBRACK_END);var n=this.parseOptionalRedirections();return Pt.conditionalCommand(r,n,t.line)}},{key:"parseFunctionDef",value:function parseFunctionDef(){var t;if(this.check(F.FUNCTION)){if(this.advance(),this.check(F.NAME)||this.check(F.WORD))t=this.advance().value;else{var i=this.current();throw new Xu("Expected function name",i.line,i.column,i)}this.check(F.LPAREN)&&(this.advance(),this.expect(F.RPAREN))}else t=this.advance().value,t.includes("$")&&this.error("`".concat(t,"': not a valid identifier")),this.expect(F.LPAREN),this.expect(F.RPAREN);this.skipNewlines();var r=this.parseCompoundCommandBody({forFunctionBody:!0}),n=this.parseOptionalRedirections();return Pt.functionDef(t,r,n)}},{key:"parseCompoundCommandBody",value:function parseCompoundCommandBody(t){var r=t==null?void 0:t.forFunctionBody;if(this.check(F.LBRACE))return F_e(this,{skipRedirections:r});if(this.check(F.LPAREN))return L_e(this,{skipRedirections:r});if(this.check(F.IF))return M_e(this,{skipRedirections:r});if(this.check(F.FOR))return O_e(this,{skipRedirections:r});if(this.check(F.WHILE))return $_e(this,{skipRedirections:r});if(this.check(F.UNTIL))return N_e(this,{skipRedirections:r});if(this.check(F.CASE))return D_e(this,{skipRedirections:r});this.error("Expected compound command for function body")}},{key:"parseCompoundList",value:function parseCompoundList(){var t=this.enterDepth(),r=[];for(this.skipNewlines();!this.check(F.EOF,F.FI,F.ELSE,F.ELIF,F.THEN,F.DO,F.DONE,F.ESAC,F.RPAREN,F.RBRACE,F.DSEMI,F.SEMI_AND,F.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();var n=this.pos,i=this.parseStatement();if(i&&r.push(i),this.skipSeparators(),this.pos===n&&!i)break}return t(),r}},{key:"parseOptionalRedirections",value:function parseOptionalRedirections(){var t=[];for(;$W(this);){this.checkIterationLimit();var r=this.pos;if(t.push(NW(this)),this.pos===r)break}return t}},{key:"parseArithmeticExpression",value:function parseArithmeticExpression(t){return Ki(this,t)}}]);return FW}()});function xke(e){var t;return(t=yke.get(e))!=null?t:""}function tyt(e){var t=[],r="",n=0;for(;n<e.length;){var i=e[n];if(i==="["){for(r+=i,n++,n<e.length&&(e[n]==="!"||e[n]==="^")&&(r+=e[n],n++),n<e.length&&e[n]==="]"&&(r+=e[n],n++);n<e.length&&e[n]!=="]";){if(e[n]==="["&&n+1<e.length&&e[n+1]===":"){var o=e.indexOf(":]",n+2);if(o!==-1){r+=e.slice(n,o+2),n=o+2;continue}}if(e[n]==="\\"&&n+1<e.length){r+=e[n]+e[n+1],n+=2;continue}r+=e[n],n++}n<e.length&&e[n]==="]"&&(r+=e[n],n++)}else i===":"?(r!==""&&t.push(r),r="",n++):i==="\\"&&n+1<e.length?(r+=i+e[n+1],n+=2):(r+=i,n++)}return r!==""&&t.push(r),t}function ryt(e){var t="^";for(var r=0;r<e.length;r++){var n=e[r];if(n==="*")t+="[^/]*";else if(n==="?")t+="[^/]";else if(n==="["){var i=r+1,o="[";i<e.length&&(e[i]==="^"||e[i]==="!")&&(o+="^",i++),i<e.length&&e[i]==="]"&&(o+="\\]",i++);var a=i;for(;a<e.length;){if(e[a]==="\\"&&a+1<e.length){a+=2;continue}if(e[a]==="["&&a+1<e.length&&e[a+1]===":"){var l=e.indexOf(":]",a+2);if(l!==-1){a=l+2;continue}}if(e[a]==="]")break;a++}var s=i;for(;i<e.length&&e[i]!=="]";){if(e[i]==="["&&i+1<e.length&&e[i+1]===":"){var l10=e.indexOf(":]",i+2);if(l10!==-1){var c=e.slice(i+2,l10),d=xke(c);o+=d,i=l10+2;continue}}if(e[i]==="\\"&&i+1<e.length){o+="\\".concat(e[i+1]),i+=2;continue}if(e[i]==="-"){var l11=i===s,c10=i+1===a;l11||c10?o+="\\-":o+="-"}else o+=e[i];i++}o+="]",t+=o,r=i}else if(n==="\\"&&r+1<e.length){var i10=e[r+1];/[.+^${}()|\\*?[\]]/.test(i10)?t+="\\".concat(i10):t+=i10,r++}else/[.+^${}()|]/.test(n)?t+="\\".concat(n):t+=n}return t+="$",ir(t)}function q_e(e,t){var r=1,n=t+1;for(;n<e.length&&r>0;){var i=e[n];if(i==="\\"){n+=2;continue}if(i==="(")r++;else if(i===")"&&(r--,r===0))return n;n++}return-1}function W_e(e){var t=[],r="",n=0,i=!1,o=0;for(;o<e.length;){var a=e[o];if(a==="'"&&!i){i=!0,r+="\0QUOTE_START\0",o++;continue}if(a==="'"&&i){i=!1,r+="\0QUOTE_END\0",o++;continue}if(i){r+=a,o++;continue}if(a==="\\"){r+=a,o+1<e.length?(r+=e[o+1],o+=2):o++;continue}a==="("?(n++,r+=a):a===")"?(n--,r+=a):a==="|"&&n===0?(t.push(r),r=""):r+=a,o++}return t.push(r),t}var yke,nyt=se(function(){"use strict";Ei(),yke=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9a-fA-F"]])}),qq,eP,TV=se(function(){"use strict";jr(),Ei(),n5(),nyt(),qq=5,eP=/*#__PURE__*/function(){function eP1(e,t,r,n){_class_call_check(this,eP1);A(this,"fs");A(this,"cwd");A(this,"globignorePatterns",[]);A(this,"hasGlobignore",!1);A(this,"globstar",!1);A(this,"nullglob",!1);A(this,"failglob",!1);A(this,"dotglob",!1);A(this,"extglob",!1);A(this,"globskipdots",!0);A(this,"ops",{count:0});A(this,"maxOps");var o,a,s,l,c,d,u;this.fs=e,this.cwd=t,typeof n=="boolean"?(this.globstar=n,this.maxOps=1e5):n?(this.globstar=(o=n.globstar)!=null?o:!1,this.nullglob=(a=n.nullglob)!=null?a:!1,this.failglob=(s=n.failglob)!=null?s:!1,this.dotglob=(l=n.dotglob)!=null?l:!1,this.extglob=(c=n.extglob)!=null?c:!1,this.globskipdots=(d=n.globskipdots)!=null?d:!0,this.maxOps=(u=n.maxGlobOperations)!=null?u:1e5):this.maxOps=1e5;var i=r==null?void 0:r.get("GLOBIGNORE");i!==void 0&&i!==""&&(this.hasGlobignore=!0,this.globignorePatterns=tyt(i))}_create_class(eP1,[{key:"checkOpsLimit",value:function checkOpsLimit(){if(++this.ops.count>this.maxOps)throw new Qt("Glob operation limit exceeded (".concat(this.maxOps,")"),"glob_operations")}},{key:"hasNullglob",value:function hasNullglob(){return this.nullglob}},{key:"hasFailglob",value:function hasFailglob(){return this.failglob}},{key:"filterGlobignore",value:function filterGlobignore(e){var _this=this;return!this.hasGlobignore&&!this.globskipdots?e:e.filter(function(t){var r=t.split("/").pop()||t;if((_this.hasGlobignore||_this.globskipdots)&&(r==="."||r===".."))return!1;if(_this.hasGlobignore){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_this.globignorePatterns[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(_this.matchGlobignorePattern(t,n))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return!0})}},{key:"matchGlobignorePattern",value:function matchGlobignorePattern(e,t){return ryt(t).test(e)}},{key:"isGlobPattern",value:function isGlobPattern(e){return!!(e.includes("*")||e.includes("?")||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}},{key:"expandArgs",value:function expandArgs(e,t){return _async_to_generator(function(){var _this,r,n,i,o,_i1,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;r=e.map(function(o,a){var s;return(s=t==null?void 0:t[a])!=null&&s||!_this.isGlobPattern(o)?null:_this.expand(o)});return[4,Promise.all(r.map(function(o){return o||Promise.resolve(null)}))];case 1:n=_state.sent(),i=[];for(o=0;o<e.length;o++){;a=n[o];a===null?i.push(e[o]):a.length>0?(_i1=i).push.apply(_i1,_to_consumable_array(a)):i.push(e[o])}return[2,i]}})}).call(this)}},{key:"expand",value:function expand(e){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,t,r10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.globstar){r=e.split("/"),n=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;if(i==="**"&&(n++,n>qq))throw new Qt("Glob pattern has too many ** segments (max ".concat(qq,")"),"glob_operations")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(!(e.includes("**")&&this.globstar&&this.isGlobstarValid(e)))return[3,2];return[4,this.expandRecursive(e)];case 1:t=_state.sent();return[3,4];case 2:r10=e.replace(/\*\*+/g,"*");return[4,this.expandSimple(r10)];case 3:t=_state.sent();_state.label=4;case 4:return[2,this.filterGlobignore(t)]}})}).call(this)}},{key:"isGlobstarValid",value:function isGlobstarValid(e){var t=e.split("/");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(r.includes("**")&&r!=="**")return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}},{key:"hasGlobChars",value:function hasGlobChars(e){return!!(e.includes("*")||e.includes("?")||/\[.*\]/.test(e)||this.extglob&&/[@*+?!]\(/.test(e))}},{key:"expandSimple",value:function expandSimple(e){return _async_to_generator(function(){var t,r,n,s,i,o,s10,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e.startsWith("/"),r=e.split("/").filter(function(s){return s!==""}),n=-1;for(s=0;s<r.length;s++)if(this.hasGlobChars(r[s])){n=s;break}if(n===-1)return[2,[e]];if(n===0)t?(i="/",o="/"):(i=this.cwd,o="");else{s10=r.slice(0,n);t?(i="/".concat(s10.join("/")),o="/".concat(s10.join("/"))):(i=this.fs.resolvePath(this.cwd,s10.join("/")),o=s10.join("/"))}a=r.slice(n);return[4,this.expandSegments(i,o,a)];case 1:return[2,_state.sent().sort()]}})}).call(this)}},{key:"expandSegments",value:function expandSegments(e,t,r){return _async_to_generator(function(){var _this,_r1,n,i,o,_o1,_$a,s,l,c,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u10,p10,m,d,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,u11,_o2,_$a1,s10,l10,c10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_this1,_loop,_iterator2,_step2,d10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,u12,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.checkOpsLimit(),r.length===0)return[2,[t]];_r1=_to_array(r),n=_r1[0],i=_r1.slice(1),o=[];_state.label=1;case 1:_state.trys.push([1,8,,9]);if(!this.fs.readdirWithFileTypes)return[3,4];this.checkOpsLimit();return[4,this.fs.readdirWithFileTypes(e)];case 2:_$a=_state.sent(),s=[],l=_to_consumable_array(_$a),c=this.dotglob||this.hasGlobignore;if(n.startsWith(".")||this.dotglob){u=_$a.some(function(m){return m.name==="."}),p=_$a.some(function(m){return m.name===".."});u||l.push({name:".",isFile:!1,isDirectory:!0,isSymbolicLink:!1}),p||l.push({name:"..",isFile:!1,isDirectory:!0,isSymbolicLink:!1})}_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=l[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u10=_step.value;if(!(u10.name.startsWith(".")&&!n.startsWith(".")&&!c)&&this.matchPattern(u10.name,n)){p10=e==="/"?"/".concat(u10.name):"".concat(e,"/").concat(u10.name),m=void 0;t===""?m=u10.name:t==="/"?m="/".concat(u10.name):m="".concat(t,"/").concat(u10.name),i.length===0?s.push(Promise.resolve([m])):u10.isDirectory&&s.push(this.expandSegments(p10,m,i))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,Promise.all(s)];case 3:d=_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=d[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){u11=_step1.value;(_o1=o).push.apply(_o1,_to_consumable_array(u11))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[3,7];case 4:this.checkOpsLimit();return[4,this.fs.readdir(e)];case 5:_$a1=_state.sent(),s10=[],l10=_to_consumable_array(_$a1),c10=this.dotglob||this.hasGlobignore;(n.startsWith(".")||this.dotglob)&&(_$a1.includes(".")||l10.push("."),_$a1.includes("..")||l10.push(".."));_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{_loop=function(){var u=_step2.value;if(!(u.startsWith(".")&&!n.startsWith(".")&&!c10)&&_this1.matchPattern(u,n)){var p=e==="/"?"/".concat(u):"".concat(e,"/").concat(u),m=void 0;t===""?m=u:t==="/"?m="/".concat(u):m="".concat(t,"/").concat(u),i.length===0?s10.push(Promise.resolve([m])):s10.push(function(){return _async_to_generator(function(){var h;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);this.checkOpsLimit();return[4,this.fs.stat(p)];case 1:if(_state.sent().isDirectory)return[2,this.expandSegments(p,m,i)];return[3,3];case 2:h=_state.sent();if(_instanceof(h,Qt))throw h;return[3,3];case 3:return[2,[]]}})}).call(_this)}())}};for(_iterator2=l10[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true)_this1=this,_loop()}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[4,Promise.all(s10)];case 6:d10=_state.sent();_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=d10[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){u12=_step3.value;(_o2=o).push.apply(_o2,_to_consumable_array(u12))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}_state.label=7;case 7:return[3,9];case 8:a=_state.sent();if(_instanceof(a,Qt))throw a;return[3,9];case 9:return[2,o]}})}).call(this)}},{key:"expandRecursive",value:function expandRecursive(e){return _async_to_generator(function(){var t,r,n,i,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=[],r=e.indexOf("**"),n=e.slice(0,r).replace(/\/$/,"")||".",i=e.slice(r+2).replace(/^\//,"");if(!(i.includes("**")&&this.isGlobstarValid(i)))return[3,2];return[4,this.walkDirectoryMultiGlobstar(n,i,t)];case 1:_tmp=(_state.sent(),_to_consumable_array(new Set(t)).sort());return[3,4];case 2:return[4,this.walkDirectory(n,i,t)];case 3:_tmp=(_state.sent(),t.sort());_state.label=4;case 4:return[2,_tmp]}})}).call(this)}},{key:"walkDirectoryMultiGlobstar",value:function walkDirectoryMultiGlobstar(e,t,r){return _async_to_generator(function(){var _this,n,_$i,_tmp,_r1,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,a,s,l10,c10,_r2,o10,a9,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,c11,d,u,p,err,s10,l11,c12,d10,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.checkOpsLimit();n=this.fs.resolvePath(this.cwd,e);_state.label=1;case 1:_state.trys.push([1,27,,28]);this.checkOpsLimit();if(!this.fs.readdirWithFileTypes)return[3,3];return[4,this.fs.readdirWithFileTypes(n)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=null;_state.label=4;case 4:_$i=_tmp;if(!_$i)return[3,10];o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l=_step.value;c=e==="."?l.name:"".concat(e,"/").concat(l.name);l.isDirectory&&o.push(c)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}a=e==="."?t:"".concat(e,"/").concat(t);return[4,this.expandRecursive(a)];case 5:s=_state.sent();(_r1=r).push.apply(_r1,_to_consumable_array(s));l10=0;_state.label=6;case 6:if(!(l10<o.length))return[3,9];c10=o.slice(l10,l10+100);return[4,Promise.all(c10.map(function(d){return _this.walkDirectoryMultiGlobstar(d,t,r)}))];case 7:_state.sent();_state.label=8;case 8:l10+=100;return[3,6];case 9:return[3,26];case 10:this.checkOpsLimit();return[4,this.fs.readdir(n)];case 11:o10=_state.sent(),a9=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=12;case 12:_state.trys.push([12,19,20,21]);_iterator1=o10[Symbol.iterator]();_state.label=13;case 13:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,18];c11=_step1.value;d=e==="."?c11:"".concat(e,"/").concat(c11),u=this.fs.resolvePath(this.cwd,d);_state.label=14;case 14:_state.trys.push([14,16,,17]);this.checkOpsLimit();return[4,this.fs.stat(u)];case 15:_state.sent().isDirectory&&a9.push(d);return[3,17];case 16:p=_state.sent();if(_instanceof(p,Qt))throw p;return[3,17];case 17:_iteratorNormalCompletion1=true;return[3,13];case 18:return[3,21];case 19:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,21];case 20:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 21:s10=e==="."?t:"".concat(e,"/").concat(t);return[4,this.expandRecursive(s10)];case 22:l11=_state.sent();(_r2=r).push.apply(_r2,_to_consumable_array(l11));c12=0;_state.label=23;case 23:if(!(c12<a9.length))return[3,26];d10=a9.slice(c12,c12+100);return[4,Promise.all(d10.map(function(u){return _this.walkDirectoryMultiGlobstar(u,t,r)}))];case 24:_state.sent();_state.label=25;case 25:c12+=100;return[3,23];case 26:return[3,28];case 27:i=_state.sent();if(_instanceof(i,Qt))throw i;return[3,28];case 28:return[2]}})}).call(this)}},{key:"walkDirectory",value:function walkDirectory(e,t,r){return _async_to_generator(function(){var _this,n,_r1,_$i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,s10,l10,_$i1,o10,s11,_o1,l11,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,s12,a9,s13,l12,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;this.checkOpsLimit();n=this.fs.resolvePath(this.cwd,e);_state.label=1;case 1:_state.trys.push([1,17,,18]);if(!this.fs.readdirWithFileTypes)return[3,7];this.checkOpsLimit();return[4,this.fs.readdirWithFileTypes(n)];case 2:_$i=_state.sent(),o=[],a=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s=_step.value;l=e==="."?s.name:"".concat(e,"/").concat(s.name);s.isDirectory?a.push(l):t&&this.matchPattern(s.name,t)&&o.push(l)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}(_r1=r).push.apply(_r1,_to_consumable_array(o));s10=0;_state.label=3;case 3:if(!(s10<a.length))return[3,6];l10=a.slice(s10,s10+100);return[4,Promise.all(l10.map(function(c){return _this.walkDirectory(c,t,r)}))];case 4:_state.sent();_state.label=5;case 5:s10+=100;return[3,3];case 6:return[3,16];case 7:this.checkOpsLimit();return[4,this.fs.readdir(n)];case 8:_$i1=_state.sent(),o10=[];s11=0;_state.label=9;case 9:if(!(s11<_$i1.length))return[3,12];l11=_$i1.slice(s11,s11+100);return[4,Promise.all(l11.map(function(d){return _async_to_generator(function(){var u,p,_$m,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:u=e==="."?d:"".concat(e,"/").concat(d),p=this.fs.resolvePath(this.cwd,u);_state.label=1;case 1:_state.trys.push([1,3,,4]);this.checkOpsLimit();return[4,this.fs.stat(p)];case 2:_$m=_state.sent();return[2,{name:d,path:u,isDirectory:_$m.isDirectory}];case 3:m=_state.sent();if(_instanceof(m,Qt))throw m;return[2,null];case 4:return[2]}})}).call(_this)}))];case 10:c=_state.sent();(_o1=o10).push.apply(_o1,_to_consumable_array(c.filter(function(d){return d!==null})));_state.label=11;case 11:s11+=100;return[3,9];case 12:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=o10[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){s12=_step1.value;!s12.isDirectory&&t&&this.matchPattern(s12.name,t)&&r.push(s12.path)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}a9=o10.filter(function(s){return s.isDirectory});s13=0;_state.label=13;case 13:if(!(s13<a9.length))return[3,16];l12=a9.slice(s13,s13+100);return[4,Promise.all(l12.map(function(c){return _this.walkDirectory(c.path,t,r)}))];case 14:_state.sent();_state.label=15;case 15:s13+=100;return[3,13];case 16:return[3,18];case 17:i=_state.sent();if(_instanceof(i,Qt))throw i;return[3,18];case 18:return[2]}})}).call(this)}},{key:"matchPattern",value:function matchPattern(e,t){return this.patternToRegex(t).test(e)}},{key:"patternToRegex",value:function patternToRegex(e){var t=this.patternToRegexStr(e);return ir("^".concat(t,"$"))}},{key:"patternToRegexStr",value:function patternToRegexStr(e){var _this,_loop=function(n10){if(e.slice(n10,n10+13)==="\0QUOTE_START\0"){r=!0,n10+=12;return n=n10,"continue"}if(e.slice(n10,n10+11)==="\0QUOTE_END\0"){r=!1,n10+=10;return n=n10,"continue"}var i=e[n10];if(r){/[.+^${}()|\\*?[\]]/.test(i)?t+="\\".concat(i):t+=i;return n=n10,"continue"}if(_this.extglob&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&n10+1<e.length&&e[n10+1]==="("){var o=q_e(e,n10+1);if(o!==-1){var a=e.slice(n10+2,o),s=W_e(a),l=s.map(function(d){return _this1.patternToRegexStr(d)}),c=l.length>0?l.join("|"):"(?:)";if(i==="@")t+="(?:".concat(c,")");else if(i==="*")t+="(?:".concat(c,")*");else if(i==="+")t+="(?:".concat(c,")+");else if(i==="?")t+="(?:".concat(c,")?");else if(i==="!")if(o<e.length-1){var d=s.map(function(u){return _this1.computePatternLength(u)});if(d.every(function(u){return u!==null})&&d.every(function(u){return u===d[0]})&&d[0]!==null){var u=d[0];if(u===0)t+="(?:.+)";else{var p=[];u>0&&p.push(".{0,".concat(u-1,"}")),p.push(".{".concat(u+1,",}")),p.push("(?!(?:".concat(c,")).{").concat(u,"}")),t+="(?:".concat(p.join("|"),")")}}else t+="(?:(?!(?:".concat(c,")).)*?")}else t+="(?!(?:".concat(c,")$).*");n10=o;return n=n10,"continue"}}if(i==="*")t+=".*";else if(i==="?")t+=".";else if(i==="["){var o10=n10+1,a9="[";o10<e.length&&(e[o10]==="^"||e[o10]==="!")&&(a9+="^",o10++),o10<e.length&&e[o10]==="]"&&(a9+="\\]",o10++);var s10=o10;for(;s10<e.length;){if(e[s10]==="\\"&&s10+1<e.length){s10+=2;continue}if(e[s10]==="["&&s10+1<e.length&&e[s10+1]===":"){var c10=e.indexOf(":]",s10+2);if(c10!==-1){s10=c10+2;continue}}if(e[s10]==="]")break;s10++}var l10=o10;for(;o10<e.length&&e[o10]!=="]";){if(e[o10]==="["&&o10+1<e.length&&e[o10+1]===":"){var c11=e.indexOf(":]",o10+2);if(c11!==-1){var d10=e.slice(o10+2,c11),u10=xke(d10);a9+=u10,o10=c11+2;continue}}if(e[o10]==="\\"&&o10+1<e.length){a9+="\\".concat(e[o10+1]),o10+=2;continue}if(e[o10]==="-"){var c12=o10===l10,d11=o10+1===s10;c12||d11?a9+="\\-":a9+="-"}else a9+=e[o10];o10++}a9+="]",t+=a9,n10=o10}else if(i==="\\"&&n10+1<e.length){var o11=e[n10+1];/[.+^${}()|\\*?[\]]/.test(o11)?t+="\\".concat(o11):t+=o11,n10++}else/[.+^${}()|]/.test(i)?t+="\\".concat(i):t+=i;n=n10,void 0};var _this1=this;var t="",r=!1;for(var n=0;n<e.length;n++)_this=this,_loop(n);return t}},{key:"computePatternLength",value:function computePatternLength(e){var _loop=function(){if(e.slice(r,r+13)==="\0QUOTE_START\0"){n=!0,r+=13;return"continue"}if(e.slice(r,r+11)==="\0QUOTE_END\0"){n=!1,r+=11;return"continue"}var i=e[r];if(n){t+=1,r++;return"continue"}if((i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&r+1<e.length&&e[r+1]==="("){var o=q_e(e,r+1);if(o!==-1){if(i==="@"){var a=e.slice(r+2,o),s=W_e(a).map(function(l){return _this.computePatternLength(l)});if(s.every(function(l){return l!==null})&&s.every(function(l){return l===s[0]})){t+=s[0],r=o+1;return"continue"}return{v:null}}return{v:null}}}if(i==="*")return{v:null};if(i==="?"){t+=1,r++;return"continue"}if(i==="["){var o10=e.indexOf("]",r+1);if(o10!==-1){t+=1,r=o10+1;return"continue"}t+=1,r++;return"continue"}if(i==="\\"){t+=1,r+=2;return"continue"}t+=1,r++};var _this=this;var t=0,r=0,n=!1;for(;r<e.length;){var _ret=_loop();if(_type_of(_ret)==="object")return _ret.v}return t}}]);return eP1}()});function vke(e){for(var t=0;t<e.length;t++){if(e[t]==="\\"){t++;continue}if(e[t]==="$"){var r=e[t+1];if(r==="{"||r&&/[a-zA-Z_]/.test(r))return!0}}return!1}function iyt(e){var n;if(!e.operation)return!1;var t=e.operation,r;if((t.type==="DefaultValue"||t.type==="AssignDefault"||t.type==="UseAlternative"||t.type==="ErrorIfUnset")&&(r=(n=t.word)==null?void 0:n.parts),!r)return!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.type==="DoubleQuoted"||i.type==="SingleQuoted")return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function oyt(e){var n;if(!e.operation)return!1;var t=e.operation,r;if((t.type==="DefaultValue"||t.type==="AssignDefault"||t.type==="UseAlternative"||t.type==="ErrorIfUnset")&&(r=(n=t.word)==null?void 0:n.parts),!r||r.length===0)return!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.type!=="DoubleQuoted"&&i.type!=="SingleQuoted")return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}function zW(e){var l,c,d,u,p,m;var t=!1,r=!1,n=!1,i=!1,o=!1,a=!1,s=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if((h.type==="SingleQuoted"||h.type==="DoubleQuoted")&&(t=!0,h.type==="DoubleQuoted"))try{for(var _iterator1=h.parts[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g=_step1.value;g.type==="ParameterExpansion"&&(g.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/)&&(!g.operation||g.operation.type==="PatternRemoval"||g.operation.type==="PatternReplacement")&&(i=!0),(((l=g.operation)==null?void 0:l.type)==="VarNamePrefix"||((c=g.operation)==null?void 0:c.type)==="ArrayKeys")&&(a=!0),((d=g.operation)==null?void 0:d.type)==="Indirection"&&(s=!0))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}h.type==="CommandSubstitution"&&(r=!0),h.type==="ParameterExpansion"&&(o=!0,(h.parameter==="@"||h.parameter==="*")&&(n=!0),iyt(h)&&(t=!0),(((u=h.operation)==null?void 0:u.type)==="VarNamePrefix"||((p=h.operation)==null?void 0:p.type)==="ArrayKeys")&&(a=!0),((m=h.operation)==null?void 0:m.type)==="Indirection"&&(s=!0)),h.type==="Glob"&&vke(h.pattern)&&(o=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{hasQuoted:t,hasCommandSub:r,hasArrayVar:n,hasArrayAtExpansion:i,hasParamExpansion:o,hasVarNamePrefixExpansion:a,hasIndirection:s}}var AV=se(function(){"use strict"});function Os(e,t){var r="".concat(t,"_"),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.startsWith(r)){var o=i.slice(r.length),a=Number.parseInt(o,10);!Number.isNaN(a)&&String(a)===o&&n.push(a)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n.sort(function(i,o){return i-o})}function o_(e,t){var r="".concat(t,"_");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;n.startsWith(r)&&e.state.env.delete(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function p1(e,t){var r="".concat(t,"_"),n="".concat(t,"__length"),i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(o!==n&&o.startsWith(r)){var a=o.slice(r.length);if(a.startsWith("_length"))continue;i.push(a)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i.sort()}function IV(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function _ke(e){if(e.parts.length<2)return null;var t=e.parts[0],r=e.parts[1];if(t.type!=="Glob"||!t.pattern.startsWith("["))return null;var n,i=r,o=1;if(r.type==="Literal"&&r.value.startsWith("]")){var u=r.value.slice(1);if(u.startsWith("+=")||u.startsWith("="))n=t.pattern.slice(1);else if(u===""){if(e.parts.length<3)return null;var p=e.parts[2];if(p.type!=="Literal"||!p.value.startsWith("=")&&!p.value.startsWith("+="))return null;n=t.pattern.slice(1),i=p,o=2}else return null}else if(t.pattern==="["&&(r.type==="DoubleQuoted"||r.type==="SingleQuoted")){if(e.parts.length<3)return null;var u10=e.parts[2];if(u10.type!=="Literal"||!u10.value.startsWith("]=")&&!u10.value.startsWith("]+="))return null;if(r.type==="SingleQuoted")n=r.value;else{n="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p10=_step.value;(p10.type==="Literal"||p10.type==="Escaped")&&(n+=p10.value)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}i=u10,o=2}else if(t.pattern.endsWith("]")){if(r.type!=="Literal"||!r.value.startsWith("=")&&!r.value.startsWith("+="))return null;n=t.pattern.slice(1,-1)}else return null;n=IV(n);var a;if(i.type!=="Literal")return null;i.value.startsWith("]=")||i.value.startsWith("]+=")?a=i.value.slice(1):a=i.value;var s=a.startsWith("+=");if(!s&&!a.startsWith("="))return null;var l=[],c=s?2:1,d=a.slice(c);d&&l.push({type:"Literal",value:d});for(var u11=o+1;u11<e.parts.length;u11++){var p11=e.parts[u11];p11.type==="BraceExpansion"?l.push({type:"Literal",value:ayt(p11)}):l.push(p11)}return{key:n,valueParts:l,append:s}}function ayt(e){return"{".concat(e.items.map(function(t){var r,n;if(t.type==="Range"){var i=(r=t.startStr)!=null?r:String(t.start),o=(n=t.endStr)!=null?n:String(t.end),a="".concat(i,"..").concat(o);return t.step&&(a+="..".concat(t.step)),a}return tP(t.word)}).join(","),"}")}function tP(e){var t="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r.type){case"Literal":t+=r.value;break;case"Glob":t+=r.pattern;break;case"SingleQuoted":t+=r.value;break;case"DoubleQuoted":var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r.parts[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var n=_step1.value;(n.type==="Literal"||n.type==="Escaped")&&(t+=n.value)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break;case"Escaped":t+=r.value;break;case"BraceExpansion":t+="{",t+=r.items.map(function(n){return n.type==="Range"?"".concat(n.startStr,"..").concat(n.endStr).concat(n.step?"..".concat(n.step):""):tP(n.word)}).join(","),t+="}";break;case"TildeExpansion":t+="~",r.user&&(t+=r.user);break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var nd=se(function(){"use strict"});function us(e){var t;return(t=e.get("IFS"))!=null?t:" \n"}function bl(e){return e.get("IFS")===""}function PV(e){var t=us(e);if(t==="")return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(r!==" "&&r!==" "&&r!=="\n")return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}function syt(e){var t=!1,r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.split("")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;n==="-"?t=!0:/[\\^$.*+?()[\]{}|]/.test(n)?r.push("\\".concat(n)):n===" "?r.push("\\t"):n==="\n"?r.push("\\n"):r.push(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t&&r.push("\\-"),r.join("")}function an(e){var t=e.get("IFS");return t===void 0?" ":t[0]||""}function lyt(e){return bke.includes(e)}function RV(e){var t=new Set,r=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;lyt(n)?t.add(n):r.add(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{whitespace:t,nonWhitespace:r}}function V_e(e,t,r,n){if(t==="")return e===""?{words:[],wordStarts:[]}:{words:[e],wordStarts:[0]};var _RV=RV(t),i=_RV.whitespace,o=_RV.nonWhitespace,a=[],s=[],l=0;for(;l<e.length&&i.has(e[l]);)l++;if(l>=e.length)return{words:[],wordStarts:[]};if(o.has(e[l]))for(a.push(""),s.push(l),l++;l<e.length&&i.has(e[l]);)l++;for(;l<e.length&&!(r!==void 0&&a.length>=r);){var c=l;for(s.push(c);l<e.length;){var d=e[l];if(!n&&d==="\\"){l++,l<e.length&&l++;continue}if(i.has(d)||o.has(d))break;l++}if(a.push(e.substring(c,l)),l>=e.length)break;for(;l<e.length&&i.has(e[l]);)l++;if(l<e.length&&o.has(e[l])){for(l++;l<e.length&&i.has(e[l]);)l++;for(;l<e.length&&o.has(e[l])&&!(r!==void 0&&a.length>=r);)for(a.push(""),s.push(l),l++;l<e.length&&i.has(e[l]);)l++}}return{words:a,wordStarts:s}}function MV(e,t){if(t==="")return{words:e?[e]:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};if(e==="")return{words:[],hadLeadingDelimiter:!1,hadTrailingDelimiter:!1};var _RV=RV(t),r=_RV.whitespace,n=_RV.nonWhitespace,i=[],o=0,a=!1,s=!1,l=o;for(;o<e.length&&r.has(e[o]);)o++;if(o>l&&(a=!0),o>=e.length)return{words:[],hadLeadingDelimiter:!0,hadTrailingDelimiter:!0};if(n.has(e[o]))for(i.push(""),o++;o<e.length&&r.has(e[o]);)o++;for(;o<e.length;){var c=o;for(;o<e.length;){var u=e[o];if(r.has(u)||n.has(u))break;o++}if(i.push(e.substring(c,o)),o>=e.length){s=!1;break}var d=o;for(;o<e.length&&r.has(e[o]);)o++;if(o<e.length&&n.has(e[o])){for(o++;o<e.length&&r.has(e[o]);)o++;for(;o<e.length&&n.has(e[o]);)for(i.push(""),o++;o<e.length&&r.has(e[o]);)o++}o>=e.length&&o>d&&(s=!0)}return{words:i,hadLeadingDelimiter:a,hadTrailingDelimiter:s}}function _i(e,t){return MV(e,t).words}function uyt(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(t.has(r))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function cyt(e,t,r){if(t==="")return e;var _RV=RV(t),n=_RV.whitespace,i=_RV.nonWhitespace,o=e.length;for(;o>0&&n.has(e[o-1]);){if(!r&&o>=2){var s=0,l=o-2;for(;l>=0&&e[l]==="\\";)s++,l--;if(s%2===1)break}o--}var a=e.substring(0,o);if(a.length>=1&&i.has(a[a.length-1])){if(!r&&a.length>=2){var l10=0,c=a.length-2;for(;c>=0&&a[c]==="\\";)l10++,c--;if(l10%2===1)return a}var s10=a.substring(0,a.length-1);if(!uyt(s10,i))return s10}return a}var bke,oc=se(function(){"use strict";bke=" \n"});function no(e,t){var r,n;return(n=(r=e.state.namerefs)==null?void 0:r.has(t))!=null?n:!1}function J0(e,t){var r,n;(n=(r=e.state).namerefs)!=null||(r.namerefs=new Set),e.state.namerefs.add(t)}function dyt(e,t){var r,n,i;(r=e.state.namerefs)==null||r.delete(t),(n=e.state.boundNamerefs)==null||n.delete(t),(i=e.state.invalidNamerefs)==null||i.delete(t)}function pyt(e,t){var r,n;(n=(r=e.state).invalidNamerefs)!=null||(r.invalidNamerefs=new Set),e.state.invalidNamerefs.add(t)}function wke(e,t){var r,n;return(n=(r=e.state.invalidNamerefs)==null?void 0:r.has(t))!=null?n:!1}function G_e(e,t){var r,n;(n=(r=e.state).boundNamerefs)!=null||(r.boundNamerefs=new Set),e.state.boundNamerefs.add(t)}function jW(e,t){var n,i;var r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(r){var o=r[1],a=Array.from(e.state.env.keys()).some(function(l){return l.startsWith("".concat(o,"_"))&&!l.includes("__")}),s=(i=(n=e.state.associativeArrays)==null?void 0:n.has(o))!=null?i:!1;return a||s}return Array.from(e.state.env.keys()).some(function(o){return o.startsWith("".concat(t,"_"))&&!o.includes("__")})?!0:e.state.env.has(t)}function gp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100;if(!no(e,t)||wke(e,t))return t;var n=new Set,i=t;for(;r-- >0;){if(n.has(i))return;if(n.add(i),!no(e,i))return i;var o=e.state.env.get(i);if(o===void 0||o===""||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(o))return i;i=o}}function rP(e,t){if(no(e,t))return e.state.env.get(t)}function fyt(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:100;if(!no(e,t)||wke(e,t))return t;var i=new Set,o=t;for(;n-- >0;){if(i.has(o))return;if(i.add(o),!no(e,o))return o;var a=e.state.env.get(o);if(a===void 0||a==="")return r!==void 0?/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)&&jW(e,r)?o:null:o;if(!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(a))return o;o=a}}var _p=se(function(){"use strict"});function myt(e,t){var r=t.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,function(n,i){var o;return(o=e.state.env.get(i))!=null?o:""});return r=r.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,function(n,i){var o;return(o=e.state.env.get(i))!=null?o:""}),r}function zr(e,t){var r,n,i,o;return t==="FUNCNAME"?((r=e.state.funcNameStack)!=null?r:[]).map(function(a,s){return[s,a]}):t==="BASH_LINENO"?((n=e.state.callLineStack)!=null?n:[]).map(function(a,s){return[s,String(a)]}):t==="BASH_SOURCE"?((i=e.state.sourceStack)!=null?i:[]).map(function(a,s){return[s,a]}):(o=e.state.associativeArrays)!=null&&o.has(t)?p1(e,t).map(function(a){var s;return[a,(s=e.state.env.get("".concat(t,"_").concat(a)))!=null?s:""]}):Os(e,t).map(function(a){var s;return[a,(s=e.state.env.get("".concat(t,"_").concat(a)))!=null?s:""]})}function d_(e,t){var r,n,i,o,a,s,l;return t==="FUNCNAME"?((n=(r=e.state.funcNameStack)==null?void 0:r.length)!=null?n:0)>0:t==="BASH_LINENO"?((o=(i=e.state.callLineStack)==null?void 0:i.length)!=null?o:0)>0:t==="BASH_SOURCE"?((s=(a=e.state.sourceStack)==null?void 0:a.length)!=null?s:0)>0:(l=e.state.associativeArrays)!=null&&l.has(t)?p1(e,t).length>0:Os(e,t).length>0}function Hn(_01,_11){return _async_to_generator(function(e,t){var r,n,a,s,l,c,d,u,p,m,h,g,x,v,y,y10,_,b,y11,y12,y13,i,y14,_10,S,S10,k,S11,S12,k10,S13,S14,k11,b10,S15,k12,S16,k13,_Math,S17,k14,E,w,S18,y15,y16,_11,o,y17;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!0,n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:!1;switch(t){case"?":return[2,String(e.state.lastExitCode)];case"$":return[2,String(e.state.virtualPid)];case"#":return[2,e.state.env.get("#")||"0"];case"@":return[2,e.state.env.get("@")||""];case"_":return[2,e.state.lastArg];case"-":{y="";return[2,(y+="h",e.state.options.errexit&&(y+="e"),e.state.options.noglob&&(y+="f"),e.state.options.nounset&&(y+="u"),e.state.options.verbose&&(y+="v"),e.state.options.xtrace&&(y+="x"),y+="B",e.state.options.noclobber&&(y+="C"),y+="s",y)]}case"*":{y10=Number.parseInt(e.state.env.get("#")||"0",10);if(y10===0)return[2,""];_=[];for(b=1;b<=y10;b++)_.push(e.state.env.get(String(b))||"");return[2,_.join(an(e.state.env))]}case"0":return[2,e.state.env.get("0")||"bash"];case"PWD":return[2,(a=e.state.env.get("PWD"))!=null?a:""];case"OLDPWD":return[2,(s=e.state.env.get("OLDPWD"))!=null?s:""];case"PPID":return[2,String(e.state.virtualPpid)];case"UID":return[2,String(e.state.virtualUid)];case"EUID":return[2,String(e.state.virtualUid)];case"RANDOM":return[2,String(Math.floor(Math.random()*32768))];case"SECONDS":return[2,String(Math.floor((Date.now()-e.state.startTime)/1e3))];case"BASH_VERSION":return[2,eke];case"!":return[2,String(e.state.lastBackgroundPid)];case"BASHPID":return[2,String(e.state.bashPid)];case"LINENO":return[2,String(e.state.currentLine)];case"FUNCNAME":{y11=(l=e.state.funcNameStack)==null?void 0:l[0];if(y11!==void 0)return[2,y11];if(r&&e.state.options.nounset)throw new Kc("FUNCNAME");return[2,""]}case"BASH_LINENO":{y12=(c=e.state.callLineStack)==null?void 0:c[0];if(y12!==void 0)return[2,String(y12)];if(r&&e.state.options.nounset)throw new Kc("BASH_LINENO");return[2,""]}case"BASH_SOURCE":{y13=(d=e.state.sourceStack)==null?void 0:d[0];if(y13!==void 0)return[2,y13];if(r&&e.state.options.nounset)throw new Kc("BASH_SOURCE");return[2,""]}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(t))throw new $f("${".concat(t,"}"));i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!i)return[3,5];y14=i[1],_10=i[2];if(no(e,y14)){S=gp(e,y14);if(S&&S!==y14){if(S.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return[2,""];y14=S}}if(_10==="@"||_10==="*"){S10=zr(e,y14);if(S10.length>0)return[2,S10.map(function(param){var _param=_sliced_to_array(param,2),E=_param[1];return E}).join(" ")];k=e.state.env.get(y14);return[2,k!==void 0?k:""]}if(y14==="FUNCNAME"){S11=Number.parseInt(_10,10);return[2,!Number.isNaN(S11)&&S11>=0&&(p=(u=e.state.funcNameStack)==null?void 0:u[S11])!=null?p:""]}if(y14==="BASH_LINENO"){S12=Number.parseInt(_10,10);if(!Number.isNaN(S12)&&S12>=0){k10=(m=e.state.callLineStack)==null?void 0:m[S12];return[2,k10!==void 0?String(k10):""]}return[2,""]}if(y14==="BASH_SOURCE"){S13=Number.parseInt(_10,10);return[2,!Number.isNaN(S13)&&S13>=0&&(g=(h=e.state.sourceStack)==null?void 0:h[S13])!=null?g:""]}if((x=e.state.associativeArrays)!=null&&x.has(y14)){S14=IV(_10);S14=myt(e,S14);k11=e.state.env.get("".concat(y14,"_").concat(S14));if(k11===void 0&&r&&e.state.options.nounset)throw new Kc("".concat(y14,"[").concat(_10,"]"));return[2,k11||""]}if(!/^-?\d+$/.test(_10))return[3,1];b10=Number.parseInt(_10,10);return[3,4];case 1:_state.trys.push([1,3,,4]);S15=new Pn,k12=Ki(S15,_10);return[4,Xt(e,k12.expression)];case 2:b10=_state.sent();return[3,4];case 3:S16=_state.sent();k13=e.state.env.get(_10);b10=k13?Number.parseInt(k13,10):0,Number.isNaN(b10)&&(b10=0);return[3,4];case 4:if(b10<0){;S17=zr(e,y14),k14=e.state.currentLine;if(S17.length===0)return[2,(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(k14,": ").concat(y14,": bad array subscript\n"),"")];E=(_Math=Math).max.apply(_Math,_to_consumable_array(S17.map(function(param){var _param=_sliced_to_array(param,1),C=_param[0];return typeof C=="number"?C:0})))+1+b10;return[2,E<0?(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(k14,": ").concat(y14,": bad array subscript\n"),""):e.state.env.get("".concat(y14,"_").concat(E))||""]}w=e.state.env.get("".concat(y14,"_").concat(b10));if(w!==void 0)return[2,w];if(b10===0){S18=e.state.env.get(y14);if(S18!==void 0)return[2,S18]}if(r&&e.state.options.nounset)throw new Kc("".concat(y14,"[").concat(b10,"]"));return[2,""];case 5:if(/^[1-9][0-9]*$/.test(t)){y15=e.state.env.get(t);if(y15===void 0&&r&&e.state.options.nounset)throw new Kc(t);return[2,y15||""]}if(!no(e,t))return[3,8];y16=gp(e,t);if(y16===void 0)return[2,""];if(!(y16!==t))return[3,7];return[4,Hn(e,y16,r,n)];case 6:return[2,_state.sent()];case 7:_11=e.state.env.get(t);if((_11===void 0||_11==="")&&r&&e.state.options.nounset)throw new Kc(t);return[2,_11||""];case 8:o=e.state.env.get(t);if(o!==void 0)return[2,((v=e.state.tempEnvBindings)!=null&&v.some(function(y){return y.has(t)})&&(e.state.accessedTempEnvVars=e.state.accessedTempEnvVars||new Set,e.state.accessedTempEnvVars.add(t)),o)];if(d_(e,t)){y17=e.state.env.get("".concat(t,"_0"));return[2,y17!==void 0?y17:""]}if(r&&e.state.options.nounset)throw new Kc(t);return[2,""]}})}).apply(this,arguments)}function g_(e,t){return _async_to_generator(function(){var n,r,i,o,s,s10,a,s11,l,s12,l10,_Math,s13,l11,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(new Set(["?","$","#","_","-","0","PPID","UID","EUID","RANDOM","SECONDS","BASH_VERSION","!","BASHPID","LINENO"]).has(t))return[2,!0];if(t==="@"||t==="*")return[2,Number.parseInt(e.state.env.get("#")||"0",10)>0];if(t==="PWD"||t==="OLDPWD")return[2,e.state.env.has(t)];r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!r)return[3,5];i=r[1],o=r[2];if(no(e,i)){s=gp(e,i);if(s&&s!==i){if(s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return[2,!1];i=s}}if(o==="@"||o==="*")return[2,zr(e,i).length>0?!0:e.state.env.has(i)];if((n=e.state.associativeArrays)!=null&&n.has(i)){s10=IV(o);return[2,e.state.env.has("".concat(i,"_").concat(s10))]}if(!/^-?\d+$/.test(o))return[3,1];a=Number.parseInt(o,10);return[3,4];case 1:_state.trys.push([1,3,,4]);s11=new Pn,l=Ki(s11,o);return[4,Xt(e,l.expression)];case 2:a=_state.sent();return[3,4];case 3:s12=_state.sent();l10=e.state.env.get(o);a=l10?Number.parseInt(l10,10):0,Number.isNaN(a)&&(a=0);return[3,4];case 4:if(a<0){;s13=zr(e,i);if(s13.length===0)return[2,!1];l11=(_Math=Math).max.apply(_Math,_to_consumable_array(s13.map(function(param){var _param=_sliced_to_array(param,1),c=_param[0];return typeof c=="number"?c:0})))+1+a;return[2,l11<0?!1:e.state.env.has("".concat(i,"_").concat(l11))]}return[2,e.state.env.has("".concat(i,"_").concat(a))];case 5:if(no(e,t)){i10=gp(e,t);return[2,i10===void 0||i10===t?e.state.env.has(t):g_(e,i10)]}return[2,!!(e.state.env.has(t)||d_(e,t))]}})})()}var lu=se(function(){"use strict";Ns(),jo(),rke(),kl(),jr(),nd(),oc(),_p()});function hyt(e,t){return _async_to_generator(function(){var r,n,i,o,i10,o10,i11,o11,a,i12,o12,a9,i13,o13,i14,o14,a10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="",n=0;_state.label=1;case 1:if(!(n<t.length))return[3,15];if(!(t[n]==="$"))return[3,7];if(t[n+1]==="{"){i=1,o=n+2;for(;o<t.length&&i>0;)t[o]==="{"?i++:t[o]==="}"&&i--,o++;r+=t.slice(n,o),n=o;return[3,14]}if(t[n+1]==="("){i10=1,o10=n+2;for(;o10<t.length&&i10>0;)t[o10]==="("?i10++:t[o10]===")"&&i10--,o10++;r+=t.slice(n,o10),n=o10;return[3,14]}if(!/[a-zA-Z_]/.test(t[n+1]||""))return[3,3];i11=n+1;for(;i11<t.length&&/[a-zA-Z0-9_]/.test(t[i11]);)i11++;o11=t.slice(n+1,i11);return[4,Hn(e,o11)];case 2:a=_state.sent();r+=a,n=i11;return[3,14];case 3:if(!/[0-9]/.test(t[n+1]||""))return[3,5];i12=n+1;for(;i12<t.length&&/[0-9]/.test(t[i12]);)i12++;o12=t.slice(n+1,i12);return[4,Hn(e,o12)];case 4:a9=_state.sent();r+=a9,n=i12;return[3,14];case 5:if(!/[*@#?\-!$]/.test(t[n+1]||""))return[3,7];i13=t[n+1];return[4,Hn(e,i13)];case 6:o13=_state.sent();r+=o13,n+=2;return[3,14];case 7:if(!(t[n]==='"'))return[3,13];r+='"',n++;_state.label=8;case 8:if(!(n<t.length&&t[n]!=='"'))return[3,12];if(!(t[n]==="$"&&/[a-zA-Z_]/.test(t[n+1]||"")))return[3,10];i14=n+1;for(;i14<t.length&&/[a-zA-Z0-9_]/.test(t[i14]);)i14++;o14=t.slice(n+1,i14);return[4,Hn(e,o14)];case 9:a10=_state.sent();r+=a10,n=i14;return[3,11];case 10:t[n]==="\\"?(r+=t[n],n++,n<t.length&&(r+=t[n],n++)):(r+=t[n],n++);_state.label=11;case 11:return[3,8];case 12:n<t.length&&(r+='"',n++);return[3,14];case 13:r+=t[n],n++;_state.label=14;case 14:return[3,1];case 15:return[2,r]}})})()}function H_e(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,s10,l10,c10,d10,s11,l11,c11,s12,l12,c12;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t,n=t.startsWith('"')&&t.endsWith('"'),i=t.startsWith("'")&&t.endsWith("'");if((n||i)&&(r=t.slice(1,-1)),i)return[2,r];o="",a=0;_state.label=1;case 1:if(!(a<r.length))return[3,15];if(!(r[a]==="$"))return[3,10];if(!(r[a+1]==="("))return[3,4];s=1,l=a+2;for(;l<r.length&&s>0;)r[l]==="("&&r[l-1]==="$"||r[l]==="("?s++:r[l]===")"&&s--,l++;c=r.slice(a+2,l-1);if(!e.execFn)return[3,3];return[4,e.execFn(c,{signal:e.state.signal})];case 2:d=_state.sent();o+=d.stdout.replace(/\n+$/,""),d.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+d.stderr);_state.label=3;case 3:a=l;return[3,9];case 4:if(!(r[a+1]==="{"))return[3,6];s10=1,l10=a+2;for(;l10<r.length&&s10>0;)r[l10]==="{"?s10++:r[l10]==="}"&&s10--,l10++;c10=r.slice(a+2,l10-1);return[4,Hn(e,c10)];case 5:d10=_state.sent();o+=d10,a=l10;return[3,9];case 6:if(!/[a-zA-Z_]/.test(r[a+1]||""))return[3,8];s11=a+1;for(;s11<r.length&&/[a-zA-Z0-9_]/.test(r[s11]);)s11++;l11=r.slice(a+1,s11);return[4,Hn(e,l11)];case 7:c11=_state.sent();o+=c11,a=s11;return[3,9];case 8:o+=r[a],a++;_state.label=9;case 9:return[3,14];case 10:if(!(r[a]==="`"))return[3,13];s12=a+1;for(;s12<r.length&&r[s12]!=="`";)s12++;l12=r.slice(a+1,s12);if(!e.execFn)return[3,12];return[4,e.execFn(l12,{signal:e.state.signal})];case 11:c12=_state.sent();o+=c12.stdout.replace(/\n+$/,""),c12.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+c12.stderr);_state.label=12;case 12:a=s12+1;return[3,14];case 13:o+=r[a],a++;_state.label=14;case 14:return[3,1];case 15:return[2,o]}})})()}var gyt=se(function(){"use strict";lu()});function xyt(e,t,r,n,i){var o=r!=null?r:1;o===0&&(o=1);var a=Math.abs(o),s=[],l=0;n!=null&&n.match(/^-?0\d/)&&(l=Math.max(l,n.replace(/^-/,"").length)),i!=null&&i.match(/^-?0\d/)&&(l=Math.max(l,i.replace(/^-/,"").length));var c=function(d){if(l>0){var u=d<0,p=String(Math.abs(d)).padStart(l,"0");return u?"-".concat(p):p}return String(d)};if(e<=t)for(var d=e,u=0;d<=t&&u<XS;d+=a,u++)s.push(c(d));else for(var d10=e,u10=0;d10>=t&&u10<XS;d10-=a,u10++)s.push(c(d10));return s}function yyt(e,t,r){var n=r!=null?r:1;n===0&&(n=1);var i=e.charCodeAt(0),o=t.charCodeAt(0),a=Math.abs(n),s=e>="A"&&e<="Z",l=e>="a"&&e<="z",c=t>="A"&&t<="Z",d=t>="a"&&t<="z";if(s&&d||l&&c){var p=r!==void 0?"..".concat(r):"";throw new rV("{".concat(e,"..").concat(t).concat(p,"}: invalid sequence"))}var u=[];if(i<=o)for(var p10=i,m=0;p10<=o&&m<XS;p10+=a,m++)u.push(String.fromCharCode(p10));else for(var p11=i,m10=0;p11>=o&&m10<XS;p11-=a,m10++)u.push(String.fromCharCode(p11));return u}function Ske(e,t,r,n,i){var o=r!==void 0?"..".concat(r):"";return typeof e=="number"&&typeof t=="number"?{expanded:xyt(e,t,r,n,i),literal:"{".concat(e,"..").concat(t).concat(o,"}")}:typeof e=="string"&&typeof t=="string"?{expanded:yyt(e,t,r),literal:"{".concat(e,"..").concat(t).concat(o,"}")}:{expanded:null,literal:"{".concat(e,"..").concat(t).concat(o,"}")}}var XS,vyt=se(function(){"use strict";jr(),XS=1e4});function _yt(e){if(e.statements.length!==1)return null;var t=e.statements[0];if(t.operators.length!==0||t.pipelines.length!==1)return null;var r=t.pipelines[0];if(r.negated||r.commands.length!==1)return null;var n=r.commands[0];if(n.type!=="SimpleCommand")return null;var i=n;if(i.name!==null||i.args.length!==0||i.assignments.length!==0||i.redirections.length!==1)return null;var o=i.redirections[0];return o.operator!=="<"||o.target.type!=="Word"?null:{target:o.target}}var byt=se(function(){"use strict"});function e1(e,t){return!!(/[*?[]/.test(e)||t&&/[@*+?!]\(/.test(e))}function Z_e(e){var t="",r=0;for(;r<e.length;)e[r]==="\\"&&r+1<e.length?(t+=e[r+1],r+=2):(t+=e[r],r++);return t}function xp(e){return e.replace(/([*?[\]\\()|])/g,"\\$1")}function OV(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var e5=se(function(){"use strict"});function gn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var u5=se(function(){"use strict"});function on(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var n="",i=0;for(;i<e.length;){var o=e[i];if(r&&(o==="@"||o==="*"||o==="+"||o==="?"||o==="!")&&i+1<e.length&&e[i+1]==="("){var a=wyt(e,i+1);if(a!==-1){var s=e.slice(i+2,a),l=Syt(s).map(function(d){return on(d,t,r)}),c=l.length>0?l.join("|"):"(?:)";o==="@"?n+="(?:".concat(c,")"):o==="*"?n+="(?:".concat(c,")*"):o==="+"?n+="(?:".concat(c,")+"):o==="?"?n+="(?:".concat(c,")?"):o==="!"&&(n+="(?!(?:".concat(c,")$).*")),i=a+1;continue}}if(o==="\\")if(i+1<e.length){var a9=e[i+1];/[\\^$.|+(){}[\]*?]/.test(a9)?n+="\\".concat(a9):n+=a9,i+=2}else n+="\\\\",i++;else if(o==="*")n+=t?".*":".*?",i++;else if(o==="?")n+=".",i++;else if(o==="["){var a10=kyt(e,i);if(a10===-1)n+="\\[",i++;else{var s10=e.slice(i+1,a10);n+=Cyt(s10),i=a10+1}}else/[\^$.|+(){}]/.test(o)?(n+="\\".concat(o),i++):(n+=o,i++)}return n}function wyt(e,t){var r=1,n=t+1;for(;n<e.length&&r>0;){var i=e[n];if(i==="\\"){n+=2;continue}if(i==="(")r++;else if(i===")"&&(r--,r===0))return n;n++}return-1}function Syt(e){var t=[],r="",n=0,i=0;for(;i<e.length;){var o=e[i];if(o==="\\"){r+=o,i+1<e.length?(r+=e[i+1],i+=2):i++;continue}o==="("?(n++,r+=o):o===")"?(n--,r+=o):o==="|"&&n===0?(t.push(r),r=""):r+=o,i++}return t.push(r),t}function kyt(e,t){var r=t+1;for(r<e.length&&e[r]==="^"&&r++,r<e.length&&e[r]==="]"&&r++;r<e.length;){if(e[r]==="\\"&&r+1<e.length){r+=2;continue}if(e[r]==="]")return r;if(e[r]==="'"){var n=e.indexOf("'",r+1);if(n!==-1){r=n+1;continue}}if(e[r]==="["&&r+1<e.length&&e[r+1]===":"){var n10=e.indexOf(":]",r+2);if(n10!==-1){r=n10+2;continue}}r++}return-1}function Cyt(e){var t="[",r=0;for((e[0]==="^"||e[0]==="!")&&(t+="^",r++);r<e.length;){if(e[r]==="'"){var i=e.indexOf("'",r+1);if(i!==-1){var o=e.slice(r+1,i);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;a==="\\"?t+="\\\\":a==="]"?t+="\\]":a==="^"&&t==="["?t+="\\^":t+=a}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r=i+1;continue}}if(e[r]==="["&&r+1<e.length&&e[r+1]===":"){var i10=e.indexOf(":]",r+2);if(i10!==-1){var o10=e.slice(r+2,i10);t+=Eyt(o10),r=i10+2;continue}}var n=e[r];n==="\\"?r+1<e.length?(t+="\\".concat(e[r+1]),r+=2):(t+="\\\\",r++):n==="-"&&r>0&&r<e.length-1?(t+="-",r++):n==="^"&&r===0?(t+="^",r++):(n==="]"&&r===0?t+="\\]":t+=n,r++)}return t+="]",t}function Eyt(e){var t;return(t=kke.get(e))!=null?t:""}var kke,c5=se(function(){"use strict";kke=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]])});function d5(e,t,r,n){if(r==="prefix")return ir("^".concat(t),"s").replace(e,"");var i=ir("".concat(t,"$"),"s");if(n)return i.replace(e,"");for(var o=e.length;o>=0;o--){var a=e.slice(o);if(i.test(a))return e.slice(0,o)}return e}function $V(e,t){var s;var r=Array.from(e.state.env.keys()),n=new Set,i=(s=e.state.associativeArrays)!=null?s:new Set,o=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;var c=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);c&&o.add(c[1]);var d=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);d&&o.add(d[1])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var a=function(l){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;var d="".concat(c,"_");if(l.startsWith(d)&&l!==c)return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1};var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var l10=_step1.value;if(l10.startsWith(t))if(l10.includes("__")){var c10=l10.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);c10!=null&&c10[1].startsWith(t)&&n.add(c10[1])}else if(/_\d+$/.test(l10)){var c11=l10.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);c11!=null&&c11[1].startsWith(t)&&n.add(c11[1])}else a(l10)||n.add(l10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return _to_consumable_array(n).sort()}var x_=se(function(){"use strict";Ei()});function Tyt(e,t){var r=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(o).padStart(a,"0")};if(e===""){var o=r(t.getHours()),a=r(t.getMinutes()),s=r(t.getSeconds());return"".concat(o,":").concat(a,":").concat(s)}var n="",i=0;for(;i<e.length;)if(e[i]==="%"){if(i+1>=e.length){n+="%",i++;continue}var o10=e[i+1];switch(o10){case"H":n+=r(t.getHours());break;case"M":n+=r(t.getMinutes());break;case"S":n+=r(t.getSeconds());break;case"d":n+=r(t.getDate());break;case"m":n+=r(t.getMonth()+1);break;case"Y":n+=t.getFullYear();break;case"y":n+=r(t.getFullYear()%100);break;case"I":{var a9=t.getHours()%12;a9===0&&(a9=12),n+=r(a9);break}case"p":n+=t.getHours()<12?"AM":"PM";break;case"P":n+=t.getHours()<12?"am":"pm";break;case"%":n+="%";break;case"a":{n+=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.getDay()];break}case"b":{n+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()];break}default:n+="%".concat(o10)}i+=2}else n+=e[i],i++;return n}function UW(e,t){var r="",n=0,i=e.state.env.get("USER")||e.state.env.get("LOGNAME")||"user",o=e.state.env.get("HOSTNAME")||"localhost",a=o.split(".")[0],s=e.state.env.get("PWD")||"/",l=e.state.env.get("HOME")||"/",c=s.startsWith(l)?"~".concat(s.slice(l.length)):s,d=s.split("/").pop()||s,u=new Date,p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=e.state.env.get("__COMMAND_NUMBER")||"1";for(;n<t.length;){var g=t[n];if(g==="\\"){if(n+1>=t.length){r+="\\",n++;continue}var x=t[n+1];if(x>="0"&&x<="7"){var v="",y=n+1;for(;y<t.length&&y<n+4&&t[y]>="0"&&t[y]<="7";)v+=t[y],y++;var _=Number.parseInt(v,8)%256;r+=String.fromCharCode(_),n=y;continue}switch(x){case"\\":r+="\\",n+=2;break;case"a":r+="\x07",n+=2;break;case"e":r+="\x1b",n+=2;break;case"n":r+="\n",n+=2;break;case"r":r+="\r",n+=2;break;case"$":r+="$",n+=2;break;case"[":case"]":n+=2;break;case"u":r+=i,n+=2;break;case"h":r+=a,n+=2;break;case"H":r+=o,n+=2;break;case"w":r+=c,n+=2;break;case"W":r+=d,n+=2;break;case"d":{var v10=String(u.getDate()).padStart(2," ");r+="".concat(p[u.getDay()]," ").concat(m[u.getMonth()]," ").concat(v10),n+=2;break}case"t":{var v11=String(u.getHours()).padStart(2,"0"),y10=String(u.getMinutes()).padStart(2,"0"),_10=String(u.getSeconds()).padStart(2,"0");r+="".concat(v11,":").concat(y10,":").concat(_10),n+=2;break}case"T":{var v12=u.getHours()%12;v12===0&&(v12=12);var y11=String(v12).padStart(2,"0"),_11=String(u.getMinutes()).padStart(2,"0"),b=String(u.getSeconds()).padStart(2,"0");r+="".concat(y11,":").concat(_11,":").concat(b),n+=2;break}case"@":{var v13=u.getHours()%12;v13===0&&(v13=12);var y12=String(v13).padStart(2,"0"),_12=String(u.getMinutes()).padStart(2,"0"),b10=u.getHours()<12?"AM":"PM";r+="".concat(y12,":").concat(_12," ").concat(b10),n+=2;break}case"A":{var v14=String(u.getHours()).padStart(2,"0"),y13=String(u.getMinutes()).padStart(2,"0");r+="".concat(v14,":").concat(y13),n+=2;break}case"D":if(n+2<t.length&&t[n+2]==="{"){var v15=t.indexOf("}",n+3);if(v15!==-1){var y14=t.slice(n+3,v15);r+=Tyt(y14,u),n=v15+1}else r+="\\D",n+=2}else r+="\\D",n+=2;break;case"s":r+="bash",n+=2;break;case"v":r+="5.0",n+=2;break;case"V":r+="5.0.0",n+=2;break;case"j":r+="0",n+=2;break;case"l":r+="tty",n+=2;break;case"#":r+=h,n+=2;break;case"!":r+=h,n+=2;break;case"x":r+="\\x",n+=2;break;default:r+="\\".concat(x),n+=2}}else r+=g,n++}return r}var Cke=se(function(){"use strict"});function n_(e){if(e==="")return"''";if(/[\n\r\t\x00-\x1f\x7f']/.test(e)){var t="$'";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r){case"'":t+="\\'";break;case"\\":t+="\\\\";break;case"\n":t+="\\n";break;case"\r":t+="\\r";break;case" ":t+="\\t";break;default:{var n=r.charCodeAt(0);n<32||n===127?t+="\\".concat(n.toString(8).padStart(3,"0")):t+=r}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"".concat(t,"'")}return"'".concat(e,"'")}var Eke=se(function(){"use strict"});function Qu(e,t){e.state.readonlyVars=e.state.readonlyVars||new Set,e.state.readonlyVars.add(t)}function s1(e,t){var r,n;return(n=(r=e.state.readonlyVars)==null?void 0:r.has(t))!=null?n:!1}function Ms(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"bash";if(s1(e,t)){var n="".concat(r,": ").concat(t,": readonly variable\n");throw new Ci(1,"",n)}return null}function Mf(e,t){var n,i;var r=(i=(n=e.state.exportedVars)==null?void 0:n.has(t))!=null?i:!1;if(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(t),e.state.localScopes.length>0&&e.state.localScopes[e.state.localScopes.length-1].has(t)&&!r){for(e.state.localExportedVars||(e.state.localExportedVars=[]);e.state.localExportedVars.length<e.state.localScopes.length;)e.state.localExportedVars.push(new Set);e.state.localExportedVars[e.state.localExportedVars.length-1].add(t)}}function Tke(e,t){var r;(r=e.state.exportedVars)==null||r.delete(t)}var f1=se(function(){"use strict";jr()});function HS(e,t){var o,a,s,l;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t))return"";var r="",n=e.state.env.has("".concat(t,"__length"))||Array.from(e.state.env.keys()).some(function(c){return c.startsWith("".concat(t,"_"))&&/^[0-9]+$/.test(c.slice(t.length+1))}),i=(a=(o=e.state.associativeArrays)==null?void 0:o.has(t))!=null?a:!1;return n&&!i&&(r+="a"),i&&(r+="A"),(s=e.state.integerVars)!=null&&s.has(t)&&(r+="i"),no(e,t)&&(r+="n"),s1(e,t)&&(r+="r"),(l=e.state.exportedVars)!=null&&l.has(t)&&(r+="x"),r}var NV=se(function(){"use strict";_p(),f1()});function Ayt(e,t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){return[2,((i=e.coverage)==null||i.hit("bash:expansion:default_value"),(r.isUnset||t.checkEmpty&&r.isEmpty)&&t.word?n(e,t.word.parts,r.inDoubleQuotes):r.effectiveValue)]})})()}function Iyt(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,_s1,l,c,d,p,m,p10,m10,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((o=e.coverage)==null||o.hit("bash:expansion:assign_default"),(n.isUnset||r.checkEmpty&&n.isEmpty)&&r.word))return[3,9];return[4,i(e,r.word.parts,n.inDoubleQuotes)];case 1:a=_state.sent(),s=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!s)return[3,7];_s1=_sliced_to_array(s,3),l=_s1[1],c=_s1[2];if(!/^\d+$/.test(c))return[3,2];d=Number.parseInt(c,10);return[3,6];case 2:_state.trys.push([2,4,,5]);p=new Pn,m=Ki(p,c);return[4,Xt(e,m.expression)];case 3:d=_state.sent();return[3,5];case 4:p10=_state.sent();m10=e.state.env.get(c);d=m10?Number.parseInt(m10,10):0;return[3,5];case 5:Number.isNaN(d)&&(d=0);_state.label=6;case 6:e.state.env.set("".concat(l,"_").concat(d),a);u=Number.parseInt(e.state.env.get("".concat(l,"__length"))||"0",10);d>=u&&e.state.env.set("".concat(l,"__length"),String(d+1));return[3,8];case 7:e.state.env.set(t,a);_state.label=8;case 8:return[2,a];case 9:return[2,n.effectiveValue]}})})()}function Pyt(e,t,r,n,i){return _async_to_generator(function(){var o,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((o=e.coverage)==null||o.hit("bash:expansion:error_if_unset"),n.isUnset||r.checkEmpty&&n.isEmpty))return[3,4];if(!r.word)return[3,2];return[4,i(e,r.word.parts,n.inDoubleQuotes)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp="".concat(t,": parameter null or not set");_state.label=3;case 3:a=_tmp;throw new Ci(1,"","bash: ".concat(a,"\n"));case 4:return[2,n.effectiveValue]}})})()}function Ryt(e,t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){return[2,((i=e.coverage)==null||i.hit("bash:expansion:use_alternative"),!(r.isUnset||t.checkEmpty&&r.isEmpty)&&t.word?n(e,t.word.parts,r.inDoubleQuotes):"")]})})()}function Myt(e,t,r,n,i){return _async_to_generator(function(){var l,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c,d,d10,d11,err,s,c10,d12;return _ts_generator(this,function(_state){switch(_state.label){case 0:(l=e.coverage)==null||l.hit("bash:expansion:pattern_removal");o="",a=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!r.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=r.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];c=_step.value;if(!(c.type==="Glob"))return[3,3];o+=on(c.pattern,r.greedy,a);return[3,11];case 3:if(!(c.type==="Literal"))return[3,4];o+=on(c.value,r.greedy,a);return[3,11];case 4:if(!(c.type==="SingleQuoted"||c.type==="Escaped"))return[3,5];o+=gn(c.value);return[3,11];case 5:if(!(c.type==="DoubleQuoted"))return[3,7];return[4,n(e,c.parts)];case 6:d=_state.sent();o+=gn(d);return[3,11];case 7:if(!(c.type==="ParameterExpansion"))return[3,9];return[4,i(e,c)];case 8:d10=_state.sent();o+=on(d10,r.greedy,a);return[3,11];case 9:return[4,i(e,c)];case 10:d11=_state.sent();o+=gn(d11);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:if(r.side==="prefix")return[2,ir("^".concat(o),"s").replace(t,"")];s=ir("".concat(o,"$"),"s");if(r.greedy)return[2,s.replace(t,"")];for(c10=t.length;c10>=0;c10--){d12=t.slice(c10);if(s.test(d12))return[2,t.slice(0,c10)]}return[2,t]}})})()}function Oyt(e,t,r,n,i){return _async_to_generator(function(){var c,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$d,u,u10,u11,err,s,_tmp,l,_$d1,u12,p,m,h,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:(c=e.coverage)==null||c.hit("bash:expansion:pattern_replacement");o="",a=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!r.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=r.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];_$d=_step.value;if(!(_$d.type==="Glob"))return[3,3];o+=on(_$d.pattern,!0,a);return[3,11];case 3:if(!(_$d.type==="Literal"))return[3,4];o+=on(_$d.value,!0,a);return[3,11];case 4:if(!(_$d.type==="SingleQuoted"||_$d.type==="Escaped"))return[3,5];o+=gn(_$d.value);return[3,11];case 5:if(!(_$d.type==="DoubleQuoted"))return[3,7];return[4,n(e,_$d.parts)];case 6:u=_state.sent();o+=gn(u);return[3,11];case 7:if(!(_$d.type==="ParameterExpansion"))return[3,9];return[4,i(e,_$d)];case 8:u10=_state.sent();o+=on(u10,!0,a);return[3,11];case 9:return[4,i(e,_$d)];case 10:u11=_state.sent();o+=gn(u11);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:if(!r.replacement)return[3,17];return[4,n(e,r.replacement.parts)];case 16:_tmp=_state.sent();return[3,18];case 17:_tmp="";_state.label=18;case 18:s=_tmp;if(r.anchor==="start"?o="^".concat(o):r.anchor==="end"&&(o="".concat(o,"$")),o==="")return[2,t];l=r.all?"gs":"s";try{_$d1=ir(o,l);if(r.all){u12="",p=0,m=0,h=e.limits.maxStringLength,g=_$d1.exec(t);for(;g!==null&&!(g[0].length===0&&g.index===t.length);){if(u12+=t.slice(p,g.index)+s,p=g.index+g[0].length,g[0].length===0&&p++,m++,m%100===0&&u12.length>h)throw new Qt("pattern replacement: string length limit exceeded (".concat(h," bytes)"),"string_length");g=_$d1.exec(t)}return[2,(u12+=t.slice(p),u12)]}return[2,_$d1.replace(t,s)]}catch(d){if(_instanceof(d,Qt))throw d;return[2,t]}return[2]}})})()}function $yt(e,t,r){var i,o,a;(i=e.coverage)==null||i.hit("bash:expansion:length");var n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(n){var s=n[1],l=zr(e,s);return l.length>0?String(l.length):e.state.env.get(s)!==void 0?"1":"0"}if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)&&d_(e,t)){if(t==="FUNCNAME"){var l10=((o=e.state.funcNameStack)==null?void 0:o[0])||"";return String(_to_consumable_array(l10).length)}if(t==="BASH_LINENO"){var l11=(a=e.state.callLineStack)==null?void 0:a[0];return String(l11!==void 0?_to_consumable_array(String(l11)).length:0)}var s10=e.state.env.get("".concat(t,"_0"))||"";return String(_to_consumable_array(s10).length)}return String(_to_consumable_array(r).length)}function Nyt(e,t,r,n){return _async_to_generator(function(){var c,d,i,o,_tmp,u,p,x,m,h,g,x10,a,u10,p10,m10,h10,g10,s,l,u11;return _ts_generator(this,function(_state){switch(_state.label){case 0:(c=e.coverage)==null||c.hit("bash:expansion:substring");return[4,Xt(e,n.offset.expression)];case 1:i=_state.sent();if(!n.length)return[3,3];return[4,Xt(e,n.length.expression)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:o=_tmp;if(t==="@"||t==="*"){u=Number.parseInt(e.state.env.get("#")||"0",10),p=[];for(x=1;x<=u;x++)p.push(e.state.env.get(String(x))||"");m=e.state.env.get("0")||"bash";if(i<=0)if(h=[m].concat(_to_consumable_array(p)),i<0){if(g=h.length+i,g<0)return[2,""]}else g=0;else h=p,g=i-1;if(g<0||g>=h.length)return[2,""];if(o!==void 0){x10=o<0?h.length+o:g+o;return[2,h.slice(g,Math.max(g,x10)).join(" ")]}return[2,h.slice(g).join(" ")]}a=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(a){u10=a[1];if((d=e.state.associativeArrays)!=null&&d.has(u10))throw new Ci(1,"","bash: ${".concat(u10,"[@]: 0: 3}: bad substitution\n"));p10=zr(e,u10),m10=0;if(i<0){if(p10.length>0){h10=p10[p10.length-1][0],g10=(typeof h10=="number"?h10:0)+1+i;if(g10<0||(m10=p10.findIndex(function(param){var _param=_sliced_to_array(param,1),x=_param[0];return typeof x=="number"&&x>=g10}),m10<0))return[2,""]}}else if(m10=p10.findIndex(function(param){var _param=_sliced_to_array(param,1),h=_param[0];return typeof h=="number"&&h>=i}),m10<0)return[2,""];if(o!==void 0){if(o<0)throw new Hi("".concat(a[1],"[@]: substring expression < 0"));return[2,p10.slice(m10,m10+o).map(function(param){var _param=_sliced_to_array(param,2),h=_param[1];return h}).join(" ")]}return[2,p10.slice(m10).map(function(param){var _param=_sliced_to_array(param,2),h=_param[1];return h}).join(" ")]}s=_to_consumable_array(r),l=i;if(l<0&&(l=Math.max(0,s.length+l)),o!==void 0){if(o<0){u11=s.length+o;return[2,s.slice(l,Math.max(l,u11)).join("")]}return[2,s.slice(l,l+o).join("")]}return[2,s.slice(l).join("")]}})})()}function Dyt(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p,m,m10,err,l,c,d,u,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,p10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((o=e.coverage)==null||o.hit("bash:expansion:case_modification"),r.pattern))return[3,14];a=e.state.shoptOptions.extglob,s="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,11,12,13]);_iterator=r.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];p=_step.value;if(!(p.type==="Glob"))return[3,3];s+=on(p.pattern,!0,a);return[3,9];case 3:if(!(p.type==="Literal"))return[3,4];s+=on(p.value,!0,a);return[3,9];case 4:if(!(p.type==="SingleQuoted"||p.type==="Escaped"))return[3,5];s+=gn(p.value);return[3,9];case 5:if(!(p.type==="DoubleQuoted"))return[3,7];return[4,n(e,p.parts)];case 6:m=_state.sent();s+=gn(m);return[3,9];case 7:if(!(p.type==="ParameterExpansion"))return[3,9];return[4,i(e,p)];case 8:m10=_state.sent();s+=on(m10,!0,a);_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,2];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:l=ir("^(?:".concat(s,")$")),c=r.direction==="upper"?function(p){return p.toUpperCase()}:function(p){return p.toLowerCase()},d="",u=!1;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=t[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){p10=_step1.value;!r.all&&u?d+=p10:l.test(p10)?(d+=c(p10),u=!0):d+=p10}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,d];case 14:return[2,r.direction==="upper"?r.all?t.toUpperCase():t.charAt(0).toUpperCase()+t.slice(1):r.all?t.toLowerCase():t.charAt(0).toLowerCase()+t.slice(1)]}})})()}function Lyt(e,t,r,n,i){var s;(s=e.coverage)==null||s.hit("bash:expansion:transform");var o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(o&&i.operator==="Q")return zr(e,o[1]).map(function(param){var _param=_sliced_to_array(param,2),l=_param[1];return n_(l)}).join(" ");if(o&&i.operator==="a")return HS(e,o[1]);var a=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[.+\]$/);if(a&&i.operator==="a")return HS(e,a[1]);switch(i.operator){case"Q":return n?"":n_(r);case"P":return UW(e,r);case"a":return HS(e,t);case"A":return n?"":"".concat(t,"=").concat(n_(r));case"E":return r.replace(/\\([\\abefnrtv'"?])/g,function(l,c){switch(c){case"\\":return"\\";case"a":return"\x07";case"b":return"\b";case"e":return"\x1b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return" ";case"v":return"\v";case"'":return"'";case'"':return'"';case"?":return"?";default:return c}});case"K":case"k":return n?"":n_(r);case"u":return r.charAt(0).toUpperCase()+r.slice(1);case"U":return r.toUpperCase();case"L":return r.toLowerCase();default:return r}}function Fyt(_01,_11,_21,_31,_41,_51){return _async_to_generator(function(e,t,r,n,i,o){var a,d,u,s,l,c,p;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=_arguments.length>6&&_arguments[6]!==void 0?_arguments[6]:!1;if((d=e.coverage)==null||d.hit("bash:expansion:indirection"),no(e,t))return[2,rP(e,t)||""];s=/^[a-zA-Z_][a-zA-Z0-9_]*\[([@*])\]$/.test(t);if(n){if(((u=i.innerOp)==null?void 0:u.type)==="UseAlternative")return[2,""];throw new $f("${!".concat(t,"}"))}l=r;if(s&&(l===""||l.includes(" ")))throw new $f("${!".concat(t,"}"));c=l.match(/^[a-zA-Z_][a-zA-Z0-9_]*\[(.+)\]$/);if(c&&c[1].includes("~"))throw new $f("${!".concat(t,"}"));if(i.innerOp){p={type:"ParameterExpansion",parameter:l,operation:i.innerOp};return[2,o(e,p,a)]}return[4,Hn(e,l)];case 1:return[2,_state.sent()]}})}).apply(this,arguments)}function zyt(e,t){var n;(n=e.coverage)==null||n.hit("bash:expansion:array_keys");var r=zr(e,t.array).map(function(param){var _param=_sliced_to_array(param,1),i=_param[0];return String(i)});return t.star?r.join(an(e.state.env)):r.join(" ")}function jyt(e,t){var n;(n=e.coverage)==null||n.hit("bash:expansion:var_name_prefix");var r=$V(e,t.prefix);return t.star?r.join(an(e.state.env)):r.join(" ")}function Uyt(e,t,r,n){var i=Number.parseInt(e.state.env.get("#")||"0",10),o=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(t==="*")return{isEmpty:i===0,effectiveValue:r};if(t==="@")return{isEmpty:i===0||i===1&&e.state.env.get("1")==="",effectiveValue:r};if(o){var _o1=_sliced_to_array(o,3),a=_o1[1],s=_o1[2],l=zr(e,a);if(l.length===0)return{isEmpty:!0,effectiveValue:""};if(s==="*"){var c=an(e.state.env),d=l.map(function(param){var _param=_sliced_to_array(param,2),u=_param[1];return u}).join(c);return{isEmpty:n?d==="":!1,effectiveValue:d}}return{isEmpty:l.length===1&&l.every(function(param){var _param=_sliced_to_array(param,2),c=_param[1];return c===""}),effectiveValue:l.map(function(param){var _param=_sliced_to_array(param,2),c=_param[1];return c}).join(" ")}}return{isEmpty:r==="",effectiveValue:r}}var Byt=se(function(){"use strict";Ns(),jo(),Ei(),kl(),jr(),oc(),_p(),u5(),c5(),x_(),Cke(),Eke(),lu(),NV()});function qyt(e){var t=0;for(;t<e.length;){var r=e[t];if(r==="\\"&&t+1<e.length){t+=2;continue}if(r==="'"){var n=e.indexOf("'",t+1);if(n!==-1){t=n+1;continue}}if(r==="$"&&t+1<e.length&&e[t+1]==="("||r==="`")return!0;t++}return!1}function Ake(e,t){var r=1,n=t,i=!1,o=!1;for(;n<e.length&&r>0;){var a=e[n];if(a==="\\"&&!i&&n+1<e.length){n+=2;continue}if(a==="'"&&!o){i=!i,n++;continue}if(a==='"'&&!i){o=!o,n++;continue}if(!i&&!o){if(a==="(")r++;else if(a===")"&&(r--,r===0))return n}n++}return-1}function $9(e,t){return _async_to_generator(function(){var l,c,r,n,i,o,a,s,_$d,u,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Pn;try{n=r.parse(t)}catch(d){return[2,""]}i=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;o=new Map(e.state.env),a=e.state.cwd,s=e.state.suppressVerbose;e.state.suppressVerbose=!0;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.executeScript(n)];case 2:_$d=_state.sent(),u=_$d.exitCode;return[2,(e.state.env=o,e.state.cwd=a,e.state.suppressVerbose=s,e.state.lastExitCode=u,e.state.env.set("?",String(u)),_$d.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+_$d.stderr),e.state.bashPid=i,_$d.stdout.replace(/\n+$/,""))];case 3:d=_state.sent();if(e.state.env=o,e.state.cwd=a,e.state.bashPid=i,e.state.suppressVerbose=s,_instanceof(d,Qt))throw d;return[2,_instanceof(d,Ci)?(e.state.lastExitCode=d.exitCode,e.state.env.set("?",String(d.exitCode)),(c=(l=d.stdout)==null?void 0:l.replace(/\n+$/,""))!=null?c:""):""];case 4:return[2]}})})()}function Ike(e,t){var i,o;var r="",n=0;for(;n<t.length;){var a=t[n];if(a==="'"){var s=t.indexOf("'",n+1);if(s!==-1){var l=t.slice(n+1,s);r+=xp(l),n=s+1;continue}}if(a==='"'){var s10=-1,l10=n+1;for(;l10<t.length;){if(t[l10]==="\\"){l10+=2;continue}if(t[l10]==='"'){s10=l10;break}l10++}if(s10!==-1){var c=t.slice(n+1,s10),d=Wyt(e,c);r+=xp(d),n=s10+1;continue}}if(a==="$"&&n+1<t.length){var s11=t[n+1];if(s11==="{"){var l11=t.indexOf("}",n+2);if(l11!==-1){var c10=t.slice(n+2,l11);r+=(i=e.state.env.get(c10))!=null?i:"",n=l11+1;continue}}else if(/[a-zA-Z_]/.test(s11)){var l12=n+1;for(;l12<t.length&&/[a-zA-Z0-9_]/.test(t[l12]);)l12++;var c11=t.slice(n+1,l12);r+=(o=e.state.env.get(c11))!=null?o:"",n=l12;continue}}if(a==="\\"&&n+1<t.length){r+=a+t[n+1],n+=2;continue}r+=a,n++}return r}function Wyt(e,t){var i,o;var r="",n=0;for(;n<t.length;){var a=t[n];if(a==="\\"&&n+1<t.length){var s=t[n+1];if(s==="$"||s==="`"||s==="\\"||s==='"'){r+=s,n+=2;continue}r+=a,n++;continue}if(a==="$"&&n+1<t.length){var s10=t[n+1];if(s10==="{"){var l=t.indexOf("}",n+2);if(l!==-1){var c=t.slice(n+2,l);r+=(i=e.state.env.get(c))!=null?i:"",n=l+1;continue}}else if(/[a-zA-Z_]/.test(s10)){var l10=n+1;for(;l10<t.length&&/[a-zA-Z0-9_]/.test(t[l10]);)l10++;var c10=t.slice(n+1,l10);r+=(o=e.state.env.get(c10))!=null?o:"",n=l10;continue}}r+=a,n++}return r}function Vyt(e,t){return _async_to_generator(function(){var i,o,r,n,a,s,l,s10,l10,c,d,s11,l11,c10,s12,l12,c11,s13,l13,c12,l14,c13;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="",n=0;_state.label=1;case 1:if(!(n<t.length))return[3,9];a=t[n];if(a==="'"){s=t.indexOf("'",n+1);if(s!==-1){l=t.slice(n+1,s);r+=xp(l),n=s+1;return[3,8]}}if(!(a==='"'))return[3,3];s10=-1,l10=n+1;for(;l10<t.length;){if(t[l10]==="\\"){l10+=2;continue}if(t[l10]==='"'){s10=l10;break}l10++}if(!(s10!==-1))return[3,3];c=t.slice(n+1,s10);return[4,Gyt(e,c)];case 2:d=_state.sent();r+=xp(d),n=s10+1;return[3,8];case 3:if(!(a==="$"&&n+1<t.length&&t[n+1]==="("))return[3,5];s11=Ake(t,n+2);if(!(s11!==-1))return[3,5];l11=t.slice(n+2,s11);return[4,$9(e,l11)];case 4:c10=_state.sent();r+=c10,n=s11+1;return[3,8];case 5:if(!(a==="`"))return[3,7];s12=t.indexOf("`",n+1);if(!(s12!==-1))return[3,7];l12=t.slice(n+1,s12);return[4,$9(e,l12)];case 6:c11=_state.sent();r+=c11,n=s12+1;return[3,8];case 7:if(a==="$"&&n+1<t.length){s13=t[n+1];if(s13==="{"){l13=t.indexOf("}",n+2);if(l13!==-1){c12=t.slice(n+2,l13);r+=(i=e.state.env.get(c12))!=null?i:"",n=l13+1;return[3,8]}}else if(/[a-zA-Z_]/.test(s13)){l14=n+1;for(;l14<t.length&&/[a-zA-Z0-9_]/.test(t[l14]);)l14++;c13=t.slice(n+1,l14);r+=(o=e.state.env.get(c13))!=null?o:"",n=l14;return[3,8]}}if(a==="\\"&&n+1<t.length){r+=a+t[n+1],n+=2;return[3,8]}r+=a,n++;_state.label=8;case 8:return[3,1];case 9:return[2,r]}})})()}function Gyt(e,t){return _async_to_generator(function(){var i,o,r,n,a,s,s10,l,c,s11,l10,c10,s12,l11,c11,l12,c12;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="",n=0;_state.label=1;case 1:if(!(n<t.length))return[3,7];a=t[n];if(a==="\\"&&n+1<t.length){s=t[n+1];if(s==="$"||s==="`"||s==="\\"||s==='"'){r+=s,n+=2;return[3,6]}r+=a,n++;return[3,6]}if(!(a==="$"&&n+1<t.length&&t[n+1]==="("))return[3,3];s10=Ake(t,n+2);if(!(s10!==-1))return[3,3];l=t.slice(n+2,s10);return[4,$9(e,l)];case 2:c=_state.sent();r+=c,n=s10+1;return[3,6];case 3:if(!(a==="`"))return[3,5];s11=t.indexOf("`",n+1);if(!(s11!==-1))return[3,5];l10=t.slice(n+1,s11);return[4,$9(e,l10)];case 4:c10=_state.sent();r+=c10,n=s11+1;return[3,6];case 5:if(a==="$"&&n+1<t.length){s12=t[n+1];if(s12==="{"){l11=t.indexOf("}",n+2);if(l11!==-1){c11=t.slice(n+2,l11);r+=(i=e.state.env.get(c11))!=null?i:"",n=l11+1;return[3,6]}}else if(/[a-zA-Z_]/.test(s12)){l12=n+1;for(;l12<t.length&&/[a-zA-Z0-9_]/.test(t[l12]);)l12++;c12=t.slice(n+1,l12);r+=(o=e.state.env.get(c12))!=null?o:"",n=l12;return[3,6]}}r+=a,n++;_state.label=6;case 6:return[3,1];case 7:return[2,r]}})})()}var Hyt=se(function(){"use strict";jo(),jr(),e5()});function Zyt(e,t){var a;if(!t.startsWith("~"))return t;(a=e.coverage)==null||a.hit("bash:expansion:tilde");var r=e.state.env.get("HOME")!==void 0?e.state.env.get("HOME"):"/home/user";if(t==="~"||t.startsWith("~/"))return r+t.slice(1);var n=1;for(;n<t.length&&/[a-zA-Z0-9_-]/.test(t[n]);)n++;var i=t.slice(1,n),o=t.slice(n);return o!==""&&!o.startsWith("/")?t:i==="root"?"/root".concat(o):t}var Kyt=se(function(){"use strict"});function Qyt(e,t,r,n){return _async_to_generator(function(){var i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,a,a9,a10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=t.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];o=_step.value;if(!(o.type==="Glob"))return[3,3];i+=on(o.pattern,!0,e.state.shoptOptions.extglob);return[3,11];case 3:if(!(o.type==="Literal"))return[3,4];i+=on(o.value,!0,e.state.shoptOptions.extglob);return[3,11];case 4:if(!(o.type==="SingleQuoted"||o.type==="Escaped"))return[3,5];i+=gn(o.value);return[3,11];case 5:if(!(o.type==="DoubleQuoted"))return[3,7];return[4,r(e,o.parts)];case 6:a=_state.sent();i+=gn(a);return[3,11];case 7:if(!(o.type==="ParameterExpansion"))return[3,9];return[4,n(e,o)];case 8:a9=_state.sent();i+=on(a9,!0,e.state.shoptOptions.extglob);return[3,11];case 9:return[4,n(e,o)];case 10:a10=_state.sent();i+=gn(a10);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:return[2,i]}})})()}function Jyt(e,t,r,n){return _async_to_generator(function(){var x,i,o,a,s,l,c,d,u,v,p,_tmp,m,h,_tmp1,g,v10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,y,_g1,v11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||((x=i.parts[0].operation)==null?void 0:x.type)!=="PatternReplacement")return[2,null];o=i.parts[0],a=o.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!a)return[2,null];s=a[1],l=a[2]==="*",c=o.operation,d=zr(e,s),u=d.map(function(param){var _param=_sliced_to_array(param,2),v=_param[1];return v});if(d.length===0){v=e.state.env.get(s);v!==void 0&&u.push(v)}if(u.length===0)return[2,{values:[],quoted:!0}];p="";_tmp=c.pattern;if(!_tmp)return[3,2];return[4,Qyt(e,c.pattern,r,n)];case 1:_tmp=p=_state.sent();_state.label=2;case 2:_tmp;if(!c.replacement)return[3,4];return[4,r(e,c.replacement.parts)];case 3:_tmp1=_state.sent();return[3,5];case 4:_tmp1="";_state.label=5;case 5:m=_tmp1,h=p;c.anchor==="start"?h="^".concat(p):c.anchor==="end"&&(h="".concat(p,"$"));g=[];try{v10=ir(h,c.all?"g":"");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=u[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){y=_step.value;g.push(v10.replace(y,m))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}catch(v){;(_g1=g).push.apply(_g1,_to_consumable_array(u))}if(l){v11=an(e.state.env);return[2,{values:[g.join(v11)],quoted:!0}]}return[2,{values:g,quoted:!0}]}})})()}function Yyt(e,t,r,n){return _async_to_generator(function(){var g,i,o,a,s,l,c,d,u,x,p,m,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x10,v,v10,v11,err,h,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,x11,x12;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||((g=i.parts[0].operation)==null?void 0:g.type)!=="PatternRemoval")return[2,null];o=i.parts[0],a=o.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!a)return[2,null];s=a[1],l=a[2]==="*",c=o.operation,d=zr(e,s),u=d.map(function(param){var _param=_sliced_to_array(param,2),x=_param[1];return x});if(d.length===0){x=e.state.env.get(s);x!==void 0&&u.push(x)}if(u.length===0)return[2,{values:[],quoted:!0}];p="",m=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!c.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=c.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];x10=_step.value;if(!(x10.type==="Glob"))return[3,3];p+=on(x10.pattern,c.greedy,m);return[3,11];case 3:if(!(x10.type==="Literal"))return[3,4];p+=on(x10.value,c.greedy,m);return[3,11];case 4:if(!(x10.type==="SingleQuoted"||x10.type==="Escaped"))return[3,5];p+=gn(x10.value);return[3,11];case 5:if(!(x10.type==="DoubleQuoted"))return[3,7];return[4,r(e,x10.parts)];case 6:v=_state.sent();p+=gn(v);return[3,11];case 7:if(!(x10.type==="ParameterExpansion"))return[3,9];return[4,n(e,x10)];case 8:v10=_state.sent();p+=on(v10,c.greedy,m);return[3,11];case 9:return[4,n(e,x10)];case 10:v11=_state.sent();p+=gn(v11);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:h=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=u[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){x11=_step1.value;h.push(d5(x11,p,c.side,c.greedy))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(l){x12=an(e.state.env);return[2,{values:[h.join(x12)],quoted:!0}]}return[2,{values:h,quoted:!0}]}})})()}var Xyt=se(function(){"use strict";Ei(),oc(),u5(),c5(),x_(),lu()});function e2t(e,t){return _async_to_generator(function(){var l,c,d,u,p,r,n,i,o,a,s,m,h,g,x,v,_,b,y,m10,h10,g10,x10,v10,m11,h11,g11,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x11,v11,x12,y10,_10,v12;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||((l=r.parts[0].operation)==null?void 0:l.type)!=="DefaultValue"&&((c=r.parts[0].operation)==null?void 0:c.type)!=="UseAlternative"&&((d=r.parts[0].operation)==null?void 0:d.type)!=="AssignDefault")return[2,null];n=r.parts[0],i=n.operation,o=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/),s=!1;if(!o)return[3,1];m=o[1];s=o[2]==="*";h=zr(e,m),g=h.length>0||e.state.env.has(m),x=h.length===0||h.length===1&&h.every(function(param){var _param=_sliced_to_array(param,2),y=_param[1];return y===""}),v=(u=i.checkEmpty)!=null?u:!1;if(i.type==="UseAlternative"?a=g&&!(v&&x):a=!g||v&&x,!a){if(h.length>0){_=h.map(function(param){var _param=_sliced_to_array(param,2),b=_param[1];return b});if(s){b=an(e.state.env);return[2,{values:[_.join(b)],quoted:!0}]}return[2,{values:_,quoted:!0}]}y=e.state.env.get(m);return[2,y!==void 0?{values:[y],quoted:!0}:{values:[],quoted:!0}]}return[3,4];case 1:m10=n.parameter;return[4,g_(e,m10)];case 2:h10=_state.sent();return[4,Hn(e,m10)];case 3:g10=_state.sent(),x10=g10==="",v10=(p=i.checkEmpty)!=null?p:!1;if(i.type==="UseAlternative"?a=h10&&!(v10&&x10):a=!h10||v10&&x10,!a)return[2,{values:[g10],quoted:!0}];_state.label=4;case 4:if(a&&i.word){m11=i.word.parts,h11=null,g11=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=m11[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){x11=_step.value;if(x11.type==="ParameterExpansion"&&!x11.operation){v11=x11.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(v11){h11=v11[1],g11=v11[2]==="*";break}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(h11){x12=zr(e,h11);if(x12.length>0){y10=x12.map(function(param){var _param=_sliced_to_array(param,2),_=_param[1];return _});if(g11||s){_10=an(e.state.env);return[2,{values:[y10.join(_10)],quoted:!0}]}return[2,{values:y10,quoted:!0}]}v12=e.state.env.get(h11);return[2,v12!==void 0?{values:[v12],quoted:!0}:{values:[],quoted:!0}]}}return[2,null]}})})()}function t2t(e,t,r,n,i){return _async_to_generator(function(){var h,g,o,a,s,l,c,x,v,y,d,x10,u,x11,p,m,x12,v10,x13,v11,y10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_,b,b10,b11,err,x14,v12,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,b12,w,w10,w11,err,y11,_10,_tmp,b13,x15;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!r||t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];o=t[0],a=-1,s="",l=!1,c=null;for(x=0;x<o.parts.length;x++){v=o.parts[x];if(v.type==="ParameterExpansion"&&(((h=v.operation)==null?void 0:h.type)==="PatternRemoval"||((g=v.operation)==null?void 0:g.type)==="PatternReplacement")){y=v.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(y){a=x,s=y[1],l=y[2]==="*",c=v.operation;break}}}if(a===-1||a===0&&a===o.parts.length-1)return[2,null];d="";x10=0;_state.label=1;case 1:if(!(x10<a))return[3,4];return[4,n(e,o.parts[x10])];case 2:d=d+_state.sent();_state.label=3;case 3:x10++;return[3,1];case 4:u="";x11=a+1;_state.label=5;case 5:if(!(x11<o.parts.length))return[3,8];return[4,n(e,o.parts[x11])];case 6:u=u+_state.sent();_state.label=7;case 7:x11++;return[3,5];case 8:p=zr(e,s),m=p.map(function(param){var _param=_sliced_to_array(param,2),x=_param[1];return x});if(p.length===0){x12=e.state.env.get(s);if(x12!==void 0)m=[x12];else{if(l)return[2,{values:[d+u],quoted:!0}];v10=d+u;return[2,{values:v10?[v10]:[],quoted:!0}]}}if(!((c==null?void 0:c.type)==="PatternRemoval"))return[3,24];x13=c,v11="",y10=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!x13.pattern)return[3,23];_state.label=9;case 9:_state.trys.push([9,21,22,23]);_iterator=x13.pattern.parts[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,20];_=_step.value;if(!(_.type==="Glob"))return[3,11];v11+=on(_.pattern,x13.greedy,y10);return[3,19];case 11:if(!(_.type==="Literal"))return[3,12];v11+=on(_.value,x13.greedy,y10);return[3,19];case 12:if(!(_.type==="SingleQuoted"||_.type==="Escaped"))return[3,13];v11+=gn(_.value);return[3,19];case 13:if(!(_.type==="DoubleQuoted"))return[3,15];return[4,i(e,_.parts)];case 14:b=_state.sent();v11+=gn(b);return[3,19];case 15:if(!(_.type==="ParameterExpansion"))return[3,17];return[4,n(e,_)];case 16:b10=_state.sent();v11+=on(b10,x13.greedy,y10);return[3,19];case 17:return[4,n(e,_)];case 18:b11=_state.sent();v11+=gn(b11);_state.label=19;case 19:_iteratorNormalCompletion=true;return[3,10];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 23:m=m.map(function(_){return d5(_,v11,x13.side,x13.greedy)});return[3,43];case 24:if(!((c==null?void 0:c.type)==="PatternReplacement"))return[3,43];x14=c,v12="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(!x14.pattern)return[3,39];_state.label=25;case 25:_state.trys.push([25,37,38,39]);_iterator1=x14.pattern.parts[Symbol.iterator]();_state.label=26;case 26:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,36];b12=_step1.value;if(!(b12.type==="Glob"))return[3,27];v12+=on(b12.pattern,!0,e.state.shoptOptions.extglob);return[3,35];case 27:if(!(b12.type==="Literal"))return[3,28];v12+=on(b12.value,!0,e.state.shoptOptions.extglob);return[3,35];case 28:if(!(b12.type==="SingleQuoted"||b12.type==="Escaped"))return[3,29];v12+=gn(b12.value);return[3,35];case 29:if(!(b12.type==="DoubleQuoted"))return[3,31];return[4,i(e,b12.parts)];case 30:w=_state.sent();v12+=gn(w);return[3,35];case 31:if(!(b12.type==="ParameterExpansion"))return[3,33];return[4,n(e,b12)];case 32:w10=_state.sent();v12+=on(w10,!0,e.state.shoptOptions.extglob);return[3,35];case 33:return[4,n(e,b12)];case 34:w11=_state.sent();v12+=gn(w11);_state.label=35;case 35:_iteratorNormalCompletion1=true;return[3,26];case 36:return[3,39];case 37:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,39];case 38:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 39:if(!x14.replacement)return[3,41];return[4,i(e,x14.replacement.parts)];case 40:_tmp=_state.sent();return[3,42];case 41:_tmp="";_state.label=42;case 42:y11=_tmp,_10=v12;x14.anchor==="start"?_10="^".concat(v12):x14.anchor==="end"&&(_10="".concat(v12,"$"));try{b13=ir(_10,x14.all?"g":"");m=m.map(function(w){return b13.replace(w,y11)})}catch(b){}_state.label=43;case 43:if(l){x15=an(e.state.env);return[2,{values:[d+m.join(x15)+u],quoted:!0}]}return[2,m.length===1?{values:[d+m[0]+u],quoted:!0}:{values:[d+m[0]].concat(_to_consumable_array(m.slice(1,-1)),[m[m.length-1]+u]),quoted:!0}]}})})()}function r2t(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,p,m,h,l,p10,c,p11,d,u,p12,m10,p13;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!r||t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0],o=-1,a="",s=!1;for(p=0;p<i.parts.length;p++){m=i.parts[p];if(m.type==="ParameterExpansion"&&!m.operation){h=m.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(h){o=p,a=h[1],s=h[2]==="*";break}}}if(o===-1)return[2,null];l="";p10=0;_state.label=1;case 1:if(!(p10<o))return[3,4];return[4,n(e,i.parts[p10])];case 2:l=l+_state.sent();_state.label=3;case 3:p10++;return[3,1];case 4:c="";p11=o+1;_state.label=5;case 5:if(!(p11<i.parts.length))return[3,8];return[4,n(e,i.parts[p11])];case 6:c=c+_state.sent();_state.label=7;case 7:p11++;return[3,5];case 8:d=zr(e,a),u=d.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return p});if(d.length===0){p12=e.state.env.get(a);if(p12!==void 0)return[2,{values:[l+p12+c],quoted:!0}];if(s)return[2,{values:[l+c],quoted:!0}];m10=l+c;return[2,{values:m10?[m10]:[],quoted:!0}]}if(s){p13=an(e.state.env);return[2,{values:[l+u.join(p13)+c],quoted:!0}]}return[2,u.length===1?{values:[l+u[0]+c],quoted:!0}:{values:[l+u[0]].concat(_to_consumable_array(u.slice(1,-1)),[u[u.length-1]+c]),quoted:!0}]}})})()}var n2t=se(function(){"use strict";Ei(),oc(),u5(),c5(),x_(),lu()});function i2t(e,t,r){return _async_to_generator(function(){var h,g,n,i,o,a,s,l,c,d,u,p,_tmp,_tmp1,x,v,m,x10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||((h=n.parts[0].operation)==null?void 0:h.type)!=="Substring")return[2,null];i=n.parts[0],o=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return[2,null];a=o[1],s=o[2]==="*",l=i.operation;if((g=e.state.associativeArrays)!=null&&g.has(a))throw new Ci(1,"","bash: ${".concat(a,"[@]: 0: 3}: bad substitution\n"));if(!l.offset)return[3,2];return[4,r(e,l.offset.expression)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=0;_state.label=3;case 3:c=_tmp;if(!l.length)return[3,5];return[4,r(e,l.length.expression)];case 4:_tmp1=_state.sent();return[3,6];case 5:_tmp1=void 0;_state.label=6;case 6:d=_tmp1,u=zr(e,a),p=0;if(c<0){if(u.length>0){x=u[u.length-1][0],v=(typeof x=="number"?x:0)+1+c;if(v<0)return[2,{values:[],quoted:!0}];p=u.findIndex(function(param){var _param=_sliced_to_array(param,1),y=_param[0];return typeof y=="number"&&y>=v}),p<0&&(p=u.length)}}else p=u.findIndex(function(param){var _param=_sliced_to_array(param,1),x=_param[0];return typeof x=="number"&&x>=c}),p<0&&(p=u.length);if(d!==void 0){if(d<0)throw new Hi("".concat(a,"[@]: substring expression < 0"));m=u.slice(p,p+d).map(function(param){var _param=_sliced_to_array(param,2),x=_param[1];return x})}else m=u.slice(p).map(function(param){var _param=_sliced_to_array(param,2),x=_param[1];return x});if(m.length===0)return[2,{values:[],quoted:!0}];if(s){x10=an(e.state.env);return[2,{values:[m.join(x10)],quoted:!0}]}return[2,{values:m,quoted:!0}]}})})()}function o2t(e,t){var u;if(t.length!==1||t[0].type!=="DoubleQuoted")return null;var r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||((u=r.parts[0].operation)==null?void 0:u.type)!=="Transform")return null;var n=r.parts[0],i=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!i)return null;var o=i[1],a=i[2]==="*",s=n.operation,l=zr(e,o);if(l.length===0){var p=e.state.env.get(o);if(p!==void 0){var m;switch(s.operator){case"a":m="";break;case"P":m=UW(e,p);break;case"Q":m=n_(p);break;default:m=p}return{values:[m],quoted:!0}}return a?{values:[""],quoted:!0}:{values:[],quoted:!0}}var c=HS(e,o),d;switch(s.operator){case"a":d=l.map(function(){return c});break;case"P":d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return UW(e,p)});break;case"Q":d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return n_(p)});break;case"u":d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return p.charAt(0).toUpperCase()+p.slice(1)});break;case"U":d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return p.toUpperCase()});break;case"L":d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return p.toLowerCase()});break;default:d=l.map(function(param){var _param=_sliced_to_array(param,2),p=_param[1];return p})}if(a){var p10=an(e.state.env);return{values:[d.join(p10)],quoted:!0}}return{values:d,quoted:!0}}var a2t=se(function(){"use strict";jr(),oc(),Cke(),Eke(),lu(),NV()});function s2t(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;var r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion")return null;var n=r.parts[0];if(n.operation)return null;var i=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!i)return null;var o=i[1];if(no(e,o)){var l=rP(e,o);if(l!=null&&l.endsWith("[@]")||l!=null&&l.endsWith("[*]"))return{values:[],quoted:!0}}var a=zr(e,o);if(a.length>0)return{values:a.map(function(param){var _param=_sliced_to_array(param,2),l=_param[1];return l}),quoted:!0};var s=e.state.env.get(o);return s!==void 0?{values:[s],quoted:!0}:{values:[],quoted:!0}}function l2t(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;var r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||r.parts[0].operation)return null;var n=r.parts[0].parameter;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||!no(e,n))return null;var i=rP(e,n);if(!i)return null;var o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!o)return null;var a=o[1],s=zr(e,a);if(s.length>0)return{values:s.map(function(param){var _param=_sliced_to_array(param,2),c=_param[1];return c}),quoted:!0};var l=e.state.env.get(a);return l!==void 0?{values:[l],quoted:!0}:{values:[],quoted:!0}}var u2t=se(function(){"use strict";_p(),lu()});function c2t(e,t,r,n,i){return _async_to_generator(function(){var h,o,a,s,l,c,g,x,v,d,u,p,x10,v10,g10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,x11,v11,y,_,err,g11,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!r||t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];o=t[0];if(o.parts.length!==1||o.parts[0].type!=="ParameterExpansion"||((h=o.parts[0].operation)==null?void 0:h.type)!=="Indirection")return[2,null];a=o.parts[0],s=a.operation;return[4,Hn(e,a.parameter)];case 1:l=_state.sent(),c=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!c){if(!s.innerOp&&(l==="@"||l==="*")){g=Number.parseInt(e.state.env.get("#")||"0",10),x=[];for(v=1;v<=g;v++)x.push(e.state.env.get(String(v))||"");return[2,l==="*"?{values:[x.join(an(e.state.env))],quoted:!0}:{values:x,quoted:!0}]}return[2,null]}d=c[1],u=c[2]==="*",p=zr(e,d);if(!s.innerOp)return[3,12];if(s.innerOp.type==="Substring")return[2,d2t(e,p,d,u,s.innerOp)];if(s.innerOp.type==="DefaultValue"||s.innerOp.type==="UseAlternative"||s.innerOp.type==="AssignDefault"||s.innerOp.type==="ErrorIfUnset")return[2,p2t(e,p,d,u,s.innerOp,i)];if(s.innerOp.type==="Transform"&&s.innerOp.operator==="a"){x10=HS(e,d),v10=p.map(function(){return x10});return[2,u?{values:[v10.join(an(e.state.env))],quoted:!0}:{values:v10,quoted:!0}]}g10=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,9,10,11]);_iterator=p[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];_step_value=_sliced_to_array(_step.value,2),x11=_step_value[1];v11={type:"ParameterExpansion",parameter:"_indirect_elem_",operation:s.innerOp},y=e.state.env.get("_indirect_elem_");e.state.env.set("_indirect_elem_",x11);_state.label=4;case 4:_state.trys.push([4,,6,7]);return[4,n(e,v11,!0)];case 5:_=_state.sent();g10.push(_);return[3,7];case 6:y!==void 0?e.state.env.set("_indirect_elem_",y):e.state.env.delete("_indirect_elem_");return[7];case 7:_iteratorNormalCompletion=true;return[3,3];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2,u?{values:[g10.join(an(e.state.env))],quoted:!0}:{values:g10,quoted:!0}];case 12:if(p.length>0){g11=p.map(function(param){var _param=_sliced_to_array(param,2),x=_param[1];return x});return[2,u?{values:[g11.join(an(e.state.env))],quoted:!0}:{values:g11,quoted:!0}]}m=e.state.env.get(d);return[2,m!==void 0?{values:[m],quoted:!0}:{values:[],quoted:!0}]}})})()}function d2t(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,_tmp,_tmp1,d,u,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!i.offset)return[3,2];return[4,Xt(e,i.offset.expression)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=0;_state.label=3;case 3:o=_tmp;if(!i.length)return[3,5];return[4,Xt(e,i.length.expression)];case 4:_tmp1=_state.sent();return[3,6];case 5:_tmp1=void 0;_state.label=6;case 6:a=_tmp1,s=0;if(o<0){if(t.length>0){d=t[t.length-1][0],u=(typeof d=="number"?d:0)+1+o;if(u<0)return[2,{values:[],quoted:!0}];if(s=t.findIndex(function(param){var _param=_sliced_to_array(param,1),p=_param[0];return typeof p=="number"&&p>=u}),s<0)return[2,{values:[],quoted:!0}]}}else if(s=t.findIndex(function(param){var _param=_sliced_to_array(param,1),d=_param[0];return typeof d=="number"&&d>=o}),s<0)return[2,{values:[],quoted:!0}];if(a!==void 0){if(a<0)throw new Hi("".concat(r,"[@]: substring expression < 0"));l=t.slice(s,s+a)}else l=t.slice(s);c=l.map(function(param){var _param=_sliced_to_array(param,2),d=_param[1];return d});return[2,n?{values:[c.join(an(e.state.env))],quoted:!0}:{values:c,quoted:!0}]}})})()}function p2t(e,t,r,n,i,o){return _async_to_generator(function(){var d,a,s,l,c,_tmp,_tmp1,_tmp2,_tmp3,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=(d=i.checkEmpty)!=null?d:!1,s=t.map(function(param){var _param=_sliced_to_array(param,2),u=_param[1];return u}),l=t.length===0,c=t.length===0;if(!(i.type==="UseAlternative"))return[3,4];if(!(!c&&!(a&&l)&&i.word))return[3,2];_tmp1={};return[4,o(e,i.word.parts,!0)];case 1:_tmp=(_tmp1.values=[_state.sent()],_tmp1.quoted=!0,_tmp1);return[3,3];case 2:_tmp={values:[],quoted:!0};_state.label=3;case 3:return[2,_tmp];case 4:if(!(i.type==="DefaultValue"))return[3,8];if(!((c||a&&l)&&i.word))return[3,6];_tmp3={};return[4,o(e,i.word.parts,!0)];case 5:_tmp2=(_tmp3.values=[_state.sent()],_tmp3.quoted=!0,_tmp3);return[3,7];case 6:_tmp2=n?{values:[s.join(an(e.state.env))],quoted:!0}:{values:s,quoted:!0};_state.label=7;case 7:return[2,_tmp2];case 8:if(!(i.type==="AssignDefault"))return[3,11];if(!((c||a&&l)&&i.word))return[3,10];return[4,o(e,i.word.parts,!0)];case 9:u=_state.sent();return[2,(e.state.env.set("".concat(r,"_0"),u),e.state.env.set("".concat(r,"__length"),"1"),{values:[u],quoted:!0})];case 10:return[2,n?{values:[s.join(an(e.state.env))],quoted:!0}:{values:s,quoted:!0}];case 11:return[2,n?{values:[s.join(an(e.state.env))],quoted:!0}:{values:s,quoted:!0}]}})})()}function f2t(e,t){return _async_to_generator(function(){var p,m,h,g,r,n,i,o,a,s,l,c,d,u,x,v,y,b,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="ParameterExpansion"||((p=t[0].operation)==null?void 0:p.type)!=="UseAlternative"&&((m=t[0].operation)==null?void 0:m.type)!=="DefaultValue")return[2,null];r=t[0],n=r.operation,i=n==null?void 0:n.word;if(!i||i.parts.length!==1||i.parts[0].type!=="DoubleQuoted")return[2,null];o=i.parts[0];if(o.parts.length!==1||o.parts[0].type!=="ParameterExpansion"||((h=o.parts[0].operation)==null?void 0:h.type)!=="Indirection")return[2,null];a=o.parts[0];return[4,Hn(e,a.parameter)];case 1:s=_state.sent().match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!s)return[2,null];return[4,g_(e,r.parameter)];case 2:l=_state.sent();return[4,Hn(e,r.parameter)];case 3:c=_state.sent()==="",d=(g=n.checkEmpty)!=null?g:!1;if(n.type==="UseAlternative"?u=l&&!(d&&c):u=!l||d&&c,u){x=s[1],v=s[2]==="*",y=zr(e,x);if(y.length>0){b=y.map(function(param){var _param=_sliced_to_array(param,2),w=_param[1];return w});return[2,v?{values:[b.join(an(e.state.env))],quoted:!0}:{values:b,quoted:!0}]}_=e.state.env.get(x);return[2,_!==void 0?{values:[_],quoted:!0}:{values:[],quoted:!0}]}return[2,{values:[],quoted:!1}]}})})()}function m2t(e,t){return _async_to_generator(function(){var m,h,g,r,n,i,o,a,s,l,c,d,u,p,x,v,y,b,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="ParameterExpansion"||((m=t[0].operation)==null?void 0:m.type)!=="Indirection")return[2,null];r=t[0],n=r.operation.innerOp;if(!n||n.type!=="UseAlternative"&&n.type!=="DefaultValue")return[2,null];i=n.word;if(!i||i.parts.length!==1||i.parts[0].type!=="DoubleQuoted")return[2,null];o=i.parts[0];if(o.parts.length!==1||o.parts[0].type!=="ParameterExpansion"||((h=o.parts[0].operation)==null?void 0:h.type)!=="Indirection")return[2,null];a=o.parts[0];return[4,Hn(e,a.parameter)];case 1:s=_state.sent().match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!s)return[2,null];return[4,Hn(e,r.parameter)];case 2:l=_state.sent();return[4,g_(e,r.parameter)];case 3:c=_state.sent(),d=l==="",u=(g=n.checkEmpty)!=null?g:!1;if(n.type==="UseAlternative"?p=c&&!(u&&d):p=!c||u&&d,p){x=s[1],v=s[2]==="*",y=zr(e,x);if(y.length>0){b=y.map(function(param){var _param=_sliced_to_array(param,2),w=_param[1];return w});return[2,v?{values:[b.join(an(e.state.env))],quoted:!0}:{values:b,quoted:!0}]}_=e.state.env.get(x);return[2,_!==void 0?{values:[_],quoted:!0}:{values:[],quoted:!0}]}return[2,{values:[],quoted:!1}]}})})()}var h2t=se(function(){"use strict";kl(),jr(),oc(),lu(),NV()});function Pke(e){var t=Number.parseInt(e.state.env.get("#")||"0",10),r=[];for(var n=1;n<=t;n++)r.push(e.state.env.get(String(n))||"");return r}function g2t(e,t,r,n){return _async_to_generator(function(){var x,i,o,a,v,y,s,l,c,d,u,_tmp,_tmp1,v10,p,m,v11,y10,_,b,v12,y11,h,v13,g,v14,v15,v16;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0],o=-1,a=!1;for(v=0;v<i.parts.length;v++){y=i.parts[v];if(y.type==="ParameterExpansion"&&(y.parameter==="@"||y.parameter==="*")&&((x=y.operation)==null?void 0:x.type)==="Substring"){o=v,a=y.parameter==="*";break}}if(o===-1)return[2,null];s=i.parts[o].operation;if(!s.offset)return[3,2];return[4,r(e,s.offset.expression)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=0;_state.label=3;case 3:l=_tmp;if(!s.length)return[3,5];return[4,r(e,s.length.expression)];case 4:_tmp1=_state.sent();return[3,6];case 5:_tmp1=void 0;_state.label=6;case 6:c=_tmp1,d=Number.parseInt(e.state.env.get("#")||"0",10),u=[];for(v10=1;v10<=d;v10++)u.push(e.state.env.get(String(v10))||"");p=e.state.env.get("0")||"bash";if(l<=0){v11=[p].concat(_to_consumable_array(u)),y10=v11.length+l;if(y10<0)m=[];else{_=l<0?y10:0;if(c!==void 0){b=c<0?v11.length+c:_+c;m=v11.slice(_,Math.max(_,b))}else m=v11.slice(_)}}else{v12=l-1;if(v12>=u.length)m=[];else if(c!==void 0){y11=c<0?u.length+c:v12+c;m=u.slice(v12,Math.max(v12,y11))}else m=u.slice(v12)}h="";v13=0;_state.label=7;case 7:if(!(v13<o))return[3,10];return[4,n(e,i.parts[v13])];case 8:h=h+_state.sent();_state.label=9;case 9:v13++;return[3,7];case 10:g="";v14=o+1;_state.label=11;case 11:if(!(v14<i.parts.length))return[3,14];return[4,n(e,i.parts[v14])];case 12:g=g+_state.sent();_state.label=13;case 13:v14++;return[3,11];case 14:if(m.length===0){v15=h+g;return[2,{values:v15?[v15]:[],quoted:!0}]}if(a){v16=an(e.state.env);return[2,{values:[h+m.join(v16)+g],quoted:!0}]}return[2,m.length===1?{values:[h+m[0]+g],quoted:!0}:{values:[h+m[0]].concat(_to_consumable_array(m.slice(1,-1)),[m[m.length-1]+g]),quoted:!0}]}})})()}function x2t(e,t,r,n){return _async_to_generator(function(){var g,i,o,a,x,v,s,l,c,x10,d,x11,x12,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x13,v10,v11,v12,err,p,m,_tmp,h,x14,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,v13,_h1,x15;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0],o=-1,a=!1;for(x=0;x<i.parts.length;x++){v=i.parts[x];if(v.type==="ParameterExpansion"&&(v.parameter==="@"||v.parameter==="*")&&((g=v.operation)==null?void 0:g.type)==="PatternReplacement"){o=x,a=v.parameter==="*";break}}if(o===-1)return[2,null];s=i.parts[o].operation,l=Pke(e),c="";x10=0;_state.label=1;case 1:if(!(x10<o))return[3,4];return[4,r(e,i.parts[x10])];case 2:c=c+_state.sent();_state.label=3;case 3:x10++;return[3,1];case 4:d="";x11=o+1;_state.label=5;case 5:if(!(x11<i.parts.length))return[3,8];return[4,r(e,i.parts[x11])];case 6:d=d+_state.sent();_state.label=7;case 7:x11++;return[3,5];case 8:if(l.length===0){x12=c+d;return[2,{values:x12?[x12]:[],quoted:!0}]}u="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!s.pattern)return[3,23];_state.label=9;case 9:_state.trys.push([9,21,22,23]);_iterator=s.pattern.parts[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,20];x13=_step.value;if(!(x13.type==="Glob"))return[3,11];u+=on(x13.pattern,!0,e.state.shoptOptions.extglob);return[3,19];case 11:if(!(x13.type==="Literal"))return[3,12];u+=on(x13.value,!0,e.state.shoptOptions.extglob);return[3,19];case 12:if(!(x13.type==="SingleQuoted"||x13.type==="Escaped"))return[3,13];u+=gn(x13.value);return[3,19];case 13:if(!(x13.type==="DoubleQuoted"))return[3,15];return[4,n(e,x13.parts)];case 14:v10=_state.sent();u+=gn(v10);return[3,19];case 15:if(!(x13.type==="ParameterExpansion"))return[3,17];return[4,r(e,x13)];case 16:v11=_state.sent();u+=on(v11,!0,e.state.shoptOptions.extglob);return[3,19];case 17:return[4,r(e,x13)];case 18:v12=_state.sent();u+=gn(v12);_state.label=19;case 19:_iteratorNormalCompletion=true;return[3,10];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 23:if(!s.replacement)return[3,25];return[4,n(e,s.replacement.parts)];case 24:_tmp=_state.sent();return[3,26];case 25:_tmp="";_state.label=26;case 26:p=_tmp,m=u;s.anchor==="start"?m="^".concat(u):s.anchor==="end"&&(m="".concat(u,"$"));h=[];try{x14=ir(m,s.all?"g":"");_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){v13=_step1.value;h.push(x14.replace(v13,p))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}catch(x){;(_h1=h).push.apply(_h1,_to_consumable_array(l))}if(a){x15=an(e.state.env);return[2,{values:[c+h.join(x15)+d],quoted:!0}]}return[2,h.length===1?{values:[c+h[0]+d],quoted:!0}:{values:[c+h[0]].concat(_to_consumable_array(h.slice(1,-1)),[h[h.length-1]+d]),quoted:!0}]}})})()}function y2t(e,t,r,n){return _async_to_generator(function(){var h,i,o,a,g,x,s,l,c,g10,d,g11,g12,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,g13,x10,x11,x12,err,m,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,g14,g15;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];i=t[0],o=-1,a=!1;for(g=0;g<i.parts.length;g++){x=i.parts[g];if(x.type==="ParameterExpansion"&&(x.parameter==="@"||x.parameter==="*")&&((h=x.operation)==null?void 0:h.type)==="PatternRemoval"){o=g,a=x.parameter==="*";break}}if(o===-1)return[2,null];s=i.parts[o].operation,l=Pke(e),c="";g10=0;_state.label=1;case 1:if(!(g10<o))return[3,4];return[4,r(e,i.parts[g10])];case 2:c=c+_state.sent();_state.label=3;case 3:g10++;return[3,1];case 4:d="";g11=o+1;_state.label=5;case 5:if(!(g11<i.parts.length))return[3,8];return[4,r(e,i.parts[g11])];case 6:d=d+_state.sent();_state.label=7;case 7:g11++;return[3,5];case 8:if(l.length===0){g12=c+d;return[2,{values:g12?[g12]:[],quoted:!0}]}u="",p=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!s.pattern)return[3,23];_state.label=9;case 9:_state.trys.push([9,21,22,23]);_iterator=s.pattern.parts[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,20];g13=_step.value;if(!(g13.type==="Glob"))return[3,11];u+=on(g13.pattern,s.greedy,p);return[3,19];case 11:if(!(g13.type==="Literal"))return[3,12];u+=on(g13.value,s.greedy,p);return[3,19];case 12:if(!(g13.type==="SingleQuoted"||g13.type==="Escaped"))return[3,13];u+=gn(g13.value);return[3,19];case 13:if(!(g13.type==="DoubleQuoted"))return[3,15];return[4,n(e,g13.parts)];case 14:x10=_state.sent();u+=gn(x10);return[3,19];case 15:if(!(g13.type==="ParameterExpansion"))return[3,17];return[4,r(e,g13)];case 16:x11=_state.sent();u+=on(x11,s.greedy,p);return[3,19];case 17:return[4,r(e,g13)];case 18:x12=_state.sent();u+=gn(x12);_state.label=19;case 19:_iteratorNormalCompletion=true;return[3,10];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 23:m=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){g14=_step1.value;m.push(d5(g14,u,s.side,s.greedy))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(a){g15=an(e.state.env);return[2,{values:[c+m.join(g15)+d],quoted:!0}]}return[2,m.length===1?{values:[c+m[0]+d],quoted:!0}:{values:[c+m[0]].concat(_to_consumable_array(m.slice(1,-1)),[m[m.length-1]+d]),quoted:!0}]}})})()}function v2t(e,t,r){return _async_to_generator(function(){var n,i,o,u,p,a,s,l,u10,c,u11,u12,d,u13,u14;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="DoubleQuoted")return[2,null];n=t[0],i=-1,o=!1;for(u=0;u<n.parts.length;u++){p=n.parts[u];if(p.type==="ParameterExpansion"&&(p.parameter==="@"||p.parameter==="*")){i=u,o=p.parameter==="*";break}}if(i===-1)return[2,null];a=n.parts[i];if(a.type==="ParameterExpansion"&&a.operation)return[2,null];s=Number.parseInt(e.state.env.get("#")||"0",10),l="";u10=0;_state.label=1;case 1:if(!(u10<i))return[3,4];return[4,r(e,n.parts[u10])];case 2:l=l+_state.sent();_state.label=3;case 3:u10++;return[3,1];case 4:c="";u11=i+1;_state.label=5;case 5:if(!(u11<n.parts.length))return[3,8];return[4,r(e,n.parts[u11])];case 6:c=c+_state.sent();_state.label=7;case 7:u11++;return[3,5];case 8:if(s===0){if(o)return[2,{values:[l+c],quoted:!0}];u12=l+c;return[2,{values:u12?[u12]:[],quoted:!0}]}d=[];for(u13=1;u13<=s;u13++)d.push(e.state.env.get(String(u13))||"");if(o){u14=an(e.state.env);return[2,{values:[l+d.join(u14)+c],quoted:!0}]}return[2,d.length===1?{values:[l+d[0]+c],quoted:!0}:{values:[l+d[0]].concat(_to_consumable_array(d.slice(1,-1)),[d[d.length-1]+c]),quoted:!0}]}})})()}var _2t=se(function(){"use strict";Ei(),oc(),u5(),c5(),x_()});function b2t(e){return new eP(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations})}function nP(e,t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,_n,o,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.state.options.noglob)return[2,t];r=b2t(e),n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];i=_step.value;if(!e1(i,e.state.shoptOptions.extglob))return[3,4];return[4,r.expand(i)];case 3:o=_state.sent();if(o.length>0)(_n=n).push.apply(_n,_to_consumable_array(o));else{if(r.hasFailglob())throw new i5(i);r.hasNullglob()||n.push(i)}return[3,5];case 4:n.push(i);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,n]}})})()}function w2t(e,t,r,n){return _async_to_generator(function(){var _x1,v,i,o,a,y,_,b,s,l,c,y10,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,y11,_10,_11,_12,err,u,p,_tmp,m,y12,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_13,_m1,h,g,y13,_14,x,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,y14;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=-1,o="",a=!1;for(y=0;y<t.length;y++){_=t[y];if(_.type==="ParameterExpansion"&&((v=_.operation)==null?void 0:v.type)==="PatternReplacement"){b=_.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(b){i=y,o=b[1],a=b[2]==="*";break}}}if(i===-1)return[2,null];s=t[i].operation,l=zr(e,o),c=l.map(function(param){var _param=_sliced_to_array(param,2),y=_param[1];return y});if(l.length===0){y10=e.state.env.get(o);y10!==void 0&&(c=[y10])}if(c.length===0)return[2,{values:[],quoted:!1}];d="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!s.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=s.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];y11=_step.value;if(!(y11.type==="Glob"))return[3,3];d+=on(y11.pattern,!0,e.state.shoptOptions.extglob);return[3,11];case 3:if(!(y11.type==="Literal"))return[3,4];d+=on(y11.value,!0,e.state.shoptOptions.extglob);return[3,11];case 4:if(!(y11.type==="SingleQuoted"||y11.type==="Escaped"))return[3,5];d+=gn(y11.value);return[3,11];case 5:if(!(y11.type==="DoubleQuoted"))return[3,7];return[4,r(e,y11.parts)];case 6:_10=_state.sent();d+=gn(_10);return[3,11];case 7:if(!(y11.type==="ParameterExpansion"))return[3,9];return[4,n(e,y11)];case 8:_11=_state.sent();d+=on(_11,!0,e.state.shoptOptions.extglob);return[3,11];case 9:return[4,n(e,y11)];case 10:_12=_state.sent();d+=gn(_12);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:if(!s.replacement)return[3,17];return[4,r(e,s.replacement.parts)];case 16:_tmp=_state.sent();return[3,18];case 17:_tmp="";_state.label=18;case 18:u=_tmp,p=d;s.anchor==="start"?p="^".concat(d):s.anchor==="end"&&(p="".concat(d,"$"));m=[];try{y12=ir(p,s.all?"g":"");_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=c[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_13=_step1.value;m.push(y12.replace(_13,u))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}catch(y){;(_m1=m).push.apply(_m1,_to_consumable_array(c))}h=us(e.state.env),g=bl(e.state.env);if(a){y13=an(e.state.env),_14=m.join(y13);return[2,g?{values:_14?[_14]:[],quoted:!1}:{values:_i(_14,h),quoted:!1}]}if(g)return[2,{values:m,quoted:!1}];x=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=m[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){y14=_step2.value;y14===""?x.push(""):(_x1=x).push.apply(_x1,_to_consumable_array(_i(y14,h)))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,{values:x,quoted:!1}]}})})()}function S2t(e,t,r,n){return _async_to_generator(function(){var _g1,x,i,o,a,v,y,_,s,l,c,v10,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,v11,y10,y11,y12,err,p,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,v12,m,h,v13,y13,g,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,v14;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=-1,o="",a=!1;for(v=0;v<t.length;v++){y=t[v];if(y.type==="ParameterExpansion"&&((x=y.operation)==null?void 0:x.type)==="PatternRemoval"){_=y.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(_){i=v,o=_[1],a=_[2]==="*";break}}}if(i===-1)return[2,null];s=t[i].operation,l=zr(e,o),c=l.map(function(param){var _param=_sliced_to_array(param,2),v=_param[1];return v});if(l.length===0){v10=e.state.env.get(o);v10!==void 0&&(c=[v10])}if(c.length===0)return[2,{values:[],quoted:!1}];d="",u=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!s.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=s.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];v11=_step.value;if(!(v11.type==="Glob"))return[3,3];d+=on(v11.pattern,s.greedy,u);return[3,11];case 3:if(!(v11.type==="Literal"))return[3,4];d+=on(v11.value,s.greedy,u);return[3,11];case 4:if(!(v11.type==="SingleQuoted"||v11.type==="Escaped"))return[3,5];d+=gn(v11.value);return[3,11];case 5:if(!(v11.type==="DoubleQuoted"))return[3,7];return[4,r(e,v11.parts)];case 6:y10=_state.sent();d+=gn(y10);return[3,11];case 7:if(!(v11.type==="ParameterExpansion"))return[3,9];return[4,n(e,v11)];case 8:y11=_state.sent();d+=on(y11,s.greedy,u);return[3,11];case 9:return[4,n(e,v11)];case 10:y12=_state.sent();d+=gn(y12);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:p=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=c[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){v12=_step1.value;p.push(d5(v12,d,s.side,s.greedy))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}m=us(e.state.env),h=bl(e.state.env);if(a){v13=an(e.state.env),y13=p.join(v13);return[2,h?{values:y13?[y13]:[],quoted:!1}:{values:_i(y13,m),quoted:!1}]}if(h)return[2,{values:p,quoted:!1}];g=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=p[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){v14=_step2.value;v14===""?g.push(""):(_g1=g).push.apply(_g1,_to_consumable_array(_i(v14,m)))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,{values:g,quoted:!1}]}})})()}function k2t(e,t,r,n){return _async_to_generator(function(){var _h1,g,i,o,x,v,a,s,l,x10,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x11,v10,v11,v12,err,u,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,x12,p,m,x13,v13,h,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,x14;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=-1,o=!1;for(x=0;x<t.length;x++){v=t[x];if(v.type==="ParameterExpansion"&&(v.parameter==="@"||v.parameter==="*")&&((g=v.operation)==null?void 0:g.type)==="PatternRemoval"){i=x,o=v.parameter==="*";break}}if(i===-1)return[2,null];a=t[i].operation,s=Number.parseInt(e.state.env.get("#")||"0",10),l=[];for(x10=1;x10<=s;x10++)l.push(e.state.env.get(String(x10))||"");if(l.length===0)return[2,{values:[],quoted:!1}];c="",d=e.state.shoptOptions.extglob;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!a.pattern)return[3,15];_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=a.pattern.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];x11=_step.value;if(!(x11.type==="Glob"))return[3,3];c+=on(x11.pattern,a.greedy,d);return[3,11];case 3:if(!(x11.type==="Literal"))return[3,4];c+=on(x11.value,a.greedy,d);return[3,11];case 4:if(!(x11.type==="SingleQuoted"||x11.type==="Escaped"))return[3,5];c+=gn(x11.value);return[3,11];case 5:if(!(x11.type==="DoubleQuoted"))return[3,7];return[4,r(e,x11.parts)];case 6:v10=_state.sent();c+=gn(v10);return[3,11];case 7:if(!(x11.type==="ParameterExpansion"))return[3,9];return[4,n(e,x11)];case 8:v11=_state.sent();c+=on(v11,a.greedy,d);return[3,11];case 9:return[4,n(e,x11)];case 10:v12=_state.sent();c+=gn(v12);_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:u=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){x12=_step1.value;u.push(d5(x12,c,a.side,a.greedy))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}p=us(e.state.env),m=bl(e.state.env);if(o){x13=an(e.state.env),v13=u.join(x13);return[2,m?{values:v13?[v13]:[],quoted:!1}:{values:_i(v13,p),quoted:!1}]}if(m)return[2,{values:u,quoted:!1}];h=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=u[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){x14=_step2.value;x14===""?h.push(""):(_h1=h).push.apply(_h1,_to_consumable_array(_i(x14,p)))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,{values:h,quoted:!1}]}})})()}function C2t(e,t,r,n){return _async_to_generator(function(){var y,i,o,_,b,a,s,l,c,d,_tmp,_tmp1,_10,u,p,_11,b10,w,S,_12,b11,m,_13,h,_14,g,x,_15,v,_16,b12,_17,b13,_v1,w10,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=-1,o=!1;for(_=0;_<t.length;_++){b=t[_];if(b.type==="ParameterExpansion"&&(b.parameter==="@"||b.parameter==="*")&&((y=b.operation)==null?void 0:y.type)==="Substring"){i=_,o=b.parameter==="*";break}}if(i===-1)return[2,null];a=t[i].operation;if(!a.offset)return[3,2];return[4,r(e,a.offset.expression)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=0;_state.label=3;case 3:s=_tmp;if(!a.length)return[3,5];return[4,r(e,a.length.expression)];case 4:_tmp1=_state.sent();return[3,6];case 5:_tmp1=void 0;_state.label=6;case 6:l=_tmp1,c=Number.parseInt(e.state.env.get("#")||"0",10),d=[];for(_10=1;_10<=c;_10++)d.push(e.state.env.get(String(_10))||"");u=e.state.env.get("0")||"bash";if(s<=0){_11=[u].concat(_to_consumable_array(d)),b10=_11.length+s;if(b10<0)p=[];else{w=s<0?b10:0;if(l!==void 0){S=l<0?_11.length+l:w+l;p=_11.slice(w,Math.max(w,S))}else p=_11.slice(w)}}else{_12=s-1;if(_12>=d.length)p=[];else if(l!==void 0){b11=l<0?d.length+l:_12+l;p=d.slice(_12,Math.max(_12,b11))}else p=d.slice(_12)}m="";_13=0;_state.label=7;case 7:if(!(_13<i))return[3,10];return[4,n(e,t[_13])];case 8:m=m+_state.sent();_state.label=9;case 9:_13++;return[3,7];case 10:h="";_14=i+1;_state.label=11;case 11:if(!(_14<t.length))return[3,14];return[4,n(e,t[_14])];case 12:h=h+_state.sent();_state.label=13;case 13:_14++;return[3,11];case 14:g=us(e.state.env),x=bl(e.state.env);if(p.length===0){_15=m+h;return[2,_15?x?{values:[_15],quoted:!1}:{values:_i(_15,g),quoted:!1}:{values:[],quoted:!1}]}if(o){_16=an(e.state.env),b12=m+p.join(_16)+h;x?v=b12?[b12]:[]:v=_i(b12,g)}else if(x)p.length===1?v=[m+p[0]+h]:v=[m+p[0]].concat(_to_consumable_array(p.slice(1,-1)),[p[p.length-1]+h]);else{v=[];for(_17=0;_17<p.length;_17++){b13=p[_17];if(_17===0&&(b13=m+b13),_17===p.length-1&&(b13=b13+h),b13==="")v.push("");else{;w10=_i(b13,g);(_v1=v).push.apply(_v1,_to_consumable_array(w10))}}}_tmp2={};return[4,nP(e,v)];case 15:return[2,(_tmp2.values=_state.sent(),_tmp2.quoted=!1,_tmp2)]}})})()}function E2t(e,t){return _async_to_generator(function(){var r,n,i,c,o,a,s,l,c10,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c11,_l1,d10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,c12,_l2,d11,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].parameter!=="@"&&t[0].parameter!=="*"||t[0].operation)return[2,null];r=t[0].parameter==="*",n=Number.parseInt(e.state.env.get("#")||"0",10);if(n===0)return[2,{values:[],quoted:!1}];i=[];for(c=1;c<=n;c++)i.push(e.state.env.get(String(c))||"");o=us(e.state.env),a=bl(e.state.env),s=PV(e.state.env);if(r)if(a)l=i.filter(function(c){return c!==""});else{c10=an(e.state.env),d=i.join(c10);l=_i(d,o)}else if(a)l=i.filter(function(c){return c!==""});else if(s){l=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){c11=_step.value;if(c11==="")continue;d10=_i(c11,o);(_l1=l).push.apply(_l1,_to_consumable_array(d10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else{l=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=i[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){c12=_step1.value;if(c12==="")l.push("");else{;d11=_i(c12,o);(_l2=l).push.apply(_l2,_to_consumable_array(d11))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}for(;l.length>0&&l[l.length-1]==="";)l.pop()}_tmp={};return[4,nP(e,l)];case 1:return[2,(_tmp.values=_state.sent(),_tmp.quoted=!1,_tmp)]}})})()}function T2t(e,t){return _async_to_generator(function(){var r,n,i,o,a,u,s,l,c,d,u10,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u11,_d1,p10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,u12,_d2,p11,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation)return[2,null];r=t[0].parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!r)return[2,null];n=r[1],i=r[2]==="*",o=zr(e,n);if(o.length===0){u=e.state.env.get(n);if(u!==void 0)a=[u];else return[2,{values:[],quoted:!1}]}else a=o.map(function(param){var _param=_sliced_to_array(param,2),u=_param[1];return u});s=us(e.state.env),l=bl(e.state.env),c=PV(e.state.env);if(i)if(l)d=a.filter(function(u){return u!==""});else{u10=an(e.state.env),p=a.join(u10);d=_i(p,s)}else if(l)d=a.filter(function(u){return u!==""});else if(c){d=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=a[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u11=_step.value;if(u11==="")continue;p10=_i(u11,s);(_d1=d).push.apply(_d1,_to_consumable_array(p10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else{d=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=a[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){u12=_step1.value;if(u12==="")d.push("");else{;p11=_i(u12,s);(_d2=d).push.apply(_d2,_to_consumable_array(p11))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}for(;d.length>0&&d[d.length-1]==="";)d.pop()}_tmp={};return[4,nP(e,d)];case 1:return[2,(_tmp.values=_state.sent(),_tmp.quoted=!1,_tmp)]}})})()}function A2t(e,t){var s;if(t.length!==1||t[0].type!=="ParameterExpansion"||((s=t[0].operation)==null?void 0:s.type)!=="VarNamePrefix")return null;var r=t[0].operation,n=$V(e,r.prefix);if(n.length===0)return{values:[],quoted:!1};var i=us(e.state.env),o=bl(e.state.env),a;if(r.star)if(o)a=n;else{var l=an(e.state.env),c=n.join(l);a=_i(c,i)}else if(o)a=n;else{a=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l10=_step.value;var _a1;var c10=_i(l10,i);(_a1=a).push.apply(_a1,_to_consumable_array(c10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return{values:a,quoted:!1}}function I2t(e,t){var s;if(t.length!==1||t[0].type!=="ParameterExpansion"||((s=t[0].operation)==null?void 0:s.type)!=="ArrayKeys")return null;var r=t[0].operation,n=zr(e,r.array).map(function(param){var _param=_sliced_to_array(param,1),l=_param[0];return String(l)});if(n.length===0)return{values:[],quoted:!1};var i=us(e.state.env),o=bl(e.state.env),a;if(r.star)if(o)a=n;else{var l=an(e.state.env),c=n.join(l);a=_i(c,i)}else if(o)a=n;else{a=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l10=_step.value;var _a1;var c10=_i(l10,i);(_a1=a).push.apply(_a1,_to_consumable_array(c10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return{values:a,quoted:!1}}function P2t(e,t,r){return _async_to_generator(function(){var n,p,m,i,o,p10,a,p11,s,p12,l,c,d,p13,u,p14,m10,h,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m11,_u,h10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m12,_u1,h11,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=-1;for(p=0;p<t.length;p++){m=t[p];if(m.type==="ParameterExpansion"&&(m.parameter==="@"||m.parameter==="*")&&!m.operation){n=p;break}}if(n===-1||t.length<=1)return[2,null];i=Number.parseInt(e.state.env.get("#")||"0",10),o=[];for(p10=1;p10<=i;p10++)o.push(e.state.env.get(String(p10))||"");a="";p11=0;_state.label=1;case 1:if(!(p11<n))return[3,4];return[4,r(e,t[p11])];case 2:a=a+_state.sent();_state.label=3;case 3:p11++;return[3,1];case 4:s="";p12=n+1;_state.label=5;case 5:if(!(p12<t.length))return[3,8];return[4,r(e,t[p12])];case 6:s=s+_state.sent();_state.label=7;case 7:p12++;return[3,5];case 8:l=us(e.state.env),c=bl(e.state.env),d=PV(e.state.env);if(i===0){p13=a+s;return[2,{values:p13?[p13]:[],quoted:!1}]}{p14=[];for(m10=0;m10<o.length;m10++){h=o[m10];m10===0&&(h=a+h),m10===o.length-1&&(h=h+s),p14.push(h)}if(c)u=p14.filter(function(m){return m!==""});else if(d){u=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=p14[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){m11=_step.value;if(m11==="")continue;h10=_i(m11,l);(_u=u).push.apply(_u,_to_consumable_array(h10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else{u=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=p14[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){m12=_step1.value;if(m12==="")u.push("");else{;h11=_i(m12,l);(_u1=u).push.apply(_u1,_to_consumable_array(h11))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}for(;u.length>0&&u[u.length-1]==="";)u.pop()}}if(!(u.length===0))return[3,9];_tmp={values:[],quoted:!1};return[3,11];case 9:_tmp1={};return[4,nP(e,u)];case 10:_tmp=(_tmp1.values=_state.sent(),_tmp1.quoted=!1,_tmp1);_state.label=11;case 11:return[2,_tmp]}})})()}var R2t=se(function(){"use strict";Ei(),TV(),jr(),oc(),u5(),e5(),c5(),x_(),lu()});function M2t(e,t,r){return _async_to_generator(function(){var v,n,_zW,i,o,a,s,l,c,d,u,_tmp,p,m,h,g,y,_,b,x;return _ts_generator(this,function(_state){switch(_state.label){case 0:(v=e.coverage)==null||v.hit("bash:expansion:word_glob");n=t.parts,_zW=zW(n),i=_zW.hasQuoted,o=_zW.hasCommandSub,a=_zW.hasArrayVar,s=_zW.hasArrayAtExpansion,l=_zW.hasParamExpansion,c=_zW.hasVarNamePrefixExpansion,d=_zW.hasIndirection;if(!r.hasBraceExpansion(n))return[3,2];return[4,r.expandWordWithBracesAsync(e,t)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=null;_state.label=3;case 3:u=_tmp;if(u&&u.length>1)return[2,O2t(e,u,i)];return[4,$2t(e,n,s,c,d,r)];case 4:p=_state.sent();if(p!==null)return[2,p];return[4,D2t(e,n,r)];case 5:m=_state.sent();if(m!==null)return[2,m];return[4,L2t(e,n,r)];case 6:h=_state.sent();if(h!==null)return[2,h];return[4,z2t(e,n,r.expandPart)];case 7:g=_state.sent();if(g!==null)return[2,Q_e(e,g)];if(!((o||a||l)&&!bl(e.state.env)))return[3,9];y=us(e.state.env),_=r.buildIfsCharClassPattern(y);return[4,r.smartWordSplit(e,n,y,_,r.expandPart)];case 8:b=_state.sent();return[2,Q_e(e,b)];case 9:return[4,r.expandWordAsync(e,t)];case 10:x=_state.sent();return[2,j2t(e,t,n,x,i,r.expandWordForGlobbing)]}})})()}function O2t(e,t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,_n,o,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];i=_step.value;if(!!(!r&&i===""))return[3,5];if(!(!r&&!e.state.options.noglob&&e1(i,e.state.shoptOptions.extglob)))return[3,4];return[4,N9(e,i)];case 3:o=_state.sent();(_n=n).push.apply(_n,_to_consumable_array(o));return[3,5];case 4:n.push(i);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,{values:n,quoted:!1}]}})})()}function $2t(e,t,r,n,i,o){return _async_to_generator(function(){var a,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r){a=s2t(e,t);if(a!==null)return[2,a]}{a9=l2t(e,t);if(a9!==null)return[2,a9]}return[4,e2t(e,t)];case 1:a10=_state.sent();if(a10!==null)return[2,a10];return[4,t2t(e,t,r,o.expandPart,o.expandWordPartsAsync)];case 2:a11=_state.sent();if(a11!==null)return[2,a11];return[4,r2t(e,t,r,o.expandPart)];case 3:a12=_state.sent();if(a12!==null)return[2,a12];return[4,i2t(e,t,o.evaluateArithmetic)];case 4:a13=_state.sent();if(a13!==null)return[2,a13];{a14=o2t(e,t);if(a14!==null)return[2,a14]}return[4,Jyt(e,t,o.expandWordPartsAsync,o.expandPart)];case 5:a15=_state.sent();if(a15!==null)return[2,a15];return[4,Yyt(e,t,o.expandWordPartsAsync,o.expandPart)];case 6:a16=_state.sent();if(a16!==null)return[2,a16];if(n&&t.length===1&&t[0].type==="DoubleQuoted"){a17=N2t(e,t);if(a17!==null)return[2,a17]}return[4,c2t(e,t,i,o.expandParameterAsync,o.expandWordPartsAsync)];case 7:a18=_state.sent();if(a18!==null)return[2,a18];return[4,f2t(e,t)];case 8:a19=_state.sent();if(a19!==null)return[2,a19];return[4,m2t(e,t)];case 9:a20=_state.sent();if(a20!==null)return[2,a20];return[2,null]}})})()}function N2t(e,t){var n,i;var r=t[0];if(r.type!=="DoubleQuoted")return null;if(r.parts.length===1&&r.parts[0].type==="ParameterExpansion"&&((n=r.parts[0].operation)==null?void 0:n.type)==="VarNamePrefix"){var o=r.parts[0].operation,a=$V(e,o.prefix);return o.star?{values:[a.join(an(e.state.env))],quoted:!0}:{values:a,quoted:!0}}if(r.parts.length===1&&r.parts[0].type==="ParameterExpansion"&&((i=r.parts[0].operation)==null?void 0:i.type)==="ArrayKeys"){var o10=r.parts[0].operation,a9=zr(e,o10.array).map(function(param){var _param=_sliced_to_array(param,1),s=_param[0];return String(s)});return o10.star?{values:[a9.join(an(e.state.env))],quoted:!0}:{values:a9,quoted:!0}}return null}function D2t(e,t,r){return _async_to_generator(function(){var n,n10,n11,n12;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,g2t(e,t,r.evaluateArithmetic,r.expandPart)];case 1:n=_state.sent();if(n!==null)return[2,n];return[4,x2t(e,t,r.expandPart,r.expandWordPartsAsync)];case 2:n10=_state.sent();if(n10!==null)return[2,n10];return[4,y2t(e,t,r.expandPart,r.expandWordPartsAsync)];case 3:n11=_state.sent();if(n11!==null)return[2,n11];return[4,v2t(e,t,r.expandPart)];case 4:n12=_state.sent();if(n12!==null)return[2,n12];return[2,null]}})})()}function L2t(e,t,r){return _async_to_generator(function(){var n,n10,n11,n12,n13,n14,n15,n16,n17;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,w2t(e,t,r.expandWordPartsAsync,r.expandPart)];case 1:n=_state.sent();if(n!==null)return[2,n];return[4,S2t(e,t,r.expandWordPartsAsync,r.expandPart)];case 2:n10=_state.sent();if(n10!==null)return[2,n10];return[4,k2t(e,t,r.expandWordPartsAsync,r.expandPart)];case 3:n11=_state.sent();if(n11!==null)return[2,n11];return[4,C2t(e,t,r.evaluateArithmetic,r.expandPart)];case 4:n12=_state.sent();if(n12!==null)return[2,n12];return[4,E2t(e,t)];case 5:n13=_state.sent();if(n13!==null)return[2,n13];return[4,T2t(e,t)];case 6:n14=_state.sent();if(n14!==null)return[2,n14];{n15=A2t(e,t);if(n15!==null)return[2,n15]}{n16=I2t(e,t);if(n16!==null)return[2,n16]}return[4,P2t(e,t,r.expandPart)];case 7:n17=_state.sent();if(n17!==null)return[2,n17];return[2,null]}})})()}function K_e(e){if(e.type!=="DoubleQuoted")return null;for(var t=0;t<e.parts.length;t++){var r=e.parts[t];if(r.type!=="ParameterExpansion"||r.operation)continue;var n=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(n)return{type:"array",name:n[1],atIndex:t,isStar:n[2]==="*"};if(r.parameter==="@"||r.parameter==="*")return{type:"positional",atIndex:t,isStar:r.parameter==="*"}}return null}function F2t(e,t,r,n){return _async_to_generator(function(){var i,s,o,s10,a,s11,s12,l,s13,l10,s14;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="";s=0;_state.label=1;case 1:if(!(s<r.atIndex))return[3,4];return[4,n(e,t.parts[s])];case 2:i=i+_state.sent();_state.label=3;case 3:s++;return[3,1];case 4:o="";s10=r.atIndex+1;_state.label=5;case 5:if(!(s10<t.parts.length))return[3,8];return[4,n(e,t.parts[s10])];case 6:o=o+_state.sent();_state.label=7;case 7:s10++;return[3,5];case 8:if(r.type==="array"){if(a=zr(e,r.name).map(function(param){var _param=_sliced_to_array(param,2),s=_param[1];return s}),a.length===0){s11=e.state.env.get(r.name);s11!==void 0&&(a=[s11])}}else{s12=Number.parseInt(e.state.env.get("#")||"0",10);a=[];for(l=1;l<=s12;l++)a.push(e.state.env.get(String(l))||"")}if(r.isStar){s13=an(e.state.env),l10=a.join(s13);return[2,[i+l10+o]]}if(a.length===0){s14=i+o;return[2,s14?[s14]:[]]}return[2,a.length===1?[i+a[0]+o]:[i+a[0]].concat(_to_consumable_array(a.slice(1,-1)),[a[a.length-1]+o])]}})})()}function z2t(e,t,r){return _async_to_generator(function(){var _s1,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,i,o,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l10,c,d,d10,d11,u,d12,u10,err,s,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,l11,c10,d13;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length<2)return[2,null];n=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l=_step.value;if(K_e(l)){n=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!n)return[2,null];i=us(e.state.env),o=bl(e.state.env),a=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator1=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,12];l10=_step1.value;c=K_e(l10);if(!(c&&l10.type==="DoubleQuoted"))return[3,4];return[4,F2t(e,l10,c,r)];case 3:d=_state.sent();a.push(d);return[3,11];case 4:if(!(l10.type==="DoubleQuoted"||l10.type==="SingleQuoted"))return[3,6];return[4,r(e,l10)];case 5:d10=_state.sent();a.push([d10]);return[3,11];case 6:if(!(l10.type==="Literal"))return[3,7];a.push([l10.value]);return[3,11];case 7:if(!(l10.type==="ParameterExpansion"))return[3,9];return[4,r(e,l10)];case 8:d11=_state.sent();if(o)a.push(d11?[d11]:[]);else{u=_i(d11,i);a.push(u)}return[3,11];case 9:return[4,r(e,l10)];case 10:d12=_state.sent();if(o)a.push(d12?[d12]:[]);else{u10=_i(d12,i);a.push(u10)}_state.label=11;case 11:_iteratorNormalCompletion1=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 15:s=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=a[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){l11=_step2.value;if(l11.length!==0)if(s.length===0)(_s1=s).push.apply(_s1,_to_consumable_array(l11));else{c10=s.length-1;s[c10]=s[c10]+l11[0];for(d13=1;d13<l11.length;d13++)s.push(l11[d13])}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,s]}})})()}function Q_e(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,_r1,i,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.state.options.noglob)return[2,{values:t,quoted:!1}];r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];n=_step.value;if(!e1(n,e.state.shoptOptions.extglob))return[3,4];return[4,N9(e,n)];case 3:i=_state.sent();(_r1=r).push.apply(_r1,_to_consumable_array(i));return[3,5];case 4:r.push(n);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,{values:r,quoted:!1}]}})})()}function N9(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new eP(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations});return[4,r.expand(t)];case 1:n=_state.sent();if(n.length>0)return[2,n];if(r.hasFailglob())throw new i5(t);return[2,r.hasNullglob()?[]:[t]]}})})()}function j2t(e,t,r,n,i,o){return _async_to_generator(function(){var a,s,c,l,c10,s10,l10,s11,l11;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=r.some(function(s){return s.type==="Glob"});if(!(!e.state.options.noglob&&a))return[3,4];return[4,o(e,t)];case 1:s=_state.sent();if(!e1(s,e.state.shoptOptions.extglob))return[3,3];return[4,N9(e,s)];case 2:c=_state.sent();if(c.length>0&&c[0]!==s)return[2,{values:c,quoted:!1}];if(c.length===0)return[2,{values:[],quoted:!1}];_state.label=3;case 3:l=Z_e(n);if(!bl(e.state.env)){c10=us(e.state.env);return[2,{values:_i(l,c10),quoted:!1}]}return[2,{values:[l],quoted:!1}];case 4:if(!(!i&&!e.state.options.noglob&&e1(n,e.state.shoptOptions.extglob)))return[3,7];return[4,o(e,t)];case 5:s10=_state.sent();if(!e1(s10,e.state.shoptOptions.extglob))return[3,7];return[4,N9(e,s10)];case 6:l10=_state.sent();if(l10.length>0&&l10[0]!==s10)return[2,{values:l10,quoted:!1}];_state.label=7;case 7:if(n===""&&!i)return[2,{values:[],quoted:!1}];if(a&&!i){s11=Z_e(n);if(!bl(e.state.env)){l11=us(e.state.env);return[2,{values:_i(s11,l11),quoted:!1}]}return[2,{values:[s11],quoted:!1}]}return[2,{values:[n],quoted:i}]}})})()}var U2t=se(function(){"use strict";TV(),jr(),oc(),AV(),Xyt(),n2t(),a2t(),u2t(),e5(),h2t(),x_(),_2t(),R2t(),lu()});function Rke(e,t){return _async_to_generator(function(){var l,r,n,i,o,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.operation;if(!r||r.type!=="DefaultValue"&&r.type!=="AssignDefault"&&r.type!=="UseAlternative")return[2,null];n=r.word;if(!n||n.parts.length===0)return[2,null];return[4,g_(e,t.parameter)];case 1:i=_state.sent();return[4,Hn(e,t.parameter,!1)];case 2:o=_state.sent()==="",a=(l=r.checkEmpty)!=null?l:!1;return[2,(r.type==="UseAlternative"?s=i&&!(a&&o):s=!i||a&&o,s?n.parts:null)]}})})()}function B2t(e){return e.type==="SingleQuoted"?!0:e.type==="DoubleQuoted"?e.parts.every(function(t){return t.type==="Literal"}):!1}function q2t(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.type!=="ParameterExpansion")return[2,null];return[4,Rke(e,t)];case 1:r=_state.sent();if(!r||r.length<=1)return[2,null];n=r.some(function(o){return B2t(o)}),i=r.some(function(o){return o.type==="Literal"||o.type==="ParameterExpansion"||o.type==="CommandSubstitution"||o.type==="ArithmeticExpansion"});return[2,n&&i?r:null]}})})()}function W2t(e){return e.type==="DoubleQuoted"||e.type==="SingleQuoted"||e.type==="Literal"?!1:e.type==="Glob"?vke(e.pattern):!(!(e.type==="ParameterExpansion"||e.type==="CommandSubstitution"||e.type==="ArithmeticExpansion")||e.type==="ParameterExpansion"&&oyt(e))}function V2t(e,t,r,n,i){return _async_to_generator(function(){var p,m,h,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m10,h10,g,x,v,_tmp,err,m11,s,l,c,d,u,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m12,h11,g10,_MV,h12,g11,x10,v10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((p=e.coverage)==null||p.hit("bash:expansion:word_split"),t.length===1&&t[0].type==="ParameterExpansion"))return[3,2];m=t[0];return[4,Rke(e,m)];case 1:h=_state.sent();if(h&&h.length>0&&h.length>1&&h.some(function(g){return g.type==="DoubleQuoted"||g.type==="SingleQuoted"})&&h.some(function(g){return g.type==="Literal"||g.type==="ParameterExpansion"||g.type==="CommandSubstitution"||g.type==="ArithmeticExpansion"}))return[2,J_e(e,h,r,n,i)];_state.label=2;case 2:o=[],a=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,11,12,13]);_iterator=t[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];m10=_step.value;h10=W2t(m10),g=m10.type==="DoubleQuoted"||m10.type==="SingleQuoted";if(!h10)return[3,6];return[4,q2t(e,m10)];case 5:_tmp=_state.sent();return[3,7];case 6:_tmp=null;_state.label=7;case 7:x=_tmp;return[4,i(e,m10)];case 8:v=_state.sent();o.push({value:v,isSplittable:h10,isQuoted:g,mixedDefaultParts:x!=null?x:void 0}),h10&&(a=!0);_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,4];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:if(!a){m11=o.map(function(h){return h.value}).join("");return[2,m11?[m11]:[]]}s=[],l="",c=!1,d=!1,u=!1;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=14;case 14:_state.trys.push([14,21,22,23]);_iterator1=o[Symbol.iterator]();_state.label=15;case 15:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,20];m12=_step1.value;if(!!m12.isSplittable)return[3,16];d?m12.isQuoted&&m12.value===""?(l!==""&&s.push(l),s.push(""),c=!0,l="",d=!1,u=!0):m12.value!==""?(l!==""&&s.push(l),l=m12.value,d=!1,u=!1):(l+=m12.value,u=!1):(l+=m12.value,u=m12.isQuoted&&m12.value==="");return[3,19];case 16:if(!m12.mixedDefaultParts)return[3,18];return[4,J_e(e,m12.mixedDefaultParts,r,n,i)];case 17:h11=_state.sent();if(h11.length!==0)if(h11.length===1)l+=h11[0],c=!0;else{l+=h11[0],s.push(l),c=!0;for(g10=1;g10<h11.length-1;g10++)s.push(h11[g10]);l=h11[h11.length-1]}d=!1,u=!1;return[3,19];case 18:_MV=MV(m12.value,r),h12=_MV.words,g11=_MV.hadLeadingDelimiter,x10=_MV.hadTrailingDelimiter;if(u&&g11&&l===""&&(s.push(""),c=!0),h12.length===0)x10&&(d=!0);else if(h12.length===1)l+=h12[0],c=!0,d=x10;else{l+=h12[0],s.push(l),c=!0;for(v10=1;v10<h12.length-1;v10++)s.push(h12[v10]);l=h12[h12.length-1],d=x10}u=!1;_state.label=19;case 19:_iteratorNormalCompletion1=true;return[3,15];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 23:return[2,(l!==""?s.push(l):s.length===0&&c&&s.push(""),s)]}})})()}function G2t(e,t){return e.length>0&&t.includes(e[0])}function J_e(e,t,r,n,i){return _async_to_generator(function(){var o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,err,a,s,l,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,d10,_MV,u10,p10,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];d=_step.value;u=!(d.type==="DoubleQuoted"||d.type==="SingleQuoted");return[4,i(e,d)];case 3:p=_state.sent();o.push({value:p,isSplittable:u});_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:a=[],s="",l=!1,c=!1;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=o[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){d10=_step1.value;if(!d10.isSplittable)c&&d10.value!==""?(s!==""&&a.push(s),s=d10.value,c=!1):s+=d10.value;else{G2t(d10.value,r)&&s!==""&&(a.push(s),s="",l=!0);_MV=MV(d10.value,r),u10=_MV.words,p10=_MV.hadTrailingDelimiter;if(u10.length===0)p10&&(c=!0);else if(u10.length===1)s+=u10[0],l=!0,c=p10;else{s+=u10[0],a.push(s),l=!0;for(m=1;m<u10.length-1;m++)a.push(u10[m]);s=u10[u10.length-1],c=p10}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,(s!==""?a.push(s):a.length===0&&l&&a.push(""),a)]}})})()}var H2t=se(function(){"use strict";lu(),oc(),AV()});function Z2t(e){switch(e.type){case"Literal":return e.value;case"SingleQuoted":return e.value;case"Escaped":return e.value;default:return null}}function K2t(e){switch(e.type){case"SingleQuoted":case"Escaped":case"DoubleQuoted":return!0;case"Literal":return e.value==="";default:return!1}}var Q2t=se(function(){"use strict"}),BW={};St(BW,{escapeGlobChars:function(){return xp},escapeRegexChars:function(){return OV},expandRedirectTarget:function(){return aP},expandWord:function(){return pr},expandWordForPattern:function(){return $ke},expandWordForRegex:function(){return Oke},expandWordWithGlob:function(){return l1},getArrayElements:function(){return zr},getVariable:function(){return Hn},hasQuotedMultiValueAt:function(){return oP},isArray:function(){return d_},isWordFullyQuoted:function(){return Mke}});function Bh(e,t,r){if(e.length>t)throw new Qt("".concat(r,": string length limit exceeded (").concat(t," bytes)"),"string_length")}function Qc(_01,_11){return _async_to_generator(function(e,t){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,_,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;n=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];i=_step.value;_=n.push;return[4,uu(e,i,r)];case 3:_.apply(n,[_state.sent()]);_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,n.join("")]}})}).apply(this,arguments)}function J2t(e){return K2t(e)}function Mke(e){if(e.parts.length===0)return!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(!J2t(t))return!1}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!0}function Y2t(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var i,o;var n=Z2t(t);if(n!==null)return n;switch(t.type){case"TildeExpansion":return r?t.user===null?"~":"~".concat(t.user):((i=e.coverage)==null||i.hit("bash:expansion:tilde"),t.user===null?(o=e.state.env.get("HOME"))!=null?o:"/home/user":t.user==="root"?"/root":"~".concat(t.user));case"Glob":return Ike(e,t.pattern);default:return null}}function pr(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,DV(e,t)]})})()}function Oke(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,i,i10,_,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,12,13,14]);_iterator=t.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,11];n=_step.value;if(!(n.type==="Escaped"))return[3,3];r.push("\\".concat(n.value));return[3,10];case 3:if(!(n.type==="SingleQuoted"))return[3,4];r.push(n.value);return[3,10];case 4:if(!(n.type==="DoubleQuoted"))return[3,6];return[4,Qc(e,n.parts)];case 5:i=_state.sent();r.push(i);return[3,10];case 6:if(!(n.type==="TildeExpansion"))return[3,8];return[4,uu(e,n)];case 7:i10=_state.sent();r.push(OV(i10));return[3,10];case 8:_=r.push;return[4,uu(e,n)];case 9:_.apply(r,[_state.sent()]);_state.label=10;case 10:_iteratorNormalCompletion=true;return[3,2];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 14:return[2,r.join("")]}})})()}function $ke(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,i,i10,_,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=t.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];n=_step.value;if(!(n.type==="Escaped"))return[3,3];i=n.value;"()|*?[]".includes(i)?r.push("\\".concat(i)):r.push(i);return[3,8];case 3:if(!(n.type==="SingleQuoted"))return[3,4];r.push(xp(n.value));return[3,8];case 4:if(!(n.type==="DoubleQuoted"))return[3,6];return[4,Qc(e,n.parts)];case 5:i10=_state.sent();r.push(xp(i10));return[3,8];case 6:_=r.push;return[4,uu(e,n)];case 7:_.apply(r,[_state.sent()]);_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2,r.join("")]}})})()}function Nke(e,t){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,i,i10,_tmp,_tmp1,_,_tmp2,_10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,17,18,19]);_iterator=t.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,16];n=_step.value;if(!(n.type==="SingleQuoted"))return[3,3];r.push(xp(n.value));return[3,15];case 3:if(!(n.type==="Escaped"))return[3,4];i=n.value;"*?[]\\()|".includes(i)?r.push("\\".concat(i)):r.push(i);return[3,15];case 4:if(!(n.type==="DoubleQuoted"))return[3,6];return[4,Qc(e,n.parts)];case 5:i10=_state.sent();r.push(xp(i10));return[3,15];case 6:if(!(n.type==="Glob"))return[3,10];if(!qyt(n.pattern))return[3,8];_=r.push;return[4,Vyt(e,n.pattern)];case 7:_tmp1=_.apply(r,[_state.sent()]);return[3,9];case 8:_tmp1=r.push(Ike(e,n.pattern));_state.label=9;case 9:_tmp=_tmp1;return[3,14];case 10:if(!(n.type==="Literal"))return[3,11];_tmp2=r.push(n.value);return[3,13];case 11:_10=r.push;return[4,uu(e,n)];case 12:_tmp2=_10.apply(r,[_state.sent()]);_state.label=13;case 13:_tmp=_tmp2;_state.label=14;case 14:_tmp;_state.label=15;case 15:_iteratorNormalCompletion=true;return[3,2];case 16:return[3,19];case 17:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,19];case 18:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 19:return[2,r.join("")]}})})()}function iP(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(t.type==="BraceExpansion"||t.type==="DoubleQuoted"&&iP(t.parts))return!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}function Dke(_01,_11){return _async_to_generator(function(e,t){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,i,o,a,s,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator1,_step1,c,d,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator2,_step2,u,d10,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator3,_step3,u10,p,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator4,_step4,m,_tmp,_,err,err,err,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator5,_step5,c10,l,_iteratorNormalCompletion7,_didIteratorError7,_iteratorError7,_iteratorNormalCompletion8,_didIteratorError8,_iteratorError8,_iterator6,_step6,c11,_iterator7,_step7,d11,_iterator8,_step8,o10,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{count:0};if(r.count>b9)return[2,[[]]];n=[[]];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,31,32,33]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step=_iterator.next()).done))return[3,30];i=_step.value;if(!(i.type==="BraceExpansion"))return[3,28];o=[],a=!1,s="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=3;case 3:_state.trys.push([3,25,26,27]);_iterator1=i.items[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion2=(_step1=_iterator1.next()).done))return[3,24];c=_step1.value;if(!(c.type==="Range"))return[3,5];d=Ske(c.start,c.end,c.step,c.startStr,c.endStr);_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(d.expanded)try{for(_iterator2=d.expanded[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){u=_step2.value;r.count++,o.push(u)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}else{a=!0,s=d.literal;return[3,24]}return[3,23];case 5:return[4,Dke(e,c.word.parts,r)];case 6:d10=_state.sent();_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;_state.label=7;case 7:_state.trys.push([7,21,22,23]);_iterator3=d10[Symbol.iterator]();_state.label=8;case 8:if(!!(_iteratorNormalCompletion4=(_step3=_iterator3.next()).done))return[3,20];u10=_step3.value;r.count++;p=[];_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;_state.label=9;case 9:_state.trys.push([9,16,17,18]);_iterator4=u10[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion5=(_step4=_iterator4.next()).done))return[3,15];m=_step4.value;if(!(typeof m=="string"))return[3,11];_tmp=p.push(m);return[3,13];case 11:_=p.push;return[4,uu(e,m)];case 12:_tmp=_.apply(p,[_state.sent()]);_state.label=13;case 13:_tmp;_state.label=14;case 14:_iteratorNormalCompletion5=true;return[3,10];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError5=true;_iteratorError5=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion5&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}return[7];case 18:o.push(p.join(""));_state.label=19;case 19:_iteratorNormalCompletion4=true;return[3,8];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError4=true;_iteratorError4=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion4&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}return[7];case 23:_iteratorNormalCompletion2=true;return[3,4];case 24:return[3,27];case 25:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,27];case 26:try{if(!_iteratorNormalCompletion2&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 27:if(a){_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(_iterator5=n[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step5=_iterator5.next()).done);_iteratorNormalCompletion6=true){c10=_step5.value;r.count++,c10.push(s)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}return[3,29]}if(n.length*o.length>e.limits.maxBraceExpansionResults||r.count>b9)return[2,n];l=[];_iteratorNormalCompletion7=true,_didIteratorError7=false,_iteratorError7=undefined,_iteratorNormalCompletion8=true,_didIteratorError8=false,_iteratorError8=undefined;try{for(_iterator6=n[Symbol.iterator]();!(_iteratorNormalCompletion8=(_step6=_iterator6.next()).done);_iteratorNormalCompletion8=true){c11=_step6.value;try{for(_iterator7=o[Symbol.iterator]();!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=true){d11=_step7.value;if(r.count++,r.count>b9)return[2,l.length>0?l:n];l.push(_to_consumable_array(c11).concat([d11]))}}catch(err){_didIteratorError7=true;_iteratorError7=err}finally{try{if(!_iteratorNormalCompletion7&&_iterator7.return!=null){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}}}}catch(err){_didIteratorError8=true;_iteratorError8=err}finally{try{if(!_iteratorNormalCompletion8&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError8){throw _iteratorError8}}}n=l;return[3,29];case 28:try{for(_iterator8=n[Symbol.iterator]();!(_iteratorNormalCompletion=(_step8=_iterator8.next()).done);_iteratorNormalCompletion=true){o10=_step8.value;r.count++,o10.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator8.return!=null){_iterator8.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=29;case 29:_iteratorNormalCompletion1=true;return[3,2];case 30:return[3,33];case 31:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,33];case 32:try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 33:return[2,n]}})}).apply(this,arguments)}function Lke(e,t){return _async_to_generator(function(){var r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,s,_tmp,_,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.parts;if(!!iP(r))return[3,2];return[4,pr(e,t)];case 1:return[2,[_state.sent()]];case 2:return[4,Dke(e,r)];case 3:n=_state.sent(),i=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,18,19,20]);_iterator=n[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,17];o=_step.value;a=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=6;case 6:_state.trys.push([6,13,14,15]);_iterator1=o[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,12];s=_step1.value;if(!(typeof s=="string"))return[3,8];_tmp=a.push(s);return[3,10];case 8:_=a.push;return[4,uu(e,s)];case 9:_tmp=_.apply(a,[_state.sent()]);_state.label=10;case 10:_tmp;_state.label=11;case 11:_iteratorNormalCompletion1=true;return[3,7];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 15:i.push(Zyt(e,a.join("")));_state.label=16;case 16:_iteratorNormalCompletion=true;return[3,5];case 17:return[3,20];case 18:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,20];case 19:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 20:return[2,i]}})})()}function X2t(){return{expandWordAsync:DV,expandWordForGlobbing:Nke,expandWordWithBracesAsync:Lke,expandWordPartsAsync:Qc,expandPart:uu,expandParameterAsync:D9,hasBraceExpansion:iP,evaluateArithmetic:Xt,buildIfsCharClassPattern:syt,smartWordSplit:V2t}}function l1(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,M2t(e,t,X2t())]})})()}function evt(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(t.type==="ParameterExpansion")return t.parameter;if(t.type==="Literal")return t.value}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return""}function oP(e,t){if(Number.parseInt(e.state.env.get("#")||"0",10)<2)return!1;function r(n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.type==="DoubleQuoted"){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=i.parts[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o=_step1.value;if(o.type==="ParameterExpansion"&&o.parameter==="@"&&!o.operation)return!0}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1}return r(t.parts)}function aP(e,t){return _async_to_generator(function(){var r,_zW,n,_tmp,i,_zW1,o,a,d,s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(oP(e,t))return[2,{error:"bash: $@: ambiguous redirect\n"}];r=t.parts,_zW=zW(r),n=_zW.hasQuoted;_tmp=iP(r);if(!_tmp)return[3,2];return[4,Lke(e,t)];case 1:_tmp=_state.sent().length>1;_state.label=2;case 2:if(_tmp)return[2,{error:"bash: ".concat(r.map(function(d){return d.type==="Literal"?d.value:d.type==="BraceExpansion"?"{".concat(d.items.map(function(u){var p,m;if(u.type==="Range"){var h=u.step?"..".concat(u.step):"";return"".concat((p=u.startStr)!=null?p:u.start,"..").concat((m=u.endStr)!=null?m:u.end).concat(h)}return u.word.parts.map(function(h){return h.type==="Literal"?h.value:""}).join("")}).join(","),"}"):""}).join(""),": ambiguous redirect\n")}];return[4,DV(e,t)];case 3:i=_state.sent(),_zW1=zW(r),o=_zW1.hasParamExpansion,a=_zW1.hasCommandSub;if((o||a)&&!n&&!bl(e.state.env)){d=us(e.state.env);if(_i(i,d).length>1)return[2,{error:"bash: $".concat(evt(r),": ambiguous redirect\n")}]}if(n||e.state.options.noglob)return[2,{target:i}];return[4,Nke(e,t)];case 4:s=_state.sent();if(!e1(s,e.state.shoptOptions.extglob))return[2,{target:i}];l=new eP(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations});return[4,l.expand(s)];case 5:c=_state.sent();return[2,c.length===0?l.hasFailglob()?{error:"bash: no match: ".concat(i,"\n")}:{target:i}:c.length===1?{target:c[0]}:{error:"bash: ".concat(i,": ambiguous redirect\n")}]}})})()}function DV(e,t){return _async_to_generator(function(){var r,n,a,i,a9,_,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.parts,n=r.length;if(!(n===1))return[3,2];return[4,uu(e,r[0])];case 1:a=_state.sent();return[2,(Bh(a,e.limits.maxStringLength,"word expansion"),a)];case 2:i=[];a9=0;_state.label=3;case 3:if(!(a9<n))return[3,6];_=i.push;return[4,uu(e,r[a9])];case 4:_.apply(i,[_state.sent()]);_state.label=5;case 5:a9++;return[3,3];case 6:o=i.join("");return[2,(Bh(o,e.limits.maxStringLength,"word expansion"),o)]}})})()}function uu(_01,_11){return _async_to_generator(function(e,t){var r,i,n,_,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,_10,err,o10,_$m,h,g,x,m,a9,s,l,c,d,u,p,_$m1,h10,g10,m10,h11,o11,a10,s10,l10,o12,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,a11,_o1,s11,_11,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;if(t.type==="ParameterExpansion")return[2,D9(e,t,r)];n=Y2t(e,t,r);if(n!==null)return[2,n];_=t.type;switch(_){case"DoubleQuoted":return[3,1];case"CommandSubstitution":return[3,10];case"ArithmeticExpansion":return[3,19];case"BraceExpansion":return[3,24]}return[3,34];case 1:o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=t.parts[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];a=_step.value;_10=o.push;return[4,uu(e,a,!0)];case 4:_10.apply(o,[_state.sent()]);_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[2,o.join("")];case 10:o10=_yt(t.body);if(!o10)return[3,15];_state.label=11;case 11:_state.trys.push([11,14,,15]);return[4,pr(e,o10.target)];case 12:_$m=_state.sent(),h=_$m.startsWith("/")?_$m:"".concat(e.state.cwd,"/").concat(_$m);return[4,e.fs.readFile(h)];case 13:g=_state.sent();e.state.lastExitCode=0,e.state.env.set("?","0");x=g.replace(/\n+$/,"");return[2,(Bh(x,e.limits.maxStringLength,"command substitution"),x)];case 14:m=_state.sent();if(_instanceof(m,Qt))throw m;return[2,(e.state.lastExitCode=1,e.state.env.set("?","1"),"")];case 15:a9=(i=e.substitutionDepth)!=null?i:0,s=e.limits.maxSubstitutionDepth;if(a9>=s)throw new Qt("Command substitution nesting limit exceeded (".concat(s,")"),"substitution_depth");l=e.substitutionDepth;e.substitutionDepth=a9+1;c=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;d=new Map(e.state.env),u=e.state.cwd,p=e.state.suppressVerbose;e.state.suppressVerbose=!0;_state.label=16;case 16:_state.trys.push([16,18,,19]);return[4,e.executeScript(t.body)];case 17:_$m1=_state.sent(),h10=_$m1.exitCode;e.state.env=d,e.state.cwd=u,e.state.suppressVerbose=p,e.state.lastExitCode=h10,e.state.env.set("?",String(h10)),_$m1.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+_$m1.stderr),e.state.bashPid=c,e.substitutionDepth=l;g10=_$m1.stdout.replace(/\n+$/,"");return[2,(Bh(g10,e.limits.maxStringLength,"command substitution"),g10)];case 18:m10=_state.sent();if(e.state.env=d,e.state.cwd=u,e.state.bashPid=c,e.substitutionDepth=l,e.state.suppressVerbose=p,_instanceof(m10,Qt))throw m10;if(_instanceof(m10,Ci)){e.state.lastExitCode=m10.exitCode,e.state.env.set("?",String(m10.exitCode)),m10.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+m10.stderr);h11=m10.stdout.replace(/\n+$/,"");return[2,(Bh(h11,e.limits.maxStringLength,"command substitution"),h11)]}throw m10;case 19:o11=t.expression.originalText;if(!(o11&&/\$[a-zA-Z_][a-zA-Z0-9_]*(?![{[(])/.test(o11)))return[3,22];return[4,hyt(e,o11)];case 20:a10=_state.sent(),s10=new Pn,l10=Ki(s10,a10);return[4,Xt(e,l10.expression,!0)];case 21:return[2,String.apply(void 0,[_state.sent()])];case 22:return[4,Xt(e,t.expression.expression,!0)];case 23:return[2,String.apply(void 0,[_state.sent()])];case 24:o12=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=25;case 25:_state.trys.push([25,31,32,33]);_iterator1=t.items[Symbol.iterator]();_state.label=26;case 26:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,30];a11=_step1.value;if(!(a11.type==="Range"))return[3,27];s11=Ske(a11.start,a11.end,a11.step,a11.startStr,a11.endStr);if(s11.expanded)(_o1=o12).push.apply(_o1,_to_consumable_array(s11.expanded));else return[2,s11.literal];return[3,29];case 27:_11=o12.push;return[4,pr(e,a11.word)];case 28:_11.apply(o12,[_state.sent()]);_state.label=29;case 29:_iteratorNormalCompletion1=true;return[3,26];case 30:return[3,33];case 31:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,33];case 32:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 33:return[2,o12.join(" ")];case 34:return[2,""];case 35:return[2]}})}).apply(this,arguments)}function D9(_01,_11){return _async_to_generator(function(e,t){var r,p,m,n,i,o,_o1,h,g,x,h10,g10,_g1,x10,v,y,a,s,l,_Uyt,c,d,u,_,h11,h12,h13;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;n=t.parameter,i=t.operation,o=n.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!o)return[3,3];_o1=_sliced_to_array(o,3),h=_o1[1],g=_o1[2];if(!((p=e.state.associativeArrays)!=null&&p.has(h)||g.includes("$(")||g.includes("`")||g.includes("${")))return[3,2];return[4,H_e(e,g)];case 1:x=_state.sent();n="".concat(h,"[").concat(x,"]");_state.label=2;case 2:return[3,5];case 3:if(!(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)&&no(e,n)))return[3,5];h10=gp(e,n);if(!(h10&&h10!==n))return[3,5];g10=h10.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!g10)return[3,5];_g1=_sliced_to_array(g10,3),x10=_g1[1],v=_g1[2];if(!((m=e.state.associativeArrays)!=null&&m.has(x10)||v.includes("$(")||v.includes("`")||v.includes("${")))return[3,5];return[4,H_e(e,v)];case 4:y=_state.sent();n="".concat(x10,"[").concat(y,"]");_state.label=5;case 5:a=i&&(i.type==="DefaultValue"||i.type==="AssignDefault"||i.type==="UseAlternative"||i.type==="ErrorIfUnset");return[4,Hn(e,n,!a)];case 6:s=_state.sent();if(!i)return[2,s];return[4,g_(e,n)];case 7:l=!_state.sent(),_Uyt=Uyt(e,n,s,r),c=_Uyt.isEmpty,d=_Uyt.effectiveValue,u={value:s,isUnset:l,isEmpty:c,effectiveValue:d,inDoubleQuotes:r};_=i.type;switch(_){case"DefaultValue":return[3,8];case"AssignDefault":return[3,9];case"ErrorIfUnset":return[3,10];case"UseAlternative":return[3,11];case"PatternRemoval":return[3,12];case"PatternReplacement":return[3,14];case"Length":return[3,16];case"LengthSliceError":return[3,17];case"BadSubstitution":return[3,18];case"Substring":return[3,19];case"CaseModification":return[3,20];case"Transform":return[3,22];case"Indirection":return[3,23];case"ArrayKeys":return[3,24];case"VarNamePrefix":return[3,25]}return[3,26];case 8:return[2,Ayt(e,i,u,Qc)];case 9:return[2,Iyt(e,n,i,u,Qc)];case 10:return[2,Pyt(e,n,i,u,Qc)];case 11:return[2,Ryt(e,i,u,Qc)];case 12:return[4,Myt(e,s,i,Qc,uu)];case 13:h11=_state.sent();return[2,(Bh(h11,e.limits.maxStringLength,"pattern removal"),h11)];case 14:return[4,Oyt(e,s,i,Qc,uu)];case 15:h12=_state.sent();return[2,(Bh(h12,e.limits.maxStringLength,"pattern replacement"),h12)];case 16:return[2,$yt(e,n,s)];case 17:throw new $f(n);case 18:throw new $f(i.text);case 19:return[2,Nyt(e,n,s,i)];case 20:return[4,Dyt(e,s,i,Qc,D9)];case 21:h13=_state.sent();return[2,(Bh(h13,e.limits.maxStringLength,"case modification"),h13)];case 22:return[2,Lyt(e,n,s,l,i)];case 23:return[2,Fyt(e,n,s,l,i,D9,r)];case 24:return[2,zyt(e,i)];case 25:return[2,jyt(e,i)];case 26:return[2,s];case 27:return[2]}})}).apply(this,arguments)}var b9,wl=se(function(){"use strict";Ns(),jo(),TV(),kl(),jr(),AV(),gyt(),vyt(),byt(),e5(),Byt(),Hyt(),Kyt(),lu(),U2t(),H2t(),oc(),_p(),Q2t(),e5(),lu(),b9=1e5});function tvt(e,t,r){switch(r){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":if(t===0)throw new Hi("division by 0");return Math.trunc(e/t);case"%":if(t===0)throw new Hi("division by 0");return e%t;case"**":if(t<0)throw new Hi("exponent less than 0");return Math.pow(e,t);case"<<":return e<<t;case">>":return e>>t;case"<":return e<t?1:0;case"<=":return e<=t?1:0;case">":return e>t?1:0;case">=":return e>=t?1:0;case"==":return e===t?1:0;case"!=":return e!==t?1:0;case"&":return e&t;case"|":return e|t;case"^":return e^t;case",":return t;default:return 0}}function Y_e(e,t,r){switch(r){case"=":return t;case"+=":return e+t;case"-=":return e-t;case"*=":return e*t;case"/=":return t!==0?Math.trunc(e/t):0;case"%=":return t!==0?e%t:0;case"<<=":return e<<t;case">>=":return e>>t;case"&=":return e&t;case"|=":return e|t;case"^=":return e^t;default:return t}}function rvt(e,t){switch(t){case"-":return-e;case"+":return+e;case"!":return e===0?1:0;case"~":return~e;default:return e}}function nvt(e,t){return _async_to_generator(function(){var r,n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=e.state.env.get(t);if(r!==void 0)return[2,r];n=e.state.env.get("".concat(t,"_0"));if(!(n!==void 0))return[3,1];_tmp=n;return[3,3];case 1:return[4,Hn(e,t)];case 2:_tmp=_state.sent();_state.label=3;case 3:return[2,_tmp]}})})()}function ivt(e){if(!e)return 0;var t=Number.parseInt(e,10);if(!Number.isNaN(t)&&/^-?\d+$/.test(e.trim()))return t;var r=e.trim();if(!r)return 0;try{var _$n=new Pn,_tc=tc(_$n,r,0),i=_tc.expr,o=_tc.pos;if(o<r.length){var a=r.slice(o).trim().split(/\s+/)[0];throw new Hi("".concat(r,': syntax error in expression (error token is "').concat(a,'")'))}return i.type==="ArithNumber"?i.value:t||0}catch(n){if(_instanceof(n,Hi))throw n;var i10=r.split(/\s+/).slice(1)[0]||r;throw new Hi("".concat(r,': syntax error in expression (error token is "').concat(i10,'")'))}}function Wq(e,t){return _async_to_generator(function(){var r,n,i,_tc,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!t)return[2,0];r=Number.parseInt(t,10);if(!Number.isNaN(r)&&/^-?\d+$/.test(t.trim()))return[2,r];n=t.trim();if(!n)return[2,0];i=new Pn,_tc=tc(i,n,0),o=_tc.expr,a=_tc.pos;if(a<n.length){s=n.slice(a).trim(),l=s.split(/\s+/)[0]||s;throw new Hi('syntax error in expression (error token is "'.concat(l,'")'),"","")}return[4,Xt(e,o)];case 1:return[2,_state.sent()]}})})()}function qW(_01,_11){return _async_to_generator(function(e,t){var r,n,i,o,a,s,_tc,l,c,d,u;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:new Set,n=_arguments.length>3&&_arguments[3]!==void 0?_arguments[3]:0;if(n>100)throw new Hi("maximum variable indirection depth exceeded");if(r.has(t))return[2,0];r.add(t);return[4,nvt(e,t)];case 1:i=_state.sent();if(!i)return[2,0];o=Number.parseInt(i,10);if(!Number.isNaN(o)&&/^-?\d+$/.test(i.trim()))return[2,o];a=i.trim();if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))return[3,3];return[4,qW(e,a,r,n+1)];case 2:return[2,_state.sent()];case 3:s=new Pn,_tc=tc(s,a,0),l=_tc.expr,c=_tc.pos;if(c<a.length){d=a.slice(c).trim(),u=d.split(/\s+/)[0]||d;throw new Hi("".concat(a,': syntax error in expression (error token is "').concat(u,'")'))}return[4,Xt(e,l)];case 4:return[2,_state.sent()]}})}).apply(this,arguments)}function w9(e,t){return _async_to_generator(function(){var u,p,h,g,m,u10,p10,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u11,p11,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.startsWith("#")){u=t.slice(1),p=u.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(p){h=p[1],g=zr(e,h);return[2,String(g.length)]}m=e.state.env.get(u)||"";return[2,String(m.length)]}if(t.startsWith("!")){u10=t.slice(1),p10=e.state.env.get(u10)||"";return[2,e.state.env.get(p10)||""]}r=[":-",":=",":?",":+","-","=","?","+"],n=-1,i="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=r[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){u11=_step.value;p11=t.indexOf(u11);p11>0&&(n===-1||p11<n)&&(n=p11,i=u11)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(!(n===-1))return[3,2];return[4,Hn(e,t)];case 1:return[2,_state.sent()];case 2:o=t.slice(0,n),a=t.slice(n+i.length),s=e.state.env.get(o),l=s===void 0,c=s==="",d=i.startsWith(":");switch(i){case":-":case"-":return[2,l||d&&c?a:s||""];case":=":case"=":return[2,l||d&&c?(e.state.env.set(o,a),a):s||""];case":+":case"+":return[2,l||d&&c?"":a];case":?":case"?":{if(l||d&&c)throw new Error(a||"".concat(o,": parameter null or not set"));return[2,s||""]}default:return[2,s||""]}return[2]}})})()}function Xt(_01,_11){return _async_to_generator(function(e,t){var r,n,i,o,a,s,l,c,_,d,u,p,_tc,m,d10,u10,d11,d12,u11,p10,d13,d14,u12,p11,p12,_Math,g,x,v,m10,h,g10,_tmp,_tmp1,d15,u13,d16,u14,p13,m11,_10,u15,p14,m12,x10,x11,h10,g11,u16,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p15,err,p16,m13,u17,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,p17,err,_tmp2,_tmp3,p18,m14,h11,g12,_tmp4,d17,u18,g13,x12,x13,x14,_Math1,v10,p19,m15,h12,d18,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,u19,err,_tmp5,d19,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,g14,err,_tmp6,_tmp7,u20,g15,p20,m16,h13,d20,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,h14,err,_tmp8,_tmp9,u21,p21,m17;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;_=t.type;switch(_){case"ArithNumber":return[3,1];case"ArithVariable":return[3,2];case"ArithSpecialVar":return[3,4];case"ArithNested":return[3,7];case"ArithCommandSubst":return[3,9];case"ArithBracedExpansion":return[3,12];case"ArithDynamicBase":return[3,14];case"ArithDynamicNumber":return[3,16];case"ArithArrayElement":return[3,18];case"ArithDoubleSubscript":return[3,28];case"ArithNumberSubscript":return[3,29];case"ArithSyntaxError":return[3,30];case"ArithSingleQuote":return[3,31];case"ArithBinary":return[3,32];case"ArithUnary":return[3,43];case"ArithTernary":return[3,81];case"ArithAssignment":return[3,87];case"ArithGroup":return[3,97];case"ArithConcat":return[3,99];case"ArithDynamicAssignment":return[3,111];case"ArithDynamicElement":return[3,129]}return[3,145];case 1:if(Number.isNaN(t.value))throw new Hi("value too great for base");return[2,t.value];case 2:return[4,qW(e,t.name)];case 3:return[2,_state.sent()];case 4:return[4,Hn(e,t.name)];case 5:d=_state.sent().trim();if(!d)return[2,0];u=Number.parseInt(d,10);if(!Number.isNaN(u)&&/^-?\d+$/.test(d))return[2,u];p=new Pn,_tc=tc(p,d,0),m=_tc.expr;return[4,Xt(e,m)];case 6:return[2,_state.sent()];case 7:return[4,Xt(e,t.expression)];case 8:return[2,_state.sent()];case 9:if(!e.execFn)return[3,11];return[4,e.execFn(t.command,{signal:e.state.signal})];case 10:d10=_state.sent();d10.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+d10.stderr);u10=d10.stdout.trim();return[2,Number.parseInt(u10,10)||0];case 11:return[2,0];case 12:return[4,w9(e,t.content)];case 13:d11=_state.sent();return[2,Number.parseInt(d11,10)||0];case 14:return[4,w9(e,t.baseExpr)];case 15:d12=_state.sent(),u11=Number.parseInt(d12,10);if(u11<2||u11>64)return[2,0];p10="".concat(u11,"#").concat(t.value);return[2,MW(p10)];case 16:return[4,w9(e,t.prefix)];case 17:d13=_state.sent()+t.suffix;return[2,MW(d13)];case 18:d14=(n=e.state.associativeArrays)==null?void 0:n.has(t.array),u12=function(p){return _async_to_generator(function(){var m,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=e.state.env.get(p);if(!(m!==void 0))return[3,2];return[4,Wq(e,m)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=0;_state.label=3;case 3:return[2,_tmp]}})})()};if(!(t.stringKey!==void 0))return[3,20];return[4,u12("".concat(t.array,"_").concat(t.stringKey))];case 19:return[2,_state.sent()];case 20:if(!(d14&&((i=t.index)==null?void 0:i.type)==="ArithVariable"&&!t.index.hasDollarPrefix))return[3,22];return[4,u12("".concat(t.array,"_").concat(t.index.name))];case 21:return[2,_state.sent()];case 22:if(!(d14&&((o=t.index)==null?void 0:o.type)==="ArithVariable"&&t.index.hasDollarPrefix))return[3,25];return[4,Hn(e,t.index.name)];case 23:p11=_state.sent();return[4,u12("".concat(t.array,"_").concat(p11))];case 24:return[2,_state.sent()];case 25:if(!t.index)return[3,27];return[4,Xt(e,t.index,r)];case 26:p12=_state.sent();if(p12<0){;g=zr(e,t.array),x=e.state.currentLine;if(g.length===0)return[2,(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(x,": ").concat(t.array,": bad array subscript\n"),0)];v=(_Math=Math).max.apply(_Math,_to_consumable_array(g.map(function(param){var _param=_sliced_to_array(param,1),y=_param[0];return typeof y=="number"?y:0})))+1+p12;if(v<0)return[2,(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(x,": ").concat(t.array,": bad array subscript\n"),0)];p12=v}m10="".concat(t.array,"_").concat(p12),h=e.state.env.get(m10);if(h!==void 0)return[2,Wq(e,h)];if(p12===0){g10=e.state.env.get(t.array);if(g10!==void 0)return[2,Wq(e,g10)]}if(e.state.options.nounset&&!Array.from(e.state.env.keys()).some(function(g){return g===t.array||g.startsWith("".concat(t.array,"_"))}))throw new Kc("".concat(t.array,"[").concat(p12,"]"));return[2,0];case 27:return[2,0];case 28:throw new Hi("double subscript","","");case 29:throw new Hi("".concat(t.number).concat(t.errorToken,': syntax error: invalid arithmetic operator (error token is "').concat(t.errorToken,'")'));case 30:throw new Hi(t.message,"","",!0);case 31:{if(r)throw new Hi("syntax error: operand expected (error token is \"'".concat(t.content,"'\")"));return[2,t.value]}_state.label=32;case 32:if(!(t.operator==="||"))return[3,36];return[4,Xt(e,t.left,r)];case 33:_tmp=_state.sent();if(_tmp)return[3,35];return[4,Xt(e,t.right,r)];case 34:_tmp=_state.sent();_state.label=35;case 35:return[2,_tmp?1:0];case 36:if(!(t.operator==="&&"))return[3,40];return[4,Xt(e,t.left,r)];case 37:_tmp1=_state.sent();if(!_tmp1)return[3,39];return[4,Xt(e,t.right,r)];case 38:_tmp1=_state.sent();_state.label=39;case 39:return[2,_tmp1?1:0];case 40:return[4,Xt(e,t.left,r)];case 41:d15=_state.sent();return[4,Xt(e,t.right,r)];case 42:u13=_state.sent();return[2,tvt(d15,u13,t.operator)];case 43:return[4,Xt(e,t.operand,r)];case 44:d16=_state.sent();if(!(t.operator==="++"||t.operator==="--"))return[3,80];if(!(t.operand.type==="ArithVariable"))return[3,46];u14=t.operand.name;_10=Number.parseInt;return[4,Hn(e,u14)];case 45:p13=_10.apply(Number,[_state.sent(),10])||0,m11=t.operator==="++"?p13+1:p13-1;return[2,(e.state.env.set(u14,String(m11)),t.prefix?m11:p13)];case 46:if(!(t.operand.type==="ArithArrayElement"))return[3,54];u15=t.operand.array,p14=(a=e.state.associativeArrays)==null?void 0:a.has(u15);if(!(t.operand.stringKey!==void 0))return[3,47];m12="".concat(u15,"_").concat(t.operand.stringKey);return[3,53];case 47:if(!(p14&&((s=t.operand.index)==null?void 0:s.type)==="ArithVariable"&&!t.operand.index.hasDollarPrefix))return[3,48];m12="".concat(u15,"_").concat(t.operand.index.name);return[3,53];case 48:if(!(p14&&((l=t.operand.index)==null?void 0:l.type)==="ArithVariable"&&t.operand.index.hasDollarPrefix))return[3,50];return[4,Hn(e,t.operand.index.name)];case 49:x10=_state.sent();m12="".concat(u15,"_").concat(x10);return[3,53];case 50:if(!t.operand.index)return[3,52];return[4,Xt(e,t.operand.index,r)];case 51:x11=_state.sent();m12="".concat(u15,"_").concat(x11);return[3,53];case 52:return[2,d16];case 53:h10=Number.parseInt(e.state.env.get(m12)||"0",10)||0,g11=t.operator==="++"?h10+1:h10-1;return[2,(e.state.env.set(m12,String(g11)),t.prefix?g11:h10)];case 54:if(!(t.operand.type==="ArithConcat"))return[3,63];u16="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=55;case 55:_state.trys.push([55,60,61,62]);_iterator=t.operand.parts[Symbol.iterator]();_state.label=56;case 56:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,59];p15=_step.value;return[4,t_(e,p15,r)];case 57:u16=u16+_state.sent();_state.label=58;case 58:_iteratorNormalCompletion=true;return[3,56];case 59:return[3,62];case 60:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,62];case 61:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 62:if(u16&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u16)){p16=Number.parseInt(e.state.env.get(u16)||"0",10)||0,m13=t.operator==="++"?p16+1:p16-1;return[2,(e.state.env.set(u16,String(m13)),t.prefix?m13:p16)]}_state.label=63;case 63:if(!(t.operand.type==="ArithDynamicElement"))return[3,79];u17="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(!(t.operand.nameExpr.type==="ArithConcat"))return[3,72];_state.label=64;case 64:_state.trys.push([64,69,70,71]);_iterator1=t.operand.nameExpr.parts[Symbol.iterator]();_state.label=65;case 65:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,68];p17=_step1.value;return[4,t_(e,p17,r)];case 66:u17=u17+_state.sent();_state.label=67;case 67:_iteratorNormalCompletion1=true;return[3,65];case 68:return[3,71];case 69:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,71];case 70:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 71:return[3,77];case 72:_tmp2=t.operand.nameExpr.type==="ArithVariable";if(!_tmp2)return[3,76];if(!t.operand.nameExpr.hasDollarPrefix)return[3,74];return[4,Hn(e,t.operand.nameExpr.name)];case 73:_tmp3=_state.sent();return[3,75];case 74:_tmp3=t.operand.nameExpr.name;_state.label=75;case 75:_tmp2=u17=_tmp3;_state.label=76;case 76:_tmp2;_state.label=77;case 77:if(!(u17&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(u17)))return[3,79];return[4,Xt(e,t.operand.subscript,r)];case 78:p18=_state.sent(),m14="".concat(u17,"_").concat(p18),h11=Number.parseInt(e.state.env.get(m14)||"0",10)||0,g12=t.operator==="++"?h11+1:h11-1;return[2,(e.state.env.set(m14,String(g12)),t.prefix?g12:h11)];case 79:return[2,d16];case 80:return[2,rvt(d16,t.operator)];case 81:return[4,Xt(e,t.condition,r)];case 82:if(!_state.sent())return[3,84];return[4,Xt(e,t.consequent,r)];case 83:_tmp4=_state.sent();return[3,86];case 84:return[4,Xt(e,t.alternate,r)];case 85:_tmp4=_state.sent();_state.label=86;case 86:return[2,_tmp4];case 87:d17=t.variable,u18=d17;if(!(t.stringKey!==void 0))return[3,88];u18="".concat(d17,"_").concat(t.stringKey);return[3,95];case 88:if(!t.subscript)return[3,95];g13=(c=e.state.associativeArrays)==null?void 0:c.has(d17);if(!(g13&&t.subscript.type==="ArithVariable"&&!t.subscript.hasDollarPrefix))return[3,89];u18="".concat(d17,"_").concat(t.subscript.name);return[3,95];case 89:if(!(g13&&t.subscript.type==="ArithVariable"&&t.subscript.hasDollarPrefix))return[3,91];return[4,Hn(e,t.subscript.name)];case 90:x12=_state.sent();u18="".concat(d17,"_").concat(x12||"\\");return[3,95];case 91:if(!g13)return[3,93];return[4,Xt(e,t.subscript,r)];case 92:x13=_state.sent();u18="".concat(d17,"_").concat(x13);return[3,95];case 93:return[4,Xt(e,t.subscript,r)];case 94:x14=_state.sent();if(x14<0){;v10=zr(e,d17);v10.length>0&&(x14=(_Math1=Math).max.apply(_Math1,_to_consumable_array(v10.map(function(param){var _param=_sliced_to_array(param,1),y=_param[0];return typeof y=="number"?y:0})))+1+x14)}u18="".concat(d17,"_").concat(x14);_state.label=95;case 95:p19=Number.parseInt(e.state.env.get(u18)||"0",10)||0;return[4,Xt(e,t.value,r)];case 96:m15=_state.sent(),h12=Y_e(p19,m15,t.operator);return[2,(e.state.env.set(u18,String(h12)),h12)];case 97:return[4,Xt(e,t.expression,r)];case 98:return[2,_state.sent()];case 99:d18="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=100;case 100:_state.trys.push([100,105,106,107]);_iterator2=t.parts[Symbol.iterator]();_state.label=101;case 101:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,104];u19=_step2.value;return[4,t_(e,u19,r)];case 102:d18=d18+_state.sent();_state.label=103;case 103:_iteratorNormalCompletion2=true;return[3,101];case 104:return[3,107];case 105:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,107];case 106:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 107:if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(d18))return[3,109];return[4,qW(e,d18)];case 108:_tmp5=_state.sent();return[3,110];case 109:_tmp5=Number.parseInt(d18,10)||0;_state.label=110;case 110:return[2,_tmp5];case 111:d19="";_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(!(t.target.type==="ArithConcat"))return[3,120];_state.label=112;case 112:_state.trys.push([112,117,118,119]);_iterator3=t.target.parts[Symbol.iterator]();_state.label=113;case 113:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,116];g14=_step3.value;return[4,t_(e,g14,r)];case 114:d19=d19+_state.sent();_state.label=115;case 115:_iteratorNormalCompletion3=true;return[3,113];case 116:return[3,119];case 117:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,119];case 118:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 119:return[3,125];case 120:_tmp6=t.target.type==="ArithVariable";if(!_tmp6)return[3,124];if(!t.target.hasDollarPrefix)return[3,122];return[4,Hn(e,t.target.name)];case 121:_tmp7=_state.sent();return[3,123];case 122:_tmp7=t.target.name;_state.label=123;case 123:_tmp6=d19=_tmp7;_state.label=124;case 124:_tmp6;_state.label=125;case 125:if(!d19||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(d19))return[2,0];u20=d19;if(!t.subscript)return[3,127];return[4,Xt(e,t.subscript,r)];case 126:g15=_state.sent();u20="".concat(d19,"_").concat(g15);_state.label=127;case 127:p20=Number.parseInt(e.state.env.get(u20)||"0",10)||0;return[4,Xt(e,t.value,r)];case 128:m16=_state.sent(),h13=Y_e(p20,m16,t.operator);return[2,(e.state.env.set(u20,String(h13)),h13)];case 129:d20="";_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;if(!(t.nameExpr.type==="ArithConcat"))return[3,138];_state.label=130;case 130:_state.trys.push([130,135,136,137]);_iterator4=t.nameExpr.parts[Symbol.iterator]();_state.label=131;case 131:if(!!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done))return[3,134];h14=_step4.value;return[4,t_(e,h14,r)];case 132:d20=d20+_state.sent();_state.label=133;case 133:_iteratorNormalCompletion4=true;return[3,131];case 134:return[3,137];case 135:err=_state.sent();_didIteratorError4=true;_iteratorError4=err;return[3,137];case 136:try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}return[7];case 137:return[3,143];case 138:_tmp8=t.nameExpr.type==="ArithVariable";if(!_tmp8)return[3,142];if(!t.nameExpr.hasDollarPrefix)return[3,140];return[4,Hn(e,t.nameExpr.name)];case 139:_tmp9=_state.sent();return[3,141];case 140:_tmp9=t.nameExpr.name;_state.label=141;case 141:_tmp8=d20=_tmp9;_state.label=142;case 142:_tmp8;_state.label=143;case 143:if(!d20||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(d20))return[2,0];return[4,Xt(e,t.subscript,r)];case 144:u21=_state.sent(),p21="".concat(d20,"_").concat(u21),m17=e.state.env.get(p21);return[2,m17!==void 0?ivt(m17):0];case 145:return[2,0];case 146:return[2]}})}).apply(this,arguments)}function t_(_01,_11){return _async_to_generator(function(e,t){var r,_,_tmp,_tmp1,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:!1;_=t.type;switch(_){case"ArithNumber":return[3,1];case"ArithSingleQuote":return[3,2];case"ArithVariable":return[3,4];case"ArithSpecialVar":return[3,8];case"ArithBracedExpansion":return[3,10];case"ArithCommandSubst":return[3,12];case"ArithConcat":return[3,16]}return[3,25];case 1:return[2,String(t.value)];case 2:return[4,Xt(e,t,r)];case 3:return[2,String.apply(void 0,[_state.sent()])];case 4:if(!t.hasDollarPrefix)return[3,6];return[4,Hn(e,t.name)];case 5:_tmp=_state.sent();return[3,7];case 6:_tmp=t.name;_state.label=7;case 7:return[2,_tmp];case 8:return[4,Hn(e,t.name)];case 9:return[2,_state.sent()];case 10:return[4,w9(e,t.content)];case 11:return[2,_state.sent()];case 12:if(!e.execFn)return[3,14];return[4,e.execFn(t.command,{signal:e.state.signal})];case 13:_tmp1=_state.sent().stdout.trim();return[3,15];case 14:_tmp1="0";_state.label=15;case 15:return[2,_tmp1];case 16:n="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=17;case 17:_state.trys.push([17,22,23,24]);_iterator=t.parts[Symbol.iterator]();_state.label=18;case 18:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,21];i=_step.value;return[4,t_(e,i,r)];case 19:n=n+_state.sent();_state.label=20;case 20:_iteratorNormalCompletion=true;return[3,18];case 21:return[3,24];case 22:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,24];case 23:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 24:return[2,n];case 25:return[4,Xt(e,t,r)];case 26:return[2,String.apply(void 0,[_state.sent()])];case 27:return[2]}})}).apply(this,arguments)}var kl=se(function(){"use strict";Ns(),jo(),jr(),wl()});function ovt(){throw new Error("node:dns is not available in browser environments")}var avt=se(function(){"use strict"});q9();td();var X_e=[{name:"echo",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Qdt(),Rbe})];case 1:return[2,_state.sent().echoCommand]}})})()}},{name:"cat",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Xdt(),Fbe})];case 1:return[2,_state.sent().catCommand]}})})()}},{name:"printf",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return gpt(),Hbe})];case 1:return[2,_state.sent().printfCommand]}})})()}},{name:"ls",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return ypt(),Qbe})];case 1:return[2,_state.sent().lsCommand]}})})()}},{name:"mkdir",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return _pt(),ewe})];case 1:return[2,_state.sent().mkdirCommand]}})})()}},{name:"rmdir",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return wpt(),nwe})];case 1:return[2,_state.sent().rmdirCommand]}})})()}},{name:"touch",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return kpt(),awe})];case 1:return[2,_state.sent().touchCommand]}})})()}},{name:"rm",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Cpt(),uwe})];case 1:return[2,_state.sent().rmCommand]}})})()}},{name:"cp",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Ept(),pwe})];case 1:return[2,_state.sent().cpCommand]}})})()}},{name:"mv",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Tpt(),hwe})];case 1:return[2,_state.sent().mvCommand]}})})()}},{name:"ln",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Apt(),ywe})];case 1:return[2,_state.sent().lnCommand]}})})()}},{name:"chmod",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Ipt(),bwe})];case 1:return[2,_state.sent().chmodCommand]}})})()}},{name:"pwd",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Ppt(),Cwe})];case 1:return[2,_state.sent().pwdCommand]}})})()}},{name:"readlink",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Rpt(),Awe})];case 1:return[2,_state.sent().readlinkCommand]}})})()}},{name:"head",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return $pt(),$we})];case 1:return[2,_state.sent().headCommand]}})})()}},{name:"tail",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Npt(),Lwe})];case 1:return[2,_state.sent().tailCommand]}})})()}},{name:"wc",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Dpt(),jwe})];case 1:return[2,_state.sent().wcCommand]}})})()}},{name:"stat",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Lpt(),Wwe})];case 1:return[2,_state.sent().statCommand]}})})()}},{name:"grep",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return fq(),s9})];case 1:return[2,_state.sent().grepCommand]}})})()}},{name:"fgrep",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return fq(),s9})];case 1:return[2,_state.sent().fgrepCommand]}})})()}},{name:"egrep",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return fq(),s9})];case 1:return[2,_state.sent().egrepCommand]}})})()}},{name:"rg",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return $ft(),h4e})];case 1:return[2,_state.sent().rgCommand]}})})()}},{name:"sed",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Kft(),E4e})];case 1:return[2,_state.sent().sedCommand]}})})()}},{name:"awk",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return fht(),H4e})];case 1:return[2,_state.sent().awkCommand2]}})})()}},{name:"sort",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return vht(),Y4e})];case 1:return[2,_state.sent().sortCommand]}})})()}},{name:"uniq",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return _ht(),t3e})];case 1:return[2,_state.sent().uniqCommand]}})})()}},{name:"comm",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return bht(),i3e})];case 1:return[2,_state.sent().commCommand]}})})()}},{name:"cut",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return kht(),s3e})];case 1:return[2,_state.sent().cutCommand]}})})()}},{name:"paste",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Cht(),c3e})];case 1:return[2,_state.sent().pasteCommand]}})})()}},{name:"tr",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Eht(),f3e})];case 1:return[2,_state.sent().trCommand]}})})()}},{name:"rev",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Aht(),x3e})];case 1:return[2,_state.sent().rev]}})})()}},{name:"nl",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Rht(),_3e})];case 1:return[2,_state.sent().nl]}})})()}},{name:"fold",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return $ht(),S3e})];case 1:return[2,_state.sent().fold]}})})()}},{name:"expand",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Lht(),E3e})];case 1:return[2,_state.sent().expand]}})})()}},{name:"unexpand",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return zht(),I3e})];case 1:return[2,_state.sent().unexpand]}})})()}},{name:"strings",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Uht(),M3e})];case 1:return[2,_state.sent().strings]}})})()}},{name:"split",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Ght(),N3e})];case 1:return[2,_state.sent().split]}})})()}},{name:"column",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Qht(),F3e})];case 1:return[2,_state.sent().column]}})})()}},{name:"join",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return egt(),U3e})];case 1:return[2,_state.sent().join]}})})()}},{name:"tee",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return tgt(),W3e})];case 1:return[2,_state.sent().teeCommand]}})})()}},{name:"find",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return ggt(),H3e})];case 1:return[2,_state.sent().findCommand]}})})()}},{name:"basename",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return xgt(),Q3e})];case 1:return[2,_state.sent().basenameCommand]}})})()}},{name:"dirname",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return ygt(),X3e})];case 1:return[2,_state.sent().dirnameCommand]}})})()}},{name:"tree",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return _gt(),r6e})];case 1:return[2,_state.sent().treeCommand]}})})()}},{name:"du",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return bgt(),a6e})];case 1:return[2,_state.sent().duCommand]}})})()}},{name:"env",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return vve(),pW})];case 1:return[2,_state.sent().envCommand]}})})()}},{name:"printenv",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return vve(),pW})];case 1:return[2,_state.sent().printenvCommand]}})})()}},{name:"alias",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return bve(),fW})];case 1:return[2,_state.sent().aliasCommand]}})})()}},{name:"unalias",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return bve(),fW})];case 1:return[2,_state.sent().unaliasCommand]}})})()}},{name:"history",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return wgt(),v6e})];case 1:return[2,_state.sent().historyCommand]}})})()}},{name:"xargs",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Sgt(),w6e})];case 1:return[2,_state.sent().xargsCommand]}})})()}},{name:"true",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return kve(),mW})];case 1:return[2,_state.sent().trueCommand]}})})()}},{name:"false",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return kve(),mW})];case 1:return[2,_state.sent().falseCommand]}})})()}},{name:"clear",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return kgt(),I6e})];case 1:return[2,_state.sent().clearCommand]}})})()}},{name:"bash",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Eve(),hW})];case 1:return[2,_state.sent().bashCommand]}})})()}},{name:"sh",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Eve(),hW})];case 1:return[2,_state.sent().shCommand]}})})()}},{name:"jq",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return l0t(),G6e})];case 1:return[2,_state.sent().jqCommand]}})})()}},{name:"base64",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return u0t(),K6e})];case 1:return[2,_state.sent().base64Command]}})})()}},{name:"diff",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return c0t(),Y6e})];case 1:return[2,_state.sent().diffCommand]}})})()}},{name:"date",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return h0t(),tSe})];case 1:return[2,_state.sent().dateCommand]}})})()}},{name:"sleep",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return g0t(),aSe})];case 1:return[2,_state.sent().sleepCommand]}})})()}},{name:"timeout",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return x0t(),uSe})];case 1:return[2,_state.sent().timeoutCommand]}})})()}},{name:"time",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return b0t(),pSe})];case 1:return[2,_state.sent().timeCommand]}})})()}},{name:"seq",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return w0t(),hSe})];case 1:return[2,_state.sent().seqCommand]}})})()}},{name:"expr",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return k0t(),ySe})];case 1:return[2,_state.sent().exprCommand]}})})()}},{name:"md5sum",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return E0t(),wSe})];case 1:return[2,_state.sent().md5sumCommand]}})})()}},{name:"sha1sum",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return T0t(),CSe})];case 1:return[2,_state.sent().sha1sumCommand]}})})()}},{name:"sha256sum",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return A0t(),ASe})];case 1:return[2,_state.sent().sha256sumCommand]}})})()}},{name:"file",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return U1t(),i5e})];case 1:return[2,_state.sent().fileCommand]}})})()}},{name:"html-to-markdown",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return B1t(),u5e})];case 1:return[2,_state.sent().htmlToMarkdownCommand]}})})()}},{name:"help",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return W1t(),p5e})];case 1:return[2,_state.sent().helpCommand]}})})()}},{name:"which",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return V1t(),g5e})];case 1:return[2,_state.sent().whichCommand]}})})()}},{name:"tac",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return H1t(),v5e})];case 1:return[2,_state.sent().tac]}})})()}},{name:"hostname",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return K1t(),w5e})];case 1:return[2,_state.sent().hostname]}})})()}},{name:"whoami",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return J1t(),C5e})];case 1:return[2,_state.sent().whoami]}})})()}},{name:"od",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return X1t(),A5e})];case 1:return[2,_state.sent().od]}})})()}},{name:"gzip",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Fq(),v9})];case 1:return[2,_state.sent().gzipCommand]}})})()}},{name:"gunzip",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Fq(),v9})];case 1:return[2,_state.sent().gunzipCommand]}})})()}},{name:"zcat",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return Fq(),v9})];case 1:return[2,_state.sent().zcatCommand]}})})()}}],svt=[],lvt=[],uvt=[{name:"curl",load:function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve().then(function(){return gxt(),Y5e})];case 1:return[2,_state.sent().curlCommand]}})})()}}],ebe=new Map;function sP(e){return{name:e.name,execute:function execute(t,r){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=ebe.get(e.name);_tmp=n;if(_tmp)return[3,2];return[4,hp.runTrustedAsync(function(){return e.load()})];case 1:_tmp=(n=_state.sent(),ebe.set(e.name,n));_state.label=2;case 2:return[2,(_tmp,r.coverage,n.execute(t,r))]}})})()}}}function cvt(e){return(e?X_e.filter(function(t){return e.includes(t.name)}):X_e).map(sP)}function dvt(){return uvt.map(sP)}function pvt(){return svt.map(sP)}function fvt(){return lvt.map(sP)}function mvt(e){return"load"in e&&typeof e.load=="function"}function LV(e,t){return{name:e,trusted:!0,execute:t}}function hvt(e){var t=null;return{name:e.name,trusted:!0,execute:function execute(r,n){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=t;if(_tmp)return[3,2];return[4,e.load()];case 1:_tmp=t=_state.sent();_state.label=2;case 2:return[2,(_tmp,t.execute(r,n))]}})})()}}}kr();kr();Z5e();function mn(e){if(!e||e==="/")return"/";var t=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;t.startsWith("/")||(t="/".concat(t));var r=t.split("/").filter(function(i){return i&&i!=="."}),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i===".."?n.pop():n.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"/".concat(n.join("/"))||"/"}function aa(e,t){if(e.includes("\0"))throw new Error("ENOENT: path contains null byte, ".concat(t," '").concat(e,"'"))}function WW(e){var t=mn(e);if(t==="/")return"/";var r=t.lastIndexOf("/");return r===0?"/":t.slice(0,r)}function Fke(e,t){if(t.startsWith("/"))return mn(t);var r=e==="/"?"/".concat(t):"".concat(e,"/").concat(t);return mn(r)}function a_(e,t){return e==="/"?"/".concat(t):"".concat(e,"/").concat(t)}function Vq(e,t){if(t.startsWith("/"))return mn(t);var r=WW(e);return mn(a_(r,t))}var Hv=new TextEncoder;function gvt(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&!_instanceof(e,Uint8Array)&&"content"in e}var t5=/*#__PURE__*/function(){"use strict";function t51(e){_class_call_check(this,t51);A(this,"data",new Map);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),t=_step_value[0],r=_step_value[1];typeof r=="function"?this.writeFileLazy(t,r):gvt(r)?this.writeFileSync(t,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(t,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}_create_class(t51,[{key:"ensureParentDirs",value:function ensureParentDirs(e){var t=WW(e);t!=="/"&&(this.data.has(t)||(this.ensureParentDirs(t),this.data.set(t,{type:"directory",mode:493,mtime:new Date})))}},{key:"writeFileSync",value:function writeFileSync(e,t,r,n){var s,l;aa(e,"write");var i=mn(e);this.ensureParentDirs(i);var o=zq(r),a=u_e(t,o);this.data.set(i,{type:"file",content:a,mode:(s=n==null?void 0:n.mode)!=null?s:420,mtime:(l=n==null?void 0:n.mtime)!=null?l:new Date})}},{key:"writeFileLazy",value:function writeFileLazy(e,t,r){var i,o;aa(e,"write");var n=mn(e);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:t,mode:(i=r==null?void 0:r.mode)!=null?i:420,mtime:(o=r==null?void 0:r.mtime)!=null?o:new Date})}},{key:"materializeLazy",value:function materializeLazy(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,t.lazy()];case 1:r=_state.sent(),n={type:"file",content:typeof r=="string"?Hv.encode(r):r,mode:t.mode,mtime:t.mtime};return[2,(this.data.set(e,n),n)]}})}).call(this)}},{key:"readFile",value:function readFile(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readFileBuffer(e)];case 1:r=_state.sent(),n=zq(t);return[2,AW(r,n)]}})}).call(this)}},{key:"readFileBytes",value:function readFileBytes(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readFileBuffer(e)];case 1:t=_state.sent();return[2,AW(t,"binary")]}})}).call(this)}},{key:"readFileBuffer",value:function readFileBuffer(e){return _async_to_generator(function(){var t,r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"open");t=this.resolvePathWithSymlinks(e),r=this.data.get(t);if(!r)throw new Error("ENOENT: no such file or directory, open '".concat(e,"'"));if(r.type!=="file")throw new Error("EISDIR: illegal operation on a directory, read '".concat(e,"'"));if(!("lazy"in r))return[3,2];return[4,this.materializeLazy(t,r)];case 1:n=_state.sent();return[2,_instanceof(n.content,Uint8Array)?n.content:Hv.encode(n.content)];case 2:return[2,_instanceof(r.content,Uint8Array)?r.content:Hv.encode(r.content)]}})}).call(this)}},{key:"writeFile",value:function writeFile(e,t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.writeFileSync(e,t,r);return[2]})}).call(this)}},{key:"appendFile",value:function appendFile(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,_tmp,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"append");n=mn(e),i=this.data.get(n);if(i&&i.type==="directory")throw new Error("EISDIR: illegal operation on a directory, write '".concat(e,"'"));o=zq(r),a=u_e(t,o);if(!((i==null?void 0:i.type)==="file"))return[3,3];s=i;_tmp="lazy"in s;if(!_tmp)return[3,2];return[4,this.materializeLazy(n,s)];case 1:_tmp=s=_state.sent();_state.label=2;case 2:_tmp;l="content"in s&&_instanceof(s.content,Uint8Array)?s.content:Hv.encode("content"in s?s.content:""),c=new Uint8Array(l.length+a.length);c.set(l),c.set(a,l.length),this.data.set(n,{type:"file",content:c,mode:s.mode,mtime:new Date});return[3,4];case 3:this.writeFileSync(e,t,r);_state.label=4;case 4:return[2]}})}).call(this)}},{key:"exists",value:function exists(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){if(e.includes("\0"))return[2,!1];try{t=this.resolvePathWithSymlinks(e);return[2,this.data.has(t)]}catch(t){return[2,!1]}return[2]})}).call(this)}},{key:"stat",value:function stat(e){return _async_to_generator(function(){var t,r,_tmp,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"stat");t=this.resolvePathWithSymlinks(e),r=this.data.get(t);if(!r)throw new Error("ENOENT: no such file or directory, stat '".concat(e,"'"));_tmp=r.type==="file"&&"lazy"in r;if(!_tmp)return[3,2];return[4,this.materializeLazy(t,r)];case 1:_tmp=r=_state.sent();_state.label=2;case 2:_tmp;n=0;return[2,(r.type==="file"&&"content"in r&&r.content&&(_instanceof(r.content,Uint8Array)?n=r.content.length:n=Hv.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date})]}})}).call(this)}},{key:"lstat",value:function lstat(e){return _async_to_generator(function(){var t,r,_tmp,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"lstat");t=this.resolveIntermediateSymlinks(e),r=this.data.get(t);if(!r)throw new Error("ENOENT: no such file or directory, lstat '".concat(e,"'"));if(r.type==="symlink")return[2,{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date}];_tmp=r.type==="file"&&"lazy"in r;if(!_tmp)return[3,2];return[4,this.materializeLazy(t,r)];case 1:_tmp=r=_state.sent();_state.label=2;case 2:_tmp;n=0;return[2,(r.type==="file"&&"content"in r&&r.content&&(_instanceof(r.content,Uint8Array)?n=r.content.length:n=Hv.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date})]}})}).call(this)}},{key:"resolveIntermediateSymlinks",value:function resolveIntermediateSymlinks(e){var t=mn(e);if(t==="/")return"/";var r=t.slice(1).split("/");if(r.length<=1)return t;var n="",i=new Set;for(var o=0;o<r.length-1;o++){var a=r[o];n="".concat(n,"/").concat(a);var s=this.data.get(n),l=0,c=40;for(;s&&s.type==="symlink"&&l<c;){if(i.has(n))throw new Error("ELOOP: too many levels of symbolic links, lstat '".concat(e,"'"));i.add(n),n=Vq(n,s.target),s=this.data.get(n),l++}if(l>=c)throw new Error("ELOOP: too many levels of symbolic links, lstat '".concat(e,"'"))}return"".concat(n,"/").concat(r[r.length-1])}},{key:"resolvePathWithSymlinks",value:function resolvePathWithSymlinks(e){var t=mn(e);if(t==="/")return"/";var r=t.slice(1).split("/"),n="",i=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;n="".concat(n,"/").concat(o);var a=this.data.get(n),s=0,l=40;for(;a&&a.type==="symlink"&&s<l;){if(i.has(n))throw new Error("ELOOP: too many levels of symbolic links, open '".concat(e,"'"));i.add(n),n=Vq(n,a.target),a=this.data.get(n),s++}if(s>=l)throw new Error("ELOOP: too many levels of symbolic links, open '".concat(e,"'"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}},{key:"mkdir",value:function mkdir(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.mkdirSync(e,t);return[2]})}).call(this)}},{key:"mkdirSync",value:function mkdirSync(e,t){var i;aa(e,"mkdir");var r=mn(e);if(this.data.has(r)){if(((i=this.data.get(r))==null?void 0:i.type)==="file")throw new Error("EEXIST: file already exists, mkdir '".concat(e,"'"));if(!(t!=null&&t.recursive))throw new Error("EEXIST: directory already exists, mkdir '".concat(e,"'"));return}var n=WW(r);if(n!=="/"&&!this.data.has(n))if(t!=null&&t.recursive)this.mkdirSync(n,{recursive:!0});else throw new Error("ENOENT: no such file or directory, mkdir '".concat(e,"'"));this.data.set(r,{type:"directory",mode:493,mtime:new Date})}},{key:"readdir",value:function readdir(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readdirWithFileTypes(e)];case 1:return[2,_state.sent().map(function(t){return t.name})]}})}).call(this)}},{key:"readdirWithFileTypes",value:function readdirWithFileTypes(e){return _async_to_generator(function(){var t,r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,a,s,l,c;return _ts_generator(this,function(_state){aa(e,"scandir");t=mn(e),r=this.data.get(t);if(!r)throw new Error("ENOENT: no such file or directory, scandir '".concat(e,"'"));n=new Set;for(;r&&r.type==="symlink";){if(n.has(t))throw new Error("ELOOP: too many levels of symbolic links, scandir '".concat(e,"'"));n.add(t),t=Vq(t,r.target),r=this.data.get(t)}if(!r)throw new Error("ENOENT: no such file or directory, scandir '".concat(e,"'"));if(r.type!=="directory")throw new Error("ENOTDIR: not a directory, scandir '".concat(e,"'"));i=t==="/"?"/":"".concat(t,"/"),o=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.data.entries()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];if(a!==t&&a.startsWith(i)){l=a.slice(i.length),c=l.split("/")[0];c&&!l.includes("/",c.length)&&!o.has(c)&&o.set(c,{name:c,isFile:s.type==="file",isDirectory:s.type==="directory",isSymbolicLink:s.type==="symlink"})}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,Array.from(o.values()).sort(function(a,s){return a.name<s.name?-1:a.name>s.name?1:0})]})}).call(this)}},{key:"rm",value:function rm1(e,t){return _async_to_generator(function(){var r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"rm");r=mn(e),n=this.data.get(r);if(!n){if(t!=null&&t.force)return[2];throw new Error("ENOENT: no such file or directory, rm '".concat(e,"'"))}if(!(n.type==="directory"))return[3,9];return[4,this.readdir(r)];case 1:i=_state.sent();if(!(i.length>0))return[3,9];if(!(t!=null&&t.recursive))throw new Error("ENOTEMPTY: directory not empty, rm '".concat(e,"'"));_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=i[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];o=_step.value;a=a_(r,o);return[4,this.rm(a,t)];case 4:_state.sent();_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:this.data.delete(r);return[2]}})}).call(this)}},{key:"cp",value:function cp1(e,t,r){return _async_to_generator(function(){var n,i,o,a,a9,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,c,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"cp"),aa(t,"cp");n=mn(e),i=mn(t),o=this.data.get(n);if(!o)throw new Error("ENOENT: no such file or directory, cp '".concat(e,"'"));if(!(o.type==="file"))return[3,1];if(this.ensureParentDirs(i),"content"in o){a=_instanceof(o.content,Uint8Array)?new Uint8Array(o.content):o.content;this.data.set(i,_object_spread_props(_object_spread({},o),{content:a}))}else this.data.set(i,_object_spread({},o));return[3,12];case 1:if(!(o.type==="symlink"))return[3,2];this.ensureParentDirs(i),this.data.set(i,_object_spread({},o));return[3,12];case 2:if(!(o.type==="directory"))return[3,12];if(!(r!=null&&r.recursive))throw new Error("EISDIR: is a directory, cp '".concat(e,"'"));return[4,this.mkdir(i,{recursive:!0})];case 3:_state.sent();return[4,this.readdir(n)];case 4:a9=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,10,11,12]);_iterator=a9[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];s=_step.value;l=a_(n,s),c=a_(i,s);return[4,this.cp(l,c,r)];case 7:_state.sent();_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2]}})}).call(this)}},{key:"mv",value:function mv1(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.cp(e,t,{recursive:!0})];case 1:_state.sent();return[4,this.rm(e,{recursive:!0})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"getAllPaths",value:function getAllPaths(){return Array.from(this.data.keys())}},{key:"resolvePath",value:function resolvePath(e,t){return Fke(e,t)}},{key:"chmod",value:function chmod(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){aa(e,"chmod");r=mn(e),n=this.data.get(r);if(!n)throw new Error("ENOENT: no such file or directory, chmod '".concat(e,"'"));n.mode=t;return[2]})}).call(this)}},{key:"symlink",value:function symlink(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){aa(t,"symlink");r=mn(t);if(this.data.has(r))throw new Error("EEXIST: file already exists, symlink '".concat(t,"'"));this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date});return[2]})}).call(this)}},{key:"link",value:function link(e,t){return _async_to_generator(function(){var r,n,i,o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:aa(e,"link"),aa(t,"link");r=mn(e),n=mn(t),i=this.data.get(r);if(!i)throw new Error("ENOENT: no such file or directory, link '".concat(e,"'"));if(i.type!=="file")throw new Error("EPERM: operation not permitted, link '".concat(e,"'"));if(this.data.has(n))throw new Error("EEXIST: file already exists, link '".concat(t,"'"));o=i;_tmp="lazy"in o;if(!_tmp)return[3,2];return[4,this.materializeLazy(r,o)];case 1:_tmp=o=_state.sent();_state.label=2;case 2:_tmp,this.ensureParentDirs(n),this.data.set(n,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime});return[2]}})}).call(this)}},{key:"readlink",value:function readlink(e){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){aa(e,"readlink");t=mn(e),r=this.data.get(t);if(!r)throw new Error("ENOENT: no such file or directory, readlink '".concat(e,"'"));if(r.type!=="symlink")throw new Error("EINVAL: invalid argument, readlink '".concat(e,"'"));return[2,r.target]})}).call(this)}},{key:"realpath",value:function realpath(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){aa(e,"realpath");t=this.resolvePathWithSymlinks(e);if(!this.data.has(t))throw new Error("ENOENT: no such file or directory, realpath '".concat(e,"'"));return[2,t]})}).call(this)}},{key:"utimes",value:function utimes(e,t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){aa(e,"utimes");n=mn(e),i=this.resolvePathWithSymlinks(n),o=this.data.get(i);if(!o)throw new Error("ENOENT: no such file or directory, utimes '".concat(e,"'"));o.mtime=r;return[2]})}).call(this)}}]);return t51}();rke();function xvt(e){var t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function yvt(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function vvt(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function _vt(e,t){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version","".concat(tke,"\n")),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm","bash\n"),e.writeFileLazy?e.writeFileLazy("/proc/self/status",function(){return f_e(t)}):e.writeFileSync("/proc/self/status",f_e(t)),e.writeFileSync("/proc/self/fd/0","/dev/stdin"),e.writeFileSync("/proc/self/fd/1","/dev/stdout"),e.writeFileSync("/proc/self/fd/2","/dev/stderr")}function bvt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pid:1,ppid:0,uid:1e3,gid:1e3};xvt(e)&&(yvt(e,t),vvt(e),_vt(e,r))}yp();Vh();jr();var wvt=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],Svt=["braceexpand","hashall","interactive-comments"];function zke(e){var t=[],r=_to_consumable_array(Svt.map(function(n){return{name:n,enabled:!0}})).concat(_to_consumable_array(wvt.map(function(n){return{name:n,enabled:e[n]}}))).sort(function(n,i){return n.name.localeCompare(i.name)});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;n.enabled&&t.push(n.name)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.join(":")}function L9(e){e.state.env.set("SHELLOPTS",zke(e.state.options))}var kvt=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function jke(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=kvt[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;e[r]&&t.push(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.join(":")}function tbe(e){e.state.env.set("BASHOPTS",jke(e.state.shoptOptions))}kr();Vh();u_();td();jo();u_();var Cvt="BASH_ALIAS_";function rbe(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function nbe(e){if(e.parts.length!==1)return null;var t=e.parts[0];return t.type==="Literal"?t.value:null}function ibe(e,t){return e.env.get("".concat(Cvt).concat(t))}function Uke(e,t,r){if(!t.name||!rbe(t.name))return t;var n=nbe(t.name);if(!n)return t;var i=ibe(e,n);if(!i||r.has(n))return t;try{r.add(n);var _$o=new Pn,a=i,s=i.endsWith(" ");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!s)try{for(var _iterator=t.args[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _$u=_step.value;var p=Bke(_$u);a+=" ".concat(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var l;try{l=_$o.parse(a)}catch(u){if(_instanceof(u,Xu))throw u;return t}if(l.statements.length!==1||l.statements[0].pipelines.length!==1||l.statements[0].pipelines[0].commands.length!==1)return obe(t,i);var c=l.statements[0].pipelines[0].commands[0];if(c.type!=="SimpleCommand")return obe(t,i);var d=_object_spread_props(_object_spread({},c),{assignments:_to_consumable_array(t.assignments).concat(_to_consumable_array(c.assignments)),redirections:_to_consumable_array(c.redirections).concat(_to_consumable_array(t.redirections)),line:t.line});if(s&&t.args.length>0&&(d=_object_spread_props(_object_spread({},d),{args:_to_consumable_array(d.args).concat(_to_consumable_array(t.args))}),d.args.length>0)){var _$u1=d.args[0];if(rbe(_$u1)){var p10=nbe(_$u1);if(p10&&ibe(e,p10)){var m={type:"SimpleCommand",name:_$u1,args:d.args.slice(1),assignments:[],redirections:[]},h=Uke(e,m,r);h!==m&&(d=_object_spread_props(_object_spread({},d),{name:h.name,args:_to_consumable_array(h.args)}))}}}return d}catch(o){throw r.delete(n),o}}function obe(e,t){var r=t;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.args[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;var s=Bke(a);r+=" ".concat(s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=new Pn,i=n.parseWordFromString("eval",!1,!1),o=n.parseWordFromString("'".concat(r.replace(/'/g,"'\\''"),"'"),!1,!1);return{type:"SimpleCommand",name:i,args:[o],assignments:e.assignments,redirections:e.redirections,line:e.line}}function Bke(e){var t="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;switch(r.type){case"Literal":t+=r.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":t+="'".concat(r.value,"'");break;case"DoubleQuoted":t+='"'.concat(r.parts.map(function(n){return n.type==="Literal"?n.value:"$".concat(n.type)}).join(""),'"');break;case"ParameterExpansion":t+="${".concat(r.parameter,"}");break;case"CommandSubstitution":t+="$(...)";break;case"ArithmeticExpansion":t+="$((".concat(r.expression,"))");break;case"Glob":t+=r.pattern;break;default:break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}kl();wl();nd();function Evt(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,p10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,m,_o1,u10,u11,err,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.parts.map(function(d){return d.type==="Literal"?d.value:"\0"}).join(""),n=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!n||!r.endsWith(")"))return[2,null];i=n[1],o=[],a=!1,s="",l=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,11,12,13]);_iterator=t.parts[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];d=_step.value;if(!(d.type==="Literal"))return[3,3];u=d.value;if(!a){p=u.indexOf("=(");p!==-1&&(a=!0,u=u.slice(p+2))}if(a){u.endsWith(")")&&(u=u.slice(0,-1));p10=u.split(/(\s+)/);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=p10[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){m=_step1.value;/^\s+$/.test(m)?(s||l)&&(o.push(s),s="",l=!1):m&&(s+=m)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}return[3,9];case 3:if(!a)return[3,9];if(!(d.type==="BraceExpansion"))return[3,7];if(!/^\[.+\]=/.test(s))return[3,4];s+=tP({type:"Word",parts:[d]});return[3,6];case 4:(s||l)&&(o.push(s),s="",l=!1);return[4,l1(e,{type:"Word",parts:[d]})];case 5:u10=_state.sent();(_o1=o).push.apply(_o1,_to_consumable_array(u10.values));_state.label=6;case 6:return[3,9];case 7:(d.type==="SingleQuoted"||d.type==="DoubleQuoted"||d.type==="Escaped")&&(l=!0);return[4,pr(e,{type:"Word",parts:[d]})];case 8:u11=_state.sent();s+=u11;_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,2];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:(s||l)&&o.push(s);c=o.map(function(d){return/^\[.+\]=/.test(d)?d:d===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(d)&&!d.startsWith("'")&&!d.startsWith('"')?"'".concat(d.replace(/'/g,"'\\''"),"'"):d});return[2,"".concat(i,"=(").concat(c.join(" "),")")]}})})()}function Tvt(e,t){return _async_to_generator(function(){var r,n,i,h,g,x,y,v,y10,o,a,s,l,c,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,h10,err,p,m,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=-1,n=-1,i=!1;for(h=0;h<t.parts.length;h++){g=t.parts[h];if(g.type==="Literal"){x=g.value.indexOf("+=");if(x!==-1){y=g.value.slice(0,x);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(y)){r=h,n=x,i=!0;break}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(y)){r=h,n=x,i=!0;break}}v=g.value.indexOf("=");if(v!==-1&&(v===0||g.value[v-1]!=="+")){y10=g.value.slice(0,v);if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(y10)||/^[a-zA-Z_][a-zA-Z0-9_]*\[[^\]]+\]$/.test(y10)){r=h,n=v;break}}}}if(r===-1)return[2,null];o=t.parts.slice(0,r),a=t.parts[r];if(a.type!=="Literal")return[2,null];s=i?2:1,l=a.value.slice(0,n),c=a.value.slice(n+s),d=t.parts.slice(r+1),u="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];h10=_step.value;return[4,pr(e,{type:"Word",parts:[h10]})];case 3:u=u+_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:u+=l;p={type:"Word",parts:c!==""?[{type:"Literal",value:c}].concat(_to_consumable_array(d)):d};if(!(p.parts.length>0))return[3,10];return[4,pr(e,p)];case 9:_tmp=_state.sent();return[3,11];case 10:_tmp="";_state.label=11;case 11:m=_tmp;return[2,"".concat(u).concat(i?"+=":"=").concat(m)]}})})()}var Avt=["tar","yq","xan","sqlite3","python3","python"];function Ivt(e){return Avt.includes(e)}kr();yp();Ff();td();jr();jr();var di=Object.freeze({stdout:"",stderr:"",exitCode:0});function Un(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return{stdout:e,stderr:"",exitCode:0}}function ot(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return{stdout:"",stderr:e,exitCode:t}}function ft(e,t,r){return{stdout:e,stderr:t,exitCode:r}}function Ca(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function u1(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";throw new Qt(e,t,r,n)}function au(e){var t=e.state.fileDescriptors;if(t&&t.size>=e.limits.maxFileDescriptors)throw new Qt("too many open file descriptors (max ".concat(e.limits.maxFileDescriptors,")"),"file_descriptors")}function Pvt(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new o5;return di}if(t.length>1)throw new Ci(1,"","bash: break: too many arguments\n");var r=1;if(t.length>0){var n=Number.parseInt(t[0],10);if(Number.isNaN(n)||n<1)throw new Ci(128,"","bash: break: ".concat(t[0],": numeric argument required\n"));r=n}throw new Nf(r)}function Rvt(e,t){return _async_to_generator(function(){var r,n,i,o,a,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p,m,h,err,s,l,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,d10,u10,err,c,d11;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=!1,i=!1,o=0;for(;o<t.length;)if(t[o]==="--"){o++;break}else if(t[o]==="-L")i=!1,o++;else if(t[o]==="-P")i=!0,o++;else if(t[o].startsWith("-")&&t[o]!=="-")o++;else break;a=t.slice(o);if(!(a.length===0||a[0]==="~"?r=e.state.env.get("HOME")||"/":a[0]==="-"?(r=e.state.previousDir,n=!0):r=a[0],!r.startsWith("/")&&!r.startsWith("./")&&!r.startsWith("../")&&r!=="."&&r!==".."))return[3,10];d=e.state.env.get("CDPATH");if(!d)return[3,10];u=d.split(":").filter(function(p){return p});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=u[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];p=_step.value;m=p.startsWith("/")?"".concat(p,"/").concat(r):"".concat(e.state.cwd,"/").concat(p,"/").concat(r);_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,e.fs.stat(m)];case 4:if(_state.sent().isDirectory){r=m,n=!0;return[3,7]}return[3,6];case 5:h=_state.sent();return[3,6];case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:s=(r.startsWith("/")?r:"".concat(e.state.cwd,"/").concat(r)).split("/").filter(function(d){return d&&d!=="."}),l="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=11;case 11:_state.trys.push([11,19,20,21]);_iterator1=s[Symbol.iterator]();_state.label=12;case 12:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,18];d10=_step1.value;if(!(d10===".."))return[3,13];l=l.split("/").slice(0,-1).join("/")||"/";return[3,17];case 13:l=l?"".concat(l,"/").concat(d10):"/".concat(d10);_state.label=14;case 14:_state.trys.push([14,16,,17]);return[4,e.fs.stat(l)];case 15:if(!_state.sent().isDirectory)return[2,ot("bash: cd: ".concat(r,": Not a directory\n"))];return[3,17];case 16:u10=_state.sent();return[2,ot("bash: cd: ".concat(r,": No such file or directory\n"))];case 17:_iteratorNormalCompletion1=true;return[3,12];case 18:return[3,21];case 19:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,21];case 20:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 21:c=l||"/";if(!i)return[3,25];_state.label=22;case 22:_state.trys.push([22,24,,25]);return[4,e.fs.realpath(c)];case 23:c=_state.sent();return[3,25];case 24:d11=_state.sent();return[3,25];case 25:return[2,(e.state.previousDir=e.state.cwd,e.state.cwd=c,e.state.env.set("PWD",e.state.cwd),e.state.env.set("OLDPWD",e.state.previousDir),Un(n?"".concat(c,"\n"):""))]}})})()}jo();Ns();jo();Ei();kl();wl();nd();function VW(e,t){return e.fs.resolvePath(e.state.cwd,t)}var Mvt=["-e","-a","-f","-d","-r","-w","-x","-s","-L","-h","-k","-g","-u","-G","-O","-b","-c","-p","-S","-t","-N"];function FV(e){return Mvt.includes(e)}function zV(e,t,r){return _async_to_generator(function(){var n,_tmp,_tmp1,_tmp2,_tmp3,_tmp4,_tmp5,i,_tmp6,_tmp7,_tmp8;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=VW(e,r);switch(t){case"-e":return[3,1];case"-a":return[3,1];case"-f":return[3,2];case"-d":return[3,7];case"-r":return[3,12];case"-w":return[3,17];case"-x":return[3,22];case"-s":return[3,27];case"-L":return[3,32];case"-h":return[3,32];case"-k":return[3,35];case"-g":return[3,40];case"-u":return[3,45];case"-G":return[3,50];case"-O":return[3,50];case"-b":return[3,51];case"-c":return[3,52];case"-p":return[3,53];case"-S":return[3,54];case"-t":return[3,55];case"-N":return[3,56]}return[3,57];case 1:return[2,e.fs.exists(n)];case 2:return[4,e.fs.exists(n)];case 3:if(!_state.sent())return[3,5];return[4,e.fs.stat(n)];case 4:_tmp=_state.sent().isFile;return[3,6];case 5:_tmp=!1;_state.label=6;case 6:return[2,_tmp];case 7:return[4,e.fs.exists(n)];case 8:if(!_state.sent())return[3,10];return[4,e.fs.stat(n)];case 9:_tmp1=_state.sent().isDirectory;return[3,11];case 10:_tmp1=!1;_state.label=11;case 11:return[2,_tmp1];case 12:return[4,e.fs.exists(n)];case 13:if(!_state.sent())return[3,15];return[4,e.fs.stat(n)];case 14:_tmp2=(_state.sent().mode&256)!==0;return[3,16];case 15:_tmp2=!1;_state.label=16;case 16:return[2,_tmp2];case 17:return[4,e.fs.exists(n)];case 18:if(!_state.sent())return[3,20];return[4,e.fs.stat(n)];case 19:_tmp3=(_state.sent().mode&128)!==0;return[3,21];case 20:_tmp3=!1;_state.label=21;case 21:return[2,_tmp3];case 22:return[4,e.fs.exists(n)];case 23:if(!_state.sent())return[3,25];return[4,e.fs.stat(n)];case 24:_tmp4=(_state.sent().mode&64)!==0;return[3,26];case 25:_tmp4=!1;_state.label=26;case 26:return[2,_tmp4];case 27:return[4,e.fs.exists(n)];case 28:if(!_state.sent())return[3,30];return[4,e.fs.stat(n)];case 29:_tmp5=_state.sent().size>0;return[3,31];case 30:_tmp5=!1;_state.label=31;case 31:return[2,_tmp5];case 32:_state.trys.push([32,34,,35]);return[4,e.fs.lstat(n)];case 33:return[2,_state.sent().isSymbolicLink];case 34:i=_state.sent();return[2,!1];case 35:return[4,e.fs.exists(n)];case 36:if(!_state.sent())return[3,38];return[4,e.fs.stat(n)];case 37:_tmp6=(_state.sent().mode&512)!==0;return[3,39];case 38:_tmp6=!1;_state.label=39;case 39:return[2,_tmp6];case 40:return[4,e.fs.exists(n)];case 41:if(!_state.sent())return[3,43];return[4,e.fs.stat(n)];case 42:_tmp7=(_state.sent().mode&1024)!==0;return[3,44];case 43:_tmp7=!1;_state.label=44;case 44:return[2,_tmp7];case 45:return[4,e.fs.exists(n)];case 46:if(!_state.sent())return[3,48];return[4,e.fs.stat(n)];case 47:_tmp8=(_state.sent().mode&2048)!==0;return[3,49];case 48:_tmp8=!1;_state.label=49;case 49:return[2,_tmp8];case 50:return[2,e.fs.exists(n)];case 51:return[2,!1];case 52:return[2,["/dev/null","/dev/zero","/dev/random","/dev/urandom","/dev/tty","/dev/stdin","/dev/stdout","/dev/stderr"].includes(n)];case 53:return[2,!1];case 54:return[2,!1];case 55:return[2,!1];case 56:return[2,e.fs.exists(n)];case 57:return[2,!1];case 58:return[2]}})})()}var Ovt=["-nt","-ot","-ef"];function jV(e){return Ovt.includes(e)}function UV(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,a9,a10,s10,a11,_tmp,a12,s11,a13;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=VW(e,r),o=VW(e,n);switch(t){case"-nt":return[3,1];case"-ot":return[3,5];case"-ef":return[3,9]}return[3,14];case 1:_state.trys.push([1,4,,5]);return[4,e.fs.stat(i)];case 2:a=_state.sent();return[4,e.fs.stat(o)];case 3:s=_state.sent();return[2,a.mtime>s.mtime];case 4:a9=_state.sent();return[2,!1];case 5:_state.trys.push([5,8,,9]);return[4,e.fs.stat(i)];case 6:a10=_state.sent();return[4,e.fs.stat(o)];case 7:s10=_state.sent();return[2,a10.mtime<s10.mtime];case 8:a11=_state.sent();return[2,!1];case 9:_state.trys.push([9,13,,14]);return[4,e.fs.exists(i)];case 10:_tmp=!_state.sent();if(_tmp)return[3,12];return[4,e.fs.exists(o)];case 11:_tmp=!_state.sent();_state.label=12;case 12:if(_tmp)return[2,!1];a12=e.fs.resolvePath(e.state.cwd,i),s11=e.fs.resolvePath(e.state.cwd,o);return[2,a12===s11];case 13:a13=_state.sent();return[2,!1];case 14:return[2,!1];case 15:return[2]}})})()}var $vt=new Set(["-eq","-ne","-lt","-le","-gt","-ge"]);function BV(e){return $vt.has(e)}function qV(e,t,r){switch(e){case"-eq":return t===r;case"-ne":return t!==r;case"-lt":return t<r;case"-le":return t<=r;case"-gt":return t>r;case"-ge":return t>=r}}function F9(e){return e==="="||e==="=="||e==="!="}function WV(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1;if(n){var s=ZV(t,r,i,o);return e==="!="?!s:s}if(i){var s10=t.toLowerCase()===r.toLowerCase();return e==="!="?!s10:s10}var a=t===r;return e==="!="?!a:a}var Nvt=new Set(["-z","-n"]);function VV(e){return Nvt.has(e)}function GV(e,t){switch(e){case"-z":return t==="";case"-n":return t!==""}}Ns();jo();kl();nd();function HV(e,t){return _async_to_generator(function(){var n,i,r,o,a,l,s,l10,c,l11,c10,_Math,l12,c11;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!r)return[3,5];o=r[1],a=r[2];if((n=e.state.associativeArrays)!=null&&n.has(o)){l=a;return[2,((l.startsWith("'")&&l.endsWith("'")||l.startsWith('"')&&l.endsWith('"'))&&(l=l.slice(1,-1)),l=l.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,function(c,d){return e.state.env.get(d)||""}),e.state.env.has("".concat(o,"_").concat(l)))]}_state.label=1;case 1:_state.trys.push([1,3,,4]);l10=new Pn,c=Ki(l10,a);return[4,Xt(e,c.expression)];case 2:s=_state.sent();return[3,4];case 3:l11=_state.sent();if(/^-?\d+$/.test(a))s=Number.parseInt(a,10);else{c10=e.state.env.get(a);s=c10?Number.parseInt(c10,10):0}return[3,4];case 4:if(s<0){;l12=Os(e,o),c11=e.state.currentLine;if(l12.length===0)return[2,(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(c11,": ").concat(o,": bad array subscript\n"),!1)];if(s=(_Math=Math).max.apply(_Math,_to_consumable_array(l12))+1+s,s<0)return[2,(e.state.expansionStderr=(e.state.expansionStderr||"")+"bash: line ".concat(c11,": ").concat(o,": bad array subscript\n"),!1)]}return[2,e.state.env.has("".concat(o,"_").concat(s))];case 5:return[2,e.state.env.has(t)?!0:(i=e.state.associativeArrays)!=null&&i.has(t)?p1(e,t).length>0:Os(e,t).length>0]}})})()}function Z0(e,t){return _async_to_generator(function(){var _,r,n,i,o,_tmp,o10,_tmp1,o11,a,s,l,r10,_tmp2,_tmp3,_tmp4,_tmp5,_10,_11,_tmp6,_tmp7;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=t.type;switch(_){case"CondBinary":return[3,1];case"CondUnary":return[3,16];case"CondNot":return[3,25];case"CondAnd":return[3,30];case"CondOr":return[3,35];case"CondGroup":return[3,40];case"CondWord":return[3,42]}return[3,44];case 1:return[4,pr(e,t.left)];case 2:r=_state.sent(),n=t.right.parts.length>0&&t.right.parts.every(function(o){return o.type==="SingleQuoted"||o.type==="DoubleQuoted"||o.type==="Escaped"&&t.operator!=="=~"});if(!(t.operator==="=~"))return[3,7];if(!n)return[3,4];return[4,pr(e,t.right)];case 3:o=_state.sent();i=OV(o);return[3,6];case 4:return[4,Oke(e,t.right)];case 5:i=_state.sent();_state.label=6;case 6:return[3,12];case 7:if(!(F9(t.operator)&&!n))return[3,9];return[4,$ke(e,t.right)];case 8:_tmp=i=_state.sent();return[3,11];case 9:return[4,pr(e,t.right)];case 10:_tmp=i=_state.sent();_state.label=11;case 11:_tmp;_state.label=12;case 12:if(F9(t.operator)){o10=e.state.shoptOptions.nocasematch;return[2,WV(t.operator,r,i,!n,o10,!0)]}if(!BV(t.operator))return[3,15];_tmp1=[t.operator];return[4,sbe(e,r)];case 13:_tmp1=_tmp1.concat([_state.sent()]);return[4,sbe(e,i)];case 14:return[2,qV.apply(void 0,_tmp1.concat([_state.sent()]))];case 15:if(jV(t.operator))return[2,UV(e,t.operator,r,i)];switch(t.operator){case"=~":try{o11=e.state.shoptOptions.nocasematch,a=zvt(i),s=ir(a,o11?"i":"").match(r);if(o_(e,"BASH_REMATCH"),s)for(l=0;l<s.length;l++)e.state.env.set("BASH_REMATCH_".concat(l),s[l]||"");return[2,s!==null]}catch(o){throw new Error("syntax error in regular expression")}case"<":return[2,r<i];case">":return[2,r>i];default:return[2,!1]}_state.label=16;case 16:return[4,pr(e,t.operand)];case 17:r10=_state.sent();if(!FV(t.operator))return[3,18];_tmp2=zV(e,t.operator,r10);return[3,24];case 18:if(!VV(t.operator))return[3,19];_tmp3=GV(t.operator,r10);return[3,23];case 19:if(!(t.operator==="-v"))return[3,21];return[4,HV(e,r10)];case 20:_tmp4=_state.sent();return[3,22];case 21:_tmp4=t.operator==="-o"?KV(e,r10):!1;_state.label=22;case 22:_tmp3=_tmp4;_state.label=23;case 23:_tmp2=_tmp3;_state.label=24;case 24:return[2,_tmp2];case 25:if(!(e.state.shoptOptions.extglob&&t.operand.type==="CondGroup"&&t.operand.expression.type==="CondWord"))return[3,27];_11=(_10="!(").concat;return[4,pr(e,t.operand.expression.word)];case 26:_tmp5=_11.apply(_10,[_state.sent(),")"])!="";return[3,29];case 27:return[4,Z0(e,t.operand)];case 28:_tmp5=!_state.sent();_state.label=29;case 29:return[2,_tmp5];case 30:return[4,Z0(e,t.left)];case 31:if(!_state.sent())return[3,33];return[4,Z0(e,t.right)];case 32:_tmp6=_state.sent();return[3,34];case 33:_tmp6=!1;_state.label=34;case 34:return[2,_tmp6];case 35:return[4,Z0(e,t.left)];case 36:if(!_state.sent())return[3,37];_tmp7=!0;return[3,39];case 37:return[4,Z0(e,t.right)];case 38:_tmp7=_state.sent();_state.label=39;case 39:return[2,_tmp7];case 40:return[4,Z0(e,t.expression)];case 41:return[2,_state.sent()];case 42:return[4,pr(e,t.word)];case 43:return[2,_state.sent()!==""];case 44:return[2,!1];case 45:return[2]}})})()}function S9(e,t){return _async_to_generator(function(){var n,i,_tmp,_tmp1,_tmp2,_tmp3,_tmp4,n10,i10,o,a,s,a9,n11,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length===0)return[2,ft("","",1)];if(t.length===1)return[2,Ca(!!t[0])];if(!(t.length===2))return[3,13];n=t[0],i=t[1];if(!(n==="("))return[3,1];_tmp=ot("test: '(' without matching ')'\n",2);return[3,12];case 1:if(!FV(n))return[3,3];return[4,zV(e,n,i)];case 2:_tmp1=Ca.apply(void 0,[_state.sent()]);return[3,11];case 3:if(!VV(n))return[3,4];_tmp2=Ca(GV(n,i));return[3,10];case 4:if(!(n==="!"))return[3,5];_tmp3=Ca(!i);return[3,9];case 5:if(!(n==="-v"))return[3,7];return[4,HV(e,i)];case 6:_tmp4=Ca.apply(void 0,[_state.sent()]);return[3,8];case 7:_tmp4=n==="-o"?Ca(KV(e,i)):n==="="||n==="=="||n==="!="||n==="<"||n===">"||n==="-eq"||n==="-ne"||n==="-lt"||n==="-le"||n==="-gt"||n==="-ge"||n==="-nt"||n==="-ot"||n==="-ef"?ot("test: ".concat(n,": unary operator expected\n"),2):ft("","",1);_state.label=8;case 8:_tmp3=_tmp4;_state.label=9;case 9:_tmp2=_tmp3;_state.label=10;case 10:_tmp1=_tmp2;_state.label=11;case 11:_tmp=_tmp1;_state.label=12;case 12:return[2,_tmp];case 13:if(!(t.length===3))return[3,18];n10=t[0],i10=t[1],o=t[2];if(F9(i10))return[2,Ca(WV(i10,n10,o))];if(BV(i10)){a=z9(n10),s=z9(o);return[2,!a.valid||!s.valid?ft("","",2):Ca(qV(i10,a.value,s.value))]}if(!jV(i10))return[3,15];return[4,UV(e,i10,n10,o)];case 14:return[2,Ca.apply(void 0,[_state.sent()])];case 15:switch(i10){case"-a":return[2,Ca(n10!==""&&o!=="")];case"-o":return[2,Ca(n10!==""||o!=="")];case">":return[2,Ca(n10>o)];case"<":return[2,Ca(n10<o)]}if(!(n10==="!"))return[3,17];return[4,S9(e,[i10,o])];case 16:a9=_state.sent();return[2,ft("",a9.stderr,a9.exitCode===0?1:a9.exitCode===1?0:a9.exitCode)];case 17:if(n10==="("&&o===")")return[2,Ca(i10!=="")];_state.label=18;case 18:if(!(t.length===4))return[3,21];if(!(t[0]==="!"))return[3,20];return[4,S9(e,t.slice(1))];case 19:n11=_state.sent();return[2,ft("",n11.stderr,n11.exitCode===0?1:n11.exitCode===1?0:n11.exitCode)];case 20:if(t[0]==="("&&t[3]===")")return[2,S9(e,[t[1],t[2]])];_state.label=21;case 21:return[4,qke(e,t,0)];case 22:r=_state.sent();return[2,r.pos<t.length?ot("test: too many arguments\n",2):Ca(r.value)]}})})()}function qke(e,t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Dvt(e,t,r)]})})()}function Dvt(e,t,r){return _async_to_generator(function(){var _ref,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,abe(e,t,r)];case 1:_ref=_state.sent(),n=_ref.value,i=_ref.pos;_state.label=2;case 2:if(!(t[i]==="-o"))return[3,5];return[4,abe(e,t,i+1)];case 3:o=_state.sent();n=n||o.value,i=o.pos;_state.label=4;case 4:return[3,2];case 5:return[2,{value:n,pos:i}]}})})()}function abe(e,t,r){return _async_to_generator(function(){var _ref,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,GW(e,t,r)];case 1:_ref=_state.sent(),n=_ref.value,i=_ref.pos;_state.label=2;case 2:if(!(t[i]==="-a"))return[3,5];return[4,GW(e,t,i+1)];case 3:o=_state.sent();n=n&&o.value,i=o.pos;_state.label=4;case 4:return[3,2];case 5:return[2,{value:n,pos:i}]}})})()}function GW(e,t,r){return _async_to_generator(function(){var _ref,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(t[r]==="!"))return[3,2];return[4,GW(e,t,r+1)];case 1:_ref=_state.sent(),n=_ref.value,i=_ref.pos;return[2,{value:!n,pos:i}];case 2:return[2,Lvt(e,t,r)]}})})()}function Lvt(e,t,r){return _async_to_generator(function(){var o,a,s,l,c,d,u,n,_ref,p,m,i,p10,m10,p11,m11,p12,m12,_tmp,p13,_tmp1,p14,p15,_tmp2,p16;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=t[r];if(!(n==="("))return[3,2];return[4,qke(e,t,r+1)];case 1:_ref=_state.sent(),p=_ref.value,m=_ref.pos;return[2,{value:p,pos:t[m]===")"?m+1:m}];case 2:i=t[r+1];if(F9(i)){p10=n,m10=(o=t[r+2])!=null?o:"";return[2,{value:WV(i,p10,m10),pos:r+3}]}if(BV(i)){p11=z9(n),m11=z9((a=t[r+2])!=null?a:"0");return[2,!p11.valid||!m11.valid?{value:!1,pos:r+3}:{value:qV(i,p11.value,m11.value),pos:r+3}]}if(!jV(i))return[3,4];p12=n,m12=(s=t[r+2])!=null?s:"";_tmp={};return[4,UV(e,i,p12,m12)];case 3:return[2,(_tmp.value=_state.sent(),_tmp.pos=r+3,_tmp)];case 4:if(!FV(n))return[3,6];p13=(l=t[r+1])!=null?l:"";_tmp1={};return[4,zV(e,n,p13)];case 5:return[2,(_tmp1.value=_state.sent(),_tmp1.pos=r+2,_tmp1)];case 6:if(VV(n)){p14=(c=t[r+1])!=null?c:"";return[2,{value:GV(n,p14),pos:r+2}]}if(!(n==="-v"))return[3,8];p15=(d=t[r+1])!=null?d:"";_tmp2={};return[4,HV(e,p15)];case 7:return[2,(_tmp2.value=_state.sent(),_tmp2.pos=r+2,_tmp2)];case 8:if(n==="-o"){p16=(u=t[r+1])!=null?u:"";return[2,{value:KV(e,p16),pos:r+2}]}return[2,{value:n!==void 0&&n!=="",pos:r+1}]}})})()}function ZV(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;var i="^".concat(Wke(t,n),"$");return ir(i,r?"is":"s").test(e)}function Wke(e,t){var _loop=function(n10){var i=e[n10];if(t&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&n10+1<e.length&&e[n10+1]==="("){var o=Vke(e,n10+1);if(o!==-1){var a=e.slice(n10+2,o),s=Gke(a),l=s.map(function(d){return Wke(d,t)}),c=l.length>0?l.join("|"):"(?:)";if(i==="@")r+="(?:".concat(c,")");else if(i==="*")r+="(?:".concat(c,")*");else if(i==="+")r+="(?:".concat(c,")+");else if(i==="?")r+="(?:".concat(c,")?");else if(i==="!")if(o<e.length-1){var d=s.map(function(u){return Hke(u,t)});if(d.every(function(u){return u!==null})&&d.every(function(u){return u===d[0]})&&d[0]!==null){var u=d[0];if(u===0)r+="(?:.+)";else{var p=[];u>0&&p.push(".{0,".concat(u-1,"}")),p.push(".{".concat(u+1,",}")),p.push("(?!(?:".concat(c,")).{").concat(u,"}")),r+="(?:".concat(p.join("|"),")")}}else r+="(?:(?!(?:".concat(c,")).)*?")}else r+="(?!(?:".concat(c,")$).*");n10=o;return n=n10,"continue"}}if(i==="\\")if(n10+1<e.length){var o10=e[n10+1];/[\\^$.|+(){}[\]*?]/.test(o10)?r+="\\".concat(o10):r+=o10,n10++}else r+="\\\\";else if(i==="*")r+=".*";else if(i==="?")r+=".";else if(i==="["){var o11=e.indexOf("]",n10+1);o11!==-1?(r+=e.slice(n10,o11+1),n10=o11):r+="\\["}else/[\\^$.|+(){}]/.test(i)?r+="\\".concat(i):r+=i;n=n10,void 0};var r="";for(var n=0;n<e.length;n++)_loop(n);return r}function Vke(e,t){var r=1,n=t+1;for(;n<e.length&&r>0;){var i=e[n];if(i==="\\"){n+=2;continue}if(i==="(")r++;else if(i===")"&&(r--,r===0))return n;n++}return-1}function Gke(e){var t=[],r="",n=0,i=0;for(;i<e.length;){var o=e[i];if(o==="\\"){r+=o,i+1<e.length?(r+=e[i+1],i+=2):i++;continue}o==="("?(n++,r+=o):o===")"?(n--,r+=o):o==="|"&&n===0?(t.push(r),r=""):r+=o,i++}return t.push(r),t}function Hke(e,t){var _loop=function(){var i=e[n];if(t&&(i==="@"||i==="*"||i==="+"||i==="?"||i==="!")&&n+1<e.length&&e[n+1]==="("){var o=Vke(e,n+1);if(o!==-1){if(i==="@"){var a=e.slice(n+2,o),s=Gke(a).map(function(l){return Hke(l,t)});if(s.every(function(l){return l!==null})&&s.every(function(l){return l===s[0]})){r+=s[0],n=o+1;return"continue"}return{v:null}}return{v:null}}}if(i==="*")return{v:null};if(i==="?"){r+=1,n++;return"continue"}if(i==="["){var o10=e.indexOf("]",n+1);if(o10!==-1){r+=1,n=o10+1;return"continue"}r+=1,n++;return"continue"}if(i==="\\"){r+=1,n+=2;return"continue"}r+=1,n++};var r=0,n=0;for(;n<e.length;){var _ret=_loop();if(_type_of(_ret)==="object")return _ret.v}return r}function KV(e,t){var r=new Map([["errexit",function(){return e.state.options.errexit===!0}],["nounset",function(){return e.state.options.nounset===!0}],["pipefail",function(){return e.state.options.pipefail===!0}],["xtrace",function(){return e.state.options.xtrace===!0}],["e",function(){return e.state.options.errexit===!0}],["u",function(){return e.state.options.nounset===!0}],["x",function(){return e.state.options.xtrace===!0}]]).get(t);return r?r():!1}function sbe(e,t){return _async_to_generator(function(){var r,n,r10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t=t.trim(),t==="")return[2,0];if(/^[+-]?(\d+#[a-zA-Z0-9@_]+|0[xX][0-9a-fA-F]+|0[0-7]+|\d+)$/.test(t))return[2,lbe(t)];_state.label=1;case 1:_state.trys.push([1,3,,4]);r=new Pn,n=Ki(r,t);return[4,Xt(e,n.expression)];case 2:return[2,_state.sent()];case 3:r10=_state.sent();return[2,lbe(t)];case 4:return[2]}})})()}function Fvt(e,t){var r=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=void 0;if(n>="0"&&n<="9")i=n.charCodeAt(0)-48;else if(n>="a"&&n<="z")i=n.charCodeAt(0)-97+10;else if(n>="A"&&n<="Z")i=n.charCodeAt(0)-65+36;else if(n==="@")i=62;else if(n==="_")i=63;else return Number.NaN;if(i>=t)return Number.NaN;r=r*t+i}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function lbe(e){if(e=e.trim(),e==="")return 0;var t=!1;e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1));var r,n=e.match(/^(\d+)#([a-zA-Z0-9@_]+)$/);if(n){var i=Number.parseInt(n[1],10);i>=2&&i<=64?r=Fvt(n[2],i):r=0}else/^0[xX][0-9a-fA-F]+$/.test(e)?r=Number.parseInt(e,16):/^0[0-7]+$/.test(e)?r=Number.parseInt(e,8):r=Number.parseInt(e,10);return Number.isNaN(r)&&(r=0),t?-r:r}function z9(e){if(e=e.trim(),e==="")return{value:0,valid:!0};var t=!1;if(e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1)),!/^\d+$/.test(e))return{value:0,valid:!1};var r=Number.parseInt(e,10);return Number.isNaN(r)?{value:0,valid:!1}:{value:t?-r:r,valid:!0}}function zvt(e){var t="",r=0;for(;r<e.length;)if(e[r]==="\\"&&r+1<e.length)t+=e[r]+e[r+1],r+=2;else if(e[r]==="["){var n=jvt(e,r);t+=n.converted,r=n.endIndex}else t+=e[r],r++;return t}function jvt(e,t){var r=t+1,n="[";r<e.length&&(e[r]==="^"||e[r]==="!")&&(n+="^",r++);var i=!1;r<e.length&&e[r]==="]"&&(i=!0,r++);var o=!1;r<e.length&&e[r]==="["&&r+1<e.length&&e[r+1]!==":"&&(o=!0,r++);var a="",s=!1;for(;r<e.length;){var l=e[r];if(l==="]"){s=!0,r++;break}if(l==="["&&r+1<e.length&&e[r+1]===":"){var c=e.indexOf(":]",r+2);if(c!==-1){var d=e.slice(r+2,c);a+=Uvt(d),r=c+2;continue}}if(l==="["&&r+1<e.length){var c10=e[r+1];if(c10==="."||c10==="="){var d10="".concat(c10,"]"),u=e.indexOf(d10,r+2);if(u!==-1){var p=e.slice(r+2,u);a+=p,r=u+2;continue}}}if(l==="\\"&&r+1<e.length){a+=l+e[r+1],r+=2;continue}a+=l,r++}return s?(i&&(n+="\\]"),o&&(n+="\\["),n+=a,n+="]",{converted:n,endIndex:r}):{converted:"\\[",endIndex:t+1}}function Uvt(e){var t;return(t=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]).get(e))!=null?t:""}wl();Ns();jo();kl();f1();function t1(e){var t=[],r="",n=!1,i=!1,o=!1,a=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(o){r+=s,o=!1,a=!0;continue}if(s==="\\"){o=!0;continue}if(s==="'"&&!i){n||(a=!0),n=!n;continue}if(s==='"'&&!n){i||(a=!0),i=!i;continue}if((s===" "||s===" "||s==="\n")&&!n&&!i){a&&(t.push(r),r="",a=!1);continue}r+=s,a=!0}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a&&t.push(r),t}function HW(e){var t=[],r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;if(e[r]!=="["){r++;continue}r++;var n="";if(e[r]==="'"||e[r]==='"'){var o=e[r];for(r++;r<e.length&&e[r]!==o;)n+=e[r],r++;e[r]===o&&r++}else for(;r<e.length&&e[r]!=="]"&&e[r]!=="=";)n+=e[r],r++;for(;r<e.length&&e[r]!=="]";)r++;if(e[r]==="]"&&r++,e[r]!=="=")continue;r++;var i="";if(e[r]==="'"||e[r]==='"'){var o10=e[r];for(r++;r<e.length&&e[r]!==o10;)e[r]==="\\"&&r+1<e.length&&r++,i+=e[r],r++;e[r]===o10&&r++}else for(;r<e.length&&!/\s/.test(e[r]);)i+=e[r],r++;t.push([n,i])}return t}function Bvt(e){var t=e.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)=\\((.*)\\)$","s"));if(t)return{name:t[1],isArray:!0,arrayElements:t1(t[2])};var r=e.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)\\[([^\\]]+)\\]=(.*)$","s"));if(r)return{name:r[1],isArray:!1,arrayIndex:r[2],value:r[3]};if(e.includes("=")){var n=e.indexOf("=");return{name:e.slice(0,n),isArray:!1,value:e.slice(n+1)}}return{name:e,isArray:!1}}function qvt(e,t){return _async_to_generator(function(){var r,n,r10,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);r=new Pn,n=Ki(r,t);return[4,Xt(e,n.expression)];case 1:return[2,_state.sent()];case 2:r10=_state.sent();n10=parseInt(t,10);return[2,Number.isNaN(n10)?0:n10];case 3:return[2]}})})()}function Wvt(_01,_11){return _async_to_generator(function(e,t){var r,d,n,i,o,a,s,tmp,l,tmp1,c,u,u10,u11,p;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{};n=t.name,i=t.isArray,o=t.arrayElements,a=t.value,s=t.arrayIndex,tmp=r.makeReadonly,l=tmp===void 0?!1:tmp,tmp1=r.checkReadonly,c=tmp1===void 0?!0:tmp1;if(c){u=Ms(e,n);if(u)return[2,u]}if(!(i&&o))return[3,1];for(u10=0;u10<o.length;u10++)e.state.env.set("".concat(n,"_").concat(u10),o[u10]);e.state.env.set("".concat(n,"__length"),String(o.length));return[3,4];case 1:if(!(s!==void 0&&a!==void 0))return[3,3];return[4,qvt(e,s)];case 2:u11=_state.sent();e.state.env.set("".concat(n,"_").concat(u11),a);p=parseInt((d=e.state.env.get("".concat(n,"__length")))!=null?d:"0",10);u11>=p&&e.state.env.set("".concat(n,"__length"),String(u11+1));return[3,4];case 3:a!==void 0&&e.state.env.set(n,a);_state.label=4;case 4:return[2,(l&&Qu(e,n),null)]}})}).apply(this,arguments)}function r_(e,t){e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,e.state.callDepth)}function ZW(e,t){var r;return(r=e.state.localVarDepth)==null?void 0:r.get(t)}function Gq(e,t){var r;(r=e.state.localVarDepth)==null||r.delete(t)}function Vvt(e,t,r){e.state.localVarStack=e.state.localVarStack||new Map;var n=e.state.localVarStack.get(t)||[];n.push({value:r,scopeIndex:e.state.localScopes.length-1}),e.state.localVarStack.set(t,n)}function KW(e,t){var n;var r=(n=e.state.localVarStack)==null?void 0:n.get(t);if(!(!r||r.length===0))return r.pop()}function Gvt(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(e.state.localVarStack)try{for(var _iterator=e.state.localVarStack.entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];for(;n.length>0&&n[n.length-1].scopeIndex===t;)n.pop();n.length===0&&e.state.localVarStack.delete(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}jr();wl();var Zke=new Set([":",".","break","continue","eval","exec","exit","export","readonly","return","set","shift","trap","unset"]);function Hvt(e){return Zke.has(e)}var Kke=new Set(["if","then","else","elif","fi","case","esac","for","select","while","until","do","done","in","function","{","}","time","[[","]]","!"]),lP=new Set([":","true","false","cd","export","unset","exit","local","set","break","continue","return","eval","shift","getopts","compgen","complete","compopt","pushd","popd","dirs","source",".","read","mapfile","readarray","declare","typeset","readonly","let","command","shopt","exec","test","[","echo","printf","pwd","alias","unalias","type","hash","ulimit","umask","trap","times","wait","kill","jobs","fg","bg","disown","suspend","fc","history","help","enable","builtin","caller"]);wl();function q0(e,t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.fs.stat(t)];case 1:if(_state.sent().isDirectory)return[2,"bash: ".concat(r,": Is a directory\n")];if(n.checkNoclobber&&e.state.options.noclobber&&!n.isClobber&&r!=="/dev/null")return[2,"bash: ".concat(r,": cannot overwrite existing file\n")];return[3,3];case 2:i=_state.sent();return[3,3];case 3:return[2,null]}})})()}function $h(e){var t=Math.min(e.length,8192);for(var r=0;r<t;r++)if(e.charCodeAt(r)>127)return"utf8";return"binary"}function Zvt(e){if(!e.startsWith("__rw__:"))return null;var t=e.slice(7),r=t.indexOf(":");if(r===-1)return null;var n=Number.parseInt(t.slice(0,r),10);if(Number.isNaN(n)||n<0)return null;var i=r+1,o=t.slice(i,i+n),a=i+n+1,s=t.slice(a),l=s.indexOf(":");if(l===-1)return null;var c=Number.parseInt(s.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;var d=s.slice(l+1);return{path:o,position:c,content:d}}function Kvt(e,t){return _async_to_generator(function(){var r,n,i,_,_tmp,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Map;n=0;_state.label=1;case 1:if(!(n<t.length))return[3,6];i=t[n];if(!(i.target.type!=="HereDoc"))return[3,5];if(!(i.operator===">&"||i.operator==="<&"))return[3,3];if(oP(e,i.target))return[2,{targets:r,error:"bash: $@: ambiguous redirect\n"}];_=r.set;_tmp=[n];return[4,pr(e,i.target)];case 2:_.apply(r,_tmp.concat([_state.sent()]));return[3,5];case 3:return[4,aP(e,i.target)];case 4:o=_state.sent();if("error"in o)return[2,{targets:r,error:o.error}];r.set(n,o.target);_state.label=5;case 5:n++;return[3,1];case 6:return[2,{targets:r}]}})})()}function Qvt(e){e.state.nextFd===void 0&&(e.state.nextFd=10);var t=e.state.nextFd,r=e.limits.maxFileDescriptors;if(t>=r)throw new Error("bash: cannot allocate file descriptor: too many open files (max ".concat(r,")"));return e.state.nextFd++,t}function Qke(e,t){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,_tmp,i,o,n,i10,o10,a,o11,_tmp1,o12,a9,o13,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,15,16,17]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];r=_step.value;if(!r.fdVariable)return[3,13];e.state.fileDescriptors||(e.state.fileDescriptors=new Map);_tmp=(r.operator===">&"||r.operator==="<&")&&r.target.type==="Word";if(!_tmp)return[3,4];return[4,pr(e,r.target)];case 3:_tmp=_state.sent()==="-";_state.label=4;case 4:if(_tmp){i=e.state.env.get(r.fdVariable);if(i!==void 0){o=Number.parseInt(i,10);Number.isNaN(o)||e.state.fileDescriptors.delete(o)}return[3,13]}n=Qvt(e);if(!(e.state.env.set(r.fdVariable,String(n)),r.target.type==="Word"))return[3,13];return[4,pr(e,r.target)];case 5:i10=_state.sent();if(r.operator===">&"||r.operator==="<&"){o10=Number.parseInt(i10,10);if(!Number.isNaN(o10)){a=e.state.fileDescriptors.get(o10);a!==void 0&&(au(e),e.state.fileDescriptors.set(n,a));return[3,13]}}if(!(r.operator===">"||r.operator===">>"||r.operator===">|"||r.operator==="&>"||r.operator==="&>>"))return[3,8];o11=e.fs.resolvePath(e.state.cwd,i10);_tmp1=r.operator===">"||r.operator===">|"||r.operator==="&>";if(!_tmp1)return[3,7];return[4,e.fs.writeFile(o11,"","binary")];case 6:_tmp1=_state.sent();_state.label=7;case 7:_tmp1,au(e),e.state.fileDescriptors.set(n,"__file__:".concat(o11));return[3,13];case 8:if(!(r.operator==="<<<"))return[3,9];au(e),e.state.fileDescriptors.set(n,"".concat(i10,"\n"));return[3,13];case 9:if(!(r.operator==="<"||r.operator==="<>"))return[3,13];_state.label=10;case 10:_state.trys.push([10,12,,13]);o12=e.fs.resolvePath(e.state.cwd,i10);return[4,e.fs.readFile(o12)];case 11:a9=_state.sent();au(e),e.state.fileDescriptors.set(n,a9);return[3,13];case 12:o13=_state.sent();return[2,ft("","bash: ".concat(i10,": No such file or directory\n"),1)];case 13:_iteratorNormalCompletion=true;return[3,2];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:return[2,null]}})})()}function r1(e,t){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,i,s,o,a,s10,s11,_tmp,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,15,16,17]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];r=_step.value;if(r.target.type==="HereDoc")return[3,13];n=r.operator===">&";if(r.operator!==">"&&r.operator!==">|"&&r.operator!=="&>"&&!n)return[3,13];i=void 0;if(!n)return[3,4];return[4,pr(e,r.target)];case 3:if(i=_state.sent(),i==="-"||!Number.isNaN(Number.parseInt(i,10))||r.fd!=null)return[3,13];return[3,6];case 4:return[4,aP(e,r.target)];case 5:s=_state.sent();if("error"in s)return[2,ft("",s.error,1)];i=s.target;_state.label=6;case 6:o=e.fs.resolvePath(e.state.cwd,i),a=r.operator===">|";if(o.includes("\0"))return[2,ft("","bash: ".concat(i,": No such file or directory\n"),1)];_state.label=7;case 7:_state.trys.push([7,9,,10]);return[4,e.fs.stat(o)];case 8:s10=_state.sent();if(s10.isDirectory)return[2,ft("","bash: ".concat(i,": Is a directory\n"),1)];if(e.state.options.noclobber&&!a&&!s10.isDirectory&&i!=="/dev/null")return[2,ft("","bash: ".concat(i,": cannot overwrite existing file\n"),1)];return[3,10];case 9:s11=_state.sent();return[3,10];case 10:_tmp=i!=="/dev/null"&&i!=="/dev/stdout"&&i!=="/dev/stderr"&&i!=="/dev/full";if(!_tmp)return[3,12];return[4,e.fs.writeFile(o,"","binary")];case 11:_tmp=_state.sent();_state.label=12;case 12:if(_tmp,i==="/dev/full")return[2,ft("","bash: /dev/full: No space left on device\n",1)];_state.label=13;case 13:_iteratorNormalCompletion=true;return[3,2];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:return[2,null]}})})()}function vo(e,t,r,n){return _async_to_generator(function(){var p,m,h,g,x,v,y,_,b,i,o,a,s,l,w,S,k,E,C,_10,C1,T,I,O,I1,O1,C10,T1,I10,T10,I11,C11,T11,I12,O10,T12,I13,O11,M,_tmp,_tmp1,I14,O12,_tmp2,_tmp3,O13,_tmp4,_tmp5,_tmp6,O14,M1,R,_tmp7,_tmp8,C12,T13,I15,C13,T14,I16,c,w10,w11,d,w12,w13,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=t.stdout,o=t.stderr,a=t.exitCode,s=t.stdoutKind==="bytes"||t.stdoutKind===void 0&&t.stdoutEncoding==="binary"?"binary":"utf8",l=function(w){return s};w=0;_state.label=1;case 1:if(!(w<r.length))return[3,64];S=r[w];if(S.target.type==="HereDoc")return[3,63];k=void 0,E=n==null?void 0:n.get(w);if(!(E!==void 0))return[3,2];k=E;return[3,6];case 2:if(!(S.operator===">&"||S.operator==="<&"))return[3,4];if(oP(e,S.target)){o+="bash: $@: ambiguous redirect\n",a=1,i="";return[3,63]}return[4,pr(e,S.target)];case 3:k=_state.sent();return[3,6];case 4:return[4,aP(e,S.target)];case 5:C=_state.sent();if("error"in C){o+=C.error,a=1,i="";return[3,63]}k=C.target;_state.label=6;case 6:if(!!S.fdVariable)return[3,63];if(k.includes("\0")){o+="bash: ".concat(k.replace(/\0/g,""),": No such file or directory\n"),a=1,i="";return[3,63]}_10=S.operator;switch(_10){case">":return[3,7];case">|":return[3,7];case">>":return[3,15];case">&":return[3,22];case"<&":return[3,22];case"&>":return[3,57];case"&>>":return[3,60]}return[3,63];case 7:C1=(p=S.fd)!=null?p:1,T=S.operator===">|";if(!(C1===1))return[3,10];if(k==="/dev/stdout")return[3,63];if(k==="/dev/stderr"){o+=i,i="";return[3,63]}if(k==="/dev/full"){o+="bash: echo: write error: No space left on device\n",a=1,i="";return[3,63]}I=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,I,k,{checkNoclobber:!0,isClobber:T})];case 8:O=_state.sent();if(O){o+=O,a=1,i="";return[3,63]}return[4,e.fs.writeFile(I,i,l(i))];case 9:_state.sent(),i="";return[3,14];case 10:if(!(C1===2))return[3,14];if(k==="/dev/stderr")return[3,63];if(k==="/dev/stdout"){i+=o,o="";return[3,63]}if(k==="/dev/full"){o+="bash: echo: write error: No space left on device\n",a=1;return[3,63]}if(!(k==="/dev/null"))return[3,11];o="";return[3,14];case 11:I1=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,I1,k,{checkNoclobber:!0,isClobber:T})];case 12:O1=_state.sent();if(O1){o+=O1,a=1;return[3,63]}return[4,e.fs.writeFile(I1,o,$h(o))];case 13:_state.sent(),o="";_state.label=14;case 14:return[3,63];case 15:C10=(m=S.fd)!=null?m:1;if(!(C10===1))return[3,18];if(k==="/dev/stdout")return[3,63];if(k==="/dev/stderr"){o+=i,i="";return[3,63]}if(k==="/dev/full"){o+="bash: echo: write error: No space left on device\n",a=1,i="";return[3,63]}T1=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,T1,k,{})];case 16:I10=_state.sent();if(I10){o+=I10,a=1,i="";return[3,63]}return[4,e.fs.appendFile(T1,i,l(i))];case 17:_state.sent(),i="";return[3,21];case 18:if(!(C10===2))return[3,21];if(k==="/dev/stderr")return[3,63];if(k==="/dev/stdout"){i+=o,o="";return[3,63]}if(k==="/dev/full"){o+="bash: echo: write error: No space left on device\n",a=1;return[3,63]}T10=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,T10,k,{})];case 19:I11=_state.sent();if(I11){o+=I11,a=1;return[3,63]}return[4,e.fs.appendFile(T10,o,$h(o))];case 20:_state.sent(),o="";_state.label=21;case 21:return[3,63];case 22:C11=(h=S.fd)!=null?h:1;if(k==="-")return[3,63];if(k.endsWith("-")){T11=k.slice(0,-1),I12=Number.parseInt(T11,10);if(!Number.isNaN(I12)){O10=(g=e.state.fileDescriptors)==null?void 0:g.get(I12);O10!==void 0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(C11,O10),I12>=3&&((x=e.state.fileDescriptors)==null||x.delete(I12))):I12===1||I12===2?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(C11,"__dupout__:".concat(I12))):I12===0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(C11,"__dupin__:".concat(I12))):I12>=3&&(o+="bash: ".concat(I12,": Bad file descriptor\n"),a=1)}return[3,63]}if(!(k==="2"||k==="&2"))return[3,23];C11===1&&(o+=i,i="");return[3,56];case 23:if(!(k==="1"||k==="&1"))return[3,24];i+=o,o="";return[3,56];case 24:T12=Number.parseInt(k,10);if(!Number.isNaN(T12))return[3,34];if(!(S.operator===">&"))return[3,33];I13=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,I13,k,{checkNoclobber:!0})];case 25:O11=_state.sent();if(O11){o=O11,a=1,i="";return[3,63]}if(!(S.fd==null))return[3,27];M=i+o;return[4,e.fs.writeFile(I13,M,l(M))];case 26:_state.sent(),i="",o="";return[3,33];case 27:if(!(C11===1))return[3,29];return[4,e.fs.writeFile(I13,i,l(i))];case 28:_tmp=(_state.sent(),i="");return[3,32];case 29:_tmp1=C11===2;if(!_tmp1)return[3,31];return[4,e.fs.writeFile(I13,o,$h(o))];case 30:_tmp1=(_state.sent(),o="");_state.label=31;case 31:_tmp=_tmp1;_state.label=32;case 32:_tmp;_state.label=33;case 33:return[3,56];case 34:I14=(v=e.state.fileDescriptors)==null?void 0:v.get(T12);if(!(I14!=null&&I14.startsWith("__file__:")))return[3,40];O12=I14.slice(9);if(!(C11===1))return[3,36];return[4,e.fs.appendFile(O12,i,l(i))];case 35:_tmp2=(_state.sent(),i="");return[3,39];case 36:_tmp3=C11===2;if(!_tmp3)return[3,38];return[4,e.fs.appendFile(O12,o,$h(o))];case 37:_tmp3=(_state.sent(),o="");_state.label=38;case 38:_tmp2=_tmp3;_state.label=39;case 39:_tmp2;return[3,56];case 40:if(!(I14!=null&&I14.startsWith("__rw__:")))return[3,47];O13=Zvt(I14);_tmp4=O13;if(!_tmp4)return[3,46];if(!(C11===1))return[3,42];return[4,e.fs.appendFile(O13.path,i,l(i))];case 41:_tmp5=(_state.sent(),i="");return[3,45];case 42:_tmp6=C11===2;if(!_tmp6)return[3,44];return[4,e.fs.appendFile(O13.path,o,$h(o))];case 43:_tmp6=(_state.sent(),o="");_state.label=44;case 44:_tmp5=_tmp6;_state.label=45;case 45:_tmp4=_tmp5;_state.label=46;case 46:_tmp4;return[3,56];case 47:if(!(I14!=null&&I14.startsWith("__dupout__:")))return[3,55];O14=Number.parseInt(I14.slice(11),10);if(!(O14!==1))return[3,54];if(!(O14===2))return[3,48];C11===1&&(o+=i,i="");return[3,54];case 48:M1=(y=e.state.fileDescriptors)==null?void 0:y.get(O14);if(!(M1!=null&&M1.startsWith("__file__:")))return[3,54];R=M1.slice(9);if(!(C11===1))return[3,50];return[4,e.fs.appendFile(R,i,l(i))];case 49:_tmp7=(_state.sent(),i="");return[3,53];case 50:_tmp8=C11===2;if(!_tmp8)return[3,52];return[4,e.fs.appendFile(R,o,$h(o))];case 51:_tmp8=(_state.sent(),o="");_state.label=52;case 52:_tmp7=_tmp8;_state.label=53;case 53:_tmp7;_state.label=54;case 54:return[3,56];case 55:I14!=null&&I14.startsWith("__dupin__:")?(o+="bash: ".concat(T12,": Bad file descriptor\n"),a=1,i=""):T12>=3&&(o+="bash: ".concat(T12,": Bad file descriptor\n"),a=1,i="");_state.label=56;case 56:return[3,63];case 57:if(k==="/dev/full"){o="bash: echo: write error: No space left on device\n",a=1,i="";return[3,63]}C12=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,C12,k,{checkNoclobber:!0})];case 58:T13=_state.sent();if(T13){o=T13,a=1,i="";return[3,63]}I15=i+o;return[4,e.fs.writeFile(C12,I15,l(I15))];case 59:_state.sent(),i="",o="";return[3,63];case 60:if(k==="/dev/full"){o="bash: echo: write error: No space left on device\n",a=1,i="";return[3,63]}C13=e.fs.resolvePath(e.state.cwd,k);return[4,q0(e,C13,k,{})];case 61:T14=_state.sent();if(T14){o=T14,a=1,i="";return[3,63]}I16=i+o;return[4,e.fs.appendFile(C13,I16,l(I16))];case 62:_state.sent(),i="",o="";return[3,63];case 63:w++;return[3,1];case 64:c=(_=e.state.fileDescriptors)==null?void 0:_.get(1);if(!c)return[3,69];if(!(c==="__dupout__:2"))return[3,65];o+=i,i="";return[3,69];case 65:if(!c.startsWith("__file__:"))return[3,67];w10=c.slice(9);return[4,e.fs.appendFile(w10,i,l(i))];case 66:_state.sent(),i="";return[3,69];case 67:if(!c.startsWith("__file_append__:"))return[3,69];w11=c.slice(16);return[4,e.fs.appendFile(w11,i,l(i))];case 68:_state.sent(),i="";_state.label=69;case 69:d=(b=e.state.fileDescriptors)==null?void 0:b.get(2);if(!d)return[3,74];if(!(d==="__dupout__:1"))return[3,70];i+=o,o="";return[3,74];case 70:if(!d.startsWith("__file__:"))return[3,72];w12=d.slice(9);return[4,e.fs.appendFile(w12,o,$h(o))];case 71:_state.sent(),o="";return[3,74];case 72:if(!d.startsWith("__file_append__:"))return[3,74];w13=d.slice(16);return[4,e.fs.appendFile(w13,o,$h(o))];case 73:_state.sent(),o="";_state.label=74;case 74:u=ft(i,o,a);return[2,(t.stdoutKind&&(u.stdoutKind=t.stdoutKind),t.stdoutEncoding==="binary"&&(u.stdoutEncoding="binary"),u)]}})})()}function Jvt(e,t){var n,i;if(e.state.options.posix&&Zke.has(t.name)){var o="bash: line ".concat(e.state.currentLine,": `").concat(t.name,"': is a special builtin\n");throw new Ci(2,"",o)}var r=_object_spread_props(_object_spread({},t),{sourceFile:(i=(n=t.sourceFile)!=null?n:e.state.currentSource)!=null?i:"main"});return e.state.functions.set(t.name,r),di}function Yvt(e,t){return _async_to_generator(function(){var n,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a,_,_10,o10,a9,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];i=_step.value;if(!((i.operator==="<<"||i.operator==="<<-")&&i.target.type==="HereDoc"))return[3,4];o=i.target;return[4,pr(e,o.content)];case 3:a=_state.sent();o.stripTabs&&(a=a.split("\n").map(function(s){return s.replace(/^\t+/,"")}).join("\n")),((n=i.fd)!=null?n:0)===0&&(r=a);return[3,11];case 4:if(!(i.operator==="<<<"&&i.target.type==="Word"))return[3,6];_10=(_="").concat;return[4,pr(e,i.target)];case 5:r=_10.apply(_,[_state.sent(),"\n"]);return[3,11];case 6:if(!(i.operator==="<"&&i.target.type==="Word"))return[3,11];return[4,pr(e,i.target)];case 7:o10=_state.sent(),a9=e.fs.resolvePath(e.state.cwd,o10);_state.label=8;case 8:_state.trys.push([8,10,,11]);return[4,e.fs.readFile(a9)];case 9:r=_state.sent();return[3,11];case 10:s=_state.sent();return[3,11];case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:return[2,r]}})})()}function Jke(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",i=arguments.length>4?arguments[4]:void 0;return _async_to_generator(function(){var c,o,_$d,a,_ref,s,l,_$d1,u,p,d,u10;return _ts_generator(this,function(_state){switch(_state.label){case 0:e.state.callDepth++,e.state.callDepth>e.limits.maxCallDepth&&(e.state.callDepth--,u1("".concat(t.name,": maximum recursion depth (").concat(e.limits.maxCallDepth,") exceeded, increase executionLimits.maxCallDepth"),"recursion")),e.state.funcNameStack||(e.state.funcNameStack=[]),e.state.callLineStack||(e.state.callLineStack=[]),e.state.sourceStack||(e.state.sourceStack=[]),e.state.funcNameStack.unshift(t.name),e.state.callLineStack.unshift(i!=null?i:e.state.currentLine),e.state.sourceStack.unshift((c=t.sourceFile)!=null?c:"main"),e.state.localScopes.push(new Map),e.state.localExportedVars||(e.state.localExportedVars=[]),e.state.localExportedVars.push(new Set);o=new Map;for(_$d=0;_$d<r.length;_$d++)o.set(String(_$d+1),e.state.env.get(String(_$d+1))),e.state.env.set(String(_$d+1),r[_$d]);o.set("@",e.state.env.get("@")),o.set("#",e.state.env.get("#")),e.state.env.set("@",r.join(" ")),e.state.env.set("#",String(r.length));a=function(){var p,m,h,g;var _$d=e.state.localScopes.length-1,u=e.state.localScopes.pop();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(u)try{for(var _iterator=u[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),x=_step_value[0],v=_step_value[1];v===void 0?e.state.env.delete(x):e.state.env.set(x,v)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(Gvt(e,_$d),e.state.fullyUnsetLocals)try{for(var _iterator1=e.state.fullyUnsetLocals.entries()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,2),x10=_step_value1[0],v10=_step_value1[1];v10===_$d&&e.state.fullyUnsetLocals.delete(x10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(e.state.localExportedVars&&e.state.localExportedVars.length>0){var x11=e.state.localExportedVars.pop();var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(x11)try{for(var _iterator2=x11[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var v11=_step2.value;(p=e.state.exportedVars)==null||p.delete(v11)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=o[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var _step_value2=_sliced_to_array(_step3.value,2),x12=_step_value2[0],v12=_step_value2[1];v12===void 0?e.state.env.delete(x12):e.state.env.set(x12,v12)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}(m=e.state.funcNameStack)==null||m.shift(),(h=e.state.callLineStack)==null||h.shift(),(g=e.state.sourceStack)==null||g.shift(),e.state.callDepth--};return[4,Kvt(e,t.redirections)];case 1:_ref=_state.sent(),s=_ref.targets,l=_ref.error;if(l)return[2,(a(),ft("",l,1))];_state.label=2;case 2:_state.trys.push([2,5,,6]);return[4,Yvt(e,t.redirections)];case 3:_$d1=_state.sent(),u=n||_$d1;return[4,e.executeCommand(t.body,u)];case 4:p=_state.sent();return[2,(a(),vo(e,p,t.redirections,s))];case 5:d=_state.sent();if(a(),_instanceof(d,Lf)){u10=ft(d.stdout,d.stderr,d.exitCode);return[2,vo(e,u10,t.redirections,s)]}throw d;case 6:return[2]}})})()}var Yke=["!","[[","]]","case","do","done","elif","else","esac","fi","for","function","if","in","then","time","until","while","{","}"],QV=[".",":","[","alias","bg","bind","break","builtin","caller","cd","command","compgen","complete","compopt","continue","declare","dirs","disown","echo","enable","eval","exec","exit","export","false","fc","fg","getopts","hash","help","history","jobs","kill","let","local","logout","mapfile","popd","printf","pushd","pwd","read","readarray","readonly","return","set","shift","shopt","source","suspend","test","times","trap","true","type","typeset","ulimit","umask","unalias","unset","wait"],Xvt=["autocd","assoc_expand_once","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","dotglob","execfail","expand_aliases","extdebug","extglob","extquote","failglob","force_fignore","globasciiranges","globstar","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lastpipe","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","nocaseglob","nocasematch","nullglob","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath","xpg_echo"],e_t=QV;function t_t(e,t){return _async_to_generator(function(){var b,w,r,n,i,o,a,s,l,c,d,u,p,m,h,_$S,k,E,E1,_m1,g,_g1,_$S1,_g2,_$S2,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$S3,_g3,k10,_g4,k11,_g5,k12,_g6,k13,_g7,k14,_g8,k15,_g9,k16,_g10,k17,_g11,k18,_g12,k19,_g13,k20,_g14,k21,err,_$S4,k22,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,E10,S,_$S5,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,k23,x,_$S6,k24,E11,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,T,C,_g15,T1,I,T10,_$S7,k25,E12,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,C1,S10,v,_$S8,k26,y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[],n=null,i="",o="",a=null,s=!1,l=!1,c=!1,d=null,u=null,p=null,m=[],h=["alias","arrayvar","binding","builtin","command","directory","disabled","enabled","export","file","function","group","helptopic","hostname","job","keyword","running","service","setopt","shopt","signal","stopped","user","variable"];for(_$S=0;_$S<t.length;_$S++){k=t[_$S];if(k==="-v")r.push("variable");else if(k==="-e")r.push("export");else if(k==="-f")r.push("file");else if(k==="-d")r.push("directory");else if(k==="-k")r.push("keyword");else if(k==="-A"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -A: option requires an argument\n",2)];E=t[_$S];if(!h.includes(E))return[2,ot("compgen: ".concat(E,": invalid action name\n"),2)];r.push(E)}else if(k==="-W"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -W: option requires an argument\n",2)];n=t[_$S]}else if(k==="-P"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -P: option requires an argument\n",2)];i=t[_$S]}else if(k==="-S"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -S: option requires an argument\n",2)];o=t[_$S]}else if(k==="-o"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -o: option requires an argument\n",2)];E1=t[_$S];if(E1==="plusdirs")s=!0;else if(E1==="dirnames")l=!0;else if(E1==="default")c=!0;else if(!(E1==="filenames"||E1==="nospace"||E1==="bashdefault"||E1==="noquote"))return[2,ot("compgen: ".concat(E1,": invalid option name\n"),2)]}else if(k==="-F"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -F: option requires an argument\n",2)];u=t[_$S]}else if(k==="-C"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -C: option requires an argument\n",2)];p=t[_$S]}else if(k==="-X"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -X: option requires an argument\n",2)];d=t[_$S]}else if(k==="-G"){if(_$S++,_$S>=t.length)return[2,ot("compgen: -G: option requires an argument\n",2)]}else if(k==="--"){;(_m1=m).push.apply(_m1,_to_consumable_array(t.slice(_$S+1)));break}else k.startsWith("-")||m.push(k)}a=(b=m[0])!=null?b:null;g=[];if(!l)return[3,2];return[4,Hq(e,a)];case 1:_$S1=_state.sent();(_g1=g).push.apply(_g1,_to_consumable_array(_$S1));_state.label=2;case 2:if(!c)return[3,4];return[4,ube(e,a)];case 3:_$S2=_state.sent();(_g2=g).push.apply(_g2,_to_consumable_array(_$S2));_state.label=4;case 4:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,23,24,25]);_iterator=r[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,22];_$S3=_step.value;if(!(_$S3==="variable"))return[3,7];k10=r_t(e,a);(_g3=g).push.apply(_g3,_to_consumable_array(k10));return[3,21];case 7:if(!(_$S3==="export"))return[3,8];k11=n_t(e,a);(_g4=g).push.apply(_g4,_to_consumable_array(k11));return[3,21];case 8:if(!(_$S3==="function"))return[3,9];k12=i_t(e,a);(_g5=g).push.apply(_g5,_to_consumable_array(k12));return[3,21];case 9:if(!(_$S3==="builtin"))return[3,10];k13=o_t(a);(_g6=g).push.apply(_g6,_to_consumable_array(k13));return[3,21];case 10:if(!(_$S3==="keyword"))return[3,11];k14=a_t(a);(_g7=g).push.apply(_g7,_to_consumable_array(k14));return[3,21];case 11:if(!(_$S3==="alias"))return[3,12];k15=s_t(e,a);(_g8=g).push.apply(_g8,_to_consumable_array(k15));return[3,21];case 12:if(!(_$S3==="shopt"))return[3,13];k16=l_t(a);(_g9=g).push.apply(_g9,_to_consumable_array(k16));return[3,21];case 13:if(!(_$S3==="helptopic"))return[3,14];k17=u_t(a);(_g10=g).push.apply(_g10,_to_consumable_array(k17));return[3,21];case 14:if(!(_$S3==="directory"))return[3,16];return[4,Hq(e,a)];case 15:k18=_state.sent();(_g11=g).push.apply(_g11,_to_consumable_array(k18));return[3,21];case 16:if(!(_$S3==="file"))return[3,18];return[4,ube(e,a)];case 17:k19=_state.sent();(_g12=g).push.apply(_g12,_to_consumable_array(k19));return[3,21];case 18:if(!(_$S3==="user"))return[3,19];k20=c_t(a);(_g13=g).push.apply(_g13,_to_consumable_array(k20));return[3,21];case 19:if(!(_$S3==="command"))return[3,21];return[4,d_t(e,a)];case 20:k21=_state.sent();(_g14=g).push.apply(_g14,_to_consumable_array(k21));_state.label=21;case 21:_iteratorNormalCompletion=true;return[3,6];case 22:return[3,25];case 23:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,25];case 24:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 25:if(!(n!==null))return[3,29];_state.label=26;case 26:_state.trys.push([26,28,,29]);return[4,p_t(e,n)];case 27:_$S4=_state.sent(),k22=f_t(e,_$S4);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=k22[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){E10=_step1.value;(a===null||E10.startsWith(a))&&g.push(E10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[3,29];case 28:S=_state.sent();return[2,ft("","",1)];case 29:if(!s)return[3,31];return[4,Hq(e,a)];case 30:_$S5=_state.sent();_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=_$S5[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){k23=_step2.value;g.includes(k23)||g.push(k23)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_state.label=31;case 31:x="";if(!(u!==null))return[3,36];_$S6=e.state.functions.get(u);if(!_$S6)return[3,36];k24=new Map;k24.set("COMP_WORDS__length",e.state.env.get("COMP_WORDS__length")),e.state.env.set("COMP_WORDS__length","0"),k24.set("COMP_CWORD",e.state.env.get("COMP_CWORD")),e.state.env.set("COMP_CWORD","-1"),k24.set("COMP_LINE",e.state.env.get("COMP_LINE")),e.state.env.set("COMP_LINE",""),k24.set("COMP_POINT",e.state.env.get("COMP_POINT")),e.state.env.set("COMP_POINT","0");E11=new Map;_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){T=_step3.value;(T==="COMPREPLY"||T.startsWith("COMPREPLY_")||T==="COMPREPLY__length")&&(E11.set(T,e.state.env.get(T)),e.state.env.delete(T))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}C=["compgen",(w=m[0])!=null?w:"",""];_state.label=32;case 32:_state.trys.push([32,34,,35]);return[4,Jke(e,_$S6,C,"")];case 33:T1=_state.sent();if(T1.exitCode!==0)return[2,(Zv(e,k24),Zv(e,E11),ft("",T1.stderr,1))];x=T1.stdout;I=m_t(e);(_g15=g).push.apply(_g15,_to_consumable_array(I));return[3,35];case 34:T10=_state.sent();return[2,(Zv(e,k24),Zv(e,E11),ft("","",1))];case 35:Zv(e,k24),Zv(e,E11);_state.label=36;case 36:if(!(p!==null))return[3,40];_state.label=37;case 37:_state.trys.push([37,39,,40]);_$S7=c_(p);return[4,e.executeScript(_$S7)];case 38:k25=_state.sent();if(k25.exitCode!==0)return[2,ft("",k25.stderr,k25.exitCode)];if(k25.stdout){E12=k25.stdout.split("\n");_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=E12[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){C1=_step4.value;C1.length>0&&g.push(C1)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}return[3,40];case 39:S10=_state.sent();if(S10.name==="ParseException")return[2,ot("compgen: -C: ".concat(S10.message,"\n"),2)];throw S10;case 40:v=g;if(d!==null){_$S8=d.startsWith("!"),k26=_$S8?d.slice(1):d;v=g.filter(function(E){var C=ZV(E,k26,!1,!0);return _$S8?C:!C})}if(v.length===0&&a!==null)return[2,ft(x,"",1)];y=v.map(function(S){return"".concat(i).concat(S).concat(o)}).join("\n"),_=x+(y?"".concat(y,"\n"):"");return[2,Un(_)]}})})()}function r_t(e,t){var r=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(i)||i.endsWith("__length"))continue;var o=i.split("_")[0];/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(i)?r.add(i):o&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(o)&&e.state.env.has("".concat(o,"__length"))&&r.add(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=Array.from(r);return t!==null&&(n=n.filter(function(i){return i.startsWith(t)})),n.sort()}function n_t(e,t){var i;var r=(i=e.state.exportedVars)!=null?i:new Set,n=Array.from(r);return t!==null&&(n=n.filter(function(o){return o.startsWith(t)})),n=n.filter(function(o){return o.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(o)||o.endsWith("__length")?!1:e.state.env.has(o)}),n.sort()}function i_t(e,t){var r=Array.from(e.state.functions.keys());return t!==null&&(r=r.filter(function(n){return n.startsWith(t)})),r.sort()}function o_t(e){var t=_to_consumable_array(QV);return e!==null&&(t=t.filter(function(r){return r.startsWith(e)})),t.sort()}function a_t(e){var t=_to_consumable_array(Yke);return e!==null&&(t=t.filter(function(r){return r.startsWith(e)})),t.sort()}function s_t(e,t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.startsWith("BASH_ALIAS_")){var o=i.slice(11);r.push(o)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=r;return t!==null&&(n=n.filter(function(i){return i.startsWith(t)})),n.sort()}function l_t(e){var t=_to_consumable_array(Xvt);return e!==null&&(t=t.filter(function(r){return r.startsWith(e)})),t.sort()}function u_t(e){var t=_to_consumable_array(e_t);return e!==null&&(t=t.filter(function(r){return r.startsWith(e)})),t.sort()}function Hq(e,t){return _async_to_generator(function(){var r,n,i,a,s,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a9,s10,l,c,l10,err,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];_state.label=1;case 1:_state.trys.push([1,13,,14]);n=e.state.cwd,i=t!=null?t:"";if(t){a=t.lastIndexOf("/");if(a!==-1){s=t.slice(0,a)||"/";i=t.slice(a+1),s.startsWith("/")?n=s:n="".concat(e.state.cwd,"/").concat(s)}}return[4,e.fs.readdir(n)];case 2:o=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,10,11,12]);_iterator=o[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];a9=_step.value;s10="".concat(n,"/").concat(a9);_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,e.fs.stat(s10)];case 6:if(_state.sent().isDirectory&&(!i||a9.startsWith(i)))if(t!=null&&t.includes("/")){l=t.lastIndexOf("/"),c=t.slice(0,l+1);r.push(c+a9)}else r.push(a9);return[3,8];case 7:l10=_state.sent();return[3,8];case 8:_iteratorNormalCompletion=true;return[3,4];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[3,14];case 13:n10=_state.sent();return[3,14];case 14:return[2,r.sort()]}})})()}function ube(e,t){return _async_to_generator(function(){var r,n,i,a,s,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a9,s10,l,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];_state.label=1;case 1:_state.trys.push([1,3,,4]);n=e.state.cwd,i=t!=null?t:"";if(t){a=t.lastIndexOf("/");if(a!==-1){s=t.slice(0,a)||"/";i=t.slice(a+1),s.startsWith("/")?n=s:n="".concat(e.state.cwd,"/").concat(s)}}return[4,e.fs.readdir(n)];case 2:o=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=o[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){a9=_step.value;if(!i||a9.startsWith(i))if(t!=null&&t.includes("/")){s10=t.lastIndexOf("/"),l=t.slice(0,s10+1);r.push(l+a9)}else r.push(a9)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,4];case 3:n10=_state.sent();return[3,4];case 4:return[2,r.sort()]}})})()}function c_t(e){return["root","nobody"]}function d_t(e,t){return _async_to_generator(function(){var o,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,a9,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,a10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,a11,n,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,a12,s,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,l,s10,err,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Set;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=QV[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){a=_step.value;r.add(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=e.state.functions.keys()[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){a9=_step1.value;r.add(a9)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){a10=_step2.value;a10.startsWith("BASH_ALIAS_")&&r.add(a10.slice(11))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=Yke[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){a11=_step3.value;r.add(a11)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}n=(o=e.state.env.get("PATH"))!=null?o:"/usr/bin:/bin";_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator4=n.split(":")[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done))return[3,7];a12=_step4.value;if(!a12)return[3,6];_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,e.fs.readdir(a12)];case 4:s=_state.sent();_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator5=s[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){l=_step5.value;r.add(l)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}return[3,6];case 5:s10=_state.sent();return[3,6];case 6:_iteratorNormalCompletion4=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError4=true;_iteratorError4=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}return[7];case 10:i=Array.from(r);return[2,(t!==null&&(i=i.filter(function(a){return a.startsWith(t)})),i.sort())]}})})()}function p_t(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Pn().parseWordFromString(t,!1,!1);return[4,pr(e,r)];case 1:return[2,_state.sent()]}})})()}function f_t(e,t){var s;var r=(s=e.state.env.get("IFS"))!=null?s:" \n";if(r.length===0)return[t];var n=new Set(r.split("")),i=[],o="",a=0;for(;a<t.length;){var l=t[a];if(l==="\\"&&a+1<t.length){var c=t[a+1];o+=c,a+=2}else n.has(l)?(o.length>0&&(i.push(o),o=""),a++):(o+=l,a++)}return o.length>0&&i.push(o),i}function Zv(e,t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];n===void 0?e.state.env.delete(r):e.state.env.set(r,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function m_t(e){var t=[];if(e.state.env.get("COMPREPLY__length")!==void 0){var r=zr(e,"COMPREPLY");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[1];t.push(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else{var r10=e.state.env.get("COMPREPLY");r10!==void 0&&t.push(r10)}return t}var h_t=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function g_t(e,t){e.state.completionSpecs||(e.state.completionSpecs=new Map);var r=!1,n=!1,i=!1,o,a,s,l=[],c=[],d=[];for(var u=0;u<t.length;u++){var p=t[u];if(p==="-p")r=!0;else if(p==="-r")n=!0;else if(p==="-D")i=!0;else if(p==="-W"){if(u++,u>=t.length)return ot("complete: -W: option requires an argument\n",2);o=t[u]}else if(p==="-F"){if(u++,u>=t.length)return ot("complete: -F: option requires an argument\n",2);a=t[u]}else if(p==="-o"){if(u++,u>=t.length)return ot("complete: -o: option requires an argument\n",2);var m=t[u];if(!h_t.includes(m))return ot("complete: ".concat(m,": invalid option name\n"),2);l.push(m)}else if(p==="-A"){if(u++,u>=t.length)return ot("complete: -A: option requires an argument\n",2);c.push(t[u])}else if(p==="-C"){if(u++,u>=t.length)return ot("complete: -C: option requires an argument\n",2);s=t[u]}else if(p==="-G"){if(u++,u>=t.length)return ot("complete: -G: option requires an argument\n",2)}else if(p==="-P"){if(u++,u>=t.length)return ot("complete: -P: option requires an argument\n",2)}else if(p==="-S"){if(u++,u>=t.length)return ot("complete: -S: option requires an argument\n",2)}else if(p==="-X"){if(u++,u>=t.length)return ot("complete: -X: option requires an argument\n",2)}else if(p==="--"){var _d1;(_d1=d).push.apply(_d1,_to_consumable_array(t.slice(u+1)));break}else p.startsWith("-")||d.push(p)}if(n){if(d.length===0)return e.state.completionSpecs.clear(),Un("");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=d[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u10=_step.value;e.state.completionSpecs.delete(u10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Un("")}if(r)return d.length===0?Zq(e):Zq(e,d);if(t.length===0||d.length===0&&!o&&!a&&!s&&l.length===0&&c.length===0&&!i)return Zq(e);if(a&&d.length===0&&!i)return ot("complete: -F: option requires a command name\n",2);if(i){var u11={isDefault:!0};return o!==void 0&&(u11.wordlist=o),a!==void 0&&(u11.function=a),s!==void 0&&(u11.command=s),l.length>0&&(u11.options=l),c.length>0&&(u11.actions=c),e.state.completionSpecs.set("__default__",u11),Un("")}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=d[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u12=_step1.value;var p10=Object.create(null);o!==void 0&&(p10.wordlist=o),a!==void 0&&(p10.function=a),s!==void 0&&(p10.command=s),l.length>0&&(p10.options=l),c.length>0&&(p10.actions=c),e.state.completionSpecs.set(u12,p10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return Un("")}function Zq(e,t){var r=e.state.completionSpecs;if(!r||r.size===0){if(t&&t.length>0){var o="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;o+="complete: ".concat(a,": no completion specification\n")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return ft("",o,1)}return Un("")}var n=[],i=t||Array.from(r.keys());var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=i[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o10=_step1.value;if(o10==="__default__")continue;var a9=r.get(o10);if(!a9){if(t)return ft(n.join("\n")+(n.length>0?"\n":""),"complete: ".concat(o10,": no completion specification\n"),1);continue}var s="complete";var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(a9.options)try{for(var _iterator2=a9.options[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var l=_step2.value;s+=" -o ".concat(l)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(a9.actions)try{for(var _iterator3=a9.actions[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var l10=_step3.value;s+=" -A ".concat(l10)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}a9.wordlist!==void 0&&(a9.wordlist.includes(" ")||a9.wordlist.includes("'")?s+=" -W '".concat(a9.wordlist,"'"):s+=" -W ".concat(a9.wordlist)),a9.function!==void 0&&(s+=" -F ".concat(a9.function)),a9.isDefault&&(s+=" -D"),s+=" ".concat(o10),n.push(s)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return n.length===0?Un(""):Un("".concat(n.join("\n"),"\n"))}var cbe=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function x_t(e,t){var s,l,c,d,u,p;e.state.completionSpecs||(e.state.completionSpecs=new Map);var r=!1,n=!1,i=[],o=[],a=[];for(var m=0;m<t.length;m++){var h=t[m];if(h==="-D")r=!0;else if(h==="-E")n=!0;else if(h==="-o"){if(m++,m>=t.length)return ot("compopt: -o: option requires an argument\n",2);var g=t[m];if(!cbe.includes(g))return ot("compopt: ".concat(g,": invalid option name\n"),2);i.push(g)}else if(h==="+o"){if(m++,m>=t.length)return ot("compopt: +o: option requires an argument\n",2);var g10=t[m];if(!cbe.includes(g10))return ot("compopt: ".concat(g10,": invalid option name\n"),2);o.push(g10)}else if(h==="--"){var _a1;(_a1=a).push.apply(_a1,_to_consumable_array(t.slice(m+1)));break}else!h.startsWith("-")&&!h.startsWith("+")&&a.push(h)}if(r){var m10=(s=e.state.completionSpecs.get("__default__"))!=null?s:{isDefault:!0},h10=new Set((l=m10.options)!=null?l:[]);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g11=_step.value;h10.add(g11)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=o[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g12=_step1.value;h10.delete(g12)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return m10.options=h10.size>0?Array.from(h10):void 0,e.state.completionSpecs.set("__default__",m10),Un("")}if(n){var m11=(c=e.state.completionSpecs.get("__empty__"))!=null?c:{},h11=new Set((d=m11.options)!=null?d:[]);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=i[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var g13=_step2.value;h11.add(g13)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=o[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var g14=_step3.value;h11.delete(g14)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return m11.options=h11.size>0?Array.from(h11):void 0,e.state.completionSpecs.set("__empty__",m11),Un("")}if(a.length>0){var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=a[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var m12=_step4.value;var h12=(u=e.state.completionSpecs.get(m12))!=null?u:{},g15=new Set((p=h12.options)!=null?p:[]);var _iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(var _iterator5=i[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var x=_step5.value;g15.add(x)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}var _iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(var _iterator6=o[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){var x10=_step6.value;g15.delete(x10)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}h12.options=g15.size>0?Array.from(g15):void 0,e.state.completionSpecs.set(m12,h12)}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return Un("")}return ot("compopt: not currently executing completion function\n",1)}jr();function y_t(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new o5;return di}if(t.length>1)throw new Ci(1,"","bash: continue: too many arguments\n");var r=1;if(t.length>0){var n=Number.parseInt(t[0],10);if(Number.isNaN(n)||n<1)throw new Ci(1,"","bash: continue: ".concat(t[0],": numeric argument required\n"));r=n}throw new Df(r)}Ns();jo();kl();nd();_p();f1();function sa(e,t){var r=e.state.env.get("HOME")||"/home/user";return t.split(":").map(function(n){return n==="~"?r:n==="~root"?"/root":n.startsWith("~/")?r+n.slice(1):n.startsWith("~root/")?"/root".concat(n.slice(5)):n}).join(":")}nd();_p();function JV(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<32||r===127)return!0}return!1}function YV(e){var t="$'";for(var r=0;r<e.length;r++){var n=e[r],i=e.charCodeAt(r);i===7?t+="\\a":i===8?t+="\\b":i===9?t+="\\t":i===10?t+="\\n":i===11?t+="\\v":i===12?t+="\\f":i===13?t+="\\r":i===27?t+="\\e":i===39?t+="\\'":i===92?t+="\\\\":i<32||i===127?t+="\\".concat(i.toString(8).padStart(3,"0")):t+=n}return t+="'",t}function Xke(e){return JV(e)?YV(e):/^[a-zA-Z0-9_/.:\-@%+,=]*$/.test(e)?e:"'".concat(e.replace(/'/g,"'\\''"),"'")}function p5(e){return JV(e)?YV(e):'"'.concat(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),'"')}function e7e(e){return JV(e)?YV(e):'"'.concat(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),'"')}function t7e(e,t){var n,i,o,a,s;var r="";return(n=e.state.integerVars)!=null&&n.has(t)&&(r+="i"),(i=e.state.lowercaseVars)!=null&&i.has(t)&&(r+="l"),no(e,t)&&(r+="n"),(o=e.state.readonlyVars)!=null&&o.has(t)&&(r+="r"),(a=e.state.uppercaseVars)!=null&&a.has(t)&&(r+="u"),(s=e.state.exportedVars)!=null&&s.has(t)&&(r+="x"),r===""?"--":"-".concat(r)}function XV(e){return e===""?"''":/[\s'\\]/.test(e)?"'".concat(e.replace(/'/g,"'\\''"),"'"):e}function v_t(e,t){var o,a,s;var r="",n="",i=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var l=_step.value;var c=t7e(e,l);if((o=e.state.associativeArrays)!=null&&o.has(l)){var p=p1(e,l);if(p.length===0)r+="declare -A ".concat(l,"=()\n");else{var m=p.map(function(h){var v;var g=(v=e.state.env.get("".concat(l,"_").concat(h)))!=null?v:"",x=XV(g);return"['".concat(h,"']=").concat(x)});r+="declare -A ".concat(l,"=(").concat(m.join(" "),")\n")}return"continue"}var d=Os(e,l);if(d.length>0){var p10=d.map(function(m){var g;var h=(g=e.state.env.get("".concat(l,"_").concat(m)))!=null?g:"";return"[".concat(m,"]=").concat(p5(h))});r+="declare -a ".concat(l,"=(").concat(p10.join(" "),")\n");return"continue"}if(e.state.env.has("".concat(l,"__length"))){r+="declare -a ".concat(l,"=()\n");return"continue"}var u=e.state.env.get(l);if(u!==void 0)r+="declare ".concat(c," ").concat(l,"=").concat(e7e(u),"\n");else{var p11=(a=e.state.declaredVars)==null?void 0:a.has(l),m10=(s=e.state.localVarDepth)==null?void 0:s.has(l);p11||m10?r+="declare ".concat(c," ").concat(l,"\n"):(n+="bash: declare: ".concat(l,": not found\n"),i=!0)}};for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return ft(r,n,i?1:0)}function __t(e,t){var u,p,m,h;var r=t.filterExport,n=t.filterReadonly,i=t.filterNameref,o=t.filterIndexedArray,a=t.filterAssocArray,s=r||n||i||o||a,l="",c=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;if(g.startsWith("BASH_"))continue;if(g.endsWith("__length")){var v=g.slice(0,-8);c.add(v);continue}var x=g.lastIndexOf("_");if(x>0){var v10=g.slice(0,x),y=g.slice(x+1);if(/^\d+$/.test(y)||(u=e.state.associativeArrays)!=null&&u.has(v10)){c.add(v10);continue}}c.add(g)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(e.state.localVarDepth)try{for(var _iterator1=e.state.localVarDepth.keys()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g10=_step1.value;c.add(g10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(e.state.associativeArrays)try{for(var _iterator2=e.state.associativeArrays[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var g11=_step2.value;c.add(g11)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var d=Array.from(c).sort();var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{var _loop=function(){var g=_step3.value;var x=t7e(e,g),v=(p=e.state.associativeArrays)==null?void 0:p.has(g),y=Os(e,g),_=!v&&(y.length>0||e.state.env.has("".concat(g,"__length")));if(s&&(a&&!v||o&&!_||r&&!((m=e.state.exportedVars)!=null&&m.has(g))||n&&!((h=e.state.readonlyVars)!=null&&h.has(g))||i&&!no(e,g)))return"continue";if(v){var w=p1(e,g);if(w.length===0)l+="declare -A ".concat(g,"=()\n");else{var S=w.map(function(k){var T;var E=(T=e.state.env.get("".concat(g,"_").concat(k)))!=null?T:"",C=XV(E);return"['".concat(k,"']=").concat(C)});l+="declare -A ".concat(g,"=(").concat(S.join(" "),")\n")}return"continue"}if(y.length>0){var w10=y.map(function(S){var E;var k=(E=e.state.env.get("".concat(g,"_").concat(S)))!=null?E:"";return"[".concat(S,"]=").concat(p5(k))});l+="declare -a ".concat(g,"=(").concat(w10.join(" "),")\n");return"continue"}if(e.state.env.has("".concat(g,"__length"))){l+="declare -a ".concat(g,"=()\n");return"continue"}var b=e.state.env.get(g);b!==void 0&&(l+="declare ".concat(x," ").concat(g,"=").concat(e7e(b),"\n"))};for(var _iterator3=d[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true)_loop()}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return Un(l)}function b_t(e){var n;var t="",r=Array.from((n=e.state.associativeArrays)!=null?n:[]).sort();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var i=_step.value;var o=p1(e,i);if(o.length===0)t+="declare -A ".concat(i,"=()\n");else{var a=o.map(function(s){var d;var l=(d=e.state.env.get("".concat(i,"_").concat(s)))!=null?d:"",c=XV(l);return"['".concat(s,"']=").concat(c)});t+="declare -A ".concat(i,"=(").concat(a.join(" "),")\n")}};for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Un(t)}function w_t(e){var i,o;var t="",r=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(a.startsWith("BASH_"))continue;if(a.endsWith("__length")){var l=a.slice(0,-8);(i=e.state.associativeArrays)!=null&&i.has(l)||r.add(l);continue}var s=a.lastIndexOf("_");if(s>0){var l10=a.slice(0,s),c=a.slice(s+1);/^\d+$/.test(c)&&((o=e.state.associativeArrays)!=null&&o.has(l10)||r.add(l10))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=Array.from(r).sort();var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{var _loop=function(){var a=_step1.value;var s=Os(e,a);if(s.length===0)t+="declare -a ".concat(a,"=()\n");else{var l=s.map(function(c){var u;var d=(u=e.state.env.get("".concat(a,"_").concat(c)))!=null?u:"";return"[".concat(c,"]=").concat(p5(d))});t+="declare -a ".concat(a,"=(").concat(l.join(" "),")\n")}};for(var _iterator1=n[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true)_loop()}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return Un(t)}function S_t(e){var i,o;var t="",r=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(a.startsWith("BASH_"))continue;if(a.endsWith("__length")){var l=a.slice(0,-8);r.add(l);continue}var s=a.lastIndexOf("_");if(s>0){var l10=a.slice(0,s),c=a.slice(s+1);if(/^\d+$/.test(c)||(i=e.state.associativeArrays)!=null&&i.has(l10)){r.add(l10);continue}}r.add(a)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=Array.from(r).sort();var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=n[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var a9=_step1.value;if((o=e.state.associativeArrays)!=null&&o.has(a9)||Os(e,a9).length>0||e.state.env.has("".concat(a9,"__length")))continue;var s10=e.state.env.get(a9);s10!==void 0&&(t+="".concat(a9,"=").concat(Xke(s10),"\n"))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return Un(t)}function Kq(e,t){var r,n;(n=(r=e.state).integerVars)!=null||(r.integerVars=new Set),e.state.integerVars.add(t)}function QW(e,t){var r,n;return(n=(r=e.state.integerVars)==null?void 0:r.has(t))!=null?n:!1}function Qq(e,t){var r,n,i;(n=(r=e.state).lowercaseVars)!=null||(r.lowercaseVars=new Set),e.state.lowercaseVars.add(t),(i=e.state.uppercaseVars)==null||i.delete(t)}function k_t(e,t){var r,n;return(n=(r=e.state.lowercaseVars)==null?void 0:r.has(t))!=null?n:!1}function Jq(e,t){var r,n,i;(n=(r=e.state).uppercaseVars)!=null||(r.uppercaseVars=new Set),e.state.uppercaseVars.add(t),(i=e.state.lowercaseVars)==null||i.delete(t)}function C_t(e,t){var r,n;return(n=(r=e.state.uppercaseVars)==null?void 0:r.has(t))!=null?n:!1}function k9(e,t,r){return k_t(e,t)?r.toLowerCase():C_t(e,t)?r.toUpperCase():r}function dbe(e,t){return _async_to_generator(function(){var r,n,i,r10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);r=new Pn,n=Ki(r,t);return[4,Xt(e,n.expression)];case 1:i=_state.sent();return[2,String(i)];case 2:r10=_state.sent();return[2,"0"];case 3:return[2]}})})()}function E_t(e){var t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return null;var r=t[0],n=r.length;if(e[n]!=="[")return null;var i=0,o=n+1;for(;n<e.length;n++)if(e[n]==="[")i++;else if(e[n]==="]"&&(i--,i===0))break;if(i!==0)return null;var a=e.slice(o,n);if(n++,e[n]!=="=")return null;n++;var s=e.slice(n);return{name:r,indexExpr:a,value:s}}function T_t(e,t){return _async_to_generator(function(){var E,C,T,I,O,M,R,$,z,D,L,ee,pe,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,N,U,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_v1,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,G,_iterator1,_step1,G5,y,_,b,w,G10,K,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,me,N10,U1,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,G11,U10,G12,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,K10,N11,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,U11,S,k,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_loop,_iterator6,_step6,_ret,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=!1,n=!1,i=!1,o=!1,a=!1,s=!1,l=!1,c=!1,d=!1,u=!1,p=!1,m=!1,h=!1,g=!1,x=!1,v=[];for(N=0;N<t.length;N++){U=t[N];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(U==="-a")r=!0;else if(U==="-A")n=!0;else if(U==="-r")i=!0;else if(U==="-x")o=!0;else if(U==="-p")a=!0;else if(U==="-n")s=!0;else if(U==="+n")l=!0;else if(U==="+a")c=!0;else if(U==="+x")d=!0;else if(U==="--"){;(_v1=v).push.apply(_v1,_to_consumable_array(t.slice(N+1)));break}else if(U.startsWith("+")){_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=U.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){G=_step.value;if(G==="n")l=!0;else if(G==="a")c=!0;else if(G==="x")d=!0;else if(G!=="r"&&G!=="i"&&!(G==="f"||G==="F"))return[2,ft("","bash: typeset: +".concat(G,": invalid option\n"),2)]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else if(U==="-i")u=!0;else if(U==="-l")p=!0;else if(U==="-u")m=!0;else if(U==="-f")h=!0;else if(U==="-F")g=!0;else if(U==="-g")x=!0;else if(U.startsWith("-"))try{for(_iterator1=U.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){G5=_step1.value;if(G5==="a")r=!0;else if(G5==="A")n=!0;else if(G5==="r")i=!0;else if(G5==="x")o=!0;else if(G5==="p")a=!0;else if(G5==="n")s=!0;else if(G5==="i")u=!0;else if(G5==="l")p=!0;else if(G5==="u")m=!0;else if(G5==="f")h=!0;else if(G5==="F")g=!0;else if(G5==="g")x=!0;else return[2,ft("","bash: typeset: -".concat(G5,": invalid option\n"),2)]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else v.push(U)}y=e.state.localScopes.length>0&&!x,_=function(N){if(!y)return;var U=e.state.localScopes[e.state.localScopes.length-1];U.has(N)||U.set(N,e.state.env.get(N))},b=function(N){if(!y)return;var U=e.state.localScopes[e.state.localScopes.length-1];U.has(N)||U.set(N,e.state.env.get(N));var G="".concat(N,"_");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var me=_step.value;me.startsWith(G)&&!me.includes("__")&&(U.has(me)||U.set(me,e.state.env.get(me)))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var K="".concat(N,"__length");e.state.env.has(K)&&!U.has(K)&&U.set(K,e.state.env.get(K))},w=function(N){y&&r_(e,N)};if(g){if(v.length===0){G10=Array.from(e.state.functions.keys()).sort(),K="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=G10[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){me=_step2.value;K+="declare -f ".concat(me,"\n")}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,Un(K)]}N10=!0,U1="";_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=v[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){G11=_step3.value;e.state.functions.has(G11)?U1+="".concat(G11,"\n"):N10=!1}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[2,ft(U1,"",N10?0:1)]}if(h){if(v.length===0){U10="",G12=Array.from(e.state.functions.keys()).sort();_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=G12[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){K10=_step4.value;U10+="".concat(K10," ()\n{\n # function body\n}\n")}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[2,Un(U10)]}N11=!0;_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator5=v[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){U11=_step5.value;e.state.functions.has(U11)||(N11=!1)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}return[2,ft("","",N11?0:1)]}if(a&&v.length>0)return[2,v_t(e,v)];if(a&&v.length===0)return[2,__t(e,{filterExport:o,filterReadonly:i,filterNameref:s,filterIndexedArray:r,filterAssocArray:n})];if(v.length===0&&n&&!a)return[2,b_t(e)];if(v.length===0&&r&&!a)return[2,w_t(e)];if(v.length===0&&!a)return[2,S_t(e)];S="",k=0;_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var N,U,V,ie,re,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,de,xe,Y,re1,de1,xe1,Y5,re2,de2,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,xe2,Y10,oe,H,J,j,Q,Fe,Q5,oe1,err,de3,V10,V11,G,V12,ie1,re3,de4,xe3,oe2,H5,oe3,H10,Y11,K,V13,ie2,re4,de5,xe4,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value1,Y12,oe4,H11,_Math,xe5,Y13,oe5,J5,H12,me,V14,ie3,re5,de6,xe6,Y14,oe6,xe7,Y15,xe8,V15,ie4,re6,de7,_tmp,xe9,V16,re7,ie5;return _ts_generator(this,function(_state){switch(_state.label){case 0:N=_step6.value;U=N.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)=\\((.*)\\)$","s"));if(!(U&&!c))return[3,17];V=U[1],ie=U[2];if(n&&Os(e,V).length>0){S+="bash: declare: ".concat(V,": cannot convert indexed to associative array\n"),k=1;return[2,"continue"]}if((r||!n&&!r)&&(E=e.state.associativeArrays)!=null&&E.has(V)){S+="bash: declare: ".concat(V,": cannot convert associative to indexed array\n"),k=1;return[2,"continue"]}if(!(b(V),n&&((T=(C=e.state).associativeArrays)!=null||(C.associativeArrays=new Set),e.state.associativeArrays.add(V)),o_(e,V),e.state.env.delete(V),e.state.env.delete("".concat(V,"__length")),n&&ie.includes("[")))return[3,1];re=HW(ie);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=re[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),de=_step_value[0],xe=_step_value[1];Y=sa(e,xe);e.state.env.set("".concat(V,"_").concat(de),Y)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,16];case 1:if(!n)return[3,2];re1=t1(ie);for(de1=0;de1<re1.length;de1+=2){xe1=re1[de1],Y5=de1+1<re1.length?sa(e,re1[de1+1]):"";e.state.env.set("".concat(V,"_").concat(xe1),Y5)}return[3,16];case 2:re2=t1(ie);if(!re2.some(function(de){return/^\[[^\]]+\]=/.test(de)}))return[3,15];de2=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=3;case 3:_state.trys.push([3,12,13,14]);_iterator1=re2[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,11];xe2=_step1.value;Y10=xe2.match(/^\[([^\]]+)\]=(.*)$/);if(!Y10)return[3,9];oe=Y10[1],H=Y10[2],J=sa(e,H),j=void 0;if(!/^-?\d+$/.test(oe))return[3,5];j=Number.parseInt(oe,10);return[3,8];case 5:_state.trys.push([5,7,,8]);Q=new Pn,Fe=Ki(Q,oe);return[4,Xt(e,Fe.expression)];case 6:j=_state.sent();return[3,8];case 7:Q5=_state.sent();j=0;return[3,8];case 8:e.state.env.set("".concat(V,"_").concat(j),J),de2=j+1;return[3,10];case 9:oe1=sa(e,xe2);e.state.env.set("".concat(V,"_").concat(de2),oe1),de2++;_state.label=10;case 10:_iteratorNormalCompletion1=true;return[3,4];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 14:return[3,16];case 15:for(de3=0;de3<re2.length;de3++)e.state.env.set("".concat(V,"_").concat(de3),re2[de3]);e.state.env.set("".concat(V,"__length"),String(re2.length));_state.label=16;case 16:w(V),i&&Qu(e,V),o&&Mf(e,V);return[2,"continue"];case 17:if(l){V10=N.includes("=")?N.slice(0,N.indexOf("=")):N;if(dyt(e,V10),!N.includes("="))return[2,"continue"]}if(d){V11=N.includes("=")?N.slice(0,N.indexOf("=")):N;if(Tke(e,V11),!N.includes("="))return[2,"continue"]}G=E_t(N);if(!G)return[3,22];V12=G.name,ie1=G.indexExpr,re3=G.value,de4=Ms(e,V12);if(de4)return[2,{v:de4}];b(V12);xe3=void 0;_state.label=18;case 18:_state.trys.push([18,20,,21]);oe2=new Pn,H5=Ki(oe2,ie1);return[4,Xt(e,H5.expression)];case 19:xe3=_state.sent();return[3,21];case 20:oe3=_state.sent();H10=parseInt(ie1,10);xe3=Number.isNaN(H10)?0:H10;return[3,21];case 21:e.state.env.set("".concat(V12,"_").concat(xe3),re3);Y11=parseInt((I=e.state.env.get("".concat(V12,"__length")))!=null?I:"0",10);xe3>=Y11&&e.state.env.set("".concat(V12,"__length"),String(xe3+1)),w(V12),i&&Qu(e,V12),o&&Mf(e,V12);return[2,"continue"];case 22:K=N.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)\\+=\\((.*)\\)$","s"));if(K&&!c){V13=K[1],ie2=K[2],re4=Ms(e,V13);if(re4)return[2,{v:re4}];b(V13);de5=t1(ie2);if((O=e.state.associativeArrays)!=null&&O.has(V13)){xe4=HW(ie2);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=xe4[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_step_value1=_sliced_to_array(_step2.value,2),Y12=_step_value1[0],oe4=_step_value1[1];H11=sa(e,oe4);e.state.env.set("".concat(V13,"_").concat(Y12),H11)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else{;xe5=Os(e,V13),Y13=0,oe5=e.state.env.get(V13);xe5.length===0&&oe5!==void 0?(e.state.env.set("".concat(V13,"_0"),oe5),e.state.env.delete(V13),Y13=1):xe5.length>0&&(Y13=(_Math=Math).max.apply(_Math,_to_consumable_array(xe5))+1);for(J5=0;J5<de5.length;J5++)e.state.env.set("".concat(V13,"_").concat(Y13+J5),sa(e,de5[J5]));H12=Y13+de5.length;e.state.env.set("".concat(V13,"__length"),String(H12))}w(V13),i&&Qu(e,V13),o&&Mf(e,V13);return[2,"continue"]}me=N.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(!me)return[3,26];V14=me[1],ie3=sa(e,me[2]),re5=Ms(e,V14);if(re5)return[2,{v:re5}];_(V14),u&&Kq(e,V14),p&&Qq(e,V14),m&&Jq(e,V14);de6=Os(e,V14).length>0||((M=e.state.associativeArrays)==null?void 0:M.has(V14));if(!QW(e,V14))return[3,24];xe6=(R=e.state.env.get(V14))!=null?R:"0",Y14=parseInt(xe6,10)||0;return[4,dbe(e,ie3)];case 23:oe6=parseInt.apply(void 0,[_state.sent(),10])||0;ie3=String(Y14+oe6),e.state.env.set(V14,ie3);return[3,25];case 24:if(de6){ie3=k9(e,V14,ie3);xe7="".concat(V14,"_0"),Y15=($=e.state.env.get(xe7))!=null?$:"";e.state.env.set(xe7,Y15+ie3)}else{ie3=k9(e,V14,ie3);xe8=(z=e.state.env.get(V14))!=null?z:"";e.state.env.set(V14,xe8+ie3)}_state.label=25;case 25:w(V14),i&&Qu(e,V14),o&&Mf(e,V14),e.state.options.allexport&&!d&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(V14));return[2,"continue"];case 26:if(!N.includes("="))return[3,29];V15=N.indexOf("="),ie4=N.slice(0,V15),re6=N.slice(V15+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(ie4)){S+="bash: typeset: `".concat(ie4,"': not a valid identifier\n"),k=1;return[2,"continue"]}de7=Ms(e,ie4);if(de7)return[2,{v:de7}];if(_(ie4),s){if(re6!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(re6)){S+="bash: declare: `".concat(re6,"': invalid variable name for name reference\n"),k=1;return[2,"continue"]}e.state.env.set(ie4,re6),J0(e,ie4),re6!==""&&jW(e,re6)&&G_e(e,ie4),w(ie4),i&&Qu(e,ie4),o&&Mf(e,ie4);return[2,"continue"]}u&&Kq(e,ie4),p&&Qq(e,ie4),m&&Jq(e,ie4);_tmp=QW(e,ie4);if(!_tmp)return[3,28];return[4,dbe(e,re6)];case 27:_tmp=re6=_state.sent();_state.label=28;case 28:if(_tmp,re6=k9(e,ie4,re6),no(e,ie4)){xe9=gp(e,ie4);xe9&&xe9!==ie4?e.state.env.set(xe9,re6):e.state.env.set(ie4,re6)}else e.state.env.set(ie4,re6);w(ie4),i&&Qu(e,ie4),o&&Mf(e,ie4),e.state.options.allexport&&!d&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(ie4));return[3,30];case 29:V16=N;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(V16)){S+="bash: typeset: `".concat(V16,"': not a valid identifier\n"),k=1;return[2,"continue"]}if(r||n?b(V16):_(V16),s){J0(e,V16);re7=e.state.env.get(V16);re7!==void 0&&re7!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(re7)?pyt(e,V16):re7&&jW(e,re7)&&G_e(e,V16),w(V16),i&&Qu(e,V16),o&&Mf(e,V16);return[2,"continue"]}if(u&&Kq(e,V16),p&&Qq(e,V16),m&&Jq(e,V16),n){if(Os(e,V16).length>0){S+="bash: declare: ".concat(V16,": cannot convert indexed to associative array\n"),k=1;return[2,"continue"]}(L=(D=e.state).associativeArrays)!=null||(D.associativeArrays=new Set),e.state.associativeArrays.add(V16)}ie5=Array.from(e.state.env.keys()).some(function(re){return re.startsWith("".concat(V16,"_"))&&!re.startsWith("".concat(V16,"__length"))});!e.state.env.has(V16)&&!ie5&&(r||n?e.state.env.set("".concat(V16,"__length"),"0"):((pe=(ee=e.state).declaredVars)!=null||(ee.declaredVars=new Set),e.state.declaredVars.add(V16))),w(V16),i&&Qu(e,V16),o&&Mf(e,V16);_state.label=30;case 30:return[2]}})};_iterator6=v[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=4;case 4:_iteratorNormalCompletion6=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError6=true;_iteratorError6=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}return[7];case 8:return[2,ft("",S,k)]}})})()}function A_t(e,t){return _async_to_generator(function(){var a,s,r,n,i,o,l,c,_o1,l10,c10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,l11,c11,m,h,g,x,v,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value,y,_,b,_Math,v10,y10,_10,w,b10,d10,m10,h10,g10,x10,u10,p10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=!1,n=!1,i=!1,o=[];for(l=0;l<t.length;l++){c=t[l];if(c==="-a")r=!0;else if(c==="-A")n=!0;else if(c==="-p")i=!0;else if(c==="--"){;(_o1=o).push.apply(_o1,_to_consumable_array(t.slice(l+1)));break}else c.startsWith("-")||o.push(c)}if(o.length===0){l10="",c10=Array.from(e.state.readonlyVars||[]).sort();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=c10[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;u=e.state.env.get(d);if(u!==void 0){p=u.replace(/\\/g,"\\\\").replace(/"/g,'\\"');l10+="declare -r ".concat(d,'="').concat(p,'"\n')}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,Un(l10)]}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator1=o[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,5];l11=_step1.value;c11=l11.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)\\+=\\((.*)\\)$","s"));if(c11){m=c11[1],h=c11[2],g=Ms(e,m);if(g)return[2,g];x=t1(h);if((a=e.state.associativeArrays)!=null&&a.has(m)){v=HW(h);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=v[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_step_value=_sliced_to_array(_step2.value,2),y=_step_value[0],_=_step_value[1];b=sa(e,_);e.state.env.set("".concat(m,"_").concat(y),b)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else{;v10=Os(e,m),y10=0,_10=e.state.env.get(m);v10.length===0&&_10!==void 0?(e.state.env.set("".concat(m,"_0"),_10),e.state.env.delete(m),y10=1):v10.length>0&&(y10=(_Math=Math).max.apply(_Math,_to_consumable_array(v10))+1);for(w=0;w<x.length;w++)e.state.env.set("".concat(m,"_").concat(y10+w),sa(e,x[w]));b10=y10+x.length;e.state.env.set("".concat(m,"__length"),String(b10))}Qu(e,m);return[3,4]}d10=l11.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(d10){m10=d10[1],h10=sa(e,d10[2]),g10=Ms(e,m10);if(g10)return[2,g10];x10=(s=e.state.env.get(m10))!=null?s:"";e.state.env.set(m10,x10+h10),Qu(e,m10);return[3,4]}u10=Bvt(l11);if(u10.value===void 0&&!u10.isArray){Qu(e,u10.name);return[3,4]}return[4,Wvt(e,u10,{makeReadonly:!0})];case 3:p10=_state.sent();if(p10)return[2,p10];_state.label=4;case 4:_iteratorNormalCompletion1=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 8:return[2,di]}})})()}function eG(e){var t,r;return(r=(t=e.state).directoryStack)!=null||(t.directoryStack=[]),e.state.directoryStack}function ZS(e,t){return t&&e===t?"~":t&&e.startsWith("".concat(t,"/"))?"~".concat(e.slice(t.length)):e}function I_t(e){var t=e.split("/").filter(function(n){return n&&n!=="."}),r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;n===".."?r.pop():r.push(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"/".concat(r.join("/"))}function P_t(e,t){return _async_to_generator(function(){var r,n,s,l,s10,i,s11,s12,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=eG(e);for(s=0;s<t.length;s++){l=t[s];if(l==="--"){if(s+1<t.length){if(n!==void 0)return[2,ot("bash: pushd: too many arguments\n",2)];n=t[s+1],s++}}else{if(l.startsWith("-")&&l!=="-")return[2,ot("bash: pushd: ".concat(l,": invalid option\n"),2)];if(n!==void 0)return[2,ot("bash: pushd: too many arguments\n",2)];n=l}}if(n===void 0){if(r.length<2)return[2,ot("bash: pushd: no other directory\n",1)];s10=r[0];r[0]=r[1],r[1]=s10,n=r[0]}if(n.startsWith("/"))i=n;else if(n===".."){s11=e.state.cwd.split("/").filter(function(l){return l});s11.pop(),i="/".concat(s11.join("/"))}else n==="."?i=e.state.cwd:n.startsWith("~")?i=(e.state.env.get("HOME")||"/")+n.slice(1):i="".concat(e.state.cwd,"/").concat(n);i=I_t(i);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.stat(i)];case 2:if(!_state.sent().isDirectory)return[2,ot("bash: pushd: ".concat(n,": Not a directory\n"),1)];return[3,4];case 3:s12=_state.sent();return[2,ot("bash: pushd: ".concat(n,": No such file or directory\n"),1)];case 4:r.unshift(e.state.cwd),e.state.previousDir=e.state.cwd,e.state.cwd=i,e.state.env.set("PWD",i),e.state.env.set("OLDPWD",e.state.previousDir);o=e.state.env.get("HOME")||"",a="".concat([i].concat(_to_consumable_array(r)).map(function(s){return ZS(s,o)}).join(" "),"\n");return[2,Un(a)]}})})()}function R_t(e,t){var r=eG(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;if(a!=="--")return a.startsWith("-")&&a!=="-"?ot("bash: popd: ".concat(a,": invalid option\n"),2):ot("bash: popd: too many arguments\n",2)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(r.length===0)return ot("bash: popd: directory stack empty\n",1);var n=r.shift();if(!n)return ot("bash: popd: directory stack empty\n",1);e.state.previousDir=e.state.cwd,e.state.cwd=n,e.state.env.set("PWD",n),e.state.env.set("OLDPWD",e.state.previousDir);var i=e.state.env.get("HOME")||"",o="".concat([n].concat(_to_consumable_array(r)).map(function(a){return ZS(a,i)}).join(" "),"\n");return Un(o)}function M_t(e,t){var r=eG(e),n=!1,i=!1,o=!1,a=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var d=_step.value;if(d!=="--")if(d.startsWith("-"))try{for(var _iterator1=d.slice(1)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var u=_step1.value;if(u==="c")n=!0;else if(u==="l")i=!0;else if(u==="p")o=!0;else if(u==="v")o=!0,a=!0;else return ot("bash: dirs: -".concat(u,": invalid option\n"),2)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else return ot("bash: dirs: too many arguments\n",1)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(n)return e.state.directoryStack=[],di;var s=[e.state.cwd].concat(_to_consumable_array(r)),l=e.state.env.get("HOME")||"",c;return a?(c=s.map(function(d,u){var p=i?d:ZS(d,l);return" ".concat(u," ").concat(p)}).join("\n"),c+="\n"):o?c=s.map(function(d){return i?d:ZS(d,l)}).join("\n")+"\n":c=s.map(function(d){return i?d:ZS(d,l)}).join(" ")+"\n",Un(c)}jo();jr();function pbe(e,t,r){return _async_to_generator(function(){var n,_$s,i,o,a,_$s1,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=t;if(n.length>0){_$s=n[0];if(_$s==="--")n=n.slice(1);else if(_$s.startsWith("-")&&_$s!=="-"&&_$s.length>1)return[2,ot("bash: eval: ".concat(_$s,": invalid option\neval: usage: eval [arg ...]\n"),2)]}if(n.length===0)return[2,di];i=n.join(" ");if(i.trim()==="")return[2,di];o=e.state.groupStdin,a=r!=null?r:e.state.groupStdin;a!==void 0&&(e.state.groupStdin=a);_state.label=1;case 1:_state.trys.push([1,3,4,5]);_$s1=c_(i);return[4,e.executeScript(_$s1)];case 2:return[2,_state.sent()];case 3:s=_state.sent();if(_instanceof(s,Nf)||_instanceof(s,Df)||_instanceof(s,Lf)||_instanceof(s,Ci))throw s;if(s.name==="ParseException")return[2,ot("bash: eval: ".concat(s.message,"\n"))];throw s;case 4:e.state.groupStdin=o;return[7];case 5:return[2]}})})()}jr();function O_t(e,t){var r,n="";if(t.length===0)r=e.state.lastExitCode;else{var i=t[0],o=Number.parseInt(i,10);i===""||Number.isNaN(o)||!/^-?\d+$/.test(i)?(n="bash: exit: ".concat(i,": numeric argument required\n"),r=2):r=(o%256+256)%256}throw new Ci(r,"",n)}f1();function $_t(e,t){var a,s;var r=!1,n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;l==="-n"?r=!0:l==="-p"||l==="--"||n.push(l)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(n.length===0&&!r){var l10="",c=(a=e.state.exportedVars)!=null?a:new Set,d=Array.from(c).sort();var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=d[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var u=_step1.value;var p=e.state.env.get(u);if(p!==void 0){var m=p.replace(/\\/g,"\\\\").replace(/"/g,'\\"');l10+="declare -x ".concat(u,'="').concat(m,'"\n')}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return Un(l10)}if(r){var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=n[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var l11=_step2.value;var c10=void 0,d10=void 0;if(l11.includes("=")){var u10=l11.indexOf("=");c10=l11.slice(0,u10),d10=sa(e,l11.slice(u10+1)),e.state.env.set(c10,d10)}else c10=l11;Tke(e,c10)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return di}var i="",o=0;var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=n[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var l12=_step3.value;var c11=void 0,d11=void 0,u11=!1,p10=l12.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(p10)c11=p10[1],d11=sa(e,p10[2]),u11=!0;else if(l12.includes("=")){var m10=l12.indexOf("=");c11=l12.slice(0,m10),d11=sa(e,l12.slice(m10+1))}else c11=l12;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c11)){i+="bash: export: `".concat(l12,"': not a valid identifier\n"),o=1;continue}if(d11!==void 0)if(u11){var m11=(s=e.state.env.get(c11))!=null?s:"";e.state.env.set(c11,m11+d11)}else e.state.env.set(c11,d11);else e.state.env.has(c11)||e.state.env.set(c11,"");Mf(e,c11)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return ft("",i,o)}function r7e(e,t){if(t.length<2)return ot("bash: getopts: usage: getopts optstring name [arg ...]\n");var r=t[0],n=t[1],i=!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n),o=r.startsWith(":"),a=o?r.slice(1):r,s;if(t.length>2)s=t.slice(2);else{var h=Number.parseInt(e.state.env.get("#")||"0",10);s=[];for(var g=1;g<=h;g++)s.push(e.state.env.get(String(g))||"")}var l=Number.parseInt(e.state.env.get("OPTIND")||"1",10);l<1&&(l=1);var c=Number.parseInt(e.state.env.get("__GETOPTS_CHARINDEX")||"0",10);if(e.state.env.set("OPTARG",""),l>s.length)return i||e.state.env.set(n,"?"),e.state.env.set("OPTIND",String(s.length+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:i?2:1,stdout:"",stderr:""};var d=s[l-1];if(!d||d==="-"||!d.startsWith("-"))return i||e.state.env.set(n,"?"),{exitCode:i?2:1,stdout:"",stderr:""};if(d==="--")return e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),i||e.state.env.set(n,"?"),{exitCode:i?2:1,stdout:"",stderr:""};var u=c===0?1:c,p=d[u];if(!p)return e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),r7e(e,t);var m=a.indexOf(p);if(m===-1){var h10="";return o?e.state.env.set("OPTARG",p):h10="bash: illegal option -- ".concat(p,"\n"),i||e.state.env.set(n,"?"),u+1<d.length?(e.state.env.set("__GETOPTS_CHARINDEX",String(u+1)),e.state.env.set("OPTIND",String(l))):(e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0")),{exitCode:i?2:0,stdout:"",stderr:h10}}if(m+1<a.length&&a[m+1]===":")if(u+1<d.length)e.state.env.set("OPTARG",d.slice(u+1)),e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0");else{if(l>=s.length){var h11="";return o?(e.state.env.set("OPTARG",p),i||e.state.env.set(n,":")):(h11="bash: option requires an argument -- ".concat(p,"\n"),i||e.state.env.set(n,"?")),e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:i?2:0,stdout:"",stderr:h11}}e.state.env.set("OPTARG",s[l]),e.state.env.set("OPTIND",String(l+2)),e.state.env.set("__GETOPTS_CHARINDEX","0")}else u+1<d.length?(e.state.env.set("__GETOPTS_CHARINDEX",String(u+1)),e.state.env.set("OPTIND",String(l))):(e.state.env.set("OPTIND",String(l+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"));return i||e.state.env.set(n,p),{exitCode:i?2:0,stdout:"",stderr:""}}function N_t(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,m,_l1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,h,m10,h10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,g,m11,h11,g10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,x,v,m12,m13,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,_step_value,h12,g11,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,_step_value1,h13,d,u,p,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,m14,h14,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator6,_step6,g12,x10,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:e.state.hashTable||(e.state.hashTable=new Map);r=!1,n=!1,i=!1,o=!1,a=!1,s="",l=[],c=0;for(;c<t.length;){m=t[c];if(m==="--"){;c++,(_l1=l).push.apply(_l1,_to_consumable_array(t.slice(c)));break}if(m==="-r")r=!0,c++;else if(m==="-d")n=!0,c++;else if(m==="-l")i=!0,c++;else if(m==="-t")a=!0,c++;else if(m==="-p"){if(o=!0,c++,c>=t.length)return[2,ot("bash: hash: -p: option requires an argument\n",1)];s=t[c],c++}else if(m.startsWith("-")&&m.length>1){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=m.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){h=_step.value;if(h==="r")r=!0;else if(h==="d")n=!0;else if(h==="l")i=!0;else if(h==="t")a=!0;else return[2,ot(h==="p"?"bash: hash: -p: option requires an argument\n":"bash: hash: -".concat(h,": invalid option\n"),1)]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}c++}else l.push(m),c++}if(r)return[2,(e.state.hashTable.clear(),di)];if(n){if(l.length===0)return[2,ot("bash: hash: -d: option requires an argument\n",1)];m10=!1,h10="";_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=l[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){g=_step1.value;e.state.hashTable.has(g)?e.state.hashTable.delete(g):(h10+="bash: hash: ".concat(g,": not found\n"),m10=!0)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,m10?ot(h10,1):di]}if(a){if(l.length===0)return[2,ot("bash: hash: -t: option requires an argument\n",1)];m11="",h11=!1,g10="";_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=l[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){x=_step2.value;v=e.state.hashTable.get(x);v?l.length>1?m11+="".concat(x," ").concat(v,"\n"):m11+="".concat(v,"\n"):(g10+="bash: hash: ".concat(x,": not found\n"),h11=!0)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,h11?{exitCode:1,stdout:m11,stderr:g10}:Un(m11)]}if(o){if(l.length===0)return[2,ot("bash: hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]\n",1)];m12=l[0];return[2,(e.state.hashTable.set(m12,s),di)]}if(l.length===0){if(e.state.hashTable.size===0)return[2,Un("hash: hash table empty\n")];m13="";_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(i)try{for(_iterator3=e.state.hashTable[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){_step_value=_sliced_to_array(_step3.value,2),h12=_step_value[0],g11=_step_value[1];m13+="builtin hash -p ".concat(g11," ").concat(h12,"\n")}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}else{m13="hits command\n";_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=e.state.hashTable[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){_step_value1=_sliced_to_array(_step4.value,2),h13=_step_value1[1];m13+=" 1 ".concat(h13,"\n")}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}return[2,Un(m13)]}d=!1,u="",p=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator5=l[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done))return[3,12];m14=_step5.value;if(m14.includes("/")){u+="bash: hash: ".concat(m14,": cannot use / in name\n"),d=!0;return[3,11]}h14=!1;_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator6=p[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done))return[3,7];g12=_step6.value;if(!g12)return[3,6];x10="".concat(g12,"/").concat(m14);return[4,e.fs.exists(x10)];case 5:if(_state.sent()){e.state.hashTable.set(m14,x10),h14=!0;return[3,7]}_state.label=6;case 6:_iteratorNormalCompletion6=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError6=true;_iteratorError6=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}return[7];case 10:h14||(u+="bash: hash: ".concat(m14,": not found\n"),d=!0);_state.label=11;case 11:_iteratorNormalCompletion5=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError5=true;_iteratorError5=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}return[7];case 15:return[2,d?ot(u,1):di]}})})()}Ei();var n7e=new Map([[":",[": [arguments]","Null command.\n No effect; the command does nothing.\n Exit Status:\n Always succeeds."]],[".",[". filename [arguments]","Execute commands from a file in the current shell.\n Read and execute commands from FILENAME in the current shell.\n The entries in $PATH are used to find the directory containing FILENAME.\n Exit Status:\n Returns the status of the last command executed in FILENAME."]],["[",["[ arg... ]","Evaluate conditional expression.\n This is a synonym for the \"test\" builtin, but the last argument must\n be a literal `]', to match the opening `['."]],["alias",["alias [-p] [name[=value] ... ]","Define or display aliases.\n Without arguments, `alias' prints the list of aliases in the reusable\n form `alias NAME=VALUE' on standard output.\n Exit Status:\n alias returns true unless a NAME is supplied for which no alias has been\n defined."]],["bg",["bg [job_spec ...]","Move jobs to the background.\n Place the jobs identified by each JOB_SPEC in the background, as if they\n had been started with `&'."]],["break",["break [n]","Exit for, while, or until loops.\n Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n loops.\n Exit Status:\n The exit status is 0 unless N is not greater than or equal to 1."]],["builtin",["builtin [shell-builtin [arg ...]]","Execute shell builtins.\n Execute SHELL-BUILTIN with arguments ARGs without performing command\n lookup. This is useful when you wish to reimplement a shell builtin\n as a shell function, but need to execute the builtin within the function.\n Exit Status:\n Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n not a shell builtin."]],["caller",["caller [expr]",'Return the context of the current subroutine call.\n Without EXPR, returns "$line $filename". With EXPR, returns\n "$line $subroutine $filename"; this extra information can be used to\n provide a stack trace.\n Exit Status:\n Returns 0 unless the shell is not executing a subroutine call or\n EXPR is invalid.']],["cd",["cd [-L|-P] [dir]","Change the shell working directory.\n Change the current directory to DIR. The default DIR is the value of the\n HOME shell variable.\n\n The variable CDPATH defines the search path for the directory containing\n DIR. Alternative directory names in CDPATH are separated by a colon (:).\n A null directory name is the same as the current directory. If DIR begins\n with a slash (/), then CDPATH is not used.\n\n If the directory is not found, and the shell option `cdable_vars' is set,\n the word is assumed to be a variable name. If that variable has a value,\n its value is used for DIR.\n\n Options:\n -L force symbolic links to be followed\n -P use the physical directory structure without following symbolic\n links\n\n The default is to follow symbolic links, as if `-L' were specified.\n\n Exit Status:\n Returns 0 if the directory is changed; non-zero otherwise."]],["command",["command [-pVv] command [arg ...]","Execute a simple command or display information about commands.\n Runs COMMAND with ARGS suppressing shell function lookup, or display\n information about the specified COMMANDs.\n\n Options:\n -p use a default value for PATH that is guaranteed to find all of\n the standard utilities\n -v print a description of COMMAND similar to the `type' builtin\n -V print a more verbose description of each COMMAND\n\n Exit Status:\n Returns exit status of COMMAND, or failure if COMMAND is not found."]],["compgen",["compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]","Display possible completions depending on the options.\n Intended to be used from within a shell function generating possible\n completions. If the optional WORD argument is supplied, matches against\n WORD are generated.\n Exit Status:\n Returns success unless an invalid option is supplied or an error occurs."]],["complete",["complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]","Specify how arguments are to be completed.\n For each NAME, specify how arguments are to be completed.\n Exit Status:\n Returns success unless an invalid option is supplied or an error occurs."]],["continue",["continue [n]","Resume for, while, or until loops.\n Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n If N is specified, resumes the Nth enclosing loop.\n Exit Status:\n The exit status is 0 unless N is not greater than or equal to 1."]],["declare",["declare [-aAfFgilnrtux] [-p] [name[=value] ...]","Set variable values and attributes.\n Declare variables and give them attributes. If no NAMEs are given,\n display the attributes and values of all variables.\n\n Options:\n -a to make NAMEs indexed arrays (if supported)\n -A to make NAMEs associative arrays (if supported)\n -i to make NAMEs have the `integer' attribute\n -l to convert the value of each NAME to lower case on assignment\n -n make NAME a reference to the variable named by its value\n -r to make NAMEs readonly\n -t to make NAMEs have the `trace' attribute\n -u to convert the value of each NAME to upper case on assignment\n -x to make NAMEs export\n\n Exit Status:\n Returns success unless an invalid option is supplied or a variable\n assignment error occurs."]],["dirs",["dirs [-clpv] [+N] [-N]","Display directory stack.\n Display the list of currently remembered directories. Directories\n find their way onto the list with the `pushd' command; you can get\n back up through the list with the `popd' command.\n Exit Status:\n Returns success unless an invalid option is supplied or an error occurs."]],["disown",["disown [-h] [-ar] [jobspec ...]","Remove jobs from current shell.\n Without any JOBSPECs, remove the current job."]],["echo",["echo [-neE] [arg ...]","Write arguments to the standard output.\n Display the ARGs, separated by a single space character and followed by a\n newline, on the standard output.\n\n Options:\n -n do not append a newline\n -e enable interpretation of the following backslash escapes\n -E explicitly suppress interpretation of backslash escapes\n\n Exit Status:\n Returns success unless a write error occurs."]],["enable",["enable [-a] [-dnps] [-f filename] [name ...]","Enable and disable shell builtins.\n Enables and disables builtin shell commands.\n Exit Status:\n Returns success unless NAME is not a shell builtin or an error occurs."]],["eval",["eval [arg ...]","Execute arguments as a shell command.\n Combine ARGs into a single string, use the result as input to the shell,\n and execute the resulting commands.\n Exit Status:\n Returns exit status of command or success if command is null."]],["exec",["exec [-cl] [-a name] [command [arguments ...]] [redirection ...]","Replace the shell with the given command.\n Execute COMMAND, replacing this shell with the specified program.\n ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,\n any redirections take effect in the current shell.\n Exit Status:\n Returns success unless COMMAND is not found or a redirection error occurs."]],["exit",["exit [n]","Exit the shell.\n Exits the shell with a status of N. If N is omitted, the exit status\n is that of the last command executed."]],["export",["export [-fn] [name[=value] ...] or export -p","Set export attribute for shell variables.\n Marks each NAME for automatic export to the environment of subsequently\n executed commands. If VALUE is supplied, assign VALUE before exporting.\n\n Options:\n -f refer to shell functions\n -n remove the export property from each NAME\n -p display a list of all exported variables and functions\n\n Exit Status:\n Returns success unless an invalid option is given or NAME is invalid."]],["false",["false","Return an unsuccessful result.\n Exit Status:\n Always fails."]],["fc",["fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]","Display or execute commands from the history list.\n Exit Status:\n Returns success or status of executed command."]],["fg",["fg [job_spec]","Move job to the foreground.\n Place the job identified by JOB_SPEC in the foreground, making it the\n current job."]],["getopts",["getopts optstring name [arg]","Parse option arguments.\n Getopts is used by shell procedures to parse positional parameters\n as options.\n\n OPTSTRING contains the option letters to be recognized; if a letter\n is followed by a colon, the option is expected to have an argument,\n which should be separated from it by white space.\n Exit Status:\n Returns success if an option is found; fails if the end of options is\n encountered or an error occurs."]],["hash",["hash [-lr] [-p pathname] [-dt] [name ...]","Remember or display program locations.\n Determine and remember the full pathname of each command NAME.\n Exit Status:\n Returns success unless NAME is not found or an invalid option is given."]],["help",["help [-s] [pattern ...]","Display information about builtin commands.\n Displays brief summaries of builtin commands. If PATTERN is\n specified, gives detailed help on all commands matching PATTERN,\n otherwise the list of help topics is printed.\n\n Options:\n -s output only a short usage synopsis for each topic matching\n PATTERN\n\n Exit Status:\n Returns success unless PATTERN is not found."]],["history",["history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]","Display or manipulate the history list.\n Display the history list with line numbers, prefixing each modified\n entry with a `*'.\n Exit Status:\n Returns success unless an invalid option is given or an error occurs."]],["jobs",["jobs [-lnprs] [jobspec ...] or jobs -x command [args]","Display status of jobs.\n Lists the active jobs.\n Exit Status:\n Returns success unless an invalid option is given or an error occurs."]],["kill",["kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]","Send a signal to a job.\n Send the processes identified by PID or JOBSPEC the signal named by\n SIGSPEC or SIGNUM.\n Exit Status:\n Returns success unless an invalid option is given or an error occurs."]],["let",["let arg [arg ...]","Evaluate arithmetic expressions.\n Evaluate each ARG as an arithmetic expression. Evaluation is done in\n fixed-width integers with no check for overflow, though division by 0\n is trapped and flagged as an error.\n Exit Status:\n If the last ARG evaluates to 0, let returns 1; 0 is returned otherwise."]],["local",["local [option] name[=value] ...","Define local variables.\n Create a local variable called NAME, and give it VALUE. OPTION can\n be any option accepted by `declare'.\n\n Local can only be used within a function; it makes the variable NAME\n have a visible scope restricted to that function and its children.\n Exit Status:\n Returns success unless an invalid option is supplied, a variable\n assignment error occurs, or the shell is not executing a function."]],["logout",["logout [n]","Exit a login shell.\n Exits a login shell with exit status N. Returns an error if not executed\n in a login shell."]],["mapfile",["mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]","Read lines from the standard input into an indexed array variable.\n Read lines from the standard input into the indexed array variable ARRAY,\n or from file descriptor FD if the -u option is supplied.\n\n Options:\n -d delim Use DELIM to terminate lines, instead of newline\n -n count Copy at most COUNT lines\n -O origin Begin assigning to ARRAY at index ORIGIN\n -s count Discard the first COUNT lines read\n -t Remove a trailing DELIM from each line read (default newline)\n -u fd Read lines from file descriptor FD instead of standard input\n\n Exit Status:\n Returns success unless an invalid option is given or ARRAY is readonly."]],["popd",["popd [-n] [+N | -N]","Remove directories from stack.\n Removes entries from the directory stack.\n Exit Status:\n Returns success unless an invalid argument is supplied or the directory\n change fails."]],["printf",["printf [-v var] format [arguments]","Formats and prints ARGUMENTS under control of the FORMAT.\n\n Options:\n -v var assign the output to shell variable VAR rather than\n display it on the standard output\n\n FORMAT is a character string which contains three types of objects: plain\n characters, which are simply copied to standard output; character escape\n sequences, which are converted and copied to the standard output; and\n format specifications, each of which causes printing of the next successive\n argument.\n Exit Status:\n Returns success unless an invalid option is given or a write or assignment\n error occurs."]],["pushd",["pushd [-n] [+N | -N | dir]","Add directories to stack.\n Adds a directory to the top of the directory stack, or rotates\n the stack, making the new top of the stack the current working\n directory.\n Exit Status:\n Returns success unless an invalid argument is supplied or the directory\n change fails."]],["pwd",["pwd [-LP]","Print the name of the current working directory.\n\n Options:\n -L print the value of $PWD if it names the current working\n directory\n -P print the physical directory, without any symbolic links\n\n By default, `pwd' behaves as if `-L' were specified.\n Exit Status:\n Returns 0 unless an invalid option is given or the current directory\n cannot be read."]],["read",["read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]","Read a line from the standard input and split it into fields.\n Reads a single line from the standard input, or from file descriptor FD\n if the -u option is supplied. The line is split into fields as with word\n splitting, and the first word is assigned to the first NAME, the second\n word to the second NAME, and so on, with any leftover words assigned to\n the last NAME.\n Exit Status:\n The return code is zero, unless end-of-file is encountered, read times out,\n or an invalid file descriptor is supplied as the argument to -u."]],["readarray",["readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]","Read lines from a file into an array variable.\n A synonym for `mapfile'."]],["readonly",["readonly [-aAf] [name[=value] ...] or readonly -p","Mark shell variables as unchangeable.\n Mark each NAME as read-only; the values of these NAMEs may not be\n changed by subsequent assignment.\n Exit Status:\n Returns success unless an invalid option is given or NAME is invalid."]],["return",["return [n]","Return from a shell function.\n Causes a function or sourced script to exit with the return value\n specified by N. If N is omitted, the return status is that of the\n last command executed within the function or script.\n Exit Status:\n Returns N, or failure if the shell is not executing a function or script."]],["set",["set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]","Set or unset values of shell options and positional parameters.\n Change the value of shell attributes and positional parameters, or\n display the names and values of shell variables.\n\n Options:\n -e Exit immediately if a command exits with a non-zero status.\n -u Treat unset variables as an error when substituting.\n -x Print commands and their arguments as they are executed.\n -o option-name\n Set the variable corresponding to option-name\n\n Exit Status:\n Returns success unless an invalid option is given."]],["shift",["shift [n]","Shift positional parameters.\n Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n not given, it is assumed to be 1.\n Exit Status:\n Returns success unless N is negative or greater than $#."]],["shopt",["shopt [-pqsu] [-o] [optname ...]","Set and unset shell options.\n Change the setting of each shell option OPTNAME. Without any option\n arguments, list each supplied OPTNAME, or all shell options if no\n OPTNAMEs are given, with an indication of whether or not each is set.\n\n Options:\n -o restrict OPTNAMEs to those defined for use with `set -o'\n -p print each shell option with an indication of its status\n -q suppress output\n -s enable (set) each OPTNAME\n -u disable (unset) each OPTNAME\n\n Exit Status:\n Returns success if OPTNAME is enabled; fails if an invalid option is\n given or OPTNAME is disabled."]],["source",["source filename [arguments]","Execute commands from a file in the current shell.\n Read and execute commands from FILENAME in the current shell.\n The entries in $PATH are used to find the directory containing FILENAME.\n Exit Status:\n Returns the status of the last command executed in FILENAME."]],["suspend",["suspend [-f]","Suspend shell execution.\n Suspend the execution of this shell until it receives a SIGCONT signal."]],["test",["test [expr]","Evaluate conditional expression.\n Exits with a status of 0 (true) or 1 (false) depending on\n the evaluation of EXPR. Expressions may be unary or binary.\n Exit Status:\n Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n false or an invalid argument is given."]],["times",["times","Display process times.\n Prints the accumulated user and system times for the shell and all of its\n child processes.\n Exit Status:\n Always succeeds."]],["trap",["trap [-lp] [[arg] signal_spec ...]","Trap signals and other events.\n Defines and activates handlers to be run when the shell receives signals\n or other conditions.\n Exit Status:\n Returns success unless a SIGSPEC is invalid or an invalid option is given."]],["true",["true","Return a successful result.\n Exit Status:\n Always succeeds."]],["type",["type [-afptP] name [name ...]","Display information about command type.\n For each NAME, indicate how it would be interpreted if used as a\n command name.\n\n Options:\n -a display all locations containing an executable named NAME\n -f suppress shell function lookup\n -P force a PATH search for each NAME, even if it is an alias,\n builtin, or function, and returns the name of the disk file\n that would be executed\n -p returns either the name of the disk file that would be executed,\n or nothing if `type -t NAME' would not return `file'\n -t output a single word which is one of `alias', `keyword',\n `function', `builtin', `file' or `', if NAME is an alias,\n shell reserved word, shell function, shell builtin, disk file,\n or not found, respectively\n\n Exit Status:\n Returns success if all of the NAMEs are found; fails if any are not found."]],["typeset",["typeset [-aAfFgilnrtux] [-p] name[=value] ...","Set variable values and attributes.\n A synonym for `declare'."]],["ulimit",["ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]","Modify shell resource limits.\n Provides control over the resources available to the shell and processes\n it creates, on systems that allow such control.\n Exit Status:\n Returns success unless an invalid option is supplied or an error occurs."]],["umask",["umask [-p] [-S] [mode]","Display or set file mode mask.\n Sets the user file-creation mask to MODE. If MODE is omitted, prints\n the current value of the mask.\n Exit Status:\n Returns success unless MODE is invalid or an invalid option is given."]],["unalias",["unalias [-a] name [name ...]","Remove each NAME from the list of defined aliases.\n Exit Status:\n Returns success unless a NAME is not an existing alias."]],["unset",["unset [-f] [-v] [-n] [name ...]","Unset values and attributes of shell variables and functions.\n For each NAME, remove the corresponding variable or function.\n\n Options:\n -f treat each NAME as a shell function\n -v treat each NAME as a shell variable\n -n treat each NAME as a name reference and unset the variable itself\n rather than the variable it references\n\n Without options, unset first tries to unset a variable, and if that fails,\n tries to unset a function.\n Exit Status:\n Returns success unless an invalid option is given or a NAME is read-only."]],["wait",["wait [-fn] [id ...]","Wait for job completion and return exit status.\n Waits for each process identified by an ID, which may be a process ID or a\n job specification, and reports its termination status.\n Exit Status:\n Returns the status of the last ID; fails if ID is invalid or an invalid\n option is given."]]]),i7e=_to_consumable_array(n7e.keys()).sort();function D_t(e,t){var r=!1,n=[],i=0;for(;i<t.length;){var l=t[i];if(l==="--"){for(i++;i<t.length;)n.push(t[i]),i++;break}if(l.startsWith("-")&&l.length>1){for(var c=1;c<l.length;c++){var d=l[c];if(d==="s")r=!0;else return ot("bash: help: -".concat(d,": invalid option\n"),2)}i++}else n.push(l),i++}if(n.length===0)return F_t();var o="",a=!1,s="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l10=_step.value;var c10=L_t(l10);if(c10.length===0){s+="bash: help: no help topics match `".concat(l10,"'. Try `help help' or `man -k ").concat(l10,"' or `info ").concat(l10,"'.\n"),a=!0;continue}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=c10[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var d10=_step1.value;var u=n7e.get(d10);if(!u)continue;var _u=_sliced_to_array(u,2),p=_u[0],m=_u[1];r?o+="".concat(d10,": ").concat(p,"\n"):o+="".concat(d10,": ").concat(p,"\n").concat(m,"\n")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{exitCode:a?1:0,stdout:o,stderr:s}}function L_t(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),r=ir("^".concat(t,"$"));return i7e.filter(function(n){return r.test(n)})}function F_t(){var e=[];e.push("just-bash shell builtins"),e.push("These shell commands are defined internally. Type `help' to see this list."),e.push("Type `help name' to find out more about the function `name'."),e.push("");var t=36,r=i7e.slice(),n=Math.ceil(r.length/2);for(var i=0;i<n;i++){var o=r[i]||"",a=r[i+n]||"",s=o.padEnd(t);e.push(a?"".concat(s).concat(a):o)}return Un("".concat(e.join("\n"),"\n"))}jo();kl();function z_t(e){var t=[],r="",n=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=i[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var o=_step1.value;o==="("?n++:o===")"&&n--}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}r?r+=" ".concat(i):r=i,n===0&&(t.push(r),r="")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r&&t.push(r),t}function j_t(e,t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,_$o,a,_tmp,o,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.length===0)return[2,ot("bash: let: expression expected\n")];r=z_t(t),n=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];i=_step.value;_state.label=3;case 3:_state.trys.push([3,7,,8]);_$o=c_("(( ".concat(i," ))")).statements[0];if(!(_$o&&_$o.pipelines.length>0&&_$o.pipelines[0].commands.length>0))return[3,6];a=_$o.pipelines[0].commands[0];_tmp=a.type==="ArithmeticCommand";if(!_tmp)return[3,5];return[4,Xt(e,a.expression.expression)];case 4:_tmp=n=_state.sent();_state.label=5;case 5:_tmp;_state.label=6;case 6:return[3,8];case 7:o=_state.sent();return[2,ot("bash: let: ".concat(i,": ").concat(o.message,"\n"))];case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[2,ft("","",n===0?1:0)]}})})()}Ns();jo();kl();nd();_p();f1();function U_t(e,t){return _async_to_generator(function(){var c,d,u,p,m,r,n,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,h,_iterator1,_step1,g,h10,g10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,x,v,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_loop,_iterator3,_step3,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.state.localScopes.length===0)return[2,ot("bash: local: can only be used in a function\n")];r=e.state.localScopes[e.state.localScopes.length-1],n="",i=0,o=!1,a=!1,s=!1,l=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){h=_step.value;if(h==="-n")o=!0;else if(h==="-a")a=!0;else if(h==="-p")s=!0;else if(h.startsWith("-")&&!h.includes("="))try{for(_iterator1=h.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){g=_step1.value;g==="n"?o=!0:g==="a"?a=!0:g==="p"&&(s=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else l.push(h)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(l.length===0){h10="",g10=Array.from(r.keys()).filter(function(x){return!x.includes("_")||!x.match(/_\d+$/)}).filter(function(x){return!x.includes("__length")}).sort();_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=g10[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){x=_step2.value;v=e.state.env.get(x);v!==void 0&&(h10+="".concat(x,"=").concat(v,"\n"))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return[2,ft(h10,"",0)]}_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_loop=function(){var h,g,x,v,S,C,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,T,k,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,C1,E,C10,y,_Math,S10,O,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,R,M,k10,E1,C11,T1,O1,I,_,S11,k11,b,S12,k12,T10,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step4,O10,I1,E10,T11,I10,T12,I11,C12,S13,w,S14,k13,E11,C13,T13,S15,k14,E12,k15,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step5,C14,E13,S16,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step6,k16,S17;return _ts_generator(this,function(_state){switch(_state.label){case 0:h=_step3.value;g=void 0,x=void 0,v=h.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)=\\((.*)\\)$","s"));if(v){g=v[1];S=v[2];if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(g)){n+="bash: local: `".concat(h,"': not a valid identifier\n"),i=1;return[2,"continue"]}if(Ms(e,g,"bash"),!r.has(g)){r.set(g,e.state.env.get(g));C="".concat(g,"_");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){T=_step.value;T.startsWith(C)&&!T.includes("__")&&(r.has(T)||r.set(T,e.state.env.get(T)))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}k="".concat(g,"_");_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){C1=_step1.value;C1.startsWith(k)&&!C1.includes("__")&&e.state.env.delete(C1)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}E=t1(S);for(C10=0;C10<E.length;C10++)e.state.env.set("".concat(g,"_").concat(C10),E[C10]);e.state.env.set("".concat(g,"__length"),String(E.length)),r_(e,g),o&&J0(e,g);return[2,"continue"]}y=h.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)\\+=\\((.*)\\)$","s"));if(y){;g=y[1];S10=y[2];if(Ms(e,g,"bash"),!r.has(g)){r.set(g,e.state.env.get(g));O="".concat(g,"_");_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){R=_step2.value;R.startsWith(O)&&!R.includes("__")&&(r.has(R)||r.set(R,e.state.env.get(R)))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}M="".concat(g,"__length");e.state.env.has(M)&&!r.has(M)&&r.set(M,e.state.env.get(M))}k10=t1(S10),E1=Os(e,g),C11=0,T1=e.state.env.get(g);E1.length===0&&T1!==void 0?(e.state.env.set("".concat(g,"_0"),T1),e.state.env.delete(g),C11=1):E1.length>0&&(C11=(_Math=Math).max.apply(_Math,_to_consumable_array(E1))+1);for(O1=0;O1<k10.length;O1++)e.state.env.set("".concat(g,"_").concat(C11+O1),sa(e,k10[O1]));I=C11+k10.length;e.state.env.set("".concat(g,"__length"),String(I)),r_(e,g),o&&J0(e,g);return[2,"continue"]}_=h.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(_){g=_[1];S11=sa(e,_[2]);Ms(e,g,"bash"),r.has(g)||r.set(g,e.state.env.get(g));k11=(c=e.state.env.get(g))!=null?c:"";e.state.env.set(g,k11+S11),r_(e,g),o&&J0(e,g);return[2,"continue"]}b=h.match(RegExp("^([a-zA-Z_][a-zA-Z0-9_]*)\\[([^\\]]+)\\]=(.*)$","s"));if(!b)return[3,5];g=b[1];S12=b[2],k12=sa(e,b[3]);if(Ms(e,g,"bash"),!r.has(g)){r.set(g,e.state.env.get(g));T10="".concat(g,"_");_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step4=_iterator3.next()).done);_iteratorNormalCompletion3=true){O10=_step4.value;O10.startsWith(T10)&&!O10.includes("__")&&(r.has(O10)||r.set(O10,e.state.env.get(O10)))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}I1="".concat(g,"__length");e.state.env.has(I1)&&!r.has(I1)&&r.set(I1,e.state.env.get(I1))}E10=void 0;_state.label=1;case 1:_state.trys.push([1,3,,4]);T11=new Pn,I10=Ki(T11,S12);return[4,Xt(e,I10.expression)];case 2:E10=_state.sent();return[3,4];case 3:T12=_state.sent();I11=parseInt(S12,10);E10=Number.isNaN(I11)?0:I11;return[3,4];case 4:e.state.env.set("".concat(g,"_").concat(E10),k12);C12=parseInt((d=e.state.env.get("".concat(g,"__length")))!=null?d:"0",10);E10>=C12&&e.state.env.set("".concat(g,"__length"),String(E10+1)),r_(e,g),o&&J0(e,g);return[2,"continue"];case 5:if(h.includes("=")){S13=h.indexOf("=");g=h.slice(0,S13),x=sa(e,h.slice(S13+1))}else g=h;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(g)){n+="bash: local: `".concat(h,"': not a valid identifier\n"),i=1;return[2,"continue"]}w=r.has(g);if(x!==void 0){S14=e.state.env.get(g);if(e.state.tempEnvBindings){k13=(u=e.state.accessedTempEnvVars)==null?void 0:u.has(g),E11=(p=e.state.mutatedTempEnvVars)==null?void 0:p.has(g);if(!k13&&!E11)for(C13=e.state.tempEnvBindings.length-1;C13>=0;C13--){T13=e.state.tempEnvBindings[C13];if(T13.has(g)){S14=T13.get(g);break}}}Vvt(e,g,S14)}if(!w){S15=e.state.env.get(g);if(e.state.tempEnvBindings)for(k14=e.state.tempEnvBindings.length-1;k14>=0;k14--){E12=e.state.tempEnvBindings[k14];if(E12.has(g)){S15=E12.get(g);break}}if(r.set(g,S15),a){k15="".concat(g,"_");_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step5=_iterator4.next()).done);_iteratorNormalCompletion4=true){C14=_step5.value;C14.startsWith(k15)&&!C14.includes("__")&&(r.has(C14)||r.set(C14,e.state.env.get(C14)))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}E13="".concat(g,"__length");e.state.env.has(E13)&&!r.has(E13)&&r.set(E13,e.state.env.get(E13))}}if(a&&x===void 0){S16="".concat(g,"_");_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;try{for(_iterator5=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step6=_iterator5.next()).done);_iteratorNormalCompletion5=true){k16=_step6.value;k16.startsWith(S16)&&!k16.includes("__")&&e.state.env.delete(k16)}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}e.state.env.set("".concat(g,"__length"),"0")}else if(x!==void 0){if(Ms(e,g,"bash"),o&&x!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(x)){n+="bash: local: `".concat(x,"': invalid variable name for name reference\n"),i=1;return[2,"continue"]}e.state.env.set(g,x),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(g))}else{S17=(m=e.state.tempEnvBindings)==null?void 0:m.some(function(k){return k.has(g)});!w&&!S17&&e.state.env.delete(g)}r_(e,g),o&&J0(e,g);return[2]}})};_iterator3=l[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done))return[3,5];return[5,_ts_values(_loop())];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion3=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError3=true;_iteratorError3=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}return[7];case 8:return[2,ft("",n,i)]}})})()}nd();function B_t(e,t,r){var y,_;var n="\n",i=0,o=0,a=0,s=!1,l="MAPFILE",c=0;for(;c<t.length;){var b=t[c];b==="-d"&&c+1<t.length?(n=t[c+1]===""?"\0":t[c+1]||"\n",c+=2):b==="-n"&&c+1<t.length?(i=Number.parseInt(t[c+1],10)||0,c+=2):b==="-O"&&c+1<t.length?(o=Number.parseInt(t[c+1],10)||0,c+=2):b==="-s"&&c+1<t.length?(a=Number.parseInt(t[c+1],10)||0,c+=2):b==="-t"?(s=!0,c++):b==="-u"||b==="-C"||b==="-c"?c+=2:(b.startsWith("-")||(l=b),c++)}var d=r;!d&&e.state.groupStdin!==void 0&&(d=e.state.groupStdin);var u=[],p=d,m=0,h=0,g=(_=(y=e.limits)==null?void 0:y.maxArrayElements)!=null?_:1e5;for(;p.length>0;){var b10=p.indexOf(n);if(b10===-1){if(p.length>0){if(h<a)h++;else if(i===0||m<i){if(o+m>=g)return ft("","mapfile: array element limit exceeded (".concat(g,")\n"),1);var k=p,E=k.indexOf("\0");E!==-1&&(k=k.substring(0,E)),u.push(k),m++}}break}var w=p.substring(0,b10),S=w.indexOf("\0");if(S!==-1&&(w=w.substring(0,S)),!s&&n!=="\0"&&(w+=n),p=p.substring(b10+n.length),h<a){h++;continue}if(i>0&&m>=i)break;if(o+m>=g)return ft("","mapfile: array element limit exceeded (".concat(g,")\n"),1);u.push(w),m++}o===0&&o_(e,l);for(var b11=0;b11<u.length;b11++)e.state.env.set("".concat(l,"_").concat(o+b11),u[b11]);var x=parseInt(e.state.env.get("".concat(l,"__length"))||"0",10),v=o+u.length;return e.state.env.set("".concat(l,"__length"),String(Math.max(x,v))),e.state.groupStdin!==void 0&&!r&&(e.state.groupStdin=""),ft("","",0)}nd();oc();function q_t(e){if(!e.startsWith("__rw__:"))return null;var t=e.slice(7),r=t.indexOf(":");if(r===-1)return null;var n=Number.parseInt(t.slice(0,r),10);if(Number.isNaN(n)||n<0)return null;var i=r+1,o=t.slice(i,i+n),a=i+n+1,s=t.slice(a),l=s.indexOf(":");if(l===-1)return null;var c=Number.parseInt(s.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;var d=s.slice(l+1);return{path:o,position:c,content:d}}function W_t(e,t,r){return"__rw__:".concat(e.length,":").concat(e,":").concat(t,":").concat(r)}function V_t(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;var I,O,M;var i=!1,o="\n",a="",s=-1,l=-1,c=null,d=-1,u=-1,p=[],m=0,h=!1,g=function(R,$){var z=1;for(;z<R.length;){var D=R[z];if(D==="r")i=!0,z++;else if(D==="s")z++;else{if(D==="d")return z+1<R.length?(o=R.substring(z+1),{nextArgIndex:$+1}):$+1<t.length?(o=t[$+1],{nextArgIndex:$+2}):{nextArgIndex:$+1};if(D==="n"){if(z+1<R.length){var L=R.substring(z+1);return s=Number.parseInt(L,10),(Number.isNaN(s)||s<0)&&(h=!0,s=0),{nextArgIndex:$+1}}else if($+1<t.length)return s=Number.parseInt(t[$+1],10),(Number.isNaN(s)||s<0)&&(h=!0,s=0),{nextArgIndex:$+2};return{nextArgIndex:$+1}}else if(D==="N"){if(z+1<R.length){var L10=R.substring(z+1);return l=Number.parseInt(L10,10),(Number.isNaN(l)||l<0)&&(h=!0,l=0),{nextArgIndex:$+1}}else if($+1<t.length)return l=Number.parseInt(t[$+1],10),(Number.isNaN(l)||l<0)&&(h=!0,l=0),{nextArgIndex:$+2};return{nextArgIndex:$+1}}else{if(D==="a")return z+1<R.length?(c=R.substring(z+1),{nextArgIndex:$+1}):$+1<t.length?(c=t[$+1],{nextArgIndex:$+2}):{nextArgIndex:$+1};if(D==="p")return z+1<R.length?(a=R.substring(z+1),{nextArgIndex:$+1}):$+1<t.length?(a=t[$+1],{nextArgIndex:$+2}):{nextArgIndex:$+1};if(D==="u"){if(z+1<R.length){var L11=R.substring(z+1);return d=Number.parseInt(L11,10),Number.isNaN(d)||d<0?{nextArgIndex:-2}:{nextArgIndex:$+1}}else if($+1<t.length)return d=Number.parseInt(t[$+1],10),Number.isNaN(d)||d<0?{nextArgIndex:-2}:{nextArgIndex:$+2};return{nextArgIndex:$+1}}else if(D==="t"){if(z+1<R.length){var L12=R.substring(z+1);return u=Number.parseFloat(L12),Number.isNaN(u)&&(u=0),{nextArgIndex:$+1}}else if($+1<t.length)return u=Number.parseFloat(t[$+1]),Number.isNaN(u)&&(u=0),{nextArgIndex:$+2};return{nextArgIndex:$+1}}else if(D==="e"||D==="i"||D==="P"){if(D==="i"&&$+1<t.length)return{nextArgIndex:$+2};z++}else z++}}}return{nextArgIndex:$+1}};for(;m<t.length;){var R=t[m];if(R.startsWith("-")&&R.length>1&&R!=="--"){var $=g(R,m);if($.nextArgIndex===-1)return{stdout:"",stderr:"",exitCode:2};if($.nextArgIndex===-2)return{stdout:"",stderr:"",exitCode:1};m=$.nextArgIndex}else if(R==="--")for(m++;m<t.length;)p.push(t[m]),m++;else p.push(R),m++}if(h)return ft("","",1);if(p.length===0&&c===null&&p.push("REPLY"),u===0){if(c)o_(e,c);else{var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=p[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var R1=_step.value;e.state.env.set(R1,"")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}p.length===0&&e.state.env.set("REPLY","")}return ft("","",0)}if(u<0&&u!==-1)return ft("","",1);var x=r;d>=0?e.state.fileDescriptors?x=e.state.fileDescriptors.get(d)||"":x="":!x&&e.state.groupStdin!==void 0&&(x=e.state.groupStdin);var v=o===""?"\0":o,y="",_=0,b=!0,w=function(R){if(d>=0&&e.state.fileDescriptors)e.state.fileDescriptors.set(d,x.substring(R));else if(n>=0&&e.state.fileDescriptors){var $=e.state.fileDescriptors.get(n);if($!=null&&$.startsWith("__rw__:")){var z=q_t($);if(z){var D=z.position+R;e.state.fileDescriptors.set(n,W_t(z.path,D,z.content))}}}else e.state.groupStdin!==void 0&&!r&&(e.state.groupStdin=x.substring(R))};if(l>=0){var R10=Math.min(l,x.length);y=x.substring(0,R10),_=R10,b=R10>=l,w(_);var $1=p[0]||"REPLY";e.state.env.set($1,y);for(var z=1;z<p.length;z++)e.state.env.set(p[z],"");return ft("","",b?0:1)}else if(s>=0){var R11=0,$10=0,z10=!1;for(;$10<x.length&&R11<s;){var D=x[$10];if(D===v){_=$10+1,z10=!0;break}if(!i&&D==="\\"&&$10+1<x.length){var L=x[$10+1];if(L===v&&v==="\n"){$10+=2,_=$10;continue}if(L===v){$10+=2,R11++,y+=L,_=$10;continue}y+=L,$10+=2,R11++,_=$10}else y+=D,$10++,R11++,_=$10}b=R11>=s||z10,w(_)}else{_=0;var R12=0;for(;R12<x.length;){var $11=x[R12];if($11===v){_=R12+v.length,b=!0;break}if(!i&&$11==="\\"&&R12+1<x.length){var z11=x[R12+1];if(z11==="\n"){R12+=2;continue}if(z11===v){y+=z11,R12+=2;continue}y+=$11,y+=z11,R12+=2;continue}y+=$11,R12++}if(R12>=x.length&&(b=!1,_=R12,y.length===0&&x.length===0)){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=p[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var $12=_step1.value;e.state.env.set($12,"")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return c&&o_(e,c),ft("","",1)}w(_)}v==="\n"&&y.endsWith("\n")&&(y=y.slice(0,-1));var S=function(R){return i?R:R.replace(/\\(.)/g,"$1")};if(p.length===1&&p[0]==="REPLY")return e.state.env.set("REPLY",S(y)),ft("","",b?0:1);var k=us(e.state.env);if(c){var _V_e=V_e(y,k,void 0,i),R13=_V_e.words,$13=(O=(I=e.limits)==null?void 0:I.maxArrayElements)!=null?O:1e5;if(R13.length>$13)return ft("","read: array element limit exceeded (".concat($13,")\n"),1);o_(e,c);for(var z12=0;z12<R13.length;z12++)e.state.env.set("".concat(c,"_").concat(z12),S(R13[z12]));return ft("","",b?0:1)}var E=p.length,_V_e1=V_e(y,k,E,i),C=_V_e1.words,T=_V_e1.wordStarts;for(var R14=0;R14<p.length;R14++){var $14=p[R14];if(R14<p.length-1)e.state.env.set($14,S((M=C[R14])!=null?M:""));else if(R14<T.length){var z13=y.substring(T[R14]);z13=cyt(z13,k,i),z13=S(z13),e.state.env.set($14,z13)}else e.state.env.set($14,"")}return ft("","",b?0:1)}jr();function G_t(e,t){if(e.state.callDepth===0&&e.state.sourceDepth===0)return ot("bash: return: can only `return' from a function or sourced script\n");var r=e.state.lastExitCode;if(t.length>0){var n=t[0],i=Number.parseInt(n,10);if(n===""||Number.isNaN(i)||!/^-?\d+$/.test(n))return ot("bash: return: ".concat(n,": numeric argument required\n"),2);r=(i%256+256)%256}throw new Lf(r)}jr();nd();var zS="set: usage: set [-eux] [+eux] [-o option] [+o option]\nOptions:\n -e Exit immediately if a command exits with non-zero status\n +e Disable -e\n -u Treat unset variables as an error when substituting\n +u Disable -u\n -x Print commands and their arguments as they are executed\n +x Disable -x\n -o errexit Same as -e\n +o errexit Disable errexit\n -o nounset Same as -u\n +o nounset Disable nounset\n -o pipefail Return status of last failing command in pipeline\n +o pipefail Disable pipefail\n -o xtrace Same as -x\n +o xtrace Disable xtrace\n",fbe=new Map([["e","errexit"],["u","nounset"],["x","xtrace"],["v","verbose"],["f","noglob"],["C","noclobber"],["a","allexport"],["n","noexec"],["h",null],["b",null],["m",null],["B",null],["H",null],["P",null],["T",null],["E",null],["p",null]]),n9=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["noclobber","noclobber"],["noglob","noglob"],["allexport","allexport"],["noexec","noexec"],["posix","posix"],["vi","vi"],["emacs","emacs"],["notify",null],["monitor",null],["braceexpand",null],["histexpand",null],["physical",null],["functrace",null],["errtrace",null],["privileged",null],["hashall",null],["ignoreeof",null],["interactive-comments",null],["keyword",null],["onecmd",null]]),o7e=["errexit","nounset","pipefail","verbose","xtrace","posix","allexport","noclobber","noglob","noexec","vi","emacs"],a7e=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"];function Yq(e,t,r){t!==null&&(r&&(t==="vi"?e.state.options.emacs=!1:t==="emacs"&&(e.state.options.vi=!1)),e.state.options[t]=r,L9(e))}function H_t(e,t){return t+1<e.length&&!e[t+1].startsWith("-")&&!e[t+1].startsWith("+")}function Z_t(e,t){var r=Os(e,t);if(r.length===0)return"".concat(t,"=()");var n=r.map(function(i){var a;var o=(a=e.state.env.get("".concat(t,"_").concat(i)))!=null?a:"";return"[".concat(i,"]=").concat(p5(o))});return"".concat(t,"=(").concat(n.join(" "),")")}function K_t(e){return/^[a-zA-Z0-9_]+$/.test(e)?e:'"'.concat(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),'"')}function Q_t(e,t){var r=p1(e,t);if(r.length===0)return"".concat(t,"=()");var n=r.map(function(i){var a;var o=(a=e.state.env.get("".concat(t,"_").concat(i)))!=null?a:"";return"[".concat(K_t(i),"]=").concat(p5(o))});return"".concat(t,"=(").concat(n.join(" ")," )")}function J_t(e){var n;var t=new Set,r=(n=e.state.associativeArrays)!=null?n:new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(o){var a=o[1];r.has(a)||t.add(a)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function Y_t(e){var t;return(t=e.state.associativeArrays)!=null?t:new Set}function mbe(e){var t=o7e.map(function(n){return"".concat(n.padEnd(16)).concat(e.state.options[n]?"on":"off")}),r=a7e.map(function(n){return"".concat(n.padEnd(16),"off")});return"".concat(_to_consumable_array(t).concat(_to_consumable_array(r)).sort().join("\n"),"\n")}function hbe(e){var t=o7e.map(function(n){return"set ".concat(e.state.options[n]?"-o":"+o"," ").concat(n)}),r=a7e.map(function(n){return"set +o ".concat(n)});return"".concat(_to_consumable_array(t).concat(_to_consumable_array(r)).sort().join("\n"),"\n")}function X_t(e,t){var o,a,s;if(t.includes("--help"))return Un(zS);if(t.length===0){var l=J_t(e),c=Y_t(e),d=function(m){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=c[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h=_step.value;var g="".concat(h,"_"),x="".concat(h,"__length");if(m!==x&&m.startsWith(g)){if(m.slice(g.length).startsWith("_length"))continue;return!0}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return!1},u=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),m=_step_value[0],h=_step_value[1];if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(m)||l.has(m)||c.has(m))continue;var g=m.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(g&&l.has(g[1]))continue;var x=m.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);x&&l.has(x[1])||d(m)||x&&c.has(x[1])||u.push([m,h])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var p=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=u.sort(function(param,param1){var _param=_sliced_to_array(param,1),g=_param[0],_param1=_sliced_to_array(param1,1),x=_param1[0];return g<x?-1:g>x?1:0})[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value1=_sliced_to_array(_step1.value,2),m10=_step_value1[0],h10=_step_value1[1];p.push("".concat(m10,"=").concat(Xke(h10)))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=_to_consumable_array(l).sort(function(h,g){return h<g?-1:h>g?1:0})[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var m11=_step2.value;p.push(Z_t(e,m11))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=_to_consumable_array(c).sort(function(h,g){return h<g?-1:h>g?1:0})[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var m12=_step3.value;p.push(Q_t(e,m12))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return p.sort(function(m,h){var g=m.split("=")[0],x=h.split("=")[0];return g<x?-1:g>x?1:0}),Un(p.length>0?"".concat(p.join("\n"),"\n"):"")}var r=[],n=function(){return r.length>0?Un(r.join("")):di},i=0;for(;i<t.length;){var l10=t[i];if((l10==="-o"||l10==="+o")&&H_t(t,i)){var c10=t[i+1];if(!n9.has(c10)){var d10="bash: set: ".concat(c10,": invalid option name\n").concat(zS);if(e.state.options.posix)throw new Of(1,"",d10);return ot(d10)}Yq(e,(o=n9.get(c10))!=null?o:null,l10==="-o"),i+=2;continue}if(l10==="-o"){r.push(mbe(e)),i++;continue}if(l10==="+o"){r.push(hbe(e)),i++;continue}if(l10.length>1&&(l10[0]==="-"||l10[0]==="+")&&l10[1]!=="-"){var c11=l10[0]==="-",d11=0;for(var u10=1;u10<l10.length;u10++){var p10=l10[u10];if(p10==="o"){var m13=i+1+d11;if(m13<t.length&&!t[m13].startsWith("-")&&!t[m13].startsWith("+")){var h11=t[m13];if(!n9.has(h11)){var g10="bash: set: ".concat(h11,": invalid option name\n").concat(zS);if(e.state.options.posix)throw new Of(1,"",g10);return ot(g10)}Yq(e,(a=n9.get(h11))!=null?a:null,c11),d11++;continue}r.push(c11?mbe(e):hbe(e));continue}if(!fbe.has(p10)){var m14="bash: set: ".concat(l10[0]).concat(p10,": invalid option\n").concat(zS);if(e.state.options.posix)throw new Of(1,"",m14);return ot(m14)}Yq(e,(s=fbe.get(p10))!=null?s:null,c11)}i+=1+d11;continue}if(l10==="--")return Xq(e,t.slice(i+1)),n();if(l10==="-"){if(e.state.options.xtrace=!1,e.state.options.verbose=!1,L9(e),i+1<t.length)return Xq(e,t.slice(i+1)),n();i++;continue}if(l10==="+"){i++;continue}if(l10.startsWith("-")||l10.startsWith("+")){var c12="bash: set: ".concat(l10,": invalid option\n").concat(zS);if(e.state.options.posix)throw new Of(1,"",c12);return ot(c12)}return Xq(e,t.slice(i)),n()}return n()}function Xq(e,t){var r=1;for(;e.state.env.has(String(r));)e.state.env.delete(String(r)),r++;for(var n=0;n<t.length;n++)e.state.env.set(String(n+1),t[n]);e.state.env.set("#",String(t.length)),e.state.env.set("@",t.join(" ")),e.state.env.set("*",t.join(" "))}jr();function ebt(e,t){var r=1;if(t.length>0){var a=Number.parseInt(t[0],10);if(Number.isNaN(a)||a<0){var s="bash: shift: ".concat(t[0],": numeric argument required\n");if(e.state.options.posix)throw new Of(1,"",s);return ot(s)}r=a}var n=Number.parseInt(e.state.env.get("#")||"0",10);if(r>n){var a9="bash: shift: shift count out of range\n";if(e.state.options.posix)throw new Of(1,"",a9);return ot(a9)}if(r===0)return di;var i=[];for(var a10=1;a10<=n;a10++)i.push(e.state.env.get(String(a10))||"");var o=i.slice(r);for(var a11=1;a11<=n;a11++)e.state.env.delete(String(a11));for(var a12=0;a12<o.length;a12++)e.state.env.set(String(a12+1),o[a12]);return e.state.env.set("#",String(o.length)),e.state.env.set("@",o.join(" ")),di}jo();jr();function tbt(e,t){return _async_to_generator(function(){var r,n,i,o,_$c,d,_$c1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d10,u,p,err,d11,u10,a,d12,_$c2,d13,d14,s,l,_$c3,d15,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t;if(r.length>0&&r[0]==="--"&&(r=r.slice(1)),r.length===0)return[2,ft("","bash: source: filename argument required\n",2)];n=r[0],i=null,o=null;if(!n.includes("/"))return[3,5];_$c=e.fs.resolvePath(e.state.cwd,n);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,e.fs.readFile(_$c)];case 2:o=_state.sent(),i=_$c;return[3,4];case 3:d=_state.sent();return[3,4];case 4:return[3,20];case 5:_$c1=(e.state.env.get("PATH")||"").split(":").filter(function(d){return d});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=6;case 6:_state.trys.push([6,14,15,16]);_iterator=_$c1[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];d10=_step.value;u=e.fs.resolvePath(e.state.cwd,"".concat(d10,"/").concat(n));_state.label=8;case 8:_state.trys.push([8,11,,12]);return[4,e.fs.stat(u)];case 9:if(_state.sent().isDirectory)return[3,12];return[4,e.fs.readFile(u)];case 10:o=_state.sent(),i=u;return[3,13];case 11:p=_state.sent();return[3,12];case 12:_iteratorNormalCompletion=true;return[3,7];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:if(!(o===null))return[3,20];d11=e.fs.resolvePath(e.state.cwd,n);_state.label=17;case 17:_state.trys.push([17,19,,20]);return[4,e.fs.readFile(d11)];case 18:o=_state.sent(),i=d11;return[3,20];case 19:u10=_state.sent();return[3,20];case 20:if(o===null)return[2,ot("bash: ".concat(n,": No such file or directory\n"))];a=new Map;if(r.length>1){for(d12=1;d12<=9;d12++)a.set(String(d12),e.state.env.get(String(d12)));a.set("#",e.state.env.get("#")),a.set("@",e.state.env.get("@"));_$c2=r.slice(1);e.state.env.set("#",String(_$c2.length)),e.state.env.set("@",_$c2.join(" "));for(d13=0;d13<_$c2.length&&d13<9;d13++)e.state.env.set(String(d13+1),_$c2[d13]);for(d14=_$c2.length+1;d14<=9;d14++)e.state.env.delete(String(d14))}s=e.state.currentSource,l=function(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(e.state.sourceDepth--,e.state.currentSource=s,r.length>1)try{for(var _iterator=a[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),_$c=_step_value[0],d=_step_value[1];d===void 0?e.state.env.delete(_$c):e.state.env.set(_$c,d)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};if(e.state.sourceDepth++,e.state.sourceDepth>e.limits.maxSourceDepth)throw e.state.sourceDepth--,new Qt("source: maximum nesting depth (".concat(e.limits.maxSourceDepth,") exceeded, increase executionLimits.maxSourceDepth"),"recursion");e.state.currentSource=n;_state.label=21;case 21:_state.trys.push([21,23,,24]);_$c3=c_(o);return[4,e.executeScript(_$c3)];case 22:d15=_state.sent();return[2,(l(),d15)];case 23:c=_state.sent();if(l(),_instanceof(c,Ci))throw c;if(_instanceof(c,Lf))return[2,ft(c.stdout,c.stderr,c.exitCode)];if(c.name==="ParseException")return[2,ot("bash: ".concat(n,": ").concat(c.message,"\n"))];throw c;case 24:return[2]}})})()}Ns();jo();kl();lu();wl();_p();f1();function gbe(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function rbt(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')}function xbe(e,t){return _async_to_generator(function(){var r,n,r10,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(rbt(t))return[2,null];_state.label=1;case 1:_state.trys.push([1,3,,4]);r=new Pn,n=Ki(r,t);return[4,Xt(e,n.expression)];case 2:return[2,_state.sent()];case 3:r10=_state.sent();n10=parseInt(t,10);return[2,Number.isNaN(n10)?0:n10];case 4:return[2]}})})()}function ybe(e,t){var r,n,i,o;if((r=e.state.localVarStack)!=null&&r.has(t)){var a=KW(e,t);if(a){a.value===void 0?e.state.env.delete(t):e.state.env.set(t,a.value);var s=(n=e.state.localVarStack)==null?void 0:n.get(t);if(!s||s.length===0)Gq(e,t),(i=e.state.localVarStack)==null||i.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,a.scopeIndex),JW(e,t);else{var l=s[s.length-1];e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,l.scopeIndex+1)}return!0}return e.state.env.delete(t),Gq(e,t),(o=e.state.localVarStack)==null||o.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,0),!0}for(var a9=e.state.localScopes.length-1;a9>=0;a9--){var s10=e.state.localScopes[a9];if(s10.has(t)){var l10=s10.get(t);l10===void 0?e.state.env.delete(t):e.state.env.set(t,l10),s10.delete(t);var c=!1;for(var d=a9-1;d>=0;d--)if(e.state.localScopes[d].has(t)){e.state.localVarDepth&&e.state.localVarDepth.set(t,d+1),c=!0;break}return c||Gq(e,t),!0}}return!1}function JW(e,t){if(!e.state.tempEnvBindings||e.state.tempEnvBindings.length===0)return!1;for(var r=e.state.tempEnvBindings.length-1;r>=0;r--){var n=e.state.tempEnvBindings[r];if(n.has(t)){var i=n.get(t);return i===void 0?e.state.env.delete(t):e.state.env.set(t,i),n.delete(t),!0}}return!1}function vbe(e,t){return _async_to_generator(function(){var r,n,r10;return _ts_generator(this,function(_state){if(t.startsWith("'")&&t.endsWith("'"))return[2,t.slice(1,-1)];if(t.startsWith('"')&&t.endsWith('"')){r=t.slice(1,-1),n=new Pn().parseWordFromString(r,!0,!1);return[2,pr(e,n)]}if(t.includes("$")){r10=new Pn().parseWordFromString(t,!1,!1);return[2,pr(e,r10)]}return[2,t]})})()}function nbt(e,t){return _async_to_generator(function(){var o,a,s,l,c,d,u,p,m,h,g,x,v,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,y,S,C,T,$,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,z,I,$1,O,M,R,$10,z10,D,L,ee,k,C1,E,C10,T1,I1,_,S10,k10,I10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_step_value1,O1,E1,I11,C11,T10,I12,O10,M1,R1,$11,b,S11,w,S12,k11,E10,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="both",n="",i=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,14,15,16]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];y=_step.value;if(y==="-v"){r="variable";return[3,12]}if(y==="-f"){r="function";return[3,12]}if(r==="function"){e.state.functions.delete(y);return[3,12]}if(!(r==="variable"))return[3,7];S=y.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!S)return[3,6];C=S[1],T=S[2];if(T==="@"||T==="*"){$=zr(e,C);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=$[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step1.value,1),z=_step_value[0];e.state.env.delete("".concat(C,"_").concat(z))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}e.state.env.delete(C);return[3,12]}I=(o=e.state.associativeArrays)==null?void 0:o.has(C);if(!I)return[3,4];return[4,vbe(e,T)];case 3:$1=_state.sent();e.state.env.delete("".concat(C,"_").concat($1));return[3,12];case 4:O=d_(e,C),M=(a=e.state.declaredVars)==null?void 0:a.has(C);if((e.state.env.has(C)||M)&&!O&&!I){n+="bash: unset: ".concat(C,": not an array variable\n"),i=1;return[3,12]}return[4,xbe(e,T)];case 5:R=_state.sent();if(R===null&&O){n+="bash: unset: ".concat(T,": not a valid identifier\n"),i=1;return[3,12]}if(R===null)return[3,12];if(R<0){$10=zr(e,C),z10=$10.length,D=e.state.currentLine;if(z10===0){n+="bash: line ".concat(D,": unset: [").concat(R,"]: bad array subscript\n"),i=1;return[3,12]}L=z10+R;if(L<0){n+="bash: line ".concat(D,": unset: [").concat(R,"]: bad array subscript\n"),i=1;return[3,12]}ee=$10[L][0];e.state.env.delete("".concat(C,"_").concat(ee));return[3,12]}e.state.env.delete("".concat(C,"_").concat(R));return[3,12];case 6:if(!gbe(y)){n+="bash: unset: `".concat(y,"': not a valid identifier\n"),i=1;return[3,12]}k=y;if(no(e,y)){C1=gp(e,y);C1&&C1!==y&&(k=C1)}if(s1(e,k)){n+="bash: unset: ".concat(k,": cannot unset: readonly variable\n"),i=1;return[3,12]}E=ZW(e,k);if(E!==void 0&&E!==e.state.callDepth)ybe(e,k);else if((s=e.state.fullyUnsetLocals)!=null&&s.has(k))e.state.env.delete(k);else if(E!==void 0){C10=(l=e.state.accessedTempEnvVars)==null?void 0:l.has(k),T1=(c=e.state.mutatedTempEnvVars)==null?void 0:c.has(k);if((C10||T1)&&(d=e.state.localVarStack)!=null&&d.has(k)){I1=KW(e,k);I1?I1.value===void 0?e.state.env.delete(k):e.state.env.set(k,I1.value):e.state.env.delete(k)}else e.state.env.delete(k)}else JW(e,k)||e.state.env.delete(k);(u=e.state.exportedVars)==null||u.delete(k);return[3,12];case 7:_=y.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!_)return[3,11];S10=_[1],k10=_[2];if(k10==="@"||k10==="*"){I10=zr(e,S10);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=I10[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_step_value1=_sliced_to_array(_step2.value,1),O1=_step_value1[0];e.state.env.delete("".concat(S10,"_").concat(O1))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}e.state.env.delete(S10);return[3,12]}E1=(p=e.state.associativeArrays)==null?void 0:p.has(S10);if(!E1)return[3,9];return[4,vbe(e,k10)];case 8:I11=_state.sent();e.state.env.delete("".concat(S10,"_").concat(I11));return[3,12];case 9:C11=d_(e,S10);if(e.state.env.has(S10)&&!C11&&!E1){n+="bash: unset: ".concat(S10,": not an array variable\n"),i=1;return[3,12]}return[4,xbe(e,k10)];case 10:T10=_state.sent();if(T10===null&&C11){n+="bash: unset: ".concat(k10,": not a valid identifier\n"),i=1;return[3,12]}if(T10===null)return[3,12];if(T10<0){I12=zr(e,S10),O10=I12.length,M1=e.state.currentLine;if(O10===0){n+="bash: line ".concat(M1,": unset: [").concat(T10,"]: bad array subscript\n"),i=1;return[3,12]}R1=O10+T10;if(R1<0){n+="bash: line ".concat(M1,": unset: [").concat(T10,"]: bad array subscript\n"),i=1;return[3,12]}$11=I12[R1][0];e.state.env.delete("".concat(S10,"_").concat($11));return[3,12]}e.state.env.delete("".concat(S10,"_").concat(T10));return[3,12];case 11:if(!gbe(y)){n+="bash: unset: `".concat(y,"': not a valid identifier\n"),i=1;return[3,12]}b=y;if(no(e,y)){S11=gp(e,y);S11&&S11!==y&&(b=S11)}if(s1(e,b)){n+="bash: unset: ".concat(b,": cannot unset: readonly variable\n"),i=1;return[3,12]}w=ZW(e,b);if(w!==void 0&&w!==e.state.callDepth)ybe(e,b);else if((m=e.state.fullyUnsetLocals)!=null&&m.has(b))e.state.env.delete(b);else if(w!==void 0){S12=(h=e.state.accessedTempEnvVars)==null?void 0:h.has(b),k11=(g=e.state.mutatedTempEnvVars)==null?void 0:g.has(b);if((S12||k11)&&(x=e.state.localVarStack)!=null&&x.has(b)){E10=KW(e,b);E10?E10.value===void 0?e.state.env.delete(b):e.state.env.set(b,E10.value):e.state.env.delete(b)}else e.state.env.delete(b)}else JW(e,b)||e.state.env.delete(b);(v=e.state.exportedVars)==null||v.delete(b),e.state.functions.delete(y);_state.label=12;case 12:_iteratorNormalCompletion=true;return[3,2];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:return[2,ft("",n,i)]}})})()}var YW=["extglob","dotglob","nullglob","failglob","globstar","globskipdots","nocaseglob","nocasematch","expand_aliases","lastpipe","xpg_echo"],ibt=["autocd","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","execfail","extdebug","extquote","force_fignore","globasciiranges","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath"];function i9(e){return YW.includes(e)}function obt(e){return ibt.includes(e)}function abt(e,t){var r=!1,n=!1,i=!1,o=!1,a=!1,s=[],l=0;for(;l<t.length;){var p=t[l];if(p==="--"){l++;break}if(p.startsWith("-")&&p.length>1){for(var m=1;m<p.length;m++){var h=p[m];switch(h){case"s":r=!0;break;case"u":n=!0;break;case"p":i=!0;break;case"q":o=!0;break;case"o":a=!0;break;default:return{exitCode:2,stdout:"",stderr:"shopt: -".concat(h,": invalid option\n")}}}l++}else break}for(;l<t.length;)s.push(t[l]),l++;if(a)return sbt(e,s,r,n,i,o);if(r&&n)return{exitCode:1,stdout:"",stderr:"shopt: cannot set and unset shell options simultaneously\n"};if(s.length===0){if(r||n){var m10=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=YW[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var h10=_step.value;var g=e.state.shoptOptions[h10];r&&g?m10.push(i?"shopt -s ".concat(h10):"".concat(h10," on")):n&&!g&&m10.push(i?"shopt -u ".concat(h10):"".concat(h10," off"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{exitCode:0,stdout:m10.length>0?"".concat(m10.join("\n"),"\n"):"",stderr:""}}var p10=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=YW[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var m11=_step1.value;var h11=e.state.shoptOptions[m11];p10.push(i?"shopt ".concat(h11?"-s":"-u"," ").concat(m11):"".concat(m11," ").concat(h11?"on":"off"))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return{exitCode:0,stdout:"".concat(p10.join("\n"),"\n"),stderr:""}}var c=!1,d="",u=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=s[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var p11=_step2.value;if(!i9(p11)&&!obt(p11)){d+="shopt: ".concat(p11,": invalid shell option name\n"),c=!0;continue}if(r)i9(p11)&&(e.state.shoptOptions[p11]=!0,tbe(e));else if(n)i9(p11)&&(e.state.shoptOptions[p11]=!1,tbe(e));else if(i9(p11)){var m12=e.state.shoptOptions[p11];o?m12||(c=!0):i?(u.push("shopt ".concat(m12?"-s":"-u"," ").concat(p11)),m12||(c=!0)):(u.push("".concat(p11," ").concat(m12?"on":"off")),m12||(c=!0))}else o?c=!0:i?(u.push("shopt -u ".concat(p11)),c=!0):(u.push("".concat(p11," off")),c=!0)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return{exitCode:c?1:0,stdout:u.length>0?"".concat(u.join("\n"),"\n"):"",stderr:d}}function sbt(e,t,r,n,i,o){var a=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["posix","posix"],["allexport","allexport"],["noclobber","noclobber"],["noglob","noglob"],["noexec","noexec"],["vi","vi"],["emacs","emacs"]]),s=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"],l=_to_consumable_array(a.keys()).concat(_to_consumable_array(s)).sort();if(t.length===0){var p=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=l[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var m=_step.value;var h=s.includes(m),g=a.get(m),x=h||!g?!1:e.state.options[g];r&&!x||n&&x||p.push(i?"set ".concat(x?"-o":"+o"," ").concat(m):"".concat(m," ").concat(x?"on":"off"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{exitCode:0,stdout:p.length>0?"".concat(p.join("\n"),"\n"):"",stderr:""}}var c=!1,d="",u=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=t[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var p10=_step1.value;var m10=a.has(p10),h10=s.includes(p10);if(!m10&&!h10){d+="shopt: ".concat(p10,": invalid option name\n"),c=!0;continue}if(h10){r||n||(o?c=!0:i?(u.push("set +o ".concat(p10)),c=!0):(u.push("".concat(p10," off")),c=!0));continue}var g10=a.get(p10);if(g10)if(r)g10==="vi"?e.state.options.emacs=!1:g10==="emacs"&&(e.state.options.vi=!1),e.state.options[g10]=!0,L9(e);else if(n)e.state.options[g10]=!1,L9(e);else{var x10=e.state.options[g10];o?x10||(c=!0):i?(u.push("set ".concat(x10?"-o":"+o"," ").concat(p10)),x10||(c=!0)):(u.push("".concat(p10," ").concat(x10?"on":"off")),x10||(c=!0))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return{exitCode:c?1:0,stdout:u.length>0?"".concat(u.join("\n"),"\n"):"",stderr:d}}function lbt(e,t,r){return _async_to_generator(function(){var i,o,a,s,l,l10,o10,a9,s10,s11,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o11,a10,s12,l11,c,d,s13,err,o12;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!t.includes("/"))return[3,5];o=e.fs.resolvePath(e.state.cwd,t);return[4,e.fs.exists(o)];case 1:if(!_state.sent())return[2,{error:"not_found",path:o}];a=o.split("/").pop()||t,s=e.commands.get(a);_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,e.fs.stat(o)];case 3:l=_state.sent();return[2,l.isDirectory?{error:"permission_denied",path:o}:s?{cmd:s,path:o}:l.mode&73?{script:!0,path:o}:{error:"permission_denied",path:o}];case 4:l10=_state.sent();return[2,{error:"not_found",path:o}];case 5:if(!(!r&&e.state.hashTable))return[3,12];o10=e.state.hashTable.get(t);if(!o10)return[3,12];return[4,e.fs.exists(o10)];case 6:if(!_state.sent())return[3,11];a9=e.commands.get(t);if(a9)return[2,{cmd:a9,path:o10}];_state.label=7;case 7:_state.trys.push([7,9,,10]);return[4,e.fs.stat(o10)];case 8:s10=_state.sent();if(!s10.isDirectory&&s10.mode&73)return[2,{script:!0,path:o10}];return[3,10];case 9:s11=_state.sent();return[3,10];case 10:return[3,12];case 11:e.state.hashTable.delete(t);_state.label=12;case 12:n=((i=r!=null?r:e.state.env.get("PATH"))!=null?i:"/usr/bin:/bin").split(":");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=13;case 13:_state.trys.push([13,21,22,23]);_iterator=n[Symbol.iterator]();_state.label=14;case 14:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,20];o11=_step.value;if(!o11)return[3,19];a10="".concat(o11.startsWith("/")?o11:e.fs.resolvePath(e.state.cwd,o11),"/").concat(t);return[4,e.fs.exists(a10)];case 15:if(!_state.sent())return[3,19];_state.label=16;case 16:_state.trys.push([16,18,,19]);return[4,e.fs.stat(a10)];case 17:s12=_state.sent();if(s12.isDirectory)return[3,19];l11=(s12.mode&73)!==0,c=e.commands.get(t),d=o11==="/bin"||o11==="/usr/bin";if(c&&d)return[2,{cmd:c,path:a10}];if(l11){if(c&&!d)return[2,{script:!0,path:a10}];if(!c)return[2,{script:!0,path:a10}]}return[3,19];case 18:s13=_state.sent();return[3,19];case 19:_iteratorNormalCompletion=true;return[3,14];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 23:return[4,e.fs.exists("/usr/bin")];case 24:if(!_state.sent()){o12=e.commands.get(t);if(o12)return[2,{cmd:o12,path:"/usr/bin/".concat(t)}]}return[2,null]}})})()}function s7e(e,t){return _async_to_generator(function(){var r,i,o,o10,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i10,o11,a,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[];if(!t.includes("/"))return[3,6];i=e.fs.resolvePath(e.state.cwd,t);return[4,e.fs.exists(i)];case 1:if(!_state.sent())return[3,5];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,e.fs.stat(i)];case 3:o=_state.sent();o.isDirectory||o.mode&73&&r.push(t);return[3,5];case 4:o10=_state.sent();return[3,5];case 5:return[2,r];case 6:n=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=7;case 7:_state.trys.push([7,16,17,18]);_iterator=n[Symbol.iterator]();_state.label=8;case 8:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,15];i10=_step.value;if(!i10)return[3,14];o11="".concat(i10.startsWith("/")?i10:e.fs.resolvePath(e.state.cwd,i10),"/").concat(t);return[4,e.fs.exists(o11)];case 9:if(!_state.sent())return[3,14];_state.label=10;case 10:_state.trys.push([10,12,,13]);return[4,e.fs.stat(o11)];case 11:if(_state.sent().isDirectory)return[3,14];return[3,13];case 12:a=_state.sent();return[3,14];case 13:r.push(i10.startsWith("/")?o11:"".concat(i10,"/").concat(t));_state.label=14;case 14:_iteratorNormalCompletion=true;return[3,8];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 18:return[2,r]}})})()}Ff();function ubt(e){return e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"then"in e&&typeof e.then=="function"}function yi(e,t,r,n){return function(){for(var _len=arguments.length,i=new Array(_len),_key=0;_key<_len;_key++){i[_key]=arguments[_key]}yl(t,r,"".concat(n," call"));var o=e.apply(void 0,_to_consumable_array(i));return ubt(o)?o.then(function(a){return yl(t,r,"".concat(n," post-await")),a},function(a){throw yl(t,r,"".concat(n," post-await")),a}):(yl(t,r,"".concat(n," return")),o)}}function cbt(e,t,r){var n=_object_spread_props(_object_spread({readFile:yi(e.readFile.bind(e),t,r,"fs.readFile")},typeof e.readFileBytes=="function"?{readFileBytes:yi(e.readFileBytes.bind(e),t,r,"fs.readFileBytes")}:Object.create(null)),{readFileBuffer:yi(e.readFileBuffer.bind(e),t,r,"fs.readFileBuffer"),writeFile:yi(e.writeFile.bind(e),t,r,"fs.writeFile"),appendFile:yi(e.appendFile.bind(e),t,r,"fs.appendFile"),exists:yi(e.exists.bind(e),t,r,"fs.exists"),stat:yi(e.stat.bind(e),t,r,"fs.stat"),mkdir:yi(e.mkdir.bind(e),t,r,"fs.mkdir"),readdir:yi(e.readdir.bind(e),t,r,"fs.readdir"),rm:yi(e.rm.bind(e),t,r,"fs.rm"),cp:yi(e.cp.bind(e),t,r,"fs.cp"),mv:yi(e.mv.bind(e),t,r,"fs.mv"),resolvePath:yi(e.resolvePath.bind(e),t,r,"fs.resolvePath"),getAllPaths:yi(e.getAllPaths.bind(e),t,r,"fs.getAllPaths"),chmod:yi(e.chmod.bind(e),t,r,"fs.chmod"),symlink:yi(e.symlink.bind(e),t,r,"fs.symlink"),link:yi(e.link.bind(e),t,r,"fs.link"),readlink:yi(e.readlink.bind(e),t,r,"fs.readlink"),lstat:yi(e.lstat.bind(e),t,r,"fs.lstat"),realpath:yi(e.realpath.bind(e),t,r,"fs.realpath"),utimes:yi(e.utimes.bind(e),t,r,"fs.utimes")});return e.readdirWithFileTypes&&(n.readdirWithFileTypes=yi(e.readdirWithFileTypes.bind(e),t,r,"fs.readdirWithFileTypes")),n}function dbt(e,t){if(!e.requireDefenseContext)return e;var r="command:".concat(t),n=_object_spread_props(_object_spread({},e),{fs:cbt(e.fs,e.requireDefenseContext,r)});return e.exec&&(n.exec=yi(e.exec,e.requireDefenseContext,r,"exec")),e.fetch&&(n.fetch=yi(e.fetch,e.requireDefenseContext,r,"fetch")),e.sleep&&(n.sleep=yi(e.sleep,e.requireDefenseContext,r,"sleep")),e.getRegisteredCommands&&(n.getRegisteredCommands=yi(e.getRegisteredCommands,e.requireDefenseContext,r,"getRegisteredCommands")),n}jr();ic();function pbt(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,l,c,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,g,_iterator1,_step1,x,d,u,p,m,h,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,g10,x10,_,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,b,_10,v,_11,b10,y,_12,b11,_13,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator4,_step4,b12,_14,_15,b13,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=!1,o=!1,a=!1,s=!1,l=!1,c=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){g=_step.value;if(g.startsWith("-")&&g.length>1)try{for(_iterator1=g.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){x=_step1.value;x==="t"?i=!0:x==="p"?o=!0:x==="P"?a=!0:x==="a"?s=!0:x==="f"&&(l=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else c.push(g)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}d="",u="",p=0,m=!1,h=!1;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=1;case 1:_state.trys.push([1,16,17,18]);_iterator2=c[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,15];g10=_step2.value;x10=!1;if(!a)return[3,7];if(!s)return[3,4];return[4,n(g10)];case 3:_=_state.sent();if(_.length>0){_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=_[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){b=_step3.value;d+="".concat(b,"\n")}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}m=!0,x10=!0}return[3,6];case 4:return[4,r(g10)];case 5:_10=_state.sent();_10&&(d+="".concat(_10,"\n"),m=!0,x10=!0);_state.label=6;case 6:x10||(h=!0);return[3,14];case 7:v=!l&&e.state.functions.has(g10);if(s&&v){if(!o)if(i)d+="function\n";else{_11=e.state.functions.get(g10),b10=_11?_be(g10,_11):"".concat(g10," is a function\n");d+=b10}x10=!0}y=e.state.env.get("BASH_ALIAS_".concat(g10));if(!!(y!==void 0&&(s||!x10)&&(o||(i?d+="alias\n":d+="".concat(g10," is aliased to `").concat(y,"'\n")),x10=!0,!s)||Kke.has(g10)&&(s||!x10)&&(o||(i?d+="keyword\n":d+="".concat(g10," is a shell keyword\n")),x10=!0,!s)))return[3,14];if(!s&&v&&!x10){if(!o)if(i)d+="function\n";else{_12=e.state.functions.get(g10),b11=_12?_be(g10,_12):"".concat(g10," is a function\n");d+=b11}x10=!0;return[3,14]}if(!!(lP.has(g10)&&(s||!x10)&&(o||(i?d+="builtin\n":d+="".concat(g10," is a shell builtin\n")),x10=!0,!s)))return[3,14];if(!s)return[3,9];return[4,n(g10)];case 8:_13=_state.sent();_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator4=_13[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){b12=_step4.value;o?d+="".concat(b12,"\n"):i?d+="file\n":d+="".concat(g10," is ").concat(b12,"\n"),m=!0,x10=!0}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}return[3,11];case 9:if(!!x10)return[3,11];return[4,r(g10)];case 10:_14=_state.sent();_14&&(o?d+="".concat(_14,"\n"):i?d+="file\n":d+="".concat(g10," is ").concat(_14,"\n"),m=!0,x10=!0);_state.label=11;case 11:if(!(!x10&&(h=!0,!i&&!o)))return[3,14];_15=!0;if(!g10.includes("/"))return[3,13];b13=e.fs.resolvePath(e.state.cwd,g10);return[4,e.fs.exists(b13)];case 12:_state.sent()&&(_15=!1);_state.label=13;case 13:_15&&(u+="bash: type: ".concat(g10,": not found\n"));_state.label=14;case 14:_iteratorNormalCompletion2=true;return[3,2];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 18:return[2,(o?p=h&&!m?1:0:p=h?1:0,ft(d,u,p))]}})})()}function _be(e,t){var r;return t.body.type==="Group"?r=t.body.body.map(function(n){return r5(n)}).join("; "):r=r5(t.body),"".concat(e," is a function\n").concat(e," () \n{ \n ").concat(r,"\n}\n")}function r5(e){if(Array.isArray(e))return e.map(function(t){return r5(t)}).join("; ");if(e.type==="Statement"){var t=[];for(var r=0;r<e.pipelines.length;r++){var n=e.pipelines[r];t.push(fbt(n)),e.operators[r]&&t.push(e.operators[r])}return t.join(" ")}if(e.type==="SimpleCommand"){var t10=e,r10=[];t10.name&&r10.push(bbe(t10.name));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t10.args[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n10=_step.value;r10.push(bbe(n10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r10.join(" ")}return e.type==="Group"?"{ ".concat(e.body.map(function(t){return r5(t)}).join("; "),"; }"):"..."}function fbt(e){var t=e.commands.map(function(r){return r5(r)});return(e.negated?"! ":"")+t.join(" | ")}function bbe(e){var t="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.type==="Literal"?t+=r.value:r.type==="DoubleQuoted"?t+='"'.concat(r.parts.map(function(n){return wbe(n)}).join(""),'"'):r.type==="SingleQuoted"?t+="'".concat(r.value,"'"):t+=wbe(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function wbe(e){var r;var t=e;return t.type==="Literal"?(r=t.value)!=null?r:"":t.type==="Variable"?"$".concat(t.name):""}function mbt(e,t,r,n){return _async_to_generator(function(){var s,i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,d,u,p,p10,d10,u10,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,p11,m,h,h10,err,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="",o="",a=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,26,27,28]);_iterator=t[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,25];l=_step.value;if(!l){a=1;return[3,24]}c=e.state.env.get("BASH_ALIAS_".concat(l));if(!(c!==void 0))return[3,3];n?i+="".concat(l,' is an alias for "').concat(c,'"\n'):i+="alias ".concat(l,"='").concat(c,"'\n");return[3,24];case 3:if(!Kke.has(l))return[3,4];n?i+="".concat(l," is a shell keyword\n"):i+="".concat(l,"\n");return[3,24];case 4:if(!lP.has(l))return[3,5];n?i+="".concat(l," is a shell builtin\n"):i+="".concat(l,"\n");return[3,24];case 5:if(!e.state.functions.has(l))return[3,6];n?i+="".concat(l," is a function\n"):i+="".concat(l,"\n");return[3,24];case 6:if(!l.includes("/"))return[3,12];d=e.fs.resolvePath(e.state.cwd,l),u=!1;return[4,e.fs.exists(d)];case 7:if(!_state.sent())return[3,11];_state.label=8;case 8:_state.trys.push([8,10,,11]);return[4,e.fs.stat(d)];case 9:p=_state.sent();p.isDirectory||p.mode&73&&(n?i+="".concat(l," is ").concat(l,"\n"):i+="".concat(l,"\n"),u=!0);return[3,11];case 10:p10=_state.sent();return[3,11];case 11:u||(n&&(o+="".concat(l,": not found\n")),a=1);return[3,24];case 12:if(!e.commands.has(l))return[3,23];d10=((s=e.state.env.get("PATH"))!=null?s:"/usr/bin:/bin").split(":"),u10=null;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=13;case 13:_state.trys.push([13,20,21,22]);_iterator1=d10[Symbol.iterator]();_state.label=14;case 14:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,19];p11=_step1.value;if(!p11)return[3,18];m="".concat(p11,"/").concat(l);_state.label=15;case 15:_state.trys.push([15,17,,18]);return[4,e.fs.stat(m)];case 16:h=_state.sent();if(!h.isDirectory&&h.mode&73){u10=m;return[3,19]}return[3,18];case 17:h10=_state.sent();return[3,18];case 18:_iteratorNormalCompletion1=true;return[3,14];case 19:return[3,22];case 20:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,22];case 21:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 22:u10||(u10="/usr/bin/".concat(l)),n?i+="".concat(l," is ").concat(u10,"\n"):i+="".concat(u10,"\n");return[3,24];case 23:n&&(o+="".concat(l,": not found\n")),a=1;_state.label=24;case 24:_iteratorNormalCompletion=true;return[3,2];case 25:return[3,28];case 26:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,28];case 27:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 28:return[2,ft(i,o,a)]}})})()}function hbt(e,t){return _async_to_generator(function(){var n,i,o,o10,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i10,o11,a,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,i11;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!t.includes("/"))return[3,7];i=e.fs.resolvePath(e.state.cwd,t);return[4,e.fs.exists(i)];case 1:if(!_state.sent())return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,e.fs.stat(i)];case 3:o=_state.sent();if(o.isDirectory||!(o.mode&73))return[2,null];return[3,5];case 4:o10=_state.sent();return[2,null];case 5:return[2,t];case 6:return[2,null];case 7:r=((n=e.state.env.get("PATH"))!=null?n:"/usr/bin:/bin").split(":");_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=8;case 8:_state.trys.push([8,17,18,19]);_iterator=r[Symbol.iterator]();_state.label=9;case 9:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,16];i10=_step.value;if(!i10)return[3,15];o11="".concat(i10.startsWith("/")?i10:e.fs.resolvePath(e.state.cwd,i10),"/").concat(t);return[4,e.fs.exists(o11)];case 10:if(!_state.sent())return[3,15];_state.label=11;case 11:_state.trys.push([11,13,,14]);return[4,e.fs.stat(o11)];case 12:if(_state.sent().isDirectory)return[3,15];return[3,14];case 13:a=_state.sent();return[3,15];case 14:return[2,"".concat(i10,"/").concat(t)];case 15:_iteratorNormalCompletion=true;return[3,9];case 16:return[3,19];case 17:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,19];case 18:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 19:if(e.commands.has(t)){_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=r[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){i11=_step1.value;if(i11==="/usr/bin"||i11==="/bin")return[2,"".concat(i11,"/").concat(t)]}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,"/usr/bin/".concat(t)]}return[2,null]}})})()}function gbt(e,t,r,n,i,o,a,s){return _async_to_generator(function(){var l,c,d,_r1,d10,u,d11;return _ts_generator(this,function(_state){switch(_state.label){case 0:l=e.ctx,c=e.runCommand;if(l.coverage&&lP.has(t)&&l.coverage.hit("bash:builtin:".concat(t)),t==="export")return[2,$_t(l,r)];if(t==="unset")return[2,nbt(l,r)];if(t==="exit")return[2,O_t(l,r)];if(t==="local")return[2,U_t(l,r)];if(t==="set")return[2,X_t(l,r)];if(t==="break")return[2,Pvt(l,r)];if(t==="continue")return[2,y_t(l,r)];if(t==="return")return[2,G_t(l,r)];if(t==="eval"&&l.state.options.posix)return[2,pbe(l,r,i)];if(t==="shift")return[2,ebt(l,r)];if(t==="getopts")return[2,r7e(l,r)];if(t==="compgen")return[2,t_t(l,r)];if(t==="complete")return[2,g_t(l,r)];if(t==="compopt")return[2,x_t(l,r)];if(!(t==="pushd"))return[3,2];return[4,P_t(l,r)];case 1:return[2,_state.sent()];case 2:if(t==="popd")return[2,R_t(l,r)];if(t==="dirs")return[2,M_t(l,r)];if(t==="source"||t===".")return[2,tbt(l,r)];if(t==="read")return[2,V_t(l,r,i,s)];if(t==="mapfile"||t==="readarray")return[2,B_t(l,r,i)];if(t==="declare"||t==="typeset")return[2,T_t(l,r)];if(t==="readonly")return[2,A_t(l,r)];if(!o){d=l.state.functions.get(t);if(d)return[2,Jke(l,d,r,i)]}if(t==="eval")return[2,pbe(l,r,i)];if(!(t==="cd"))return[3,4];return[4,Rvt(l,r)];case 3:return[2,_state.sent()];case 4:if(t===":"||t==="true")return[2,di];if(t==="false")return[2,Ca(!1)];if(t==="let")return[2,j_t(l,r)];if(t==="command")return[2,xbt(e,r,i)];if(t==="builtin")return[2,ybt(e,r,i)];if(t==="shopt")return[2,abt(l,r)];if(t==="exec"){if(r.length===0)return[2,di];_r1=_to_array(r),d10=_r1[0],u=_r1.slice(1);return[2,c(d10,u,[],i,!1,!1,-1)]}if(t==="wait")return[2,di];if(!(t==="type"))return[3,6];return[4,pbt(l,r,function(d){return hbt(l,d)},function(d){return s7e(l,d)})];case 5:return[2,_state.sent()];case 6:if(t==="hash")return[2,N_t(l,r)];if(t==="help")return[2,D_t(l,r)];if(t==="["||t==="test"){d11=r;if(t==="["){if(r[r.length-1]!=="]")return[2,ot("[: missing `]'\n",2)];d11=r.slice(0,-1)}return[2,S9(l,d11)]}return[2,null]}})})()}function xbt(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,l,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p,_l1,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=e.ctx,i=e.runCommand;if(t.length===0)return[2,di];o=!1,a=!1,s=!1,l=t;for(;l.length>0&&l[0].startsWith("-");){u=l[0];if(u==="--"){l=l.slice(1);break}_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=u.slice(1)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){p=_step.value;p==="p"?o=!0:p==="V"?a=!0:p==="v"&&(s=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}l=l.slice(1)}if(l.length===0)return[2,di];if(!(s||a))return[3,2];return[4,mbt(n,l,s,a)];case 1:return[2,_state.sent()];case 2:_l1=_to_array(l),c=_l1[0],d=_l1.slice(1);return[2,i(c,d,[],r,!0,o,-1)]}})})()}function ybt(e,t,r){return _async_to_generator(function(){var n,i,o,_i1,a;return _ts_generator(this,function(_state){n=e.runCommand;if(t.length===0)return[2,di];i=t;if(i[0]==="--"&&(i=i.slice(1),i.length===0))return[2,di];o=i[0];if(!lP.has(o))return[2,ot("bash: builtin: ".concat(o,": not a shell builtin\n"))];_i1=_to_array(i),a=_i1.slice(1);return[2,n(o,a,[],r,!0,!1,-1)]})})()}function vbt(e,t,r,n,i){return _async_to_generator(function(){var o,a,s,l,c,d,u,p,m,h,_$g,_tmp,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=e.ctx,a=e.buildExportedEnv,s=e.executeUserScript;return[4,lbt(o,t,i?"/usr/bin:/bin":void 0)];case 1:l=_state.sent();if(!l)return[2,Ivt(t)?ot("bash: ".concat(t,": command not available in browser environments. Exclude '").concat(t,"' from your commands or use the Node.js bundle.\n"),127):ot("bash: ".concat(t,": command not found\n"),127)];if("error"in l)return[2,l.error==="permission_denied"?ot("bash: ".concat(t,": Permission denied\n"),126):ot("bash: ".concat(t,": No such file or directory\n"),127)];if(!("script"in l))return[3,3];t.includes("/")||(o.state.hashTable||(o.state.hashTable=new Map),o.state.hashTable.set(t,l.path));return[4,s(l.path,r,n)];case 2:return[2,_state.sent()];case 3:c=l.cmd,d=l.path;t.includes("/")||(o.state.hashTable||(o.state.hashTable=new Map),o.state.hashTable.set(t,d));u=n||o.state.groupStdin||"",p=a(),m={fs:o.fs,cwd:o.state.cwd,env:o.state.env,exportedEnv:p,stdin:u,limits:o.limits,exec:o.execFn,fetch:o.fetch,getRegisteredCommands:function(){return Array.from(o.commands.keys())},sleep:o.sleep,trace:o.trace,fileDescriptors:o.state.fileDescriptors,xpgEcho:o.state.shoptOptions.xpg_echo,coverage:o.coverage,signal:o.state.signal,requireDefenseContext:o.requireDefenseContext,jsBootstrapCode:o.jsBootstrapCode,invokeTool:o.invokeTool},h=dbt(m,t);_state.label=4;case 4:_state.trys.push([4,9,,10]);_$g=function(){return Wh(o.requireDefenseContext,"command","".concat(t," execution"),function(){return c.execute(r,h)})};if(!c.trusted)return[3,6];return[4,hp.runTrustedAsync(function(){return _$g()})];case 5:_tmp=_state.sent();return[3,8];case 6:return[4,_$g()];case 7:_tmp=_state.sent();_state.label=8;case 8:return[2,_tmp];case 9:g=_state.sent();if(_instanceof(g,Qt)||_instanceof(g,nn))throw g;return[2,ot("".concat(t,": ").concat(la(cu(g)),"\n"))];case 10:return[2]}})})()}kl();jr();wl();function l7e(e,t){return _async_to_generator(function(){var r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=e.state.inCondition;e.state.inCondition=!0;n="",i="",o=0;_state.label=1;case 1:_state.trys.push([1,,10,11]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=t[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];a=_step.value;return[4,e.executeStatement(a)];case 4:s=_state.sent();n+=s.stdout,i+=s.stderr,o=s.exitCode;_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[3,11];case 10:e.state.inCondition=r;return[7];case 11:return[2,{stdout:n,stderr:i,exitCode:o}]}})})()}jr();ic();function uP(e,t,r,n){if(_instanceof(e,Nf))return t+=e.stdout,r+=e.stderr,e.levels>1&&n>1?(e.levels--,e.stdout=t,e.stderr=r,{action:"rethrow",stdout:t,stderr:r,error:e}):{action:"break",stdout:t,stderr:r};if(_instanceof(e,Df))return t+=e.stdout,r+=e.stderr,e.levels>1&&n>1?(e.levels--,e.stdout=t,e.stderr=r,{action:"rethrow",stdout:t,stderr:r,error:e}):{action:"continue",stdout:t,stderr:r};if(_instanceof(e,Lf)||_instanceof(e,qh)||_instanceof(e,Ci)||_instanceof(e,Qt))return e.prependOutput(t,r),{action:"rethrow",stdout:t,stderr:r,error:e};var i=cu(e);return{action:"error",stdout:t,stderr:"".concat(r).concat(i,"\n"),exitCode:1}}jr();ic();function XW(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return _async_to_generator(function(){var i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$s,l,err,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=r,o=n,a=0;_state.label=1;case 1:_state.trys.push([1,10,,11]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=t[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];_$s=_step.value;return[4,e.executeStatement(_$s)];case 4:l=_state.sent();i+=l.stdout,o+=l.stderr,a=l.exitCode;_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[3,11];case 10:s=_state.sent();if(Ube(s)||_instanceof(s,qh)||_instanceof(s,Ci)||_instanceof(s,Qt)||_instanceof(s,o5))throw s.prependOutput(i,o),s;return[2,{stdout:i,stderr:"".concat(o).concat(cu(s),"\n"),exitCode:1}];case 11:return[2,{stdout:i,stderr:o,exitCode:a}]}})})()}function _bt(e,t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="",n="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=t.clauses[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];i=_step.value;return[4,l7e(e,i.condition)];case 3:o=_state.sent();if(r+=o.stdout,n+=o.stderr,o.exitCode===0)return[2,XW(e,i.body,r,n)];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2,t.elseBody?XW(e,t.elseBody,r,n):ft(r,n,0)]}})})()}function bbt(e,t){return _async_to_generator(function(){var c,r,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$d,_s1,_$u,err,d,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$d1,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_$u1,p,err,u,p10,m,err,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r1(e,t.redirections)];case 1:r=_state.sent();if(r)return[2,r];n="",i="",o=0,a=0;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t.variable))return[2,ot("bash: `".concat(t.variable,"': not a valid identifier\n"))];s=[];if(!(t.words===null))return[3,2];s=(e.state.env.get("@")||"").split(" ").filter(Boolean);return[3,13];case 2:if(!(t.words.length===0))return[3,3];s=[];return[3,13];case 3:_state.trys.push([3,12,,13]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,9,10,11]);_iterator=t.words[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];_$d=_step.value;return[4,l1(e,_$d)];case 6:_$u=_state.sent();(_s1=s).push.apply(_s1,_to_consumable_array(_$u.values));_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[3,13];case 12:d=_state.sent();if(_instanceof(d,i5))return[2,{stdout:"",stderr:d.stderr,exitCode:1}];throw d;case 13:e.state.loopDepth++;_state.label=14;case 14:_state.trys.push([14,,32,33]);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=15;case 15:_state.trys.push([15,29,30,31]);_iterator1=s[Symbol.iterator]();_state.label=16;case 16:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,28];_$d1=_step1.value;a++,a>e.limits.maxLoopIterations&&u1("for loop: too many iterations (".concat(e.limits.maxLoopIterations,"), increase executionLimits.maxLoopIterations"),"iterations",n,i),e.state.env.set(t.variable,_$d1);_state.label=17;case 17:_state.trys.push([17,26,,27]);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=18;case 18:_state.trys.push([18,23,24,25]);_iterator2=t.body[Symbol.iterator]();_state.label=19;case 19:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,22];_$u1=_step2.value;return[4,e.executeStatement(_$u1)];case 20:p=_state.sent();n+=p.stdout,i+=p.stderr,o=p.exitCode;_state.label=21;case 21:_iteratorNormalCompletion2=true;return[3,19];case 22:return[3,25];case 23:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,25];case 24:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 25:return[3,27];case 26:u=_state.sent();p10=uP(u,n,i,e.state.loopDepth);if(n=p10.stdout,i=p10.stderr,p10.action==="break")return[3,28];if(p10.action==="continue")return[3,27];if(p10.action==="error"){m=ft(n,i,(c=p10.exitCode)!=null?c:1);return[2,vo(e,m,t.redirections)]}throw p10.error;case 27:_iteratorNormalCompletion1=true;return[3,16];case 28:return[3,31];case 29:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,31];case 30:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 31:return[3,33];case 32:e.state.loopDepth--;return[7];case 33:l=ft(n,i,o);return[2,vo(e,l,t.redirections)]}})})()}function wbt(e,t){return _async_to_generator(function(){var c,r,n,i,o,a,s,_tmp,_tmp1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$d,u,err,d,u10,_tmp2,p,_tmp3,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r1(e,t.redirections)];case 1:r=_state.sent();if(r)return[2,r];n=t.line;n!==void 0&&(e.state.currentLine=n);i="",o="",a=0,s=0;_tmp=t.init;if(!_tmp)return[3,3];return[4,Xt(e,t.init.expression)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp,e.state.loopDepth++;_state.label=4;case 4:_state.trys.push([4,,26,27]);_state.label=5;case 5:s++,s>e.limits.maxLoopIterations&&u1("for loop: too many iterations (".concat(e.limits.maxLoopIterations,"), increase executionLimits.maxLoopIterations"),"iterations",i,o);_tmp1=t.condition;if(!_tmp1)return[3,7];n!==void 0&&(e.state.currentLine=n);return[4,Xt(e,t.condition.expression)];case 6:_tmp1=_state.sent()===0;_state.label=7;case 7:if(!!_tmp1)return[3,25];_state.label=8;case 8:_state.trys.push([8,17,,21]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=9;case 9:_state.trys.push([9,14,15,16]);_iterator=t.body[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];_$d=_step.value;return[4,e.executeStatement(_$d)];case 11:u=_state.sent();i+=u.stdout,o+=u.stderr,a=u.exitCode;_state.label=12;case 12:_iteratorNormalCompletion=true;return[3,10];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:return[3,21];case 17:d=_state.sent();u10=uP(d,i,o,e.state.loopDepth);if(i=u10.stdout,o=u10.stderr,u10.action==="break")return[3,25];if(!(u10.action==="continue"))return[3,20];_tmp2=t.update;if(!_tmp2)return[3,19];return[4,Xt(e,t.update.expression)];case 18:_tmp2=_state.sent();_state.label=19;case 19:_tmp2;return[3,24];case 20:if(u10.action==="error"){p=ft(i,o,(c=u10.exitCode)!=null?c:1);return[2,vo(e,p,t.redirections)]}throw u10.error;case 21:_tmp3=t.update;if(!_tmp3)return[3,23];return[4,Xt(e,t.update.expression)];case 22:_tmp3=_state.sent();_state.label=23;case 23:_tmp3;_state.label=24;case 24:return[3,5];case 25:return[3,27];case 26:e.state.loopDepth--;return[7];case 27:l=ft(i,o,a);return[2,vo(e,l,t.redirections)]}})})()}function Sbt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return _async_to_generator(function(){var c,n,i,o,a,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,p,_,_10,u10,p10,u11,p11,err,l,d10,u12,p12,m,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$h,g,err,h,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_$h1,g10,err,h10,g11;return _ts_generator(this,function(_state){switch(_state.label){case 0:n="",i="",o=0,a=0,s=r;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,14,15,16]);_iterator=t.redirections[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];d=_step.value;if(!((d.operator==="<<"||d.operator==="<<-")&&d.target.type==="HereDoc"))return[3,4];u=d.target;return[4,pr(e,u.content)];case 3:p=_state.sent();u.stripTabs&&(p=p.split("\n").map(function(m){return m.replace(/^\t+/,"")}).join("\n")),s=p;return[3,12];case 4:if(!(d.operator==="<<<"&&d.target.type==="Word"))return[3,6];_10=(_="").concat;return[4,pr(e,d.target)];case 5:s=_10.apply(_,[_state.sent(),"\n"]);return[3,12];case 6:if(!(d.operator==="<"&&d.target.type==="Word"))return[3,12];_state.label=7;case 7:_state.trys.push([7,10,,12]);return[4,pr(e,d.target)];case 8:u10=_state.sent(),p10=e.fs.resolvePath(e.state.cwd,u10);return[4,e.fs.readFile(p10)];case 9:s=_state.sent();return[3,12];case 10:u11=_state.sent();return[4,pr(e,d.target)];case 11:p11=_state.sent();return[2,ot("bash: ".concat(p11,": No such file or directory\n"))];case 12:_iteratorNormalCompletion=true;return[3,2];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:l=e.state.groupStdin;s&&(e.state.groupStdin=s),e.state.loopDepth++;_state.label=17;case 17:_state.trys.push([17,,43,44]);_state.label=18;case 18:a++,a>e.limits.maxLoopIterations&&u1("while loop: too many iterations (".concat(e.limits.maxLoopIterations,"), increase executionLimits.maxLoopIterations"),"iterations",n,i);d10=0,u12=!1,p12=!1,m=e.state.inCondition;e.state.inCondition=!0;_state.label=19;case 19:_state.trys.push([19,28,29,30]);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=20;case 20:_state.trys.push([20,25,26,27]);_iterator1=t.condition[Symbol.iterator]();_state.label=21;case 21:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,24];_$h=_step1.value;return[4,e.executeStatement(_$h)];case 22:g=_state.sent();n+=g.stdout,i+=g.stderr,d10=g.exitCode;_state.label=23;case 23:_iteratorNormalCompletion1=true;return[3,21];case 24:return[3,27];case 25:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,27];case 26:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 27:return[3,30];case 28:h=_state.sent();if(_instanceof(h,Nf)){if(n+=h.stdout,i+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=n,h.stderr=i,e.state.inCondition=m,h;u12=!0}else if(_instanceof(h,Df)){if(n+=h.stdout,i+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=n,h.stderr=i,e.state.inCondition=m,h;p12=!0}else throw e.state.inCondition=m,h;return[3,30];case 29:e.state.inCondition=m;return[7];case 30:if(u12)return[3,42];if(!!p12)return[3,41];if(d10!==0)return[3,42];_state.label=31;case 31:_state.trys.push([31,40,,41]);_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=32;case 32:_state.trys.push([32,37,38,39]);_iterator2=t.body[Symbol.iterator]();_state.label=33;case 33:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,36];_$h1=_step2.value;return[4,e.executeStatement(_$h1)];case 34:g10=_state.sent();n+=g10.stdout,i+=g10.stderr,o=g10.exitCode;_state.label=35;case 35:_iteratorNormalCompletion2=true;return[3,33];case 36:return[3,39];case 37:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,39];case 38:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 39:return[3,41];case 40:h10=_state.sent();g11=uP(h10,n,i,e.state.loopDepth);if(n=g11.stdout,i=g11.stderr,g11.action==="break")return[3,42];if(g11.action==="continue")return[3,41];if(g11.action==="error")return[2,ft(n,i,(c=g11.exitCode)!=null?c:1)];throw g11.error;case 41:return[3,18];case 42:return[3,44];case 43:e.state.loopDepth--,e.state.groupStdin=l;return[7];case 44:return[2,ft(n,i,o)]}})})()}function kbt(e,t){return _async_to_generator(function(){var a,r,n,i,o,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$l,c,err,l,c10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r="",n="",i=0,o=0;e.state.loopDepth++;_state.label=1;case 1:_state.trys.push([1,,16,17]);_state.label=2;case 2:o++,o>e.limits.maxLoopIterations&&u1("until loop: too many iterations (".concat(e.limits.maxLoopIterations,"), increase executionLimits.maxLoopIterations"),"iterations",r,n);return[4,l7e(e,t.condition)];case 3:s=_state.sent();if(r+=s.stdout,n+=s.stderr,s.exitCode===0)return[3,15];_state.label=4;case 4:_state.trys.push([4,13,,14]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,10,11,12]);_iterator=t.body[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];_$l=_step.value;return[4,e.executeStatement(_$l)];case 7:c=_state.sent();r+=c.stdout,n+=c.stderr,i=c.exitCode;_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,6];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:return[3,14];case 13:l=_state.sent();c10=uP(l,r,n,e.state.loopDepth);if(r=c10.stdout,n=c10.stderr,c10.action==="break")return[3,15];if(c10.action==="continue")return[3,14];if(c10.action==="error")return[2,ft(r,n,(a=c10.exitCode)!=null?a:1)];throw c10.error;case 14:return[3,2];case 15:return[3,17];case 16:e.state.loopDepth--;return[7];case 17:return[2,ft(r,n,i)]}})})()}function Cbt(e,t){return _async_to_generator(function(){var r,n,i,o,a,s,c,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,p,m,h,g,err,p10,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r1(e,t.redirections)];case 1:r=_state.sent();if(r)return[2,r];n="",i="",o=0;return[4,pr(e,t.word)];case 2:a=_state.sent(),s=!1;c=0;_state.label=3;case 3:if(!(c<t.items.length))return[3,15];d=t.items[c],u=s;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(!!s)return[3,11];_state.label=4;case 4:_state.trys.push([4,9,10,11]);_iterator=d.patterns[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];p=_step.value;return[4,pr(e,p)];case 6:m=_state.sent();Mke(p)&&(m=xp(m));h=e.state.shoptOptions.nocasematch,g=e.state.shoptOptions.extglob;if(ZV(a,m,h,g)){u=!0;return[3,8]}_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:if(!u)return[3,13];return[4,XW(e,d.body,n,i)];case 12:p10=_state.sent();if(n=p10.stdout,i=p10.stderr,o=p10.exitCode,d.terminator===";;")return[3,15];d.terminator===";&"?s=!0:s=!1;return[3,14];case 13:s=!1;_state.label=14;case 14:c++;return[3,3];case 15:l=ft(n,i,o);return[2,vo(e,l,t.redirections)]}})})()}jr();wl();function Sbe(e,t){if(e.parts.length!==1)return!1;var r=e.parts[0];return r.type!=="Literal"?!1:t.includes(r.value)}function Ebt(e){if(!e.startsWith("__rw__:"))return null;var t=e.slice(7),r=t.indexOf(":");if(r===-1)return null;var n=Number.parseInt(t.slice(0,r),10);if(Number.isNaN(n)||n<0)return null;var i=r+1,o=t.slice(i,i+n),a=i+n+1,s=t.slice(a),l=s.indexOf(":");if(l===-1)return null;var c=Number.parseInt(s.slice(0,l),10);if(Number.isNaN(c)||c<0)return null;var d=s.slice(l+1);return{path:o,position:c,content:d}}jo();wl();var kbe="+ ";function u7e(e){return _async_to_generator(function(){var t,r,r10;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e.state.env.get("PS4");if(t===void 0)return[2,kbe];if(t==="")return[2,""];_state.label=1;case 1:_state.trys.push([1,3,,4]);r=new Pn().parseWordFromString(t,!1,!1);return[4,pr(e,r)];case 2:return[2,_state.sent()];case 3:r10=_state.sent();return[2,(e.state.expansionStderr="".concat(e.state.expansionStderr||"","bash: ").concat(t,": bad substitution\n"),t||kbe)];case 4:return[2]}})})()}function Tbt(e){return e.map(function(t){return Abt(t)}).join(" ")}function Abt(e){if(e==="")return"''";if(!/[\s'"\\$`!*?[\]{}|&;<>()~#\n\t]/.test(e))return e;var t=/[\x00-\x1f\x7f]/.test(e),r=e.includes("\n"),n=e.includes(" "),i=e.includes("\\"),o=e.includes("'");if(t||r||n||i){var a="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;var l=s.charCodeAt(0);s==="\n"?a+="\\n":s===" "?a+="\\t":s==="\\"?a+="\\\\":s==="'"?a+="'":s==='"'?a+='"':l<32||l===127?l<256?a+="\\x".concat(l.toString(16).padStart(2,"0")):a+="\\u".concat(l.toString(16).padStart(4,"0")):a+=s}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"$'".concat(a,"'")}return o?'"'.concat(e.replace(/([\\$`"])/g,"\\$1"),'"'):"'".concat(e,"'")}function Ibt(e,t,r){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.state.options.xtrace)return[2,""];return[4,u7e(e)];case 1:n=_state.sent(),i=[t].concat(_to_consumable_array(r)),o=Tbt(i);return[2,"".concat(n).concat(o,"\n")]}})})()}function Pbt(e,t,r){return _async_to_generator(function(){var _tmp,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.state.options.xtrace)return[3,2];_10=(_="").concat;return[4,u7e(e)];case 1:_tmp=_10.apply(_,[_state.sent()]).concat(t,"=").concat(r,"\n");return[3,3];case 2:_tmp="";_state.label=3;case 3:return[2,_tmp]}})})()}kr();K9();jr();function Rbt(e,t,r){return _async_to_generator(function(){var u,p,n,i,o,a,s,l,c,d,m,h,g,x,v,y,_,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m10,m11,m12,h10,g10,x10;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=t.timed?JS():0,i="",o=di,a=0,s=[],l="",c=t.commands.length>1,d=e.state.lastArg;m=0;_state.label=1;case 1:if(!(m<t.commands.length))return[3,7];h=t.commands[m],g=m===t.commands.length-1,x=m===0;c&&(e.state.lastArg="",x||(e.state.groupStdin=void 0));v=c&&(!g||!e.state.shoptOptions.lastpipe)?new Map(e.state.env):null,y=void 0;_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,r(h,i)];case 3:y=_state.sent();return[3,5];case 4:_=_state.sent();if(_instanceof(_,$f))y={stdout:_.stdout,stderr:_.stderr,exitCode:1};else if(_instanceof(_,Ci)&&t.commands.length>1)y={stdout:_.stdout,stderr:_.stderr,exitCode:_.exitCode};else if(_instanceof(_,qh)&&t.commands.length>1)y={stdout:_.stdout,stderr:_.stderr,exitCode:_.exitCode};else throw v&&(e.state.env=v),_;return[3,5];case 5:v&&(e.state.env=v),s.push(y.exitCode),y.exitCode!==0&&(a=y.exitCode),g?o=y:((p=(u=t.pipeStderr)==null?void 0:u[m])!=null&&p?i=n1(y.stderr)+hye(y):(i=hye(y),l+=y.stderr),o={stdout:"",stderr:"",exitCode:y.exitCode});_state.label=6;case 6:m++;return[3,1];case 7:if(l&&(o=_object_spread_props(_object_spread({},o),{stderr:l+o.stderr})),t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e.state.env.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){m10=_step.value;m10.startsWith("PIPESTATUS_")&&e.state.env.delete(m10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}for(m11=0;m11<s.length;m11++)e.state.env.set("PIPESTATUS_".concat(m11),String(s[m11]));e.state.env.set("PIPESTATUS__length",String(s.length))}if(e.state.options.pipefail&&a!==0&&(o=_object_spread_props(_object_spread({},o),{exitCode:a})),t.negated&&(o=_object_spread_props(_object_spread({},o),{exitCode:o.exitCode===0?1:0})),t.timed){m12=(JS()-n)/1e3,h10=Math.floor(m12/60),g10=m12%60;t.timePosix?x10="real ".concat(m12.toFixed(2),"\nuser 0.00\nsys 0.00\n"):x10="\nreal ".concat("".concat(h10,"m").concat(g10.toFixed(3),"s"),"\nuser 0m0.000s\nsys 0m0.000s\n"),o=_object_spread_props(_object_spread({},o),{stderr:o.stderr+x10})}return[2,(c&&!e.state.shoptOptions.lastpipe&&(e.state.lastArg=d),o)]}})})()}Ns();jo();kl();jr();wl();nd();_p();f1();function Mbt(e,t){return _async_to_generator(function(){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,c,a,_tmp,s,c10,l,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Map,n="";_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,13,14,15]);_iterator=t.assignments[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];i=_step.value;o=i.name;if(!i.array)return[3,4];return[4,Obt(e,t,o,i.array,i.append,r)];case 3:c=_state.sent();if(c.error)return[2,{continueToNext:!1,xtraceOutput:n,tempAssignments:r,error:c.error}];if(n+=c.xtraceOutput,c.continueToNext)return[3,11];_state.label=4;case 4:if(!i.value)return[3,6];return[4,pr(e,i.value)];case 5:_tmp=_state.sent();return[3,7];case 6:_tmp="";_state.label=7;case 7:a=_tmp;if(o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[\]$/))return[2,{continueToNext:!1,xtraceOutput:n,tempAssignments:r,error:ft("","bash: ".concat(o,": bad array subscript\n"),1)}];s=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(!s)return[3,9];return[4,Fbt(e,t,s[1],s[2],a,i.append,r)];case 8:c10=_state.sent();if(c10.error)return[2,{continueToNext:!1,xtraceOutput:n,tempAssignments:r,error:c10.error}];if(c10.continueToNext)return[3,11];_state.label=9;case 9:return[4,jbt(e,t,o,a,i.append,r)];case 10:l=_state.sent();if(l.error)return[2,{continueToNext:!1,xtraceOutput:n,tempAssignments:r,error:l.error}];n+=l.xtraceOutput,l.continueToNext;_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,2];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:return[2,{continueToNext:!1,xtraceOutput:n,tempAssignments:r}]}})})()}function Obt(e,t,r,n,i,o){return _async_to_generator(function(){var d,a,u,p,u10,s,l,c,_tmp,_tmp1,u11;return _ts_generator(this,function(_state){switch(_state.label){case 0:a="";if(/\[.+\]$/.test(r))return[2,{continueToNext:!1,xtraceOutput:"",error:ft("","bash: ".concat(r,": cannot assign list to array member\n"),1)}];if(no(e,r)){u=rP(e,r);if(u===void 0||u==="")throw new Ci(1,"","");p=gp(e,r);if(p&&/^[a-zA-Z_][a-zA-Z0-9_]*\[@\]$/.test(p))return[2,{continueToNext:!1,xtraceOutput:"",error:ft("","bash: ".concat(r,": cannot assign list to array member\n"),1)}]}if(s1(e,r)){if(t.name)return[2,(a+="bash: ".concat(r,": readonly variable\n"),{continueToNext:!0,xtraceOutput:a})];u10=Ms(e,r);if(u10)return[2,{continueToNext:!1,xtraceOutput:"",error:u10}]}s=(d=e.state.associativeArrays)==null?void 0:d.has(r),l=$bt(n),c=function(){var u="".concat(r,"_");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.state.env.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var p=_step.value;p.startsWith(u)&&!p.includes("__")&&e.state.env.delete(p)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}e.state.env.delete(r)};if(!(s&&l))return[3,2];return[4,Nbt(e,t,r,n,i,c,function(u){a+=u})];case 1:_tmp=_state.sent();return[3,7];case 2:if(!l)return[3,4];return[4,Dbt(e,r,n,i,c)];case 3:_tmp1=_state.sent();return[3,6];case 4:return[4,Lbt(e,r,n,i,c)];case 5:_tmp1=_state.sent();_state.label=6;case 6:_tmp=_tmp1;_state.label=7;case 7:if(_tmp,t.name){o.set(r,e.state.env.get(r));u11="(".concat(n.map(function(p){return tP(p)}).join(" "),")");e.state.env.set(r,u11)}return[2,{continueToNext:!0,xtraceOutput:a}]}})})()}function $bt(e){return e.some(function(t){if(t.parts.length>=2){var r=t.parts[0],n=t.parts[1];if(r.type!=="Glob"||!r.pattern.startsWith("["))return!1;if(r.pattern==="["&&(n.type==="DoubleQuoted"||n.type==="SingleQuoted")){if(t.parts.length<3)return!1;var i=t.parts[2];return i.type!=="Literal"?!1:i.value.startsWith("]=")||i.value.startsWith("]+=")}return n.type!=="Literal"?!1:n.value.startsWith("]")?n.value.startsWith("]=")||n.value.startsWith("]+="):r.pattern.endsWith("]")?n.value.startsWith("=")||n.value.startsWith("+="):!1}return!1})}function Nbt(e,t,r,n,i,o,a){return _async_to_generator(function(){var l,c,d,s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,u,p,m,h,g,x,_tmp,m10,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,u10,p10,p11;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=n[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];u=_step.value;p=_ke(u);if(!p)return[3,6];m=p.key,h=p.valueParts,g=p.append,x=void 0;if(!(h.length>0))return[3,4];return[4,pr(e,{type:"Word",parts:h})];case 3:_tmp=x=_state.sent();return[3,5];case 4:_tmp=x="";_state.label=5;case 5:_tmp,x=sa(e,x),s.push({type:"keyed",key:m,value:x,append:g});return[3,8];case 6:return[4,pr(e,u)];case 7:m10=_state.sent();s.push({type:"invalid",expandedValue:m10});_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:i||o();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=s[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){u10=_step1.value;if(u10.type==="keyed")if(u10.append){p10=(l=e.state.env.get("".concat(r,"_").concat(u10.key)))!=null?l:"";e.state.env.set("".concat(r,"_").concat(u10.key),p10+u10.value)}else e.state.env.set("".concat(r,"_").concat(u10.key),u10.value);else{p11=(d=(c=t.line)!=null?c:e.state.currentLine)!=null?d:1;a("bash: line ".concat(p11,": ").concat(r,": ").concat(u10.expandedValue,": must use subscript when assigning associative array\n"))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2]}})})()}function Dbt(e,t,r,n,i){return _async_to_generator(function(){var s,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,d,u,p,m,_tmp,d10,err,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator1,_step1,l10,c10,d11,u10,d12,u11,d13,_iterator2,_step2,c11,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,10,11,12]);_iterator=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,9];l=_step.value;c=_ke(l);if(!c)return[3,6];d=c.key,u=c.valueParts,p=c.append,m=void 0;if(!(u.length>0))return[3,4];return[4,pr(e,{type:"Word",parts:u})];case 3:_tmp=m=_state.sent();return[3,5];case 4:_tmp=m="";_state.label=5;case 5:_tmp,m=sa(e,m),o.push({type:"keyed",indexExpr:d,value:m,append:p});return[3,8];case 6:return[4,l1(e,l)];case 7:d10=_state.sent();o.push({type:"non-keyed",values:d10.values});_state.label=8;case 8:_iteratorNormalCompletion=true;return[3,2];case 9:return[3,12];case 10:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,12];case 11:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 12:n||i();a=0;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined,_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=13;case 13:_state.trys.push([13,22,23,24]);_iterator1=o[Symbol.iterator]();_state.label=14;case 14:if(!!(_iteratorNormalCompletion2=(_step1=_iterator1.next()).done))return[3,21];l10=_step1.value;if(!(l10.type==="keyed"))return[3,19];c10=void 0;_state.label=15;case 15:_state.trys.push([15,17,,18]);d11=new Pn,u10=Ki(d11,l10.indexExpr);return[4,Xt(e,u10.expression,!1)];case 16:c10=_state.sent();return[3,18];case 17:d12=_state.sent();if(/^-?\d+$/.test(l10.indexExpr))c10=Number.parseInt(l10.indexExpr,10);else{u11=e.state.env.get(l10.indexExpr);c10=u11?Number.parseInt(u11,10):0,Number.isNaN(c10)&&(c10=0)}return[3,18];case 18:if(l10.append){d13=(s=e.state.env.get("".concat(t,"_").concat(c10)))!=null?s:"";e.state.env.set("".concat(t,"_").concat(c10),d13+l10.value)}else e.state.env.set("".concat(t,"_").concat(c10),l10.value);a=c10+1;return[3,20];case 19:try{for(_iterator2=l10.values[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step2=_iterator2.next()).done);_iteratorNormalCompletion1=true){c11=_step2.value;e.state.env.set("".concat(t,"_").concat(a++),c11)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=20;case 20:_iteratorNormalCompletion2=true;return[3,14];case 21:return[3,24];case 22:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,24];case 23:try{if(!_iteratorNormalCompletion2&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 24:return[2]}})})()}function Lbt(e,t,r,n,i){return _async_to_generator(function(){var o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,_o1,l,err,a,_Math,s10,l10,s11;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=r[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];s=_step.value;return[4,l1(e,s)];case 3:l=_state.sent();(_o1=o).push.apply(_o1,_to_consumable_array(l.values));_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:a=0;if(n){;s10=zr(e,t);if(s10.length>0)a=(_Math=Math).max.apply(_Math,_to_consumable_array(s10.map(function(param){var _param=_sliced_to_array(param,1),l=_param[0];return typeof l=="number"?l:0})))+1;else{l10=e.state.env.get(t);l10!==void 0&&(e.state.env.set("".concat(t,"_0"),l10),e.state.env.delete(t),a=1)}}else i();for(s11=0;s11<o.length;s11++)e.state.env.set("".concat(t,"_").concat(a+s11),o[s11]);n||e.state.env.set("".concat(t,"__length"),String(o.length));return[2]}})})()}function Fbt(e,t,r,n,i,o,a){return _async_to_generator(function(){var u,s,p,p10,l,c,p11,d,p12,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=r;if(no(e,r)){p=gp(e,r);if(p&&p!==r){if(p.includes("["))return[2,{continueToNext:!1,xtraceOutput:"",error:ft("","bash: `".concat(p,"': not a valid identifier\n"),1)}];s=p}}if(s1(e,s)){if(t.name)return[2,{continueToNext:!0,xtraceOutput:""}];p10=Ms(e,s);if(p10)return[2,{continueToNext:!1,xtraceOutput:"",error:p10}]}l=(u=e.state.associativeArrays)==null?void 0:u.has(s);if(!l)return[3,2];return[4,c7e(e,s,n)];case 1:c=_state.sent();return[3,4];case 2:return[4,zbt(e,s,n)];case 3:p11=_state.sent();if(p11.error)return[2,{continueToNext:!1,xtraceOutput:"",error:p11.error}];c="".concat(s,"_").concat(p11.index);_state.label=4;case 4:d=o?(e.state.env.get(c)||"")+i:i;if(t.name)a.set(c,e.state.env.get(c)),e.state.env.set(c,d);else{p12=ZW(e,s);if(p12!==void 0&&p12===e.state.callDepth&&e.state.localScopes.length>0){m=e.state.localScopes[e.state.localScopes.length-1];m.has(c)||m.set(c,e.state.env.get(c))}e.state.env.set(c,d)}return[2,{continueToNext:!0,xtraceOutput:""}]}})})()}function c7e(e,t,r){return _async_to_generator(function(){var n,i,o,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(r.startsWith("'")&&r.endsWith("'")))return[3,1];n=r.slice(1,-1);return[3,6];case 1:if(!(r.startsWith('"')&&r.endsWith('"')))return[3,3];i=r.slice(1,-1),o=new Pn().parseWordFromString(i,!0,!1);return[4,pr(e,o)];case 2:n=_state.sent();return[3,6];case 3:if(!r.includes("$"))return[3,5];i10=new Pn().parseWordFromString(r,!1,!1);return[4,pr(e,i10)];case 4:n=_state.sent();return[3,6];case 5:n=r;_state.label=6;case 6:return[2,"".concat(t,"_").concat(n)]}})})()}function zbt(e,t,r){return _async_to_generator(function(){var n,i,_$o,a,o,s,a9,_Math,_$o1,a10,a11;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=r;r.startsWith('"')&&r.endsWith('"')&&r.length>=2&&(n=r.slice(1,-1));if(!/^-?\d+$/.test(n))return[3,1];i=Number.parseInt(n,10);return[3,5];case 1:_state.trys.push([1,3,,4]);_$o=new Pn,a=Ki(_$o,n);return[4,Xt(e,a.expression,!1)];case 2:i=_state.sent();return[3,4];case 3:o=_state.sent();if(_instanceof(o,Hi)){s="bash: line ".concat(e.state.currentLine,": ").concat(r,": ").concat(o.message,"\n");if(o.fatal)throw new Ci(1,"",s);return[2,{index:0,error:ft("",s,1)}]}a9=e.state.env.get(r);i=a9?Number.parseInt(a9,10):0;return[3,4];case 4:Number.isNaN(i)&&(i=0);_state.label=5;case 5:if(i<0){;_$o1=zr(e,t);if(_$o1.length===0){a10=e.state.currentLine;return[2,{index:0,error:ft("","bash: line ".concat(a10,": ").concat(t,"[").concat(r,"]: bad array subscript\n"),1)}]}if(i=(_Math=Math).max.apply(_Math,_to_consumable_array(_$o1.map(function(param){var _param=_sliced_to_array(param,1),a=_param[0];return typeof a=="number"?a:0})))+1+i,i<0){a11=e.state.currentLine;return[2,{index:0,error:ft("","bash: line ".concat(a11,": ").concat(t,"[").concat(r,"]: bad array subscript\n"),1)}]}}return[2,{index:i}]}})})()}function jbt(e,t,r,n,i,o){return _async_to_generator(function(){var u,a,s,l,p,m,p10,c,p11,m10,h,m11,p12,_ref,p13,m12,d,_ref1,p14;return _ts_generator(this,function(_state){switch(_state.label){case 0:a="",s=r,l=null;if(no(e,r)){p=fyt(e,r,n);if(p===void 0)return[2,{continueToNext:!1,xtraceOutput:"",error:ft("","bash: ".concat(r,": circular name reference\n"),1)}];if(p===null)return[2,{continueToNext:!0,xtraceOutput:""}];s=p;m=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);m&&(l={arrayName:m[1],subscriptExpr:m[2]},s=m[1])}if(s1(e,s)){if(t.name)return[2,(a+="bash: ".concat(s,": readonly variable\n"),{continueToNext:!0,xtraceOutput:a})];p10=Ms(e,s);if(p10)return[2,{continueToNext:!1,xtraceOutput:"",error:p10}]}if(!QW(e,s))return[3,8];_state.label=1;case 1:_state.trys.push([1,6,,7]);p11=new Pn;if(!i)return[3,3];m10="(".concat(e.state.env.get(s)||"0",") + (").concat(n,")"),h=Ki(p11,m10);return[4,Xt(e,h.expression)];case 2:c=String.apply(void 0,[_state.sent()]);return[3,5];case 3:m11=Ki(p11,n);return[4,Xt(e,m11.expression)];case 4:c=String.apply(void 0,[_state.sent()]);_state.label=5;case 5:return[3,7];case 6:p12=_state.sent();c="0";return[3,7];case 7:return[3,10];case 8:return[4,Promise.resolve().then(function(){return wl(),BW})];case 9:_ref=_state.sent(),p13=_ref.isArray,m12=p13(e,s)?"".concat(s,"_0"):s;c=i?(e.state.env.get(m12)||"")+n:n;_state.label=10;case 10:c=k9(e,s,c);return[4,Pbt(e,s,c)];case 11:a=a+_state.sent();d=s;if(!l)return[3,13];return[4,Ubt(e,l)];case 12:d=_state.sent();return[3,15];case 13:return[4,Promise.resolve().then(function(){return wl(),BW})];case 14:_ref1=_state.sent(),p14=_ref1.isArray;p14(e,s)&&(d="".concat(s,"_0"));_state.label=15;case 15:return[2,(t.name?(o.set(d,e.state.env.get(d)),e.state.env.set(d,c)):(e.state.env.set(d,c),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(s)),(u=e.state.tempEnvBindings)!=null&&u.some(function(p){return p.has(s)})&&(e.state.mutatedTempEnvVars=e.state.mutatedTempEnvVars||new Set,e.state.mutatedTempEnvVars.add(s))),{continueToNext:!1,xtraceOutput:a})]}})})()}function Ubt(e,t){return _async_to_generator(function(){var o,r,n,i,a,s,a9,s10,_Math,a10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.arrayName,n=t.subscriptExpr;if((o=e.state.associativeArrays)!=null&&o.has(r))return[2,c7e(e,r,n)];if(!/^-?\d+$/.test(n))return[3,1];i=Number.parseInt(n,10);return[3,5];case 1:_state.trys.push([1,3,,4]);a=new Pn,s=Ki(a,n);return[4,Xt(e,s.expression,!1)];case 2:i=_state.sent();return[3,4];case 3:a9=_state.sent();s10=e.state.env.get(n);i=s10?Number.parseInt(s10,10):0;return[3,4];case 4:Number.isNaN(i)&&(i=0);_state.label=5;case 5:if(i<0){;a10=zr(e,r);a10.length>0&&(i=(_Math=Math).max.apply(_Math,_to_consumable_array(a10.map(function(s){return s[0]})))+1+i)}return[2,"".concat(r,"_").concat(i)]}})})()}jo();jr();wl();ic();function Bbt(e,t,r,n){return _async_to_generator(function(){var i,o,a,s,l,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,_$k,E,m,h,g,x,v,y,_,b,w,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$k1,E1,err,k,C,C1,C10,C11,C12,E10,S;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r1(e,t.redirections)];case 1:i=_state.sent();if(i)return[2,i];o=new Map(e.state.env),a=e.state.cwd,s=_object_spread({},e.state.options),l=new Map(e.state.functions),c=e.state.localScopes,d=e.state.localVarStack,u=e.state.localVarDepth,p=e.state.fullyUnsetLocals;if(e.state.localScopes=c.map(function(k){return new Map(k)}),d){e.state.localVarStack=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=d.entries()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),_$k=_step_value[0],E=_step_value[1];e.state.localVarStack.set(_$k,E.map(function(C){return _object_spread({},C)}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}u&&(e.state.localVarDepth=new Map(u)),p&&(e.state.fullyUnsetLocals=new Map(p));m=e.state.loopDepth,h=e.state.parentHasLoopContext;e.state.parentHasLoopContext=m>0,e.state.loopDepth=0;g=e.state.lastArg,x=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;v=e.state.groupStdin;r&&(e.state.groupStdin=r);y="",_="",b=0,w=function(){e.state.env=o,e.state.cwd=a,e.state.options=s,e.state.functions=l,e.state.localScopes=c,e.state.localVarStack=d,e.state.localVarDepth=u,e.state.fullyUnsetLocals=p,e.state.loopDepth=m,e.state.parentHasLoopContext=h,e.state.groupStdin=v,e.state.bashPid=x,e.state.lastArg=g};_state.label=2;case 2:_state.trys.push([2,11,,12]);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator1=t.body[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,7];_$k1=_step1.value;return[4,n(_$k1)];case 5:E1=_state.sent();y+=E1.stdout,_+=E1.stderr,b=E1.exitCode;_state.label=6;case 6:_iteratorNormalCompletion1=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 10:return[3,12];case 11:k=_state.sent();if(w(),_instanceof(k,Qt))throw k;if(_instanceof(k,o5)){y+=k.stdout,_+=k.stderr;C=ft(y,_,0);return[2,vo(e,C,t.redirections)]}if(_instanceof(k,Nf)||_instanceof(k,Df)){y+=k.stdout,_+=k.stderr;C1=ft(y,_,0);return[2,vo(e,C1,t.redirections)]}if(_instanceof(k,Ci)){y+=k.stdout,_+=k.stderr;C10=ft(y,_,k.exitCode);return[2,vo(e,C10,t.redirections)]}if(_instanceof(k,Lf)){y+=k.stdout,_+=k.stderr;C11=ft(y,_,k.exitCode);return[2,vo(e,C11,t.redirections)]}if(_instanceof(k,qh)){C12=ft(y+k.stdout,_+k.stderr,k.exitCode);return[2,vo(e,C12,t.redirections)]}E10=ft(y,"".concat(_).concat(cu(k),"\n"),1);return[2,vo(e,E10,t.redirections)];case 12:w();S=ft(y,_,b);return[2,vo(e,S,t.redirections)]}})})()}function qbt(e,t,r,n){return _async_to_generator(function(){var u,i,o,a,s,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$p,m,h,g,_,_10,m10,h10,m11,h11,err,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$p1,m12,err,p,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="",o="",a=0;return[4,Qke(e,t.redirections)];case 1:s=_state.sent();if(s)return[2,s];l=r;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,15,16,17]);_iterator=t.redirections[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];_$p=_step.value;if(!((_$p.operator==="<<"||_$p.operator==="<<-")&&_$p.target.type==="HereDoc"))return[3,5];m=_$p.target;return[4,pr(e,m.content)];case 4:h=_state.sent();m.stripTabs&&(h=h.split("\n").map(function(x){return x.replace(/^\t+/,"")}).join("\n"));g=(u=_$p.fd)!=null?u:0;g!==0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),au(e),e.state.fileDescriptors.set(g,h)):l=h;return[3,13];case 5:if(!(_$p.operator==="<<<"&&_$p.target.type==="Word"))return[3,7];_10=(_="").concat;return[4,pr(e,_$p.target)];case 6:l=_10.apply(_,[_state.sent(),"\n"]);return[3,13];case 7:if(!(_$p.operator==="<"&&_$p.target.type==="Word"))return[3,13];_state.label=8;case 8:_state.trys.push([8,11,,13]);return[4,pr(e,_$p.target)];case 9:m10=_state.sent(),h10=e.fs.resolvePath(e.state.cwd,m10);return[4,e.fs.readFile(h10)];case 10:l=_state.sent();return[3,13];case 11:m11=_state.sent();return[4,pr(e,_$p.target)];case 12:h11=_state.sent();return[2,ft("","bash: ".concat(h11,": No such file or directory\n"),1)];case 13:_iteratorNormalCompletion=true;return[3,3];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:c=e.state.groupStdin;l&&(e.state.groupStdin=l);_state.label=18;case 18:_state.trys.push([18,27,,28]);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=19;case 19:_state.trys.push([19,24,25,26]);_iterator1=t.body[Symbol.iterator]();_state.label=20;case 20:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,23];_$p1=_step1.value;return[4,n(_$p1)];case 21:m12=_state.sent();i+=m12.stdout,o+=m12.stderr,a=m12.exitCode;_state.label=22;case 22:_iteratorNormalCompletion1=true;return[3,20];case 23:return[3,26];case 24:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,26];case 25:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 26:return[3,28];case 27:p=_state.sent();if(e.state.groupStdin=c,_instanceof(p,Qt))throw p;if(Ube(p)||_instanceof(p,qh)||_instanceof(p,Ci))throw p.prependOutput(i,o),p;return[2,ft(i,"".concat(o).concat(cu(p),"\n"),1)];case 28:e.state.groupStdin=c;d=ft(i,o,a);return[2,vo(e,d,t.redirections)]}})})()}function Wbt(e,t,r,n,i){return _async_to_generator(function(){var o,x,_$x,a,s,l,c,d,u,p,m,h,_$x1,_$x2,g,_$x3,v,x10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.fs.readFile(t)];case 1:o=_state.sent();return[3,3];case 2:x=_state.sent();return[2,ot("bash: ".concat(t,": No such file or directory\n"),127)];case 3:if(o.startsWith("#!")){_$x=o.indexOf("\n");_$x!==-1&&(o=o.slice(_$x+1))}a=new Map(e.state.env),s=e.state.cwd,l=_object_spread({},e.state.options),c=e.state.loopDepth,d=e.state.parentHasLoopContext,u=e.state.lastArg,p=e.state.bashPid,m=e.state.groupStdin,h=e.state.currentSource;e.state.parentHasLoopContext=c>0,e.state.loopDepth=0,e.state.bashPid=e.state.nextVirtualPid++,n&&(e.state.groupStdin=n),e.state.currentSource=t,e.state.env.set("0",t),e.state.env.set("#",String(r.length)),e.state.env.set("@",r.join(" ")),e.state.env.set("*",r.join(" "));for(_$x1=0;_$x1<r.length&&_$x1<9;_$x1++)e.state.env.set(String(_$x1+1),r[_$x1]);for(_$x2=r.length+1;_$x2<=9;_$x2++)e.state.env.delete(String(_$x2));g=function(){e.state.env=a,e.state.cwd=s,e.state.options=l,e.state.loopDepth=c,e.state.parentHasLoopContext=d,e.state.lastArg=u,e.state.bashPid=p,e.state.groupStdin=m,e.state.currentSource=h};_state.label=4;case 4:_state.trys.push([4,6,,7]);_$x3=new Pn().parse(o);return[4,i(_$x3)];case 5:v=_state.sent();return[2,(g(),v)];case 6:x10=_state.sent();if(g(),_instanceof(x10,Ci)||_instanceof(x10,Qt))throw x10;if(x10.name==="ParseException")return[2,ot("bash: ".concat(t,": ").concat(x10.message,"\n"))];throw x10;case 7:return[2]}})})()}var Vbt=/*#__PURE__*/function(){"use strict";function Vbt1(e,t){_class_call_check(this,Vbt1);A(this,"ctx");A(this,"aliasExpansionStack",new Set);var r;this.ctx={state:t,fs:e.fs,commands:e.commands,limits:e.limits,execFn:e.exec,executeScript:this.executeScript.bind(this),executeStatement:this.executeStatement.bind(this),executeCommand:this.executeCommand.bind(this),fetch:e.fetch,sleep:e.sleep,trace:e.trace,coverage:e.coverage,requireDefenseContext:(r=e.requireDefenseContext)!=null?r:!1,jsBootstrapCode:e.jsBootstrapCode,invokeTool:e.invokeTool}}_create_class(Vbt1,[{key:"assertDefenseContext",value:function assertDefenseContext(e){if(!this.ctx.requireDefenseContext||hp.isInSandboxedContext())return;var t="interpreter ".concat(e," attempted outside defense context");throw new nn(t,{timestamp:Date.now(),type:"missing_defense_context",message:t,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:hp.getCurrentExecutionId()})}},{key:"buildExportedEnv",value:function buildExportedEnv(){var e=this.ctx.state.exportedVars,t=this.ctx.state.tempExportedVars,r=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(e)try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;r.add(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(t)try{for(var _iterator1=t[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var i10=_step1.value;r.add(i10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(r.size===0)return Object.create(null);var n=Object.create(null);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=r[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var i11=_step2.value;var o=this.ctx.state.env.get(i11);o!==void 0&&(n[i11]=o)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return n}},{key:"executeScript",value:function executeScript(e){return _async_to_generator(function(){var t,r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,_$s,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.assertDefenseContext("execution");t="",r="",n=0,i=this.ctx.limits.maxOutputSize,o=function(a,s){t.length+r.length+a.length+s.length>i&&u1("total output size exceeded (>".concat(i," bytes), increase executionLimits.maxOutputSize"),"output_size"),t+=a,r+=s};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,8,9,10]);_iterator=e.statements[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];a=_step.value;_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,this.executeStatement(a)];case 4:_$s=_state.sent();o(gye(_$s),_$s.stderr),n=_$s.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));return[3,6];case 5:s=_state.sent();if(_instanceof(s,Ci))throw s.prependOutput(t,r),s;if(_instanceof(s,Of))return[2,(o(s.stdout,s.stderr),n=s.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:t,stderr:r,exitCode:n,env:Jc(this.ctx.state.env)})];if(_instanceof(s,Qt))throw s;if(_instanceof(s,qh))return[2,(o(s.stdout,s.stderr),n=s.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:t,stderr:r,exitCode:n,env:Jc(this.ctx.state.env)})];if(_instanceof(s,Kc))return[2,(o(s.stdout,s.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:t,stderr:r,exitCode:n,env:Jc(this.ctx.state.env)})];if(_instanceof(s,$f))return[2,(o(s.stdout,s.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:t,stderr:r,exitCode:n,env:Jc(this.ctx.state.env)})];if(_instanceof(s,Hi)){o(s.stdout,s.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));return[3,6]}if(_instanceof(s,rV)){o(s.stdout,s.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));return[3,6]}if(_instanceof(s,Nf)||_instanceof(s,Df)){if(this.ctx.state.loopDepth>0)throw s.prependOutput(t,r),s;o(s.stdout,s.stderr);return[3,6]}throw _instanceof(s,Lf)&&s.prependOutput(t,r),s;case 6:_iteratorNormalCompletion=true;return[3,2];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2,{stdout:t,stderr:r,exitCode:n,env:Jc(this.ctx.state.env)}]}})}).call(this)}},{key:"executeUserScript",value:function executeUserScript(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,Wbt(this.ctx,e,t,r,function(n){return _this.executeScript(n)})]})}).call(this)}},{key:"executeStatement",value:function executeStatement(e){return _async_to_generator(function(){var l,c,t,r,n,i,o,d,u,p,m,a,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.assertDefenseContext("statement"),(l=this.ctx.state.signal)==null?void 0:l.aborted)throw new nV;if(this.ctx.state.commandCount++,this.ctx.state.commandCount>this.ctx.limits.maxCommandCount&&u1("too many commands executed (>".concat(this.ctx.limits.maxCommandCount,"), increase executionLimits.maxCommandCount"),"commands"),e.deferredError)throw new Xu(e.deferredError.message,(c=e.line)!=null?c:1,1);if(this.ctx.state.options.noexec)return[2,di];this.ctx.state.errexitSafe=!1;t="",r="";this.ctx.state.options.verbose&&!this.ctx.state.suppressVerbose&&e.sourceText&&(r+="".concat(e.sourceText,"\n"));n=0,i=-1,o=!1;d=0;_state.label=1;case 1:if(!(d<e.pipelines.length))return[3,4];u=e.pipelines[d],p=d>0?e.operators[d-1]:null;if(p==="&&"&&n!==0||p==="||"&&n===0)return[3,3];return[4,this.executePipeline(u)];case 2:m=_state.sent();t+=gye(m),r+=m.stderr,n=m.exitCode,i=d,o=u.negated,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));_state.label=3;case 3:d++;return[3,1];case 4:a=i<e.pipelines.length-1,s=this.ctx.state.errexitSafe;if(this.ctx.state.errexitSafe=a||o||s,this.ctx.state.options.errexit&&n!==0&&i===e.pipelines.length-1&&!o&&!this.ctx.state.inCondition&&!s)throw new qh(n,t,r);return[2,ft(t,r,n)]}})}).call(this)}},{key:"executePipeline",value:function executePipeline(e){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,Rbt(this.ctx,e,function(t,r){return _this.executeCommand(t,r)})]})}).call(this)}},{key:"executeCommand",value:function executeCommand(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(this.assertDefenseContext("command"),(r=this.ctx.coverage)==null||r.hit("bash:cmd:".concat(e.type)),e.type){case"SimpleCommand":return[2,this.executeSimpleCommand(e,t)];case"If":return[2,_bt(this.ctx,e)];case"For":return[2,bbt(this.ctx,e)];case"CStyleFor":return[2,wbt(this.ctx,e)];case"While":return[2,Sbt(this.ctx,e,t)];case"Until":return[2,kbt(this.ctx,e)];case"Case":return[2,Cbt(this.ctx,e)];case"Subshell":return[2,this.executeSubshell(e,t)];case"Group":return[2,this.executeGroup(e,t)];case"FunctionDef":return[2,Jvt(this.ctx,e)];case"ArithmeticCommand":return[2,this.executeArithmeticCommand(e)];case"ConditionalCommand":return[2,this.executeConditionalCommand(e)];default:return[2,di]}return[2]})}).call(this)}},{key:"executeSimpleCommand",value:function executeSimpleCommand(e,t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.executeSimpleCommandInner(e,t)];case 1:return[2,_state.sent()];case 2:r=_state.sent();if(_instanceof(r,i5))return[2,ot(r.stderr)];throw r;case 3:return[2]}})}).call(this)}},{key:"executeSimpleCommandInner",value:function executeSimpleCommandInner(e,t){return _async_to_generator(function(){var v,y,_,_$b,w,S,r,n,i,w10,S10,_$b1,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$b2,s,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,_$b3,w11,l,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_$b4,w12,S11,k,_10,_11,w13,S12,w14,S13,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,_step_value1,k10,E,w15,S14,k11,E1,err,c,d,u,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator4,_step4,_$b5,w16,S15,k12,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator5,_step5,E10,err,_iterator6,_step6,_$b6,w17,_iteratorNormalCompletion7,_didIteratorError7,_iteratorError7,_iterator7,_step7,S16,err,_$b7,_iteratorNormalCompletion8,_didIteratorError8,_iteratorError8,_iterator8,_step8,_$b8,w18,S17,_12,k13,k14,k15,E11,E12,k16,E13,E14,k17,E15,C,k18,k19,E16,C1,k20,err,_iteratorNormalCompletion9,_didIteratorError9,_iteratorError9,_iterator9,_step9,_step_value2,_$b9,w19,_iteratorNormalCompletion10,_didIteratorError10,_iteratorError10,_iterator10,_step10,_$b10,_d1,_$b11,p,m,h,b,g,_$b12,w20,x,_iteratorNormalCompletion11,_didIteratorError11,_iteratorError11,_iterator11,_step11,_step_value3,_$b13,w21,_iteratorNormalCompletion12,_didIteratorError12,_iteratorError12,_iterator12,_step12,_$b14;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e.line!==void 0&&(this.ctx.state.currentLine=e.line),this.ctx.state.shoptOptions.expand_aliases&&e.name){_$b=e,w=100;for(;w>0;){S=this.expandAlias(_$b);if(S===_$b)break;_$b=S,w--}this.aliasExpansionStack.clear(),_$b!==e&&(e=_$b)}this.ctx.state.expansionStderr="";return[4,Mbt(this.ctx,e)];case 1:r=_state.sent();if(r.error)return[2,r.error];n=r.tempAssignments,i=r.xtraceOutput;if(!!e.name)return[3,4];if(!(e.redirections.length>0))return[3,3];return[4,r1(this.ctx,e.redirections)];case 2:w10=_state.sent();if(w10)return[2,w10];S10=ft("",i,0);return[2,vo(this.ctx,S10,e.redirections)];case 3:this.ctx.state.lastArg="";_$b1=(this.ctx.state.expansionStderr||"")+i;return[2,(this.ctx.state.expansionStderr="",ft("",_$b1,this.ctx.state.lastExitCode))];case 4:o=e.name&&Sbe(e.name,["local","declare","typeset","export","readonly"]),a=Array.from(n.keys());if(a.length>0&&!o){this.ctx.state.tempExportedVars=this.ctx.state.tempExportedVars||new Set;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=a[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$b2=_step.value;this.ctx.state.tempExportedVars.add(_$b2)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return[4,Qke(this.ctx,e.redirections)];case 5:s=_state.sent();if(s){_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=n[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step1.value,2),_$b3=_step_value[0],w11=_step_value[1];w11===void 0?this.ctx.state.env.delete(_$b3):this.ctx.state.env.set(_$b3,w11)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,s]}l=-1;_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=6;case 6:_state.trys.push([6,21,22,23]);_iterator2=e.redirections[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,20];_$b4=_step2.value;if(!((_$b4.operator==="<<"||_$b4.operator==="<<-")&&_$b4.target.type==="HereDoc"))return[3,9];w12=_$b4.target;return[4,pr(this.ctx,w12.content)];case 8:S11=_state.sent();w12.stripTabs&&(S11=S11.split("\n").map(function(E){return E.replace(/^\t+/,"")}).join("\n")),S11=n1(S11);k=(v=_$b4.fd)!=null?v:0;k!==0?(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),au(this.ctx),this.ctx.state.fileDescriptors.set(k,S11)):t=S11;return[3,19];case 9:if(!(_$b4.operator==="<<<"&&_$b4.target.type==="Word"))return[3,11];_11=(_10="").concat;return[4,pr(this.ctx,_$b4.target)];case 10:t=n1.apply(void 0,[_11.apply(_10,[_state.sent(),"\n"])]);return[3,19];case 11:if(!(_$b4.operator==="<"&&_$b4.target.type==="Word"))return[3,17];_state.label=12;case 12:_state.trys.push([12,15,,17]);return[4,pr(this.ctx,_$b4.target)];case 13:w13=_state.sent(),S12=this.ctx.fs.resolvePath(this.ctx.state.cwd,w13);return[4,p_(this.ctx.fs,S12)];case 14:t=_state.sent();return[3,17];case 15:w14=_state.sent();return[4,pr(this.ctx,_$b4.target)];case 16:S13=_state.sent();_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=n[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){_step_value1=_sliced_to_array(_step3.value,2),k10=_step_value1[0],E=_step_value1[1];E===void 0?this.ctx.state.env.delete(k10):this.ctx.state.env.set(k10,E)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}return[2,ot("bash: ".concat(S13,": No such file or directory\n"))];case 17:if(!(_$b4.operator==="<&"&&_$b4.target.type==="Word"))return[3,19];return[4,pr(this.ctx,_$b4.target)];case 18:w15=_state.sent(),S14=Number.parseInt(w15,10);if(!Number.isNaN(S14)&&this.ctx.state.fileDescriptors){k11=this.ctx.state.fileDescriptors.get(S14);if(k11!==void 0)if(k11.startsWith("__rw__:")){E1=Ebt(k11);E1&&(t=E1.content.slice(E1.position),l=S14)}else k11.startsWith("__file__:")||k11.startsWith("__file_append__:")||(t=k11)}_state.label=19;case 19:_iteratorNormalCompletion2=true;return[3,7];case 20:return[3,23];case 21:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,23];case 22:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 23:return[4,pr(this.ctx,e.name)];case 24:c=_state.sent(),d=[],u=[];_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined,_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;if(!(Sbe(e.name,["local","declare","typeset","export","readonly"])&&(c==="local"||c==="declare"||c==="typeset"||c==="export"||c==="readonly")))return[3,37];_state.label=25;case 25:_state.trys.push([25,34,35,36]);_iterator4=e.args[Symbol.iterator]();_state.label=26;case 26:if(!!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done))return[3,33];_$b5=_step4.value;return[4,Evt(this.ctx,_$b5)];case 27:w16=_state.sent();if(!w16)return[3,28];d.push(w16),u.push(!0);return[3,32];case 28:return[4,Tvt(this.ctx,_$b5)];case 29:S15=_state.sent();if(!(S15!==null))return[3,30];d.push(S15),u.push(!0);return[3,32];case 30:return[4,l1(this.ctx,_$b5)];case 31:k12=_state.sent();_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;try{for(_iterator5=k12.values[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step5=_iterator5.next()).done);_iteratorNormalCompletion6=true){E10=_step5.value;d.push(E10),u.push(k12.quoted)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}_state.label=32;case 32:_iteratorNormalCompletion4=true;return[3,26];case 33:return[3,36];case 34:err=_state.sent();_didIteratorError4=true;_iteratorError4=err;return[3,36];case 35:try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}return[7];case 36:return[3,44];case 37:_state.trys.push([37,42,43,44]);_iterator6=e.args[Symbol.iterator]();_state.label=38;case 38:if(!!(_iteratorNormalCompletion5=(_step6=_iterator6.next()).done))return[3,41];_$b6=_step6.value;return[4,l1(this.ctx,_$b6)];case 39:w17=_state.sent();_iteratorNormalCompletion7=true,_didIteratorError7=false,_iteratorError7=undefined;try{for(_iterator7=w17.values[Symbol.iterator]();!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=true){S16=_step7.value;d.push(S16),u.push(w17.quoted)}}catch(err){_didIteratorError7=true;_iteratorError7=err}finally{try{if(!_iteratorNormalCompletion7&&_iterator7.return!=null){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}}_state.label=40;case 40:_iteratorNormalCompletion5=true;return[3,38];case 41:return[3,44];case 42:err=_state.sent();_didIteratorError5=true;_iteratorError5=err;return[3,44];case 43:try{if(!_iteratorNormalCompletion5&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}return[7];case 44:if(!!c)return[3,48];if(!e.name.parts.every(function(b){return b.type==="CommandSubstitution"||b.type==="ParameterExpansion"||b.type==="ArithmeticExpansion"}))return[3,47];if(!(d.length>0))return[3,46];_$b7=d.shift();u.shift();return[4,this.runCommand(_$b7,d,u,t,!1,!1,l)];case 45:return[2,_state.sent()];case 46:return[2,ft("","",this.ctx.state.lastExitCode)];case 47:return[2,ot("bash: : command not found\n",127)];case 48:if(!(c==="exec"&&(d.length===0||d[0]==="--")))return[3,73];_iteratorNormalCompletion8=true,_didIteratorError8=false,_iteratorError8=undefined;_state.label=49;case 49:_state.trys.push([49,70,71,72]);_iterator8=e.redirections[Symbol.iterator]();_state.label=50;case 50:if(!!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done))return[3,69];_$b8=_step8.value;if(_$b8.target.type==="HereDoc"||_$b8.fdVariable)return[3,68];return[4,pr(this.ctx,_$b8.target)];case 51:w18=_state.sent(),S17=(y=_$b8.fd)!=null?y:_$b8.operator==="<"||_$b8.operator==="<>"?0:1;_12=(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),_$b8.operator);switch(_12){case">":return[3,52];case">|":return[3,52];case">>":return[3,54];case"<":return[3,55];case"<>":return[3,60];case">&":return[3,66];case"<&":return[3,67]}return[3,68];case 52:k13=this.ctx.fs.resolvePath(this.ctx.state.cwd,w18);return[4,this.ctx.fs.writeFile(k13,"","utf8")];case 53:_state.sent(),au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__file__:".concat(k13));return[3,68];case 54:{k14=this.ctx.fs.resolvePath(this.ctx.state.cwd,w18);au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__file_append__:".concat(k14));return[3,68]}_state.label=55;case 55:k15=this.ctx.fs.resolvePath(this.ctx.state.cwd,w18);_state.label=56;case 56:_state.trys.push([56,58,,59]);return[4,this.ctx.fs.readFile(k15)];case 57:E11=_state.sent();au(this.ctx),this.ctx.state.fileDescriptors.set(S17,E11);return[3,59];case 58:E12=_state.sent();return[2,ot("bash: ".concat(w18,": No such file or directory\n"))];case 59:return[3,68];case 60:k16=this.ctx.fs.resolvePath(this.ctx.state.cwd,w18);_state.label=61;case 61:_state.trys.push([61,63,,65]);return[4,this.ctx.fs.readFile(k16)];case 62:E13=_state.sent();au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__rw__:".concat(k16.length,":").concat(k16,":0:").concat(E13));return[3,65];case 63:E14=_state.sent();return[4,this.ctx.fs.writeFile(k16,"","utf8")];case 64:_state.sent(),au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__rw__:".concat(k16.length,":").concat(k16,":0:"));return[3,65];case 65:return[3,68];case 66:{if(w18==="-")this.ctx.state.fileDescriptors.delete(S17);else if(w18.endsWith("-")){k17=w18.slice(0,-1),E15=Number.parseInt(k17,10);if(!Number.isNaN(E15)){C=this.ctx.state.fileDescriptors.get(E15);C!==void 0?this.ctx.state.fileDescriptors.set(S17,C):this.ctx.state.fileDescriptors.set(S17,"__dupout__:".concat(E15)),this.ctx.state.fileDescriptors.delete(E15)}}else{k18=Number.parseInt(w18,10);Number.isNaN(k18)||(au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__dupout__:".concat(k18)))}return[3,68]}_state.label=67;case 67:{if(w18==="-")this.ctx.state.fileDescriptors.delete(S17);else if(w18.endsWith("-")){k19=w18.slice(0,-1),E16=Number.parseInt(k19,10);if(!Number.isNaN(E16)){C1=this.ctx.state.fileDescriptors.get(E16);C1!==void 0?this.ctx.state.fileDescriptors.set(S17,C1):this.ctx.state.fileDescriptors.set(S17,"__dupin__:".concat(E16)),this.ctx.state.fileDescriptors.delete(E16)}}else{k20=Number.parseInt(w18,10);Number.isNaN(k20)||(au(this.ctx),this.ctx.state.fileDescriptors.set(S17,"__dupin__:".concat(k20)))}return[3,68]}_state.label=68;case 68:_iteratorNormalCompletion8=true;return[3,50];case 69:return[3,72];case 70:err=_state.sent();_didIteratorError8=true;_iteratorError8=err;return[3,72];case 71:try{if(!_iteratorNormalCompletion8&&_iterator8.return!=null){_iterator8.return()}}finally{if(_didIteratorError8){throw _iteratorError8}}return[7];case 72:_iteratorNormalCompletion9=true,_didIteratorError9=false,_iteratorError9=undefined;try{for(_iterator9=n[Symbol.iterator]();!(_iteratorNormalCompletion9=(_step9=_iterator9.next()).done);_iteratorNormalCompletion9=true){_step_value2=_sliced_to_array(_step9.value,2),_$b9=_step_value2[0],w19=_step_value2[1];w19===void 0?this.ctx.state.env.delete(_$b9):this.ctx.state.env.set(_$b9,w19)}}catch(err){_didIteratorError9=true;_iteratorError9=err}finally{try{if(!_iteratorNormalCompletion9&&_iterator9.return!=null){_iterator9.return()}}finally{if(_didIteratorError9){throw _iteratorError9}}}_iteratorNormalCompletion10=true,_didIteratorError10=false,_iteratorError10=undefined;if(this.ctx.state.tempExportedVars)try{for(_iterator10=n.keys()[Symbol.iterator]();!(_iteratorNormalCompletion10=(_step10=_iterator10.next()).done);_iteratorNormalCompletion10=true){_$b10=_step10.value;this.ctx.state.tempExportedVars.delete(_$b10)}}catch(err){_didIteratorError10=true;_iteratorError10=err}finally{try{if(!_iteratorNormalCompletion10&&_iterator10.return!=null){_iterator10.return()}}finally{if(_didIteratorError10){throw _iteratorError10}}}return[2,di];case 73:if(this.ctx.state.extraArgs){;(_d1=d).push.apply(_d1,_to_consumable_array(this.ctx.state.extraArgs));for(_$b11=0;_$b11<this.ctx.state.extraArgs.length;_$b11++)u.push(!0);this.ctx.state.extraArgs=void 0}return[4,Ibt(this.ctx,c,d)];case 74:p=_state.sent();n.size>0&&(this.ctx.state.tempEnvBindings=this.ctx.state.tempEnvBindings||[],this.ctx.state.tempEnvBindings.push(new Map(n)));h=null;_state.label=75;case 75:_state.trys.push([75,77,,78]);return[4,this.runCommand(c,d,u,t,!1,!1,l)];case 76:m=_state.sent();return[3,78];case 77:b=_state.sent();if(_instanceof(b,Nf)||_instanceof(b,Df))h=b,m=di;else throw b;return[3,78];case 78:g=i+p;g&&(m=_object_spread_props(_object_spread({},m),{stderr:g+m.stderr}));return[4,vo(this.ctx,m,e.redirections)];case 79:if(m=_state.sent(),h)throw h;if(d.length>0){_$b12=d[d.length-1];if((c==="declare"||c==="local"||c==="typeset")&&/^[a-zA-Z_][a-zA-Z0-9_]*=\(/.test(_$b12)){w20=_$b12.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);w20&&(_$b12=w20[1])}this.ctx.state.lastArg=_$b12}else this.ctx.state.lastArg=c;x=Hvt(c)&&c!=="unset"&&c!=="eval";_iteratorNormalCompletion11=true,_didIteratorError11=false,_iteratorError11=undefined;if(!this.ctx.state.options.posix||!x)try{for(_iterator11=n[Symbol.iterator]();!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=true){_step_value3=_sliced_to_array(_step11.value,2),_$b13=_step_value3[0],w21=_step_value3[1];(_=this.ctx.state.fullyUnsetLocals)!=null&&_.has(_$b13)||(w21===void 0?this.ctx.state.env.delete(_$b13):this.ctx.state.env.set(_$b13,w21))}}catch(err){_didIteratorError11=true;_iteratorError11=err}finally{try{if(!_iteratorNormalCompletion11&&_iterator11.return!=null){_iterator11.return()}}finally{if(_didIteratorError11){throw _iteratorError11}}}_iteratorNormalCompletion12=true,_didIteratorError12=false,_iteratorError12=undefined;if(this.ctx.state.tempExportedVars)try{for(_iterator12=n.keys()[Symbol.iterator]();!(_iteratorNormalCompletion12=(_step12=_iterator12.next()).done);_iteratorNormalCompletion12=true){_$b14=_step12.value;this.ctx.state.tempExportedVars.delete(_$b14)}}catch(err){_didIteratorError12=true;_iteratorError12=err}finally{try{if(!_iteratorNormalCompletion12&&_iterator12.return!=null){_iterator12.return()}}finally{if(_didIteratorError12){throw _iteratorError12}}}return[2,(n.size>0&&this.ctx.state.tempEnvBindings&&this.ctx.state.tempEnvBindings.pop(),this.ctx.state.expansionStderr&&(m=_object_spread_props(_object_spread({},m),{stderr:this.ctx.state.expansionStderr+m.stderr}),this.ctx.state.expansionStderr=""),m)]}})}).call(this)}},{key:"runCommand",value:function runCommand(_01,_11,_21,_31){return _async_to_generator(function(e,t,r,n){var _this,i,o,a,s,l;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;i=_arguments.length>4&&_arguments[4]!==void 0?_arguments[4]:!1,o=_arguments.length>5&&_arguments[5]!==void 0?_arguments[5]:!1,a=_arguments.length>6&&_arguments[6]!==void 0?_arguments[6]:-1;s={ctx:this.ctx,runCommand:function(c,d,u,p,m,h,g){return _this.runCommand(c,d,u,p,m,h,g)},buildExportedEnv:function(){return _this.buildExportedEnv()},executeUserScript:function(c,d,u){return _this.executeUserScript(c,d,u)}};return[4,gbt(s,e,t,r,n,i,o,a)];case 1:l=_state.sent();return[2,l!==null?l:vbt(s,e,t,n,o)]}})}).apply(this,arguments)}},{key:"expandAlias",value:function expandAlias(e){return Uke(this.ctx.state,e,this.aliasExpansionStack)}},{key:"findCommandInPath",value:function findCommandInPath(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,s7e(this.ctx,e)]})}).call(this)}},{key:"executeSubshell",value:function executeSubshell(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,Bbt(this.ctx,e,t,function(r){return _this.executeStatement(r)})]})}).call(this)}},{key:"executeGroup",value:function executeGroup(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,qbt(this.ctx,e,t,function(r){return _this.executeStatement(r)})]})}).call(this)}},{key:"executeArithmeticCommand",value:function executeArithmeticCommand(e){return _async_to_generator(function(){var t,_$r,n,r,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:e.line!==void 0&&(this.ctx.state.currentLine=e.line);return[4,r1(this.ctx,e.redirections)];case 1:t=_state.sent();if(t)return[2,t];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,Xt(this.ctx,e.expression.expression)];case 3:_$r=_state.sent(),n=Ca(_$r!==0);return[2,(this.ctx.state.expansionStderr&&(n=_object_spread_props(_object_spread({},n),{stderr:this.ctx.state.expansionStderr+n.stderr}),this.ctx.state.expansionStderr=""),vo(this.ctx,n,e.redirections))];case 4:r=_state.sent();n10=ot("bash: arithmetic expression: ".concat(r.message,"\n"));return[2,vo(this.ctx,n10,e.redirections)];case 5:return[2]}})}).call(this)}},{key:"executeConditionalCommand",value:function executeConditionalCommand(e){return _async_to_generator(function(){var t,_$r,n,r,n10,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:e.line!==void 0&&(this.ctx.state.currentLine=e.line);return[4,r1(this.ctx,e.redirections)];case 1:t=_state.sent();if(t)return[2,t];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,Z0(this.ctx,e.expression)];case 3:_$r=_state.sent(),n=Ca(_$r);return[2,(this.ctx.state.expansionStderr&&(n=_object_spread_props(_object_spread({},n),{stderr:this.ctx.state.expansionStderr+n.stderr}),this.ctx.state.expansionStderr=""),vo(this.ctx,n,e.redirections))];case 4:r=_state.sent();n10=_instanceof(r,Hi)?1:2,i=ot("bash: conditional expression: ".concat(r.message,"\n"),n10);return[2,vo(this.ctx,i,e.redirections)];case 5:return[2]}})}).call(this)}}]);return Vbt1}(),oa={maxCallDepth:100,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxGlobOperations:1e5,maxStringLength:0xa00000,maxArrayElements:1e5,maxHeredocSize:0xa00000,maxSubstitutionDepth:50,maxBraceExpansionResults:1e4,maxOutputSize:0xa00000,maxFileDescriptors:1024,maxSourceDepth:100};function Gbt(e){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y;return e?{maxCallDepth:(t=e.maxCallDepth)!=null?t:oa.maxCallDepth,maxCommandCount:(r=e.maxCommandCount)!=null?r:oa.maxCommandCount,maxLoopIterations:(n=e.maxLoopIterations)!=null?n:oa.maxLoopIterations,maxAwkIterations:(i=e.maxAwkIterations)!=null?i:oa.maxAwkIterations,maxSedIterations:(o=e.maxSedIterations)!=null?o:oa.maxSedIterations,maxJqIterations:(a=e.maxJqIterations)!=null?a:oa.maxJqIterations,maxSqliteTimeoutMs:(s=e.maxSqliteTimeoutMs)!=null?s:oa.maxSqliteTimeoutMs,maxPythonTimeoutMs:(l=e.maxPythonTimeoutMs)!=null?l:oa.maxPythonTimeoutMs,maxJsTimeoutMs:(c=e.maxJsTimeoutMs)!=null?c:oa.maxJsTimeoutMs,maxGlobOperations:(d=e.maxGlobOperations)!=null?d:oa.maxGlobOperations,maxStringLength:(u=e.maxStringLength)!=null?u:oa.maxStringLength,maxArrayElements:(p=e.maxArrayElements)!=null?p:oa.maxArrayElements,maxHeredocSize:(m=e.maxHeredocSize)!=null?m:oa.maxHeredocSize,maxSubstitutionDepth:(h=e.maxSubstitutionDepth)!=null?h:oa.maxSubstitutionDepth,maxBraceExpansionResults:(g=e.maxBraceExpansionResults)!=null?g:oa.maxBraceExpansionResults,maxOutputSize:(x=e.maxOutputSize)!=null?x:oa.maxOutputSize,maxFileDescriptors:(v=e.maxFileDescriptors)!=null?v:oa.maxFileDescriptors,maxSourceDepth:(y=e.maxSourceDepth)!=null?y:oa.maxSourceDepth}:_object_spread({},oa)}avt();td();q9();function tG(e){try{var t=new URL(e);return{origin:t.origin,pathname:t.pathname,href:t.href}}catch(t){return null}}function Hbt(e){var t=tG(e);return t?{origin:t.origin,pathPrefix:t.pathname}:null}function d7e(e){if(e.includes("\\"))return!0;var t=e.toLowerCase();return t.includes("%2f")||t.includes("%5c")}function Zbt(e,t){return t==="/"||t===""?!0:t.endsWith("/")?e.startsWith(t):e===t||e.startsWith("".concat(t,"/"))}function p7e(e,t){var r=tG(e);if(!r)return!1;var n=Hbt(t);return!n||r.origin!==n.origin||n.pathPrefix!=="/"&&n.pathPrefix!==""&&d7e(r.pathname)?!1:Zbt(r.pathname,n.pathPrefix)}function f7e(e){return typeof e=="string"?e:e.url}function Kbt(e,t){return!t||t.length===0?!1:t.some(function(r){return p7e(e,f7e(r))})}function Cbe(e){var t=Qbt(e);if(t==="localhost"||t.endsWith(".localhost"))return!0;var r=m7e(t);if(r)return C9(r);var n=Ybt(t);return n?Xbt(n):!1}function Qbt(e){var t=e.trim().toLowerCase();return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function Jbt(e){if(!e)return null;var t=10,r=e;if(r.startsWith("0x")||r.startsWith("0X")?(t=16,r=r.slice(2)):r.length>1&&r.startsWith("0")&&(t=8),!r||t===16&&!/^[0-9a-fA-F]+$/.test(r)||t===10&&!/^\d+$/.test(r)||t===8&&!/^[0-7]+$/.test(r))return null;var n=Number.parseInt(r,t);return!Number.isFinite(n)||n<0?null:n}function m7e(e){var t=e.split(".");if(t.length===0||t.length>4)return null;var r=t.map(function(l){return Jbt(l)});if(r.some(function(l){return l===null}))return null;var n=r;if(t.length===1){var l=n[0];return l>0xffffffff?null:[l>>>24&255,l>>>16&255,l>>>8&255,l&255]}if(t.length===2){var _n=_sliced_to_array(n,2),l10=_n[0],c=_n[1];return l10>255||c>0xffffff?null:[l10,c>>>16&255,c>>>8&255,c&255]}if(t.length===3){var _n1=_sliced_to_array(n,3),l11=_n1[0],c10=_n1[1],d=_n1[2];return l11>255||c10>255||d>65535?null:[l11,c10,d>>>8&255,d&255]}var _n2=_sliced_to_array(n,4),i=_n2[0],o=_n2[1],a=_n2[2],s=_n2[3];return i>255||o>255||a>255||s>255?null:[i,o,a,s]}function Ybt(e){var t=e,r=null;if(t.includes(".")){var g=t.lastIndexOf(":");if(g<0)return null;var x=t.slice(g+1),v=m7e(x);if(!v)return null;r=v,t=t.slice(0,g)}var n=t.includes("::")?t.split("::").length-1:0;if(n>1)return null;var _t_split=_sliced_to_array(t.split("::"),2),i=_t_split[0],o=_t_split[1],a=i?i.split(":").filter(Boolean):[],s=o?o.split(":").filter(Boolean):[],l=function(g){return/^[0-9a-f]{1,4}$/i.test(g)?Number.parseInt(g,16):null},c=a.map(l),d=s.map(l);if(c.some(function(g){return g===null})||d.some(function(g){return g===null}))return null;var u=r?2:0,p=c.length+d.length+u,m=0;if(n===1){if(m=8-p,m<0)return null}else if(p!==8)return null;var h=_to_consumable_array(c).concat(_to_consumable_array(new Array(m).fill(0)),_to_consumable_array(d));return r&&(h.push(r[0]<<8|r[1]),h.push(r[2]<<8|r[3])),h.length===8?h:null}function C9(e){var _e1=_sliced_to_array(e,2),t=_e1[0],r=_e1[1];return t===127||t===10||t===172&&r>=16&&r<=31||t===192&&r===168||t===169&&r===254||t===0||t===100&&r>=64&&r<=127||t===198&&(r===18||r===19)||t===192&&r===0&&e[2]===0||t===192&&r===0&&e[2]===2||t===198&&r===51&&e[2]===100||t===203&&r===0&&e[2]===113||t>=240}function Xbt(e){if(e.every(function(t){return t===0})||e.slice(0,7).every(function(t){return t===0})&&e[7]===1||(e[0]&65472)===65152||(e[0]&65024)===64512)return!0;if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===65535){var t=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return C9(t)}if(e[0]===8193&&e[1]===3512)return!0;if(e[0]===100&&e[1]===65435&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0){var t10=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return C9(t10)}if(e[0]===100&&e[1]===65435&&e[2]===1)return!0;if(e[0]===8194){var t11=[e[1]>>>8&255,e[1]&255,e[2]>>>8&255,e[2]&255];return C9(t11)}return!1}function ewt(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(typeof r!="string"&&(r===null||(typeof r==="undefined"?"undefined":_type_of(r))!="object"||!("url"in r)||typeof r.url!="string")){t.push('Invalid allow-list entry: must be a string URL or an object with a "url" string property');continue}var n=f7e(r);if(!tG(n)){t.push('Invalid URL in allow-list: "'.concat(n,'" - must be a valid URL with scheme and host (e.g., "https://example.com")'));continue}var i=new URL(n);if(i.protocol!=="http:"&&i.protocol!=="https:"){t.push('Only http and https URLs are allowed in allow-list: "'.concat(n,'"'));continue}if(!i.hostname){t.push('Allow-list entry must include a hostname: "'.concat(n,'"'));continue}if(i.pathname!=="/"&&i.pathname!==""&&d7e(i.pathname)){t.push('Allow-list entry contains ambiguous path separators: "'.concat(n,'"'));continue}(i.search||i.hash)&&t.push('Query strings and fragments are ignored in allow-list entries: "'.concat(n,'"'))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var j9=null,eW=null,Ebe=!1;function twt(){if(Ebe||!j9||!eW)return;Ebe=!0;var e=j9,t=eW.lookup;function r(){for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key]}var i=n[0],o=e.getStore();if(typeof i!="string"||!o||o.hostname.toLowerCase()!==i.toLowerCase())return t.apply(this,n);var a={},s;if(n.length===2)s=n[1];else if(n.length>=3){var c=n[1];typeof c=="number"?a={family:c}:c&&(typeof c==="undefined"?"undefined":_type_of(c))=="object"&&(a=c),s=n[2]}if(typeof s!="function")return t.apply(this,n);var l=s;if(a.family!==void 0&&a.family!==0&&a.family!==o.family){var c10=new Error("ENOTFOUND ".concat(i));c10.code="ENOTFOUND",c10.errno=-3008,c10.syscall="getaddrinfo",c10.hostname=i,process.nextTick(function(){return l(c10)});return}process.nextTick(function(){a.all?l(null,[{address:o.address,family:o.family}]):l(null,o.address,o.family)})}Object.defineProperty(eW,"lookup",{value:r,writable:!0,configurable:!0})}function rwt(e,t){return twt(),j9?j9.run(e,t):t()}var Kv=/*#__PURE__*/function(Error1){"use strict";_inherits(Kv1,Error1);function Kv1(e,t){_class_call_check(this,Kv1);var _this;var r=t!=null?t:"URL not in allow-list";_this=_call_super(this,Kv1,["Network access denied: ".concat(r,": ").concat(e)]),_this.name="NetworkAccessDeniedError";return _this}return Kv1}(_wrap_native_super(Error)),nwt=/*#__PURE__*/function(Error1){"use strict";_inherits(nwt1,Error1);function nwt1(e){_class_call_check(this,nwt1);var _this;_this=_call_super(this,nwt1,["Too many redirects (max: ".concat(e,")")]),_this.name="TooManyRedirectsError";return _this}return nwt1}(_wrap_native_super(Error)),iwt=/*#__PURE__*/function(Error1){"use strict";_inherits(iwt1,Error1);function iwt1(e){_class_call_check(this,iwt1);var _this;_this=_call_super(this,iwt1,["Redirect target not in allow-list: ".concat(e)]),_this.name="RedirectNotAllowedError";return _this}return iwt1}(_wrap_native_super(Error)),owt=/*#__PURE__*/function(Error1){"use strict";_inherits(owt1,Error1);function owt1(e,t){_class_call_check(this,owt1);var _this;_this=_call_super(this,owt1,["HTTP method '".concat(e,"' not allowed. Allowed methods: ").concat(t.join(", "))]),_this.name="MethodNotAllowedError";return _this}return owt1}(_wrap_native_super(Error)),tW=/*#__PURE__*/function(Error1){"use strict";_inherits(tW1,Error1);function tW1(e){_class_call_check(this,tW1);var _this;_this=_call_super(this,tW1,["Response body too large (max: ".concat(e," bytes)")]),_this.name="ResponseTooLargeError";return _this}return tW1}(_wrap_native_super(Error));function awt(e){return new Promise(function(t,r){ovt(e,{all:!0},function(n,i){n?r(n):t(i)})})}var swt=20,lwt=3e4,uwt=0xa00000,cwt=["GET","HEAD"],dwt=new Set(["GET","HEAD","OPTIONS"]),pwt=new Set([301,302,303,307,308]);function fwt(e){var m,h,g,x,v,y,_;var t=(m=e.allowedUrlPrefixes)!=null?m:[];if(!e.dangerouslyAllowFullInternetAccess){var b=ewt(t);if(b.length>0)throw new Error("Invalid network allow-list:\n".concat(b.join("\n")))}var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var b10=_step.value;(typeof b10==="undefined"?"undefined":_type_of(b10))=="object"&&b10.transform&&b10.transform.length>0&&r.push(b10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}function n(b){if(r.length===0)return null;var w=null;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var S=_step.value;if(p7e(b,S.url)&&S.transform){w||(w=new Headers);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined,_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator1=S.transform[Symbol.iterator](),_step1;!(_iteratorNormalCompletion2=(_step1=_iterator1.next()).done);_iteratorNormalCompletion2=true){var k=_step1.value;try{for(var _iterator2=Object.entries(k.headers)[Symbol.iterator](),_step2;!(_iteratorNormalCompletion1=(_step2=_iterator2.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step2.value,2),E=_step_value[0],C=_step_value[1];w.set(E,C)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return w}var i=(h=e.maxRedirects)!=null?h:swt,o=(g=e.timeoutMs)!=null?g:lwt,a=(x=e.maxResponseSize)!=null?x:uwt,s=e.dangerouslyAllowFullInternetAccess?["GET","HEAD","POST","PUT","DELETE","PATCH","OPTIONS"]:(v=e.allowedMethods)!=null?v:cwt,l=(y=e.denyPrivateRanges)!=null?y:(typeof process==="undefined"?"undefined":_type_of(process))<"u"&&!0,c=(_=e._dnsResolve)!=null?_:awt;function d(b){return _async_to_generator(function(){var _$w,S,_$k,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,C,E,k,E1,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!e.dangerouslyAllowFullInternetAccess&&!Kbt(b,t))throw new Kv(b);if(!l)return[3,7];_state.label=1;case 1:_state.trys.push([1,6,,7]);_$w=new URL(b);if(Cbe(_$w.hostname))throw new Kv(b,"private/loopback IP address blocked");S=_$w.hostname;if(!/[a-zA-Z]/.test(S))return[3,5];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,c(S)];case 3:_$k=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$k[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_step.value,C=_step_value.address;if(Cbe(C))throw new Kv(b,"hostname resolves to private/loopback IP address")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}E=_$k[0];if(E)return[2,{hostname:S,address:E.address,family:E.family===6?6:4}];return[3,5];case 4:k=_state.sent();if(_instanceof(k,Kv))throw k;E1=k==null?void 0:k.code;if(!(E1==="ENOTFOUND"||E1==="ENODATA"))throw new Kv(b,"DNS resolution failed for private IP check");return[3,5];case 5:return[3,7];case 6:w=_state.sent();if(_instanceof(w,Kv))throw w;return[3,7];case 7:return[2,null]}})})()}function u(b){if(e.dangerouslyAllowFullInternetAccess)return;var w=b.toUpperCase();if(!s.includes(w))throw new owt(w,s)}function p(_01){return _async_to_generator(function(b){var _loop,w,O,M,R,S,k,E,C,T,I,_ret;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_loop=function(){var $,z,D,L,_tmp,ee,pe,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:$=new AbortController,z=KS(function(){return $.abort()},I);_state.label=1;case 1:_state.trys.push([1,,11,12]);return[4,hp.runTrustedAsync(function(){var L=n(E),ee=mwt(w.headers,L),pe={method:S,headers:ee,signal:$.signal,redirect:"manual"};return w.body&&!dwt.has(S)&&(pe.body=w.body),k?rwt(k,function(){return fetch(E,pe)}):fetch(E,pe)})];case 2:D=_state.sent();if(!(pwt.has(D.status)&&T))return[3,9];L=D.headers.get("location");if(!!L)return[3,4];_tmp={};return[4,Tbe(D,E,a)];case 3:return[2,(_tmp.v=_state.sent(),_tmp)];case 4:ee=new URL(L,E).href;_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,d(ee)];case 6:k=_state.sent();return[3,8];case 7:pe=_state.sent();throw new iwt(ee);case 8:if(C++,C>i)throw new nwt(i);E=ee;return[2,"continue"];case 9:_tmp1={};return[4,Tbe(D,E,a)];case 10:return[2,(_tmp1.v=_state.sent(),_tmp1)];case 11:B9(z);return[7];case 12:return[2]}})};w=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{};S=(M=(O=w.method)==null?void 0:O.toUpperCase())!=null?M:"GET";return[4,d(b)];case 1:k=_state.sent();u(S);E=b,C=0,T=(R=w.followRedirects)!=null?R:!0,I=w.timeoutMs!==void 0?Math.min(w.timeoutMs,o):o;_state.label=2;case 2:return[5,_ts_values(_loop())];case 3:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=4;case 4:return[3,2];case 5:return[2]}})}).apply(this,arguments)}return p}function mwt(e,t){if(!e&&!t)return;if(!t)return e;var r=_instanceof(e,Headers)?new Headers(e):new Headers(e);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];r.set(n,i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function Tbe(e,t,r){return _async_to_generator(function(){var n,o,a,i,o10,a9,s,_ref,c,d,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,c10,o11;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=Object.create(null);if(e.headers.forEach(function(o,a){n[a.toLowerCase()]=o}),r>0){o=e.headers.get("content-length");if(o){a=parseInt(o,10);if(!Number.isNaN(a)&&a>r)throw new tW(r)}}if(!(r>0&&e.body))return[3,5];o10=e.body.getReader(),a9=[],s=0;_state.label=1;case 1:return[4,o10.read()];case 2:_ref=_state.sent(),c=_ref.done,d=_ref.value;if(c)return[3,4];if(d){if(s+=d.byteLength,s>r)throw o10.cancel(),new tW(r);a9.push(d)}_state.label=3;case 3:return[3,1];case 4:i=new Uint8Array(s);l=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=a9[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){c10=_step.value;i.set(c10,l),l+=c10.byteLength}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,7];case 5:return[4,e.arrayBuffer()];case 6:o11=_state.sent();if(r>0&&o11.byteLength>r)throw new tW(r);i=new Uint8Array(o11);_state.label=7;case 7:return[2,{status:e.status,statusText:e.statusText,headers:n,body:i,url:t}]}})})()}d1();jo();td();function hwt(e){return Y0(e)}function Y0(e){return e.statements.map(h7e).join("\n")}function h7e(e){var t=[];for(var n=0;n<e.pipelines.length;n++)t.push(gwt(e.pipelines[n])),n<e.operators.length&&t.push(e.operators[n]);var r=t.join(" ");return e.background&&(r+=" &"),r}function gwt(e){var n;var t=[];e.timed&&t.push(e.timePosix?"time -p":"time"),e.negated&&t.push("!");var r=[];for(var i=0;i<e.commands.length;i++)if(r.push(g7e(e.commands[i])),i<e.commands.length-1){var o=(n=e.pipeStderr)==null?void 0:n[i];r.push(o?"|&":"|")}return(t.length>0?"".concat(t.join(" ")," "):"")+r.join(" ")}function g7e(e){switch(e.type){case"SimpleCommand":return xwt(e);case"If":return Ewt(e);case"For":return Twt(e);case"CStyleFor":return Awt(e);case"While":return Iwt(e);case"Until":return Pwt(e);case"Case":return Rwt(e);case"Subshell":return Owt(e);case"Group":return $wt(e);case"ArithmeticCommand":return Nwt(e);case"ConditionalCommand":return Dwt(e);case"FunctionDef":return Lwt(e);default:{var t=e;throw new Error("Unsupported command type: ".concat(t.type))}}}function xwt(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.assignments[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t.push(ywt(r))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}e.name&&t.push($s(e.name));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e.args[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r10=_step1.value;t.push($s(r10))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=e.redirections[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var r11=_step2.value;t.push(v7e(r11))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}return t.join(" ")}function ywt(e){var t=e.append?"+=":"=";if(e.array){var r=e.array.map($s).join(" ");return"".concat(e.name).concat(t,"(").concat(r,")")}return e.value?"".concat(e.name).concat(t).concat($s(e.value)):"".concat(e.name).concat(t)}function $s(e){return e.parts.map(function(t){return cP(t,!1)}).join("")}function Nh(e){return e.parts.map(function(t){return cP(t,!0)}).join("")}function cP(e,t){switch(e.type){case"Literal":return t?_wt(e.value):vwt(e.value);case"SingleQuoted":return"'".concat(e.value,"'");case"DoubleQuoted":return'"'.concat(e.parts.map(function(r){return cP(r,!0)}).join(""),'"');case"Escaped":return"\\".concat(e.value);case"ParameterExpansion":return x7e(e);case"CommandSubstitution":return e.legacy?"`".concat(Y0(e.body),"`"):"$(".concat(Y0(e.body),")");case"ArithmeticExpansion":return"$((".concat(ei(e.expression.expression),"))");case"ProcessSubstitution":return e.direction==="input"?"<(".concat(Y0(e.body),")"):">(".concat(Y0(e.body),")");case"BraceExpansion":return kwt(e);case"TildeExpansion":return e.user!==null?"~".concat(e.user):"~";case"Glob":return e.pattern;default:{var r=e;throw new Error("Unsupported word part type: ".concat(r.type))}}}function vwt(e){return e.replace(/[\s\\'"`!|&;()<>{}[\]*?~#]/g,"\\$&")}function _wt(e){return e.replace(/[$`"\\]/g,"\\$&")}function bwt(e,t){return e.parts.map(function(r){return wwt(r,t)}).join("")}function wwt(e,t){switch(e.type){case"Literal":return t?e.value:e.value.replace(/[$`]/g,"\\$&");case"Escaped":return"\\".concat(e.value);case"ParameterExpansion":return x7e(e);case"CommandSubstitution":return e.legacy?"`".concat(Y0(e.body),"`"):"$(".concat(Y0(e.body),")");case"ArithmeticExpansion":return"$((".concat(ei(e.expression.expression),"))");default:return cP(e,!1)}}function x7e(e){return e.operation?"${".concat(y7e(e.parameter,e.operation),"}"):Swt(e.parameter)?"${".concat(e.parameter,"}"):"$".concat(e.parameter)}function Swt(e){return!(/^[?#@*$!\-0-9]$/.test(e)||/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))}function y7e(e,t){switch(t.type){case"Length":return"#".concat(e);case"LengthSliceError":return"#".concat(e,":");case"BadSubstitution":return t.text;case"DefaultValue":return"".concat(e).concat(t.checkEmpty?":":"","-").concat(Nh(t.word));case"AssignDefault":return"".concat(e).concat(t.checkEmpty?":":"","=").concat(Nh(t.word));case"ErrorIfUnset":return"".concat(e).concat(t.checkEmpty?":":"","?").concat(t.word?Nh(t.word):"");case"UseAlternative":return"".concat(e).concat(t.checkEmpty?":":"","+").concat(Nh(t.word));case"Substring":{var r=ei(t.offset.expression);return t.length?"".concat(e,":").concat(r,":").concat(ei(t.length.expression)):"".concat(e,":").concat(r)}case"PatternRemoval":{var r10=t.side==="prefix"?"#":"%",n=t.greedy?"".concat(r10).concat(r10):r10;return"".concat(e).concat(n).concat(Nh(t.pattern))}case"PatternReplacement":{var r11="/";t.all?r11="//":t.anchor==="start"?r11="/#":t.anchor==="end"&&(r11="/%");var n10=t.replacement?"/".concat(Nh(t.replacement)):"";return"".concat(e).concat(r11).concat(Nh(t.pattern)).concat(n10)}case"CaseModification":{var r12=t.direction==="upper"?"^":",",n11=t.all?"".concat(r12).concat(r12):r12,i=t.pattern?Nh(t.pattern):"";return"".concat(e).concat(n11).concat(i)}case"Transform":return"".concat(e,"@").concat(t.operator);case"Indirection":return t.innerOp?"!".concat(y7e(e,t.innerOp)):"!".concat(e);case"ArrayKeys":return"!".concat(t.array,"[").concat(t.star?"*":"@","]");case"VarNamePrefix":return"!".concat(t.prefix).concat(t.star?"*":"@");default:{var r13=t;throw new Error("Unsupported parameter operation type: ".concat(r13.type))}}}function kwt(e){return"{".concat(e.items.map(Cwt).join(","),"}")}function Cwt(e){var n,i;if(e.type==="Word")return $s(e.word);var t=(n=e.startStr)!=null?n:String(e.start),r=(i=e.endStr)!=null?i:String(e.end);return e.step!==void 0?"".concat(t,"..").concat(r,"..").concat(e.step):"".concat(t,"..").concat(r)}function v7e(e){var t=e.fdVariable?"{".concat(e.fdVariable,"}"):e.fd!==null?String(e.fd):"";if(e.operator==="<<"||e.operator==="<<-"){var r=e.target,n=r.quoted?"'".concat(r.delimiter,"'"):r.delimiter,i=bwt(r.content,r.quoted);return"".concat(t).concat(e.operator).concat(n,"\n").concat(i).concat(r.delimiter)}return e.operator==="<<<"?"".concat(t,"<<< ").concat($s(e.target)):e.operator==="&>"||e.operator==="&>>"?"".concat(e.operator," ").concat($s(e.target)):"".concat(t).concat(e.operator," ").concat($s(e.target))}function id(e){return e.length===0?"":" ".concat(e.map(v7e).join(" "))}function rc(e){return e.map(h7e).join("\n")}function Ewt(e){var t=[];for(var r=0;r<e.clauses.length;r++){var n=e.clauses[r],i=r===0?"if":"elif";t.push("".concat(i," ").concat(rc(n.condition),"; then\n").concat(rc(n.body)))}return e.elseBody&&t.push("else\n".concat(rc(e.elseBody))),"".concat(t.join("\n"),"\nfi").concat(id(e.redirections))}function Twt(e){var t;if(e.words===null)t="for ".concat(e.variable);else{var r=e.words.map($s).join(" ");t="for ".concat(e.variable," in ").concat(r)}return"".concat(t,"; do\n").concat(rc(e.body),"\ndone").concat(id(e.redirections))}function Awt(e){var t=e.init?ei(e.init.expression):"",r=e.condition?ei(e.condition.expression):"",n=e.update?ei(e.update.expression):"";return"for ((".concat(t,"; ").concat(r,"; ").concat(n,")); do\n").concat(rc(e.body),"\ndone").concat(id(e.redirections))}function Iwt(e){return"while ".concat(rc(e.condition),"; do\n").concat(rc(e.body),"\ndone").concat(id(e.redirections))}function Pwt(e){return"until ".concat(rc(e.condition),"; do\n").concat(rc(e.body),"\ndone").concat(id(e.redirections))}function Rwt(e){var t=e.items.map(Mwt).join("\n");return"case ".concat($s(e.word)," in\n").concat(t,"\nesac").concat(id(e.redirections))}function Mwt(e){var t=e.patterns.map($s).join(" | "),r=rc(e.body);return r?"".concat(t,")\n").concat(r,"\n").concat(e.terminator):"".concat(t,")\n").concat(e.terminator)}function Owt(e){return"(".concat(rc(e.body),")").concat(id(e.redirections))}function $wt(e){return"{ ".concat(rc(e.body),"; }").concat(id(e.redirections))}function Nwt(e){return"((".concat(ei(e.expression.expression),"))").concat(id(e.redirections))}function Dwt(e){return"[[ ".concat(K0(e.expression)," ]]").concat(id(e.redirections))}function Lwt(e){var t=g7e(e.body);return"".concat(e.name,"() ").concat(t).concat(id(e.redirections))}function ei(e){switch(e.type){case"ArithNumber":return String(e.value);case"ArithVariable":return e.hasDollarPrefix?"$".concat(e.name):e.name;case"ArithSpecialVar":return"$".concat(e.name);case"ArithBinary":return"".concat(ei(e.left)," ").concat(e.operator," ").concat(ei(e.right));case"ArithUnary":return e.prefix?"".concat(e.operator).concat(ei(e.operand)):"".concat(ei(e.operand)).concat(e.operator);case"ArithTernary":return"".concat(ei(e.condition)," ? ").concat(ei(e.consequent)," : ").concat(ei(e.alternate));case"ArithAssignment":return"".concat(e.subscript?"".concat(e.variable,"[").concat(ei(e.subscript),"]"):e.stringKey!==void 0?"".concat(e.variable,"[").concat(e.stringKey,"]"):e.variable," ").concat(e.operator," ").concat(ei(e.value));case"ArithDynamicAssignment":return"".concat(e.subscript?"".concat(ei(e.target),"[").concat(ei(e.subscript),"]"):ei(e.target)," ").concat(e.operator," ").concat(ei(e.value));case"ArithDynamicElement":return"".concat(ei(e.nameExpr),"[").concat(ei(e.subscript),"]");case"ArithGroup":return"(".concat(ei(e.expression),")");case"ArithNested":return"$((".concat(ei(e.expression),"))");case"ArithCommandSubst":return"$(".concat(e.command,")");case"ArithBracedExpansion":return"${".concat(e.content,"}");case"ArithArrayElement":return e.stringKey!==void 0?"".concat(e.array,"[").concat(e.stringKey,"]"):e.index?"".concat(e.array,"[").concat(ei(e.index),"]"):e.array;case"ArithDynamicBase":return"${".concat(e.baseExpr,"}#").concat(e.value);case"ArithDynamicNumber":return"${".concat(e.prefix,"}").concat(e.suffix);case"ArithConcat":return e.parts.map(ei).join("");case"ArithDoubleSubscript":return"".concat(e.array,"[").concat(ei(e.index),"]");case"ArithNumberSubscript":return"".concat(e.number,"[").concat(e.errorToken,"]");case"ArithSyntaxError":return e.errorToken;case"ArithSingleQuote":return"'".concat(e.content,"'");default:{var t=e;throw new Error("Unsupported arithmetic expression type: ".concat(t.type))}}}function K0(e){switch(e.type){case"CondBinary":return"".concat($s(e.left)," ").concat(e.operator," ").concat($s(e.right));case"CondUnary":return"".concat(e.operator," ").concat($s(e.operand));case"CondNot":return"! ".concat(K0(e.operand));case"CondAnd":return"".concat(K0(e.left)," && ").concat(K0(e.right));case"CondOr":return"".concat(K0(e.left)," || ").concat(K0(e.right));case"CondGroup":return"( ".concat(K0(e.expression)," )");case"CondWord":return $s(e.word);default:{var t=e;throw new Error("Unsupported conditional expression type: ".concat(t.type))}}}var _7e=/*#__PURE__*/function(){"use strict";function _7e1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_class_call_check(this,_7e1);A(this,"fs");A(this,"commands",new Map);A(this,"useDefaultLayout",!1);A(this,"limits");A(this,"secureFetch");A(this,"sleepFn");A(this,"traceFn");A(this,"logger");A(this,"defenseInDepthConfig");A(this,"coverageWriter");A(this,"jsBootstrapCode");A(this,"invokeToolFn");A(this,"transformPlugins",[]);A(this,"state");var o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b;var t=(o=e.fs)!=null?o:new t5(e.files);this.fs=t,this.useDefaultLayout=!e.cwd&&!e.files;var r=e.cwd||(this.useDefaultLayout?"/home/user":"/"),n=new Map([["HOME",this.useDefaultLayout?"/home/user":"/"],["PATH","/usr/bin:/bin"],["IFS"," \n"],["OSTYPE","linux-gnu"],["MACHTYPE","x86_64-pc-linux-gnu"],["HOSTTYPE","x86_64"],["HOSTNAME","localhost"],["PWD",r],["OLDPWD",r],["OPTIND","1"]].concat(_to_consumable_array(Object.entries((a=e.env)!=null?a:{}))));if(this.limits=Gbt(_object_spread({},e.executionLimits,e.maxCallDepth!==void 0&&{maxCallDepth:e.maxCallDepth},e.maxCommandCount!==void 0&&{maxCommandCount:e.maxCommandCount},e.maxLoopIterations!==void 0&&{maxLoopIterations:e.maxLoopIterations})),e.fetch?this.secureFetch=e.fetch:e.network&&(this.secureFetch=fwt(e.network)),this.sleepFn=e.sleep,this.traceFn=e.trace,this.logger=e.logger,this.defenseInDepthConfig=(s=e.defenseInDepth)!=null?s:!0,this.coverageWriter=e.coverage,this.state={env:n,cwd:r,previousDir:"/home/user",functions:new Map,localScopes:[],callDepth:0,sourceDepth:0,commandCount:0,lastExitCode:0,lastArg:"",startTime:Date.now(),lastBackgroundPid:0,virtualPid:(c=(l=e.processInfo)==null?void 0:l.pid)!=null?c:1,virtualPpid:(u=(d=e.processInfo)==null?void 0:d.ppid)!=null?u:0,virtualUid:(m=(p=e.processInfo)==null?void 0:p.uid)!=null?m:1e3,virtualGid:(g=(h=e.processInfo)==null?void 0:h.gid)!=null?g:1e3,bashPid:(v=(x=e.processInfo)==null?void 0:x.pid)!=null?v:1,nextVirtualPid:((_=(y=e.processInfo)==null?void 0:y.pid)!=null?_:1)+1,currentLine:1,options:{errexit:!1,pipefail:!1,nounset:!1,xtrace:!1,verbose:!1,posix:!1,allexport:!1,noclobber:!1,noglob:!1,noexec:!1,vi:!1,emacs:!1},shoptOptions:{extglob:!1,dotglob:!1,nullglob:!1,failglob:!1,globstar:!1,globskipdots:!0,nocaseglob:!1,nocasematch:!1,expand_aliases:!1,lastpipe:!1,xpg_echo:!1},inCondition:!1,loopDepth:0,exportedVars:new Set(["HOME","PATH","PWD","OLDPWD"].concat(_to_consumable_array(Object.keys(e.env||{})))),readonlyVars:new Set(["SHELLOPTS","BASHOPTS"]),hashTable:new Map},this.state.env.set("SHELLOPTS",zke(this.state.options)),this.state.env.set("BASHOPTS",jke(this.state.shoptOptions)),bvt(t,this.useDefaultLayout,{pid:this.state.virtualPid,ppid:this.state.virtualPpid,uid:this.state.virtualUid,gid:this.state.virtualGid}),r!=="/"&&_instanceof(t,t5))try{t.mkdirSync(r,{recursive:!0})}catch(w){}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=cvt(e.commands)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var w=_step.value;this.registerCommand(w)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(e.fetch||e.network)try{for(var _iterator1=dvt()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var w10=_step1.value;this.registerCommand(w10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(e.python)try{for(var _iterator2=pvt()[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var w11=_step2.value;this.registerCommand(w11)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var i=_type_of(e.javascript)=="object"?e.javascript:Object.create(null);if(e.javascript||i.invokeTool){var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=fvt()[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var w12=_step3.value;this.registerCommand(w12)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}i.bootstrap&&(this.jsBootstrapCode=i.bootstrap),i.invokeTool&&(this.invokeToolFn=i.invokeTool)}var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;if(e.customCommands)try{for(var _iterator4=e.customCommands[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var w13=_step4.value;mvt(w13)?this.registerCommand(hvt(w13)):this.registerCommand(_object_spread_props(_object_spread({},w13),{trusted:(b=w13.trusted)!=null?b:!0}))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}}_create_class(_7e1,[{key:"registerCommand",value:function registerCommand(e){this.commands.set(e.name,e);var t=this.fs;if(typeof t.writeFileSync=="function"){var r="#!/bin/bash\n# Built-in command: ".concat(e.name,"\n");try{t.writeFileSync("/bin/".concat(e.name),r)}catch(n){}try{t.writeFileSync("/usr/bin/".concat(e.name),r)}catch(n){}}}},{key:"logResult",value:function logResult(e){return this.logger&&(e.stdout&&this.logger.debug("stdout",{output:e.stdout}),e.stderr&&this.logger.info("stderr",{output:e.stderr}),this.logger.info("exit",{exitCode:e.exitCode})),e.stdout=Ibe(e.stdout),e.stderr=Ibe(e.stderr),e}},{key:"exec",value:function exec(e,t){return _async_to_generator(function(){var _this,d,u,r,n,i,p,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,_$p,m,a,s,l,c,_$p1,_tmp,p10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.state.callDepth===0&&(this.state.commandCount=0),this.state.commandCount++,this.state.commandCount>this.limits.maxCommandCount)return[2,{stdout:"",stderr:"bash: maximum command count (".concat(this.limits.maxCommandCount,") exceeded (possible infinite loop). Increase with executionLimits.maxCommandCount option.\n"),exitCode:1,env:Gc(this.state.env,t==null?void 0:t.env)}];if(!e.trim())return[2,{stdout:"",stderr:"",exitCode:0,env:Gc(this.state.env,t==null?void 0:t.env)}];(d=this.logger)==null||d.info("exec",{command:e});r=(u=t==null?void 0:t.cwd)!=null?u:this.state.cwd,i=r;if(!(t!=null&&t.cwd))return[3,7];if(!(t.env&&"PWD"in t.env))return[3,1];n=t.env.PWD;return[3,7];case 1:if(!(t!=null&&t.env&&!("PWD"in t.env)))return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,this.fs.realpath(r)];case 3:n=_state.sent(),i=n;return[3,5];case 4:p=_state.sent();n=r;return[3,5];case 5:return[3,7];case 6:n=r;_state.label=7;case 7:o=t!=null&&t.replaceEnv?new Map:new Map(this.state.env);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(t!=null&&t.env)try{for(_iterator=Object.entries(t.env)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),_$p=_step_value[0],m=_step_value[1];o.set(_$p,m)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n!==void 0&&o.set("PWD",n);a=_object_spread_props(_object_spread({},this.state),{env:o,cwd:i,functions:new Map(this.state.functions),localScopes:_to_consumable_array(this.state.localScopes),options:_object_spread({},this.state.options),hashTable:this.state.hashTable,groupStdin:zwt(t==null?void 0:t.stdin,t==null?void 0:t.stdinKind),signal:t==null?void 0:t.signal,extraArgs:t==null?void 0:t.args}),s=e;t!=null&&t.rawScript||(s=Abe(e));l=this.defenseInDepthConfig?hp.getInstance(this.defenseInDepthConfig):null,c=l==null?void 0:l.activate();_state.label=8;case 8:_state.trys.push([8,13,14,15]);_$p1=function(){return _async_to_generator(function(){var m,h,v,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,y,_,g,x;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=c_(s,{maxHeredocSize:this.limits.maxHeredocSize});if(this.transformPlugins.length>0){v=Object.create(null);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.transformPlugins[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){y=_step.value;_=y.transform({ast:m,metadata:v});m=_.ast,_.metadata&&(v=I9(v,_.metadata))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}h=v}g={fs:this.fs,commands:this.commands,limits:this.limits,exec:this.exec.bind(this),fetch:this.secureFetch,sleep:this.sleepFn,trace:this.traceFn,coverage:this.coverageWriter,requireDefenseContext:(l==null?void 0:l.isEnabled())===!0,jsBootstrapCode:this.jsBootstrapCode,invokeTool:this.invokeToolFn};return[4,new Vbt(g,a).executeScript(m)];case 1:x=_state.sent();return[2,(h&&(x.metadata=h),this.logResult(x))]}})}).call(_this)};if(!c)return[3,10];return[4,c.run(_$p1)];case 9:_tmp=_state.sent();return[3,12];case 10:return[4,_$p1()];case 11:_tmp=_state.sent();_state.label=12;case 12:return[2,_tmp];case 13:p10=_state.sent();if(_instanceof(p10,Ci))return[2,this.logResult({stdout:p10.stdout,stderr:p10.stderr,exitCode:p10.exitCode,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,Of))return[2,this.logResult({stdout:p10.stdout,stderr:p10.stderr,exitCode:p10.exitCode,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,Hi))return[2,this.logResult({stdout:p10.stdout,stderr:p10.stderr,exitCode:1,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,nV))return[2,this.logResult({stdout:p10.stdout,stderr:p10.stderr,exitCode:124,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,Qt))return[2,this.logResult({stdout:p10.stdout,stderr:la(p10.stderr),exitCode:Qt.EXIT_CODE,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,nn))return[2,this.logResult({stdout:"",stderr:"bash: security violation: ".concat(la(p10.message),"\n"),exitCode:1,env:Gc(this.state.env,t==null?void 0:t.env)})];if(p10.name==="ParseException")return[2,this.logResult({stdout:"",stderr:"bash: syntax error: ".concat(la(p10.message),"\n"),exitCode:2,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,e_))return[2,this.logResult({stdout:"",stderr:"bash: ".concat(la(p10.message),"\n"),exitCode:2,env:Gc(this.state.env,t==null?void 0:t.env)})];if(_instanceof(p10,RangeError))return[2,this.logResult({stdout:"",stderr:"bash: ".concat(la(p10.message),"\n"),exitCode:1,env:Gc(this.state.env,t==null?void 0:t.env)})];throw p10;case 14:c==null||c.deactivate();return[7];case 15:return[2]}})}).call(this)}},{key:"readFile",value:function readFile(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.fs.readFile(this.fs.resolvePath(this.state.cwd,e))]})}).call(this)}},{key:"writeFile",value:function writeFile(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.fs.writeFile(this.fs.resolvePath(this.state.cwd,e),t)]})}).call(this)}},{key:"getCwd",value:function getCwd(){return this.state.cwd}},{key:"getEnv",value:function getEnv(){return Jc(this.state.env)}},{key:"registerTransformPlugin",value:function registerTransformPlugin(e){this.transformPlugins.push(e)}},{key:"transform",value:function transform(e){var t=Abe(e),r=c_(t,{maxHeredocSize:this.limits.maxHeredocSize}),n=Object.create(null);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.transformPlugins[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.transform({ast:r,metadata:n});r=o.ast,o.metadata&&(n=I9(n,o.metadata))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{script:hwt(r),ast:r,metadata:n}}}]);return _7e1}();function Abe(e){var t=e.split("\n"),r=[],n=[];for(var i=0;i<t.length;i++){var o=t[i];if(n.length>0){var l=n[n.length-1];if((l.stripTabs?o.replace(/^\t+/,""):o)===l.delimiter){r.push(o.trimStart()),n.pop();continue}r.push(o);continue}var a=o.trimStart();r.push(a);var s=/<<(-?)\s*(['"]?)([\w-]+)\2/g;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=a.matchAll(s)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l10=_step.value;var c=l10[1]==="-",d=l10[3];n.push({delimiter:d,stripTabs:c})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return r.join("\n")}var Fwt=new TextDecoder("utf-8",{fatal:!0});function Ibe(e){if(!e)return e;var t=!1;for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i>255)return e;i>127&&(t=!0)}if(!t)return e;var r=new Uint8Array(e.length);for(var n10=0;n10<e.length;n10++)r[n10]=e.charCodeAt(n10);try{return Fwt.decode(r)}catch(n){return e}}function zwt(e,t){if(e!==void 0)return t==="bytes"?e:n1(e)}kr();var b7e=/*#__PURE__*/function(){"use strict";function b7e1(e){_class_call_check(this,b7e1);A(this,"baseFs");A(this,"mounts",new Map);var t;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(this.baseFs=(t=e==null?void 0:e.base)!=null?t:new t5,e==null?void 0:e.mounts)try{for(var _iterator=e.mounts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,r=_step_value.mountPoint,n=_step_value.filesystem;this.mount(r,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}_create_class(b7e1,[{key:"mount",value:function mount(e,t){this.validateMountPath(e);var r=mn(e);this.validateMount(r),this.mounts.set(r,{mountPoint:r,filesystem:t})}},{key:"unmount",value:function unmount(e){var t=mn(e);if(!this.mounts.has(t))throw new Error("No filesystem mounted at '".concat(e,"'"));this.mounts.delete(t)}},{key:"getMounts",value:function getMounts(){return Array.from(this.mounts.values()).map(function(e){return{mountPoint:e.mountPoint,filesystem:e.filesystem}})}},{key:"isMountPoint",value:function isMountPoint(e){var t=mn(e);return this.mounts.has(t)}},{key:"validateMountPath",value:function validateMountPath(e){var t=e.split("/");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;if(r==="."||r==="..")throw new Error("Invalid mount point '".concat(e,"': contains '.' or '..' segments"))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"validateMount",value:function validateMount(e){if(e==="/")throw new Error("Cannot mount at root '/'");var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.mounts.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(t!==e){if(e.startsWith("".concat(t,"/")))throw new Error("Cannot mount at '".concat(e,"': inside existing mount '").concat(t,"'"));if(t.startsWith("".concat(e,"/")))throw new Error("Cannot mount at '".concat(e,"': would contain existing mount '").concat(t,"'"))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"routePath",value:function routePath(e){aa(e,"access");var t=mn(e),r=null,n=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.mounts.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=i.mountPoint;if(t===o)return{fs:i.filesystem,relativePath:"/"};t.startsWith("".concat(o,"/"))&&o.length>n&&(r=i,n=o.length)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(r){var i10=t.slice(n);return{fs:r.filesystem,relativePath:i10||"/"}}return{fs:this.baseFs,relativePath:t}}},{key:"getChildMountPoints",value:function getChildMountPoints(e){var t=mn(e),r=t==="/"?"/":"".concat(t,"/"),n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.mounts.keys()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.startsWith(r)){var o=i.slice(r.length).split("/")[0];o&&!n.includes(o)&&n.push(o)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}},{key:"readFile",value:function readFile(e,t){return _async_to_generator(function(){var _this_routePath,r,n;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),r=_this_routePath.fs,n=_this_routePath.relativePath;return[2,r.readFile(n,t)]})}).call(this)}},{key:"readFileBytes",value:function readFileBytes(e){return _async_to_generator(function(){var _this_routePath,t,r;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),t=_this_routePath.fs,r=_this_routePath.relativePath;return[2,p_(t,r)]})}).call(this)}},{key:"readFileBuffer",value:function readFileBuffer(e){return _async_to_generator(function(){var _this_routePath,t,r;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),t=_this_routePath.fs,r=_this_routePath.relativePath;return[2,t.readFileBuffer(r)]})}).call(this)}},{key:"writeFile",value:function writeFile(e,t,r){return _async_to_generator(function(){var _this_routePath,n,i;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.writeFile(i,t,r)]})}).call(this)}},{key:"appendFile",value:function appendFile(e,t,r){return _async_to_generator(function(){var _this_routePath,n,i;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.appendFile(i,t,r)]})}).call(this)}},{key:"exists",value:function exists(e){return _async_to_generator(function(){var t,_this_routePath,r,n;return _ts_generator(this,function(_state){t=mn(e);if(this.mounts.has(t)||this.getChildMountPoints(t).length>0)return[2,!0];_this_routePath=this.routePath(e),r=_this_routePath.fs,n=_this_routePath.relativePath;return[2,r.exists(n)]})}).call(this)}},{key:"stat",value:function stat(e){return _async_to_generator(function(){var t,r,o,o10,_this_routePath,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=mn(e),r=this.mounts.get(t);if(!r)return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,r.filesystem.stat("/")];case 2:return[2,_state.sent()];case 3:o=_state.sent();return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}];case 4:if(!(this.getChildMountPoints(t).length>0))return[3,8];_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,this.baseFs.stat(t)];case 6:return[2,_state.sent()];case 7:o10=_state.sent();return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}];case 8:_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.stat(i)]}})}).call(this)}},{key:"lstat",value:function lstat(e){return _async_to_generator(function(){var t,r,o,o10,_this_routePath,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=mn(e),r=this.mounts.get(t);if(!r)return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,r.filesystem.lstat("/")];case 2:return[2,_state.sent()];case 3:o=_state.sent();return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}];case 4:if(!(this.getChildMountPoints(t).length>0))return[3,8];_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,this.baseFs.lstat(t)];case 6:return[2,_state.sent()];case 7:o10=_state.sent();return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}];case 8:_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.lstat(i)]}})}).call(this)}},{key:"mkdir",value:function mkdir(e,t){return _async_to_generator(function(){var r,_this_routePath,n,i;return _ts_generator(this,function(_state){r=mn(e);if(this.mounts.has(r)){if(t!=null&&t.recursive)return[2];throw new Error("EEXIST: directory already exists, mkdir '".concat(e,"'"))}if(this.getChildMountPoints(r).length>0&&t!=null&&t.recursive)return[2];_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.mkdir(i,t)]})}).call(this)}},{key:"readdir",value:function readdir(e){return _async_to_generator(function(){var t,r,n,_this_routePath,i,o,_$s,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,s,l10,c,a,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$s1;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=mn(e),r=new Set,n=null,_this_routePath=this.routePath(e),i=_this_routePath.fs,o=_this_routePath.relativePath;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,i.readdir(o)];case 2:_$s=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_$s[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){l=_step.value;r.add(l)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,4];case 3:s=_state.sent();l10=s.code,c=s.message||"";if(l10!=="ENOENT"&&!c.includes("ENOENT"))throw s;n=s;return[3,4];case 4:a=this.getChildMountPoints(t);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=a[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){_$s1=_step1.value;r.add(_$s1)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(r.size===0&&n&&!this.mounts.has(t))throw n;return[2,Array.from(r).sort()]}})}).call(this)}},{key:"rm",value:function rm1(e,t){return _async_to_generator(function(){var r,_this_routePath,n,i;return _ts_generator(this,function(_state){r=mn(e);if(this.mounts.has(r))throw new Error("EBUSY: mount point, cannot remove '".concat(e,"'"));if(this.getChildMountPoints(r).length>0)throw new Error("EBUSY: contains mount points, cannot remove '".concat(e,"'"));_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.rm(i,t)]})}).call(this)}},{key:"cp",value:function cp1(e,t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){n=this.routePath(e),i=this.routePath(t);return[2,n.fs===i.fs?n.fs.cp(n.relativePath,i.relativePath,r):this.crossMountCopy(e,t,r)]})}).call(this)}},{key:"mv",value:function mv1(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=mn(e);if(this.mounts.has(r))throw new Error("EBUSY: mount point, cannot move '".concat(e,"'"));n=this.routePath(e),i=this.routePath(t);if(n.fs===i.fs)return[2,n.fs.mv(n.relativePath,i.relativePath)];return[4,this.cp(e,t,{recursive:!0})];case 1:_state.sent();return[4,this.rm(e,{recursive:!0})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"resolvePath",value:function resolvePath(e,t){return Fke(e,t)}},{key:"getAllPaths",value:function getAllPaths(){var e=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.baseFs.getAllPaths()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;e.add(t)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=this.mounts.keys()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var t10=_step1.value;var r=t10.split("/").filter(Boolean),n="";var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=r[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var o=_step2.value;n="".concat(n,"/").concat(o),e.add(n)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var i=this.mounts.get(t10);var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;if(i)try{for(var _iterator3=i.filesystem.getAllPaths()[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var o10=_step3.value;o10==="/"?e.add(t10):e.add("".concat(t10).concat(o10))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return Array.from(e).sort()}},{key:"chmod",value:function chmod(e,t){return _async_to_generator(function(){var r,n,_this_routePath,i,o;return _ts_generator(this,function(_state){r=mn(e),n=this.mounts.get(r);if(n)return[2,n.filesystem.chmod("/",t)];_this_routePath=this.routePath(e),i=_this_routePath.fs,o=_this_routePath.relativePath;return[2,i.chmod(o,t)]})}).call(this)}},{key:"symlink",value:function symlink(e,t){return _async_to_generator(function(){var _this_routePath,r,n;return _ts_generator(this,function(_state){_this_routePath=this.routePath(t),r=_this_routePath.fs,n=_this_routePath.relativePath;return[2,r.symlink(e,n)]})}).call(this)}},{key:"link",value:function link(e,t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=this.routePath(e),n=this.routePath(t);if(r.fs!==n.fs)throw new Error("EXDEV: cross-device link not permitted, link '".concat(e,"' -> '").concat(t,"'"));return[2,r.fs.link(r.relativePath,n.relativePath)]})}).call(this)}},{key:"readlink",value:function readlink(e){return _async_to_generator(function(){var _this_routePath,t,r;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),t=_this_routePath.fs,r=_this_routePath.relativePath;return[2,t.readlink(r)]})}).call(this)}},{key:"realpath",value:function realpath(e){return _async_to_generator(function(){var t,_this_routePath,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=mn(e);if(this.mounts.get(t))return[2,t];_this_routePath=this.routePath(e),r=_this_routePath.fs,n=_this_routePath.relativePath;return[4,r.realpath(n)];case 1:i=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.mounts[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),o=_step_value[0],a=_step_value[1];if(t===o||t.startsWith("".concat(o,"/")))return[2,i==="/"?o:"".concat(o).concat(i)]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,i]}})}).call(this)}},{key:"crossMountCopy",value:function crossMountCopy(e,t,r){return _async_to_generator(function(){var n,i,i10,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,a,s,err,i11;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.lstat(e)];case 1:n=_state.sent();if(!n.isFile)return[3,5];return[4,this.readFileBuffer(e)];case 2:i=_state.sent();return[4,this.writeFile(t,i)];case 3:_state.sent();return[4,this.chmod(t,n.mode)];case 4:_state.sent();return[3,19];case 5:if(!n.isDirectory)return[3,16];if(!(r!=null&&r.recursive))throw new Error("cp: ".concat(e," is a directory (not copied)"));return[4,this.mkdir(t,{recursive:!0})];case 6:_state.sent();return[4,this.readdir(e)];case 7:i10=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=8;case 8:_state.trys.push([8,13,14,15]);_iterator=i10[Symbol.iterator]();_state.label=9;case 9:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,12];o=_step.value;a=a_(e,o),s=a_(t,o);return[4,this.crossMountCopy(a,s,r)];case 10:_state.sent();_state.label=11;case 11:_iteratorNormalCompletion=true;return[3,9];case 12:return[3,15];case 13:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,15];case 14:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 15:return[3,19];case 16:if(!n.isSymbolicLink)return[3,19];return[4,this.readlink(e)];case 17:i11=_state.sent();return[4,this.symlink(i11,t)];case 18:_state.sent();_state.label=19;case 19:return[2]}})}).call(this)}},{key:"utimes",value:function utimes(e,t,r){return _async_to_generator(function(){var _this_routePath,n,i;return _ts_generator(this,function(_state){_this_routePath=this.routePath(e),n=_this_routePath.fs,i=_this_routePath.relativePath;return[2,n.utimes(i,t,r)]})}).call(this)}}]);return b7e1}();var vP=require("obsidian");var dP=nr(ln(),1);var w7e="# AI ChatBox\n\nThe plugin includes an AI Agent that can read, edit, and manage vault files\nthrough natural-language requests. It supports compatible AI providers and\ncan carry out multi-step tasks with the tools available in the current chat.\n\n## Approval behavior\n\nBefore making a change, the agent requests approval by default. The user can\napprove an individual operation, approve an operation type for the current\nsession, or enable YOLO mode in settings to auto-approve operations.\n\n## Run HTML in chat\n\nWhen the agent's reply contains an HTML code block, the chat shows a Run\ntoggle that renders the code in a sandboxed preview pane inside the message\n(scripts, forms, and popups are allowed, but the pane is sandboxed). Use it\nto preview generated pages, UI prototypes, or widgets without leaving\nObsidian.\n\n## Sessions are files\n\nChat sessions persist as individual JSON files in the vault:\n\n```text\n.agents/nutstore-sync/\n├── chat-meta.json # lightweight index of sessions and titles\n└── sessions/<id>.json # one full ChatSession per file\n```\n\nEach session file holds its title alongside the snapshot, so the index can\nalways be rebuilt from the files. Because sessions are plain vault files,\nthey are grep-able and sync across devices with the same sync feature.\nContext can be compressed manually or automatically, and a message can be\nrecalled, optionally restoring the file changes it made.\n\nDo not say a provider, model, or approval setting is configured unless the\nuser supplies that information or it is available in the current workspace.\n";var S7e="# Filter-rule compatibility contract\n\nThe sync filter uses gitignore-style path matching, not raw `.gitignore` files.\n\n## Compatible behavior\n\n- Rules are evaluated in order and the last matching rule wins.\n- Excluded parent directories prune their descendants. A descendant can only be\n included after every excluded ancestor has been included again.\n- `/`, a trailing `/`, `*`, `?`, bracket expressions, and the documented `**`\n positions follow gitignore path semantics.\n- Blank patterns, escaping, unescaped trailing spaces, and path normalization\n follow the same behavior covered by the Git-generated oracle corpus.\n\n## Intentional product extensions\n\n- Include and exclude are explicit rule types. A leading `!` is therefore not\n parsed as negation.\n- A leading `#` is a literal filename character, not a comment marker.\n- Case sensitivity is stored per rule and is deterministic across devices. Git\n instead controls case folding for the repository through `core.ignoreCase`.\n- A rule can be disabled (`disabled: true`); disabled rules do not match\n anything and behave as if absent, without being deleted from the list.\n- Every rule is relative to the vault root. Nested `.gitignore` scopes are not\n supported.\n- Wildcards operate on Unicode characters for user-facing vault names; Git's C\n wildmatch implementation can differ for multibyte names.\n- Directory decisions are traversal decisions. For example, `directory/**`\n keeps `directory` traversable so a later child include can still take effect,\n even though `git check-ignore directory/` reports a direct pattern match.\n\nCompatibility claims in product copy should use “gitignore-style path rules”,\nnot “complete `.gitignore` compatibility”.\n\n## Config directory sync mode\n\nThe `configDirSyncMode` setting is layered on top of the filter rules:\n\n- `none` excludes the whole config directory.\n- `bookmarks` excludes the config directory except `bookmarks.json`.\n- `all` adds no system rules: the config directory is included unless the\n user's own rules exclude it. A rule that matches the config directory itself\n (for example a catch-all hidden-path rule) still prunes the whole subtree, so\n `all` can intentionally sync nothing from the config directory until that\n rule is adjusted. The plugin warns about this before enabling `all`.\n";var k7e='# MCP Server Configuration\n\nUse this reference when the user asks to add, edit, remove, or diagnose an MCP\nserver.\n\n## Configuration workflow\n\n1. The file is a real vault file at `.agents/nutstore-sync/mcp.json`, visible\n to the tools at `/.agents/nutstore-sync/mcp.json`.\n2. Read the file first when it exists: `cat /.agents/nutstore-sync/mcp.json`.\n Preserve unrelated server entries unless the user asks to remove them.\n3. The file is a JSON object with a top-level `mcpServers` map. Each server\n name must use letters, numbers, hyphens, or underscores, and must start with\n a letter or number.\n4. Only HTTP servers are supported. A server entry has `type: "http"`, a\n `url`, optional string `headers`, and optional boolean `enabled`. A server\n with `enabled` missing or `false` is disabled; in-file `enabled: false`\n differs from disabling a server for one chat session.\n5. To add, edit, or remove a server, rewrite the complete `mcpServers` map with\n `jq` on the current contents or an `apply_patch` update (read the file before\n patching). Keep the JSON valid and intact, and never drop other servers.\n6. Handle headers as secrets: retain existing values where possible and never\n include their values in a chat response.\n7. MCP tools are refreshed before the next agent turn. After changing the file,\n tell the user that the configuration will take effect on their next message;\n the new tools are not available in the current turn.\n\nUse this neutral example only when the user needs the file format:\n\n```json\n{\n "mcpServers": {\n "notes-service": {\n "type": "http",\n "url": "https://example.com/mcp",\n "enabled": true\n }\n }\n}\n```\n\nIf connection or parsing fails, explain the observed error and check the\nserver name, JSON syntax, URL, and header names before proposing a change.\n';var C7e='# Plugin Settings File\n\nUse this reference when the user asks to change plugin sync settings, filters, or\ntoggles through the chat.\n\n## What this file is\n\nThe plugin exposes a whitelist of settings as the virtual file\n`/.config/nutstore-sync/settings.json`. It is not a real file on disk: it\nreflects the live plugin settings, and every save is validated and applied on the\nspot. It never contains credentials — account, credential, OAuth responses,\nenterprise base URL, and AI provider API keys are deliberately excluded and can\nnever be read or set through it.\n\n## Read the current settings first\n\n```bash\ncat /.config/nutstore-sync/settings.json\n```\n\nAlways read the file before proposing or making a change, and preserve the\nvalues of any keys you are not changing.\n\n## How to change it\n\nA write applies only the keys present in the JSON you save; keys you omit keep\ntheir current value. The file must be valid JSON and must include at least one\nsupported setting.\n\n- **With bash**: rewrite the file with `jq` or a direct write, for example:\n `cat /.config/nutstore-sync/settings.json | jq \'.syncMode = "strict"\' > /.config/nutstore-sync/settings.json`.\n An invalid write fails and changes nothing.\n- **With apply_patch**: read the file first, then update it with a normal\n `*** Update File: /.config/nutstore-sync/settings.json` patch.\n\n## Allowed keys and constraints\n\n| Key | Type | Notes |\n| ------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `filterRules` | object `{ rules: [...] }` | Max 200 rules. Each rule: `expr` (non-empty glob string), `type` (`include` or `exclude`), optional `caseSensitive` (boolean), optional `disabled` (boolean, default `false`; disabled rules are ignored). |\n| `skipLargeFiles` | object `{ maxSize: string }` | Byte-size string, at most `500MB` (for example `"50MB"`). |\n| `startupSyncDelaySeconds` | number | Clamped to `0`–`86400`. |\n| `autoSyncIntervalSeconds` | number | Clamped to `0`–`86400`. |\n| `realtimeSync` | boolean | |\n| `confirmBeforeSync` | boolean | |\n| `confirmBeforeDeleteInAutoSync` | boolean | |\n| `syncMode` | `strict` or `loose` | |\n| `conflictStrategy` | one of `no-conflict-merge`, `diff3`, `local-priority`, `server-priority` | |\n| `configDirSyncMode` | one of `none`, `bookmarks`, `all` | `none` excludes the config directory, `bookmarks` syncs only `bookmarks.json`, `all` adds no rules — the config directory is included unless your own filter rules exclude it. |\n| `language` | `zh`, `en`, or `""` | Empty string means auto. |\n\nNo other key is allowed; an unknown key such as `credential` or `account` makes\nthe whole write fail so credentials can never be modified here.\n\nUse this neutral example only when the user needs the file format:\n\n```json\n{\n "syncMode": "strict",\n "realtimeSync": true,\n "startupSyncDelaySeconds": 30,\n "skipLargeFiles": {\n "maxSize": "50MB"\n }\n}\n```\n\nA successful save requests a settings update confirmation, applies the change\nimmediately, and does not require a restart. If a write fails, explain the\nobserved validation error before retrying.\n';var E7e="---\nname: nutstore-sync-guide\ndescription: Explain and operate Nutstore Sync features—including syncing, plugin settings, AI ChatBox, and MCP server configuration—when users ask for plugin help, setup, or troubleshooting.\n---\n\n# Nutstore Sync Guide\n\nAnswer questions about the Nutstore Sync plugin and support the MCP server\nconfiguration workflow.\n\n## Stay within documented behavior\n\n- Describe only documented plugin behavior; never infer the user's sync state,\n account state, or settings from the question alone.\n- Do not read, reveal, or repeat credentials, authorization headers, or other\n secrets unless the user explicitly asks to manage the relevant configuration.\n- Provide UI navigation or troubleshooting steps only when the requested action\n is not available through current tools; never claim a UI setting changed\n without evidence.\n\n## Read only the reference you need\n\n| Topic | Reference |\n| ---------------------------------------------------------------------------- | ---------------------------- |\n| Synchronization, account connection, conflicts, large files, troubleshooting | `references/sync.md` |\n| Plugin settings file, sync timing, toggles, enums | `references/settings.md` |\n| Filter rule semantics, include/exclude patterns, case sensitivity | `references/filter-rules.md` |\n| AI provider setup, ChatBox, approval behavior | `references/ai-chatbox.md` |\n| Adding, editing, removing, diagnosing an MCP server | `references/mcp-servers.md` |\n\nFor a request spanning several topics, read each relevant reference before\nanswering or acting. Read the MCP reference before making any MCP change, and\nread the settings reference before changing plugin settings.\n";var T7e="# Synchronization Guide\n\nNutstore Sync synchronizes an Obsidian vault and Nutstore through WebDAV. It\nuses incremental synchronization after it has synchronization history, so the\nfirst run can take longer than later runs.\n\n## Before recommending a change\n\nAsk which side is the source of truth, whether the device should be allowed to\nupload, and whether the user needs an exact mirror or wants to preserve unique\nfiles on both sides. Do not infer the current policy, conflict strategy, or\nsync result from the question alone.\n\nRecommend a backup before a first sync, a policy that can delete files, or an\nautomatic merge of important notes. Prefer a manual, confirmed sync when\ntesting a new policy or resolving a conflict.\n\n## Sync policies\n\nThe sync policy is chosen per device. It controls the direction of file\nchanges; excluded files, files over the configured size limit, and protected\nplugin files are exceptions to the normal rules.\n\n### Two Way\n\nUse this as the normal multi-device policy. New files, edits, and deletions are\npropagated in both directions.\n\n- A change on only one side is copied to the other side.\n- If a deletion meets an edit on the other side, the edited copy is retained\n and restored rather than being deleted.\n- If both sides edit the same file, the configured conflict strategy decides\n the result.\n\n### Send Only\n\nUse this when the local vault is normally authoritative and the cloud should\nnot introduce changes back into the device.\n\n- Local new or edited files upload to the cloud.\n- A local deletion removes the cloud copy only when that cloud copy has not\n changed independently.\n- Cloud-only files and cloud edits are preserved instead of being downloaded\n or overwritten.\n- When both copies have changed, the item is skipped to protect the cloud\n edit; this policy does not run the conflict resolver.\n\n### Send Only: Override Changes\n\nUse only when the cloud must be made to match the current local vault.\n\n- Local files replace cloud files with the same path.\n- Cloud files that do not exist locally are removed.\n- Back up first and review pending operations, because this mode can delete\n cloud-only content.\n\n### Receive Only\n\nUse this for a device that should follow the cloud while preserving its unique\nlocal work.\n\n- Cloud new or edited files download to the local vault.\n- A cloud deletion removes a local copy only when that local copy has not\n changed independently.\n- Local-only files and local edits are preserved instead of being uploaded or\n overwritten.\n- When both copies have changed, the item is skipped to protect the local\n edit; this policy does not run the conflict resolver.\n- The plugin never deletes its own files (the `plugins/nutstore-sync/` folder\n inside the Obsidian config directory). When the remote vault does not have\n the plugin installed, those local files are preserved, even in Revert mode.\n\n### Receive Only: Revert Local Changes\n\nUse only when the local vault must be made to match the cloud.\n\n- Cloud files replace local files with the same path.\n- Local files that do not exist in the cloud are removed.\n- Back up first and review pending operations, because this mode can delete\n local-only content.\n\n## Strict and loose modes\n\n- **Strict** checks same-path files without synchronization history instead of\n assuming they are equal. In two-way sync, such a pair is handled as a\n conflict; one-way policies follow their chosen source side.\n- **Loose** is the default and is faster for large vaults. If a same-path file\n has no synchronization history and both copies have the same byte size, it\n is treated as already synchronized. Their contents are not compared in that\n case.\n\nUse strict mode when correctness matters more than speed, especially after\ncopying files independently to both locations. Use loose mode only when equal\nsizes are an acceptable shortcut.\n\n## Conflict resolution\n\nA two-way file conflict occurs when both copies changed since their last\nknown common state. The selected strategy applies to that file.\n\n| Strategy | User-visible result | Use when |\n| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| Conflict-free merge | Attempts to produce one merged text file without conflict markers. For JSON, independent object fields can be combined; competing changes to the same value keep the local value. | Both sides contain meaningful text edits and the user will review the result. |\n| Diff3 merge | Writes Git-style `<<<<<<<`, `=======`, and `>>>>>>>` markers for overlapping edits. | The user wants to inspect and decide every overlap. |\n| Local priority | Replaces the cloud copy with the local file. | The local file is unquestionably correct. |\n| Server priority | Replaces the local copy with the cloud file. | The cloud file is unquestionably correct. |\n\nConflict-free merge runs a fallback chain on text files:\n\n1. If both copies are identical, nothing changes.\n2. For JSON files, fields are merged one by one: independent fields are\n combined, and a field changed on both sides keeps the local value.\n3. Otherwise a Git-style diff3 merge runs; if no hunks overlap, its clean\n merge is used directly.\n4. If diff3 reports overlapping edits, a collaborative-editing merge (Yjs\n CRDT) reconciles both branches against the common base snapshot.\n5. If that also fails, the merge is reported as failed rather than silently\n overwriting anything, leaving the file for manual handling.\n\nThe three-way merge is based on the last common base blob recorded for the\nfile, so repeated merges are deterministic. A successful merge is written to\nboth the local note and the remote copy.\n\nAutomatic text merging is available only for recognized text formats, including\nMarkdown, JSON, YAML, CSV, common source/configuration files, and plain text.\nIt is not a safe choice for binary or unsupported file types; choose the\nauthoritative side instead. Files over the configured size limit are skipped,\nincluding during conflict handling.\n\nWhen using conflict-free merge, review the merged note before relying on it.\nWhen using Diff3, resolve every marker block and make sure no markers remain.\nFor a Markdown file with markers, a configured AI model enables the editor's\nconflict-resolution action, which opens a focused ChatBox task; it does not\nsilently resolve the file.\n\nIf the same path is a folder on one side and a file on the other, correct the\nlayout manually before retrying. Do not promise that the plugin can merge that\nkind of conflict.\n\n## Other settings that affect results\n\n- **Confirm before sync** displays the pending operations before they run.\n- **Confirm before deleting files during auto-sync** lets the user choose\n whether to delete a local file or re-upload it when automatic sync would\n remove it.\n- **Real-time sync**, startup sync delay, and interval sync control when a\n sync starts; they do not change the selected policy.\n- **Skip large files** omits files above the configured limit from sync tasks.\n Lower the limit if large files are causing reliability problems, but explain\n that skipped files will remain unsynchronized.\n- Configuration-directory sync can exclude the whole Obsidian configuration\n directory, include only bookmarks, or include it more broadly. Some plugin\n runtime data remains excluded even when configuration sync is enabled.\n- Inclusion and exclusion filters apply before reconciliation. Do not tell a\n user that an excluded path will be synchronized.\n\nFor which of these settings the agent can change directly through the chat and\nthe exact allowed values, read `references/settings.md`.\n\n## Troubleshooting workflow\n\n1. Ask whether the issue is a missing file, an unexpected overwrite, a skipped\n item, a conflict marker, or a connection/error message.\n2. Confirm the intended source of truth and the active policy before proposing\n an override or revert policy.\n3. Check filters, file-size limits, and the selected strict/loose mode before\n treating an item as a conflict.\n4. For a conflict, preserve copies of both versions, choose a strategy that\n matches the user's intent, then review the resulting file.\n5. Ask for the visible error or a redacted log excerpt if more evidence is\n needed. Never request credentials, access tokens, or authorization headers.\n\nDo not state that synchronization completed, failed, or used a particular\nstrategy unless the user provides evidence from the progress UI or logs.\n";var A7e="---\nname: skill-creator\ndescription: Create and define agent Skills in the current Obsidian vault. Use when the user asks to create a Skill, write a SKILL.md file, or turn a workflow into reusable agent instructions.\n---\n\n# Skill Creator\n\nCreate reusable Skills for the agent.\n\n## Understand Skills\n\nA Skill is a self-contained directory of instructions that teaches the agent\nhow to perform a particular kind of task. Skills use progressive disclosure:\n\n1. The agent first sees only the Skill name, description, and path.\n2. When a task matches, the agent reads the full `SKILL.md`.\n3. Supporting files are accessed later only when needed.\n\nA Skill provides knowledge and workflow instructions. It does not grant new\npermissions, bypass safeguards, or require a particular tool.\n\n## Create the required structure\n\nCreate each Vault Skill at:\n\n```text\n.agents/skills/<skill-name>/SKILL.md\n```\n\nThe directory name and frontmatter `name` must match exactly. Every Skill\nrequires YAML frontmatter followed by Markdown instructions:\n\n```markdown\n---\nname: example-skill\ndescription: Explain what this Skill does and when the agent should use it.\n---\n\n# Example Skill\n\nFollow the workflow described here.\n```\n\n## Choose the name\n\nChoose a short, action-oriented name that:\n\n- Contains only lowercase ASCII letters, digits, and single hyphens.\n- Starts and ends with a letter or digit.\n- Is no longer than 64 characters.\n- Exactly matches its directory name.\n\n## Write the description\n\nTreat `description` as the triggering contract. State both what the Skill does\nand when it should be used. Keep it specific enough to distinguish the Skill\nfrom unrelated tasks. The description must be non-empty and no longer than\n1024 characters.\n\nDo not put essential triggering conditions only in the body because the body is\nnot loaded until after the Skill has been selected.\n\n## Write effective instructions\n\nAssume the agent is already capable. Include only specialized, procedural,\nproject-specific, or easy-to-miss information. Write direct, actionable\ninstructions and prefer concise workflows or examples over broad explanations.\n\nMatch detail to the task: give flexible guidance when several approaches are\nvalid, ordered steps when sequence matters, and exact commands or scripts only\nwhen deterministic behavior is required.\n\nDo not unnecessarily restrict which tools the agent may use. Let it choose from\nthe tools available in its environment unless a particular integration is an\nessential part of the Skill.\n\n## Add optional resources only when useful\n\n```text\nskill-name/\n├── SKILL.md\n├── scripts/\n├── references/\n└── assets/\n```\n\n- Use `scripts/` for repeatable deterministic operations.\n- Use `references/` for detailed knowledge loaded only when needed.\n- Use `assets/` for templates and files used in generated output.\n\nSupporting files are not automatically loaded. Reference them clearly from\n`SKILL.md` and explain when to read or use them. Avoid unrelated files such as\nREADME files, changelogs, or installation guides.\n\n## Follow the creation workflow\n\n1. Determine the intended task and representative user requests.\n2. Choose and validate the Skill name.\n3. Check whether the target directory already exists.\n4. Plan the minimum required instructions and supporting resources.\n5. Create the directory and `SKILL.md` with any suitable available tools.\n6. Add optional resources only when they provide reusable value.\n7. Read the resulting files and verify their structure and content.\n8. Report the created path and briefly describe when the Skill will trigger.\n\nDo not overwrite an existing Skill without making the conflict clear to the\nuser.\n\n## Validate the result\n\nVerify that:\n\n- The file is at `.agents/skills/<name>/SKILL.md`.\n- The directory and frontmatter names match.\n- `name` and `description` are present and valid.\n- The body contains actionable instructions.\n- Every referenced supporting file exists.\n- `SKILL.md` is UTF-8 text, contains no null bytes, and is smaller than 64 KiB.\n";var I7e=Yl,rG=[{name:"nutstore-sync-guide",description:"Explain and operate Nutstore Sync features—including syncing, plugin settings, AI ChatBox, and MCP server configuration—when users ask for plugin help, setup, or troubleshooting.",path:"".concat(I7e,"/nutstore-sync-guide/SKILL.md"),content:E7e,resources:[{path:"references/ai-chatbox.md",content:w7e},{path:"references/filter-rules.md",content:S7e},{path:"references/mcp-servers.md",content:k7e},{path:"references/settings.md",content:C7e},{path:"references/sync.md",content:T7e}]},{name:"skill-creator",description:"Create and define agent Skills in the current Obsidian vault. Use when the user asks to create a Skill, write a SKILL.md file, or turn a workflow into reusable agent instructions.",path:"".concat(I7e,"/skill-creator/SKILL.md"),content:A7e}];function Hwt(e,t){var r=dP.posix.normalize(t);if(dP.posix.isAbsolute(t)||r==="."||r===".."||r.startsWith("../"))throw new Error("Built-in Skill resource path must stay within '".concat(e,"': ").concat(t));return"/".concat(e,"/").concat(r)}function P7e(){return _async_to_generator(function(){var r,e,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,i,o,err,err,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=new t5;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,15,16,17]);_iterator=rG[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,14];n=_step.value;return[4,e.mkdir("/".concat(n.name),{recursive:!0})];case 3:_state.sent();return[4,e.writeFile("/".concat(n.name,"/SKILL.md"),n.content)];case 4:_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=5;case 5:_state.trys.push([5,11,12,13]);_iterator1=((r=n.resources)!=null?r:[])[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,10];i=_step1.value;o=Hwt(n.name,i.path);return[4,e.mkdir(dP.posix.dirname(o),{recursive:!0})];case 7:_state.sent();return[4,e.writeFile(o,i.content)];case 8:_state.sent();_state.label=9;case 9:_iteratorNormalCompletion1=true;return[3,6];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 13:_iteratorNormalCompletion=true;return[3,2];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 17:t=new Set(["writeFile","appendFile","mkdir","rm","cp","mv","chmod","symlink","link","utimes"]);return[2,new Proxy(e,{get:function get1(n,i,o){if(typeof i=="string"&&t.has(i))return function(){for(var _len=arguments.length,l=new Array(_len),_key=0;_key<_len;_key++){l[_key]=arguments[_key]}return _async_to_generator(function(){var c;return _ts_generator(this,function(_state){c=typeof l[0]=="string"?l[0]:"/";throw new Error("EROFS: read-only built-in Skills path '".concat(c,"'"))})})()};var a=Reflect.get(n,i,o);return typeof a!="function"?a:a.bind(n)}})]}})})()}function pP(e,t){return _async_to_generator(function(){var r,n,_ref,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.list(t)];case 1:r=_state.sent(),n=function(a){return _async_to_generator(function(){var s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,e.stat(a)];case 1:return[2,Boolean.apply(void 0,[_state.sent()])];case 2:s=_state.sent();return[2,!1];case 3:return[2]}})})()};return[4,Promise.all([Promise.all(r.files.map(function(a){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n(a)];case 1:return[2,_state.sent()?a:void 0]}})})()})),Promise.all(r.folders.map(function(a){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n(a)];case 1:return[2,_state.sent()?a:void 0]}})})()}))])];case 2:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),i=_ref[0],o=_ref[1];return[2,{files:i.filter(function(a){return Boolean(a)}),folders:o.filter(function(a){return Boolean(a)})}]}})})()}var du=require("obsidian"),bp=nr(ln(),1);var Zwt=420,nG=493;function O7e(e){var t;return e?typeof e=="string"?e:(t=e.encoding)!=null?t:"utf8":"utf8"}function Kwt(e,t){var r=O7e(t);if(r==="base64")return tx(e,!1);if(r==="hex")return Array.from(e).map(function(n){return n.toString(16).padStart(2,"0")}).join("");if(r==="binary"||r==="latin1"){var _String;var i="";for(var o=0;o<e.length;o+=32768)i+=(_String=String).fromCharCode.apply(_String,_to_consumable_array(e.subarray(o,Math.min(o+32768,e.length))));return i}return new TextDecoder("utf-8").decode(e)}function fP(e,t){if(_instanceof(e,Uint8Array))return e;var r=O7e(t);if(r==="base64"){if(typeof Buffer!="undefined")return Uint8Array.from(Buffer.from(e,"base64"));var n=atob(e);return Uint8Array.from(n,function(i){return i.charCodeAt(0)})}if(r==="hex"){var n10=new Uint8Array(e.length/2);for(var i=0;i<e.length;i+=2)n10[i/2]=Number.parseInt(e.slice(i,i+2),16);return n10}if(r==="binary"||r==="latin1"){var n11=new Uint8Array(e.length);for(var i10=0;i10<e.length;i10++)n11[i10]=e.charCodeAt(i10)&255;return n11}return new TextEncoder().encode(e)}function aG(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function R7e(e){return e.split("/").filter(Boolean).length}function Qwt(e){var t=bp.posix.normalize(bp.posix.resolve("/",e));return t===""?"/":t}function M7e(e,t){return e==="/"?"/".concat(t):"".concat(e,"/").concat(t)}function Cl(e){var t=Qwt(e);if(!t.startsWith("/"))throw new Error("EINVAL: invalid path '".concat(e,"'"));return t}function iG(e,t,r,n){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,a,err,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,e.stat(t)];case 1:if(!_state.sent().isDirectory)return[3,12];if(!(n!=null&&n.recursive))throw new Error("EISDIR: illegal operation on a directory, copy '".concat(t,"'"));return[4,e.mkdir(r,{recursive:!0})];case 2:_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,9,10,11]);return[4,e.readdir(t)];case 4:_iterator=_state.sent()[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];a=_step.value;return[4,iG(e,M7e(t,a),M7e(r,a),n)];case 6:_state.sent();_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[2];case 12:return[4,e.readFileBuffer(t)];case 13:o=_state.sent();return[4,e.writeFile(r,o)];case 14:_state.sent();return[2]}})})()}var oG=/*#__PURE__*/function(){"use strict";function oG1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];_class_call_check(this,oG1);A(this,"paths",new Set(["/"]));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;this.recordPath(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}_create_class(oG1,[{key:"recordPath",value:function recordPath(t){var r=Cl(t);this.paths.add("/");var n="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.split("/").filter(Boolean)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;n="".concat(n,"/").concat(i),this.paths.add(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"forgetPath",value:function forgetPath(t){var r=Cl(t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_to_consumable_array(this.paths)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;(n===r||n.startsWith("".concat(r,"/")))&&this.paths.delete(n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.paths.add("/")}},{key:"getAllPaths",value:function getAllPaths(){return _to_consumable_array(this.paths).sort()}}]);return oG1}(),y_=/*#__PURE__*/function(){"use strict";function y_1(){_class_call_check(this,y_1);A(this,"captureDepth",0);A(this,"virtualInitial",new Map);A(this,"virtualLatest",new Map)}_create_class(y_1,[{key:"isCapturing",get:function get1(){return this.captureDepth>0}},{key:"beginCapture",value:function beginCapture(){this.captureDepth++}},{key:"endCapture",value:function endCapture(){this.captureDepth--}},{key:"recordVirtualTransition",value:function recordVirtualTransition(t,r,n){this.virtualInitial.has(t)||this.virtualInitial.set(t,r),this.virtualLatest.set(t,n)}},{key:"sameFileContent",value:function sameFileContent(t,r){return _async_to_generator(function(){var _ref,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all([xh(t),xh(r)])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),n=_ref[0],i=_ref[1],o=new Uint8Array(n),a=new Uint8Array(i);return[2,o.length===a.length&&o.every(function(s,l){return s===a[l]})]}})})()}},{key:"getNetOperations",value:function getNetOperations(){return _async_to_generator(function(){var t,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,r,n,i,_tmp,_tmp1,_tmp2,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,12,13,14]);_iterator=_to_consumable_array(this.virtualInitial).sort(function(param,param1){var _param=_sliced_to_array(param,1),i=_param[0],_param1=_sliced_to_array(param1,1),o=_param1[0];var a=R7e(i)-R7e(o);return a!==0?a:i.localeCompare(o)})[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,11];_step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];i=this.virtualLatest.get(r);if(!(!n&&i))return[3,3];_tmp=t.push({vaultPath:r,operation:"create",before:{kind:i.kind},after:i});return[3,9];case 3:if(!(n&&!i))return[3,4];_tmp1=t.push({vaultPath:r,operation:"delete",before:n});return[3,8];case 4:if(!((n==null?void 0:n.kind)==="file"&&(i==null?void 0:i.kind)==="file"))return[3,6];return[4,this.sameFileContent(n,i)];case 5:_tmp2=_state.sent()||t.push({vaultPath:r,operation:"update",before:n,after:i});return[3,7];case 6:_tmp2=n&&i&&n.kind!==i.kind&&(t.push({vaultPath:r,operation:"delete",before:n}),t.push({vaultPath:r,operation:"create",before:{kind:i.kind},after:i}));_state.label=7;case 7:_tmp1=_tmp2;_state.label=8;case 8:_tmp=_tmp1;_state.label=9;case 9:_tmp;_state.label=10;case 10:_iteratorNormalCompletion=true;return[3,2];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 14:return[2,t]}})}).call(this)}}]);return y_1}(),mP=/*#__PURE__*/function(){"use strict";function mP1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;_class_call_check(this,mP1);this.vault=t;this.permissionGuard=n;this.onRead=i;A(this,"_batchDepth",0);A(this,"pathIndex");this.pathIndex=Array.isArray(r)?new oG(r):r}_create_class(mP1,[{key:"withBatch",value:function withBatch(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this._batchDepth++;_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,t()];case 2:return[2,_state.sent()];case 3:this._batchDepth--;return[7];case 4:return[2]}})}).call(this)}},{key:"checkPermission",value:function checkPermission(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this._batchDepth>0||!this.permissionGuard)return[2];r="src"in t?{type:"fs",fs:{kind:t.kind,src:this.toPermissionPath(t.src),dest:this.toPermissionPath(t.dest)}}:{type:"fs",fs:{kind:t.kind,path:this.toPermissionPath(t.path)}};return[4,this.permissionGuard(_object_spread({},r))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"toPermissionPath",value:function toPermissionPath(t){return Cl(t)}},{key:"toVaultPath",value:function toVaultPath(t){var r=Cl(t);return r==="/"?"":(0,du.normalizePath)(r.slice(1))}},{key:"deleteAbstractFile",value:function deleteAbstractFile(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(typeof this.vault.trash=="function"))return[3,2];return[4,this.vault.trash(t,!1)];case 1:_state.sent();return[2];case 2:if(!(typeof this.vault.delete=="function"))return[3,4];return[4,this.vault.delete(t,!1)];case 3:_state.sent();return[2];case 4:throw new Error("ENOTSUP: vault delete is not available for '".concat(t.path,"'"))}})}).call(this)}},{key:"isInternalDirectory",value:function isInternalDirectory(t){var r=Cl(t),n="/".concat((0,du.normalizePath)(this.vault.configDir));return r==="/".concat(y0)||r===n}},{key:"listDirectory",value:function listDirectory(t){return _async_to_generator(function(){var r,n,_tmp,s,l,i,o,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Cl(t),n=this.toVaultPath(r);if(!(typeof this.vault.adapter.list=="function"))return[3,4];_tmp=this.isInternalDirectory(r);if(!_tmp)return[3,2];return[4,this.vault.adapter.exists(n)];case 1:_tmp=!_state.sent();_state.label=2;case 2:if(_tmp)return[2,{files:[],folders:[]}];return[4,pP(this.vault.adapter,n)];case 3:s=_state.sent();if(r==="/"){l=new Set(s.folders);return[2,(l.add(y0),l.add((0,du.normalizePath)(this.vault.configDir)),{files:s.files,folders:_to_consumable_array(l)})]}return[2,s];case 4:i=n===""?this.vault.getRoot():this.vault.getAbstractFileByPath(n);if(!_instanceof(i,du.TFolder)){if(this.isInternalDirectory(r))return[2,{files:[],folders:[]}];throw new Error("ENOTDIR: not a directory, scandir '".concat(t,"'"))}o=[],a=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i.children[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s10=_step.value;_instanceof(s10,du.TFile)&&o.push(s10.path),_instanceof(s10,du.TFolder)&&a.push(s10.path)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,(r==="/"&&a.push(y0,(0,du.normalizePath)(this.vault.configDir)),{files:o,folders:a})]}})}).call(this)}},{key:"recordPath",value:function recordPath(t){this.pathIndex.recordPath(t)}},{key:"forgetPath",value:function forgetPath(t){this.pathIndex.forgetPath(t)}},{key:"assertExists",value:function assertExists(t){return this.exists(t).then(function(r){if(!r)throw new Error("ENOENT: no such file or directory, access '".concat(t,"'"))})}},{key:"readFile",value:function readFile(t,r){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,this.withBatch(function(){return _this.readFileBuffer(t).then(function(n){return Kwt(n,r)})})]})}).call(this)}},{key:"readFileBuffer",value:function readFileBuffer(t){return _async_to_generator(function(){var n,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readInternal(t)];case 1:r=_state.sent();return[2,((n=this.onRead)==null||n.call(this,this.toVaultPath(t)),r)]}})}).call(this)}},{key:"readInternal",value:function readInternal(t){return _async_to_generator(function(){var _;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.stat(t)];case 1:if(!_state.sent().isFile)throw new Error("EISDIR: illegal operation on a directory, read '".concat(t,"'"));_=Uint8Array.bind;return[4,xc(this.vault,this.toVaultPath(t))];case 2:return[2,new(_.apply(Uint8Array,[void 0,_state.sent()]))]}})}).call(this)}},{key:"writeFile",value:function writeFile(t,r,n){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.checkPermission({kind:"write",path:t})];case 1:_state.sent();return[4,this.withBatch(function(){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.mkdir(bp.posix.dirname(Cl(t)),{recursive:!0})];case 1:_state.sent();i=fP(r,n);return[4,Wp(this.vault,this.toVaultPath(t),aG(i))];case 2:_state.sent(),this.recordPath(t);return[2]}})}).call(_this)})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"appendFile",value:function appendFile(t,r,n){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.checkPermission({kind:"write",path:t})];case 1:_state.sent();return[4,this.withBatch(function(){return _async_to_generator(function(){var i,o,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=fP(r,n);return[4,this.exists(t)];case 1:if(!_state.sent())return[3,3];return[4,this.readInternal(t)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=new Uint8Array(0);_state.label=4;case 4:o=_tmp,a=new Uint8Array(o.length+i.length);a.set(o),a.set(i,o.length);return[4,this.writeFile(t,a)];case 5:_state.sent();return[2]}})}).call(_this)})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"exists",value:function exists(t){return _async_to_generator(function(){var r,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Cl(t);if(!(r==="/"||this.isInternalDirectory(r)))return[3,1];_tmp=!0;return[3,3];case 1:return[4,Fl(this.vault,this.toVaultPath(r))];case 2:_tmp=_state.sent();_state.label=3;case 3:return[2,_tmp]}})}).call(this)}},{key:"stat",value:function stat(t){return _async_to_generator(function(){var o,a,s,r,_tmp,n,i,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=Cl(t);if(r==="/")return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:nG,size:0,mtime:new Date(0)}];_tmp=this.isInternalDirectory(r);if(!_tmp)return[3,2];return[4,this.vault.adapter.exists(this.toVaultPath(r))];case 1:_tmp=!_state.sent();_state.label=2;case 2:if(_tmp)return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:nG,size:0,mtime:new Date(0)}];return[4,Ya(this.vault,this.toVaultPath(r))];case 3:n=_state.sent();if(!n)throw new Error("ENOENT: no such file or directory, stat '".concat(t,"'"));if(!(n.isDir&&n.mtime===void 0))return[3,5];return[4,this.vault.adapter.stat(this.toVaultPath(r))];case 4:_tmp1=_state.sent();return[3,6];case 5:_tmp1=void 0;_state.label=6;case 6:i=_tmp1;return[2,{isFile:!n.isDir,isDirectory:n.isDir,isSymbolicLink:!1,mode:n.isDir?nG:Zwt,size:n.isDir?0:(o=n.size)!=null?o:0,mtime:new Date((s=(a=n.mtime)!=null?a:i==null?void 0:i.mtime)!=null?s:0)}]}})}).call(this)}},{key:"mkdir",value:function mkdir(t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=Cl(t);if(!(n!=="/"))return[3,5];return[4,this.checkPermission({kind:"mkdir",path:t})];case 1:if(!(_state.sent(),!(r!=null&&r.recursive)))return[3,3];i=bp.posix.dirname(n);return[4,this.exists(i)];case 2:if(!_state.sent())throw new Error("ENOENT: no such file or directory, mkdir '".concat(n,"'"));_state.label=3;case 3:return[4,Ja(this.vault,this.toVaultPath(n))];case 4:_state.sent(),this.recordPath(n);_state.label=5;case 5:return[2]}})}).call(this)}},{key:"readdir",value:function readdir(t){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.stat(t)];case 1:if(!_state.sent().isDirectory)throw new Error("ENOTDIR: not a directory, scandir '".concat(t,"'"));return[4,this.listDirectory(t)];case 2:n=_state.sent();return[2,_to_consumable_array(n.files).concat(_to_consumable_array(n.folders)).map(function(i){return bp.posix.basename((0,du.normalizePath)(i))}).sort()]}})}).call(this)}},{key:"readdirWithFileTypes",value:function readdirWithFileTypes(t){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.stat(t)];case 1:if(!_state.sent().isDirectory)throw new Error("ENOTDIR: not a directory, scandir '".concat(t,"'"));return[4,this.listDirectory(t)];case 2:n=_state.sent();return[2,_to_consumable_array(n.files.map(function(i){return{name:bp.posix.basename((0,du.normalizePath)(i)),isFile:!0,isDirectory:!1,isSymbolicLink:!1}})).concat(_to_consumable_array(n.folders.map(function(i){return{name:bp.posix.basename((0,du.normalizePath)(i)),isFile:!1,isDirectory:!0,isSymbolicLink:!1}}))).sort(function(i,o){return i.name.localeCompare(o.name)})]}})}).call(this)}},{key:"rm",value:function rm1(t,r){return _async_to_generator(function(){var o,n,i,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=Cl(t);if(n==="/")throw new Error("EPERM: operation not permitted, remove '".concat(t,"'"));return[4,this.checkPermission({kind:"delete",path:t})];case 1:_state.sent();return[4,this.exists(n)];case 2:if(!_state.sent()){if(r!=null&&r.force)return[2];throw new Error("ENOENT: no such file or directory, remove '".concat(t,"'"))}i=this.toVaultPath(n);if(!_m(this.vault,i))return[3,4];return[4,Lx(this.vault,i,(o=r==null?void 0:r.recursive)!=null?o:!1)];case 3:_state.sent();return[3,6];case 4:a=this.vault.getAbstractFileByPath(i);if(!a)throw new Error("ENOENT: no such file or directory, remove '".concat(t,"'"));return[4,this.deleteAbstractFile(a)];case 5:_state.sent();_state.label=6;case 6:this.forgetPath(n);return[2]}})}).call(this)}},{key:"cp",value:function cp1(t,r,n){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.checkPermission({kind:"copy",src:t,dest:r})];case 1:_state.sent();return[4,this.withBatch(function(){return iG(_this,t,r,n)})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"mv",value:function mv1(t,r){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.checkPermission({kind:"move",src:t,dest:r})];case 1:_state.sent();return[4,this.withBatch(function(){return _async_to_generator(function(){var n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.exists(t)];case 1:if(!_state.sent())throw new Error("ENOENT: no such file or directory, move '".concat(t,"'"));return[4,this.mkdir(bp.posix.dirname(Cl(r)),{recursive:!0})];case 2:_state.sent();n=_m(this.vault,this.toVaultPath(t)),i=_m(this.vault,this.toVaultPath(r));if(!(n!==i))return[3,5];return[4,iG(this,t,r,{recursive:!0})];case 3:_state.sent();return[4,this.rm(t,{recursive:!0})];case 4:_state.sent();return[3,9];case 5:if(!n)return[3,7];return[4,this.vault.adapter.rename(this.toVaultPath(t),this.toVaultPath(r))];case 6:_state.sent();return[3,9];case 7:o=this.vault.getAbstractFileByPath(this.toVaultPath(t));if(!o)throw new Error("ENOENT: no such file or directory, move '".concat(t,"'"));return[4,this.vault.rename(o,this.toVaultPath(r))];case 8:_state.sent();_state.label=9;case 9:this.forgetPath(t),this.recordPath(r);return[2]}})}).call(_this)})];case 2:_state.sent();return[2]}})}).call(this)}},{key:"resolvePath",value:function resolvePath(t,r){return Cl(bp.posix.resolve(t||"/",r))}},{key:"getAllPaths",value:function getAllPaths(){return this.pathIndex.getAllPaths()}},{key:"chmod",value:function chmod(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.assertExists(t)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"symlink",value:function symlink(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){throw new Error("ENOTSUP: symbolic links are not supported in vault fs, link '".concat(r,"'"))})})()}},{key:"link",value:function link(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){throw new Error("ENOTSUP: hard links are not supported in vault fs, link '".concat(r,"'"))})})()}},{key:"readlink",value:function readlink(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){throw new Error("EINVAL: not a symbolic link, readlink '".concat(t,"'"))})})()}},{key:"lstat",value:function lstat(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.stat(t)]})}).call(this)}},{key:"realpath",value:function realpath(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.assertExists(t)];case 1:return[2,(_state.sent(),Cl(t))]}})}).call(this)}},{key:"utimes",value:function utimes(t,r,n){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.withBatch(function(){return _async_to_generator(function(){var o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.stat(t)];case 1:if(_state.sent().isDirectory)return[2];return[4,this.readInternal(t)];case 2:o=_state.sent();return[4,this.writeFile(t,o)];case 3:_state.sent();return[2]}})}).call(_this)})];case 1:_state.sent();return[2]}})}).call(this)}}]);return mP1}();var f5=nr(ln(),1);function sG(e){return f5.posix.normalize(f5.posix.resolve("/",e))}function Jwt(e,t){return e==="/"?"/".concat(t):"".concat(e,"/").concat(t)}var hP=/*#__PURE__*/function(){"use strict";function hP1(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_class_call_check(this,hP1);this.inner=t;this.recorder=r;this.options=n;A(this,"depth",0)}_create_class(hP1,[{key:"toRecordedPath",value:function toRecordedPath(t){var n;var r=sG(t);return!this.options.absoluteMountPoints||r==="/"||(n=this.options.absoluteMountPoints)!=null&&n.some(function(i){return r===i||r.startsWith("".concat(i,"/"))})?r:r.slice(1)}},{key:"snapshot",value:function snapshot(_01){return _async_to_generator(function(t){var r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,err,_,_tmp,_tmp1;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:new Map;n=sG(t);return[4,this.inner.exists(n)];case 1:if(!_state.sent())return[2,r];return[4,this.inner.stat(n)];case 2:if(!_state.sent().isDirectory)return[3,12];r.set(n,{kind:"dir"});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,9,10,11]);return[4,this.inner.readdir(n)];case 4:_iterator=_state.sent()[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];o=_step.value;return[4,this.snapshot(Jwt(n,o),r)];case 6:_state.sent();_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[3,14];case 12:_=r.set;_tmp=[n];_tmp1={kind:"file"};return[4,this.inner.readFileBuffer(n)];case 13:_.apply(r,_tmp.concat([(_tmp1.contentCompressed=Tme.apply(void 0,[_state.sent()]),_tmp1)]));_state.label=14;case 14:return[2,r]}})}).apply(this,arguments)}},{key:"mutate",value:function mutate(t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$l,err,i,o,a,l,s,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_$l1,err,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,_$l2;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.depth>0)return[2,r()];this.depth++;_state.label=1;case 1:_state.trys.push([1,,28,29]);n=new Map;this.recorder.beginCapture();_state.label=2;case 2:_state.trys.push([2,,11,12]);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator=t[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];_$l=_step.value;return[4,this.snapshot(_$l,n)];case 5:_state.sent();_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[3,12];case 11:this.recorder.endCapture();return[7];case 12:a=!1;_state.label=13;case 13:_state.trys.push([13,15,,16]);return[4,r()];case 14:i=_state.sent();return[3,16];case 15:l=_state.sent();a=!0,o=l;return[3,16];case 16:s=new Map;this.recorder.beginCapture();_state.label=17;case 17:_state.trys.push([17,,26,27]);_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=18;case 18:_state.trys.push([18,23,24,25]);_iterator1=t[Symbol.iterator]();_state.label=19;case 19:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,22];_$l1=_step1.value;return[4,this.snapshot(_$l1,s)];case 20:_state.sent();_state.label=21;case 21:_iteratorNormalCompletion1=true;return[3,19];case 22:return[3,25];case 23:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,25];case 24:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 25:return[3,27];case 26:this.recorder.endCapture();return[7];case 27:_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=new Set(_to_consumable_array(n.keys()).concat(_to_consumable_array(s.keys())))[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){_$l2=_step2.value;this.recorder.recordVirtualTransition(this.toRecordedPath(_$l2),n.get(_$l2),s.get(_$l2))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}if(a)throw o;return[2,i];case 28:this.depth--;return[7];case 29:return[2]}})}).call(this)}},{key:"writePaths",value:function writePaths(t){return _async_to_generator(function(){var r,n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=[sG(t)],n=f5.posix.dirname(r[0]);_state.label=1;case 1:_tmp=n!=="/";if(!_tmp)return[3,3];return[4,this.inner.exists(n)];case 2:_tmp=!_state.sent();_state.label=3;case 3:if(!_tmp)return[3,5];r.push(n),n=f5.posix.dirname(n);_state.label=4;case 4:return[3,1];case 5:return[2,r]}})}).call(this)}},{key:"readFile",value:function readFile(t,r){return this.inner.readFile(t,r)}},{key:"readFileBuffer",value:function readFileBuffer(t){return this.inner.readFileBuffer(t)}},{key:"writeFile",value:function writeFile(t,r,n){return _async_to_generator(function(){var _this,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_10=(_=this).mutate;return[4,this.writePaths(t)];case 1:return[2,_10.apply(_,[_state.sent(),function(){return _this.inner.writeFile(t,r,n)}])]}})}).call(this)}},{key:"appendFile",value:function appendFile(t,r,n){return _async_to_generator(function(){var _this,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_10=(_=this).mutate;return[4,this.writePaths(t)];case 1:return[2,_10.apply(_,[_state.sent(),function(){return _this.inner.appendFile(t,r,n)}])]}})}).call(this)}},{key:"exists",value:function exists(t){return this.inner.exists(t)}},{key:"stat",value:function stat(t){return this.inner.stat(t)}},{key:"lstat",value:function lstat(t){var r,n,i;return(i=(n=(r=this.inner).lstat)==null?void 0:n.call(r,t))!=null?i:this.inner.stat(t)}},{key:"mkdir",value:function mkdir(t,r){return _async_to_generator(function(){var _this,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_10=(_=this).mutate;return[4,this.writePaths(t)];case 1:return[2,_10.apply(_,[_state.sent(),function(){return _this.inner.mkdir(t,r)}])]}})}).call(this)}},{key:"readdir",value:function readdir(t){return this.inner.readdir(t)}},{key:"readdirWithFileTypes",value:function readdirWithFileTypes(t){return this.inner.readdirWithFileTypes(t)}},{key:"rm",value:function rm1(t,r){var _this=this;return this.mutate([t],function(){return _this.inner.rm(t,r)})}},{key:"cp",value:function cp1(t,r,n){return _async_to_generator(function(){var _this,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_10=(_=this).mutate;return[4,this.writePaths(r)];case 1:return[2,_10.apply(_,[_state.sent(),function(){return _this.inner.cp(t,r,n)}])]}})}).call(this)}},{key:"mv",value:function mv1(t,r){return _async_to_generator(function(){var _this,_,_10,_11,_12;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_10=(_=this).mutate;_12=(_11=[t]).concat;return[4,this.writePaths(r)];case 1:return[2,_10.apply(_,[_12.apply(_11,[_to_consumable_array.apply(void 0,[_state.sent()])]),function(){return _this.inner.mv(t,r)}])]}})}).call(this)}},{key:"resolvePath",value:function resolvePath(t,r){return this.inner.resolvePath(t,r)}},{key:"getAllPaths",value:function getAllPaths(){return this.inner.getAllPaths()}},{key:"chmod",value:function chmod(t,r){return this.inner.chmod(t,r)}},{key:"symlink",value:function symlink(t,r){var _this=this;return this.mutate([r],function(){return _this.inner.symlink(t,r)})}},{key:"link",value:function link(t,r){var _this=this;return this.mutate([r],function(){return _this.inner.link(t,r)})}},{key:"readlink",value:function readlink(t){return this.inner.readlink(t)}},{key:"realpath",value:function realpath(t){return this.inner.realpath(t)}},{key:"utimes",value:function utimes(t,r,n){return this.inner.utimes(t,r,n)}}]);return hP1}();var yP=nr(ln(),1);var m5=nr(Tg(),1);function L7e(e,t){t.filterRules!==void 0&&(e.filterRules={rules:t.filterRules}),t.skipLargeFilesMaxSize!==void 0&&(e.skipLargeFiles={maxSize:t.skipLargeFilesMaxSize}),t.startupSyncDelaySeconds!==void 0&&(e.startupSyncDelaySeconds=t.startupSyncDelaySeconds),t.autoSyncIntervalSeconds!==void 0&&(e.autoSyncIntervalSeconds=t.autoSyncIntervalSeconds),t.realtimeSync!==void 0&&(e.realtimeSync=t.realtimeSync),t.confirmBeforeSync!==void 0&&(e.confirmBeforeSync=t.confirmBeforeSync),t.confirmBeforeDeleteInAutoSync!==void 0&&(e.confirmBeforeDeleteInAutoSync=t.confirmBeforeDeleteInAutoSync),t.syncMode!==void 0&&(e.syncMode=t.syncMode),t.conflictStrategy!==void 0&&(e.conflictStrategy=t.conflictStrategy),t.configDirSyncMode!==void 0&&(e.configDirSyncMode=t.configDirSyncMode),t.language!==void 0&&(e.language=t.language||void 0)}var F7e="500MB",Ywt=(0,m5.parse)(F7e,{mode:"jedec"}),$7e=200,N7e=86400,Xwt=new Set(["no-conflict-merge","diff3","local-priority","server-priority"]),e4t=new Set(["strict","loose"]),t4t=new Set(["none","bookmarks","all"]),r4t=new Set(["zh","en",""]),n4t=new Set(["include","exclude"]),i4t=new Set(["filterRules","skipLargeFiles","startupSyncDelaySeconds","autoSyncIntervalSeconds","realtimeSync","confirmBeforeSync","confirmBeforeDeleteInAutoSync","syncMode","conflictStrategy","configDirSyncMode","language"]);function xP(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)}function cs(e,t){return"invalid setting '".concat(e,"': expected ").concat(t)}function o4t(e,t,r,n){var i="".concat(e,".rules[").concat(r,"]");if(!xP(t))return cs(i,"an object");var o=t.expr;if(typeof o!="string"||o.trim()==="")return cs("".concat(i,".expr"),"a non-empty string");var a=t.type;if(typeof a!="string"||!n4t.has(a))return cs("".concat(i,".type"),"'include' or 'exclude'");var s=t.caseSensitive;if(s!==void 0&&typeof s!="boolean")return cs("".concat(i,".caseSensitive"),"a boolean");var l=t.disabled;if(l!==void 0&&typeof l!="boolean")return cs("".concat(i,".disabled"),"a boolean");var c={caseSensitive:s===!0},d=_object_spread({expr:o,options:c,type:a},l===!0?{disabled:!0}:{});if(ev(d))return cs("".concat(i,".expr"),"a non-empty pattern");try{new Vu(o,c)}catch(u){return cs("".concat(i,".expr"),"a valid glob pattern")}return n.push(d),null}function a4t(e,t){if(!xP(t))return{rules:[],error:cs(e,"an object with a rules array")};if(!Array.isArray(t.rules))return{rules:[],error:cs("".concat(e,".rules"),"an array")};if(t.rules.length>$7e)return{rules:[],error:"invalid setting '".concat(e,".rules': too many rules (max ").concat($7e,")")};var r=[];for(var n=0;n<t.rules.length;n+=1){var i=o4t(e,t.rules[n],n,r);if(i)return{rules:[],error:i}}return{rules:r,error:null}}function s4t(e,t){if(typeof t!="string")return{size:null,error:cs(e,"a byte size string")};var r=$x(t,"");if(!r)return{size:null,error:cs(e,"a non-empty byte size string")};var n=(0,m5.parse)(r,{mode:"jedec"});return n===null?{size:null,error:cs(e,"a valid byte size string")}:n>Ywt?{size:null,error:"invalid setting '".concat(e,"': exceeds the maximum of ").concat(F7e)}:{size:r,error:null}}function D7e(e,t,r,n){return typeof t!="number"||!Rb(t)||!Number.isFinite(t)?{number:null,error:cs(e,"a number")}:{number:Ed(t,r,n),error:null}}function l4t(e,t){return t!==!0&&t!==!1?{boolean:null,error:cs(e,"a boolean")}:{boolean:t,error:null}}function gP(e,t,r,n){return typeof t!="string"||!r.has(t)?{value:null,error:cs(e,n)}:{value:t,error:null}}function z7e(e){var t;try{t=JSON.parse(e)}catch(i){return{ok:!1,error:"invalid setting file: not valid JSON"}}if(!xP(t))return{ok:!1,error:"invalid setting file: expected a JSON object"};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.keys(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(!i4t.has(i))return{ok:!1,error:"invalid setting file: unknown key '".concat(i,"' is not allowed")}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var r={};if(!lo(t.filterRules)){var _a4t=a4t("filterRules",t.filterRules),i10=_a4t.rules,o=_a4t.error;if(o)return{ok:!1,error:o};r.filterRules=i10}if(!lo(t.skipLargeFiles)){if(!xP(t.skipLargeFiles))return{ok:!1,error:cs("skipLargeFiles","an object with maxSize")};var _s4t=s4t("skipLargeFiles.maxSize",t.skipLargeFiles.maxSize),i11=_s4t.size,o10=_s4t.error;if(o10)return{ok:!1,error:o10};r.skipLargeFilesMaxSize=i11}if(!lo(t.startupSyncDelaySeconds)){var _D7e=D7e("startupSyncDelaySeconds",t.startupSyncDelaySeconds,0,N7e),i12=_D7e.number,o11=_D7e.error;if(o11)return{ok:!1,error:o11};r.startupSyncDelaySeconds=i12}if(!lo(t.autoSyncIntervalSeconds)){var _D7e1=D7e("autoSyncIntervalSeconds",t.autoSyncIntervalSeconds,0,N7e),i13=_D7e1.number,o12=_D7e1.error;if(o12)return{ok:!1,error:o12};r.autoSyncIntervalSeconds=i13}for(var _i1=0,_iter=["realtimeSync","confirmBeforeSync","confirmBeforeDeleteInAutoSync"];_i1<_iter.length;_i1++){var i14=_iter[_i1];if(lo(t[i14]))continue;var _l4t=l4t(i14,t[i14]),o13=_l4t.boolean,a=_l4t.error;if(a)return{ok:!1,error:a};r[i14]=o13}if(!lo(t.syncMode)){var _gP=gP("syncMode",t.syncMode,e4t,"'strict' or 'loose'"),i15=_gP.value,o14=_gP.error;if(o14)return{ok:!1,error:o14};r.syncMode=i15}if(!lo(t.conflictStrategy)){var _gP1=gP("conflictStrategy",t.conflictStrategy,Xwt,"a supported conflict strategy"),i16=_gP1.value,o15=_gP1.error;if(o15)return{ok:!1,error:o15};r.conflictStrategy=i16}if(!lo(t.configDirSyncMode)){var _gP2=gP("configDirSyncMode",t.configDirSyncMode,t4t,"'none', 'bookmarks', or 'all'"),i17=_gP2.value,o16=_gP2.error;if(o16)return{ok:!1,error:o16};r.configDirSyncMode=i17}if(!lo(t.language)){var _gP3=gP("language",t.language,r4t,"'zh', 'en', or an empty string"),i18=_gP3.value,o17=_gP3.error;if(o17)return{ok:!1,error:o17};r.language=i18}return Object.keys(r).length>0||r.filterRules!==void 0&&r.filterRules.length===0?{ok:!0,patch:r,text:e}:{ok:!1,error:"invalid setting file: no supported settings were provided"}}function j7e(e){var r,n,i,o,a;var t={filterRules:{rules:((n=(r=e.filterRules)==null?void 0:r.rules)!=null?n:[]).map(function(s){return{expr:s.expr,type:s.type,caseSensitive:s.options.caseSensitive===!0,disabled:s.disabled===!0?!0:void 0}})},skipLargeFiles:{maxSize:(i=e.skipLargeFiles)==null?void 0:i.maxSize},startupSyncDelaySeconds:e.startupSyncDelaySeconds,autoSyncIntervalSeconds:e.autoSyncIntervalSeconds,realtimeSync:e.realtimeSync,confirmBeforeSync:e.confirmBeforeSync,confirmBeforeDeleteInAutoSync:e.confirmBeforeDeleteInAutoSync,syncMode:e.syncMode,conflictStrategy:e.conflictStrategy,configDirSyncMode:(o=e.configDirSyncMode)!=null?o:"none",language:(a=e.language)!=null?a:""};return"".concat(JSON.stringify(t,null,2),"\n")}function u4t(e,t){return e.length!==t.length?!1:e.every(function(r,n){var i=t[n];return r.expr===i.expr&&r.type===i.type&&r.options.caseSensitive===i.options.caseSensitive&&r.disabled===!0==(i.disabled===!0)})}function c4t(e,t){if(e===t)return!0;var r=e?(0,m5.parse)(e,{mode:"jedec"}):null,n=(0,m5.parse)(t,{mode:"jedec"});return r!==null&&n!==null&&r===n}function U7e(e,t){var n,i,o,a,s;var r={};return t.filterRules!==void 0&&!u4t((i=(n=e.filterRules)==null?void 0:n.rules)!=null?i:[],t.filterRules)&&(r.filterRules=t.filterRules),t.skipLargeFilesMaxSize!==void 0&&!c4t((o=e.skipLargeFiles)==null?void 0:o.maxSize,t.skipLargeFilesMaxSize)&&(r.skipLargeFilesMaxSize=t.skipLargeFilesMaxSize),t.startupSyncDelaySeconds!==void 0&&t.startupSyncDelaySeconds!==e.startupSyncDelaySeconds&&(r.startupSyncDelaySeconds=t.startupSyncDelaySeconds),t.autoSyncIntervalSeconds!==void 0&&t.autoSyncIntervalSeconds!==e.autoSyncIntervalSeconds&&(r.autoSyncIntervalSeconds=t.autoSyncIntervalSeconds),t.realtimeSync!==void 0&&t.realtimeSync!==e.realtimeSync&&(r.realtimeSync=t.realtimeSync),t.confirmBeforeSync!==void 0&&t.confirmBeforeSync!==e.confirmBeforeSync&&(r.confirmBeforeSync=t.confirmBeforeSync),t.confirmBeforeDeleteInAutoSync!==void 0&&t.confirmBeforeDeleteInAutoSync!==e.confirmBeforeDeleteInAutoSync&&(r.confirmBeforeDeleteInAutoSync=t.confirmBeforeDeleteInAutoSync),t.syncMode!==void 0&&t.syncMode!==e.syncMode&&(r.syncMode=t.syncMode),t.conflictStrategy!==void 0&&t.conflictStrategy!==e.conflictStrategy&&(r.conflictStrategy=t.conflictStrategy),t.configDirSyncMode!==void 0&&t.configDirSyncMode!==((a=e.configDirSyncMode)!=null?a:"none")&&(r.configDirSyncMode=t.configDirSyncMode),t.language!==void 0&&t.language!==((s=e.language)!=null?s:"")&&(r.language=t.language),r}function d4t(e){var r;var t=(r=e.filterRules)!=null?r:[];return t.length===0?P.t("aiPermission.settings.fields.filterRules.empty"):t.slice(0,5).map(function(n){return"".concat(n.type==="include"?"+":"-"," ").concat(n.expr).concat(n.disabled===!0?" ".concat(P.t("aiPermission.settings.fields.filterRules.disabled")):"")}).join("; ")}function B7e(e){var t=[];return e.filterRules!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.filterRules.name"),": ").concat(d4t(e))),e.skipLargeFilesMaxSize!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.skipLargeFiles.name"),": ").concat(e.skipLargeFilesMaxSize)),e.startupSyncDelaySeconds!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.startupSyncDelay.name"),": ").concat(e.startupSyncDelaySeconds,"s")),e.autoSyncIntervalSeconds!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.autoSyncInterval.name"),": ").concat(Math.round(e.autoSyncIntervalSeconds/60),"min")),e.realtimeSync!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.realtimeSync.name"),": ").concat(P.t(e.realtimeSync?"aiPermission.settings.on":"aiPermission.settings.off"))),e.confirmBeforeSync!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.confirmBeforeSync.name"),": ").concat(P.t(e.confirmBeforeSync?"aiPermission.settings.on":"aiPermission.settings.off"))),e.confirmBeforeDeleteInAutoSync!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.confirmBeforeDeleteInAutoSync.name"),": ").concat(P.t(e.confirmBeforeDeleteInAutoSync?"aiPermission.settings.on":"aiPermission.settings.off"))),e.syncMode!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.syncMode.name"),": ").concat(e.syncMode)),e.conflictStrategy!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.conflictStrategy.name"),": ").concat(e.conflictStrategy)),e.configDirSyncMode!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.configDirSyncMode.name"),": ").concat(e.configDirSyncMode)),e.language!==void 0&&t.push("".concat(P.t("aiPermission.settings.fields.language.name"),": ").concat(e.language===""?P.t("aiPermission.settings.fields.language.auto"):e.language)),t}var p4t=420,f4t=493;function uG(e){var t=yP.posix.normalize(yP.posix.resolve("/",e));return t===""?"/":t}function q7e(e,t){return e==="/"?"/".concat(t):"".concat(e,"/").concat(t)}function h5(e){var t=uG(e);return t==="/"?"":t.slice(1)}function lG(e,t){var r=new Error("".concat(e,": ").concat(t));throw r.code=e,r}var wp=/*#__PURE__*/function(){"use strict";function wp1(t){_class_call_check(this,wp1);this.input=t;A(this,"lastWriteMtime",new Date)}_create_class(wp1,[{key:"isFileRoot",value:function isFileRoot(t){return h5(t)===wp.FILE}},{key:"isDirectoryRoot",value:function isDirectoryRoot(t){return h5(t)===""}},{key:"missing",value:function missing(t){lG("ENOENT","no such file or directory, access '".concat(t,"'"))}},{key:"noOpOnPath",value:function noOpOnPath(t){lG("EROFS","settings file is virtual and cannot be modified this way: '".concat(t,"'"))}},{key:"serialized",value:function serialized(){return j7e(this.input.getSettings())}},{key:"readText",value:function readText(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,(this.isFileRoot(t)||this.missing(t),this.serialized())]})}).call(this)}},{key:"readFile",value:function readFile(t,r){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,this.readText(t).then(function(n){var i,o;return(o=(i=_this.input).onRead)==null||o.call(i,q7e(Cs,wp.FILE)),n})]})}).call(this)}},{key:"readFileBuffer",value:function readFileBuffer(t){return _async_to_generator(function(){var n,i,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.readText(t)];case 1:r=_state.sent();return[2,((i=(n=this.input).onRead)==null||i.call(n,q7e(Cs,wp.FILE)),new TextEncoder().encode(r))]}})}).call(this)}},{key:"writeFile",value:function writeFile(t,r,n){return _async_to_generator(function(){var s,l,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.isFileRoot(t)||this.missing(t);i=new TextDecoder("utf-8").decode(aG(fP(r,n))),o=z7e(i);if(!o.ok)throw new Error("EINVAL: ".concat(o.error));a=U7e(this.input.getSettings(),o.patch);return[4,(l=(s=this.input).permissionGuard)==null?void 0:l.call(s,{type:"settings",settings:{action:"update",summary:B7e(a).join("\n")||"",changes:a}})];case 1:_state.sent();return[4,this.input.updateSettings(a)];case 2:_state.sent(),this.lastWriteMtime=new Date;return[2]}})}).call(this)}},{key:"appendFile",value:function appendFile(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.isFileRoot(t)||this.missing(t),this.noOpOnPath(t);return[2]})}).call(this)}},{key:"exists",value:function exists(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){r=h5(t);return[2,r===""||r===wp.FILE]})})()}},{key:"stat",value:function stat(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=h5(t);if(r==="")return[2,{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:f4t,size:0,mtime:new Date(0)}];if(r===wp.FILE){n=new TextEncoder().encode(this.serialized()).byteLength;return[2,{isFile:!0,isDirectory:!1,isSymbolicLink:!1,mode:p4t,size:n,mtime:this.lastWriteMtime}]}this.missing(t);return[2]})}).call(this)}},{key:"lstat",value:function lstat(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.stat(t)]})}).call(this)}},{key:"mkdir",value:function mkdir(t,r){return _async_to_generator(function(){var _tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=h5(t)!=="";if(!_tmp)return[3,3];_tmp1=r!=null&&r.recursive;if(!_tmp1)return[3,2];return[4,this.exists(t)];case 1:_tmp1=!_state.sent();_state.label=2;case 2:_tmp=(_tmp1&&this.noOpOnPath(t),lG("EEXIST","file already exists, mkdir '".concat(t,"'")));_state.label=3;case 3:_tmp;return[2]}})}).call(this)}},{key:"readdir",value:function readdir(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,(this.isDirectoryRoot(t)||this.missing(t),[wp.FILE])]})}).call(this)}},{key:"readdirWithFileTypes",value:function readdirWithFileTypes(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,(this.isDirectoryRoot(t)||this.missing(t),[{name:wp.FILE,isFile:!0,isDirectory:!1,isSymbolicLink:!1}])]})}).call(this)}},{key:"rm",value:function rm1(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.exists(t)];case 1:_state.sent()||this.missing(t),this.noOpOnPath(t);return[2]}})}).call(this)}},{key:"cp",value:function cp1(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.noOpOnPath(r);return[2]})}).call(this)}},{key:"mv",value:function mv1(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.noOpOnPath(r);return[2]})}).call(this)}},{key:"resolvePath",value:function resolvePath(t,r){return uG(yP.posix.resolve(t||"/",r))}},{key:"getAllPaths",value:function getAllPaths(){return["/","/".concat(wp.FILE)]}},{key:"chmod",value:function chmod(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.exists(t)];case 1:_state.sent()||this.missing(t);return[2]}})}).call(this)}},{key:"symlink",value:function symlink(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.noOpOnPath(r);return[2]})}).call(this)}},{key:"link",value:function link(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.noOpOnPath(r);return[2]})}).call(this)}},{key:"readlink",value:function readlink(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.missing(t);return[2]})}).call(this)}},{key:"realpath",value:function realpath(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.exists(t)];case 1:return[2,(_state.sent()||this.missing(t),uG(t))]}})}).call(this)}},{key:"utimes",value:function utimes(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.exists(t)];case 1:_state.sent()||this.missing(t),this.isFileRoot(t)&&(this.lastWriteMtime=n);return[2]}})}).call(this)}}]);return wp1}(),g5=wp;A(g5,"FILE","settings.json");function m4t(e){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=e.vault.getAllLoadedFiles().map(function(n){return n.path});return[4,h4t(e)];case 1:r=_state.sent();return[2,_to_consumable_array(new Set(_to_consumable_array(t).concat(_to_consumable_array(r))))]}})})()}function h4t(e){return _async_to_generator(function(){var t,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,o10,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=[],r=[y0];_state.label=1;case 1:if(!(r.length>0))return[3,6];n=r.pop();_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,pP(e.vault.adapter,n)];case 3:i=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=_to_consumable_array(i.files).concat(_to_consumable_array(i.folders))[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){o=_step.value;t.push((0,vP.normalizePath)(o))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=i.folders[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){o10=_step1.value;r.push((0,vP.normalizePath)(o10))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[3,5];case 4:i10=_state.sent();return[3,5];case 5:return[3,1];case 6:return[2,t]}})})()}var x5=/*#__PURE__*/function(){"use strict";function x51(t){_class_call_check(this,x51);this.app=t;A(this,"sharedPromise")}_create_class(x51,[{key:"create",value:function create(){return _async_to_generator(function(){var t,r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:{};return[4,this.getShared()];case 1:r=_state.sent();return[2,g4t(this.app,r,t)]}})}).apply(this,arguments)}},{key:"getShared",value:function getShared(){var _this=this;return this.sharedPromise||(this.sharedPromise=P7e().then(function(t){return{builtinSkillsFs:t}}).catch(function(t){throw _this.sharedPromise=void 0,t})),this.sharedPromise}}]);return x51}();function g4t(e,t,r){return _async_to_generator(function(){var n,i,o,a,s,_,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=function(l){var c,d;(c=r.recorder)!=null&&c.isCapturing||(d=r.onRead)==null||d.call(r,l)},i=Pfe((0,vP.normalizePath)(e.vault.configDir));_=mP.bind;_tmp=[void 0,e.vault];return[4,m4t(e)];case 1:o=new(_.apply(mP,_tmp.concat([_state.sent(),r.permissionGuard,n]))),a=r.getSettingsSnapshot&&r.updateSettings?new g5({getSettings:r.getSettingsSnapshot,updateSettings:r.updateSettings,permissionGuard:r.permissionGuard,onRead:n}):void 0,s=new b7e({base:o,mounts:[{mountPoint:Yl,filesystem:t.builtinSkillsFs}].concat(_to_consumable_array(a?[{mountPoint:Cs,filesystem:a}]:[]))});return[2,r.recorder?new hP(s,r.recorder,{absoluteMountPoints:[is,i,Cs]}):s]}})})()}function Gh(_01){return _async_to_generator(function(e){var t,n;var _arguments=arguments;return _ts_generator(this,function(_state){t=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{};return[2,((n=t.fileSystemManager)!=null?n:new x5(e)).create(t)]})}).apply(this,arguments)}var W7e=nr(ln(),1);function x4t(_01,_11){return _async_to_generator(function(e,t){var r,o,a,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value,s10,l10,_tmp,_,_tmp1,_10,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{};return[4,Gh(e,{fileSystemManager:r.fileSystemManager,getSettingsSnapshot:(o=r.settingsIo)==null?void 0:o.getSettingsSnapshot,updateSettings:(a=r.settingsIo)==null?void 0:a.updateSettings})];case 1:n=_state.sent(),i=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=t[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){s=_step.value;l=Ife(s.vaultPath);i.has(l)||i.set(l,s)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=2;case 2:_state.trys.push([2,15,16,17]);_iterator1=_to_consumable_array(i.entries()).reverse()[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,14];_step_value=_sliced_to_array(_step1.value,2),s10=_step_value[0],l10=_step_value[1];if(!(l10.operation==="create"))return[3,7];return[4,n.exists(s10)];case 4:_tmp=_state.sent();if(!_tmp)return[3,6];return[4,n.rm(s10,{recursive:!0})];case 5:_tmp=_state.sent();_state.label=6;case 6:_tmp;return[3,13];case 7:if(!(l10.before.kind==="dir"))return[3,9];return[4,n.mkdir(s10,{recursive:!0})];case 8:_state.sent();return[3,13];case 9:return[4,n.mkdir(W7e.posix.dirname(s10),{recursive:!0})];case 10:_state.sent();_=n.writeFile;_tmp1=[s10];_10=Uint8Array.bind;return[4,xh(l10.before)];case 11:return[4,_.apply(n,_tmp1.concat([new(_10.apply(Uint8Array,[void 0,_state.sent()]))]))];case 12:_state.sent();_state.label=13;case 13:_iteratorNormalCompletion1=true;return[3,3];case 14:return[3,17];case 15:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,17];case 16:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 17:return[2]}})}).apply(this,arguments)}var _P=/*#__PURE__*/function(){"use strict";function _P1(t,r,n,i,o,a,s,l,c,d,u,p){_class_call_check(this,_P1);this.app=t;this.state=r;this.runtimeStates=n;this.store=i;this.notify=o;this.reportTransientError=a;this.messageFactory=s;this.validateSelection=l;this.enqueueRegenerate=c;this.skillRepository=d;this.settingsIo=u;this.fileSystemManager=p}_create_class(_P1,[{key:"deleteMessage",value:function deleteMessage(t){var r=this.getLoadedActiveSession();if(!r||this.runtimeStates.get(r.id).runState!=="idle")return;var i=this.messageFactory.getActiveAgent(r),o=i.timeline.findIndex(function(s){return s.id===t});if(o===-1)return;var a=i.timeline[o];if(a.role==="user"){var s=o+1;for(;s<i.timeline.length&&i.timeline[s].role!=="user";)s++;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.timeline.splice(o,s-o)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;delete i.operations[l.id]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else i.timeline.splice(o,1),delete i.operations[a.id];this.store.persistSession(r),this.notify()}},{key:"recallMessage",value:function recallMessage(t,r){return _async_to_generator(function(){var n,i,o,a,s,l,c,u,_tmp,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_$p,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.getLoadedActiveSession();if(!n)return[2];i=this.runtimeStates.get(n.id);if(i.runState!=="idle")return[2];o=this.messageFactory.getActiveAgent(n),a=o.timeline.findIndex(function(p){return p.id===t});if(a===-1)return[2];s=o.timeline[a],l=s.role==="user"?v0(s):"",c=gg(w6(s)),u=o.timeline.slice(a).flatMap(function(p){var m;return(m=o.operations[p.id])!=null?m:[]});_state.label=1;case 1:_state.trys.push([1,5,,6]);_tmp=r!=null&&r.restoreFiles;if(!_tmp)return[3,3];return[4,this.restoreFilesForRecall(u)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=o.timeline.splice(a)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_$p=_step.value;delete o.operations[_$p.id]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}i.draft.userContext=c,i.draft.text=l;return[4,this.store.persistSession(n)];case 4:return[2,(_state.sent(),this.notify(),{text:l,userContext:gg(c)})];case 5:p=_state.sent();Me.error(p),this.reportTransientError(_instanceof(p,Error)?p.message:String(p));return[3,6];case 6:return[2]}})}).call(this)}},{key:"recallMessageHasReversibleOps",value:function recallMessageHasReversibleOps(t){var r=this.getLoadedActiveSession();if(!r)return!1;var n=this.messageFactory.getActiveAgent(r),i=n.timeline.findIndex(function(o){return o.id===t});return i===-1?!1:n.timeline.slice(i).some(function(o){var a;return Boolean((a=n.operations[o.id])==null?void 0:a.length)})}},{key:"regenerateMessage",value:function regenerateMessage(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=this.getLoadedActiveSession();if(!r||!this.validateSelection(r))return[2];n=this.runtimeStates.get(r.id);II(n)||this.messageFactory.getActiveAgent(r).timeline.findIndex(function(a){return a.id===t})===-1||this.enqueueRegenerate(r.id,t);return[2]})}).call(this)}},{key:"beginRegeneration",value:function beginRegeneration(t,r,n){return _async_to_generator(function(){var h,g,i,o,_tmp,a,s,l,c,d,u,p,m,x,x10,v,y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=this.messageFactory.getActiveAgent(t),o=i.timeline.findIndex(function(x){return x.id===r});_tmp=o===-1;if(_tmp)return[3,2];return[4,(h=this.skillRepository)==null?void 0:h.refresh()];case 1:_tmp=(_state.sent(),!n());_state.label=2;case 2:if(_tmp)return[2];a=i.timeline.slice(),s=Object.fromEntries(Object.entries(i.operations).map(function(param){var _param=_sliced_to_array(param,2),x=_param[0],v=_param[1];return[x,v.slice()]})),l=Object.fromEntries(Object.entries(i.toolTimings).map(function(param){var _param=_sliced_to_array(param,2),x=_param[0],v=_param[1];return[x,_object_spread({},v)]})),c=this.state.sessionIndex.findIndex(function(x){return x.id===t.id}),d=t.updatedAt,u=a.slice(0,o),p=a.slice(o+1),m=-1;for(x=u.length-1;x>=0;x-=1)if(u[x].role==="user"){m=x;break}if(m!==-1){x10=u.slice(0,m),v=_I(this.app,this.skillRepository),y=bI(x10,v),_=u[m];u[m]=_object_spread_props(_object_spread({},_),{parts:_.parts.filter(function(b){return b.type!=="data-workspace-context"})}),y.length&&u[m].parts.unshift({type:"data-workspace-context",data:{deltas:y}})}return[2,(i.timeline=u,{targetMessageId:r,targetToolCallIds:a[o].parts.flatMap(function(x){return x.type==="dynamic-tool"?[x.toolCallId]:[]}),originalTimeline:a,originalOperations:s,originalToolTimings:l,originalReadVaultPaths:(g=i.readVaultPaths)==null?void 0:g.slice(),originalSessionUpdatedAt:d,originalSessionIndexItem:c===-1?void 0:_object_spread({},this.state.sessionIndex[c]),originalSessionIndexPosition:c,prefixLength:u.length,suffix:p})]}})}).call(this)}},{key:"commitRegeneration",value:function commitRegeneration(t,r){var n=this.messageFactory.getActiveAgent(t);delete n.operations[r.targetMessageId];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.targetToolCallIds[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;delete n.toolTimings[i]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}n.timeline=_to_consumable_array(n.timeline).concat(_to_consumable_array(r.suffix))}},{key:"rollbackRegeneration",value:function rollbackRegeneration(t,r){var o;var n=this.messageFactory.getActiveAgent(t);n.timeline=r.originalTimeline.slice(),n.operations=Object.fromEntries(Object.entries(r.originalOperations).map(function(param){var _param=_sliced_to_array(param,2),a=_param[0],s=_param[1];return[a,s.slice()]})),n.toolTimings=Object.fromEntries(Object.entries(r.originalToolTimings).map(function(param){var _param=_sliced_to_array(param,2),a=_param[0],s=_param[1];return[a,_object_spread({},s)]})),n.readVaultPaths=(o=r.originalReadVaultPaths)==null?void 0:o.slice(),t.updatedAt=r.originalSessionUpdatedAt;var i=this.state.sessionIndex.findIndex(function(a){return a.id===t.id});if(r.originalSessionIndexItem){var a=_object_spread({},r.originalSessionIndexItem);if(i===-1){var s=Math.min(r.originalSessionIndexPosition,this.state.sessionIndex.length);this.state.sessionIndex=_to_consumable_array(this.state.sessionIndex.slice(0,s)).concat([a],_to_consumable_array(this.state.sessionIndex.slice(s)))}else this.state.sessionIndex=this.state.sessionIndex.slice(),this.state.sessionIndex[i]=a}else i!==-1&&(this.state.sessionIndex=this.state.sessionIndex.filter(function(a){return a.id!==t.id}))}},{key:"restoreFilesForRecall",value:function restoreFilesForRecall(t){return _async_to_generator(function(){var r,n,_tmp,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,a,s,l,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,d10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,d11,err,c,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iteratorNormalCompletion4,_didIteratorError4,_iteratorError4,_iterator3,_step3,d12,_iterator4,_step4,u,_iteratorNormalCompletion5,_didIteratorError5,_iteratorError5,_iterator5,_step5,d13,err,_iteratorNormalCompletion6,_didIteratorError6,_iteratorError6,_iterator6,_step6,d14,u10,_tmp1,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.map(lp).filter(function(d){return!!d});if(r.length===0)return[2];n=r.filter(function(d){return d.vaultPath.startsWith("/")});_tmp=n.length>0;if(!_tmp)return[3,2];return[4,this.restoreVirtualFilesForRecall(n)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;i=r.filter(function(d){return!d.vaultPath.startsWith("/")});if(i.length===0)return[2];o=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;o.has(d.vaultPath)||o.set(d.vaultPath,d)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}a=new Set,s=new Set,l=new Map;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=o.values()[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){d10=_step1.value;if(d10.operation==="create"){a.add(d10.vaultPath);continue}if(d10.operation==="update"){l.set(d10.vaultPath,d10.before);continue}if(d10.before.kind==="dir"){s.add(d10.vaultPath);continue}l.set(d10.vaultPath,d10.before)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}Me.info("Recall restore start: ".concat(r.length," recorded ops, ").concat(a.size," deletes, ").concat(s.size," directories, ").concat(l.size," files."));_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator2=_to_consumable_array(a).sort(function(u,p){var m=F0(p)-F0(u);return m!==0?m:u.localeCompare(p)})[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,7];d11=_step2.value;return[4,this.deleteVaultPathIfExists(d11)];case 5:_state.sent();_state.label=6;case 6:_iteratorNormalCompletion2=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 10:c=new Set(s);_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined,_iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(_iterator3=l.keys()[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step3=_iterator3.next()).done);_iteratorNormalCompletion4=true){d12=_step3.value;try{for(_iterator4=cxe(d12)[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step4=_iterator4.next()).done);_iteratorNormalCompletion3=true){u=_step4.value;c.add(u)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}_iteratorNormalCompletion5=true,_didIteratorError5=false,_iteratorError5=undefined;_state.label=11;case 11:_state.trys.push([11,16,17,18]);_iterator5=_to_consumable_array(c).sort(function(u,p){var m=F0(u)-F0(p);return m!==0?m:u.localeCompare(p)})[Symbol.iterator]();_state.label=12;case 12:if(!!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done))return[3,15];d13=_step5.value;return[4,this.ensureVaultDirectory(d13)];case 13:_state.sent();_state.label=14;case 14:_iteratorNormalCompletion5=true;return[3,12];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError5=true;_iteratorError5=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion5&&_iterator5.return!=null){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}return[7];case 18:_iteratorNormalCompletion6=true,_didIteratorError6=false,_iteratorError6=undefined;_state.label=19;case 19:_state.trys.push([19,25,26,27]);_iterator6=_to_consumable_array(l.keys()).sort(function(u,p){var m=F0(u)-F0(p);return m!==0?m:u.localeCompare(p)})[Symbol.iterator]();_state.label=20;case 20:if(!!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done))return[3,24];d14=_step6.value;u10=l.get(d14);_tmp1=u10;if(!_tmp1)return[3,22];return[4,this.writeVaultFile(d14,u10)];case 21:_tmp1=_state.sent();_state.label=22;case 22:_tmp1;_state.label=23;case 23:_iteratorNormalCompletion6=true;return[3,20];case 24:return[3,27];case 25:err=_state.sent();_didIteratorError6=true;_iteratorError6=err;return[3,27];case 26:try{if(!_iteratorNormalCompletion6&&_iterator6.return!=null){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}return[7];case 27:Me.info("Recall restore completed.");return[2]}})}).call(this)}},{key:"restoreVirtualFilesForRecall",value:function restoreVirtualFilesForRecall(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,x4t(this.app,t,{fileSystemManager:this.fileSystemManager,settingsIo:this.settingsIo})];case 1:_state.sent();return[2]}})}).call(this)}},{key:"deleteVaultPathIfExists",value:function deleteVaultPathIfExists(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.app.vault.getAbstractFileByPath(t);if(!r)return[3,2];if(wI(r)&&r.children.length>0){Me.info("Recall restore skip non-empty dir: ".concat(t));return[2]}Me.info("Recall restore delete: ".concat(t));return[4,this.app.fileManager.trashFile(r)];case 1:_state.sent();_state.label=2;case 2:return[2]}})}).call(this)}},{key:"ensureVaultDirectory",value:function ensureVaultDirectory(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!t)return[2];r=this.app.vault.getAbstractFileByPath(t);if(r){if(wI(r))return[2];throw new Error("Unable to restore ".concat(t,": a file already exists there."))}Me.info("Recall restore mkdir: ".concat(t));return[4,this.app.vault.createFolder(t)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"writeVaultFile",value:function writeVaultFile(t,r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,xh(r)];case 1:n=_state.sent(),i=this.app.vault.getAbstractFileByPath(t);if(i&&wI(i))throw new Error("Unable to restore ".concat(t,": a directory already exists there."));if(!(i&&dxe(i)))return[3,3];Me.info("Recall restore write: ".concat(t," (overwrite)"));return[4,this.app.vault.modifyBinary(i,n)];case 2:_state.sent();return[2];case 3:Me.info("Recall restore write: ".concat(t," (create)"));return[4,this.app.vault.createBinary(t,n)];case 4:_state.sent();return[2]}})}).call(this)}},{key:"getLoadedActiveSession",value:function getLoadedActiveSession(){return this.state.activeSessionId?this.state.loadedSessions.get(this.state.activeSessionId):void 0}}]);return _P1}();var bP=/*#__PURE__*/function(){"use strict";function bP1(){_class_call_check(this,bP1);A(this,"listeners",new Set)}_create_class(bP1,[{key:"subscribe",value:function subscribe(t){var _this=this;return this.listeners.add(t),function(){_this.listeners.delete(t)}}},{key:"notify",value:function notify(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.listeners[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;t()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}]);return bP1}();var wP=function wP1(){"use strict";_class_call_check(this,wP1);A(this,"loadedSessions",new Map);A(this,"autoApproveRequestsBySessionId",new Map);A(this,"sessionIndex",[]);A(this,"deletedSessionIds",new Set);A(this,"pendingProviderId");A(this,"pendingModelId");A(this,"activeSessionId");A(this,"runtimeBySessionId",new Map);A(this,"chatModalHostEl");A(this,"initialization");A(this,"initialized",!1)};function SP(e){var t;return cG((t=e==null?void 0:e.limit)==null?void 0:t.output)}function V7e(e){var i,o;var t=cG((i=e==null?void 0:e.limit)==null?void 0:i.output),r=cG((o=e==null?void 0:e.limit)==null?void 0:o.context),n=r?Math.min(y4t(Math.floor(r*.02),4096,16384),Math.max(1,Math.floor(r*.1))):4096;return t===void 0?n:Math.min(n,t)}function y4t(e,t,r){return Math.min(Math.max(e,t),r)}function cG(e){return e!==void 0&&Number.isInteger(e)&&e>0?e:void 0}var v4t=ne(function(){return te(f.object({type:f.literal("error"),error:f.object({type:f.string(),message:f.string()})}))}),y5=Vr({errorSchema:v4t,errorToMessage:function(e){return e.error.message}}),_4t=ne(function(){return te(f.object({id:f.string(),type:f.literal("file"),filename:f.string(),mime_type:f.string(),size_bytes:f.number(),created_at:f.string(),downloadable:f.boolean().nullish()}))}),b4t=/*#__PURE__*/function(){"use strict";function b4t1(e){_class_call_check(this,b4t1);this.config=e,this.specificationVersion="v4"}_create_class(b4t1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"uploadFile",value:function uploadFile(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,_ref,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.data,t=param.mediaType,r=param.filename;o=Gd(e),a=new Blob([o],{type:t}),s=new FormData;r!=null?s.append("file",a,r):s.append("file",a);return[4,ul({url:"".concat(this.config.baseURL,"/files"),headers:ht(this.config.headers(),{"anthropic-beta":"files-api-2025-04-14"}),formData:s,failedResponseHandler:y5,successfulResponseHandler:wt(_4t),fetch:this.config.fetch})];case 1:_ref=_state.sent(),l=_ref.value;return[2,{warnings:[],providerReference:{anthropic:l.id},mediaType:(n=l.mime_type)!=null?n:t,filename:(i=l.filename)!=null?i:r,providerMetadata:{anthropic:_object_spread({filename:l.filename,mimeType:l.mime_type,sizeBytes:l.size_bytes,createdAt:l.created_at},l.downloadable!=null?{downloadable:l.downloadable}:{})}}]}})}).apply(this,arguments)}}]);return b4t1}(),r8e=f.object({type:f.string(),category:f.string().nullish(),explanation:f.string().nullish(),recommended_model:f.string().nullish()}),w4t=ne(function(){return te(f.object({type:f.literal("message"),id:f.string().nullish(),model:f.string().nullish(),content:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("text"),text:f.string(),citations:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("web_search_result_location"),cited_text:f.string(),url:f.string(),title:f.string(),encrypted_index:f.string()}),f.object({type:f.literal("page_location"),cited_text:f.string(),document_index:f.number(),document_title:f.string().nullable(),start_page_number:f.number(),end_page_number:f.number()}),f.object({type:f.literal("char_location"),cited_text:f.string(),document_index:f.number(),document_title:f.string().nullable(),start_char_index:f.number(),end_char_index:f.number()})])).optional()}),f.object({type:f.literal("thinking"),thinking:f.string(),signature:f.string()}),f.object({type:f.literal("redacted_thinking"),data:f.string()}),f.object({type:f.literal("compaction"),content:f.string()}),f.object({type:f.literal("tool_use"),id:f.string(),name:f.string(),input:f.unknown(),caller:f.union([f.object({type:f.literal("code_execution_20250825"),tool_id:f.string()}),f.object({type:f.literal("code_execution_20260120"),tool_id:f.string()}),f.object({type:f.literal("direct")})]).optional()}),f.object({type:f.literal("server_tool_use"),id:f.string(),name:f.string(),input:f.record(f.string(),f.unknown()).nullish(),caller:f.union([f.object({type:f.literal("code_execution_20260120"),tool_id:f.string()}),f.object({type:f.literal("direct")})]).optional()}),f.object({type:f.literal("mcp_tool_use"),id:f.string(),name:f.string(),input:f.unknown(),server_name:f.string()}),f.object({type:f.literal("mcp_tool_result"),tool_use_id:f.string(),is_error:f.boolean(),content:f.array(f.union([f.string(),f.object({type:f.literal("text"),text:f.string()})]))}),f.object({type:f.literal("web_fetch_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("web_fetch_result"),url:f.string(),retrieved_at:f.string(),content:f.object({type:f.literal("document"),title:f.string().nullable(),citations:f.object({enabled:f.boolean()}).optional(),source:f.union([f.object({type:f.literal("base64"),media_type:f.literal("application/pdf"),data:f.string()}),f.object({type:f.literal("text"),media_type:f.literal("text/plain"),data:f.string()})])})}),f.object({type:f.literal("web_fetch_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("web_search_tool_result"),tool_use_id:f.string(),content:f.union([f.array(f.object({type:f.literal("web_search_result"),url:f.string(),title:f.string(),encrypted_content:f.string(),page_age:f.string().nullish()})),f.object({type:f.literal("web_search_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("code_execution_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("code_execution_result"),stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("encrypted_code_execution_result"),encrypted_stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("code_execution_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("bash_code_execution_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("bash_code_execution_result"),content:f.array(f.object({type:f.literal("bash_code_execution_output"),file_id:f.string()})),stdout:f.string(),stderr:f.string(),return_code:f.number()}),f.object({type:f.literal("bash_code_execution_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("text_editor_code_execution_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("text_editor_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_view_result"),content:f.string(),file_type:f.string(),num_lines:f.number().nullable(),start_line:f.number().nullable(),total_lines:f.number().nullable()}),f.object({type:f.literal("text_editor_code_execution_create_result"),is_file_update:f.boolean()}),f.object({type:f.literal("text_editor_code_execution_str_replace_result"),lines:f.array(f.string()).nullable(),new_lines:f.number().nullable(),new_start:f.number().nullable(),old_lines:f.number().nullable(),old_start:f.number().nullable()})])}),f.object({type:f.literal("tool_search_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("tool_search_tool_search_result"),tool_references:f.array(f.object({type:f.literal("tool_reference"),tool_name:f.string()}))}),f.object({type:f.literal("tool_search_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("advisor_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("advisor_result"),text:f.string()}),f.object({type:f.literal("advisor_redacted_result"),encrypted_content:f.string()}),f.object({type:f.literal("advisor_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("fallback")})])),stop_reason:f.string().nullish(),stop_sequence:f.string().nullish(),stop_details:r8e.nullish(),usage:f.looseObject({input_tokens:f.number(),output_tokens:f.number(),output_tokens_details:f.object({thinking_tokens:f.number().nullish()}).nullish(),cache_creation_input_tokens:f.number().nullish(),cache_read_input_tokens:f.number().nullish(),iterations:f.array(f.object({type:f.union([f.literal("compaction"),f.literal("message"),f.literal("advisor_message"),f.literal("fallback_message")]),model:f.string().nullish(),input_tokens:f.number(),output_tokens:f.number(),cache_creation_input_tokens:f.number().nullish(),cache_read_input_tokens:f.number().nullish()})).nullish()}),container:f.object({expires_at:f.string(),id:f.string(),skills:f.array(f.object({type:f.union([f.literal("anthropic"),f.literal("custom")]),skill_id:f.string(),version:f.string()})).nullish()}).nullish(),context_management:f.object({applied_edits:f.array(f.union([f.object({type:f.literal("clear_tool_uses_20250919"),cleared_tool_uses:f.number(),cleared_input_tokens:f.number()}),f.object({type:f.literal("clear_thinking_20251015"),cleared_thinking_turns:f.number(),cleared_input_tokens:f.number()}),f.object({type:f.literal("compact_20260112")})]))}).nullish()}))}),S4t=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("message_start"),message:f.object({id:f.string().nullish(),model:f.string().nullish(),role:f.string().nullish(),usage:f.looseObject({input_tokens:f.number(),cache_creation_input_tokens:f.number().nullish(),cache_read_input_tokens:f.number().nullish()}),content:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("tool_use"),id:f.string(),name:f.string(),input:f.unknown(),caller:f.union([f.object({type:f.literal("code_execution_20250825"),tool_id:f.string()}),f.object({type:f.literal("code_execution_20260120"),tool_id:f.string()}),f.object({type:f.literal("direct")})]).optional()})])).nullish(),stop_reason:f.string().nullish(),container:f.object({expires_at:f.string(),id:f.string()}).nullish()})}),f.object({type:f.literal("content_block_start"),index:f.number(),content_block:f.discriminatedUnion("type",[f.object({type:f.literal("text"),text:f.string()}),f.object({type:f.literal("thinking"),thinking:f.string()}),f.object({type:f.literal("tool_use"),id:f.string(),name:f.string(),input:f.record(f.string(),f.unknown()).optional(),caller:f.union([f.object({type:f.literal("code_execution_20250825"),tool_id:f.string()}),f.object({type:f.literal("code_execution_20260120"),tool_id:f.string()}),f.object({type:f.literal("direct")})]).optional()}),f.object({type:f.literal("redacted_thinking"),data:f.string()}),f.object({type:f.literal("compaction"),content:f.string().nullish()}),f.object({type:f.literal("server_tool_use"),id:f.string(),name:f.string(),input:f.record(f.string(),f.unknown()).nullish(),caller:f.union([f.object({type:f.literal("code_execution_20260120"),tool_id:f.string()}),f.object({type:f.literal("direct")})]).optional()}),f.object({type:f.literal("mcp_tool_use"),id:f.string(),name:f.string(),input:f.unknown(),server_name:f.string()}),f.object({type:f.literal("mcp_tool_result"),tool_use_id:f.string(),is_error:f.boolean(),content:f.array(f.union([f.string(),f.object({type:f.literal("text"),text:f.string()})]))}),f.object({type:f.literal("web_fetch_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("web_fetch_result"),url:f.string(),retrieved_at:f.string(),content:f.object({type:f.literal("document"),title:f.string().nullable(),citations:f.object({enabled:f.boolean()}).optional(),source:f.union([f.object({type:f.literal("base64"),media_type:f.literal("application/pdf"),data:f.string()}),f.object({type:f.literal("text"),media_type:f.literal("text/plain"),data:f.string()})])})}),f.object({type:f.literal("web_fetch_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("web_search_tool_result"),tool_use_id:f.string(),content:f.union([f.array(f.object({type:f.literal("web_search_result"),url:f.string(),title:f.string(),encrypted_content:f.string(),page_age:f.string().nullish()})),f.object({type:f.literal("web_search_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("code_execution_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("code_execution_result"),stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("encrypted_code_execution_result"),encrypted_stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("code_execution_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("bash_code_execution_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("bash_code_execution_result"),content:f.array(f.object({type:f.literal("bash_code_execution_output"),file_id:f.string()})),stdout:f.string(),stderr:f.string(),return_code:f.number()}),f.object({type:f.literal("bash_code_execution_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("text_editor_code_execution_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("text_editor_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_view_result"),content:f.string(),file_type:f.string(),num_lines:f.number().nullable(),start_line:f.number().nullable(),total_lines:f.number().nullable()}),f.object({type:f.literal("text_editor_code_execution_create_result"),is_file_update:f.boolean()}),f.object({type:f.literal("text_editor_code_execution_str_replace_result"),lines:f.array(f.string()).nullable(),new_lines:f.number().nullable(),new_start:f.number().nullable(),old_lines:f.number().nullable(),old_start:f.number().nullable()})])}),f.object({type:f.literal("tool_search_tool_result"),tool_use_id:f.string(),content:f.union([f.object({type:f.literal("tool_search_tool_search_result"),tool_references:f.array(f.object({type:f.literal("tool_reference"),tool_name:f.string()}))}),f.object({type:f.literal("tool_search_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("advisor_tool_result"),tool_use_id:f.string(),content:f.discriminatedUnion("type",[f.object({type:f.literal("advisor_result"),text:f.string()}),f.object({type:f.literal("advisor_redacted_result"),encrypted_content:f.string()}),f.object({type:f.literal("advisor_tool_result_error"),error_code:f.string()})])}),f.object({type:f.literal("fallback")})])}),f.object({type:f.literal("content_block_delta"),index:f.number(),delta:f.discriminatedUnion("type",[f.object({type:f.literal("input_json_delta"),partial_json:f.string()}),f.object({type:f.literal("text_delta"),text:f.string()}),f.object({type:f.literal("thinking_delta"),thinking:f.string()}),f.object({type:f.literal("signature_delta"),signature:f.string()}),f.object({type:f.literal("compaction_delta"),content:f.string().nullish()}),f.object({type:f.literal("citations_delta"),citation:f.discriminatedUnion("type",[f.object({type:f.literal("web_search_result_location"),cited_text:f.string(),url:f.string(),title:f.string(),encrypted_index:f.string()}),f.object({type:f.literal("page_location"),cited_text:f.string(),document_index:f.number(),document_title:f.string().nullable(),start_page_number:f.number(),end_page_number:f.number()}),f.object({type:f.literal("char_location"),cited_text:f.string(),document_index:f.number(),document_title:f.string().nullable(),start_char_index:f.number(),end_char_index:f.number()})])})])}),f.object({type:f.literal("content_block_stop"),index:f.number()}),f.object({type:f.literal("error"),error:f.object({type:f.string(),message:f.string()})}),f.object({type:f.literal("message_delta"),delta:f.object({stop_reason:f.string().nullish(),stop_sequence:f.string().nullish(),stop_details:r8e.nullish(),container:f.object({expires_at:f.string(),id:f.string(),skills:f.array(f.object({type:f.union([f.literal("anthropic"),f.literal("custom")]),skill_id:f.string(),version:f.string()})).nullish()}).nullish()}),usage:f.looseObject({input_tokens:f.number().nullish(),output_tokens:f.number(),output_tokens_details:f.object({thinking_tokens:f.number().nullish()}).nullish(),cache_creation_input_tokens:f.number().nullish(),cache_read_input_tokens:f.number().nullish(),iterations:f.array(f.object({type:f.union([f.literal("compaction"),f.literal("message"),f.literal("advisor_message"),f.literal("fallback_message")]),model:f.string().nullish(),input_tokens:f.number(),output_tokens:f.number(),cache_creation_input_tokens:f.number().nullish(),cache_read_input_tokens:f.number().nullish()})).nullish()}),context_management:f.object({applied_edits:f.array(f.union([f.object({type:f.literal("clear_tool_uses_20250919"),cleared_tool_uses:f.number(),cleared_input_tokens:f.number()}),f.object({type:f.literal("clear_thinking_20251015"),cleared_thinking_turns:f.number(),cleared_input_tokens:f.number()}),f.object({type:f.literal("compact_20260112")})]))}).nullish()}),f.object({type:f.literal("message_stop")}),f.object({type:f.literal("ping")})]))}),k4t=ne(function(){return te(f.object({signature:f.string().optional(),redactedData:f.string().optional()}))}),dG=f.object({containerUpload:f.boolean().optional(),citations:f.object({enabled:f.boolean()}).optional(),title:f.string().optional(),context:f.string().optional()}),C4t=f.object({toolChanges:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("tool_addition"),toolName:f.string()}),f.object({type:f.literal("tool_removal"),toolName:f.string()})])).optional()}),G7e=f.object({sendReasoning:f.boolean().optional(),structuredOutputMode:f.enum(["outputFormat","jsonTool","auto"]).optional(),thinking:f.discriminatedUnion("type",[f.object({type:f.literal("adaptive"),display:f.enum(["omitted","summarized"]).optional()}),f.object({type:f.literal("enabled"),budgetTokens:f.number().optional()}),f.object({type:f.literal("disabled")})]).optional(),disableParallelToolUse:f.boolean().optional(),cacheControl:f.object({type:f.literal("ephemeral"),ttl:f.union([f.literal("5m"),f.literal("1h")]).optional()}).optional(),metadata:f.object({userId:f.string().optional()}).optional(),mcpServers:f.array(f.object({type:f.literal("url"),name:f.string(),url:f.string(),authorizationToken:f.string().nullish(),toolConfiguration:f.object({enabled:f.boolean().nullish(),allowedTools:f.array(f.string()).nullish()}).nullish()})).optional(),container:f.object({id:f.string().optional(),skills:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("anthropic"),skillId:f.string(),version:f.string().optional()}),f.object({type:f.literal("custom"),providerReference:f.record(f.string(),f.string()),version:f.string().optional()})])).optional()}).optional(),toolStreaming:f.boolean().optional(),effort:f.enum(["low","medium","high","xhigh","max"]).optional(),taskBudget:f.object({type:f.literal("tokens"),total:f.number().int().min(2e4),remaining:f.number().int().min(0).optional()}).optional(),speed:f.enum(["fast","standard"]).optional(),inferenceGeo:f.enum(["us","global"]).optional(),fallbacks:f.union([f.literal("default"),f.array(f.object({model:f.string(),max_tokens:f.number().int().optional(),thinking:f.record(f.string(),f.unknown()).optional(),output_config:f.record(f.string(),f.unknown()).optional(),speed:f.enum(["fast","standard"]).optional()}))]).optional(),anthropicBeta:f.array(f.string()).optional(),contextManagement:f.object({edits:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("clear_tool_uses_20250919"),trigger:f.discriminatedUnion("type",[f.object({type:f.literal("input_tokens"),value:f.number()}),f.object({type:f.literal("tool_uses"),value:f.number()})]).optional(),keep:f.object({type:f.literal("tool_uses"),value:f.number()}).optional(),clearAtLeast:f.object({type:f.literal("input_tokens"),value:f.number()}).optional(),clearToolInputs:f.boolean().optional(),excludeTools:f.array(f.string()).optional()}),f.object({type:f.literal("clear_thinking_20251015"),keep:f.union([f.literal("all"),f.object({type:f.literal("thinking_turns"),value:f.number()})]).optional()}),f.object({type:f.literal("compact_20260112"),trigger:f.object({type:f.literal("input_tokens"),value:f.number()}).optional(),pauseAfterCompaction:f.boolean().optional(),instructions:f.string().optional()})]))}).optional()}),H7e=4;function E4t(e){var t;var r=e==null?void 0:e.anthropic;return(t=r==null?void 0:r.cacheControl)!=null?t:r==null?void 0:r.cache_control}var fG=/*#__PURE__*/function(){"use strict";function fG1(){_class_call_check(this,fG1);this.breakpointCount=0,this.warnings=[]}_create_class(fG1,[{key:"getCacheControl",value:function getCacheControl(e,t){var r=E4t(e);if(r){if(!t.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:"cache_control cannot be set on ".concat(t.type,". It will be ignored.")});return}if(this.breakpointCount++,this.breakpointCount>H7e){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:"Maximum ".concat(H7e," cache breakpoints exceeded (found ").concat(this.breakpointCount,"). This breakpoint will be ignored.")});return}return r}}},{key:"getWarnings",value:function getWarnings(){return this.warnings}}]);return fG1}(),T4t=ne(function(){return te(f.object({model:f.string(),maxUses:f.number().optional(),caching:f.object({type:f.literal("ephemeral"),ttl:f.union([f.literal("5m"),f.literal("1h")])}).optional()}))}),n8e=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("advisor_result"),text:f.string()}),f.object({type:f.literal("advisor_redacted_result"),encryptedContent:f.string()}),f.object({type:f.literal("advisor_tool_result_error"),errorCode:f.string()})]))}),A4t=ne(function(){return te(f.object({}).strict())}),I4t=tr({id:"anthropic.advisor_20260301",inputSchema:A4t,outputSchema:n8e,supportsDeferredResults:!0}),P4t=function(e){return I4t(e)},R4t=ne(function(){return te(f.object({maxCharacters:f.number().optional()}))}),M4t=ne(function(){return te(f.object({command:f.enum(["view","create","str_replace","insert"]),path:f.string(),file_text:f.string().optional(),insert_line:f.number().int().optional(),new_str:f.string().optional(),insert_text:f.string().optional(),old_str:f.string().optional(),view_range:f.array(f.number().int()).optional()}))}),O4t=Yi({id:"anthropic.text_editor_20250728",inputSchema:M4t}),$4t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return O4t(e)},N4t=ne(function(){return te(f.object({maxUses:f.number().optional(),allowedDomains:f.array(f.string()).optional(),blockedDomains:f.array(f.string()).optional(),userLocation:f.object({type:f.literal("approximate"),city:f.string().optional(),region:f.string().optional(),country:f.string().optional(),timezone:f.string().optional()}).optional()}))}),D4t=ne(function(){return te(f.array(f.object({url:f.string(),title:f.string().nullable(),pageAge:f.string().nullable(),encryptedContent:f.string(),type:f.literal("web_search_result")})))}),L4t=ne(function(){return te(f.object({query:f.string()}))}),F4t=tr({id:"anthropic.web_search_20260209",inputSchema:L4t,outputSchema:D4t,supportsDeferredResults:!0}),z4t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return F4t(e)},j4t=ne(function(){return te(f.object({maxUses:f.number().optional(),allowedDomains:f.array(f.string()).optional(),blockedDomains:f.array(f.string()).optional(),userLocation:f.object({type:f.literal("approximate"),city:f.string().optional(),region:f.string().optional(),country:f.string().optional(),timezone:f.string().optional()}).optional()}))}),i8e=ne(function(){return te(f.array(f.object({url:f.string(),title:f.string().nullable(),pageAge:f.string().nullable(),encryptedContent:f.string(),type:f.literal("web_search_result")})))}),U4t=ne(function(){return te(f.object({query:f.string()}))}),B4t=tr({id:"anthropic.web_search_20250305",inputSchema:U4t,outputSchema:i8e,supportsDeferredResults:!0}),q4t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return B4t(e)},W4t=ne(function(){return te(f.object({maxUses:f.number().optional(),allowedDomains:f.array(f.string()).optional(),blockedDomains:f.array(f.string()).optional(),citations:f.object({enabled:f.boolean()}).optional(),maxContentTokens:f.number().optional()}))}),V4t=ne(function(){return te(f.object({type:f.literal("web_fetch_result"),url:f.string(),content:f.object({type:f.literal("document"),title:f.string().nullable(),citations:f.object({enabled:f.boolean()}).optional(),source:f.union([f.object({type:f.literal("base64"),mediaType:f.literal("application/pdf"),data:f.string()}),f.object({type:f.literal("text"),mediaType:f.literal("text/plain"),data:f.string()})])}),retrievedAt:f.string().nullable()}))}),G4t=ne(function(){return te(f.object({url:f.string()}))}),H4t=tr({id:"anthropic.web_fetch_20260209",inputSchema:G4t,outputSchema:V4t,supportsDeferredResults:!0}),Z4t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return H4t(e)},K4t=ne(function(){return te(f.object({maxUses:f.number().optional(),allowedDomains:f.array(f.string()).optional(),blockedDomains:f.array(f.string()).optional(),citations:f.object({enabled:f.boolean()}).optional(),maxContentTokens:f.number().optional()}))}),o8e=ne(function(){return te(f.object({type:f.literal("web_fetch_result"),url:f.string(),content:f.object({type:f.literal("document"),title:f.string().nullable(),citations:f.object({enabled:f.boolean()}).optional(),source:f.union([f.object({type:f.literal("base64"),mediaType:f.literal("application/pdf"),data:f.string()}),f.object({type:f.literal("text"),mediaType:f.literal("text/plain"),data:f.string()})])}),retrievedAt:f.string().nullable()}))}),Q4t=ne(function(){return te(f.object({url:f.string()}))}),J4t=tr({id:"anthropic.web_fetch_20250910",inputSchema:Q4t,outputSchema:o8e,supportsDeferredResults:!0}),Y4t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return J4t(e)};function X4t(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,tmp,a,s,l,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,h,_,g,x,v,y,_10,_11,g10,g11,g12,g13,g14,g15,err,m,h10;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.tools,t=param.toolChoice,r=param.disableParallelToolUse,n=param.cacheControlValidator,i=param.supportsStructuredOutput,o=param.supportsStrictTools,tmp=param.defaultEagerInputStreaming,a=tmp===void 0?!1:tmp;e=e!=null&&e.length?e:void 0;c=[],d=new Set,u=n||new fG;if(e==null)return[2,{tools:void 0,toolChoice:void 0,toolWarnings:c,betas:d}];p=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,36,37,38]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,35];h=_step.value;_=h.type;switch(_){case"function":return[3,3];case"provider":return[3,4]}return[3,33];case 3:{g=u.getCacheControl(h.providerOptions,{type:"tool definition",canCache:!0}),x=(s=h.providerOptions)==null?void 0:s.anthropic,v=(l=x==null?void 0:x.eagerInputStreaming)!=null?l:a,y=x==null?void 0:x.deferLoading,_10=x==null?void 0:x.allowedCallers;!o&&h.strict!=null&&c.push({type:"unsupported",feature:"strict",details:"Tool '".concat(h.name,"' has strict: ").concat(h.strict,", but strict mode is not supported by this provider. The strict property will be ignored.")}),p.push(_object_spread({name:h.name,description:h.description,input_schema:h.inputSchema,cache_control:g},v?{eager_input_streaming:!0}:{},o===!0&&h.strict!=null?{strict:h.strict}:{},y!=null?{defer_loading:y}:{},_10!=null?{allowed_callers:_10}:{},h.inputExamples!=null?{input_examples:h.inputExamples.map(function(b){return b.input})}:{})),i===!0&&d.add("structured-outputs-2025-11-13"),(h.inputExamples!=null||_10!=null)&&d.add("advanced-tool-use-2025-11-20");return[3,34]}_state.label=4;case 4:_11=h.id;switch(_11){case"anthropic.code_execution_20250522":return[3,5];case"anthropic.code_execution_20250825":return[3,6];case"anthropic.code_execution_20260120":return[3,7];case"anthropic.computer_20250124":return[3,8];case"anthropic.computer_20251124":return[3,9];case"anthropic.computer_20241022":return[3,10];case"anthropic.text_editor_20250124":return[3,11];case"anthropic.text_editor_20241022":return[3,12];case"anthropic.text_editor_20250429":return[3,13];case"anthropic.text_editor_20250728":return[3,14];case"anthropic.bash_20250124":return[3,16];case"anthropic.bash_20241022":return[3,17];case"anthropic.memory_20250818":return[3,18];case"anthropic.web_fetch_20250910":return[3,19];case"anthropic.web_fetch_20260209":return[3,21];case"anthropic.web_search_20250305":return[3,23];case"anthropic.web_search_20260209":return[3,25];case"anthropic.tool_search_regex_20251119":return[3,27];case"anthropic.tool_search_bm25_20251119":return[3,28];case"anthropic.advisor_20260301":return[3,29]}return[3,31];case 5:{d.add("code-execution-2025-05-22"),p.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});return[3,32]}_state.label=6;case 6:{d.add("code-execution-2025-08-25"),p.push({type:"code_execution_20250825",name:"code_execution"});return[3,32]}_state.label=7;case 7:{p.push({type:"code_execution_20260120",name:"code_execution"});return[3,32]}_state.label=8;case 8:{d.add("computer-use-2025-01-24"),p.push({name:"computer",type:"computer_20250124",display_width_px:h.args.displayWidthPx,display_height_px:h.args.displayHeightPx,display_number:h.args.displayNumber,cache_control:void 0});return[3,32]}_state.label=9;case 9:{d.add("computer-use-2025-11-24"),p.push({name:"computer",type:"computer_20251124",display_width_px:h.args.displayWidthPx,display_height_px:h.args.displayHeightPx,display_number:h.args.displayNumber,enable_zoom:h.args.enableZoom,cache_control:void 0});return[3,32]}_state.label=10;case 10:{d.add("computer-use-2024-10-22"),p.push({name:"computer",type:"computer_20241022",display_width_px:h.args.displayWidthPx,display_height_px:h.args.displayHeightPx,display_number:h.args.displayNumber,cache_control:void 0});return[3,32]}_state.label=11;case 11:{d.add("computer-use-2025-01-24"),p.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});return[3,32]}_state.label=12;case 12:{d.add("computer-use-2024-10-22"),p.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});return[3,32]}_state.label=13;case 13:{d.add("computer-use-2025-01-24"),p.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});return[3,32]}_state.label=14;case 14:return[4,ur({value:h.args,schema:R4t})];case 15:g10=_state.sent();p.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:g10.maxCharacters,cache_control:void 0});return[3,32];case 16:{d.add("computer-use-2025-01-24"),p.push({name:"bash",type:"bash_20250124",cache_control:void 0});return[3,32]}_state.label=17;case 17:{d.add("computer-use-2024-10-22"),p.push({name:"bash",type:"bash_20241022",cache_control:void 0});return[3,32]}_state.label=18;case 18:{d.add("context-management-2025-06-27"),p.push({name:"memory",type:"memory_20250818"});return[3,32]}_state.label=19;case 19:d.add("web-fetch-2025-09-10");return[4,ur({value:h.args,schema:K4t})];case 20:g11=_state.sent();p.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:g11.maxUses,allowed_domains:g11.allowedDomains,blocked_domains:g11.blockedDomains,citations:g11.citations,max_content_tokens:g11.maxContentTokens,cache_control:void 0});return[3,32];case 21:d.add("code-execution-web-tools-2026-02-09");return[4,ur({value:h.args,schema:W4t})];case 22:g12=_state.sent();p.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:g12.maxUses,allowed_domains:g12.allowedDomains,blocked_domains:g12.blockedDomains,citations:g12.citations,max_content_tokens:g12.maxContentTokens,cache_control:void 0});return[3,32];case 23:return[4,ur({value:h.args,schema:j4t})];case 24:g13=_state.sent();p.push({type:"web_search_20250305",name:"web_search",max_uses:g13.maxUses,allowed_domains:g13.allowedDomains,blocked_domains:g13.blockedDomains,user_location:g13.userLocation,cache_control:void 0});return[3,32];case 25:d.add("code-execution-web-tools-2026-02-09");return[4,ur({value:h.args,schema:N4t})];case 26:g14=_state.sent();p.push({type:"web_search_20260209",name:"web_search",max_uses:g14.maxUses,allowed_domains:g14.allowedDomains,blocked_domains:g14.blockedDomains,user_location:g14.userLocation,cache_control:void 0});return[3,32];case 27:{p.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});return[3,32]}_state.label=28;case 28:{p.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});return[3,32]}_state.label=29;case 29:d.add("advisor-tool-2026-03-01");return[4,ur({value:h.args,schema:T4t})];case 30:g15=_state.sent();p.push(_object_spread({type:"advisor_20260301",name:"advisor",model:g15.model},g15.maxUses!==void 0&&{max_uses:g15.maxUses},g15.caching!==void 0&&{caching:g15.caching}));return[3,32];case 31:{c.push({type:"unsupported",feature:"provider-defined tool ".concat(h.id)});return[3,32]}_state.label=32;case 32:return[3,34];case 33:{c.push({type:"unsupported",feature:"tool ".concat(h)});return[3,34]}_state.label=34;case 34:_iteratorNormalCompletion=true;return[3,2];case 35:return[3,38];case 36:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,38];case 37:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 38:if(t==null)return[2,{tools:p,toolChoice:r?{type:"auto",disable_parallel_tool_use:r}:void 0,toolWarnings:c,betas:d}];m=t.type;switch(m){case"auto":return[2,{tools:p,toolChoice:{type:"auto",disable_parallel_tool_use:r},toolWarnings:c,betas:d}];case"required":return[2,{tools:p,toolChoice:{type:"any",disable_parallel_tool_use:r},toolWarnings:c,betas:d}];case"none":return[2,{tools:void 0,toolChoice:void 0,toolWarnings:c,betas:d}];case"tool":return[2,{tools:p,toolChoice:{type:"tool",name:t.toolName,disable_parallel_tool_use:r},toolWarnings:c,betas:d}];default:{h10=m;throw new or({functionality:"tool choice type: ".concat(h10)})}}return[2]}})}).apply(this,arguments)}function Z7e(param){var e=param.usage,t=param.rawUsage;var r,n,i,o,a;var s=(r=e.cache_creation_input_tokens)!=null?r:0,l=(n=e.cache_read_input_tokens)!=null?n:0,c=(o=(i=e.output_tokens_details)==null?void 0:i.thinking_tokens)!=null?o:void 0,d,u,p=(a=e.iterations)==null?void 0:a.some(function(m){return m.type==="fallback_message"});if(e.iterations&&e.iterations.length>0&&!p){var m=e.iterations.filter(function(h){return h.type==="compaction"||h.type==="message"});if(m.length>0){var h=m.reduce(function(g,x){return{input:g.input+x.input_tokens,output:g.output+x.output_tokens}},{input:0,output:0});d=h.input,u=h.output}else d=e.input_tokens,u=e.output_tokens}else d=e.input_tokens,u=e.output_tokens;return{inputTokens:{total:d+s+l,noCache:d,cacheRead:l,cacheWrite:s},outputTokens:{total:u,text:c==null?void 0:u-c,reasoning:c},raw:t!=null?t:e}}var a8e=ne(function(){return te(f.object({type:f.literal("code_execution_result"),stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}))}),e3t=ne(function(){return te(f.object({code:f.string()}))}),t3t=tr({id:"anthropic.code_execution_20250522",inputSchema:e3t,outputSchema:a8e}),r3t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t3t(e)},s8e=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("code_execution_result"),stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("bash_code_execution_result"),content:f.array(f.object({type:f.literal("bash_code_execution_output"),file_id:f.string()})),stdout:f.string(),stderr:f.string(),return_code:f.number()}),f.object({type:f.literal("bash_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_view_result"),content:f.string(),file_type:f.string(),num_lines:f.number().nullable(),start_line:f.number().nullable(),total_lines:f.number().nullable()}),f.object({type:f.literal("text_editor_code_execution_create_result"),is_file_update:f.boolean()}),f.object({type:f.literal("text_editor_code_execution_str_replace_result"),lines:f.array(f.string()).nullable(),new_lines:f.number().nullable(),new_start:f.number().nullable(),old_lines:f.number().nullable(),old_start:f.number().nullable()})]))}),n3t=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("programmatic-tool-call"),code:f.string()}),f.object({type:f.literal("bash_code_execution"),command:f.string()}),f.discriminatedUnion("command",[f.object({type:f.literal("text_editor_code_execution"),command:f.literal("view"),path:f.string()}),f.object({type:f.literal("text_editor_code_execution"),command:f.literal("create"),path:f.string(),file_text:f.string().nullish()}),f.object({type:f.literal("text_editor_code_execution"),command:f.literal("str_replace"),path:f.string(),old_str:f.string(),new_str:f.string()})])]))}),i3t=tr({id:"anthropic.code_execution_20250825",inputSchema:n3t,outputSchema:s8e,supportsDeferredResults:!0}),o3t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i3t(e)},l8e=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("code_execution_result"),stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("encrypted_code_execution_result"),encrypted_stdout:f.string(),stderr:f.string(),return_code:f.number(),content:f.array(f.object({type:f.literal("code_execution_output"),file_id:f.string()})).optional().default([])}),f.object({type:f.literal("bash_code_execution_result"),content:f.array(f.object({type:f.literal("bash_code_execution_output"),file_id:f.string()})),stdout:f.string(),stderr:f.string(),return_code:f.number()}),f.object({type:f.literal("bash_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_tool_result_error"),error_code:f.string()}),f.object({type:f.literal("text_editor_code_execution_view_result"),content:f.string(),file_type:f.string(),num_lines:f.number().nullable(),start_line:f.number().nullable(),total_lines:f.number().nullable()}),f.object({type:f.literal("text_editor_code_execution_create_result"),is_file_update:f.boolean()}),f.object({type:f.literal("text_editor_code_execution_str_replace_result"),lines:f.array(f.string()).nullable(),new_lines:f.number().nullable(),new_start:f.number().nullable(),old_lines:f.number().nullable(),old_start:f.number().nullable()})]))}),a3t=ne(function(){return te(f.discriminatedUnion("type",[f.object({type:f.literal("programmatic-tool-call"),code:f.string()}),f.object({type:f.literal("bash_code_execution"),command:f.string()}),f.discriminatedUnion("command",[f.object({type:f.literal("text_editor_code_execution"),command:f.literal("view"),path:f.string()}),f.object({type:f.literal("text_editor_code_execution"),command:f.literal("create"),path:f.string(),file_text:f.string().nullish()}),f.object({type:f.literal("text_editor_code_execution"),command:f.literal("str_replace"),path:f.string(),old_str:f.string(),new_str:f.string()})])]))}),s3t=tr({id:"anthropic.code_execution_20260120",inputSchema:a3t,outputSchema:l8e,supportsDeferredResults:!0}),l3t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return s3t(e)},u8e=ne(function(){return te(f.array(f.object({type:f.literal("tool_reference"),toolName:f.string()})))}),u3t=ne(function(){return te(f.object({pattern:f.string(),limit:f.number().optional()}))}),c3t=tr({id:"anthropic.tool_search_regex_20251119",inputSchema:u3t,outputSchema:u8e,supportsDeferredResults:!0}),d3t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return c3t(e)};function p3t(e){return typeof e=="string"?new TextDecoder().decode(Ui(e)):new TextDecoder().decode(e)}function K7e(e){try{if(typeof e=="string")return ll(e);if((typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null)return e}catch(t){var r=e==null?void 0:e.errorCode;return{errorCode:typeof r=="string"?r:"unavailable"}}return{}}function f3t(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,pe,N,U,G,K,me,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,V,ie,re,de,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,xe,err,K10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,me1,V10,ie1,re1,de1,xe1,Y,_10,_11,oe,oe1,H,oe2,H5,J,H10,J5,re2,de2,xe2,Y5,oe3,H11,J10,re3,err,K11,me2,V11,ie2,re4,de3,xe3,Y10,oe4,H12,_12,J11,J12,Q,it,_Y_input,it1,pt,J13,j,J14,j1,j10,Q5,Q10,Q11,Q12,j11,Q13,j12,Q14,j13,Fe,j14,Q15,K12;function D(pe){return _async_to_generator(function(){var N,U,G;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,$t({provider:"anthropic",providerOptions:pe,schema:dG})];case 1:G=_state.sent();return[2,(U=(N=G==null?void 0:G.citations)==null?void 0:N.enabled)!=null?U:!1]}})})()}function L(pe){return _async_to_generator(function(){var N,U;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,$t({provider:"anthropic",providerOptions:pe,schema:dG})];case 1:U=_state.sent();return[2,(N=U==null?void 0:U.containerUpload)!=null?N:!1]}})})()}function ee(pe){return _async_to_generator(function(){var N;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,$t({provider:"anthropic",providerOptions:pe,schema:dG})];case 1:N=_state.sent();return[2,{title:N==null?void 0:N.title,context:N==null?void 0:N.context}]}})})()}return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.prompt,t=param.sendReasoning,r=param.warnings,n=param.cacheControlValidator,i=param.toolNameMapping;O=new Set,M=m3t(e),R=n||new fG,z=[];pe=0;_state.label=1;case 1:if(!(pe<M.length))return[3,73];N=M[pe],U=pe===M.length-1,G=N.type;switch(G){case"system":return[3,2];case"user":return[3,11];case"assistant":return[3,42]}return[3,71];case 2:K=[],me=0;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=3;case 3:_state.trys.push([3,8,9,10]);_iterator=N.messages[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];_step_value=_step.value,V=_step_value.content,ie=_step_value.providerOptions;return[4,$t({provider:"anthropic",providerOptions:ie,schema:C4t})];case 5:re=_state.sent(),de=(o=re==null?void 0:re.toolChanges)!=null?o:[];(V!==""||de.length===0)&&K.push({type:"text",text:V,cache_control:R.getCacheControl(ie,{type:"system message",canCache:!0})});_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=de[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){xe=_step1.value;me++,K.push({type:xe.type,tool:{type:"tool_reference",name:i.toProviderToolName(xe.toolName)}})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:pe===0||$==null&&me===0?(me>0&&r.push({type:"other",message:"tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored."}),$=K.filter(function(V){return V.type==="text"})):(z.push({role:"system",content:K}),O.add("mid-conversation-system-2026-04-07"),me>0&&O.add("mid-conversation-tool-changes-2026-07-01"));return[3,72];case 11:K10=[];_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=12;case 12:_state.trys.push([12,39,40,41]);_iterator2=N.messages[Symbol.iterator]();_state.label=13;case 13:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,38];me1=_step2.value;V10=me1.role,ie1=me1.content;switch(V10){case"user":return[3,14];case"tool":return[3,35]}return[3,36];case 14:re1=0;_state.label=15;case 15:if(!(re1<ie1.length))return[3,34];de1=ie1[re1],xe1=re1===ie1.length-1,Y=(a=R.getCacheControl(de1.providerOptions,{type:"user message part",canCache:!0}))!=null?a:xe1?R.getCacheControl(me1.providerOptions,{type:"user message",canCache:!0}):void 0;_10=de1.type;switch(_10){case"text":return[3,16];case"file":return[3,17]}return[3,33];case 16:{K10.push({type:"text",text:de1.text,cache_control:Y});return[3,33]}_state.label=17;case 17:_11=de1.data.type;switch(_11){case"reference":return[3,18];case"text":return[3,20];case"url":return[3,23];case"data":return[3,23]}return[3,32];case 18:oe=ns({reference:de1.data.reference,provider:"anthropic"});O.add("files-api-2025-04-14");return[4,L(de1.providerOptions)];case 19:_state.sent()?K10.push({type:"container_upload",file_id:oe}):ea(de1.mediaType)==="image"?K10.push({type:"image",source:{type:"file",file_id:oe},cache_control:Y}):K10.push({type:"document",source:{type:"file",file_id:oe},cache_control:Y});return[3,32];case 20:return[4,D(de1.providerOptions)];case 21:oe1=_state.sent();return[4,ee(de1.providerOptions)];case 22:H=_state.sent();K10.push(_object_spread_props(_object_spread({type:"document",source:{type:"text",media_type:"text/plain",data:de1.data.text},title:(s=H.title)!=null?s:de1.filename},H.context&&{context:H.context},oe1&&{citations:{enabled:!0}}),{cache_control:Y}));return[3,32];case 23:oe2=ea(de1.mediaType);if(!(oe2==="image"))return[3,24];K10.push({type:"image",source:de1.data.type==="url"?{type:"url",url:de1.data.url.toString()}:{type:"base64",media_type:ai({part:de1}),data:Fr(de1.data.data)},cache_control:Y});return[3,31];case 24:if(!(oe2==="application"&&(de1.data.type==="url"?de1.mediaType==="application/pdf":ai({part:de1})==="application/pdf")))return[3,27];O.add("pdfs-2024-09-25");return[4,D(de1.providerOptions)];case 25:H5=_state.sent();return[4,ee(de1.providerOptions)];case 26:J=_state.sent();K10.push(_object_spread_props(_object_spread({type:"document",source:de1.data.type==="url"?{type:"url",url:de1.data.url.toString()}:{type:"base64",media_type:"application/pdf",data:Fr(de1.data.data)},title:(l=J.title)!=null?l:de1.filename},J.context&&{context:J.context},H5&&{citations:{enabled:!0}}),{cache_control:Y}));return[3,31];case 27:if(!(de1.mediaType==="text/plain"))return[3,30];return[4,D(de1.providerOptions)];case 28:H10=_state.sent();return[4,ee(de1.providerOptions)];case 29:J5=_state.sent();K10.push(_object_spread_props(_object_spread({type:"document",source:de1.data.type==="url"?{type:"url",url:de1.data.url.toString()}:{type:"text",media_type:"text/plain",data:p3t(de1.data.data)},title:(c=J5.title)!=null?c:de1.filename},J5.context&&{context:J5.context},H10&&{citations:{enabled:!0}}),{cache_control:Y}));return[3,31];case 30:throw new or({functionality:"media type: ".concat(de1.mediaType)});case 31:return[3,32];case 32:return[3,33];case 33:re1++;return[3,15];case 34:return[3,37];case 35:{for(re2=0;re2<ie1.length;re2++){de2=ie1[re2];if(de2.type==="tool-approval-response")continue;xe2=de2.output,Y5="providerOptions"in xe2?xe2.providerOptions:xe2.type==="content"?(d=xe2.value.find(function(j){return j.providerOptions!=null}))==null?void 0:d.providerOptions:void 0,oe3=re2===ie1.length-1,H11=(p=(u=R.getCacheControl(de2.providerOptions,{type:"tool result part",canCache:!0}))!=null?u:R.getCacheControl(Y5,{type:"tool result output",canCache:!0}))!=null?p:oe3?R.getCacheControl(me1.providerOptions,{type:"tool result message",canCache:!0}):void 0,J10=void 0;switch(xe2.type){case"content":J10=xe2.value.map(function(j){var Q;switch(j.type){case"text":return{type:"text",text:j.text};case"file":{var Fe=ea(j.mediaType);if(j.data.type==="url")return Fe==="image"?{type:"image",source:{type:"url",url:j.data.url.toString()}}:{type:"document",source:{type:"url",url:j.data.url.toString()}};if(j.data.type==="data"){if(Fe==="image")return{type:"image",source:{type:"base64",media_type:ai({part:j}),data:Fr(j.data.data)}};if(ai({part:j})==="application/pdf")return O.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:"application/pdf",data:Fr(j.data.data)}};r.push({type:"other",message:"unsupported tool content part type: ".concat(j.type," with media type: ").concat(j.mediaType)});return}r.push({type:"other",message:"unsupported tool content part type: ".concat(j.type," with data type: ").concat(j.data.type)});return}case"custom":{var Fe1=(Q=j.providerOptions)==null?void 0:Q.anthropic;if((Fe1==null?void 0:Fe1.type)==="tool-reference")return{type:"tool_reference",tool_name:Fe1.toolName};r.push({type:"other",message:"unsupported custom tool content part"});return}default:{r.push({type:"other",message:"unsupported tool content part type: ".concat(j.type)});return}}}).filter(p0);break;case"text":case"error-text":J10=xe2.value;break;case"execution-denied":J10=(m=xe2.reason)!=null?m:"Tool call execution denied.";break;case"json":case"error-json":default:J10=JSON.stringify(xe2.value);break}K10.push({type:"tool_result",tool_use_id:de2.toolCallId,content:J10,is_error:xe2.type==="error-text"||xe2.type==="error-json"?!0:void 0,cache_control:H11})}return[3,37]}_state.label=36;case 36:{re3=V10;throw new Error("Unsupported role: ".concat(re3))}_state.label=37;case 37:_iteratorNormalCompletion2=true;return[3,13];case 38:return[3,41];case 39:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,41];case 40:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 41:z.push({role:"user",content:K10});return[3,72];case 42:K11=[],me2=new Set;V11=0;_state.label=43;case 43:if(!(V11<N.messages.length))return[3,70];ie2=N.messages[V11],re4=V11===N.messages.length-1,de3=ie2.content;xe3=0;_state.label=44;case 44:if(!(xe3<de3.length))return[3,69];Y10=de3[xe3],oe4=xe3===de3.length-1,H12=(h=R.getCacheControl(Y10.providerOptions,{type:"assistant message part",canCache:!0}))!=null?h:oe4?R.getCacheControl(ie2.providerOptions,{type:"assistant message",canCache:!0}):void 0;_12=Y10.type;switch(_12){case"text":return[3,45];case"reasoning":return[3,46];case"tool-call":return[3,50];case"tool-result":return[3,51]}return[3,68];case 45:{J11=(g=Y10.providerOptions)==null?void 0:g.anthropic;(J11==null?void 0:J11.type)==="compaction"?K11.push({type:"compaction",content:Y10.text,cache_control:H12}):K11.push(_object_spread_props(_object_spread({type:"text",text:U&&re4&&oe4?Y10.text.trim():Y10.text},(J11==null?void 0:J11.citations)!=null&&{citations:J11.citations}),{cache_control:H12}));return[3,68]}_state.label=46;case 46:if(!t)return[3,48];return[4,$t({provider:"anthropic",providerOptions:Y10.providerOptions,schema:k4t})];case 47:J12=_state.sent();J12!=null?J12.signature!=null?(R.getCacheControl(Y10.providerOptions,{type:"thinking block",canCache:!1}),K11.push({type:"thinking",thinking:Y10.text,signature:J12.signature})):J12.redactedData!=null?(R.getCacheControl(Y10.providerOptions,{type:"redacted thinking block",canCache:!1}),K11.push({type:"redacted_thinking",data:J12.redactedData})):r.push({type:"other",message:"unsupported reasoning metadata"}):r.push({type:"other",message:"unsupported reasoning metadata"});return[3,49];case 48:r.push({type:"other",message:"sending reasoning content is disabled for this model"});_state.label=49;case 49:return[3,68];case 50:{if(Y10.providerExecuted){Q=i.toProviderToolName(Y10.toolName);if(((v=(x=Y10.providerOptions)==null?void 0:x.anthropic)==null?void 0:v.type)==="mcp-tool-use"){me2.add(Y10.toolCallId);it=(_=(y=Y10.providerOptions)==null?void 0:y.anthropic)==null?void 0:_.serverName;if(it==null||typeof it!="string"){r.push({type:"other",message:"mcp tool use server name is required and must be a string"});return[3,68]}K11.push({type:"mcp_tool_use",id:Y10.toolCallId,name:Y10.toolName,input:Y10.input,server_name:it,cache_control:H12})}else if(Q==="code_execution"&&Y10.input!=null&&_type_of(Y10.input)=="object"&&"type"in Y10.input&&typeof Y10.input.type=="string"&&(Y10.input.type==="bash_code_execution"||Y10.input.type==="text_editor_code_execution"))K11.push({type:"server_tool_use",id:Y10.toolCallId,name:Y10.input.type,input:Y10.input,cache_control:H12});else if(Q==="code_execution"&&Y10.input!=null&&_type_of(Y10.input)=="object"&&"type"in Y10.input&&Y10.input.type==="programmatic-tool-call"){_Y_input=Y10.input,it1=_Y_input.type,pt=_object_without_properties(_Y_input,["type"]);K11.push({type:"server_tool_use",id:Y10.toolCallId,name:"code_execution",input:pt,cache_control:H12})}else Q==="code_execution"||Q==="web_fetch"||Q==="web_search"?K11.push({type:"server_tool_use",id:Y10.toolCallId,name:Q,input:Y10.input,cache_control:H12}):Q==="tool_search_tool_regex"||Q==="tool_search_tool_bm25"?K11.push({type:"server_tool_use",id:Y10.toolCallId,name:Q,input:Y10.input,cache_control:H12}):Q==="advisor"?K11.push({type:"server_tool_use",id:Y10.toolCallId,name:"advisor",input:{},cache_control:H12}):r.push({type:"other",message:"provider executed tool call for tool ".concat(Y10.toolName," is not supported")});return[3,68]}J13=(b=Y10.providerOptions)==null?void 0:b.anthropic,j=J13!=null&&J13.caller?(J13.caller.type==="code_execution_20250825"||J13.caller.type==="code_execution_20260120")&&J13.caller.toolId?{type:J13.caller.type,tool_id:J13.caller.toolId}:J13.caller.type==="direct"?{type:"direct"}:void 0:void 0;K11.push(_object_spread_props(_object_spread({type:"tool_use",id:Y10.toolCallId,name:Y10.toolName,input:g3t(Y10.input)},j&&{caller:j}),{cache_control:H12}));return[3,68]}_state.label=51;case 51:J14=i.toProviderToolName(Y10.toolName);if(!me2.has(Y10.toolCallId))return[3,52];j1=Y10.output;if(j1.type!=="json"&&j1.type!=="error-json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j1.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}K11.push({type:"mcp_tool_result",tool_use_id:Y10.toolCallId,is_error:j1.type==="error-json",content:j1.value,cache_control:H12});return[3,59];case 52:if(!(J14==="code_execution"))return[3,59];j10=Y10.output;if(j10.type==="error-text"||j10.type==="error-json"){Q5={};try{typeof j10.value=="string"?Q5=ll(j10.value):_type_of(j10.value)=="object"&&j10.value!==null&&(Q5=j10.value)}catch(Fe){}Q5.type==="code_execution_tool_result_error"?K11.push({type:"code_execution_tool_result",tool_use_id:Y10.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(w=Q5.errorCode)!=null?w:"unknown"},cache_control:H12}):K11.push({type:"bash_code_execution_tool_result",tool_use_id:Y10.toolCallId,cache_control:H12,content:{type:"bash_code_execution_tool_result_error",error_code:(S=Q5.errorCode)!=null?S:"unknown"}});return[3,68]}if(j10.type!=="json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j10.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}if(j10.value==null||_type_of(j10.value)!="object"||!("type"in j10.value)||typeof j10.value.type!="string"){r.push({type:"other",message:"provider executed tool result output value is not a valid code execution result for tool ".concat(Y10.toolName)});return[3,68]}if(!(j10.value.type==="code_execution_result"))return[3,54];return[4,ur({value:j10.value,schema:a8e})];case 53:Q10=_state.sent();K11.push({type:"code_execution_tool_result",tool_use_id:Y10.toolCallId,content:{type:Q10.type,stdout:Q10.stdout,stderr:Q10.stderr,return_code:Q10.return_code,content:(k=Q10.content)!=null?k:[]},cache_control:H12});return[3,58];case 54:if(!(j10.value.type==="encrypted_code_execution_result"))return[3,56];return[4,ur({value:j10.value,schema:l8e})];case 55:Q11=_state.sent();Q11.type==="encrypted_code_execution_result"&&K11.push({type:"code_execution_tool_result",tool_use_id:Y10.toolCallId,content:{type:Q11.type,encrypted_stdout:Q11.encrypted_stdout,stderr:Q11.stderr,return_code:Q11.return_code,content:(E=Q11.content)!=null?E:[]},cache_control:H12});return[3,58];case 56:return[4,ur({value:j10.value,schema:s8e})];case 57:Q12=_state.sent();Q12.type==="code_execution_result"?K11.push({type:"code_execution_tool_result",tool_use_id:Y10.toolCallId,content:{type:Q12.type,stdout:Q12.stdout,stderr:Q12.stderr,return_code:Q12.return_code,content:(C=Q12.content)!=null?C:[]},cache_control:H12}):Q12.type==="bash_code_execution_result"||Q12.type==="bash_code_execution_tool_result_error"?K11.push({type:"bash_code_execution_tool_result",tool_use_id:Y10.toolCallId,cache_control:H12,content:Q12}):K11.push({type:"text_editor_code_execution_tool_result",tool_use_id:Y10.toolCallId,cache_control:H12,content:Q12});_state.label=58;case 58:return[3,68];case 59:if(!(J14==="web_fetch"))return[3,61];j11=Y10.output;if(j11.type==="error-json"){K11.push({type:"web_fetch_tool_result",tool_use_id:Y10.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:(T=K7e(j11.value).errorCode)!=null?T:"unavailable"},cache_control:H12});return[3,68]}if(j11.type!=="json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j11.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}return[4,ur({value:j11.value,schema:o8e})];case 60:Q13=_state.sent();K11.push({type:"web_fetch_tool_result",tool_use_id:Y10.toolCallId,content:{type:"web_fetch_result",url:Q13.url,retrieved_at:Q13.retrievedAt,content:{type:"document",title:Q13.content.title,citations:Q13.content.citations,source:{type:Q13.content.source.type,media_type:Q13.content.source.mediaType,data:Q13.content.source.data}}},cache_control:H12});return[3,68];case 61:if(!(J14==="web_search"))return[3,63];j12=Y10.output;if(j12.type==="error-json"){K11.push({type:"web_search_tool_result",tool_use_id:Y10.toolCallId,content:{type:"web_search_tool_result_error",error_code:(I=K7e(j12.value).errorCode)!=null?I:"unavailable"},cache_control:H12});return[3,68]}if(j12.type!=="json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j12.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}return[4,ur({value:j12.value,schema:i8e})];case 62:Q14=_state.sent();K11.push({type:"web_search_tool_result",tool_use_id:Y10.toolCallId,content:Q14.map(function(Fe){return{url:Fe.url,title:Fe.title,page_age:Fe.pageAge,encrypted_content:Fe.encryptedContent,type:Fe.type}}),cache_control:H12});return[3,68];case 63:if(!(J14==="tool_search_tool_regex"||J14==="tool_search_tool_bm25"))return[3,65];j13=Y10.output;if(j13.type!=="json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j13.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}return[4,ur({value:j13.value,schema:u8e})];case 64:Fe=_state.sent().map(function(it){return{type:"tool_reference",tool_name:it.toolName}});K11.push({type:"tool_search_tool_result",tool_use_id:Y10.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:Fe},cache_control:H12});return[3,68];case 65:if(!(J14==="advisor"))return[3,67];j14=Y10.output;if(j14.type!=="json"&&j14.type!=="error-json"){r.push({type:"other",message:"provider executed tool result output type ".concat(j14.type," for tool ").concat(Y10.toolName," is not supported")});return[3,68]}return[4,ur({value:j14.value,schema:n8e})];case 66:Q15=_state.sent();Q15.type==="advisor_result"?K11.push({type:"advisor_tool_result",tool_use_id:Y10.toolCallId,content:{type:"advisor_result",text:Q15.text},cache_control:H12}):Q15.type==="advisor_redacted_result"?K11.push({type:"advisor_tool_result",tool_use_id:Y10.toolCallId,content:{type:"advisor_redacted_result",encrypted_content:Q15.encryptedContent},cache_control:H12}):K11.push({type:"advisor_tool_result",tool_use_id:Y10.toolCallId,content:{type:"advisor_tool_result_error",error_code:Q15.errorCode},cache_control:H12});return[3,68];case 67:r.push({type:"other",message:"provider executed tool result for tool ".concat(Y10.toolName," is not supported")});return[3,68];case 68:xe3++;return[3,44];case 69:V11++;return[3,43];case 70:z.push({role:"assistant",content:h3t(K11)});return[3,72];case 71:{K12=G;throw new Error("content type: ".concat(K12))}_state.label=72;case 72:pe++;return[3,1];case 73:return[2,{prompt:{system:$,messages:z},betas:O}]}})}).apply(this,arguments)}function m3t(e){var t=[],r;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;var i=n.role;switch(i){case"system":{(r==null?void 0:r.type)!=="system"&&(r={type:"system",messages:[]},t.push(r)),r.messages.push(n);break}case"assistant":{(r==null?void 0:r.type)!=="assistant"&&(r={type:"assistant",messages:[]},t.push(r)),r.messages.push(n);break}case"user":{(r==null?void 0:r.type)!=="user"&&(r={type:"user",messages:[]},t.push(r)),r.messages.push(n);break}case"tool":{(r==null?void 0:r.type)!=="user"&&(r={type:"user",messages:[]},t.push(r)),r.messages.push(n);break}default:{var o=i;throw new Error("Unsupported role: ".concat(o))}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function h3t(e){var t=[],r=[];function n(){var _t1;(_t1=t).push.apply(_t1,_to_consumable_array(r.filter(function(i){return i.type!=="tool_use"})).concat(_to_consumable_array(r.filter(function(i){return i.type==="tool_use"})))),r=[]}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;i.type==="thinking"||i.type==="redacted_thinking"?(n(),t.push(i)):r.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n(),t}function g3t(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&!Array.isArray(e)?e:{rawInvalidInput:e}}function pG(param){var e=param.finishReason,t=param.isJsonResponseFromTool;switch(e){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return t?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}var c8e=new Set(["date-time","time","date","duration","email","hostname","uri","ipv4","ipv6","uuid"]),x3t=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","minItems","maxItems","uniqueItems","minProperties","maxProperties","not"];function y3t(e){return d8e(e)}function Hh(e){return typeof e=="boolean"||!w3t(e)?e:d8e(e)}function d8e(e){var t={},r=e;if(e.$ref!=null)return{$ref:e.$ref};if(e.$schema!=null&&(t.$schema=e.$schema),e.$id!=null&&(t.$id=e.$id),e.title!=null&&(t.title=e.title),e.description!=null&&(t.description=e.description),e.default!==void 0&&(t.default=e.default),e.const!==void 0&&(t.const=e.const),e.enum!=null&&(t.enum=e.enum),e.type!=null&&(t.type=e.type),e.anyOf!=null?t.anyOf=e.anyOf.map(Hh):e.oneOf!=null&&(t.anyOf=e.oneOf.map(Hh)),e.allOf!=null&&(t.allOf=e.allOf.map(Hh)),e.definitions!=null&&(t.definitions=Object.fromEntries(Object.entries(e.definitions).map(function(param){var _param=_sliced_to_array(param,2),i=_param[0],o=_param[1];return[i,Hh(o)]}))),r.$defs!=null){var i=t;i.$defs=Object.fromEntries(Object.entries(r.$defs).map(function(param){var _param=_sliced_to_array(param,2),o=_param[0],a=_param[1];return[o,Hh(a)]}))}(e.type==="object"||e.properties!=null)&&(e.properties!=null&&(t.properties=Object.fromEntries(Object.entries(e.properties).map(function(param){var _param=_sliced_to_array(param,2),i=_param[0],o=_param[1];return[i,Hh(o)]}))),t.additionalProperties=!1,e.required!=null&&(t.required=e.required)),e.items!=null&&(t.items=Array.isArray(e.items)?e.items.map(Hh):Hh(e.items)),typeof e.format=="string"&&c8e.has(e.format)&&(t.format=e.format);var n=v3t(e);return n!=null&&(t.description=t.description==null?n:"".concat(t.description,"\n").concat(n)),t}function v3t(e){var t=x3t.flatMap(function(r){var n=e[r];return n==null||n===!1?[]:"".concat(_3t(r),": ").concat(b3t(n))});return typeof e.format=="string"&&!c8e.has(e.format)&&t.push("format: ".concat(e.format)),t.length===0?void 0:"".concat(t.join("; "),".")}function _3t(e){return e.replace(/[A-Z]/g,function(t){return" ".concat(t.toLowerCase())})}function b3t(e){return typeof e=="string"?e:JSON.stringify(e)}function w3t(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!==null&&!Array.isArray(e)}function Q7e(e,t,r){var n;if(e.type==="web_search_result_location")return{type:"source",sourceType:"url",id:r(),url:e.url,title:e.title,providerMetadata:{anthropic:{citedText:e.cited_text,encryptedIndex:e.encrypted_index}}};if(e.type!=="page_location"&&e.type!=="char_location")return;var i=t[e.document_index];if(i)return{type:"source",sourceType:"document",id:r(),mediaType:i.mediaType,title:(n=e.document_title)!=null?n:i.title,filename:i.filename,providerMetadata:{anthropic:e.type==="page_location"?{citedText:e.cited_text,startPageNumber:e.start_page_number,endPageNumber:e.end_page_number}:{citedText:e.cited_text,startCharIndex:e.start_char_index,endCharIndex:e.end_char_index}}}}var S3t=/*#__PURE__*/function(){"use strict";function p8e(t,r){_class_call_check(this,p8e);this.specificationVersion="v4";var n;this.modelId=t,this.config=r,this.generateId=(n=r.generateId)!=null?n:Qr}_create_class(p8e,[{key:"supportsUrl",value:function supportsUrl(t){return t.protocol==="https:"}},{key:"provider",get:function get1(){return this.config.provider}},{key:"providerOptionsName",get:function get1(){var t=this.config.provider,r=t.indexOf(".");return r===-1?t:t.substring(0,r)}},{key:"supportedUrls",get:function get1(){var t,r,n;return(n=(r=(t=this.config).supportedUrls)==null?void 0:r.call(t))!=null?n:{}}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,D,L,_k3t,ee,pe,N,U,G,K,me,_tmp,V,ie,re,de,xe,Y,oe,H,J,_ref,j,Q,Ve,Fe,it,pt,nt,gt,Ie,we,Oe,_ref1,Pe,tt,We,Ut,Rt;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.userSuppliedBetas,r=param.prompt,n=param.maxOutputTokens,i=param.temperature,o=param.topP,a=param.topK,s=param.frequencyPenalty,l=param.presencePenalty,c=param.stopSequences,d=param.responseFormat,u=param.seed,p=param.tools,m=param.toolChoice,h=param.reasoning,g=param.providerOptions,x=param.stream;M=[];s!=null&&M.push({type:"unsupported",feature:"frequencyPenalty"}),l!=null&&M.push({type:"unsupported",feature:"presencePenalty"}),u!=null&&M.push({type:"unsupported",feature:"seed"}),i!=null&&i>1?(M.push({type:"unsupported",feature:"temperature",details:"".concat(i," exceeds anthropic maximum of 1.0. clamped to 1.0")}),i=1):i!=null&&i<0&&(M.push({type:"unsupported",feature:"temperature",details:"".concat(i," is below anthropic minimum of 0. clamped to 0")}),i=0),(d==null?void 0:d.type)==="json"&&d.schema==null&&M.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."});R=this.providerOptionsName;return[4,$t({provider:"anthropic",providerOptions:g,schema:G7e})];case 1:$=_state.sent();if(!(R!=="anthropic"))return[3,3];return[4,$t({provider:R,providerOptions:g,schema:G7e})];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=null;_state.label=4;case 4:z=_tmp,D=z!=null,L=Object.assign({},$!=null?$:{},z!=null?z:{}),_k3t=k3t(this.modelId),ee=_k3t.maxOutputTokens,pe=_k3t.supportsStructuredOutput,N=_k3t.supportsAdaptiveThinking,U=_k3t.rejectsSamplingParameters,G=_k3t.supportsXhighEffort,K=_k3t.rejectsThinkingDisabledAboveHighEffort,me=_k3t.isKnownModel;!me&&n==null&&M.push({type:"compatibility",feature:"maxOutputTokens",details:'The model "'.concat(this.modelId,'" is unknown. The max output tokens have been limited to ').concat(ee,". Set maxOutputTokens explicitly to override this limit.")}),U&&(i!=null&&(M.push({type:"unsupported",feature:"temperature",details:"temperature is not supported by ".concat(this.modelId," and will be ignored")}),i=void 0),a!=null&&(M.push({type:"unsupported",feature:"topK",details:"topK is not supported by ".concat(this.modelId," and will be ignored")}),a=void 0),o!=null&&(M.push({type:"unsupported",feature:"topP",details:"topP is not supported by ".concat(this.modelId," and will be ignored")}),o=void 0));V=me||this.modelId.includes("claude-"),ie=((v=this.config.supportsNativeStructuredOutput)!=null?v:!0)&&pe,re=((y=this.config.supportsStrictTools)!=null?y:!0)&&pe,de=(_=L==null?void 0:L.structuredOutputMode)!=null?_:"auto",xe=de==="outputFormat"||de==="auto"&&ie,Y=(d==null?void 0:d.type)==="json"&&d.schema!=null&&!xe?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:d.schema}:void 0;Y!=null&&(L==null?void 0:L.disableParallelToolUse)===!1&&M.push({type:"unsupported",feature:"providerOptions.anthropic.disableParallelToolUse",details:"`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call."});oe=L==null?void 0:L.contextManagement,H=new fG,J=oT({tools:p,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25","anthropic.advisor_20260301":"advisor"}});return[4,f3t({prompt:r,sendReasoning:(b=L==null?void 0:L.sendReasoning)!=null?b:!0,warnings:M,cacheControlValidator:H,toolNameMapping:J})];case 5:_ref=_state.sent(),j=_ref.prompt,Q=_ref.betas;if(Oc(h)&&(L==null?void 0:L.effort)==null){Ve=C3t({reasoning:h,supportsAdaptiveThinking:N,supportsXhighEffort:G,maxOutputTokensForModel:ee,warnings:M});Ve!=null&&(L.thinking==null&&(L.thinking=Ve.thinking),Ve.effort!=null&&((w=L.thinking)==null?void 0:w.type)!=="disabled"&&(L.effort=Ve.effort))}K&&((S=L==null?void 0:L.thinking)==null?void 0:S.type)==="disabled"&&(L.effort==="xhigh"||L.effort==="max")&&(M.push({type:"unsupported",feature:"providerOptions.anthropic.effort",details:"effort '".concat(L.effort,"' is not supported by ").concat(this.modelId," when thinking is disabled. The effort has been lowered to 'high'.")}),L.effort="high");Fe=(k=L==null?void 0:L.thinking)==null?void 0:k.type,it=Fe==="enabled"||Fe==="adaptive",pt=it||Fe==="disabled",nt=Fe==="enabled"?(E=L==null?void 0:L.thinking)==null?void 0:E.budgetTokens:void 0,gt=Fe==="adaptive"?(C=L==null?void 0:L.thinking)==null?void 0:C.display:void 0,Ie=n!=null?n:ee,we=_object_spread(_object_spread_props(_object_spread({model:this.modelId,max_tokens:Ie,temperature:i,top_k:a,top_p:o,stop_sequences:c},pt&&{thinking:_object_spread({type:Fe},nt!=null&&{budget_tokens:nt},gt!=null&&{display:gt})},((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||xe&&(d==null?void 0:d.type)==="json"&&d.schema!=null)&&{output_config:_object_spread({},(L==null?void 0:L.effort)&&{effort:L.effort},(L==null?void 0:L.taskBudget)&&{task_budget:_object_spread({type:L.taskBudget.type,total:L.taskBudget.total},L.taskBudget.remaining!=null&&{remaining:L.taskBudget.remaining})},xe&&(d==null?void 0:d.type)==="json"&&d.schema!=null&&{format:{type:"json_schema",schema:y3t(d.schema)}})},(L==null?void 0:L.speed)&&{speed:L.speed},(L==null?void 0:L.inferenceGeo)&&{inference_geo:L.inferenceGeo},(L==null?void 0:L.fallbacks)!=null&&(L.fallbacks==="default"||L.fallbacks.length>0)&&{fallbacks:L.fallbacks},(L==null?void 0:L.cacheControl)&&{cache_control:L.cacheControl},((T=L==null?void 0:L.metadata)==null?void 0:T.userId)!=null&&{metadata:{user_id:L.metadata.userId}},(L==null?void 0:L.mcpServers)&&L.mcpServers.length>0&&{mcp_servers:L.mcpServers.map(function(Ve){return{type:Ve.type,name:Ve.name,url:Ve.url,authorization_token:Ve.authorizationToken,tool_configuration:Ve.toolConfiguration?{allowed_tools:Ve.toolConfiguration.allowedTools,enabled:Ve.toolConfiguration.enabled}:void 0}})},(L==null?void 0:L.container)&&{container:L.container.skills&&L.container.skills.length>0?{id:L.container.id,skills:L.container.skills.map(function(Ve){return{type:Ve.type,skill_id:Ve.type==="custom"?ns({reference:Ve.providerReference,provider:"anthropic"}):Ve.skillId,version:Ve.version}})}:L.container.id}),{system:j.system,messages:j.messages}),oe&&{context_management:{edits:oe.edits.map(function(Ve){var Tr=Ve.type;switch(Tr){case"clear_tool_uses_20250919":return _object_spread({type:Ve.type},Ve.trigger!==void 0&&{trigger:Ve.trigger},Ve.keep!==void 0&&{keep:Ve.keep},Ve.clearAtLeast!==void 0&&{clear_at_least:Ve.clearAtLeast},Ve.clearToolInputs!==void 0&&{clear_tool_inputs:Ve.clearToolInputs},Ve.excludeTools!==void 0&&{exclude_tools:Ve.excludeTools});case"clear_thinking_20251015":return _object_spread({type:Ve.type},Ve.keep!==void 0&&{keep:Ve.keep});case"compact_20260112":return _object_spread({type:Ve.type},Ve.trigger!==void 0&&{trigger:Ve.trigger},Ve.pauseAfterCompaction!==void 0&&{pause_after_compaction:Ve.pauseAfterCompaction},Ve.instructions!==void 0&&{instructions:Ve.instructions});default:M.push({type:"other",message:"Unknown context management strategy: ".concat(Tr)});return}}).filter(function(Ve){return Ve!==void 0})}});it?(Fe==="enabled"&&nt==null&&(M.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),we.thinking={type:"enabled",budget_tokens:1024},nt=1024),we.temperature!=null&&(we.temperature=void 0,M.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"})),a!=null&&(we.top_k=void 0,M.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"})),o!=null&&(we.top_p=void 0,M.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"})),we.max_tokens=Ie+(nt!=null?nt:0)):V&&o!=null&&i!=null&&(M.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),we.top_p=void 0),me&&we.max_tokens>ee&&(n!=null&&M.push({type:"unsupported",feature:"maxOutputTokens",details:"".concat(we.max_tokens," (maxOutputTokens + thinkingBudget) is greater than ").concat(this.modelId," ").concat(ee," max output tokens. The max output tokens have been limited to ").concat(ee,".")}),we.max_tokens=ee),L!=null&&L.mcpServers&&L.mcpServers.length>0&&Q.add("mcp-client-2025-04-04"),oe&&(Q.add("context-management-2025-06-27"),oe.edits.some(function(Ve){return Ve.type==="compact_20260112"})&&Q.add("compact-2026-01-12")),L!=null&&L.container&&L.container.skills&&L.container.skills.length>0&&(Q.add("code-execution-2025-08-25"),Q.add("skills-2025-10-02"),Q.add("files-api-2025-04-14"),p!=null&&p.some(function(Ve){return Ve.type==="provider"&&(Ve.id==="anthropic.code_execution_20250825"||Ve.id==="anthropic.code_execution_20260120")})||M.push({type:"other",message:"code execution tool is required when using skills"})),L!=null&&L.taskBudget&&Q.add("task-budgets-2026-03-13"),(L==null?void 0:L.speed)==="fast"&&Q.add("fast-mode-2026-02-01"),(L==null?void 0:L.fallbacks)==="default"?Q.add("server-side-fallback-2026-07-01"):L!=null&&L.fallbacks&&L.fallbacks.length>0&&Q.add("server-side-fallback-2026-06-01");Oe=x&&((I=L==null?void 0:L.toolStreaming)!=null?I:!0);return[4,X4t(Y!=null?{tools:_to_consumable_array(p!=null?p:[]).concat([Y]),toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:H,supportsStructuredOutput:!1,supportsStrictTools:re,defaultEagerInputStreaming:Oe}:{tools:p!=null?p:[],toolChoice:m,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:H,supportsStructuredOutput:ie,supportsStrictTools:re,defaultEagerInputStreaming:Oe})];case 6:_ref1=_state.sent(),Pe=_ref1.tools,tt=_ref1.toolChoice,We=_ref1.toolWarnings,Ut=_ref1.betas,Rt=H.getWarnings();return[2,{args:_object_spread_props(_object_spread({},we),{tools:Pe,tool_choice:tt,stream:x===!0?!0:void 0}),warnings:_to_consumable_array(M).concat(_to_consumable_array(We),_to_consumable_array(Rt)),betas:new Set(_to_consumable_array(Q).concat(_to_consumable_array(Ut),_to_consumable_array(t),_to_consumable_array((O=L==null?void 0:L.anthropicBeta)!=null?O:[]))),usesJsonResponseTool:Y!=null,toolNameMapping:J,providerOptionsName:R,usedCustomProviderKey:D}]}})}).apply(this,arguments)}},{key:"getHeaders",value:function getHeaders(_01){return _async_to_generator(function(param){var t,r,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.betas,r=param.headers;if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:return[2,ht.apply(void 0,[_tmp,r,t.size>0?{"anthropic-beta":Array.from(t).join(",")}:{}])]}})}).apply(this,arguments)}},{key:"getBetasFromHeaders",value:function getBetasFromHeaders(t){return _async_to_generator(function(){var r,n,i,o,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.config.headers)return[3,2];return[4,Kt(this.config.headers)];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=void 0;_state.label=3;case 3:i=_tmp,o=(r=i==null?void 0:i["anthropic-beta"])!=null?r:"",a=(n=t==null?void 0:t["anthropic-beta"])!=null?n:"";return[2,new Set(_to_consumable_array(o.toLowerCase().split(",")).concat(_to_consumable_array(a.toLowerCase().split(","))).map(function(s){return s.trim()}).filter(function(s){return s!==""}))]}})}).call(this)}},{key:"buildRequestUrl",value:function buildRequestUrl(t){var r,n,i;return(i=(n=(r=this.config).buildRequestUrl)==null?void 0:n.call(r,this.config.baseURL,t))!=null?i:"".concat(this.config.baseURL,"/messages")}},{key:"transformRequestBody",value:function transformRequestBody(t,r){var n,i,o;return(o=(i=(n=this.config).transformRequestBody)==null?void 0:i.call(n,t,r))!=null?o:t}},{key:"extractCitationDocuments",value:function extractCitationDocuments(t){var r=function(n){var i,o;if(n.type!=="file"||n.mediaType!=="application/pdf"&&n.mediaType!=="text/plain")return!1;var a=(i=n.providerOptions)==null?void 0:i.anthropic,s=a==null?void 0:a.citations;return(o=s==null?void 0:s.enabled)!=null?o:!1};return t.filter(function(n){return n.role==="user"}).flatMap(function(n){return n.content}).filter(r).map(function(n){var i;var o=n;return{title:(i=o.filename)!=null?i:"Untitled Document",filename:o.filename,mediaType:o.mediaType}})}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,_ref,d,u,p,m,h,g,x,v,y,_ref1,_,b,w,S,k,E,C,_10,_11,_tmp,_tmp1,_tmp2,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,T,I,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,O,M,O1,M1,I1,I10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,I11,I12,O10,M10,I13;return _ts_generator(this,function(_state){switch(_state.label){case 0:_11=(_10=this).getArgs;_tmp=[_object_spread({},t)];_tmp1={stream:!1};return[4,this.getBetasFromHeaders(t.headers)];case 1:return[4,_11.apply(_10,[_object_spread_props.apply(void 0,_tmp.concat([(_tmp1.userSuppliedBetas=_state.sent(),_tmp1)]))])];case 2:_ref=_state.sent(),d=_ref.args,u=_ref.warnings,p=_ref.betas,m=_ref.usesJsonResponseTool,h=_ref.toolNameMapping,g=_ref.providerOptionsName,x=_ref.usedCustomProviderKey,v=_to_consumable_array(this.extractCitationDocuments(t.prompt)),y=J7e(d.tools);_tmp2={url:this.buildRequestUrl(!1)};return[4,this.getHeaders({betas:p,headers:t.headers})];case 3:return[4,zt.apply(void 0,[(_tmp2.headers=_state.sent(),_tmp2.body=this.transformRequestBody(d,p),_tmp2.failedResponseHandler=y5,_tmp2.successfulResponseHandler=wt(w4t),_tmp2.abortSignal=t.abortSignal,_tmp2.fetch=this.config.fetch,_tmp2)])];case 4:_ref1=_state.sent(),_=_ref1.responseHeaders,b=_ref1.value,w=_ref1.rawValue,S=[],k={},E={},C=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=b.content[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){T=_step.value;switch(T.type){case"text":{if(!m){I=(r=T.citations)==null?void 0:r.filter(function(O){return O.type==="web_search_result_location"});_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(S.push(_object_spread({type:"text",text:T.text},I!=null&&I.length>0&&{providerMetadata:{anthropic:{citations:I}}})),T.citations)try{for(_iterator1=T.citations[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){O=_step1.value;M=Q7e(O,v,this.generateId);M&&S.push(M)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}break}case"thinking":{S.push({type:"reasoning",text:T.thinking,providerMetadata:{anthropic:{signature:T.signature}}});break}case"redacted_thinking":{S.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:T.data}}});break}case"compaction":{S.push({type:"text",text:T.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(m&&T.name==="json")C=!0,S.push({type:"text",text:JSON.stringify(T.input)});else{O1=T.caller,M1=O1?{type:O1.type,toolId:"tool_id"in O1?O1.tool_id:void 0}:void 0;S.push(_object_spread({type:"tool-call",toolCallId:T.id,toolName:T.name,input:JSON.stringify(T.input)},M1&&{providerMetadata:{anthropic:{caller:M1}}}))}break}case"server_tool_use":{if(T.name==="text_editor_code_execution"||T.name==="bash_code_execution"){I1="code_execution";S.push(_object_spread({type:"tool-call",toolCallId:T.id,toolName:h.toCustomToolName("code_execution"),input:JSON.stringify(_object_spread({type:T.name},T.input)),providerExecuted:!0},y&&I1==="code_execution"?{dynamic:!0}:{}))}else if(T.name==="web_search"||T.name==="code_execution"||T.name==="web_fetch"){I10=T.name==="code_execution"&&T.input!=null&&_type_of(T.input)=="object"&&"code"in T.input&&!("type"in T.input)?_object_spread({type:"programmatic-tool-call"},T.input):T.input;S.push(_object_spread({type:"tool-call",toolCallId:T.id,toolName:h.toCustomToolName(T.name),input:JSON.stringify(I10),providerExecuted:!0},y&&T.name==="code_execution"?{dynamic:!0}:{}))}else T.name==="tool_search_tool_regex"||T.name==="tool_search_tool_bm25"?(E[T.id]=T.name,S.push({type:"tool-call",toolCallId:T.id,toolName:h.toCustomToolName(T.name),input:JSON.stringify(T.input),providerExecuted:!0})):T.name==="advisor"&&S.push({type:"tool-call",toolCallId:T.id,toolName:h.toCustomToolName("advisor"),input:JSON.stringify(T.input),providerExecuted:!0});break}case"mcp_tool_use":{k[T.id]={type:"tool-call",toolCallId:T.id,toolName:T.name,input:JSON.stringify(T.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:T.server_name}}},S.push(k[T.id]);break}case"mcp_tool_result":{S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:k[T.tool_use_id].toolName,isError:T.is_error,result:T.content,dynamic:!0,providerMetadata:k[T.tool_use_id].providerMetadata});break}case"web_fetch_tool_result":{T.content.type==="web_fetch_result"?(v.push({title:(n=T.content.content.title)!=null?n:T.content.url,mediaType:T.content.content.source.media_type}),S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:T.content.url,retrievedAt:T.content.retrieved_at,content:{type:T.content.content.type,title:T.content.content.title,citations:T.content.content.citations,source:{type:T.content.content.source.type,mediaType:T.content.content.source.media_type,data:T.content.content.source.data}}}})):T.content.type==="web_fetch_tool_result_error"&&S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:T.content.error_code}});break}case"web_search_tool_result":{if(Array.isArray(T.content)){S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("web_search"),result:T.content.map(function(I){var O;return{url:I.url,title:I.title,pageAge:(O=I.page_age)!=null?O:null,encryptedContent:I.encrypted_content,type:I.type}})});_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=T.content[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){I11=_step2.value;S.push({type:"source",sourceType:"url",id:this.generateId(),url:I11.url,title:I11.title,providerMetadata:{anthropic:{pageAge:(i=I11.page_age)!=null?i:null}}})}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:T.content.error_code}});break}case"code_execution_tool_result":{T.content.type==="code_execution_result"?S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("code_execution"),result:{type:T.content.type,stdout:T.content.stdout,stderr:T.content.stderr,return_code:T.content.return_code,content:(o=T.content.content)!=null?o:[]}}):T.content.type==="encrypted_code_execution_result"?S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("code_execution"),result:{type:T.content.type,encrypted_stdout:T.content.encrypted_stdout,stderr:T.content.stderr,return_code:T.content.return_code,content:(a=T.content.content)!=null?a:[]}}):T.content.type==="code_execution_tool_result_error"&&S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:T.content.error_code}});break}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName("code_execution"),result:T.content});break}case"tool_search_tool_result":{I12=E[T.tool_use_id];if(I12==null){O10=h.toCustomToolName("tool_search_tool_bm25"),M10=h.toCustomToolName("tool_search_tool_regex");O10!=="tool_search_tool_bm25"?I12="tool_search_tool_bm25":I12="tool_search_tool_regex"}T.content.type==="tool_search_tool_search_result"?S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName(I12),result:T.content.tool_references.map(function(O){return{type:O.type,toolName:O.tool_name}})}):S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:h.toCustomToolName(I12),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:T.content.error_code}});break}case"advisor_tool_result":{I13=h.toCustomToolName("advisor");T.content.type==="advisor_result"?S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:I13,result:{type:"advisor_result",text:T.content.text}}):T.content.type==="advisor_redacted_result"?S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:I13,result:{type:"advisor_redacted_result",encryptedContent:T.content.encrypted_content}}):S.push({type:"tool-result",toolCallId:T.tool_use_id,toolName:I13,isError:!0,result:{type:"advisor_tool_result_error",errorCode:T.content.error_code}});break}case"fallback":break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,{content:S,finishReason:{unified:pG({finishReason:b.stop_reason,isJsonResponseFromTool:C}),raw:(s=b.stop_reason)!=null?s:void 0},usage:Z7e({usage:b.usage}),request:{body:d},response:{id:(l=b.id)!=null?l:void 0,modelId:(c=b.model)!=null?c:void 0,headers:_,body:w},warnings:u,providerMetadata:function(){var T,I,O,M;var R=X7e(b.stop_details),$=_object_spread_props(_object_spread({usage:b.usage,stopSequence:(T=b.stop_sequence)!=null?T:null},R!=null?{stopDetails:R}:{}),{iterations:b.usage.iterations?b.usage.iterations.map(function(D){return _object_spread(_object_spread_props(_object_spread({type:D.type},D.model!=null?{model:D.model}:{}),{inputTokens:D.input_tokens,outputTokens:D.output_tokens}),D.cache_creation_input_tokens?{cacheCreationInputTokens:D.cache_creation_input_tokens}:{},D.cache_read_input_tokens?{cacheReadInputTokens:D.cache_read_input_tokens}:{})}):null,container:b.container?{expiresAt:b.container.expires_at,id:b.container.id,skills:(O=(I=b.container.skills)==null?void 0:I.map(function(D){return{type:D.type,skillId:D.skill_id,version:D.version}}))!=null?O:null}:null,contextManagement:(M=Y7e(b.context_management))!=null?M:null}),z={anthropic:$};return x&&g!=="anthropic"&&(z[g]=$),z}()}]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,_ref,i,o,a,s,l,c,d,u,p,m,_ref1,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,_M_tee,R,$,z,_10,_11,_tmp,_tmp1,_tmp2,D,_tmp3,L;return _ts_generator(this,function(_state){switch(_state.label){case 0:_11=(_10=this).getArgs;_tmp=[_object_spread({},t)];_tmp1={stream:!0};return[4,this.getBetasFromHeaders(t.headers)];case 1:return[4,_11.apply(_10,[_object_spread_props.apply(void 0,_tmp.concat([(_tmp1.userSuppliedBetas=_state.sent(),_tmp1)]))])];case 2:_ref=_state.sent(),i=_ref.args,o=_ref.warnings,a=_ref.betas,s=_ref.usesJsonResponseTool,l=_ref.toolNameMapping,c=_ref.providerOptionsName,d=_ref.usedCustomProviderKey,u=_to_consumable_array(this.extractCitationDocuments(t.prompt)),p=J7e(i.tools),m=this.buildRequestUrl(!0);_tmp2={url:m};return[4,this.getHeaders({betas:a,headers:t.headers})];case 3:return[4,zt.apply(void 0,[(_tmp2.headers=_state.sent(),_tmp2.body=this.transformRequestBody(i,a),_tmp2.failedResponseHandler=y5,_tmp2.successfulResponseHandler=Oo(S4t),_tmp2.abortSignal=t.abortSignal,_tmp2.fetch=this.config.fetch,_tmp2)])];case 4:_ref1=_state.sent(),h=_ref1.responseHeaders,g=_ref1.value,x={unified:"other",raw:void 0},v={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},y={},_={},b={},w=null,k=null,C=null,T=!1,O=this.generateId,M=g.pipeThrough(new TransformStream({start:function start(D){D.enqueue({type:"stream-start",warnings:o})},transform:function transform(D,L){var ee,pe,N,U,G,K,me,V,ie,re,de,xe,Y;if(t.includeRawChunks&&L.enqueue({type:"raw",rawValue:D.rawValue}),!D.success){L.enqueue({type:"error",error:D.error});return}var oe=D.value;switch(oe.type){case"ping":return;case"content_block_start":{var H=oe.content_block,J=H.type;if(J==="fallback")return;switch(I=J,J){case"text":{if(s)return;y[oe.index]={type:"text",citations:[]},L.enqueue({type:"text-start",id:String(oe.index)});return}case"thinking":{y[oe.index]={type:"reasoning"},L.enqueue({type:"reasoning-start",id:String(oe.index)});return}case"redacted_thinking":{y[oe.index]={type:"reasoning"},L.enqueue({type:"reasoning-start",id:String(oe.index),providerMetadata:{anthropic:{redactedData:H.data}}});return}case"compaction":{y[oe.index]={type:"text",citations:[]},L.enqueue({type:"text-start",id:String(oe.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(s&&H.name==="json")T=!0,y[oe.index]={type:"text",citations:[]},L.enqueue({type:"text-start",id:String(oe.index)});else{var Q=H.caller,Fe=Q?{type:Q.type,toolId:"tool_id"in Q?Q.tool_id:void 0}:void 0,pt=H.input&&Object.keys(H.input).length>0?JSON.stringify(H.input):"";y[oe.index]=_object_spread({type:"tool-call",toolCallId:H.id,toolName:H.name,input:pt,firstDelta:pt.length===0},Fe&&{caller:Fe}),L.enqueue({type:"tool-input-start",id:H.id,toolName:H.name})}return}case"server_tool_use":{if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(H.name)){var j=H.name==="text_editor_code_execution"||H.name==="bash_code_execution"?"code_execution":H.name,Q5=H.name==="text_editor_code_execution"||H.name==="bash_code_execution"?H.name:H.name==="code_execution"?"programmatic-tool-call":void 0,Fe1=l.toCustomToolName(j),it=H.input!=null&&_type_of(H.input)=="object"&&Object.keys(H.input).length>0?JSON.stringify(H.input):"";y[oe.index]=_object_spread_props(_object_spread({type:"tool-call",toolCallId:H.id,toolName:Fe1,input:it,providerExecuted:!0},p&&j==="code_execution"?{dynamic:!0}:{}),{firstDelta:it.length===0,providerToolName:j,providerToolInputType:Q5}),L.enqueue(_object_spread({type:"tool-input-start",id:H.id,toolName:Fe1,providerExecuted:!0},p&&j==="code_execution"?{dynamic:!0}:{}))}else if(H.name==="tool_search_tool_regex"||H.name==="tool_search_tool_bm25"){b[H.id]=H.name;var j1=l.toCustomToolName(H.name);y[oe.index]={type:"tool-call",toolCallId:H.id,toolName:j1,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:H.name},L.enqueue({type:"tool-input-start",id:H.id,toolName:j1,providerExecuted:!0})}else if(H.name==="advisor"){var j10=l.toCustomToolName("advisor");y[oe.index]={type:"tool-call",toolCallId:H.id,toolName:j10,input:"{}",providerExecuted:!0,firstDelta:!0,providerToolName:H.name},L.enqueue({type:"tool-input-start",id:H.id,toolName:j10,providerExecuted:!0})}return}case"web_fetch_tool_result":{H.content.type==="web_fetch_result"?(u.push({title:(ee=H.content.content.title)!=null?ee:H.content.url,mediaType:H.content.content.source.media_type}),L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:H.content.url,retrievedAt:H.content.retrieved_at,content:{type:H.content.content.type,title:H.content.content.title,citations:H.content.content.citations,source:{type:H.content.content.source.type,mediaType:H.content.content.source.media_type,data:H.content.content.source.data}}}})):H.content.type==="web_fetch_tool_result_error"&&L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:H.content.error_code}});return}case"web_search_tool_result":{if(Array.isArray(H.content)){L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("web_search"),result:H.content.map(function(j){var Q;return{url:j.url,title:j.title,pageAge:(Q=j.page_age)!=null?Q:null,encryptedContent:j.encrypted_content,type:j.type}})});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=H.content[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var j11=_step.value;L.enqueue({type:"source",sourceType:"url",id:O(),url:j11.url,title:j11.title,providerMetadata:{anthropic:{pageAge:(pe=j11.page_age)!=null?pe:null}}})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:H.content.error_code}});return}case"code_execution_tool_result":{H.content.type==="code_execution_result"?L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("code_execution"),result:{type:H.content.type,stdout:H.content.stdout,stderr:H.content.stderr,return_code:H.content.return_code,content:(N=H.content.content)!=null?N:[]}}):H.content.type==="encrypted_code_execution_result"?L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("code_execution"),result:{type:H.content.type,encrypted_stdout:H.content.encrypted_stdout,stderr:H.content.stderr,return_code:H.content.return_code,content:(U=H.content.content)!=null?U:[]}}):H.content.type==="code_execution_tool_result_error"&&L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:H.content.error_code}});return}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName("code_execution"),result:H.content});return}case"tool_search_tool_result":{var j12=b[H.tool_use_id];if(j12==null){var Q10=l.toCustomToolName("tool_search_tool_bm25"),Fe2=l.toCustomToolName("tool_search_tool_regex");Q10!=="tool_search_tool_bm25"?j12="tool_search_tool_bm25":j12="tool_search_tool_regex"}H.content.type==="tool_search_tool_search_result"?L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName(j12),result:H.content.tool_references.map(function(Q){return{type:Q.type,toolName:Q.tool_name}})}):L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:l.toCustomToolName(j12),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:H.content.error_code}});return}case"advisor_tool_result":{var j13=l.toCustomToolName("advisor");H.content.type==="advisor_result"?L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:j13,result:{type:"advisor_result",text:H.content.text}}):H.content.type==="advisor_redacted_result"?L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:j13,result:{type:"advisor_redacted_result",encryptedContent:H.content.encrypted_content}}):L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:j13,isError:!0,result:{type:"advisor_tool_result_error",errorCode:H.content.error_code}});return}case"mcp_tool_use":{_[H.id]={type:"tool-call",toolCallId:H.id,toolName:H.name,input:JSON.stringify(H.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:H.server_name}}},L.enqueue(_[H.id]);return}case"mcp_tool_result":{L.enqueue({type:"tool-result",toolCallId:H.tool_use_id,toolName:_[H.tool_use_id].toolName,isError:H.is_error,result:H.content,dynamic:!0,providerMetadata:_[H.tool_use_id].providerMetadata});return}default:{var j14=J;throw new Error("Unsupported content block type: ".concat(j14))}}}case"content_block_stop":{if(y[oe.index]!=null){var H5=y[oe.index];switch(H5.type){case"text":{L.enqueue(_object_spread({type:"text-end",id:String(oe.index)},H5.citations.length>0&&{providerMetadata:{anthropic:{citations:H5.citations}}}));break}case"reasoning":{L.enqueue({type:"reasoning-end",id:String(oe.index)});break}case"tool-call":if(!(s&&H5.toolName==="json")){L.enqueue({type:"tool-input-end",id:H5.toolCallId});var j15=H5.input===""?"{}":H5.input;if(H5.providerToolName==="code_execution")try{var Q11=ll(j15);Q11!=null&&(typeof Q11==="undefined"?"undefined":_type_of(Q11))=="object"&&"code"in Q11&&!("type"in Q11)&&(j15=JSON.stringify(_object_spread({type:"programmatic-tool-call"},Q11)))}catch(Q){}L.enqueue(_object_spread({type:"tool-call",toolCallId:H5.toolCallId,toolName:H5.toolName,input:j15,providerExecuted:H5.providerExecuted},p&&H5.providerToolName==="code_execution"?{dynamic:!0}:{},H5.caller&&{providerMetadata:{anthropic:{caller:H5.caller}}}))}break}delete y[oe.index]}I=void 0;return}case"content_block_delta":{var H10=oe.delta.type;switch(H10){case"text_delta":{if(s)return;L.enqueue({type:"text-delta",id:String(oe.index),delta:oe.delta.text});return}case"thinking_delta":{L.enqueue({type:"reasoning-delta",id:String(oe.index),delta:oe.delta.thinking});return}case"signature_delta":{I==="thinking"&&L.enqueue({type:"reasoning-delta",id:String(oe.index),delta:"",providerMetadata:{anthropic:{signature:oe.delta.signature}}});return}case"compaction_delta":{oe.delta.content!=null&&L.enqueue({type:"text-delta",id:String(oe.index),delta:oe.delta.content});return}case"input_json_delta":{var J5=y[oe.index],j16=oe.delta.partial_json;if(j16.length===0)return;if(T){if((J5==null?void 0:J5.type)!=="text")return;L.enqueue({type:"text-delta",id:String(oe.index),delta:j16})}else{if((J5==null?void 0:J5.type)!=="tool-call")return;J5.firstDelta&&J5.providerToolInputType!=null&&(j16='{"type": "'.concat(J5.providerToolInputType,'",').concat(j16.substring(1))),L.enqueue({type:"tool-input-delta",id:J5.toolCallId,delta:j16}),J5.input+=j16,J5.firstDelta=!1}return}case"citations_delta":{var J10=oe.delta.citation,j17=y[oe.index];(j17==null?void 0:j17.type)==="text"&&J10.type==="web_search_result_location"&&j17.citations.push(J10);var Q12=Q7e(J10,u,O);Q12&&L.enqueue(Q12);return}default:{var J11=H10;throw new Error("Unsupported delta type: ".concat(J11))}}}case"message_start":{if(v.input_tokens=oe.message.usage.input_tokens,v.cache_read_input_tokens=(G=oe.message.usage.cache_read_input_tokens)!=null?G:0,v.cache_creation_input_tokens=(K=oe.message.usage.cache_creation_input_tokens)!=null?K:0,S=_object_spread({},oe.message.usage),oe.message.container!=null&&(C={expiresAt:oe.message.container.expires_at,id:oe.message.container.id,skills:null}),oe.message.stop_reason!=null&&(x={unified:pG({finishReason:oe.message.stop_reason,isJsonResponseFromTool:T}),raw:oe.message.stop_reason}),L.enqueue({type:"response-metadata",id:(me=oe.message.id)!=null?me:void 0,modelId:(V=oe.message.model)!=null?V:void 0}),oe.message.content!=null)for(var H11=0;H11<oe.message.content.length;H11++){var J12=oe.message.content[H11];if(J12.type==="tool_use"){var j18=J12.caller,Q13=j18?{type:j18.type,toolId:"tool_id"in j18?j18.tool_id:void 0}:void 0;L.enqueue({type:"tool-input-start",id:J12.id,toolName:J12.name});var Fe3=JSON.stringify((ie=J12.input)!=null?ie:{});L.enqueue({type:"tool-input-delta",id:J12.id,delta:Fe3}),L.enqueue({type:"tool-input-end",id:J12.id}),L.enqueue(_object_spread({type:"tool-call",toolCallId:J12.id,toolName:J12.name,input:Fe3},Q13&&{providerMetadata:{anthropic:{caller:Q13}}}))}}return}case"message_delta":{oe.usage.input_tokens!=null&&v.input_tokens!==oe.usage.input_tokens&&(v.input_tokens=oe.usage.input_tokens),v.output_tokens=oe.usage.output_tokens,oe.usage.output_tokens_details!=null&&(v.output_tokens_details=oe.usage.output_tokens_details),oe.usage.cache_read_input_tokens!=null&&(v.cache_read_input_tokens=oe.usage.cache_read_input_tokens),oe.usage.cache_creation_input_tokens!=null&&(v.cache_creation_input_tokens=oe.usage.cache_creation_input_tokens),oe.usage.iterations!=null&&(v.iterations=oe.usage.iterations),x={unified:pG({finishReason:oe.delta.stop_reason,isJsonResponseFromTool:T}),raw:(re=oe.delta.stop_reason)!=null?re:void 0},k=(de=oe.delta.stop_sequence)!=null?de:null,E=X7e(oe.delta.stop_details),C=oe.delta.container!=null?{expiresAt:oe.delta.container.expires_at,id:oe.delta.container.id,skills:(Y=(xe=oe.delta.container.skills)==null?void 0:xe.map(function(H){return{type:H.type,skillId:H.skill_id,version:H.version}}))!=null?Y:null}:null,oe.context_management&&(w=Y7e(oe.context_management)),S=_object_spread({},S,oe.usage);return}case"message_stop":{var H12=_object_spread_props(_object_spread({usage:S!=null?S:null,stopSequence:k},E!=null?{stopDetails:E}:{}),{iterations:v.iterations?v.iterations.map(function(j){return _object_spread(_object_spread_props(_object_spread({type:j.type},j.model!=null?{model:j.model}:{}),{inputTokens:j.input_tokens,outputTokens:j.output_tokens}),j.cache_creation_input_tokens?{cacheCreationInputTokens:j.cache_creation_input_tokens}:{},j.cache_read_input_tokens?{cacheReadInputTokens:j.cache_read_input_tokens}:{})}):null,container:C,contextManagement:w}),J13={anthropic:H12};d&&c!=="anthropic"&&(J13[c]=H12),L.enqueue({type:"finish",finishReason:x,usage:Z7e({usage:v,rawUsage:S}),providerMetadata:J13});return}case"error":{L.enqueue({type:"error",error:oe.error});return}default:{var H13=oe;throw new Error("Unsupported chunk type: ".concat(H13))}}}})),_M_tee=_sliced_to_array(M.tee(),2),R=_M_tee[0],$=_M_tee[1],z=R.getReader();_state.label=5;case 5:_state.trys.push([5,,10,11]);return[4,z.read()];case 6:_state.sent();return[4,z.read()];case 7:D=_state.sent();_tmp3=((r=D.value)==null?void 0:r.type)==="raw";if(!_tmp3)return[3,9];return[4,z.read()];case 8:_tmp3=D=_state.sent();_state.label=9;case 9:if(_tmp3,((n=D.value)==null?void 0:n.type)==="error"){L=D.value.error;throw new Rr({message:L.message,url:m,requestBodyValues:i,statusCode:L.type==="overloaded_error"?529:500,responseHeaders:h,responseBody:JSON.stringify(L),isRetryable:L.type==="overloaded_error"})}return[3,11];case 10:z.cancel().catch(function(){}),z.releaseLock();return[7];case 11:return[2,{stream:$,request:{body:i},response:{headers:h}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new p8e(t.modelId,t.config)}}]);return p8e}();function k3t(e){return e.includes("claude-opus-5")?{maxOutputTokens:128e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,isKnownModel:!0}:e.includes("claude-opus-4-8")||e.includes("claude-opus-4-7")||e.includes("claude-fable-5")||e.includes("claude-sonnet-5")?{maxOutputTokens:128e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-sonnet-4-6")||e.includes("claude-opus-4-6")?{maxOutputTokens:128e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-sonnet-4-5")||e.includes("claude-opus-4-5")||e.includes("claude-haiku-4-5")?{maxOutputTokens:64e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-opus-4-1")?{maxOutputTokens:32e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-sonnet-4-")?{maxOutputTokens:64e3,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-opus-4-")?{maxOutputTokens:32e3,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:e.includes("claude-3-haiku")?{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!0}:/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(e)?{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!1}:e.includes("claude-")?{maxOutputTokens:128e3,supportsStructuredOutput:!0,supportsAdaptiveThinking:!0,rejectsSamplingParameters:!0,supportsXhighEffort:!0,rejectsThinkingDisabledAboveHighEffort:!0,isKnownModel:!1}:{maxOutputTokens:4096,supportsStructuredOutput:!1,supportsAdaptiveThinking:!1,rejectsSamplingParameters:!1,supportsXhighEffort:!1,rejectsThinkingDisabledAboveHighEffort:!1,isKnownModel:!1}}function J7e(e){if(!e)return!1;var t=!1,r=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if("type"in n&&(n.type==="web_fetch_20260209"||n.type==="web_search_20260209")){t=!0;continue}if(n.name==="code_execution"){r=!0;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t&&!r}function C3t(param){var e=param.reasoning,t=param.supportsAdaptiveThinking,r=param.supportsXhighEffort,n=param.maxOutputTokensForModel,i=param.warnings;if(!Oc(e))return;if(e==="none")return{thinking:{type:"disabled"}};if(t){var a=uT({reasoning:e,effortMap:{minimal:"low",low:"low",medium:"medium",high:"high",xhigh:r?"xhigh":"max"},warnings:i});return{thinking:{type:"adaptive"},effort:a}}var o=cT({reasoning:e,maxOutputTokens:n,maxReasoningBudget:n,warnings:i});if(o!=null)return{thinking:{type:"enabled",budgetTokens:o}}}function Y7e(e){return e?{appliedEdits:e.applied_edits.map(function(t){switch(t.type){case"clear_tool_uses_20250919":return{type:t.type,clearedToolUses:t.cleared_tool_uses,clearedInputTokens:t.cleared_input_tokens};case"clear_thinking_20251015":return{type:t.type,clearedThinkingTurns:t.cleared_thinking_turns,clearedInputTokens:t.cleared_input_tokens};case"compact_20260112":return{type:t.type}}}).filter(function(t){return t!==void 0})}:null}function X7e(e){if(e!=null)return _object_spread({type:e.type},e.category!=null?{category:e.category}:{},e.explanation!=null?{explanation:e.explanation}:{},e.recommended_model!=null?{recommendedModel:e.recommended_model}:{})}var E3t=ne(function(){return te(f.object({command:f.string(),restart:f.boolean().optional()}))}),e8e=Yi({id:"anthropic.bash_20241022",inputSchema:E3t});function T3t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=e.execute,r=_object_without_properties(e,["execute"]);return e8e(t===void 0?_object_spread_props(_object_spread({},r),{execute:function(param,param1){var n=param.command,i=param1.abortSignal,o=param1.experimental_sandbox;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!o)throw new Error("Sandbox session is not available");return[4,o.run({command:n,abortSignal:i})];case 1:return[2,_state.sent()]}})})()}}):_object_spread({},r,t===null?{}:{execute:t}))}var A3t=ne(function(){return te(f.object({command:f.string(),restart:f.boolean().optional()}))}),t8e=Yi({id:"anthropic.bash_20250124",inputSchema:A3t});function I3t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=e.execute,r=_object_without_properties(e,["execute"]);return t8e(t===void 0?_object_spread_props(_object_spread({},r),{execute:function(param,param1){var n=param.command,i=param1.abortSignal,o=param1.experimental_sandbox;return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!o)throw new Error("Sandbox session is not available");return[4,o.run({command:n,abortSignal:i})];case 1:return[2,_state.sent()]}})})()}}):_object_spread({},r,t===null?{}:{execute:t}))}var P3t=ne(function(){return te(f.object({action:f.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:f.array(f.number().int()).optional(),text:f.string().optional()}))}),R3t=Yi({id:"anthropic.computer_20241022",inputSchema:P3t}),M3t=ne(function(){return te(f.object({action:f.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:f.tuple([f.number().int(),f.number().int()]).optional(),duration:f.number().optional(),scroll_amount:f.number().optional(),scroll_direction:f.enum(["up","down","left","right"]).optional(),start_coordinate:f.tuple([f.number().int(),f.number().int()]).optional(),text:f.string().optional()}))}),O3t=Yi({id:"anthropic.computer_20250124",inputSchema:M3t}),$3t=ne(function(){return te(f.object({action:f.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:f.tuple([f.number().int(),f.number().int()]).optional(),duration:f.number().optional(),region:f.tuple([f.number().int(),f.number().int(),f.number().int(),f.number().int()]).optional(),scroll_amount:f.number().optional(),scroll_direction:f.enum(["up","down","left","right"]).optional(),start_coordinate:f.tuple([f.number().int(),f.number().int()]).optional(),text:f.string().optional()}))}),N3t=Yi({id:"anthropic.computer_20251124",inputSchema:$3t}),D3t=ne(function(){return te(f.discriminatedUnion("command",[f.object({command:f.literal("view"),path:f.string(),view_range:f.tuple([f.number(),f.number()]).optional()}),f.object({command:f.literal("create"),path:f.string(),file_text:f.string()}),f.object({command:f.literal("str_replace"),path:f.string(),old_str:f.string(),new_str:f.string()}),f.object({command:f.literal("insert"),path:f.string(),insert_line:f.number(),insert_text:f.string()}),f.object({command:f.literal("delete"),path:f.string()}),f.object({command:f.literal("rename"),old_path:f.string(),new_path:f.string()})]))}),L3t=Yi({id:"anthropic.memory_20250818",inputSchema:D3t}),F3t=ne(function(){return te(f.object({command:f.enum(["view","create","str_replace","insert","undo_edit"]),path:f.string(),file_text:f.string().optional(),insert_line:f.number().int().optional(),new_str:f.string().optional(),insert_text:f.string().optional(),old_str:f.string().optional(),view_range:f.array(f.number().int()).optional()}))}),z3t=Yi({id:"anthropic.text_editor_20241022",inputSchema:F3t}),j3t=ne(function(){return te(f.object({command:f.enum(["view","create","str_replace","insert","undo_edit"]),path:f.string(),file_text:f.string().optional(),insert_line:f.number().int().optional(),new_str:f.string().optional(),insert_text:f.string().optional(),old_str:f.string().optional(),view_range:f.array(f.number().int()).optional()}))}),U3t=Yi({id:"anthropic.text_editor_20250124",inputSchema:j3t}),B3t=ne(function(){return te(f.object({command:f.enum(["view","create","str_replace","insert"]),path:f.string(),file_text:f.string().optional(),insert_line:f.number().int().optional(),new_str:f.string().optional(),insert_text:f.string().optional(),old_str:f.string().optional(),view_range:f.array(f.number().int()).optional()}))}),q3t=Yi({id:"anthropic.text_editor_20250429",inputSchema:B3t}),W3t=ne(function(){return te(f.array(f.object({type:f.literal("tool_reference"),toolName:f.string()})))}),V3t=ne(function(){return te(f.object({query:f.string(),limit:f.number().optional()}))}),G3t=tr({id:"anthropic.tool_search_bm25_20251119",inputSchema:V3t,outputSchema:W3t,supportsDeferredResults:!0}),H3t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return G3t(e)},Z3t={advisor_20260301:P4t,bash_20241022:T3t,bash_20250124:I3t,codeExecution_20250522:r3t,codeExecution_20250825:o3t,codeExecution_20260120:l3t,computer_20241022:R3t,computer_20250124:O3t,computer_20251124:N3t,memory_20250818:L3t,textEditor_20241022:z3t,textEditor_20250124:U3t,textEditor_20250429:q3t,textEditor_20250728:$4t,webFetch_20250910:Y4t,webFetch_20260209:Z4t,webSearch_20250305:q4t,webSearch_20260209:z4t,toolSearchRegex_20251119:d3t,toolSearchBm25_20251119:H3t},K3t=ne(function(){return te(f.object({id:f.string(),display_title:f.string().nullish(),name:f.string().nullish(),description:f.string().nullish(),latest_version:f.string().nullish(),source:f.string(),created_at:f.string(),updated_at:f.string()}))}),fSr=ne(function(){return te(f.object({data:f.array(f.object({version:f.string()}))}))}),Q3t=ne(function(){return te(f.object({type:f.string(),skill_id:f.string(),name:f.string().nullish(),description:f.string().nullish()}))}),J3t=/*#__PURE__*/function(){"use strict";function J3t1(e){_class_call_check(this,J3t1);this.config=e,this.specificationVersion="v4"}_create_class(J3t1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getHeaders",value:function getHeaders(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Kt(this.config.headers)];case 1:return[2,ht.apply(void 0,[_state.sent(),{"anthropic-beta":"skills-2025-10-02"}])]}})}).call(this)}},{key:"fetchVersionMetadata",value:function fetchVersionMetadata(_01){return _async_to_generator(function(param){var e,t,r,_ref,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.skillId,t=param.version,r=param.headers;return[4,$a({url:"".concat(this.config.baseURL,"/skills/").concat(e,"/versions/").concat(t),validateUrl:!1,headers:r,failedResponseHandler:y5,successfulResponseHandler:wt(Q3t),fetch:this.config.fetch})];case 1:_ref=_state.sent(),n=_ref.value;return[2,_object_spread({},n.name!=null?{name:n.name}:{},n.description!=null?{description:n.description}:{})]}})}).apply(this,arguments)}},{key:"uploadSkill",value:function uploadSkill(e){return _async_to_generator(function(){var t,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,d,u,o,_ref,a,s,l,c,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=[],i=new FormData;e.displayTitle!=null&&i.append("display_title",e.displayTitle);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e.files[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){d=_step.value;u=Gd(d.data);i.append("files[]",new Blob([u]),d.path)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,this.getHeaders()];case 1:o=_state.sent();return[4,ul({url:"".concat(this.config.baseURL,"/skills"),headers:o,formData:i,failedResponseHandler:y5,successfulResponseHandler:wt(K3t),fetch:this.config.fetch})];case 2:_ref=_state.sent(),a=_ref.value;if(!(a.latest_version!=null))return[3,4];return[4,this.fetchVersionMetadata({skillId:a.id,version:a.latest_version,headers:o})];case 3:_tmp=_state.sent();return[3,5];case 4:_tmp={};_state.label=5;case 5:s=_tmp,l=(t=s.name)!=null?t:a.name,c=(r=s.description)!=null?r:a.description;return[2,_object_spread_props(_object_spread({providerReference:{anthropic:a.id}},a.display_title!=null?{displayTitle:a.display_title}:{},l!=null?{name:l}:{},c!=null?{description:c}:{},a.latest_version!=null?{latestVersion:a.latest_version}:{}),{providerMetadata:{anthropic:_object_spread({},a.source!=null?{source:a.source}:{},a.created_at!=null?{createdAt:a.created_at}:{},a.updated_at!=null?{updatedAt:a.updated_at}:{})},warnings:n})]}})}).call(this)}}]);return J3t1}(),Y3t="4.0.23",f8e="https://api.anthropic.com",m8e="".concat(f8e,"/v1");function X3t(e){var t=Kd(fT(e));return t===f8e?m8e:t}function mG(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,r;var n=(t=X3t(Hd({settingValue:e.baseURL,environmentVariableName:"ANTHROPIC_BASE_URL"})))!=null?t:m8e,i=(r=e.name)!=null?r:"anthropic.messages";if(e.apiKey&&e.authToken)throw new il({argument:"apiKey/authToken",message:"Both apiKey and authToken were provided. Please use only one authentication method."});var o=function(){var c=e.authToken?{Authorization:"Bearer ".concat(e.authToken)}:{"x-api-key":U2({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"})};return Bi(_object_spread({"anthropic-version":"2023-06-01"},c,e.headers),"ai-sdk/anthropic/".concat(Y3t))},a=function(c){var d;return new S3t(c,{provider:i,baseURL:n,headers:o,fetch:e.fetch,generateId:(d=e.generateId)!=null?d:Qr,supportedUrls:function(){return{"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]}}})},s=function(){return new J3t({provider:"".concat(i.replace(".messages",""),".skills"),baseURL:n,headers:o,fetch:e.fetch})},l=function _target(c){if(_instanceof(this,_target)?this.constructor:void 0)throw new Error("The Anthropic model function cannot be called with the new keyword.");return a(c)};return l.specificationVersion="v4",l.languageModel=a,l.chat=a,l.messages=a,l.embeddingModel=function(c){throw new VC({modelId:c,modelType:"embeddingModel"})},l.textEmbeddingModel=l.embeddingModel,l.imageModel=function(c){throw new VC({modelId:c,modelType:"imageModel"})},l.files=function(){return new b4t({provider:i,baseURL:n,headers:o,fetch:e.fetch})},l.skills=s,l.tools=Z3t,l}var mSr=mG();var e6t=202,t6t=502,r6t=400,n6t=409,i6t=100,o6t=201,a6t=417;var s6t=403,l6t=504,u6t=410,c6t=505,d6t=418,p6t=419,f6t=507,m6t=500,h6t=411,g6t=423,x6t=420,y6t=405,v6t=301,_6t=302,b6t=207,w6t=300,S6t=511,k6t=204,C6t=203,E6t=406,T6t=404,A6t=501,I6t=304,P6t=200,R6t=206,M6t=402,O6t=308,$6t=412,N6t=428,D6t=102,L6t=407,F6t=431,z6t=408,j6t=413,U6t=414,B6t=416,q6t=205,W6t=303,V6t=503,G6t=101,H6t=307,Z6t=429,K6t=401,Q6t=422,J6t=415,Y6t=305,h8e={ACCEPTED:e6t,BAD_GATEWAY:t6t,BAD_REQUEST:r6t,CONFLICT:n6t,CONTINUE:i6t,CREATED:o6t,EXPECTATION_FAILED:a6t,FORBIDDEN:s6t,GATEWAY_TIMEOUT:l6t,GONE:u6t,HTTP_VERSION_NOT_SUPPORTED:c6t,IM_A_TEAPOT:d6t,INSUFFICIENT_SPACE_ON_RESOURCE:p6t,INSUFFICIENT_STORAGE:f6t,INTERNAL_SERVER_ERROR:m6t,LENGTH_REQUIRED:h6t,LOCKED:g6t,METHOD_FAILURE:x6t,METHOD_NOT_ALLOWED:y6t,MOVED_PERMANENTLY:v6t,MOVED_TEMPORARILY:_6t,MULTI_STATUS:b6t,MULTIPLE_CHOICES:w6t,NETWORK_AUTHENTICATION_REQUIRED:S6t,NO_CONTENT:k6t,NON_AUTHORITATIVE_INFORMATION:C6t,NOT_ACCEPTABLE:E6t,NOT_FOUND:T6t,NOT_IMPLEMENTED:A6t,NOT_MODIFIED:I6t,OK:P6t,PARTIAL_CONTENT:R6t,PAYMENT_REQUIRED:M6t,PERMANENT_REDIRECT:O6t,PRECONDITION_FAILED:$6t,PRECONDITION_REQUIRED:N6t,PROCESSING:D6t,PROXY_AUTHENTICATION_REQUIRED:L6t,REQUEST_HEADER_FIELDS_TOO_LARGE:F6t,REQUEST_TIMEOUT:z6t,REQUEST_TOO_LONG:j6t,REQUEST_URI_TOO_LONG:U6t,REQUESTED_RANGE_NOT_SATISFIABLE:B6t,RESET_CONTENT:q6t,SEE_OTHER:W6t,SERVICE_UNAVAILABLE:V6t,SWITCHING_PROTOCOLS:G6t,TEMPORARY_REDIRECT:H6t,TOO_MANY_REQUESTS:Z6t,UNAUTHORIZED:K6t,UNPROCESSABLE_ENTITY:Q6t,UNSUPPORTED_MEDIA_TYPE:J6t,USE_PROXY:Y6t};var g8e={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",103:"Early Hints",426:"Upgrade Required",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"},x8e={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Early Hints":103,"Upgrade Required":426,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421};function kP(e){var t=g8e[e.toString()];if(!t)throw new Error("Status code does not exist: "+e);return t}function hG(e){var t=x8e[e];if(!t)throw new Error("Reason phrase does not exist: "+e);return t}var gG=kP;var CP=function CP1(){return CP=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},CP.apply(this,arguments)},CSr=CP(CP({},h8e),{getStatusCode:hG,getStatusText:gG});function Ds(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Aborted";if(typeof DOMException!="undefined")return new DOMException(e,"AbortError");var t=new Error(e);return t.name="AbortError",t}function y8e(e){return _instanceof(e,Error)&&e.name==="AbortError"}function v5(e){if(e!=null&&e.aborted)throw _instanceof(e.reason,Error)?e.reason:Ds(typeof e.reason=="string"?e.reason:void 0)}function v8e(e,t){return v5(t),t?new Promise(function(r,n){var i=function(){o(),n(_instanceof(t.reason,Error)?t.reason:Ds())},o=function(){t.removeEventListener("abort",i)};t.addEventListener("abort",i,{once:!0}),e.then(function(a){o(),r(a)},function(a){o(),n(_instanceof(a,Error)?a:new Error(String(a)))})}):e}function _8e(e){if(e){if(_instanceof(e,Headers)){var t=[];return e.forEach(function(r,n){t.push([n,r])}),Object.fromEntries(t)}return Array.isArray(e)?Object.fromEntries(e):_object_spread({},e)}}function X6t(e,t){return _async_to_generator(function(){var _tmp,_tmp1,_tmp2,_tmp3,_tmp4,_tmp5;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!_instanceof(e,Request))return[3,7];_tmp1={url:e.url,method:(t==null?void 0:t.method)||e.method,headers:_8e((t==null?void 0:t.headers)||e.headers)};if(!(t!=null&&t.body))return[3,2];return[4,new Response(t.body).arrayBuffer()];case 1:_tmp2=_state.sent();return[3,6];case 2:if(!(e.method==="GET"||e.method==="HEAD"))return[3,3];_tmp3=void 0;return[3,5];case 3:return[4,e.arrayBuffer()];case 4:_tmp3=_state.sent();_state.label=5;case 5:_tmp2=_tmp3;_state.label=6;case 6:_tmp=(_tmp1.body=_tmp2,_tmp1);return[3,11];case 7:_tmp4={url:_instanceof(e,URL)?e.toString():String(e),method:(t==null?void 0:t.method)||"GET",headers:_8e(t==null?void 0:t.headers)};if(!(t!=null&&t.body))return[3,9];return[4,new Response(t.body).arrayBuffer()];case 8:_tmp5=_state.sent();return[3,10];case 9:_tmp5=void 0;_state.label=10;case 10:_tmp=(_tmp4.body=_tmp5,_tmp4);_state.label=11;case 11:return[2,_tmp]}})})()}var zf=function(e,t){return _async_to_generator(function(){var a,r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(a=t==null?void 0:t.signal)!=null?a:void 0;v5(r);return[4,X6t(e,t)];case 1:n=_state.sent();return[4,v8e(Su({url:n.url,method:n.method,headers:n.headers,body:n.body,throw:!1}),r)];case 2:i=_state.sent();v5(r);o=kP(i.status);return[2,new Response([101,103,204,205,304].includes(i.status)?null:i.arrayBuffer,{status:i.status,statusText:o,headers:i.headers})]}})})()};function eSt(e){return _instanceof(e,TypeError)}function tSt(e){return typeof navigator!="undefined"&&navigator.onLine===!1||_instanceof(e,Error)&&e.message.includes("ERR_INTERNET_DISCONNECTED")}function rSt(e){return"obsidian://nutstore-sync/modal/provider-edit?providerId=".concat(encodeURIComponent(e))}function b8e(e){var t=e.allowBrowserCors?fetch:zf;return e.allowBrowserCors?function(r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,t(r,n)];case 1:return[2,_state.sent()];case 2:i=_state.sent();throw tSt(i)?new Error(P.t("settings.ai.errors.networkDisconnected"),{cause:i}):eSt(i)?new Error(P.t("settings.ai.errors.browserCorsFailedWithDisableLink",{link:rSt(e.id)}),{cause:i}):i;case 3:return[2]}})})()}:t}function El(e){if(!e.apiKey.trim())throw e.id===_d?new Error(P.t("settings.ai.nutstoreLlmGateway.errors.authorizationRequired")):new Error(P.t("chatbox.errors.apiKeyRequired"))}function Sp(e){return{name:e.name,baseURL:e.api,apiKey:e.apiKey,fetch:b8e(e)}}function kp(e,t){return{model:kpe({model:t,middleware:[]}),providerName:e.name}}var w8e={assertUsable:El,createLanguageModel:function createLanguageModel(e,t){El(e);var r=mG(Sp(e));return kp(e,r(t))}};var nSt="4.0.26",iSt=ne(function(){return te(f.object({error:f.object({code:f.number().nullable(),message:f.string(),status:f.string()})}))}),Tl=Vr({errorSchema:iSt,errorToMessage:function(e){return e.error.message}}),oSt=f.union([f.object({text:f.string()}),f.object({inlineData:f.object({mimeType:f.string(),data:f.string()})}),f.object({fileData:f.object({fileUri:f.string(),mimeType:f.string()})})]),aSt=ne(function(){return te(f.object({outputDimensionality:f.number().optional(),taskType:f.enum(["SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","RETRIEVAL_DOCUMENT","RETRIEVAL_QUERY","QUESTION_ANSWERING","FACT_VERIFICATION","CODE_RETRIEVAL_QUERY"]).optional(),content:f.array(f.array(oSt).min(1).nullable()).optional()}))}),sSt=/*#__PURE__*/function(){"use strict";function F8e(t,r){_class_call_check(this,F8e);this.specificationVersion="v4",this.maxEmbeddingsPerCall=100,this.supportsParallelCalls=!0,this.modelId=t,this.config=r}_create_class(F8e,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doEmbed",value:function doEmbed(_01){return _async_to_generator(function(param){var _this,t,r,n,i,o,a,s,_tmp,u,p,m,_ref,h,g,x,_ref1,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;t=param.values,r=param.headers,n=param.abortSignal,i=param.providerOptions;return[4,$t({provider:"google",providerOptions:i,schema:aSt})];case 1:o=_state.sent();if(t.length>this.maxEmbeddingsPerCall)throw new Zg({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:t});if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:a=ht.apply(void 0,[_tmp,r]),s=o==null?void 0:o.content;if(s!=null&&s.length!==t.length)throw new Error("The number of multimodal content entries (".concat(s.length,") must match the number of values (").concat(t.length,")."));if(!(t.length===1))return[3,6];u=s==null?void 0:s[0],p=t[0]?[{text:t[0]}]:[],m=u!=null?_to_consumable_array(p).concat(_to_consumable_array(u)):[{text:t[0]}];return[4,zt({url:"".concat(this.config.baseURL,"/models/").concat(this.modelId,":embedContent"),headers:a,body:{model:"models/".concat(this.modelId),content:{parts:m},outputDimensionality:o==null?void 0:o.outputDimensionality,taskType:o==null?void 0:o.taskType},failedResponseHandler:Tl,successfulResponseHandler:wt(uSt),abortSignal:n,fetch:this.config.fetch})];case 5:_ref=_state.sent(),h=_ref.responseHeaders,g=_ref.value,x=_ref.rawValue;return[2,{warnings:[],embeddings:[g.embedding.values],usage:void 0,response:{headers:h,body:x}}];case 6:return[4,zt({url:"".concat(this.config.baseURL,"/models/").concat(this.modelId,":batchEmbedContents"),headers:a,body:{requests:t.map(function(u,p){var m=s==null?void 0:s[p],h=u?[{text:u}]:[];return{model:"models/".concat(_this.modelId),content:{role:"user",parts:m!=null?_to_consumable_array(h).concat(_to_consumable_array(m)):[{text:u}]},outputDimensionality:o==null?void 0:o.outputDimensionality,taskType:o==null?void 0:o.taskType}})},failedResponseHandler:Tl,successfulResponseHandler:wt(lSt),abortSignal:n,fetch:this.config.fetch})];case 7:_ref1=_state.sent(),l=_ref1.responseHeaders,c=_ref1.value,d=_ref1.rawValue;return[2,{warnings:[],embeddings:c.embeddings.map(function(u){return u.values}),usage:void 0,response:{headers:l,body:d}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new F8e(t.modelId,t.config)}}]);return F8e}(),lSt=ne(function(){return te(f.object({embeddings:f.array(f.object({values:f.array(f.number())}))}))}),uSt=ne(function(){return te(f.object({embedding:f.object({values:f.array(f.number())})}))});function S8e(e){var t,r,n,i;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var o=(t=e.promptTokenCount)!=null?t:0,a=(r=e.candidatesTokenCount)!=null?r:0,s=(n=e.cachedContentTokenCount)!=null?n:0,l=(i=e.thoughtsTokenCount)!=null?i:0;return{inputTokens:{total:o,noCache:o-s,cacheRead:s,cacheWrite:void 0},outputTokens:{total:a+l,text:a,reasoning:l},raw:e}}function ac(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null)return;if(cSt(e))return t?void 0:(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e.description?{type:"object",description:e.description}:{type:"object"};if(typeof e=="boolean")return{type:"boolean",properties:{}};var r=e.type,n=e.description,i=e.required,o=e.properties,a=e.items,s=e.allOf,l=e.anyOf,c=e.oneOf,d=e.format,u=e.const,p=e.minLength,m=e.enum,h={};if(n&&(h.description=n),i&&(h.required=i),d&&(h.format=d),u!==void 0&&(h.enum=[u]),r)if(Array.isArray(r)){var g=r.includes("null"),x=r.filter(function(v){return v!=="null"});x.length===0?h.type="null":(h.anyOf=x.map(function(v){return{type:v}}),g&&(h.nullable=!0))}else h.type=r;if(m!==void 0&&(h.enum=m),o!=null&&(h.properties=Object.entries(o).reduce(function(g,param){var _param=_sliced_to_array(param,2),x=_param[0],v=_param[1];return g[x]=ac(v,!1),g},{})),a&&(h.items=Array.isArray(a)?a.map(function(g){return ac(g,!1)}):ac(a,!1)),s&&(h.allOf=s.map(function(g){return ac(g,!1)})),l)if(l.some(function(g){return(typeof g==="undefined"?"undefined":_type_of(g))=="object"&&(g==null?void 0:g.type)==="null"})){var g10=l.filter(function(x){return!((typeof x==="undefined"?"undefined":_type_of(x))=="object"&&(x==null?void 0:x.type)==="null")});if(g10.length===1){var x10=ac(g10[0],!1);(typeof x10==="undefined"?"undefined":_type_of(x10))=="object"&&(h.nullable=!0,Object.assign(h,x10))}else h.anyOf=g10.map(function(x){return ac(x,!1)}),h.nullable=!0}else h.anyOf=l.map(function(g){return ac(g,!1)});return c&&(h.oneOf=c.map(function(g){return ac(g,!1)})),p!==void 0&&(h.minLength=p),h}function cSt(e){return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e.type==="object"&&(e.properties==null||Object.keys(e.properties).length===0)&&!e.additionalProperties}var dSt="skip_thought_signature_validator",pSt=RegExp("^data:([^;,]+);base64,(.+)$","s");function fSt(e){var t=pSt.exec(e);if(t!=null)return{mediaType:t[1],data:t[2]}}function mSt(e){var t=fSt(e);if(t!=null)return{inlineData:{mimeType:t.mediaType,data:t.data}}}function hSt(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;var o=[],a=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;switch(s.type){case"text":{a.push(s.text);break}case"file":{if(s.data.type==="data")o.push({inlineData:{mimeType:ai({part:s}),data:Fr(s.data.data)}});else if(s.data.type==="url"){var l=mSt(s.data.url.toString());l!=null?o.push(l):a.push(JSON.stringify(s))}else a.push(JSON.stringify(s));break}default:{a.push(JSON.stringify(s));break}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}e.push({functionResponse:_object_spread(_object_spread_props(_object_spread({},i&&n!=null?{id:n}:{}),{name:t,response:{name:t,content:a.length>0?a.join("\n"):"Tool executed successfully."}}),o.length>0?{parts:o}:{})})}function gSt(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;switch(o.type){case"text":e.push({functionResponse:_object_spread_props(_object_spread({},i&&n!=null?{id:n}:{}),{name:t,response:{name:t,content:o.text}})});break;case"file":{if(o.data.type==="data"){var a=ea(o.mediaType);e.push({inlineData:{mimeType:ai({part:o}),data:Fr(o.data.data)}},{text:"Tool executed successfully and returned this ".concat(a==="image"?"image":"file"," as a response")})}else e.push({text:JSON.stringify(o)});break}default:e.push({text:JSON.stringify(o)});break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function xSt(e,t){var r,n,i,o,a,s;var l=[],c=[],d=!0,u=(r=t==null?void 0:t.isGemmaModel)!=null?r:!1,p=(n=t==null?void 0:t.isGemini3Model)!=null?n:!1,m=t==null?void 0:t.onWarning,h=(i=t==null?void 0:t.providerOptionsNames)!=null?i:["google"],g=!h.includes("google"),x=(o=t==null?void 0:t.supportsFunctionResponseParts)!=null?o:!0,v=(a=t==null?void 0:t.includeFunctionCallIds)!=null?a:!0,y=!1,_=[],b=function(S){return _.push(S),y=!0,dSt},w=function(S){var k,E,C,T,I;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var O=_step.value;var M=(k=S.providerOptions)==null?void 0:k[O];if(M!=null)return M}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return g?(E=S.providerOptions)==null?void 0:E.google:(I=(C=S.providerOptions)==null?void 0:C.googleVertex)!=null?I:(T=S.providerOptions)==null?void 0:T.vertex};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var _step_value=_step.value,S=_step_value.role,k=_step_value.content;switch(S){case"system":{if(!d)throw new or({functionality:"system messages are only supported at the beginning of the conversation"});l.push({text:k});break}case"user":{d=!1;var E=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=k[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator.next()).done);_iteratorNormalCompletion=true){var C=_step1.value;switch(C.type){case"text":{E.push({text:C.text});break}case"file":{switch(C.data.type){case"url":{E.push({fileData:{mimeType:ai({part:C}),fileUri:C.data.url.toString()}});break}case"reference":{if(g)throw new or({functionality:"file parts with provider references"});E.push({fileData:{mimeType:ai({part:C}),fileUri:ns({reference:C.data.reference,provider:"google"})}});break}case"text":{E.push({inlineData:{mimeType:qu(C.mediaType)?C.mediaType:"text/plain",data:Fr(new TextEncoder().encode(C.data.text))}});break}case"data":{E.push({inlineData:{mimeType:ai({part:C}),data:Fr(C.data.data)}});break}}break}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}c.push({role:"user",parts:E});break}case"assistant":{d=!1;var E1=!1;c.push({role:"model",parts:k.map(function(C){var T=w(C),I=(T==null?void 0:T.thoughtSignature)!=null?String(T.thoughtSignature):void 0;switch(C.type){case"text":return C.text.length===0?void 0:{text:C.text,thoughtSignature:I};case"reasoning":return C.text.length===0?void 0:{text:C.text,thought:!0,thoughtSignature:I};case"reasoning-file":{switch(C.data.type){case"url":throw new or({functionality:"File data URLs in assistant messages are not supported"});case"data":return{inlineData:{mimeType:C.mediaType,data:Fr(C.data.data)},thought:!0,thoughtSignature:I}}break}case"file":{switch(C.data.type){case"url":throw new or({functionality:"File data URLs in assistant messages are not supported"});case"reference":{if(g)throw new or({functionality:"file parts with provider references"});return _object_spread_props(_object_spread({fileData:{mimeType:C.mediaType,fileUri:ns({reference:C.data.reference,provider:"google"})}},(T==null?void 0:T.thought)===!0?{thought:!0}:{}),{thoughtSignature:I})}case"text":return _object_spread_props(_object_spread({inlineData:{mimeType:qu(C.mediaType)?C.mediaType:"text/plain",data:Fr(new TextEncoder().encode(C.data.text))}},(T==null?void 0:T.thought)===!0?{thought:!0}:{}),{thoughtSignature:I});case"data":return _object_spread_props(_object_spread({inlineData:{mimeType:C.mediaType,data:Fr(C.data.data)}},(T==null?void 0:T.thought)===!0?{thought:!0}:{}),{thoughtSignature:I})}break}case"tool-call":{var O=(T==null?void 0:T.serverToolCallId)!=null?String(T.serverToolCallId):void 0,M=(T==null?void 0:T.serverToolType)!=null?String(T.serverToolType):void 0,R=O!=null&&M!=null,$=!R&&I==null&&E1,z=I!=null?I:p&&!$?b(C.toolName):void 0;return!R&&I!=null&&(E1=!0),R?{toolCall:{toolType:M,args:typeof C.input=="string"?ll(C.input):C.input,id:O},thoughtSignature:z}:{functionCall:_object_spread_props(_object_spread({},v&&C.toolCallId!=null?{id:C.toolCallId}:{}),{name:C.toolName,args:C.input}),thoughtSignature:z}}case"tool-result":{var O1=(T==null?void 0:T.serverToolCallId)!=null?String(T.serverToolCallId):void 0,M1=(T==null?void 0:T.serverToolType)!=null?String(T.serverToolType):void 0;return O1&&M1?{toolResponse:{toolType:M1,response:C.output.type==="json"?C.output.value:{},id:O1},thoughtSignature:I}:void 0}}}).filter(function(C){return C!==void 0})});break}case"tool":{d=!1;var E10=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=k[Symbol.iterator](),_step2;!(_iteratorNormalCompletion1=(_step2=_iterator1.next()).done);_iteratorNormalCompletion1=true){var C1=_step2.value;if(C1.type==="tool-approval-response")continue;var T=w(C1),I=(T==null?void 0:T.serverToolCallId)!=null?String(T.serverToolCallId):void 0,O=(T==null?void 0:T.serverToolType)!=null?String(T.serverToolType):void 0;if(I&&O){var R=(T==null?void 0:T.thoughtSignature)!=null?String(T.thoughtSignature):void 0;if(c.length>0){var $=c[c.length-1];if($.role==="model"){$.parts.push({toolResponse:{toolType:O,response:C1.output.type==="json"?C1.output.value:{},id:I},thoughtSignature:R});continue}}}var M=C1.output;M.type==="content"?x?hSt(E10,C1.toolName,M.value,C1.toolCallId,v):gSt(E10,C1.toolName,M.value,C1.toolCallId,v):E10.push({functionResponse:_object_spread_props(_object_spread({},v&&C1.toolCallId!=null?{id:C1.toolCallId}:{}),{name:C1.toolName,response:{name:C1.toolName,content:M.type==="execution-denied"?(s=M.reason)!=null?s:"Tool call execution denied.":M.value}})})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}c.push({role:"user",parts:E10});break}}};for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(u&&l.length>0&&c.length>0&&c[0].role==="user"){var S=l.map(function(k){return k.text}).join("\n\n");c[0].parts.unshift({text:S+"\n\n"})}if(y&&m!=null){var S10=Array.from(new Set(_));m({type:"other",message:"Replayed ".concat(_.length," `functionCall` part(s) for a Gemini 3 model without a `thoughtSignature` (tools: ").concat(S10.map(function(k){return"`".concat(k,"`")}).join(", "),"). Injected the documented `skip_thought_signature_validator` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops `providerOptions.google.thoughtSignature` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.")})}return{systemInstruction:l.length>0&&!u?{parts:l}:void 0,contents:c}}function AP(e){return e.includes("/")?e:"models/".concat(e)}var k8e=ne(function(){return te(f.object({responseModalities:f.array(f.enum(["TEXT","IMAGE"])).optional(),thinkingConfig:f.object({thinkingBudget:f.number().optional(),includeThoughts:f.boolean().optional(),thinkingLevel:f.enum(["minimal","low","medium","high"]).optional()}).optional(),cachedContent:f.string().optional(),structuredOutputs:f.boolean().optional(),safetySettings:f.array(f.object({category:f.enum(["HARM_CATEGORY_UNSPECIFIED","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_CIVIC_INTEGRITY"]),threshold:f.enum(["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"])})).optional(),threshold:f.enum(["HARM_BLOCK_THRESHOLD_UNSPECIFIED","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH","BLOCK_NONE","OFF"]).optional(),audioTimestamp:f.boolean().optional(),labels:f.record(f.string(),f.string()).optional(),mediaResolution:f.enum(["MEDIA_RESOLUTION_UNSPECIFIED","MEDIA_RESOLUTION_LOW","MEDIA_RESOLUTION_MEDIUM","MEDIA_RESOLUTION_HIGH"]).optional(),imageConfig:f.object({aspectRatio:f.enum(["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9","1:8","8:1","1:4","4:1"]).optional(),imageSize:f.enum(["1K","2K","4K","512"]).optional(),personGeneration:f.enum(["PERSON_GENERATION_UNSPECIFIED","ALLOW_ALL","ALLOW_ADULT","ALLOW_NONE"]).optional(),prominentPeople:f.enum(["PROMINENT_PEOPLE_UNSPECIFIED","ALLOW_PROMINENT_PEOPLE","BLOCK_PROMINENT_PEOPLE"]).optional(),imageOutputOptions:f.object({mimeType:f.enum(["image/jpeg","image/png"]).optional(),compressionQuality:f.number().optional()}).optional()}).optional(),retrievalConfig:f.object({latLng:f.object({latitude:f.number(),longitude:f.number()}).optional()}).optional(),streamFunctionCallArguments:f.boolean().optional(),serviceTier:f.enum(["standard","flex","priority"]).optional(),sharedRequestType:f.enum(["priority","flex","standard"]).optional(),requestType:f.enum(["shared"]).optional()}))}),ySt=/(^|\/)gemini-1(?:[.-]|$)/i,vSt=/(^|\/)gemini-2(?:[.-]|$)/i,_St=/(^|\/)gemini-2\.5(?:[.-]|$)/i,bSt=/(^|\/)gemini-/i;function wSt(e){return ySt.test(e)||/(^|\/)gemini-pro(?:-vision)?$/i.test(e)||/(^|\/)gemini-robotics-er-1\.5(?:[.-]|$)/i.test(e)}function wG(e){var t=bSt.test(e),r=vSt.test(e),n=wSt(e),o=t&&!(n||r);return{supportsGemini2Tools:t&&!n||e.toLowerCase().includes("nano-banana"),supportsFileSearch:_St.test(e)||o,usesGemini3Features:o}}function SSt(param){var e=param.tools,t=param.toolChoice,r=param.modelId,tmp=param.isVertexProvider,n=tmp===void 0?!1:tmp;var i,o;e=e!=null&&e.length?e:void 0;var a=[],_wG=wG(r),s=_wG.supportsGemini2Tools,l=_wG.supportsFileSearch,c=_wG.usesGemini3Features;if(e==null)return{tools:void 0,toolConfig:void 0,toolWarnings:a};var d=e.some(function(g){return g.type==="function"}),u=e.some(function(g){return g.type==="provider"});if(d&&u&&!c&&a.push({type:"unsupported",feature:"combination of function and provider-defined tools"}),u){var g=[];if(e.filter(function(v){return v.type==="provider"}).forEach(function(v){switch(v.id){case"google.google_search":s?g.push({googleSearch:_object_spread({},v.args)}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"Google Search requires Gemini 2.0 or newer."});break;case"google.enterprise_web_search":s?g.push({enterpriseWebSearch:{}}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"Enterprise Web Search requires Gemini 2.0 or newer."});break;case"google.url_context":s?g.push({urlContext:{}}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"The URL context tool is not supported with other Gemini models than Gemini 2."});break;case"google.code_execution":s?g.push({codeExecution:{}}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"The code execution tool is not supported with other Gemini models than Gemini 2."});break;case"google.file_search":l?g.push({fileSearch:_object_spread({},v.args)}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"The file search tool is only supported with Gemini 2.5 models and Gemini 3 models."});break;case"google.vertex_rag_store":s?g.push({retrieval:{vertex_rag_store:{rag_resources:{rag_corpus:v.args.ragCorpus},similarity_top_k:v.args.topK}}}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"The RAG store tool is not supported with other Gemini models than Gemini 2."});break;case"google.google_maps":s?g.push({googleMaps:{}}):a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id),details:"The Google Maps grounding tool is not supported with Gemini models other than Gemini 2 or newer."});break;default:a.push({type:"unsupported",feature:"provider-defined tool ".concat(v.id)});break}}),d&&c&&g.length>0){var v=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _=_step.value;_.type==="function"&&v.push({name:_.name,description:(i=_.description)!=null?i:"",parameters:ac(_.inputSchema)})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var y=_object_spread({functionCallingConfig:{mode:"VALIDATED"}},!n&&{includeServerSideToolInvocations:!0});if(t!=null)switch(t.type){case"auto":break;case"none":y.functionCallingConfig={mode:"NONE"};break;case"required":y.functionCallingConfig={mode:"ANY"};break;case"tool":y.functionCallingConfig={mode:"ANY",allowedFunctionNames:[t.toolName]};break}return{tools:_to_consumable_array(g).concat([{functionDeclarations:v}]),toolConfig:y,toolWarnings:a}}return{tools:g.length>0?g:void 0,toolConfig:void 0,toolWarnings:a}}var p=[],m=!1;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=e[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g10=_step1.value;switch(g10.type){case"function":p.push({name:g10.name,description:(o=g10.description)!=null?o:"",parameters:ac(g10.inputSchema)}),g10.strict===!0&&(m=!0);break;default:a.push({type:"unsupported",feature:"function tool ".concat(g10.name)});break}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(t==null)return{tools:[{functionDeclarations:p}],toolConfig:m?{functionCallingConfig:{mode:"VALIDATED"}}:void 0,toolWarnings:a};var h=t.type;switch(h){case"auto":return{tools:[{functionDeclarations:p}],toolConfig:{functionCallingConfig:{mode:m?"VALIDATED":"AUTO"}},toolWarnings:a};case"none":return{tools:[{functionDeclarations:p}],toolConfig:{functionCallingConfig:{mode:"NONE"}},toolWarnings:a};case"required":return{tools:[{functionDeclarations:p}],toolConfig:{functionCallingConfig:{mode:m?"VALIDATED":"ANY"}},toolWarnings:a};case"tool":return{tools:[{functionDeclarations:p}],toolConfig:{functionCallingConfig:{mode:m?"VALIDATED":"ANY",allowedFunctionNames:[t.toolName]}},toolWarnings:a};default:{var g11=h;throw new or({functionality:"tool choice type: ".concat(g11)})}}}var kSt=/*#__PURE__*/function(){"use strict";function kSt1(){_class_call_check(this,kSt1);this.accumulatedArgs={},this.jsonText="",this.pathStack=[],this.stringOpen=!1}_create_class(kSt1,[{key:"processPartialArgs",value:function processPartialArgs(e){var t="";var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=r.jsonPath.replace(/^\$\./,"");if(!n)continue;var i=CSt(n),o=TSt(this.accumulatedArgs,i);if(r.stringValue!=null&&o!==void 0){var l=JSON.stringify(r.stringValue).slice(1,-1);E8e(this.accumulatedArgs,i,o+r.stringValue),t+=l;continue}var s=ASt(r);s!=null&&(E8e(this.accumulatedArgs,i,s.value),t+=this.emitNavigationTo(i,r,s.json))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return this.jsonText+=t,{currentJSON:this.accumulatedArgs,textDelta:t}}},{key:"finalize",value:function finalize(){var e=JSON.stringify(this.accumulatedArgs),t=e.slice(this.jsonText.length);return{finalJSON:e,closingDelta:t}}},{key:"ensureRoot",value:function ensureRoot(){return this.pathStack.length===0?(this.pathStack.push({segment:"",isArray:!1,childCount:0}),"{"):""}},{key:"emitNavigationTo",value:function emitNavigationTo(e,t,r){var n="";this.stringOpen&&(n+='"',this.stringOpen=!1),n+=this.ensureRoot();var i=e.slice(0,-1),o=e[e.length-1],a=this.findCommonStackDepth(i);return n+=this.closeDownTo(a),n+=this.openDownTo(i,o),n+=this.emitLeaf(o,t,r),n}},{key:"findCommonStackDepth",value:function findCommonStackDepth(e){var t=Math.min(this.pathStack.length-1,e.length),r=0;for(var n=0;n<t&&this.pathStack[n+1].segment===e[n];n++)r++;return r+1}},{key:"closeDownTo",value:function closeDownTo(e){var t="";for(;this.pathStack.length>e;){var r=this.pathStack.pop();t+=r.isArray?"]":"}"}return t}},{key:"openDownTo",value:function openDownTo(e,t){var r="",n=this.pathStack.length-1;for(var i=n;i<e.length;i++){var o=e[i],a=this.pathStack[this.pathStack.length-1];a.childCount>0&&(r+=","),a.childCount++,typeof o=="string"&&(r+="".concat(JSON.stringify(o),":"));var l=typeof(i+1<e.length?e[i+1]:t)=="number";r+=l?"[":"{",this.pathStack.push({segment:o,isArray:l,childCount:0})}return r}},{key:"emitLeaf",value:function emitLeaf(e,t,r){var n="",i=this.pathStack[this.pathStack.length-1];return i.childCount>0&&(n+=","),i.childCount++,typeof e=="string"&&(n+="".concat(JSON.stringify(e),":")),t.stringValue!=null&&t.willContinue?(n+=r.slice(0,-1),this.stringOpen=!0):n+=r,n}}]);return kSt1}();function CSt(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.split(".")[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=r.indexOf("[");if(n===-1)t.push(r);else{n>0&&t.push(r.slice(0,n));var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=r.matchAll(/\[(\d+)\]/g)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var i=_step1.value;t.push(parseInt(i[1],10))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var ESt=Object.prototype.hasOwnProperty;function z8e(e,t){return ESt.call(e,t)}function C8e(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function TSt(e,t){var r=e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(r==null||(typeof r==="undefined"?"undefined":_type_of(r))!="object")return;var i=r;if(!z8e(i,n))return;r=i[n]}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function E8e(e,t,r){var n=e;for(var i=0;i<t.length-1;i++){var o=t[i],a=t[i+1];(!z8e(n,o)||n[o]==null)&&C8e(n,o,typeof a=="number"?[]:{}),n=n[o]}C8e(n,t[t.length-1],r)}function ASt(e){var t,r;var n=(r=(t=e.stringValue)!=null?t:e.numberValue)!=null?r:e.boolValue;if(n!=null)return{value:n,json:JSON.stringify(n)};if("nullValue"in e)return{value:null,json:"null"}}function T8e(param){var e=param.finishReason,t=param.hasToolCalls;switch(e){case"STOP":return t?"tool-calls":"stop";case"MAX_TOKENS":return"length";case"IMAGE_SAFETY":case"RECITATION":case"SAFETY":case"BLOCKLIST":case"PROHIBITED_CONTENT":case"SPII":return"content-filter";case"MALFORMED_FUNCTION_CALL":return"error";case"FINISH_REASON_UNSPECIFIED":case"OTHER":default:return"other"}}var ISt=["HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_DANGEROUS_CONTENT","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_SEXUALLY_EXPLICIT"],j8e=/*#__PURE__*/function(){"use strict";function U8e(t,r){_class_call_check(this,U8e);this.specificationVersion="v4";var n;this.modelId=t,this.config=r,this.generateId=(n=r.generateId)!=null?n:Qr}_create_class(U8e,[{key:"provider",get:function get1(){return this.config.provider}},{key:"supportedUrls",get:function get1(){var t,r,n;return(n=(r=(t=this.config).supportedUrls)==null?void 0:r.call(t))!=null?n:{}}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,_ref,tmp,g,x,v,y,_,b,w,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,G,err,_tmp,S,k,E,C,G5,K,me,V,ie,T,_wG,I,_xSt,O,M,_SSt,R,$,z,D,L,ee,pe,N,U;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.maxOutputTokens,n=param.temperature,i=param.topP,o=param.topK,a=param.frequencyPenalty,s=param.presencePenalty,l=param.stopSequences,c=param.responseFormat,d=param.seed,u=param.tools,p=param.toolChoice,m=param.reasoning,h=param.providerOptions,_ref=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{},tmp=_ref.isStreaming,g=tmp===void 0?!1:tmp;_=[],b=this.config.provider.includes("vertex")?["googleVertex","vertex"]:["google"];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=b[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];G=_step.value;return[4,$t({provider:G,providerOptions:h,schema:k8e})];case 3:if(w=_state.sent(),w!=null)return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:_tmp=w==null&&!b.includes("google");if(!_tmp)return[3,10];return[4,$t({provider:"google",providerOptions:h,schema:k8e})];case 9:_tmp=w=_state.sent();_state.label=10;case 10:_tmp;S=this.config.provider.startsWith("google.vertex.");u!=null&&u.some(function(G){return G.type==="provider"&&G.id==="google.vertex_rag_store"})&&!S&&_.push({type:"other",message:"The 'vertex_rag_store' tool is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (".concat(this.config.provider,").")}),w!=null&&w.streamFunctionCallArguments&&!S&&_.push({type:"other",message:"'streamFunctionCallArguments' is only supported on the Vertex AI API and will be ignored with the current Google provider (".concat(this.config.provider,"). See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc")}),w!=null&&w.serviceTier&&S&&_.push({type:"other",message:"'serviceTier' is a Gemini API option and is not supported on Vertex AI. Use 'sharedRequestType' (and optionally 'requestType') instead. See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo"}),(w!=null&&w.sharedRequestType||w!=null&&w.requestType)&&!S&&_.push({type:"other",message:"'sharedRequestType' and 'requestType' are Vertex AI options and are ignored with the current Google provider (".concat(this.config.provider,").")});k=S&&(w!=null&&w.sharedRequestType||w!=null&&w.requestType)?_object_spread({},w.sharedRequestType&&{"X-Vertex-AI-LLM-Shared-Request-Type":w.sharedRequestType},w.requestType&&{"X-Vertex-AI-LLM-Request-Type":w.requestType}):void 0,E=S||w==null?void 0:w.serviceTier,C=w==null?void 0:w.imageConfig;if(C!=null&&!S){G5=C.personGeneration,K=C.prominentPeople,me=C.imageOutputOptions,V=_object_without_properties(C,["personGeneration","prominentPeople","imageOutputOptions"]),ie=Object.entries({personGeneration:G5,prominentPeople:K,imageOutputOptions:me}).filter(function(param){var _param=_sliced_to_array(param,2),re=_param[1];return re!=null}).map(function(param){var _param=_sliced_to_array(param,1),re=_param[0];return"'imageConfig.".concat(re,"'")});ie.length>0&&(_.push({type:"other",message:"".concat(ie.join(", ")," ").concat(ie.length===1?"is a Vertex AI option and is":"are Vertex AI options and are"," ignored with the current Google provider (").concat(this.config.provider,").")}),C=V)}T=this.modelId.toLowerCase().startsWith("gemma-"),_wG=wG(this.modelId),I=_wG.usesGemini3Features,_xSt=xSt(t,{isGemmaModel:T,isGemini3Model:I,onWarning:function(G){return _.push(G)},providerOptionsNames:b,supportsFunctionResponseParts:I,includeFunctionCallIds:!S}),O=_xSt.contents,M=_xSt.systemInstruction,_SSt=SSt({tools:u,toolChoice:p,modelId:this.modelId,isVertexProvider:S}),R=_SSt.tools,$=_SSt.toolConfig,z=_SSt.toolWarnings,D=MSt({reasoning:m,modelId:this.modelId,warnings:_}),L=w!=null&&w.thinkingConfig||D?_object_spread({},D,w==null?void 0:w.thinkingConfig):void 0,ee=g&&S?(x=w==null?void 0:w.streamFunctionCallArguments)!=null?x:!1:void 0,pe=w==null?void 0:w.threshold,N=(v=w==null?void 0:w.safetySettings)!=null?v:pe!=null?ISt.map(function(G){return{category:G,threshold:pe}}):void 0,U=$||ee||w!=null&&w.retrievalConfig?_object_spread({},$,ee&&{functionCallingConfig:_object_spread_props(_object_spread({},$==null?void 0:$.functionCallingConfig),{streamFunctionCallArguments:!0})},(w==null?void 0:w.retrievalConfig)&&{retrievalConfig:w.retrievalConfig}):void 0;return[2,{args:{generationConfig:_object_spread(_object_spread_props(_object_spread({maxOutputTokens:r,temperature:n,topK:o,topP:i,frequencyPenalty:a,presencePenalty:s,stopSequences:l,seed:d,responseMimeType:(c==null?void 0:c.type)==="json"?"application/json":void 0,responseSchema:(c==null?void 0:c.type)==="json"&&c.schema!=null&&((y=w==null?void 0:w.structuredOutputs)==null||y)?ac(c.schema):void 0},(w==null?void 0:w.audioTimestamp)&&{audioTimestamp:w.audioTimestamp}),{responseModalities:w==null?void 0:w.responseModalities,thinkingConfig:L}),(w==null?void 0:w.mediaResolution)&&{mediaResolution:w.mediaResolution},C&&{imageConfig:C}),contents:O,systemInstruction:T?void 0:M,safetySettings:N,tools:R,toolConfig:U,cachedContent:w==null?void 0:w.cachedContent,labels:w==null?void 0:w.labels,serviceTier:E},warnings:_to_consumable_array(_).concat(_to_consumable_array(z)),providerOptionsNames:b,extraHeaders:k}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,_ref,w,S,k,E,C,T,_ref1,I,O,M,R,$,z,D,L,ee,_tmp,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,N,U,U1,G,U10,G5,U11,U12,pe,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,N10;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),w=_ref.args,S=_ref.warnings,k=_ref.providerOptionsNames,E=_ref.extraHeaders,C=function(N){return Object.fromEntries(k.map(function(U){return[U,N]}))};if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:T=ht.apply(void 0,[_tmp,t.headers,E]);return[4,zt({url:"".concat(this.config.baseURL,"/").concat(AP(this.modelId),":generateContent"),headers:T,body:w,failedResponseHandler:Tl,successfulResponseHandler:wt(DSt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 5:_ref1=_state.sent(),I=_ref1.responseHeaders,O=_ref1.value,M=_ref1.rawValue,R=O.candidates[0],$=[],z=(n=(r=R.content)==null?void 0:r.parts)!=null?n:[],D=O.usageMetadata;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=z[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){N=_step.value;if("executableCode"in N&&(i=N.executableCode)!=null&&i.code){U=this.config.generateId();L=U,$.push({type:"tool-call",toolCallId:U,toolName:"code_execution",input:JSON.stringify(N.executableCode),providerExecuted:!0})}else if("codeExecutionResult"in N&&N.codeExecutionResult)$.push({type:"tool-result",toolCallId:L,toolName:"code_execution",result:{outcome:N.codeExecutionResult.outcome,output:(o=N.codeExecutionResult.output)!=null?o:""}});else if("text"in N&&N.text!=null){U1=N.thoughtSignature?C({thoughtSignature:N.thoughtSignature}):void 0;if(N.text.length===0){if(U1!=null&&$.length>0){G=$[$.length-1];G.providerMetadata=U1}}else $.push({type:N.thought===!0?"reasoning":"text",text:N.text,providerMetadata:U1})}else if("functionCall"in N&&N.functionCall.name!=null)$.push({type:"tool-call",toolCallId:(a=N.functionCall.id)!=null?a:this.config.generateId(),toolName:N.functionCall.name,input:JSON.stringify((s=N.functionCall.args)!=null?s:{}),providerMetadata:N.thoughtSignature?C({thoughtSignature:N.thoughtSignature}):void 0});else if("inlineData"in N){U10=N.thought===!0,G5=!!N.thoughtSignature;$.push({type:U10?"reasoning-file":"file",data:{type:"data",data:N.inlineData.data},mediaType:N.inlineData.mimeType,providerMetadata:G5?C({thoughtSignature:N.thoughtSignature}):void 0})}else if("toolCall"in N&&N.toolCall){U11=(l=N.toolCall.id)!=null?l:this.config.generateId();ee=U11,$.push({type:"tool-call",toolCallId:U11,toolName:"server:".concat(N.toolCall.toolType),input:JSON.stringify((c=N.toolCall.args)!=null?c:{}),providerExecuted:!0,dynamic:!0,providerMetadata:N.thoughtSignature?C({thoughtSignature:N.thoughtSignature,serverToolCallId:U11,serverToolType:N.toolCall.toolType}):C({serverToolCallId:U11,serverToolType:N.toolCall.toolType})})}else if("toolResponse"in N&&N.toolResponse){U12=(d=ee!=null?ee:N.toolResponse.id)!=null?d:this.config.generateId();$.push({type:"tool-result",toolCallId:U12,toolName:"server:".concat(N.toolResponse.toolType),result:(u=N.toolResponse.response)!=null?u:{},providerMetadata:N.thoughtSignature?C({thoughtSignature:N.thoughtSignature,serverToolCallId:U12,serverToolType:N.toolResponse.toolType}):C({serverToolCallId:U12,serverToolType:N.toolResponse.toolType})}),ee=void 0}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}pe=(p=A8e({groundingMetadata:R.groundingMetadata,generateId:this.config.generateId}))!=null?p:[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=pe[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){N10=_step1.value;$.push(N10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return[2,{content:$,finishReason:{unified:T8e({finishReason:R.finishReason,hasToolCalls:$.some(function(N){return N.type==="tool-call"&&!N.providerExecuted})}),raw:(m=R.finishReason)!=null?m:void 0},usage:S8e(D),warnings:S,providerMetadata:C({promptFeedback:(h=O.promptFeedback)!=null?h:null,groundingMetadata:(g=R.groundingMetadata)!=null?g:null,urlContextMetadata:(x=R.urlContextMetadata)!=null?x:null,safetyRatings:(v=R.safetyRatings)!=null?v:null,usageMetadata:D!=null?D:null,finishMessage:(y=R.finishMessage)!=null?y:null,serviceTier:(_=D==null?void 0:D.serviceTier)!=null?_:null}),request:{body:w},response:{id:(b=O.responseId)!=null?b:void 0,headers:I,body:M}}]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var _ref,r,n,i,o,a,s,_ref1,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t,{isStreaming:!0})];case 1:_ref=_state.sent(),r=_ref.args,n=_ref.warnings,i=_ref.providerOptionsNames,o=_ref.extraHeaders,a=function(T){return Object.fromEntries(i.map(function(I){return[I,T]}))};if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:s=ht.apply(void 0,[_tmp,t.headers,o]);return[4,zt({url:"".concat(this.config.baseURL,"/").concat(AP(this.modelId),":streamGenerateContent?alt=sse"),headers:s,body:r,failedResponseHandler:Tl,successfulResponseHandler:Oo(LSt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 5:_ref1=_state.sent(),l=_ref1.responseHeaders,c=_ref1.value,d={unified:"other",raw:void 0},m=null,h=null,g=this.config.generateId,x=!1,v=!1,y=null,_=null,b=0,w=new Set,E=[],C=function(T){var I=E.pop();if(I==null)return;var _I_accumulator_finalize=I.accumulator.finalize(),O=_I_accumulator_finalize.finalJSON,M=_I_accumulator_finalize.closingDelta;M.length>0&&T.enqueue({type:"tool-input-delta",id:I.toolCallId,delta:M,providerMetadata:I.providerMetadata}),T.enqueue({type:"tool-input-end",id:I.toolCallId,providerMetadata:I.providerMetadata}),T.enqueue({type:"tool-call",toolCallId:I.toolCallId,toolName:I.toolName,input:O,providerMetadata:I.providerMetadata}),x=!0};return[2,{stream:c.pipeThrough(new TransformStream({start:function start(T){T.enqueue({type:"stream-start",warnings:n})},transform:function transform(T,I){var O,M,R,$,z,D,L,ee,pe,N,U,G,K,me,V,ie;if(t.includeRawChunks&&I.enqueue({type:"raw",rawValue:T.rawValue}),!T.success){I.enqueue({type:"error",error:T.error});return}var re=T.value;!v&&re.responseId!=null&&(v=!0,I.enqueue({type:"response-metadata",id:re.responseId}));var de=re.usageMetadata;de!=null&&(u=de);var xe=(O=re.candidates)==null?void 0:O[0];if(xe==null)return;var Y=xe.content;xe.groundingMetadata!=null&&(m=xe.groundingMetadata),xe.urlContextMetadata!=null&&(h=xe.urlContextMetadata);var oe=A8e({groundingMetadata:xe.groundingMetadata,generateId:g});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(oe!=null)try{for(var _iterator=oe[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var H=_step.value;H.sourceType==="url"&&!w.has(H.url)&&(w.add(H.url),I.enqueue(H))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(Y!=null){var H5=(M=Y.parts)!=null?M:[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=H5[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var J=_step1.value;if("executableCode"in J&&(R=J.executableCode)!=null&&R.code){var j=g();S=j,I.enqueue({type:"tool-call",toolCallId:j,toolName:"code_execution",input:JSON.stringify(J.executableCode),providerExecuted:!0})}else if("codeExecutionResult"in J&&J.codeExecutionResult){var j1=S;j1&&I.enqueue({type:"tool-result",toolCallId:j1,toolName:"code_execution",result:{outcome:J.codeExecutionResult.outcome,output:($=J.codeExecutionResult.output)!=null?$:""}})}else if("text"in J&&J.text!=null){var j10=J.thoughtSignature?a({thoughtSignature:J.thoughtSignature}):void 0;J.text.length===0?j10!=null&&y!==null&&I.enqueue({type:"text-delta",id:y,delta:"",providerMetadata:j10}):J.thought===!0?(y!==null&&(I.enqueue({type:"text-end",id:y}),y=null),_===null&&(_=String(b++),I.enqueue({type:"reasoning-start",id:_,providerMetadata:j10})),I.enqueue({type:"reasoning-delta",id:_,delta:J.text,providerMetadata:j10})):(_!==null&&(I.enqueue({type:"reasoning-end",id:_}),_=null),y===null&&(y=String(b++),I.enqueue({type:"text-start",id:y,providerMetadata:j10})),I.enqueue({type:"text-delta",id:y,delta:J.text,providerMetadata:j10}))}else if("inlineData"in J){y!==null&&(I.enqueue({type:"text-end",id:y}),y=null),_!==null&&(I.enqueue({type:"reasoning-end",id:_}),_=null);var j11=J.thought===!0,Fe=!!J.thoughtSignature?a({thoughtSignature:J.thoughtSignature}):void 0;I.enqueue({type:j11?"reasoning-file":"file",mediaType:J.inlineData.mimeType,data:{type:"data",data:J.inlineData.data},providerMetadata:Fe})}else if("toolCall"in J&&J.toolCall){var j12=(z=J.toolCall.id)!=null?z:g();k=j12;var Q=a(_object_spread_props(_object_spread({},J.thoughtSignature?{thoughtSignature:J.thoughtSignature}:{}),{serverToolCallId:j12,serverToolType:J.toolCall.toolType}));I.enqueue({type:"tool-call",toolCallId:j12,toolName:"server:".concat(J.toolCall.toolType),input:JSON.stringify((D=J.toolCall.args)!=null?D:{}),providerExecuted:!0,dynamic:!0,providerMetadata:Q})}else if("toolResponse"in J&&J.toolResponse){var j13=(L=k!=null?k:J.toolResponse.id)!=null?L:g(),Q5=a(_object_spread_props(_object_spread({},J.thoughtSignature?{thoughtSignature:J.thoughtSignature}:{}),{serverToolCallId:j13,serverToolType:J.toolResponse.toolType}));I.enqueue({type:"tool-result",toolCallId:j13,toolName:"server:".concat(J.toolResponse.toolType),result:(ee=J.toolResponse.response)!=null?ee:{},providerMetadata:Q5}),k=void 0}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=H5[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var J5=_step2.value;if(!("functionCall"in J5))continue;var j14=J5.thoughtSignature?a({thoughtSignature:J5.thoughtSignature}):void 0,Q10=J5.functionCall.partialArgs!=null||J5.functionCall.name!=null&&J5.functionCall.willContinue===!0,Fe1=J5.functionCall.name==null&&J5.functionCall.args==null&&J5.functionCall.partialArgs==null&&J5.functionCall.willContinue==null,it=J5.functionCall.name!=null&&J5.functionCall.args!=null&&J5.functionCall.partialArgs==null,pt=J5.functionCall.name!=null&&J5.functionCall.args==null&&J5.functionCall.partialArgs==null&&J5.functionCall.willContinue!==!0;if(Q10){if(J5.functionCall.name!=null){var nt=(pe=J5.functionCall.id)!=null?pe:g(),gt=new kSt;if(E.push({toolCallId:nt,toolName:J5.functionCall.name,accumulator:gt,providerMetadata:j14}),I.enqueue({type:"tool-input-start",id:nt,toolName:J5.functionCall.name,providerMetadata:j14}),J5.functionCall.partialArgs!=null){var Ie=J5.functionCall.partialArgs,_gt_processPartialArgs=gt.processPartialArgs(Ie),we=_gt_processPartialArgs.textDelta;we.length>0&&I.enqueue({type:"tool-input-delta",id:nt,delta:we,providerMetadata:j14}),J5.functionCall.willContinue!==!0&&Ie.every(function(Oe){return Oe.willContinue!==!0})&&C(I)}}else if(J5.functionCall.partialArgs!=null&&E.length>0){var nt1=E[E.length-1],gt1=J5.functionCall.partialArgs,_nt_accumulator_processPartialArgs=nt1.accumulator.processPartialArgs(gt1),Ie1=_nt_accumulator_processPartialArgs.textDelta;Ie1.length>0&&I.enqueue({type:"tool-input-delta",id:nt1.toolCallId,delta:Ie1,providerMetadata:j14}),J5.functionCall.willContinue!==!0&>1.every(function(we){return we.willContinue!==!0})&&C(I)}}else if(Fe1&&E.length>0)C(I);else if(it){var nt2=(N=J5.functionCall.id)!=null?N:g(),gt2=J5.functionCall.name,Ie2=typeof J5.functionCall.args=="string"?J5.functionCall.args:JSON.stringify((U=J5.functionCall.args)!=null?U:{});I.enqueue({type:"tool-input-start",id:nt2,toolName:gt2,providerMetadata:j14}),I.enqueue({type:"tool-input-delta",id:nt2,delta:Ie2,providerMetadata:j14}),I.enqueue({type:"tool-input-end",id:nt2,providerMetadata:j14}),I.enqueue({type:"tool-call",toolCallId:nt2,toolName:gt2,input:Ie2,providerMetadata:j14}),x=!0}else if(pt){var nt3=(G=J5.functionCall.id)!=null?G:g(),gt3=J5.functionCall.name;I.enqueue({type:"tool-input-start",id:nt3,toolName:gt3,providerMetadata:j14}),I.enqueue({type:"tool-input-end",id:nt3,providerMetadata:j14}),I.enqueue({type:"tool-call",toolCallId:nt3,toolName:gt3,input:"{}",providerMetadata:j14}),x=!0}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}xe.finishReason!=null&&(d={unified:T8e({finishReason:xe.finishReason,hasToolCalls:x}),raw:xe.finishReason},p=a({promptFeedback:(K=re.promptFeedback)!=null?K:null,groundingMetadata:m,urlContextMetadata:h,safetyRatings:(me=xe.safetyRatings)!=null?me:null,usageMetadata:de!=null?de:null,finishMessage:(V=xe.finishMessage)!=null?V:null,serviceTier:(ie=u==null?void 0:u.serviceTier)!=null?ie:null}))},flush:function flush(T){y!==null&&T.enqueue({type:"text-end",id:y}),_!==null&&T.enqueue({type:"reasoning-end",id:_}),T.enqueue({type:"finish",finishReason:d,usage:S8e(u),providerMetadata:p})}})),response:{headers:l},request:{body:r}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new U8e(t.modelId,t.config)}}]);return U8e}();function PSt(){return 65536}function RSt(e){var t=e.toLowerCase();return t.includes("2.5-pro")||t.includes("gemini-3-pro-image")?32768:24576}function MSt(param){var e=param.reasoning,t=param.modelId,r=param.warnings;if(Oc(e))return wG(t).usesGemini3Features&&!t.includes("gemini-3-pro-image")?OSt({reasoning:e,warnings:r}):$St({reasoning:e,modelId:t,warnings:r})}function OSt(param){var e=param.reasoning,t=param.warnings;if(e==="none")return{thinkingLevel:"minimal"};var r=uT({reasoning:e,effortMap:{minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"high"},warnings:t});if(r!=null)return{thinkingLevel:r}}function $St(param){var e=param.reasoning,t=param.modelId,r=param.warnings;if(e==="none")return{thinkingBudget:0};var n=cT({reasoning:e,maxOutputTokens:PSt(),maxReasoningBudget:RSt(t),minReasoningBudget:0,warnings:r});if(n!=null)return{thinkingBudget:n}}function A8e(param){var e=param.groundingMetadata,t=param.generateId;var r,n,i,o,a,s;if(!(e!=null&&e.groundingChunks))return;var l=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.groundingChunks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var c=_step.value;if(c.web!=null)l.push({type:"source",sourceType:"url",id:t(),url:c.web.uri,title:(r=c.web.title)!=null?r:void 0});else if(c.image!=null)l.push({type:"source",sourceType:"url",id:t(),url:c.image.sourceUri,title:(n=c.image.title)!=null?n:void 0});else if(c.retrievedContext!=null){var d=c.retrievedContext.uri,u=c.retrievedContext.fileSearchStore;if(d&&(d.startsWith("http://")||d.startsWith("https://")))l.push({type:"source",sourceType:"url",id:t(),url:d,title:(i=c.retrievedContext.title)!=null?i:void 0});else if(d){var p=(o=c.retrievedContext.title)!=null?o:"Unknown Document",m="application/octet-stream",h=void 0;d.endsWith(".pdf")?(m="application/pdf",h=d.split("/").pop()):d.endsWith(".txt")?(m="text/plain",h=d.split("/").pop()):d.endsWith(".docx")?(m="application/vnd.openxmlformats-officedocument.wordprocessingml.document",h=d.split("/").pop()):d.endsWith(".doc")?(m="application/msword",h=d.split("/").pop()):(d.match(/\.(md|markdown)$/)&&(m="text/markdown"),h=d.split("/").pop()),l.push({type:"source",sourceType:"document",id:t(),mediaType:m,title:p,filename:h})}else if(u){var p10=(a=c.retrievedContext.title)!=null?a:"Unknown Document";l.push({type:"source",sourceType:"document",id:t(),mediaType:"application/octet-stream",title:p10,filename:u.split("/").pop()})}}else c.maps!=null&&c.maps.uri&&l.push({type:"source",sourceType:"url",id:t(),url:c.maps.uri,title:(s=c.maps.title)!=null?s:void 0})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return l.length>0?l:void 0}var B8e=function(){return f.object({webSearchQueries:f.array(f.string()).nullish(),imageSearchQueries:f.array(f.string()).nullish(),retrievalQueries:f.array(f.string()).nullish(),searchEntryPoint:f.object({renderedContent:f.string()}).nullish(),groundingChunks:f.array(f.object({web:f.object({uri:f.string(),title:f.string().nullish()}).nullish(),image:f.object({sourceUri:f.string(),imageUri:f.string(),title:f.string().nullish(),domain:f.string().nullish()}).nullish(),retrievedContext:f.object({uri:f.string().nullish(),title:f.string().nullish(),text:f.string().nullish(),fileSearchStore:f.string().nullish()}).nullish(),maps:f.object({uri:f.string().nullish(),title:f.string().nullish(),text:f.string().nullish(),placeId:f.string().nullish()}).nullish()})).nullish(),groundingSupports:f.array(f.object({segment:f.object({startIndex:f.number().nullish(),endIndex:f.number().nullish(),text:f.string().nullish()}).nullish(),segment_text:f.string().nullish(),groundingChunkIndices:f.array(f.number()).nullish(),supportChunkIndices:f.array(f.number()).nullish(),confidenceScores:f.array(f.number()).nullish(),confidenceScore:f.array(f.number()).nullish()})).nullish(),retrievalMetadata:f.union([f.object({webDynamicRetrievalScore:f.number()}),f.object({})]).nullish()})},NSt=f.object({jsonPath:f.string(),stringValue:f.string().nullish(),numberValue:f.number().nullish(),boolValue:f.boolean().nullish(),nullValue:f.unknown().nullish(),willContinue:f.boolean().nullish()}),q8e=function(){return f.object({parts:f.array(f.union([f.object({functionCall:f.object({id:f.string().nullish(),name:f.string().nullish(),args:f.unknown().nullish(),partialArgs:f.array(NSt).nullish(),willContinue:f.boolean().nullish()}),thoughtSignature:f.string().nullish()}),f.object({inlineData:f.object({mimeType:f.string(),data:f.string()}),thought:f.boolean().nullish(),thoughtSignature:f.string().nullish()}),f.object({toolCall:f.object({toolType:f.string(),args:f.unknown().nullish(),id:f.string()}),thoughtSignature:f.string().nullish()}),f.object({toolResponse:f.object({toolType:f.string(),response:f.unknown().nullish(),id:f.string()}),thoughtSignature:f.string().nullish()}),f.object({executableCode:f.object({language:f.string(),code:f.string()}).nullish(),codeExecutionResult:f.object({outcome:f.string(),output:f.string().nullish()}).nullish(),text:f.string().nullish(),thought:f.boolean().nullish(),thoughtSignature:f.string().nullish()})])).nullish()})},IP=function(){return f.object({category:f.string().nullish(),probability:f.string().nullish(),probabilityScore:f.number().nullish(),severity:f.string().nullish(),severityScore:f.number().nullish(),blocked:f.boolean().nullish()})},I8e=f.array(f.object({modality:f.string(),tokenCount:f.number()})).nullish(),W8e=f.object({cachedContentTokenCount:f.number().nullish(),thoughtsTokenCount:f.number().nullish(),promptTokenCount:f.number().nullish(),candidatesTokenCount:f.number().nullish(),totalTokenCount:f.number().nullish(),trafficType:f.string().nullish(),serviceTier:f.string().nullish(),promptTokensDetails:I8e,candidatesTokensDetails:I8e}),V8e=function(){return f.object({urlMetadata:f.array(f.object({retrievedUrl:f.string(),urlRetrievalStatus:f.string()})).nullish()})},DSt=ne(function(){return te(f.object({responseId:f.string().nullish(),candidates:f.array(f.object({content:q8e().nullish().or(f.object({}).strict()),finishReason:f.string().nullish(),finishMessage:f.string().nullish(),safetyRatings:f.array(IP()).nullish(),groundingMetadata:B8e().nullish(),urlContextMetadata:V8e().nullish()})),usageMetadata:W8e.nullish(),promptFeedback:f.object({blockReason:f.string().nullish(),safetyRatings:f.array(IP()).nullish()}).nullish()}))}),LSt=ne(function(){return te(f.object({responseId:f.string().nullish(),candidates:f.array(f.object({content:q8e().nullish(),finishReason:f.string().nullish(),finishMessage:f.string().nullish(),safetyRatings:f.array(IP()).nullish(),groundingMetadata:B8e().nullish(),urlContextMetadata:V8e().nullish()})).nullish(),usageMetadata:W8e.nullish(),promptFeedback:f.object({blockReason:f.string().nullish(),safetyRatings:f.array(IP()).nullish()}).nullish()}))}),FSt=tr({id:"google.code_execution",inputSchema:f.object({language:f.string().describe("The programming language of the code."),code:f.string().describe("The code to be executed.")}),outputSchema:f.object({outcome:f.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),output:f.string().describe("The output from the code execution.")})}),zSt=tr({id:"google.enterprise_web_search",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),h5r=f.looseObject({fileSearchStoreNames:f.array(f.string()).describe("The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"),topK:f.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),metadataFilter:f.string().describe("Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.").optional()}),jSt=tr({id:"google.file_search",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),USt=tr({id:"google.google_maps",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),BSt=f.looseObject({searchTypes:f.object({webSearch:f.object({}).optional(),imageSearch:f.object({}).optional()}).optional(),timeRangeFilter:f.object({startTime:f.string(),endTime:f.string()}).optional()}),qSt=tr({id:"google.google_search",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),WSt=tr({id:"google.url_context",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),VSt=tr({id:"google.vertex_rag_store",inputSchema:ne(function(){return te(f.object({}))}),outputSchema:ne(function(){return te(f.object({}))})}),GSt={googleSearch:qSt,enterpriseWebSearch:zSt,googleMaps:USt,urlContext:WSt,fileSearch:jSt,codeExecution:FSt,vertexRagStore:VSt},P8e=ne(function(){return te(f.object({personGeneration:f.enum(["dont_allow","allow_adult","allow_all"]).nullish(),aspectRatio:f.enum(["1:1","3:4","4:3","9:16","16:9"]).nullish(),googleSearch:BSt.optional()}))}),HSt=/*#__PURE__*/function(){"use strict";function G8e(t,r,n){_class_call_check(this,G8e);this.modelId=t,this.settings=r,this.config=n,this.specificationVersion="v4"}_create_class(G8e,[{key:"maxImagesPerCall",get:function get1(){return this.settings.maxImagesPerCall!=null?this.settings.maxImagesPerCall:R8e(this.modelId)?10:4}},{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,R8e(this.modelId)?this.doGenerateGemini(t):this.doGenerateImagen(t)]})}).call(this)}},{key:"doGenerateImagen",value:function doGenerateImagen(t){return _async_to_generator(function(){var r,n,i,o,tmp,a,s,tmp1,l,c,d,u,p,m,h,g,x,v,y,S,k,_,_ref,b,w,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=t.prompt,tmp=t.n,a=tmp===void 0?1:tmp,s=t.size,tmp1=t.aspectRatio,l=tmp1===void 0?"1:1":tmp1,c=t.seed,d=t.providerOptions,u=t.headers,p=t.abortSignal,m=t.files,h=t.mask,g=[];if(m!=null&&m.length>0)throw new Error("Google Gemini API does not support image editing with Imagen models. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.");if(h!=null)throw new Error("Google Gemini API does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.");s!=null&&g.push({type:"unsupported",feature:"size",details:"This model does not support the `size` option. Use `aspectRatio` instead."}),c!=null&&g.push({type:"unsupported",feature:"seed",details:"This model does not support the `seed` option through this provider."});return[4,$t({provider:"google",providerOptions:d,schema:P8e})];case 1:x=_state.sent(),v=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date,y={sampleCount:a};if(l!=null&&(y.aspectRatio=l),x){S=x.googleSearch,k=_object_without_properties(x,["googleSearch"]);S!=null&&g.push({type:"unsupported",feature:"googleSearch",details:"Google Search grounding is only supported on Gemini image models."}),Object.assign(y,k)}_={instances:[{prompt:o}],parameters:y};_tmp={url:"".concat(this.config.baseURL,"/models/").concat(this.modelId,":predict")};if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp1=_state.sent();return[3,4];case 3:_tmp1=void 0;_state.label=4;case 4:return[4,zt.apply(void 0,[(_tmp.headers=ht.apply(void 0,[_tmp1,u]),_tmp.body=_,_tmp.failedResponseHandler=Tl,_tmp.successfulResponseHandler=wt(ZSt),_tmp.abortSignal=p,_tmp.fetch=this.config.fetch,_tmp)])];case 5:_ref=_state.sent(),b=_ref.responseHeaders,w=_ref.value;return[2,{images:w.predictions.map(function(S){return S.bytesBase64Encoded}),warnings:g,providerMetadata:{google:{images:w.predictions.map(function(){return{}})}},response:{timestamp:v,modelId:this.modelId,headers:b}}]}})}).call(this)}},{key:"doGenerateGemini",value:function doGenerateGemini(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,L,C,T,_ref,I,O,R,$,z,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,L10,D;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=t.prompt,h=t.n,g=t.size,x=t.aspectRatio,v=t.seed,y=t.providerOptions,_=t.headers,b=t.abortSignal,w=t.files,S=t.mask,k=[];if(S!=null)throw new Error("Gemini image models do not support mask-based image editing.");if(h!=null&&h>1)throw new Error("Gemini image models do not support generating a set number of images per call. Use n=1 or omit the n parameter.");g!=null&&k.push({type:"unsupported",feature:"size",details:"This model does not support the `size` option. Use `aspectRatio` instead."});E=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(m!=null&&E.push({type:"text",text:m}),w!=null&&w.length>0)try{for(_iterator=w[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){L=_step.value;L.type==="url"?E.push({type:"file",data:{type:"url",url:new URL(L.url)},mediaType:"image/*"}):E.push({type:"file",data:{type:"data",data:typeof L.data=="string"?L.data:new Uint8Array(L.data)},mediaType:L.mediaType})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}C=[{role:"user",content:E}];return[4,$t({provider:"google",providerOptions:y,schema:P8e})];case 1:T=_state.sent(),_ref=(r=y==null?void 0:y.google)!=null?r:{},I=_ref.googleSearch,O=_object_without_properties(_ref,["googleSearch"]);return[4,new j8e(this.modelId,{provider:this.config.provider,baseURL:this.config.baseURL,headers:(n=this.config.headers)!=null?n:{},fetch:this.config.fetch,generateId:(i=this.config.generateId)!=null?i:Qr}).doGenerate({prompt:C,seed:v,providerOptions:{google:_object_spread({responseModalities:["IMAGE"],imageConfig:x?{aspectRatio:x}:void 0},O)},tools:(T==null?void 0:T.googleSearch)!=null?[{type:"provider",id:"google.google_search",name:"google_search",args:T.googleSearch}]:void 0,headers:_,abortSignal:b})];case 2:R=_state.sent(),$=(s=(a=(o=this.config._internal)==null?void 0:o.currentDate)==null?void 0:a.call(o))!=null?s:new Date,z=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=R.content[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){L10=_step1.value;L10.type==="file"&&L10.mediaType.startsWith("image/")&&L10.data.type==="data"&&z.push(Fr(L10.data.data))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}D=(c=(l=R.providerMetadata)==null?void 0:l.google)!=null?c:{};return[2,{images:z,warnings:k,providerMetadata:{google:_object_spread_props(_object_spread({},D),{images:z.map(function(){return{}})})},response:{timestamp:$,modelId:this.modelId,headers:(d=R.response)==null?void 0:d.headers},usage:R.usage?{inputTokens:R.usage.inputTokens.total,outputTokens:R.usage.outputTokens.total,totalTokens:((u=R.usage.inputTokens.total)!=null?u:0)+((p=R.usage.outputTokens.total)!=null?p:0)}:void 0}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new G8e(t.modelId,{},t.config)}}]);return G8e}();function R8e(e){return e.startsWith("gemini-")}var ZSt=ne(function(){return te(f.object({predictions:f.array(f.object({bytesBase64Encoded:f.string()})).default([])}))}),KSt=/*#__PURE__*/function(){"use strict";function KSt1(e){_class_call_check(this,KSt1);this.config=e,this.specificationVersion="v4"}_create_class(KSt1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"uploadFile",value:function uploadFile(e){return _async_to_generator(function(){var t,r,n,i,o,a,s,l,c,d,u,p,m,w,h,g,w10,v,y,_,b,_ref,w11;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,$t({provider:"google",providerOptions:e.providerOptions,schema:JSt})];case 1:o=_state.sent(),a=this.config.headers(),s=(t=this.config.fetch)!=null?t:globalThis.fetch,l=[];e.filename!=null&&l.push({type:"unsupported",feature:"filename"});c=Gd(e.data),d=e.mediaType,u=o==null?void 0:o.displayName,p=this.config.baseURL.replace(/\/v1beta$/,"");return[4,s("".concat(p,"/upload/v1beta/files"),{method:"POST",headers:_object_spread_props(_object_spread({},a),{"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":String(c.length),"X-Goog-Upload-Header-Content-Type":d,"Content-Type":"application/json"}),body:JSON.stringify({file:_object_spread({},u!=null?{display_name:u}:{})})})];case 2:m=_state.sent();if(!!m.ok)return[3,4];return[4,m.text()];case 3:w=_state.sent();throw new Ze({name:"GOOGLE_FILES_UPLOAD_ERROR",message:"Failed to initiate resumable upload: ".concat(m.status," ").concat(w)});case 4:h=m.headers.get("x-goog-upload-url");if(!h)throw new Ze({name:"GOOGLE_FILES_UPLOAD_ERROR",message:"No upload URL returned from initiation request"});return[4,s(h,{method:"POST",headers:{"Content-Length":String(c.length),"X-Goog-Upload-Offset":"0","X-Goog-Upload-Command":"upload, finalize"},body:c})];case 5:g=_state.sent();if(!!g.ok)return[3,7];return[4,g.text()];case 6:w10=_state.sent();throw new Ze({name:"GOOGLE_FILES_UPLOAD_ERROR",message:"Failed to upload file data: ".concat(g.status," ").concat(w10)});case 7:return[4,g.json()];case 8:v=_state.sent().file,y=(r=o==null?void 0:o.pollIntervalMs)!=null?r:2e3,_=(n=o==null?void 0:o.pollTimeoutMs)!=null?n:3e5,b=Date.now();_state.label=9;case 9:if(!(v.state==="PROCESSING"))return[3,13];if(Date.now()-b>_)throw new Ze({name:"GOOGLE_FILES_UPLOAD_TIMEOUT",message:"File processing timed out after ".concat(_,"ms")});return[4,Bu(y)];case 10:_state.sent();return[4,$a({url:"".concat(this.config.baseURL,"/").concat(v.name),validateUrl:!1,headers:ht(a),successfulResponseHandler:wt(QSt),failedResponseHandler:Tl,fetch:this.config.fetch})];case 11:_ref=_state.sent(),w11=_ref.value;v=w11;_state.label=12;case 12:return[3,9];case 13:if(v.state==="FAILED")throw new Ze({name:"GOOGLE_FILES_UPLOAD_FAILED",message:"File processing failed for ".concat(v.name)});return[2,{warnings:l,providerReference:{google:v.uri},mediaType:(i=v.mimeType)!=null?i:e.mediaType,providerMetadata:{google:_object_spread({name:v.name,displayName:v.displayName,mimeType:v.mimeType,sizeBytes:v.sizeBytes,state:v.state,uri:v.uri},v.createTime!=null?{createTime:v.createTime}:{},v.updateTime!=null?{updateTime:v.updateTime}:{},v.expirationTime!=null?{expirationTime:v.expirationTime}:{},v.sha256Hash!=null?{sha256Hash:v.sha256Hash}:{})}}]}})}).call(this)}}]);return KSt1}(),QSt=ne(function(){return te(f.object({name:f.string(),displayName:f.string().nullish(),mimeType:f.string(),sizeBytes:f.string().nullish(),createTime:f.string().nullish(),updateTime:f.string().nullish(),expirationTime:f.string().nullish(),sha256Hash:f.string().nullish(),uri:f.string(),state:f.string()}))}),JSt=ne(function(){return te(f.looseObject({displayName:f.string().nullish(),pollIntervalMs:f.number().positive().nullish(),pollTimeoutMs:f.number().positive().nullish()}))}),YSt=ne(function(){return te(f.looseObject({pollIntervalMs:f.number().positive().nullish(),pollTimeoutMs:f.number().positive().nullish(),personGeneration:f.enum(["dont_allow","allow_adult","allow_all"]).nullish(),negativePrompt:f.string().nullish(),referenceImages:f.array(f.object({bytesBase64Encoded:f.string().nullish(),gcsUri:f.string().nullish()})).nullish()}))});function XSt(e){var t,r;return(r=(t=e.frameImages)==null?void 0:t.find(function(n){return n.frameType==="first_frame"}))==null?void 0:r.image}function e5t(e){var t;return(t=XSt(e))!=null?t:e.image}function t5t(e){var t,r;return(r=(t=e.frameImages)==null?void 0:t.find(function(n){return n.frameType==="last_frame"}))==null?void 0:r.image}function r5t(e){if(!(e.frameImages!=null&&e.frameImages.length>0))return e.inputReferences!=null&&e.inputReferences.length>0?e.inputReferences:void 0}function xG(e,t){if(e.type==="url"){if(e.url.startsWith("gs://"))return{gcsUri:e.url,mimeType:"image/png"};t.push({type:"unsupported",feature:"URL-based image input",details:"Google Generative AI video models require base64-encoded images or GCS URIs. URL will be ignored."});return}return{bytesBase64Encoded:typeof e.data=="string"?e.data:Jl(e.data),mimeType:e.mediaType||"image/png"}}function n5t(e){return e.bytesBase64Encoded?{image:{bytesBase64Encoded:e.bytesBase64Encoded,mimeType:"image/png"},referenceType:"asset"}:e.gcsUri?{image:{gcsUri:e.gcsUri,mimeType:"image/png"},referenceType:"asset"}:e}function i5t(e,t){var r=xG(e,t);return r!=null?{image:r,referenceType:"asset"}:void 0}var o5t=/*#__PURE__*/function(){"use strict";function o5t1(e,t){_class_call_check(this,o5t1);this.modelId=e,this.config=t,this.specificationVersion="v4"}_create_class(o5t1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"maxVideosPerCall",get:function get1(){return 4}},{key:"doGenerate",value:function doGenerate(e){return _async_to_generator(function(){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,R,g,R1,x,v,R10,R11,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,$,z,_ref,y,_,_tmp,b,w,S,k,E,_ref1,R12,$1,_tmp1,C,T,I,O,M,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,R13,$10;return _ts_generator(this,function(_state){switch(_state.label){case 0:c=(n=(r=(t=this.config._internal)==null?void 0:t.currentDate)==null?void 0:r.call(t))!=null?n:new Date,d=[];return[4,$t({provider:"google",providerOptions:e.providerOptions,schema:YSt})];case 1:u=_state.sent(),p=[{}],m=p[0];e.prompt!=null&&(m.prompt=e.prompt);h=e5t(e);if(h!=null){R=xG(h,d);R!=null&&(m.image=R)}g=t5t(e);if(g!=null){R1=xG(g,d);R1!=null&&(m.lastFrame=R1)}x=r5t(e);x!=null?m.referenceImages=x.flatMap(function(R){var $=i5t(R,d);return $!=null?[$]:[]}):(u==null?void 0:u.referenceImages)!=null&&(m.referenceImages=u.referenceImages.map(function(R){return n5t(R)}));v={sampleCount:e.n};if(e.aspectRatio&&(v.aspectRatio=e.aspectRatio),e.resolution){R10={"1280x720":"720p","1920x1080":"1080p","3840x2160":"4k"};v.resolution=R10[e.resolution]||e.resolution}if(e.duration&&(v.durationSeconds=e.duration),e.seed&&(v.seed=e.seed),u!=null){R11=u;R11.personGeneration!==void 0&&R11.personGeneration!==null&&(v.personGeneration=R11.personGeneration),R11.negativePrompt!==void 0&&R11.negativePrompt!==null&&(v.negativePrompt=R11.negativePrompt);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=Object.entries(R11)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),$=_step_value[0],z=_step_value[1];["pollIntervalMs","pollTimeoutMs","personGeneration","negativePrompt","referenceImages"].includes($)||(v[$]=z)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}_tmp={url:"".concat(this.config.baseURL,"/models/").concat(this.modelId,":predictLongRunning")};return[4,Kt(this.config.headers)];case 2:return[4,zt.apply(void 0,[(_tmp.headers=ht.apply(void 0,[_state.sent(),e.headers]),_tmp.body={instances:p,parameters:v},_tmp.successfulResponseHandler=wt(M8e),_tmp.failedResponseHandler=Tl,_tmp.abortSignal=e.abortSignal,_tmp.fetch=this.config.fetch,_tmp)])];case 3:_ref=_state.sent(),y=_ref.value,_=y.name;if(!_)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_ERROR",message:"No operation name returned from API"});b=(i=u==null?void 0:u.pollIntervalMs)!=null?i:1e4,w=(o=u==null?void 0:u.pollTimeoutMs)!=null?o:6e5,S=Date.now(),k=y;_state.label=4;case 4:if(!!k.done)return[3,9];if(Date.now()-S>w)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_TIMEOUT",message:"Video generation timed out after ".concat(w,"ms")});return[4,Bu(b)];case 5:if(_state.sent(),(a=e.abortSignal)!=null&&a.aborted)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_ABORTED",message:"Video generation request was aborted"});_tmp1={url:"".concat(this.config.baseURL,"/").concat(_),validateUrl:!1};return[4,Kt(this.config.headers)];case 6:return[4,$a.apply(void 0,[(_tmp1.headers=ht.apply(void 0,[_state.sent(),e.headers]),_tmp1.successfulResponseHandler=wt(M8e),_tmp1.failedResponseHandler=Tl,_tmp1.abortSignal=e.abortSignal,_tmp1.fetch=this.config.fetch,_tmp1)])];case 7:_ref1=_state.sent(),R12=_ref1.value,$1=_ref1.responseHeaders;k=R12,E=$1;_state.label=8;case 8:return[3,4];case 9:if(k.error)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_FAILED",message:"Video generation failed: ".concat(k.error.message)});C=k.response;if(!((s=C==null?void 0:C.generateVideoResponse)!=null&&s.generatedSamples)||C.generateVideoResponse.generatedSamples.length===0)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_ERROR",message:"No videos in response. Response: ".concat(JSON.stringify(k))});T=[],I=[];return[4,Kt(this.config.headers)];case 10:O=_state.sent(),M=O==null?void 0:O["x-goog-api-key"];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=C.generateVideoResponse.generatedSamples[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){R13=_step1.value;if((l=R13.video)!=null&&l.uri){$10=M&&J3(R13.video.uri,this.config.baseURL)?"".concat(R13.video.uri).concat(R13.video.uri.includes("?")?"&":"?","key=").concat(M):R13.video.uri;T.push({type:"url",url:$10,mediaType:"video/mp4"}),I.push({uri:R13.video.uri})}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(T.length===0)throw new Ze({name:"GOOGLE_VIDEO_GENERATION_ERROR",message:"No valid videos in response"});return[2,{videos:T,warnings:d,response:{timestamp:c,modelId:this.modelId,headers:E},providerMetadata:{google:{videos:I}}}]}})}).call(this)}}]);return o5t1}(),M8e=f.object({name:f.string().nullish(),done:f.boolean().nullish(),error:f.object({code:f.number().nullish(),message:f.string(),status:f.string().nullish()}).nullish(),response:f.object({generateVideoResponse:f.object({generatedSamples:f.array(f.object({video:f.object({uri:f.string().nullish()}).nullish()})).nullish()}).nullish()}).nullish()}),a5t=ne(function(){return te(f.object({candidates:f.array(f.object({content:f.object({parts:f.array(f.object({inlineData:f.object({mimeType:f.string().nullish(),data:f.string().nullish()}).nullish()})).nullish()}).nullish()})).nullish()}))}),s5t=f.object({voiceName:f.string()}),l5t=f.object({prebuiltVoiceConfig:s5t}),O8e=ne(function(){return te(f.object({multiSpeakerVoiceConfig:f.object({speakerVoiceConfigs:f.array(f.object({speaker:f.string(),voiceConfig:l5t}))}).optional()}))}),u5t="Kore",c5t=24e3,d5t=/*#__PURE__*/function(){"use strict";function H8e(t,r){_class_call_check(this,H8e);this.modelId=t,this.config=r,this.specificationVersion="v4"}_create_class(H8e,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,tmp,r,n,i,o,a,s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,x,err,_tmp,u,p,m,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.text,tmp=param.voice,r=tmp===void 0?u5t:tmp,n=param.outputFormat,i=param.instructions,o=param.speed,a=param.language,s=param.providerOptions;l=[],c=this.config.provider.includes("vertex")?["googleVertex","vertex"]:["google"];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=c[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];x=_step.value;return[4,$t({provider:x,providerOptions:s,schema:O8e})];case 3:if(d=_state.sent(),d!=null)return[3,5];_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:_tmp=d==null&&!c.includes("google");if(!_tmp)return[3,10];return[4,$t({provider:"google",providerOptions:s,schema:O8e})];case 9:_tmp=d=_state.sent();_state.label=10;case 10:_tmp;u=d==null?void 0:d.multiSpeakerVoiceConfig,p=u?{multiSpeakerVoiceConfig:u}:{voiceConfig:{prebuiltVoiceConfig:{voiceName:r}}},m=t;i!=null&&(u?l.push({type:"unsupported",feature:"instructions",details:"Google Gemini TTS ignores `instructions` when `multiSpeakerVoiceConfig` is set, because prepending them would break multi-speaker transcript parsing."}):m="".concat(i,": ").concat(t)),o!=null&&l.push({type:"unsupported",feature:"speed",details:"Google Gemini TTS models do not support the `speed` option. It was ignored."}),a!=null&&l.push({type:"unsupported",feature:"language",details:"Google Gemini TTS models do not support the `language` option. Language is detected automatically from the input text."});h="wav";return[2,(n==="pcm"?h="pcm":n!=null&&n!=="wav"&&l.push({type:"unsupported",feature:"outputFormat",details:"Unsupported output format: ".concat(n,". Using wav instead.")}),{requestBody:{contents:[{role:"user",parts:[{text:m}]}],generationConfig:{responseModalities:["AUDIO"],speechConfig:p}},warnings:l,outputFormat:h})]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,_ref,p,m,h,_ref1,g,x,v,y,_,_tmp,_tmp1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,k,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,E,b,w,S;return _ts_generator(this,function(_state){switch(_state.label){case 0:u=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,this.getArgs(t)];case 1:_ref=_state.sent(),p=_ref.requestBody,m=_ref.warnings,h=_ref.outputFormat;_tmp={url:"".concat(this.config.baseURL,"/models/").concat(this.modelId,":generateContent")};if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp1=_state.sent();return[3,4];case 3:_tmp1=void 0;_state.label=4;case 4:return[4,zt.apply(void 0,[(_tmp.headers=ht.apply(void 0,[_tmp1,t.headers]),_tmp.body=p,_tmp.failedResponseHandler=Tl,_tmp.successfulResponseHandler=wt(a5t),_tmp.abortSignal=t.abortSignal,_tmp.fetch=this.config.fetch,_tmp)])];case 5:_ref1=_state.sent(),g=_ref1.value,x=_ref1.responseHeaders,v=_ref1.rawValue;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=((o=g.candidates)!=null?o:[])[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){k=_step.value;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=((s=(a=k.content)==null?void 0:a.parts)!=null?s:[])[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){E=_step1.value;if((l=E.inlineData)!=null&&l.data){y=E.inlineData.data,_=(c=E.inlineData.mimeType)!=null?c:void 0;break}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}if(y!=null)break}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}b=(d=p5t(_))!=null?d:c5t,w=y!=null?Ui(y):new Uint8Array(0),S=h==="pcm"||w.length===0?w:f5t(w,b);return[2,(h==="pcm"&&w.length>0&&m.push({type:"unsupported",feature:"outputFormat",details:"Returning raw PCM audio (signed 16-bit little-endian, mono, ".concat(b," Hz). These bytes have no container header and are not directly playable; see providerMetadata.google for the sample rate and mime type.")}),{audio:S,warnings:m,request:{body:JSON.stringify(p)},response:{timestamp:u,modelId:this.modelId,headers:x,body:v},providerMetadata:{google:{sampleRate:b,mimeType:_!=null?_:null}}})]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new H8e(t.modelId,t.config)}}]);return H8e}();function p5t(e){if(e==null)return;var t=/rate=(\d+)/.exec(e);return t?Number.parseInt(t[1],10):void 0}function f5t(e,t){var o=t*2,a=e.length,s=new ArrayBuffer(44+a),l=new DataView(s);EP(l,0,"RIFF"),l.setUint32(4,36+a,!0),EP(l,8,"WAVE"),EP(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,1,!0),l.setUint32(24,t,!0),l.setUint32(28,o,!0),l.setUint16(32,2,!0),l.setUint16(34,16,!0),EP(l,36,"data"),l.setUint32(40,a,!0);var c=new Uint8Array(s);return c.set(e,44),c}function EP(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))}function SG(e){var t,r,n,i,o,a,s,l;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var c=(t=e.total_input_tokens)!=null?t:0,d=(r=e.total_output_tokens)!=null?r:0,u=(n=e.total_thought_tokens)!=null?n:0,p=(i=e.total_cached_tokens)!=null?i:0;return{inputTokens:{total:(o=e.total_input_tokens)!=null?o:void 0,noCache:e.total_input_tokens==null?void 0:c-p,cacheRead:(a=e.total_cached_tokens)!=null?a:void 0,cacheWrite:void 0},outputTokens:{total:e.total_output_tokens==null&&e.total_thought_tokens==null?void 0:d+u,text:(s=e.total_output_tokens)!=null?s:void 0,reasoning:(l=e.total_thought_tokens)!=null?l:void 0},raw:e}}function Z8e(e){var t=e==null?void 0:e.output_tokens_by_modality;if(t==null)return;var r={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;(n==null?void 0:n.modality)!=null&&n.tokens!=null&&(r[n.modality]=n.tokens)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Object.keys(r).length>0?r:void 0}var m5t={pdf:"application/pdf",txt:"text/plain",md:"text/markdown",markdown:"text/markdown",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};function K8e(e){var t=e.toLowerCase();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(m5t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];if(t.endsWith(".".concat(r)))return n}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return"application/octet-stream"}function Q8e(e){var t=e.split("/"),r=t[t.length-1];return r&&r.length>0?r:void 0}function h5t(param){var e=param.annotation,t=param.generateId;var r,n,i,o,a;switch(e.type){case"url_citation":{var s=e;return s.url==null||s.url.length===0?void 0:_object_spread({type:"source",sourceType:"url",id:t(),url:s.url},s.title!=null?{title:s.title}:{})}case"file_citation":{var s10=e,l=(n=(r=s10.url)!=null?r:s10.document_uri)!=null?n:s10.file_name;if(l==null||l.length===0)return;if(l.startsWith("http://")||l.startsWith("https://"))return _object_spread({type:"source",sourceType:"url",id:t(),url:l},s10.file_name!=null?{title:s10.file_name}:{});var c=(i=s10.file_name)!=null?i:Q8e(l),d=K8e(l);return _object_spread({type:"source",sourceType:"document",id:t(),mediaType:d,title:(a=(o=s10.file_name)!=null?o:c)!=null?a:l},c!=null?{filename:c}:{})}case"place_citation":{var s11=e;return s11.url==null||s11.url.length===0?void 0:_object_spread({type:"source",sourceType:"url",id:t(),url:s11.url},s11.name!=null?{title:s11.name}:{})}default:return}}function J8e(param){var e=param.block,t=param.generateId;var r,n,i,o,a,s,l,c,d,u,p;var m=[];switch(e.type){case"url_context_result":{var h=(r=e.result)!=null?r:[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var g=_step.value;(g==null?void 0:g.url)==null||g.url.length===0||g.status!=null&&g.status!=="success"||m.push({type:"source",sourceType:"url",id:t(),url:g.url})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}break}case"google_search_result":{var h10=(n=e.result)!=null?n:[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=h10[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var g10=_step1.value;var x=g10==null?void 0:g10.url;x==null||x.length===0||m.push(_object_spread({type:"source",sourceType:"url",id:t(),url:x},g10.title!=null?{title:g10.title}:{}))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break}case"google_maps_result":{var h11=(i=e.result)!=null?i:[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined,_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator2=h11[Symbol.iterator](),_step2;!(_iteratorNormalCompletion3=(_step2=_iterator2.next()).done);_iteratorNormalCompletion3=true){var g11=_step2.value;try{for(var _iterator3=((o=g11.places)!=null?o:[])[Symbol.iterator](),_step3;!(_iteratorNormalCompletion2=(_step3=_iterator3.next()).done);_iteratorNormalCompletion2=true){var x10=_step3.value;x10.url==null||x10.url.length===0||m.push(_object_spread({type:"source",sourceType:"url",id:t(),url:x10.url},x10.name!=null?{title:x10.name}:{}))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}break}case"file_search_result":{var h12=(a=e.result)!=null?a:[];var _iteratorNormalCompletion4=true,_didIteratorError4=false,_iteratorError4=undefined;try{for(var _iterator4=h12[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var g12=_step4.value;if(g12==null||(typeof g12==="undefined"?"undefined":_type_of(g12))!="object")continue;var x11=g12,v=(l=(s=x11.url)!=null?s:x11.document_uri)!=null?l:x11.file_name;if(v==null||v.length===0)continue;if(v.startsWith("http://")||v.startsWith("https://")){m.push(_object_spread({type:"source",sourceType:"url",id:t(),url:v},x11.title!=null?{title:x11.title}:{}));continue}var y=(c=x11.file_name)!=null?c:Q8e(v),_=K8e(v);m.push(_object_spread({type:"source",sourceType:"document",id:t(),mediaType:_,title:(p=(u=(d=x11.title)!=null?d:x11.file_name)!=null?u:y)!=null?p:v},y!=null?{filename:y}:{}))}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return!=null){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}break}default:break}return m}function yG(param){var e=param.annotations,t=param.generateId;var r;if(e==null)return[];var n=new Set,i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;var a=h5t({annotation:o,generateId:t});if(a==null)continue;var s=a.sourceType==="url"?"url:".concat(a.url):"doc:".concat((r=a.filename)!=null?r:a.title);n.has(s)||(n.add(s),i.push(a))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i}function kG(param){var e=param.status,t=param.hasFunctionCall;switch(e){case"completed":return t?"tool-calls":"stop";case"requires_action":return"tool-calls";case"failed":return"error";case"incomplete":return"length";case"cancelled":return"other";case"in_progress":default:return"other"}}var g5t=new Set(["google_search_call","code_execution_call","url_context_call","file_search_call","google_maps_call","mcp_server_tool_call"]),x5t=new Set(["google_search_result","code_execution_result","url_context_result","file_search_result","google_maps_result","mcp_server_tool_result"]);function y5t(e){return e.replace(/_call$/,"")}function v5t(e){return e.replace(/_result$/,"")}function $8e(param){var e=param.warnings,t=param.generateId,r=param.includeRawChunks,n=param.serviceTier;var i,o,a=n,s,l=!1,c=new Map,d=new Set;function u(p){var m;return p.sourceType==="url"?"url:".concat(p.url):"doc:".concat((m=p.filename)!=null?m:p.title)}return new TransformStream({start:function start(p){p.enqueue({type:"stream-start",warnings:e})},transform:function transform(p,m){var h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,D;if(r&&m.enqueue({type:"raw",rawValue:p.rawValue}),!p.success){s="failed",m.enqueue({type:"error",error:p.error});return}var L=p.value,ee=L.event_type;switch(ee){case"interaction.created":{var N=L.interaction;i=(N==null?void 0:N.id)!=null&&N.id.length>0?N.id:void 0;var U=N==null?void 0:N.created,G;if(typeof U=="string"){var K=new Date(U);Number.isNaN(K.getTime())||(G=K)}m.enqueue(_object_spread(_object_spread_props(_object_spread({type:"response-metadata"},i!=null?{id:i}:{}),{modelId:N==null?void 0:N.model}),G?{timestamp:G}:{}));break}case"step.start":{var pe=L,N10=pe.step,U1=pe.index,G5="".concat(i!=null?i:"interaction",":").concat(U1),K10=N10==null?void 0:N10.type;if(K10==="model_output"){var me=(h=N10==null?void 0:N10.content)==null?void 0:h[0];if((me==null?void 0:me.type)==="text"){c.set(U1,{kind:"text",id:G5,emittedSourceKeys:new Set}),m.enqueue({type:"text-start",id:G5});var V=yG({annotations:me.annotations,generateId:t});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=V[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var ie=_step.value;var re=u(ie);d.has(re)||(d.add(re),m.enqueue(ie))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}else(me==null?void 0:me.type)==="image"?c.set(U1,_object_spread({kind:"image",id:G5},me.data!=null?{data:me.data}:{},me.mime_type!=null?{mimeType:me.mime_type}:{},me.uri!=null?{uri:me.uri}:{})):c.set(U1,{kind:"pending_model_output",id:G5})}else if(K10==="thought"){var me1=N10==null?void 0:N10.signature;var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(c.set(U1,_object_spread({kind:"reasoning",id:G5},me1!=null?{signature:me1}:{})),m.enqueue({type:"reasoning-start",id:G5}),Array.isArray(N10==null?void 0:N10.summary))try{for(var _iterator1=N10.summary[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var V10=_step1.value;(V10==null?void 0:V10.type)==="text"&&typeof V10.text=="string"&&m.enqueue({type:"reasoning-delta",id:G5,delta:V10.text})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}else if(K10==="function_call"){var me2=(g=N10==null?void 0:N10.id)!=null?g:G5,V11=(x=N10==null?void 0:N10.name)!=null?x:"unknown";l=!0;var ie1=_object_spread({kind:"function_call",id:G5,toolCallId:me2,toolName:V11,argumentsAccum:""},(N10==null?void 0:N10.signature)!=null?{signature:N10.signature}:{});c.set(U1,ie1),m.enqueue({type:"tool-input-start",id:me2,toolName:V11})}else if(K10!=null&&g5t.has(K10)){var me3=K10==="mcp_server_tool_call"?(v=N10==null?void 0:N10.name)!=null?v:"mcp_server_tool":y5t(K10),V12=(y=N10==null?void 0:N10.id)!=null?y:G5,ie2={kind:"builtin_tool_call",id:G5,blockType:K10,toolCallId:V12,toolName:me3,arguments:(_=N10==null?void 0:N10.arguments)!=null?_:{},callEmitted:!1};c.set(U1,ie2)}else if(K10!=null&&x5t.has(K10)){var me4=K10==="mcp_server_tool_result"?(b=N10==null?void 0:N10.name)!=null?b:"mcp_server_tool":v5t(K10),V13=(w=N10==null?void 0:N10.call_id)!=null?w:G5,ie3=_object_spread_props(_object_spread({kind:"builtin_tool_result",id:G5,blockType:K10,callId:V13,toolName:me4,result:(S=N10==null?void 0:N10.result)!=null?S:null},(N10==null?void 0:N10.is_error)!=null?{isError:N10.is_error}:{}),{resultEmitted:!1});c.set(U1,ie3)}else c.set(U1,{kind:"unknown",id:G5});break}case"step.delta":{var pe1=L,N11=c.get(pe1.index);if(N11==null)break;var U10=(k=pe1.delta)==null?void 0:k.type;if(N11.kind==="pending_model_output"&&(U10==="text"||U10==="text_annotation"||U10==="text_annotation_delta")){var K11={kind:"text",id:N11.id,emittedSourceKeys:new Set};c.set(pe1.index,K11),N11=K11,m.enqueue({type:"text-start",id:K11.id})}if(U10==="image"&&(N11.kind==="pending_model_output"||N11.kind==="text"||N11.kind==="image")){var K12=pe1.delta,me5={};i!=null&&(me5.interactionId=i);var V14=Object.keys(me5).length>0?{google:me5}:void 0;(K12==null?void 0:K12.data)!=null&&K12.data.length>0?m.enqueue(_object_spread({type:"file",mediaType:(E=K12.mime_type)!=null?E:"image/png",data:{type:"data",data:K12.data}},V14?{providerMetadata:V14}:{})):(K12==null?void 0:K12.uri)!=null&&K12.uri.length>0&&m.enqueue(_object_spread({type:"file",mediaType:(C=K12.mime_type)!=null?C:"image/png",data:{type:"url",url:new URL(K12.uri)}},V14?{providerMetadata:V14}:{})),N11.kind==="image"&&(N11.data=void 0,N11.uri=void 0);break}if(U10==="video"&&(N11.kind==="pending_model_output"||N11.kind==="text")){var K13=pe1.delta,me6={};i!=null&&(me6.interactionId=i);var V15=Object.keys(me6).length>0?{google:me6}:void 0;(K13==null?void 0:K13.data)!=null&&K13.data.length>0?m.enqueue(_object_spread({type:"file",mediaType:(T=K13.mime_type)!=null?T:"video/mp4",data:{type:"data",data:K13.data}},V15?{providerMetadata:V15}:{})):(K13==null?void 0:K13.uri)!=null&&K13.uri.length>0&&m.enqueue(_object_spread({type:"file",mediaType:(I=K13.mime_type)!=null?I:"video/mp4",data:{type:"url",url:new URL(K13.uri)}},V15?{providerMetadata:V15}:{}));break}var G10=pe1.delta;if(N11.kind==="text"&&(G10==null?void 0:G10.type)==="text"){var K14=(O=G10.text)!=null?O:"";K14.length>0&&m.enqueue({type:"text-delta",id:N11.id,delta:K14})}else if(N11.kind==="text"&&((G10==null?void 0:G10.type)==="text_annotation"||(G10==null?void 0:G10.type)==="text_annotation_delta")){var K15=yG({annotations:G10.annotations,generateId:t});var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=K15[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var me7=_step2.value;var V16=u(me7);d.has(V16)||(d.add(V16),N11.emittedSourceKeys.add(V16),m.enqueue(me7))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else if(N11.kind==="image"&&(G10==null?void 0:G10.type)==="image")G10.data!=null&&(N11.data=G10.data),G10.mime_type!=null&&(N11.mimeType=G10.mime_type),G10.uri!=null&&(N11.uri=G10.uri);else if(N11.kind==="reasoning"){if((G10==null?void 0:G10.type)==="thought_summary"){var K16=G10.content;(K16==null?void 0:K16.type)==="text"&&typeof K16.text=="string"&&m.enqueue({type:"reasoning-delta",id:N11.id,delta:K16.text})}else if((G10==null?void 0:G10.type)==="thought_signature"){var K17=G10.signature;K17!=null&&(N11.signature=K17)}}else if(N11.kind==="function_call"&&(G10==null?void 0:G10.type)==="arguments_delta"){var K18=typeof G10.arguments=="string"?G10.arguments:"";K18.length>0&&(N11.argumentsAccum+=K18,m.enqueue({type:"tool-input-delta",id:N11.toolCallId,delta:K18})),G10.id!=null&&(N11.toolCallId=G10.id),G10.signature!=null&&(N11.signature=G10.signature),l=!0}else N11.kind==="builtin_tool_call"&&(G10==null?void 0:G10.type)===N11.blockType?(G10.id!=null&&(N11.toolCallId=G10.id),G10.arguments!=null&&_type_of(G10.arguments)=="object"&&(N11.arguments=G10.arguments),G10.name!=null&&N11.blockType==="mcp_server_tool_call"&&(N11.toolName=G10.name)):N11.kind==="builtin_tool_result"&&(G10==null?void 0:G10.type)===N11.blockType&&(G10.call_id!=null&&(N11.callId=G10.call_id),G10.result!==void 0&&(N11.result=G10.result),G10.is_error!=null&&(N11.isError=G10.is_error),G10.name!=null&&N11.blockType==="mcp_server_tool_result"&&(N11.toolName=G10.name));break}case"step.stop":{var pe2=L,N12=c.get(pe2.index);if(N12==null)break;if(N12.kind==="text"){var U11=i!=null?{google:{interactionId:i}}:void 0;m.enqueue(_object_spread({type:"text-end",id:N12.id},U11?{providerMetadata:U11}:{}))}else if(N12.kind==="reasoning"){var U12={};N12.signature!=null&&(U12.signature=N12.signature),i!=null&&(U12.interactionId=i);var G11=Object.keys(U12).length>0?{google:U12}:void 0;m.enqueue(_object_spread({type:"reasoning-end",id:N12.id},G11?{providerMetadata:G11}:{}))}else if(N12.kind==="image"){var U13={};i!=null&&(U13.interactionId=i);var G12=Object.keys(U13).length>0?{google:U13}:void 0;N12.data!=null&&N12.data.length>0?m.enqueue(_object_spread({type:"file",mediaType:(M=N12.mimeType)!=null?M:"image/png",data:{type:"data",data:N12.data}},G12?{providerMetadata:G12}:{})):N12.uri!=null&&N12.uri.length>0&&m.enqueue(_object_spread({type:"file",mediaType:(R=N12.mimeType)!=null?R:"image/png",data:{type:"url",url:new URL(N12.uri)}},G12?{providerMetadata:G12}:{}))}else if(N12.kind==="function_call"){var U14=N12.argumentsAccum.length>0?N12.argumentsAccum:"{}";m.enqueue({type:"tool-input-end",id:N12.toolCallId});var G13={};N12.signature!=null&&(G13.signature=N12.signature),i!=null&&(G13.interactionId=i);var K19=Object.keys(G13).length>0?{google:G13}:void 0;m.enqueue(_object_spread({type:"tool-call",toolCallId:N12.toolCallId,toolName:N12.toolName,input:U14},K19?{providerMetadata:K19}:{}))}else if(N12.kind==="builtin_tool_call"&&!N12.callEmitted)m.enqueue({type:"tool-call",toolCallId:N12.toolCallId,toolName:N12.toolName,input:JSON.stringify(($=N12.arguments)!=null?$:{}),providerExecuted:!0}),N12.callEmitted=!0;else if(N12.kind==="builtin_tool_result"&&!N12.resultEmitted){m.enqueue({type:"tool-result",toolCallId:N12.callId,toolName:N12.toolName,result:(z=N12.result)!=null?z:null}),N12.resultEmitted=!0;var U15=J8e({block:{type:N12.blockType,call_id:N12.callId,result:N12.result},generateId:t});var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=U15[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var G14=_step3.value;var K20=u(G14);d.has(K20)||(d.add(K20),m.enqueue(G14))}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}c.delete(pe2.index);break}case"interaction.status_update":case"interaction.in_progress":case"interaction.requires_action":{var pe3=L;pe3.status!=null?s=pe3.status:ee==="interaction.requires_action"?s="requires_action":s="in_progress";break}case"interaction.completed":{var N13=L.interaction;(N13==null?void 0:N13.id)!=null&&N13.id.length>0&&(i=N13.id),(N13==null?void 0:N13.status)!=null&&(s=N13.status),(N13==null?void 0:N13.usage)!=null&&(o=N13.usage),(N13==null?void 0:N13.service_tier)!=null&&(a=N13.service_tier);break}case"error":{var pe4=L;s="failed";var N14=(D=pe4.error)!=null?D:{message:"Unknown interaction error"};m.enqueue({type:"error",error:N14});break}default:break}},flush:function flush(p){var m={unified:kG({status:s,hasFunctionCall:l}),raw:s},h=Z8e(o),g={google:_object_spread({},i!=null?{interactionId:i}:{},a!=null?{serviceTier:a}:{},h!=null?{outputTokensByModality:h}:{})};p.enqueue({type:"finish",finishReason:m,usage:SG(o),providerMetadata:g})}})}function _5t(param){var e=param.prompt,t=param.previousInteractionId,r=param.store,n=param.mediaResolution;var i,o,a,s,l,c,d;var u=[],p=t!=null&&r===!1,m=t!=null&&r!==!1;p&&u.push({type:"other",message:"google.interactions: providerOptions.google.previousInteractionId was set together with store: false. These are incoherent (the prior interaction cannot be referenced when nothing was stored on the server); the full history will be sent and previous_interaction_id will still be emitted."});var h=m?b5t({prompt:e,previousInteractionId:t}):e,g=[],x=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var y=_step.value;switch(y.role){case"system":{g.push(y.content);break}case"user":{var _=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=y.content[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator.next()).done);_iteratorNormalCompletion=true){var w=_step1.value;if(w.type==="text")_.push({type:"text",text:w.text});else if(w.type==="file"){var S=N8e({part:w,warnings:u,mediaResolution:n});S!=null&&_.push(S)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var b=C5t(_);b.length>0&&x.push({type:"user_input",content:b});break}case"assistant":{var _10=[],b10=function(){_10.length>0&&(x.push({type:"model_output",content:_10}),_10=[])};var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=y.content[Symbol.iterator](),_step2;!(_iteratorNormalCompletion1=(_step2=_iterator1.next()).done);_iteratorNormalCompletion1=true){var w10=_step2.value;if(w10.type==="text")_10.push({type:"text",text:w10.text});else if(w10.type==="reasoning"){b10();var S10=(o=(i=w10.providerOptions)==null?void 0:i.google)==null?void 0:o.signature;x.push(_object_spread_props(_object_spread({type:"thought"},S10!=null?{signature:S10}:{}),{summary:w10.text.length>0?[{type:"text",text:w10.text}]:void 0}))}else if(w10.type==="file"){var S11=N8e({part:w10,warnings:u,mediaResolution:n});S11!=null&&_10.push(S11)}else if(w10.type==="tool-call"){b10();var S12=(s=(a=w10.providerOptions)==null?void 0:a.google)==null?void 0:s.signature,k=typeof w10.input=="string"?w5t(w10.input):(l=w10.input)!=null?l:{};x.push(_object_spread({type:"function_call",id:w10.toolCallId,name:w10.toolName,arguments:k},S12!=null?{signature:S12}:{}))}else u.push({type:"other",message:'google.interactions: unsupported assistant content part type "'.concat(w10.type,'"; part dropped.')})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}b10();break}case"tool":{var _11=[];var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=y.content[Symbol.iterator](),_step3;!(_iteratorNormalCompletion2=(_step3=_iterator2.next()).done);_iteratorNormalCompletion2=true){var b11=_step3.value;if(b11.type!=="tool-result"){u.push({type:"other",message:'google.interactions: unsupported tool message part type "'.concat(b11.type,'"; part dropped.')});continue}var w11=S5t({toolCallId:b11.toolCallId,toolName:b11.toolName,output:b11.output,signature:(d=(c=b11.providerOptions)==null?void 0:c.google)==null?void 0:d.signature,warnings:u});_11.push(w11)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}_11.length>0&&x.push({type:"user_input",content:_11});break}}};for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var v=g.length>0?g.join("\n\n"):void 0;return{input:x,systemInstruction:v,warnings:u}}function N8e(param){var e=param.part,t=param.warnings,r=param.mediaResolution;if(e.data.type==="text")return{type:"text",text:e.data.text};var n=ea(e.mediaType),i;switch(n){case"image":i="image";break;case"audio":i="audio";break;case"video":i="video";break;case"application":case"text":i="document";break;default:i=void 0}if(i==null){t.push({type:"other",message:'google.interactions: unsupported file media type "'.concat(e.mediaType,'"; part dropped.')});return}var o=r!=null&&(i==="image"||i==="video")?{resolution:r}:{};switch(e.data.type){case"data":{var a=ai({part:e});return _object_spread({type:i,data:Fr(e.data.data),mime_type:a},o)}case"url":return _object_spread({type:i,uri:e.data.url.toString()},qu(e.mediaType)?{mime_type:e.mediaType}:{},o);case"reference":{var a9=ns({reference:e.data.reference,provider:"google"});return _object_spread({type:i,uri:a9},qu(e.mediaType)?{mime_type:e.mediaType}:{},o)}}}function b5t(param){var e=param.prompt,t=param.previousInteractionId;var r=[],n=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;if(i.role==="assistant"){if(i.content.some(function(a){var s,l;return((l=(s=a.providerOptions)==null?void 0:s.google)==null?void 0:l.interactionId)===t})){var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=i.content[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var a=_step1.value;a.type==="tool-call"&&n.add(a.toolCallId)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}continue}r.push(i);continue}if(i.role==="tool"){var o=i.content.filter(function(a){return a.type!=="tool-result"?!0:!n.has(a.toolCallId)});if(o.length===0)continue;r.push(_object_spread_props(_object_spread({},i),{content:o}));continue}r.push(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}function w5t(e){try{var t=ll(e);return t!=null&&(typeof t==="undefined"?"undefined":_type_of(t))=="object"&&!Array.isArray(t)?t:{value:t}}catch(t){return{value:e}}}function S5t(param){var e=param.toolCallId,t=param.toolName,r=param.output,n=param.signature,i=param.warnings;var o;var a=_object_spread({type:"function_result",call_id:e,name:t},n!=null?{signature:n}:{});switch(r.type){case"text":return _object_spread_props(_object_spread({},a),{result:r.value});case"json":return _object_spread_props(_object_spread({},a),{result:JSON.stringify(r.value)});case"error-text":return _object_spread_props(_object_spread({},a),{is_error:!0,result:r.value});case"error-json":return _object_spread_props(_object_spread({},a),{is_error:!0,result:JSON.stringify(r.value)});case"execution-denied":return _object_spread_props(_object_spread({},a),{is_error:!0,result:(o=r.reason)!=null?o:"Tool execution denied by user."});case"content":{var s=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=r.value[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var l=_step.value;if(l.type==="text")s.push({type:"text",text:l.text});else if(l.type==="file"){if(ea(l.mediaType)!=="image"){i.push({type:"other",message:'google.interactions: tool-result file with mediaType "'.concat(l.mediaType,'" is not supported (Interactions `function_result.result` accepts only text and image content); part dropped.')});continue}var d=k5t({part:l,warnings:i});d!=null&&s.push(d)}else i.push({type:"other",message:'google.interactions: tool-result content part type "'.concat(l.type,'" is not supported; part dropped.')})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return _object_spread_props(_object_spread({},a),{result:s})}}}function k5t(param){var e=param.part,t=param.warnings;switch(e.data.type){case"data":{var r=qu(e.mediaType)?e.mediaType:ai({part:{type:"file",mediaType:e.mediaType,data:e.data}});return{type:"image",data:Fr(e.data.data),mime_type:r}}case"url":return _object_spread({type:"image",uri:e.data.url.toString()},qu(e.mediaType)?{mime_type:e.mediaType}:{});case"reference":return _object_spread({type:"image",uri:ns({reference:e.data.reference,provider:"google"})},qu(e.mediaType)?{mime_type:e.mediaType}:{});case"text":{t.push({type:"other",message:'google.interactions: tool-result image part with `data.type === "text"` is not representable as an image; part dropped.'});return}}}function C5t(e){if(e.length<2)return e;var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=t[t.length-1];if(r.type==="text"&&n!=null&&n.type==="text"&&n.annotations==null&&r.annotations==null){var i={type:"text",text:"".concat(n.text,"\n\n").concat(r.text)};t[t.length-1]=i;continue}t.push(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var TP=function(){return f.object({modality:f.string().nullish(),tokens:f.number().nullish()}).loose()},Y8e=function(){return f.object({total_input_tokens:f.number().nullish(),total_output_tokens:f.number().nullish(),total_thought_tokens:f.number().nullish(),total_cached_tokens:f.number().nullish(),total_tool_use_tokens:f.number().nullish(),total_tokens:f.number().nullish(),input_tokens_by_modality:f.array(TP()).nullish(),output_tokens_by_modality:f.array(TP()).nullish(),cached_tokens_by_modality:f.array(TP()).nullish(),tool_use_tokens_by_modality:f.array(TP()).nullish(),grounding_tool_count:f.array(f.object({type:f.string().nullish(),count:f.number().nullish()}).loose()).nullish()}).loose()},X8e=function(){return f.enum(["in_progress","requires_action","completed","failed","cancelled","incomplete"])},eCe=function(){var e=f.object({type:f.literal("url_citation"),url:f.string().nullish(),title:f.string().nullish(),start_index:f.number().nullish(),end_index:f.number().nullish()}).loose(),t=f.object({type:f.literal("file_citation"),file_name:f.string().nullish(),document_uri:f.string().nullish(),url:f.string().nullish(),page_number:f.number().nullish(),media_id:f.string().nullish(),start_index:f.number().nullish(),end_index:f.number().nullish(),custom_metadata:f.record(f.string(),f.unknown()).nullish()}).loose(),r=f.object({type:f.literal("place_citation"),name:f.string().nullish(),url:f.string().nullish(),place_id:f.string().nullish(),start_index:f.number().nullish(),end_index:f.number().nullish()}).loose();return f.union([e,t,r,f.object({type:f.string()}).loose()])},tCe=function(){return f.object({type:f.string(),text:f.string().nullish(),data:f.string().nullish(),mime_type:f.string().nullish()}).loose()},D8e=function(){var e=f.object({type:f.literal("text"),text:f.string(),annotations:f.array(eCe()).nullish()}).loose(),t=f.object({type:f.literal("image"),data:f.string().nullish(),mime_type:f.string().nullish(),resolution:f.enum(["low","medium","high","ultra_high"]).nullish(),uri:f.string().nullish()}).loose(),r=f.object({type:f.literal("video"),data:f.string().nullish(),mime_type:f.string().nullish(),uri:f.string().nullish()}).loose();return f.union([e,t,r,f.object({type:f.string()}).loose()])},rCe=["google_search_call","code_execution_call","url_context_call","file_search_call","google_maps_call","mcp_server_tool_call"],nCe=["google_search_result","code_execution_result","url_context_result","file_search_result","google_maps_result","mcp_server_tool_result"],iCe=function(){var e=f.object({type:f.literal("user_input"),content:f.array(D8e()).nullish()}).loose(),t=f.object({type:f.literal("model_output"),content:f.array(D8e()).nullish()}).loose(),r=f.object({type:f.literal("function_call"),id:f.string(),name:f.string(),arguments:f.record(f.string(),f.unknown()).nullish(),signature:f.string().nullish()}).loose(),n=f.object({type:f.literal("thought"),signature:f.string().nullish(),summary:f.array(tCe()).nullish()}).loose(),i=f.object({type:f.enum(rCe),id:f.string(),arguments:f.record(f.string(),f.unknown()).nullish(),name:f.string().nullish(),server_name:f.string().nullish(),search_type:f.string().nullish(),signature:f.string().nullish()}).loose(),o=f.object({type:f.enum(nCe),call_id:f.string(),result:f.unknown().nullish(),is_error:f.boolean().nullish(),name:f.string().nullish(),server_name:f.string().nullish(),signature:f.string().nullish()}).loose();return f.union([e,t,r,n,i,o,f.object({type:f.string()}).loose()])},vG=ne(function(){return te(f.object({id:f.string().nullish(),created:f.string().nullish(),updated:f.string().nullish(),status:X8e(),model:f.string().nullish(),agent:f.string().nullish(),steps:f.array(iCe()).nullish(),usage:Y8e().nullish(),service_tier:f.string().nullish(),previous_interaction_id:f.string().nullish(),response_modalities:f.array(f.string()).nullish()}).loose())}),oCe=ne(function(){return te(function(){var e=X8e(),t=eCe(),r=tCe(),n=f.object({event_type:f.literal("interaction.created"),event_id:f.string().nullish(),interaction:f.object({id:f.string().nullish(),created:f.string().nullish(),model:f.string().nullish(),agent:f.string().nullish(),status:e.nullish()}).loose()}).loose(),i=f.object({event_type:f.literal("step.start"),event_id:f.string().nullish(),index:f.number(),step:iCe()}).loose(),o=f.object({type:f.literal("text"),text:f.string()}).loose(),a=f.object({type:f.literal("thought_summary"),content:r.nullish()}).loose(),s=f.object({type:f.literal("thought_signature"),signature:f.string().nullish()}).loose(),l=f.object({type:f.literal("arguments_delta"),arguments:f.string().nullish(),id:f.string().nullish(),signature:f.string().nullish()}).loose(),c=f.object({type:f.enum(["text_annotation_delta","text_annotation"]),annotations:f.array(t).nullish()}).loose(),d=f.object({type:f.literal("image"),data:f.string().nullish(),mime_type:f.string().nullish(),resolution:f.enum(["low","medium","high","ultra_high"]).nullish(),uri:f.string().nullish()}).loose(),u=f.object({type:f.literal("video"),data:f.string().nullish(),mime_type:f.string().nullish(),uri:f.string().nullish()}).loose(),p=f.object({type:f.enum(rCe),id:f.string().nullish(),arguments:f.record(f.string(),f.unknown()).nullish(),name:f.string().nullish(),server_name:f.string().nullish(),search_type:f.string().nullish(),signature:f.string().nullish()}).loose(),m=f.object({type:f.enum(nCe),call_id:f.string().nullish(),result:f.unknown().nullish(),is_error:f.boolean().nullish(),name:f.string().nullish(),server_name:f.string().nullish(),signature:f.string().nullish()}).loose(),h=f.object({type:f.string()}).loose(),g=f.union([o,d,u,a,s,l,c,p,m,h]),x=f.object({event_type:f.literal("step.delta"),event_id:f.string().nullish(),index:f.number(),delta:g}).loose(),v=f.object({event_type:f.literal("step.stop"),event_id:f.string().nullish(),index:f.number()}).loose(),y=f.object({event_type:f.literal("interaction.status_update"),event_id:f.string().nullish(),interaction_id:f.string().nullish(),status:e.nullish()}).loose(),_=f.object({event_type:f.literal("interaction.in_progress"),event_id:f.string().nullish(),interaction_id:f.string().nullish(),status:e.nullish()}).loose(),b=f.object({event_type:f.literal("interaction.requires_action"),event_id:f.string().nullish(),interaction_id:f.string().nullish(),status:e.nullish()}).loose(),w=f.object({event_type:f.literal("interaction.completed"),event_id:f.string().nullish(),interaction:f.object({id:f.string().nullish(),status:e.nullish(),usage:Y8e().nullish(),service_tier:f.string().nullish()}).loose()}).loose(),S=f.object({event_type:f.literal("error"),event_id:f.string().nullish(),error:f.object({code:f.string().nullish(),message:f.string().nullish()}).loose().nullish()}).loose(),k=f.object({event_type:f.string()}).loose();return f.union([n,i,x,v,y,_,b,w,S,k])}())}),E5t=ne(function(){return te(f.object({previousInteractionId:f.string().nullish(),store:f.boolean().nullish(),agent:f.string().nullish(),agentConfig:f.union([f.object({type:f.literal("dynamic")}).loose(),f.object({type:f.literal("deep-research"),thinkingSummaries:f.enum(["auto","none"]).nullish(),visualization:f.enum(["off","auto"]).nullish(),collaborativePlanning:f.boolean().nullish()})]).nullish(),thinkingLevel:f.enum(["minimal","low","medium","high"]).nullish(),thinkingSummaries:f.enum(["auto","none"]).nullish(),responseFormat:f.array(f.union([f.object({type:f.literal("text"),mimeType:f.string().nullish(),schema:f.unknown().nullish()}).loose(),f.object({type:f.literal("image"),mimeType:f.string().nullish(),aspectRatio:f.enum(["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9","1:8","8:1","1:4","4:1"]).nullish(),imageSize:f.enum(["1K","2K","4K","512"]).nullish()}).loose(),f.object({type:f.literal("audio"),mimeType:f.string().nullish()}).loose()])).nullish(),imageConfig:f.object({aspectRatio:f.enum(["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9","1:8","8:1","1:4","4:1"]).nullish(),imageSize:f.enum(["1K","2K","4K","512"]).nullish()}).nullish(),mediaResolution:f.enum(["low","medium","high","ultra_high"]).nullish(),responseModalities:f.array(f.enum(["text","image","audio","video","document"])).nullish(),serviceTier:f.enum(["flex","standard","priority"]).nullish(),systemInstruction:f.string().nullish(),signature:f.string().nullish(),interactionId:f.string().nullish(),pollingTimeoutMs:f.number().int().positive().nullish(),background:f.boolean().nullish(),environment:f.union([f.string(),f.object({type:f.literal("remote"),sources:f.array(f.union([f.object({type:f.literal("gcs"),source:f.string(),target:f.string().nullish()}),f.object({type:f.literal("repository"),source:f.string(),target:f.string().nullish()}),f.object({type:f.literal("inline"),content:f.string(),target:f.string()})])).nullish(),network:f.union([f.literal("disabled"),f.object({allowlist:f.array(f.object({domain:f.string(),transform:f.array(f.record(f.string(),f.string())).nullish()}))})]).nullish()})]).nullish()}))});function m1(param){var e=param.signature,t=param.interactionId;var r={};return e!=null&&(r.signature=e),t!=null&&(r.interactionId=t),Object.keys(r).length>0?{providerMetadata:{google:r}}:{}}var T5t=new Set(["google_search_call","code_execution_call","url_context_call","file_search_call","google_maps_call","mcp_server_tool_call"]),A5t=new Set(["google_search_result","code_execution_result","url_context_result","file_search_result","google_maps_result","mcp_server_tool_result"]);function I5t(e){return e.replace(/_call$/,"")}function P5t(e){return e.replace(/_result$/,"")}function aCe(param){var e=param.steps,t=param.generateId,r=param.interactionId;var n,i,o,a,s,l,c,d,u,p,m,h,g;var x=[],v=!1;if(e==null)return{content:x,hasFunctionCall:v};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var y=_step.value;if(y==null||(typeof y==="undefined"?"undefined":_type_of(y))!="object")continue;var _=y.type;if(typeof _=="string")switch(_){case"user_input":break;case"model_output":{var b=(n=y.content)!=null?n:[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=b[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var w=_step1.value;if(w==null||(typeof w==="undefined"?"undefined":_type_of(w))!="object")continue;var S=w.type;if(S==="text"){var k=(i=w.text)!=null?i:"",E=w.annotations;x.push(_object_spread({type:"text",text:k},m1({interactionId:r})));var C=yG({annotations:E,generateId:t});var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=C[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var T=_step2.value;x.push(T)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}else if(S==="image"){var k10=w;k10.data!=null&&k10.data.length>0?x.push(_object_spread({type:"file",mediaType:(o=k10.mime_type)!=null?o:"image/png",data:{type:"data",data:k10.data}},m1({interactionId:r}))):k10.uri!=null&&k10.uri.length>0&&x.push(_object_spread({type:"file",mediaType:(a=k10.mime_type)!=null?a:"image/png",data:{type:"url",url:new URL(k10.uri)}},m1({interactionId:r})))}else if(S==="video"){var k11=w;k11.data!=null&&k11.data.length>0?x.push(_object_spread({type:"file",mediaType:(s=k11.mime_type)!=null?s:"video/mp4",data:{type:"data",data:k11.data}},m1({interactionId:r}))):k11.uri!=null&&k11.uri.length>0&&x.push(_object_spread({type:"file",mediaType:(l=k11.mime_type)!=null?l:"video/mp4",data:{type:"url",url:new URL(k11.uri)}},m1({interactionId:r})))}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break}case"thought":{var b10=y,S10=(Array.isArray(b10.summary)?b10.summary:[]).filter(function(k){return(k==null?void 0:k.type)==="text"&&typeof k.text=="string"}).map(function(k){return k.text}).join("\n");x.push(_object_spread({type:"reasoning",text:S10},m1({signature:b10.signature,interactionId:r})));break}case"function_call":{v=!0;var b11=y;x.push(_object_spread({type:"tool-call",toolCallId:b11.id,toolName:b11.name,input:JSON.stringify((c=b11.arguments)!=null?c:{})},m1({signature:b11.signature,interactionId:r})));break}default:{if(T5t.has(_)){var b12=y,w10=_==="mcp_server_tool_call"?(d=b12.name)!=null?d:"mcp_server_tool":I5t(_),S11=JSON.stringify((u=b12.arguments)!=null?u:{});x.push({type:"tool-call",toolCallId:(p=b12.id)!=null?p:t(),toolName:w10,input:S11,providerExecuted:!0})}else if(A5t.has(_)){var b13=y,w11=_==="mcp_server_tool_result"?(m=b13.name)!=null?m:"mcp_server_tool":P5t(_);x.push({type:"tool-result",toolCallId:(h=b13.call_id)!=null?h:t(),toolName:w11,result:(g=b13.result)!=null?g:null});var S12=J8e({block:y,generateId:t});var _iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(var _iterator3=S12[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var k12=_step3.value;x.push(k12)}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}break}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{content:x,hasFunctionCall:v}}var R5t=function(){return globalThis.fetch};function sCe(_01){return _async_to_generator(function(param){var e,t,r,tmp,n,i,o,a,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.baseURL,t=param.interactionId,r=param.headers,tmp=param.fetch,n=tmp===void 0?R5t():tmp;if(t==null||t.length===0)return[2];i="".concat(e,"/interactions/").concat(encodeURIComponent(t),"/cancel");_state.label=1;case 1:_state.trys.push([1,7,,8]);return[4,n(i,{method:"POST",headers:Bi(ht({"Content-Type":"application/json"},r),j2()),body:"{}"})];case 2:o=_state.sent();_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,o.text()];case 4:_state.sent();return[3,6];case 5:a=_state.sent();return[3,6];case 6:return[3,8];case 7:o10=_state.sent();return[3,8];case 8:return[2]}})}).apply(this,arguments)}var M5t=new Set(["completed","failed","cancelled","incomplete"]);function _G(e){return e!=null&&M5t.has(e)}var O5t=1e3,$5t=1e4,N5t=30*60*1e3;function D5t(_01){return _async_to_generator(function(param){var e,t,r,n,i,tmp,o,tmp1,a,tmp2,s,l,c,d,u,_ref,_$p,m,h,p,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.baseURL,t=param.interactionId,r=param.headers,n=param.fetch,i=param.abortSignal,tmp=param.initialDelayMs,o=tmp===void 0?O5t:tmp,tmp1=param.maxDelayMs,a=tmp1===void 0?$5t:tmp1,tmp2=param.timeoutMs,s=tmp2===void 0?N5t:tmp2;if(t==null||t.length===0)throw new Error("google.interactions: cannot poll a background interaction without an id. The POST response did not include an interaction id.");l=Date.now(),c=o,d="".concat(e,"/interactions/").concat(encodeURIComponent(t)),u=function(){return sCe({baseURL:e,interactionId:t,headers:r,fetch:n})};_state.label=1;case 1:_state.trys.push([1,9,,12]);_state.label=2;case 2:if(!(i!=null&&i.aborted))return[3,4];return[4,u()];case 3:throw _state.sent(),new DOMException("Polling was aborted","AbortError");case 4:if(Date.now()-l>s)throw new Error("google.interactions: timed out polling interaction ".concat(t," after ").concat(s,"ms."));return[4,Bu(c,{abortSignal:i})];case 5:_state.sent();return[4,$a({url:d,validateUrl:!1,headers:r,failedResponseHandler:Tl,successfulResponseHandler:wt(vG),abortSignal:i,fetch:n})];case 6:_ref=_state.sent(),_$p=_ref.value,m=_ref.rawValue,h=_ref.responseHeaders;if(_G(_$p.status))return[2,{response:_$p,rawResponse:m,responseHeaders:h}];c=Math.min(c*2,a);_state.label=7;case 7:return[3,2];case 8:return[3,12];case 9:p=_state.sent();_tmp=Kl(p);if(!_tmp)return[3,11];return[4,u()];case 10:_tmp=_state.sent();_state.label=11;case 11:throw _tmp,p;case 12:return[2]}})}).apply(this,arguments)}function L5t(param){var e=param.tools,t=param.toolChoice;var r,n,i,o;var a=[],s=e!=null&&e.length?e:void 0;if(s==null)return{tools:void 0,toolChoice:void 0,toolWarnings:a};var l=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var u=_step.value;if(u.type==="function"){l.push({type:"function",name:u.name,description:(r=u.description)!=null?r:"",parameters:u.inputSchema});continue}if(u.type==="provider"){var p=(n=u.args)!=null?n:{};switch(u.id){case"google.google_search":{var m=p.searchTypes,h=void 0;if(m!=null&&(typeof m==="undefined"?"undefined":_type_of(m))=="object"){var g=[];m.webSearch!=null&&g.push("web_search"),m.imageSearch!=null&&g.push("image_search"),g.length>0&&(h=g)}l.push(_object_spread({type:"google_search"},h!=null?{search_types:h}:{}));break}case"google.code_execution":{l.push({type:"code_execution"});break}case"google.url_context":{l.push({type:"url_context"});break}case"google.file_search":{l.push(_object_spread({type:"file_search"},p.fileSearchStoreNames!=null?{file_search_store_names:p.fileSearchStoreNames}:{},p.topK!=null?{top_k:p.topK}:{},p.metadataFilter!=null?{metadata_filter:p.metadataFilter}:{}));break}case"google.google_maps":{l.push(_object_spread({type:"google_maps"},p.latitude!=null?{latitude:p.latitude}:{},p.longitude!=null?{longitude:p.longitude}:{},p.enableWidget!=null?{enable_widget:p.enableWidget}:{}));break}case"google.computer_use":{l.push(_object_spread({type:"computer_use",environment:(i=p.environment)!=null?i:"browser"},p.excludedPredefinedFunctions!=null?{excludedPredefinedFunctions:p.excludedPredefinedFunctions}:{}));break}case"google.mcp_server":{l.push(_object_spread({type:"mcp_server"},p.name!=null?{name:p.name}:{},p.url!=null?{url:p.url}:{},p.headers!=null?{headers:p.headers}:{},p.allowedTools!=null?{allowed_tools:p.allowedTools}:{}));break}case"google.retrieval":{var m10=(o=p.vertexAiSearchConfig)!=null?o:void 0;l.push(_object_spread({type:"retrieval"},p.retrievalTypes!=null?{retrieval_types:p.retrievalTypes}:{retrieval_types:["vertex_ai_search"]},m10!=null?{vertex_ai_search_config:m10}:{}));break}default:{a.push({type:"unsupported",feature:"provider-defined tool ".concat(u.id),details:"provider-defined tool ".concat(u.id," is not supported by google.interactions; tool dropped.")});break}}continue}a.push({type:"unsupported",feature:"tool of type ".concat(u.type),details:"Only function tools and google.* provider-defined tools are supported by google.interactions; tool dropped."})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var c=l.some(function(u){return u.type==="function"}),d;if(t!=null&&c)switch(t.type){case"auto":d="auto";break;case"required":d="any";break;case"none":d="none";break;case"tool":d={allowed_tools:{mode:"validated",tools:[t.toolName]}};break}return{tools:l.length>0?l:void 0,toolChoice:d,toolWarnings:a}}var F5t=3,z5t=500;function j5t(param){var e=param.baseURL,t=param.interactionId,r=param.headers,n=param.fetch,i=param.abortSignal,tmp=param.maxRetries,o=tmp===void 0?F5t:tmp,tmp1=param.retryDelayMs,a=tmp1===void 0?z5t:tmp1;if(t.length===0)throw new Error("google.interactions: cannot stream a background interaction without an id.");var s=_object_spread_props(_object_spread({},r),{accept:"text/event-stream"}),l,c=!1,d=0,u=!1,p,m=new AbortController,h=function(){return m.abort()};i!=null&&(i.aborted?m.abort():i.addEventListener("abort",h,{once:!0}));var g=m.signal;function x(){var y="".concat(e,"/interactions/").concat(encodeURIComponent(t)),_=new URLSearchParams({stream:"true"});return l!=null&&_.set("last_event_id",l),"".concat(y,"?").concat(_.toString())}function v(){return _async_to_generator(function(){var _ref,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,$a({url:x(),validateUrl:!1,headers:s,failedResponseHandler:Tl,successfulResponseHandler:Oo(oCe),abortSignal:g,fetch:n})];case 1:_ref=_state.sent(),y=_ref.value;return[2,y.getReader()]}})})()}return new ReadableStream({start:function start(y){return _async_to_generator(function(){var _,_ref,_$_,b,w,_10,_11,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,16,17,20]);_state.label=1;case 1:if(!(!c&&!g.aborted))return[3,15];if(!(p==null))return[3,6];_state.label=2;case 2:_state.trys.push([2,4,,6]);return[4,v()];case 3:p=_state.sent(),u=!1;return[3,6];case 4:_=_state.sent();if(Kl(_)||g.aborted){y.error(_);return[2]}if(d++,d>=o){y.error(_);return[2]}return[4,Bu(a*d,{abortSignal:g})];case 5:_state.sent();return[3,14];case 6:_state.trys.push([6,12,,14]);return[4,p.read()];case 7:_ref=_state.sent(),_$_=_ref.done,b=_ref.value;if(!_$_)return[3,11];if(p=void 0,c)return[3,15];if(!u)return[3,8];d=0;return[3,10];case 8:if(d++,d>=o){y.error(new Error("google.interactions: SSE stream closed without producing any events."));return[2]}return[4,Bu(a*d,{abortSignal:g})];case 9:_state.sent();_state.label=10;case 10:return[3,14];case 11:if(u=!0,b.success){w=b.value;typeof w.event_id=="string"&&w.event_id.length>0&&(l=w.event_id),(w.event_type==="interaction.completed"||w.event_type==="error")&&(c=!0)}y.enqueue(b);return[3,14];case 12:_10=_state.sent();if(Kl(_10)||g.aborted){y.error(_10);return[2]}if(p=void 0,d++,d>=o){y.error(_10);return[2]}return[4,Bu(a*d,{abortSignal:g})];case 13:_state.sent();return[3,14];case 14:return[3,1];case 15:y.close();return[3,20];case 16:_11=_state.sent();y.error(_11);return[3,20];case 17:i!=null&&i.removeEventListener("abort",h),p==null||p.cancel().catch(function(){}),p=void 0;_tmp=g.aborted&&!c;if(!_tmp)return[3,19];return[4,sCe({baseURL:e,interactionId:t,headers:r,fetch:n})];case 18:_tmp=_state.sent();_state.label=19;case 19:_tmp;return[7];case 20:return[2]}})})()},cancel:function cancel(){m.abort(),p==null||p.cancel().catch(function(){}),p=void 0}})}function U5t(param){var e=param.response,t=param.warnings,r=param.generateId,n=param.includeRawChunks,i=param.headerServiceTier;return new ReadableStream({start:function start(o){var a,s,l;o.enqueue({type:"stream-start",warnings:t});var c=typeof e.id=="string"&&e.id.length>0?e.id:void 0,d,u=e.created;if(typeof u=="string"){var _=new Date(u);Number.isNaN(_.getTime())||(d=_)}o.enqueue(_object_spread(_object_spread_props(_object_spread({type:"response-metadata"},c!=null?{id:c}:{}),{modelId:(a=e.model)!=null?a:void 0}),d?{timestamp:d}:{})),n&&o.enqueue({type:"raw",rawValue:e});var _aCe=aCe({steps:(s=e.steps)!=null?s:null,generateId:r,interactionId:c}),p=_aCe.content,m=_aCe.hasFunctionCall,h=0,g=function(){return"".concat(c!=null?c:"agent",":").concat(h++)};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=p[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _10=_step.value;switch(_10.type){case"text":{var b=g(),w=_10.providerMetadata;o.enqueue({type:"text-start",id:b}),_10.text.length>0&&o.enqueue({type:"text-delta",id:b,delta:_10.text}),o.enqueue(_object_spread({type:"text-end",id:b},w?{providerMetadata:w}:{}));break}case"reasoning":{var b10=g(),w10=_10.providerMetadata;o.enqueue({type:"reasoning-start",id:b10}),_10.text.length>0&&o.enqueue({type:"reasoning-delta",id:b10,delta:_10.text}),o.enqueue(_object_spread({type:"reasoning-end",id:b10},w10?{providerMetadata:w10}:{}));break}case"tool-call":{var b11=_10.providerMetadata;o.enqueue(_object_spread({type:"tool-input-start",id:_10.toolCallId,toolName:_10.toolName},_10.providerExecuted?{providerExecuted:_10.providerExecuted}:{})),o.enqueue({type:"tool-input-delta",id:_10.toolCallId,delta:_10.input}),o.enqueue({type:"tool-input-end",id:_10.toolCallId}),o.enqueue(_object_spread({type:"tool-call",toolCallId:_10.toolCallId,toolName:_10.toolName,input:_10.input},_10.providerExecuted?{providerExecuted:_10.providerExecuted}:{},b11?{providerMetadata:b11}:{}));break}case"tool-result":{o.enqueue({type:"tool-result",toolCallId:_10.toolCallId,toolName:_10.toolName,result:_10.result});break}case"source":case"file":{o.enqueue(_10);break}default:break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var x=(l=e.service_tier)!=null?l:i,v={unified:kG({status:e.status,hasFunctionCall:m}),raw:e.status},y={google:_object_spread({},c!=null?{interactionId:c}:{},x!=null?{serviceTier:x}:{})};o.enqueue({type:"finish",finishReason:v,usage:SG(e.usage),providerMetadata:y}),o.close()}})}var B5t=/*#__PURE__*/function(){"use strict";function lCe(t,r){_class_call_check(this,lCe);this.specificationVersion="v4",typeof t=="string"?(this.modelId=t,this.agent=void 0):"managedAgent"in t?(this.modelId=t.managedAgent,this.agent=t.managedAgent):(this.modelId=t.agent,this.agent=t.agent),this.config=r}_create_class(lCe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"supportedUrls",get:function get1(){return this.config.supportedUrls?this.config.supportedUrls():{"image/*":[/^https?:\/\/.+/],"application/pdf":[/^https?:\/\/.+/],"audio/*":[/^https?:\/\/.+/],"video/*":[/^https?:\/\/(www\.)?youtube\.com\/watch\?v=.+/,/^https?:\/\/youtu\.be\/.+/,/^gs:\/\/.+/]}}},{key:"getArgs",value:function getArgs(t){return _async_to_generator(function(){var _$_O,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,D,_$_O1,re,L,re1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,re2,_$_5t,ee,pe,N,U,G,K,re3,re4,me,re5,V,re6,de,xe;return _ts_generator(this,function(_state){switch(_state.label){case 0:O=[];return[4,$t({provider:"google",providerOptions:t.providerOptions,schema:E5t})];case 1:M=_state.sent(),R=this.agent!=null,$=t.tools!=null&&t.tools.length>0;if($){;re=L5t({tools:t.tools,toolChoice:t.toolChoice});z=re.tools,D=re.toolChoice,(_$_O1=O).push.apply(_$_O1,_to_consumable_array(re.toolWarnings))}L=[];if(((r=t.responseFormat)==null?void 0:r.type)==="json")if(R)O.push({type:"other",message:"google.interactions: structured output (responseFormat) is not supported when an agent is set; responseFormat will be ignored."});else{re1=_object_spread({type:"text",mime_type:"application/json"},t.responseFormat.schema!=null?{schema:t.responseFormat.schema}:{});L.push(re1)}_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if((M==null?void 0:M.responseFormat)!=null)try{for(_iterator=M.responseFormat[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){re2=_step.value;re2.type==="text"?L.push(jf({type:"text",mime_type:(n=re2.mimeType)!=null?n:void 0,schema:(i=re2.schema)!=null?i:void 0})):re2.type==="image"?L.push(jf({type:"image",mime_type:(o=re2.mimeType)!=null?o:void 0,aspect_ratio:(a=re2.aspectRatio)!=null?a:void 0,image_size:(s=re2.imageSize)!=null?s:void 0})):re2.type==="audio"&&L.push(jf({type:"audio",mime_type:(l=re2.mimeType)!=null?l:void 0}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_$_5t=_5t({prompt:t.prompt,previousInteractionId:(c=M==null?void 0:M.previousInteractionId)!=null?c:void 0,store:(d=M==null?void 0:M.store)!=null?d:void 0,mediaResolution:(u=M==null?void 0:M.mediaResolution)!=null?u:void 0}),ee=_$_5t.input,pe=_$_5t.systemInstruction,N=_$_5t.warnings;(_$_O=O).push.apply(_$_O,_to_consumable_array(N));U=pe,G=(p=M==null?void 0:M.systemInstruction)!=null?p:void 0;U!=null&&G!=null?O.push({type:"other",message:"google.interactions: both AI SDK system message and providerOptions.google.systemInstruction were set; using the AI SDK system message."}):U==null&&G!=null&&(U=G);if(R){re3=[];t.temperature!=null&&re3.push("temperature"),t.topP!=null&&re3.push("topP"),t.seed!=null&&re3.push("seed"),t.stopSequences!=null&&t.stopSequences.length>0&&re3.push("stopSequences"),t.maxOutputTokens!=null&&re3.push("maxOutputTokens"),(M==null?void 0:M.thinkingLevel)!=null&&re3.push("thinkingLevel"),(M==null?void 0:M.thinkingSummaries)!=null&&re3.push("thinkingSummaries"),(M==null?void 0:M.imageConfig)!=null&&re3.push("imageConfig"),re3.length>0&&O.push({type:"other",message:"google.interactions: ".concat(re3.join(", ")," ").concat(re3.length===1?"is":"are"," not supported when an agent is set; use providerOptions.google.agentConfig instead. Dropped from the request body.")}),K=void 0}else if(K=jf({temperature:(m=t.temperature)!=null?m:void 0,top_p:(h=t.topP)!=null?h:void 0,seed:(g=t.seed)!=null?g:void 0,stop_sequences:t.stopSequences!=null&&t.stopSequences.length>0?t.stopSequences:void 0,max_output_tokens:(x=t.maxOutputTokens)!=null?x:void 0,thinking_level:(v=M==null?void 0:M.thinkingLevel)!=null?v:void 0,thinking_summaries:(y=M==null?void 0:M.thinkingSummaries)!=null?y:void 0,tool_choice:D}),(M==null?void 0:M.imageConfig)!=null){re4=L.some(function(de){return de.type==="image"});O.push({type:"other",message:re4?"google.interactions: providerOptions.google.imageConfig is deprecated and was ignored because providerOptions.google.responseFormat already supplies an image entry. Use responseFormat exclusively.":'google.interactions: providerOptions.google.imageConfig is deprecated. Use providerOptions.google.responseFormat with a { type: "image", ... } entry instead.'}),re4||L.push(_object_spread({type:"image",mime_type:"image/png"},M.imageConfig.aspectRatio!=null?{aspect_ratio:M.imageConfig.aspectRatio}:{},M.imageConfig.imageSize!=null?{image_size:M.imageConfig.imageSize}:{}))}if(R&&(M==null?void 0:M.agentConfig)!=null){re5=M.agentConfig;re5.type==="deep-research"?me=jf({type:"deep-research",thinking_summaries:(_=re5.thinkingSummaries)!=null?_:void 0,visualization:(b=re5.visualization)!=null?b:void 0,collaborative_planning:(w=re5.collaborativePlanning)!=null?w:void 0}):re5.type==="dynamic"&&(me={type:"dynamic"})}if((M==null?void 0:M.environment)!=null)if(!R)O.push({type:"other",message:"google.interactions: environment is only supported when an agent is set; environment will be omitted from the request body."});else if(typeof M.environment=="string")V=M.environment;else{re6=M.environment,de=(S=re6.sources)==null?void 0:S.map(function(Y){var oe;return Y.type==="inline"?{type:"inline",content:Y.content,target:Y.target}:jf({type:Y.type,source:Y.source,target:(oe=Y.target)!=null?oe:void 0})});re6.network==="disabled"?xe="disabled":re6.network!=null&&(xe={allowlist:re6.network.allowlist.map(function(Y){var oe;return jf({domain:Y.domain,transform:(oe=Y.transform)!=null?oe:void 0})})}),V=jf({type:"remote",sources:de!=null&&de.length>0?de:void 0,network:xe})}return[2,{args:jf(_object_spread_props(_object_spread({},R?{agent:this.agent}:{model:this.modelId}),{input:ee,system_instruction:U,tools:z,response_format:L.length>0?L:void 0,response_modalities:(M==null?void 0:M.responseModalities)!=null?M.responseModalities:void 0,previous_interaction_id:(k=M==null?void 0:M.previousInteractionId)!=null?k:void 0,service_tier:(E=M==null?void 0:M.serviceTier)!=null?E:void 0,store:(C=M==null?void 0:M.store)!=null?C:void 0,generation_config:K!=null&&Object.keys(K).length>0?K:void 0,agent_config:me,environment:V,background:(T=M==null?void 0:M.background)!=null?T:void 0})),warnings:O,isAgent:R,isBackground:(M==null?void 0:M.background)===!0,pollingTimeoutMs:(I=M==null?void 0:M.pollingTimeoutMs)!=null?I:void 0}]}})}).call(this)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,_ref,l,c,d,u,p,m,h,g,x,v,_tmp,T,y,_aCe,_,b,w,S,k,E,C,T1;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),l=_ref.args,c=_ref.warnings,d=_ref.isAgent,u=_ref.pollingTimeoutMs,p="".concat(this.config.baseURL,"/interactions");if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:m=ht.apply(void 0,[_tmp,t.headers]);return[4,zt({url:p,headers:m,body:l,failedResponseHandler:Tl,successfulResponseHandler:wt(vG),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 5:h=_state.sent(),g=h.responseHeaders,x=h.value,v=h.rawValue;if(!(d&&!_G(x.status)))return[3,7];return[4,D5t({baseURL:this.config.baseURL,interactionId:x.id,headers:m,fetch:this.config.fetch,abortSignal:t.abortSignal,timeoutMs:u})];case 6:T=_state.sent();x=T.response,v=T.rawResponse,g=(r=T.responseHeaders)!=null?r:g;_state.label=7;case 7:y=typeof x.id=="string"&&x.id.length>0?x.id:void 0,_aCe=aCe({steps:(n=x.steps)!=null?n:null,generateId:(i=this.config.generateId)!=null?i:Qr,interactionId:y}),_=_aCe.content,b=_aCe.hasFunctionCall,w={unified:kG({status:x.status,hasFunctionCall:b}),raw:x.status},S=(a=(o=x.service_tier)!=null?o:g==null?void 0:g["x-gemini-service-tier"])!=null?a:void 0,k=Z8e(x.usage),E={google:_object_spread({},y!=null?{interactionId:y}:{},S!=null?{serviceTier:S}:{},k!=null?{outputTokensByModality:k}:{})};if(typeof x.created=="string"){T1=new Date(x.created);Number.isNaN(T1.getTime())||(C=T1)}return[2,{content:_,finishReason:w,usage:SG(x.usage),warnings:c,providerMetadata:E,request:{body:l},response:_object_spread_props(_object_spread({headers:g,body:v},y!=null?{id:y}:{},C?{timestamp:C}:{}),{modelId:(s=x.model)!=null?s:void 0})}]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,_ref,n,i,o,a,s,l,_tmp,c,_ref1,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),n=_ref.args,i=_ref.warnings,o=_ref.isBackground,a=_ref.pollingTimeoutMs,s="".concat(this.config.baseURL,"/interactions");if(!this.config.headers)return[3,3];return[4,Kt(this.config.headers)];case 2:_tmp=_state.sent();return[3,4];case 3:_tmp=void 0;_state.label=4;case 4:l=ht.apply(void 0,[_tmp,t.headers]);if(o)return[2,this.doStreamBackground({args:n,warnings:i,url:s,mergedHeaders:l,options:t,pollingTimeoutMs:a})];c=_object_spread_props(_object_spread({},n),{stream:!0});return[4,zt({url:s,headers:l,body:c,failedResponseHandler:Tl,successfulResponseHandler:Oo(oCe),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 5:_ref1=_state.sent(),d=_ref1.responseHeaders,u=_ref1.value,p=d==null?void 0:d["x-gemini-service-tier"],m=$8e({warnings:i,generateId:(r=this.config.generateId)!=null?r:Qr,includeRawChunks:t.includeRawChunks,serviceTier:p});return[2,{stream:u.pipeThrough(m),request:{body:c},response:{headers:d}}]}})}).call(this)}},{key:"doStreamBackground",value:function doStreamBackground(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.args,r=param.warnings,n=param.url,i=param.mergedHeaders,o=param.options,a=param.pollingTimeoutMs;return[4,zt({url:n,headers:i,body:t,failedResponseHandler:Tl,successfulResponseHandler:wt(vG),abortSignal:o.abortSignal,fetch:this.config.fetch})];case 1:c=_state.sent(),d=c.responseHeaders,u=c.value,p=u.id;if(p==null||p.length===0)throw new Error("google.interactions: background POST response did not include an interaction id; cannot stream the result.");m=d==null?void 0:d["x-gemini-service-tier"];if(_G(u.status))return[2,{stream:U5t({response:u,warnings:r,generateId:(s=this.config.generateId)!=null?s:Qr,includeRawChunks:o.includeRawChunks,headerServiceTier:m}),request:{body:t},response:{headers:d}}];h=j5t({baseURL:this.config.baseURL,interactionId:p,headers:i,fetch:this.config.fetch,abortSignal:o.abortSignal}),g=$8e({warnings:r,generateId:(l=this.config.generateId)!=null?l:Qr,includeRawChunks:o.includeRawChunks,serviceTier:m});return[2,{stream:h.pipeThrough(g),request:{body:t},response:{headers:d}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return _object_spread_props(_object_spread({},Sr({modelId:t.modelId,config:t.config})),{agent:t.agent})}},{key:br,value:function value(t){return new lCe(t.agent!=null?{agent:t.agent}:t.modelId,t.config)}}]);return lCe}();function jf(e){var t={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];n!==void 0&&(t[r]=n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function uCe(e){var t=new URL(e),r=t.pathname.split("/"),n=r.at(-1);return(n==="v1beta"||n==="v1alpha")&&(r.pop(),t.pathname=r.join("/")||"/"),t}function cCe(e,t){var r=uCe(e);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="".concat(r.pathname.replace(/\/$/,""),"/ws/").concat(t),r}function L8e(e){return e!=null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)}var q5t=/*#__PURE__*/function(){"use strict";function q5t1(){_class_call_check(this,q5t1);this.turnCounter=0,this.hasAudio=!1,this.hasText=!1,this.hasTranscript=!1,this.turnClosed=!1,this.inputAudioRate=16e3}_create_class(q5t1,[{key:"responseId",get:function get1(){return"google-resp-".concat(this.turnCounter)}},{key:"itemId",get:function get1(){return"google-item-".concat(this.turnCounter)}},{key:"beginTurnIfClosed",value:function beginTurnIfClosed(){this.turnClosed&&(this.turnCounter++,this.hasAudio=!1,this.hasText=!1,this.hasTranscript=!1,this.turnClosed=!1)}},{key:"parseServerEvent",value:function parseServerEvent(e){var _this=this;var t,r;var n=e;return n.setupComplete!=null?{type:"session-created",raw:e}:n.toolCall!=null?(this.beginTurnIfClosed(),((t=n.toolCall.functionCalls)!=null?t:[]).flatMap(function(o){var a;var s=JSON.stringify((a=o.args)!=null?a:{});return[{type:"function-call-arguments-delta",responseId:_this.responseId,itemId:_this.itemId,callId:o.id,delta:s,raw:e},{type:"function-call-arguments-done",responseId:_this.responseId,itemId:_this.itemId,callId:o.id,name:o.name,arguments:s,raw:e}]})):n.toolCallCancellation!=null?{type:"custom",rawType:"toolCallCancellation",raw:e}:n.goAway!=null?{type:"custom",rawType:"goAway",raw:e}:n.sessionResumptionUpdate!=null?{type:"custom",rawType:"sessionResumptionUpdate",raw:e}:n.serverContent!=null?this.parseServerContent(n.serverContent,e):((r=n.inputTranscription)==null?void 0:r.text)!=null?{type:"input-transcription-completed",itemId:"google-input-".concat(this.turnCounter),transcript:n.inputTranscription.text,raw:e}:{type:"custom",rawType:String(Object.keys(n)[0]),raw:e}}},{key:"parseServerContent",value:function parseServerContent(e,t){var r,n,i,o;var a=[];if(e.interrupted&&a.push({type:"speech-started",raw:t}),(r=e.modelTurn)!=null&&r.parts){this.beginTurnIfClosed();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.modelTurn.parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;(n=s.inlineData)!=null&&n.data&&(this.hasAudio=!0,a.push({type:"audio-delta",responseId:this.responseId,itemId:this.itemId,delta:s.inlineData.data,raw:t})),s.text&&(this.hasText=!0,a.push({type:"text-delta",responseId:this.responseId,itemId:this.itemId,delta:s.text,raw:t}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return(i=e.outputTranscription)!=null&&i.text&&(this.hasTranscript=!0,a.push({type:"audio-transcript-delta",responseId:this.responseId,itemId:this.itemId,delta:e.outputTranscription.text,raw:t})),(o=e.inputTranscription)!=null&&o.text&&a.push({type:"input-transcription-completed",itemId:"google-input-".concat(this.turnCounter),transcript:e.inputTranscription.text,raw:t}),e.generationComplete&&a.push({type:"custom",rawType:"generationComplete",raw:t}),e.turnComplete&&(this.hasAudio&&a.push({type:"audio-done",responseId:this.responseId,itemId:this.itemId,raw:t}),this.hasText&&a.push({type:"text-done",responseId:this.responseId,itemId:this.itemId,raw:t}),this.hasTranscript&&a.push({type:"audio-transcript-done",responseId:this.responseId,itemId:this.itemId,raw:t}),a.push({type:"response-done",responseId:this.responseId,status:"completed",raw:t}),this.turnClosed=!0),a.length===0?{type:"custom",rawType:"serverContent",raw:t}:a.length===1?a[0]:a}},{key:"serializeClientEvent",value:function serializeClientEvent(e,t){var r;switch(e.type){case"session-update":return((r=e.config.inputAudioFormat)==null?void 0:r.rate)!=null&&(this.inputAudioRate=e.config.inputAudioFormat.rate),{setup:bG(e.config,t)};case"input-audio-append":return{realtimeInput:{audio:{data:e.audio,mimeType:"audio/pcm;rate=".concat(this.inputAudioRate)}}};case"input-audio-commit":return{realtimeInput:{audioStreamEnd:!0}};case"input-audio-clear":case"response-create":case"response-cancel":case"conversation-item-truncate":return null;case"conversation-item-create":{var n=e.item;switch(n.type){case"text-message":return{realtimeInput:{text:n.text}};case"function-call-output":return W5t(n);case"audio-message":return null}break}}return null}}]);return q5t1}();function W5t(e){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Ji({text:e.output})];case 1:t=_state.sent(),r=t.success?t.value:{};return[2,{toolResponse:{functionResponses:[{id:e.callId,name:e.name,response:r}]}}]}})})()}function bG(e,t){var r={model:AP(t)},n={};if((e==null?void 0:e.outputModalities)!=null?n.responseModalities=e.outputModalities.map(function(s){return s.toUpperCase()}):n.responseModalities=["AUDIO"],(e==null?void 0:e.voice)!=null&&(n.speechConfig={voiceConfig:{prebuiltVoiceConfig:{voiceName:e.voice}}}),r.generationConfig=n,(e==null?void 0:e.instructions)!=null&&(r.systemInstruction={parts:[{text:e.instructions}]}),(e==null?void 0:e.tools)!=null&&e.tools.length>0&&(r.tools=[{functionDeclarations:e.tools.map(function(s){return{name:s.name,description:s.description,parameters:ac(s.parameters)}})}]),(e==null?void 0:e.inputAudioTranscription)!=null&&(r.inputAudioTranscription={}),(e==null?void 0:e.outputAudioTranscription)!=null&&(r.outputAudioTranscription={}),(e==null?void 0:e.providerOptions)==null)return r;var _e_providerOptions=e.providerOptions,i=_e_providerOptions.google,o=_object_without_properties(_e_providerOptions,["google"]);Object.assign(r,o);var a=L8e(i)?i:void 0;if((a==null?void 0:a.translationConfig)!=null){var s=L8e(r.generationConfig)?r.generationConfig:n;r.generationConfig=_object_spread_props(_object_spread({},s),{translationConfig:a.translationConfig})}return r}var V5t="google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentConstrained";function G5t(e){var t=uCe(e);return t.pathname="".concat(t.pathname.replace(/\/$/,""),"/v1alpha/auth_tokens"),t.toString()}function H5t(e){return cCe(e,V5t).toString()}var Z5t=/*#__PURE__*/function(){"use strict";function Z5t1(e,t){_class_call_check(this,Z5t1);this.specificationVersion="v4",this.mapper=new q5t,this.modelId=e,this.provider=t.provider,this.config=t}_create_class(Z5t1,[{key:"doCreateClientSecret",value:function doCreateClientSecret(e){return _async_to_generator(function(){var t,r,n,o,a,s,l,c,d,u,m,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=(t=this.config.fetch)!=null?t:fetch,o=this.config.headers()["x-goog-api-key"];if(!o)throw new Error("Google Generative AI API key is required for realtime token creation.");a=Date.now(),s=((r=e.expiresAfterSeconds)!=null?r:60)*1e3,l=new Date(a+s).toISOString(),c=new Date(a+s+30*60*1e3).toISOString(),d=bG(e.sessionConfig,this.modelId);return[4,n("".concat(G5t(this.config.baseURL),"?key=").concat(encodeURIComponent(o)),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uses:0,expireTime:c,newSessionExpireTime:l,bidiGenerateContentSetup:d})})];case 1:u=_state.sent();if(!!u.ok)return[3,3];return[4,u.text()];case 2:m=_state.sent();throw new Error("Google realtime auth token request failed: ".concat(u.status," ").concat(m));case 3:return[4,u.json()];case 4:p=_state.sent();return[2,{token:p.name,url:H5t(this.config.baseURL),expiresAt:p.expireTime?Math.floor(new Date(p.expireTime).getTime()/1e3):void 0}]}})}).call(this)}},{key:"getWebSocketConfig",value:function getWebSocketConfig(e){return{url:"".concat(e.url,"?access_token=").concat(encodeURIComponent(e.token))}}},{key:"parseServerEvent",value:function parseServerEvent(e){return this.mapper.parseServerEvent(e)}},{key:"serializeClientEvent",value:function serializeClientEvent(e){return this.mapper.serializeClientEvent(e,this.modelId)}},{key:"buildSessionConfig",value:function buildSessionConfig(e){return bG(e,this.modelId)}}]);return Z5t1}(),K5t=ne(function(){return te(f.object({echoTargetLanguage:f.boolean().optional()}))}),Q5t="google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent",J5t=1e3,Y5t=24e3,X5t=128;function ekt(e,t){var r=cCe(e,Q5t);return r.searchParams.set("key",t),r}var tkt=/*#__PURE__*/function(){"use strict";function dCe(t,r){_class_call_check(this,dCe);this.specificationVersion="v4",this.modelId=t,this.config=r}_create_class(dCe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,g,x,m,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.targetLanguage==null)throw new il({argument:"targetLanguage",message:"targetLanguage is required for translation model '".concat(this.modelId,"'.")});l=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,$t({provider:"google",providerOptions:t.providerOptions,schema:K5t})];case 1:c=_state.sent(),d=[];akt(t.inputAudioFormat),t.sourceLanguage!=null&&d.push({type:"unsupported",feature:"sourceLanguage",details:"The Gemini Live translation API auto-detects the source language and does not accept a source language."}),t.outputAudioFormat!=null&&d.push({type:"unsupported",feature:"outputAudioFormat",details:"The Gemini Live API always outputs 24kHz 16-bit PCM audio and does not accept an output audio format."});u=ht(this.config.headers(),t.headers);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=Object.entries(u)[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){_step_value=_sliced_to_array(_step.value,2),g=_step_value[0],x=_step_value[1];g.toLowerCase()==="x-goog-api-key"&&x!=null&&(p=x)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(p==null)throw new Error("Google Generative AI API key is required for streaming translation.");m=Object.fromEntries(Object.entries(u).filter(function(param){var _param=_sliced_to_array(param,1),g=_param[0];return g.toLowerCase()!=="x-goog-api-key"})),h=okt({modelId:this.modelId,targetLanguage:t.targetLanguage,providerOptions:c});return[2,{request:{body:h},response:{timestamp:l,modelId:this.modelId},stream:rkt({webSocket:this.config.webSocket,url:ekt(this.config.baseURL,p),headers:m,setup:h,inputAudioRate:(o=t.inputAudioFormat.rate)!=null?o:16e3,finishGraceMs:(s=(a=this.config._internal)==null?void 0:a.finishGraceMs)!=null?s:J5t,warnings:d,audio:t.audio,abortSignal:t.abortSignal,includeRawChunks:t.includeRawChunks})}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new dCe(t.modelId,t.config)}}]);return dCe}();function rkt(param){var e=param.webSocket,t=param.url,r=param.headers,n=param.setup,i=param.inputAudioRate,o=param.finishGraceMs,a=param.warnings,s=param.audio,l=param.abortSignal,c=param.includeRawChunks;var d=!1,u=function(){};return new ReadableStream({start:function(p){var m,h,g,x=new Promise(function(pe){g=pe}),v=0,y="",_="",b="",w="",S=!1,k,E=!1,C=!1,T=0,I,O=function(){return"google-item-".concat(v)},M=function(){I!=null&&(clearTimeout(I),I=void 0)},R=function(){d||I!=null||(I=setTimeout(function(){I=void 0,D()},o))},$=function(){E=!0,T=0,M()};u=function(pe){M(),m!=null?m.cancel().catch(function(){}):s.cancel().catch(function(){}),h==null||h.close(pe)};var z=function(pe){d||(d=!0,u(),p.error(pe))},D=function(){d||((_!==""||w!=="")&&L(),d=!0,p.enqueue({type:"finish",sourceText:y,outputText:b,usage:k}),p.close(),u(1e3))},L=function(){_!==""&&(p.enqueue({type:"source-transcript-final",id:O(),text:_}),y+=_,_=""),w!==""&&(p.enqueue({type:"output-text-final",id:O(),text:w}),b+=w,w=""),v++},ee=function(pe){return _async_to_generator(function(){var _ref,N,U;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=s.getReader();_state.label=1;case 1:_state.trys.push([1,,7,8]);_state.label=2;case 2:return[4,m.read()];case 3:_ref=_state.sent(),N=_ref.done,U=_ref.value;if(N||d)return[3,6];pe.send(JSON.stringify({realtimeInput:{audio:{data:Fr(U),mimeType:"audio/pcm;rate=".concat(i)}}}));return[4,sh(pe)];case 4:_state.sent();_state.label=5;case 5:return[3,2];case 6:return[3,8];case 7:m.releaseLock(),m=void 0;return[7];case 8:d||(pe.send(JSON.stringify({realtimeInput:{audioStreamEnd:!0}})),S=!0,C&&!E&&R());return[2]}})})()};h=lh({url:t,headers:r,webSocket:e,abortSignal:l,onAbort:z,onProcessingError:z,onOpen:function(pe){p.enqueue({type:"stream-start",warnings:a}),pe.send(JSON.stringify({setup:n})),x.then(function(){return d?void 0:ee(pe)}).catch(z)},onMessageText:function(pe){return _async_to_generator(function(){var N,U,G,K,me,V,ie,re,de,xe,Y,oe,H,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,J,j;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(d)return[2];return[4,Ji({text:pe})];case 1:xe=_state.sent();if(!xe.success)return[2];Y=xe.value;if(c&&p.enqueue({type:"raw",rawValue:Y}),Y.setupComplete!=null&&g(),Y.usageMetadata!=null&&(k=nkt(k,Y.usageMetadata)),Y.error!=null){z(new Error((N=Y.error.message)!=null?N:"Google Live API error"));return[2]}oe=(me=(G=(U=Y.serverContent)==null?void 0:U.inputTranscription)==null?void 0:G.text)!=null?me:(K=Y.inputTranscription)==null?void 0:K.text;oe&&($(),_+=oe,p.enqueue({type:"source-transcript-delta",id:O(),delta:oe}));H=Y.serverContent;if(H!=null){_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=((ie=(V=H.modelTurn)==null?void 0:V.parts)!=null?ie:[])[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){J=_step.value;if((re=J.inlineData)!=null&&re.data){p.enqueue({type:"audio",id:O(),audio:J.inlineData.data});j=ikt(J.inlineData.data);if(S&&j!=null){if(T+=j,T>=o){D();return[2]}}else $()}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}(de=H.outputTranscription)!=null&&de.text&&($(),w+=H.outputTranscription.text,p.enqueue({type:"output-text-delta",id:O(),delta:H.outputTranscription.text})),H.turnComplete&&(L(),E=!1,C=!0,S&&R())}return[2]}})})()},onSocketError:function(){z(new Error("Google Live translation error"))},onClose:function(param){var pe=param.code,N=param.reason;if(!d){if(I!=null){D();return}z(new Error("Google Live translation WebSocket closed unexpectedly before finishing (code ".concat(pe!=null?pe:"unknown").concat(N?", reason: ".concat(N):"",").")))}}})},cancel:function(){d||(d=!0,u())}})}function nkt(e,t){var r,n;var i=e==null?void 0:e.inputAudioTokens,o=e==null?void 0:e.outputAudioTokens;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=((r=t.promptTokensDetails)!=null?r:[])[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;a.modality==="AUDIO"&&a.tokenCount!=null&&(i=(i!=null?i:0)+a.tokenCount)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=((n=t.responseTokensDetails)!=null?n:[])[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var a9=_step1.value;a9.modality==="AUDIO"&&a9.tokenCount!=null&&(o=(o!=null?o:0)+a9.tokenCount)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return i==null&&o==null?e:_object_spread({},e,i!=null?{inputAudioTokens:i}:{},o!=null?{outputAudioTokens:o}:{})}function ikt(e){var t;try{t=Ui(e)}catch(i){return}if(t.byteLength<2)return;var r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=Math.floor(t.byteLength/2);for(var i=0;i<n;i++)if(Math.abs(r.getInt16(i*2,!0))>X5t)return;return n/Y5t*1e3}function okt(param){var e=param.modelId,t=param.targetLanguage,r=param.providerOptions;return{model:AP(e),generationConfig:{responseModalities:["AUDIO"],translationConfig:_object_spread({targetLanguageCode:t},(r==null?void 0:r.echoTargetLanguage)!=null?{echoTargetLanguage:r.echoTargetLanguage}:{})},inputAudioTranscription:{},outputAudioTranscription:{}}}function akt(e){if(e.type!=="audio/pcm"||e.rate!=null&&e.rate!==16e3)throw new il({argument:"inputAudioFormat",message:"The Gemini Live translation API only supports 16kHz 16-bit PCM input audio."})}var skt=["text/html","text/css","text/plain","text/xml","text/csv","text/rtf","text/javascript","application/json","application/pdf","image/bmp","image/jpeg","image/png","image/webp","video/mp4","video/mpeg","video/quicktime","video/avi","video/x-flv","video/mpg","video/webm","video/wmv","video/3gpp"],lkt=/^https:\/\/.*$/;function ukt(e){return/(^|\/)gemini-/.test(e)&&!/(^|\/)gemini-2\.0/.test(e)}function CG(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,r;var n=(t=Kd(e.baseURL))!=null?t:"https://generativelanguage.googleapis.com/v1beta",i=(r=e.name)!=null?r:"google.generative-ai",o=function(){return Bi(_object_spread({"x-goog-api-key":U2({apiKey:e.apiKey,environmentVariableName:"GOOGLE_GENERATIVE_AI_API_KEY",description:"Google Generative AI"})},e.headers),"ai-sdk/google/".concat(nSt))},a=function(v){var y;return new j8e(v,{provider:i,baseURL:n,headers:o,generateId:(y=e.generateId)!=null?y:Qr,supportedUrls:function(){return _object_spread({"*":[new RegExp("^".concat(n,"/files/.*$")),new RegExp("^https://(?:www\\.)?youtube\\.com/watch\\?v=[\\w-]+(?:&[\\w=&.-]*)?$"),new RegExp("^https://youtu\\.be/[\\w-]+(?:\\?[\\w=&.-]*)?$")]},ukt(v)?Object.fromEntries(skt.map(function(_){return[_,[lkt]]})):{})},fetch:e.fetch})},s=function(v){return new sSt(v,{provider:i,baseURL:n,headers:o,fetch:e.fetch})},l=function(v){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new HSt(v,y,{provider:i,baseURL:n,headers:o,fetch:e.fetch})},c=function(){return new KSt({provider:i,baseURL:n,headers:o,fetch:e.fetch})},d=function(v){var y;return new o5t(v,{provider:i,baseURL:n,headers:o,fetch:e.fetch,generateId:(y=e.generateId)!=null?y:Qr})},u=function(v){return new Z5t(v,{provider:"".concat(i,".realtime"),baseURL:n,headers:o,fetch:e.fetch})},p=function(v){return new tkt(v,{provider:"".concat(i,".translation"),baseURL:n,headers:o,webSocket:e.webSocket})},m=function(v){return new d5t(v,{provider:"".concat(i,".speech"),baseURL:n,headers:o,fetch:e.fetch})},h=Object.assign(function(v){return u(v)},{getToken:function(v){return _async_to_generator(function(){var _;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,u(v.model).doCreateClientSecret({sessionConfig:v.sessionConfig,expiresAfterSeconds:v.expiresAfterSeconds})];case 1:_=_state.sent();return[2,{token:_.token,url:_.url,expiresAt:_.expiresAt}]}})})()}}),g=function(v){var y;return new B5t(v,{provider:"".concat(i,".interactions"),baseURL:n,headers:o,generateId:(y=e.generateId)!=null?y:Qr,fetch:e.fetch})},x=function _target(v){if(_instanceof(this,_target)?this.constructor:void 0)throw new Error("The Google Generative AI model function cannot be called with the new keyword.");return a(v)};return x.specificationVersion="v4",x.languageModel=a,x.chat=a,x.generativeAI=a,x.embedding=s,x.embeddingModel=s,x.textEmbedding=s,x.textEmbeddingModel=s,x.image=l,x.imageModel=l,x.video=d,x.videoModel=d,x.experimental_realtime=h,x.files=c,x.speech=m,x.speechModel=m,x.translation=p,x.speechTranslationModel=p,x.interactions=g,x.tools=GSt,x}var tkr=CG();var pCe={assertUsable:El,createLanguageModel:function createLanguageModel(e,t){El(e);var r=CG(Sp(e));return kp(e,r(t))}};function h1(e){return e.replace(/[_-]([a-z])/g,function(t){return t[1].toUpperCase()})}function ckt(e,t){var r=h1(e);return r!==e&&(t==null?void 0:t[r])!=null?r:e}function PP(param){var e=param.rawName,t=param.providerOptions,r=param.warnings;var n=h1(e);n!==e&&(t==null?void 0:t[e])!=null&&r.push({type:"deprecated",setting:"providerOptions key '".concat(e,"'"),message:"Use '".concat(n,"' instead.")})}var dkt=f.object({error:f.object({message:f.string(),type:f.string().nullish(),param:f.any().nullish(),code:f.union([f.string(),f.number()]).nullish()})}),w5={errorSchema:dkt,errorToMessage:function(e){return e.error.message}};function pkt(e){var t,r,n,i,o,a;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var s=(t=e.prompt_tokens)!=null?t:0,l=(r=e.completion_tokens)!=null?r:0,c=(i=(n=e.prompt_tokens_details)==null?void 0:n.cached_tokens)!=null?i:0,d=(a=(o=e.completion_tokens_details)==null?void 0:o.reasoning_tokens)!=null?a:0;return{inputTokens:{total:s,noCache:s-c,cacheRead:c,cacheWrite:void 0},outputTokens:{total:l,text:l-d,reasoning:d},raw:e}}function _5(e){var t,r;return(r=(t=e==null?void 0:e.providerOptions)==null?void 0:t.openaiCompatible)!=null?r:{}}function fkt(e){switch(e){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function mkt(e){var t,r,n;var i=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _ref=_step.value;var o=_ref.role,a=_ref.content,s=_object_without_properties(_ref,["role","content"]);var l=_5(_object_spread({},s));switch(o){case"system":{i.push(_object_spread({role:"system",content:a},l));break}case"user":{if(a.length===1&&a[0].type==="text"){i.push(_object_spread({role:"user",content:a[0].text},_5(a[0])));break}i.push(_object_spread({role:"user",content:a.map(function(c){var d;var u=_5(c);switch(c.type){case"text":return _object_spread({type:"text",text:c.text},u);case"file":switch(c.data.type){case"reference":throw new or({functionality:"file parts with provider references"});case"text":throw new or({functionality:"text file parts"});case"url":case"data":{var p=ea(c.mediaType);if(p==="image")return _object_spread({type:"image_url",image_url:{url:c.data.type==="url"?c.data.url.toString():"data:".concat(ai({part:c}),";base64,").concat(Fr(c.data.data))}},u);if(p==="audio"){if(c.data.type==="url")throw new or({functionality:"audio file parts with URLs"});var m=ai({part:c}),h=fkt(m);if(h===null)throw new or({functionality:"audio media type ".concat(m)});return _object_spread({type:"input_audio",input_audio:{data:Fr(c.data.data),format:h}},u)}if(p==="application"){if(c.data.type==="url")throw new or({functionality:"PDF file parts with URLs"});var m10=ai({part:c});if(m10!=="application/pdf")throw new or({functionality:"file part media type ".concat(m10)});return _object_spread({type:"file",file:{filename:(d=c.filename)!=null?d:"document.pdf",file_data:"data:application/pdf;base64,".concat(Fr(c.data.data))}},u)}if(p==="text")return _object_spread({type:"text",text:c.data.type==="url"?c.data.url.toString():typeof c.data.data=="string"?new TextDecoder().decode(Ui(c.data.data)):new TextDecoder().decode(c.data.data)},u);throw new or({functionality:"file part media type ".concat(c.mediaType)})}}}})},l));break}case"assistant":{var c="",d="",u=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=a[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var p=_step1.value;var m=_5(p);switch(p.type){case"text":{c+=p.text;break}case"reasoning":{d+=p.text;break}case"tool-call":{var h=(r=(t=p.providerOptions)==null?void 0:t.google)==null?void 0:r.thoughtSignature;u.push(_object_spread({id:p.toolCallId,type:"function",function:{name:p.toolName,arguments:JSON.stringify(p.input)}},m,h?{extra_content:{google:{thought_signature:String(h)}}}:{}));break}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}i.push(_object_spread(_object_spread_props(_object_spread({role:"assistant",content:u.length>0?c||null:c},d.length>0?{reasoning_content:d}:{}),{tool_calls:u.length>0?u:void 0}),l));break}case"tool":{var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=a[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c10=_step2.value;if(c10.type==="tool-approval-response")continue;var d10=c10.output,u10=void 0;switch(d10.type){case"text":case"error-text":u10=d10.value;break;case"execution-denied":u10=(n=d10.reason)!=null?n:"Tool call execution denied.";break;case"content":case"json":case"error-json":u10=JSON.stringify(d10.value);break}var p10=_5(c10);i.push(_object_spread({role:"tool",tool_call_id:c10.toolCallId,content:u10},p10))}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}break}default:{var c11=o;throw new Error("Unsupported role: ".concat(c11))}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return i}function fCe(param){var e=param.id,t=param.model,r=param.created;return{id:e!=null?e:void 0,modelId:t!=null?t:void 0,timestamp:r!=null?new Date(r*1e3):void 0}}function mCe(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var b5=f.object({user:f.string().optional(),reasoningEffort:f.string().optional(),textVerbosity:f.string().optional(),strictJsonSchema:f.boolean().optional()});function hkt(param){var e=param.tools,t=param.toolChoice;e=e!=null&&e.length?e:void 0;var r=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:r};var n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;o.type==="provider"?r.push({type:"unsupported",feature:"provider-defined tool ".concat(o.id)}):n.push({type:"function",function:_object_spread({name:o.name,description:o.description,parameters:o.inputSchema},o.strict!=null?{strict:o.strict}:{})})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(t==null)return{tools:n,toolChoice:void 0,toolWarnings:r};var i=t.type;switch(i){case"auto":case"none":case"required":return{tools:n,toolChoice:i,toolWarnings:r};case"tool":return{tools:n,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:r};default:{var o10=i;throw new or({functionality:"tool choice type: ".concat(o10)})}}}var gkt=/*#__PURE__*/function(){"use strict";function bCe(t,r){_class_call_check(this,bCe);this.specificationVersion="v4";var n,i;this.modelId=t,this.config=r;var o=(n=r.errorStructure)!=null?n:w5;this.chunkSchema=vkt(o.errorSchema),this.failedResponseHandler=Vr(o),this.supportsStructuredOutputs=(i=r.supportsStructuredOutputs)!=null?i:!1}_create_class(bCe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"providerOptionsName",get:function get1(){return this.config.provider.split(".")[0].trim()}},{key:"supportedUrls",get:function get1(){var t,r,n;return(n=(r=(t=this.config).supportedUrls)==null?void 0:r.call(t))!=null?n:{}}},{key:"transformRequestBody",value:function transformRequestBody(t){var r,n,i;return(i=(n=(r=this.config).transformRequestBody)==null?void 0:n.call(r,t))!=null?i:t}},{key:"convertUsage",value:function convertUsage(t){var r,n,i;return(i=(n=(r=this.config).convertUsage)==null?void 0:n.call(r,t))!=null?i:pkt(t)}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,_10,_tmp,_hkt,C,T,I;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.maxOutputTokens,n=param.temperature,i=param.topP,o=param.topK,a=param.frequencyPenalty,s=param.presencePenalty,l=param.reasoning,c=param.providerOptions,d=param.stopSequences,u=param.responseFormat,p=param.seed,m=param.toolChoice,h=param.tools;w=[];return[4,$t({provider:"openai-compatible",providerOptions:c,schema:b5})];case 1:S=_state.sent();S!=null&&w.push({type:"deprecated",setting:"providerOptions key 'openai-compatible'",message:"Use 'openaiCompatible' instead."}),PP({rawName:this.providerOptionsName,providerOptions:c,warnings:w});_10=Object.assign;_tmp=[S!=null?S:{}];return[4,$t({provider:"openaiCompatible",providerOptions:c,schema:b5})];case 2:_tmp=_tmp.concat([(g=_state.sent())!=null?g:{}]);return[4,$t({provider:this.providerOptionsName,providerOptions:c,schema:b5})];case 3:_tmp=_tmp.concat([(x=_state.sent())!=null?x:{}]);return[4,$t({provider:h1(this.providerOptionsName),providerOptions:c,schema:b5})];case 4:k=_10.apply(Object,_tmp.concat([(v=_state.sent())!=null?v:{}])),E=(y=k==null?void 0:k.strictJsonSchema)!=null?y:!0;o!=null&&w.push({type:"unsupported",feature:"topK"}),(u==null?void 0:u.type)==="json"&&u.schema!=null&&!this.supportsStructuredOutputs&&w.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});_hkt=hkt({tools:h,toolChoice:m}),C=_hkt.tools,T=_hkt.toolChoice,I=_hkt.toolWarnings;return[2,{metadataKey:ckt(this.providerOptionsName,c),args:_object_spread_props(_object_spread({model:this.modelId,user:k.user,max_tokens:r,temperature:n,top_p:i,frequency_penalty:a,presence_penalty:s,response_format:(u==null?void 0:u.type)==="json"?this.supportsStructuredOutputs===!0&&u.schema!=null?{type:"json_schema",json_schema:{schema:u.schema,strict:E,name:(_=u.name)!=null?_:"response",description:u.description}}:{type:"json_object"}:void 0,stop:d,seed:p},Object.fromEntries(Object.entries(_object_spread({},c==null?void 0:c[this.providerOptionsName],c==null?void 0:c[h1(this.providerOptionsName)])).filter(function(param){var _param=_sliced_to_array(param,1),M=_param[0];return!Object.keys(b5.shape).includes(M)}))),{reasoning_effort:(b=k.reasoningEffort)!=null?b:Oc(l)&&l!=="none"?l:void 0,verbosity:k.textVerbosity,messages:mkt(t),tools:C,tool_choice:T}),warnings:_to_consumable_array(w).concat(_to_consumable_array(I))}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,_ref,p,m,h,g,x,_ref1,v,y,_,b,w,S,k,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,T,I,E,C,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(_object_spread({},t))];case 1:_ref=_state.sent(),p=_ref.args,m=_ref.warnings,h=_ref.metadataKey,g=this.transformRequestBody(p),x=JSON.stringify(g);return[4,zt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:g,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wt(xkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),v=_ref1.responseHeaders,y=_ref1.value,_=_ref1.rawValue,b=y.choices[0],w=[],S=b.message.content;S!=null&&S.length>0&&w.push({type:"text",text:S});k=(i=b.message.reasoning_content)!=null?i:b.message.reasoning;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(k!=null&&k.length>0&&w.push({type:"reasoning",text:k}),b.message.tool_calls!=null)try{for(_iterator=b.message.tool_calls[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){T=_step.value;I=(a=(o=T.extra_content)==null?void 0:o.google)==null?void 0:a.thought_signature;w.push(_object_spread({type:"tool-call",toolCallId:(s=T.id)!=null?s:Qr(),toolName:T.function.name,input:T.function.arguments},I?{providerMetadata:_define_property({},h,{thoughtSignature:I})}:{}))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_tmp=[_define_property({},h,{})];return[4,(c=(l=this.config.metadataExtractor)==null?void 0:l.extractMetadata)==null?void 0:c.call(l,{parsedBody:_})];case 3:E=_object_spread.apply(void 0,_tmp.concat([_state.sent()])),C=(d=y.usage)==null?void 0:d.completion_tokens_details;return[2,((C==null?void 0:C.accepted_prediction_tokens)!=null&&(E[h].acceptedPredictionTokens=C==null?void 0:C.accepted_prediction_tokens),(C==null?void 0:C.rejected_prediction_tokens)!=null&&(E[h].rejectedPredictionTokens=C==null?void 0:C.rejected_prediction_tokens),{content:w,finishReason:{unified:mCe(b.finish_reason),raw:(u=b.finish_reason)!=null?u:void 0},usage:this.convertUsage(y.usage),providerMetadata:E,request:{body:x},response:_object_spread_props(_object_spread({},fCe(y)),{headers:v,body:_}),warnings:m})]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var _this,r,n,i,_ref,o,a,s,l,c,_ref1,d,u,p,m,h,g,x,v,y,_,b,w,S;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.getArgs(_object_spread({},t))];case 1:_ref=_state.sent(),o=_ref.args,a=_ref.warnings,s=_ref.metadataKey,l=this.transformRequestBody(_object_spread_props(_object_spread({},o),{stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0})),c=(r=this.config.metadataExtractor)==null?void 0:r.createStreamExtractor();return[4,zt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:ht((i=(n=this.config).headers)==null?void 0:i.call(n),t.headers),body:l,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Oo(this.chunkSchema),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),d=_ref1.responseHeaders,u=_ref1.value,p=s,h=new Map,g=new Set,x=function(k){var E,C,T,I,O;var M=k.index;if(M==null||g.has(M)){m.processDelta(k);return}var R=h.get(M);R==null?(R={id:(E=k.id)!=null?E:null,bufferedArguments:"",extraContent:(C=k.extra_content)!=null?C:null},h.set(M,R)):(R.id==null&&k.id!=null&&(R.id=k.id),R.extraContent==null&&k.extra_content!=null&&(R.extraContent=k.extra_content));var $=(T=k.function)==null?void 0:T.arguments;$!=null&&(R.bufferedArguments+=$);var z=(I=k.function)==null?void 0:I.name;if(z!=null){var D={index:M,id:R.id,function:{name:z,arguments:R.bufferedArguments},extra_content:(O=R.extraContent)!=null?O:void 0};m.processDelta(D),h.delete(M),g.add(M)}},v={unified:"other",raw:void 0},_=!0,b=!1,w=!1,S=function(k){return _this.convertUsage(k)};return[2,{stream:u.pipeThrough(new TransformStream({start:function start(k){m=new pT(k,{generateId:Qr,extractMetadata:function(E){var C,T;var I=(T=(C=E.extra_content)==null?void 0:C.google)==null?void 0:T.thought_signature;return I?_define_property({},p,{thoughtSignature:I}):void 0},buildToolCallProviderMetadata:function(E){return E}}),k.enqueue({type:"stream-start",warnings:a})},transform:function transform(k,E){var C,T;if(t.includeRawChunks&&E.enqueue({type:"raw",rawValue:k.rawValue}),!k.success){v={unified:"error",raw:void 0},E.enqueue({type:"error",error:k.error});return}if(c==null||c.processChunk(k.rawValue),"error"in k.value){v={unified:"error",raw:void 0},E.enqueue({type:"error",error:k.value.error});return}var I=k.value;_&&(_=!1,E.enqueue(_object_spread({type:"response-metadata"},fCe(I)))),I.usage!=null&&(y=I.usage);var O=I.choices[0];if((O==null?void 0:O.finish_reason)!=null&&(v={unified:mCe(O.finish_reason),raw:(C=O.finish_reason)!=null?C:void 0}),(O==null?void 0:O.delta)==null)return;var M=O.delta,R=(T=M.reasoning_content)!=null?T:M.reasoning;if(R&&(b||(E.enqueue({type:"reasoning-start",id:"reasoning-0"}),b=!0),E.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:R})),M.content&&(b&&(E.enqueue({type:"reasoning-end",id:"reasoning-0"}),b=!1),w||(E.enqueue({type:"text-start",id:"txt-0"}),w=!0),E.enqueue({type:"text-delta",id:"txt-0",delta:M.content})),M.tool_calls!=null){b&&(E.enqueue({type:"reasoning-end",id:"reasoning-0"}),b=!1);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=M.tool_calls[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var $=_step.value;x($)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},flush:function flush(k){var E,C,T,I;b&&k.enqueue({type:"reasoning-end",id:"reasoning-0"}),w&&k.enqueue({type:"text-end",id:"txt-0"});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=h[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),M=_step_value[0],R=_step_value[1];m.processDelta({index:M,id:R.id,function:{arguments:R.bufferedArguments}})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}h.clear(),m.flush();var O=_object_spread(_define_property({},p,{}),c==null?void 0:c.buildMetadata());((E=y==null?void 0:y.completion_tokens_details)==null?void 0:E.accepted_prediction_tokens)!=null&&(O[p].acceptedPredictionTokens=(C=y==null?void 0:y.completion_tokens_details)==null?void 0:C.accepted_prediction_tokens),((T=y==null?void 0:y.completion_tokens_details)==null?void 0:T.rejected_prediction_tokens)!=null&&(O[p].rejectedPredictionTokens=(I=y==null?void 0:y.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens),k.enqueue({type:"finish",finishReason:v,usage:S(y),providerMetadata:O})}})),request:{body:l},response:{headers:d}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new bCe(t.modelId,t.config)}}]);return bCe}(),wCe=f.looseObject({prompt_tokens:f.number().nullish(),completion_tokens:f.number().nullish(),total_tokens:f.number().nullish(),prompt_tokens_details:f.object({cached_tokens:f.number().nullish()}).nullish(),completion_tokens_details:f.object({reasoning_tokens:f.number().nullish(),accepted_prediction_tokens:f.number().nullish(),rejected_prediction_tokens:f.number().nullish()}).nullish()}).nullish(),xkt=f.looseObject({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({message:f.object({role:f.literal("assistant").nullish(),content:f.string().nullish(),reasoning_content:f.string().nullish(),reasoning:f.string().nullish(),tool_calls:f.array(f.object({id:f.string().nullish(),function:f.object({name:f.string(),arguments:f.string()}),extra_content:f.object({google:f.object({thought_signature:f.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:f.string().nullish()})),usage:wCe}),ykt=f.looseObject({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({delta:f.object({role:f.enum(["assistant",""]).nullish(),content:f.string().nullish(),reasoning_content:f.string().nullish(),reasoning:f.string().nullish(),tool_calls:f.array(f.object({index:f.number().nullish(),id:f.string().nullish(),function:f.object({name:f.string().nullish(),arguments:f.string().nullish()}),extra_content:f.object({google:f.object({thought_signature:f.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:f.string().nullish()})),usage:wCe}),vkt=function(e){return f.union([ykt,e])};function hCe(e){var t,r;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var n=(t=e.prompt_tokens)!=null?t:0,i=(r=e.completion_tokens)!=null?r:0;return{inputTokens:{total:n,noCache:n,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:i,text:i,reasoning:void 0},raw:e}}function _kt(param){var e=param.prompt,tmp=param.user,t=tmp===void 0?"user":tmp,tmp1=param.assistant,r=tmp1===void 0?"assistant":tmp1;var n="";e[0].role==="system"&&(n+="".concat(e[0].content,"\n\n"),e=e.slice(1));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,i=_step_value.role,o=_step_value.content;switch(i){case"system":throw new Gl({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{var a=o.map(function(s){switch(s.type){case"text":return s.text}}).filter(Boolean).join("");n+="".concat(t,":\n").concat(a,"\n\n");break}case"assistant":{var a9=o.map(function(s){switch(s.type){case"text":return s.text;case"tool-call":throw new or({functionality:"tool-call messages"})}}).join("");n+="".concat(r,":\n").concat(a9,"\n\n");break}case"tool":throw new or({functionality:"tool messages"});default:{var a10=i;throw new Error("Unsupported role: ".concat(a10))}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n+="".concat(r,":\n"),{prompt:n,stopSequences:["\n".concat(t,":")]}}function gCe(param){var e=param.id,t=param.model,r=param.created;return{id:e!=null?e:void 0,modelId:t!=null?t:void 0,timestamp:r!=null?new Date(r*1e3):void 0}}function xCe(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var yCe=f.object({echo:f.boolean().optional(),logitBias:f.record(f.string(),f.number()).optional(),suffix:f.string().optional(),user:f.string().optional()}),bkt=/*#__PURE__*/function(){"use strict";function SCe(t,r){_class_call_check(this,SCe);this.specificationVersion="v4";var n;this.modelId=t,this.config=r;var i=(n=r.errorStructure)!=null?n:w5;this.chunkSchema=Skt(i.errorSchema),this.failedResponseHandler=Vr(i)}_create_class(SCe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"providerOptionsName",get:function get1(){return this.config.provider.split(".")[0].trim()}},{key:"supportedUrls",get:function get1(){var t,r,n;return(n=(r=(t=this.config).supportedUrls)==null?void 0:r.call(t))!=null?n:{}}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,_,_tmp,_$_kt,y,_10,b;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.maxOutputTokens,n=param.temperature,i=param.topP,o=param.topK,a=param.frequencyPenalty,s=param.presencePenalty,l=param.stopSequences,c=param.responseFormat,d=param.seed,u=param.providerOptions,p=param.tools,m=param.toolChoice;x=[];PP({rawName:this.providerOptionsName,providerOptions:u,warnings:x});_=Object.assign;return[4,$t({provider:this.providerOptionsName,providerOptions:u,schema:yCe})];case 1:_tmp=[(h=_state.sent())!=null?h:{}];return[4,$t({provider:h1(this.providerOptionsName),providerOptions:u,schema:yCe})];case 2:v=_.apply(Object,_tmp.concat([(g=_state.sent())!=null?g:{}]));o!=null&&x.push({type:"unsupported",feature:"topK"}),p!=null&&p.length&&x.push({type:"unsupported",feature:"tools"}),m!=null&&x.push({type:"unsupported",feature:"toolChoice"}),c!=null&&c.type!=="text"&&x.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});_$_kt=_kt({prompt:t}),y=_$_kt.prompt,_10=_$_kt.stopSequences,b=_to_consumable_array(_10!=null?_10:[]).concat(_to_consumable_array(l!=null?l:[]));return[2,{args:_object_spread_props(_object_spread({model:this.modelId,echo:v.echo,logit_bias:v.logitBias,suffix:v.suffix,user:v.user,max_tokens:r,temperature:n,top_p:i,frequency_penalty:a,presence_penalty:s,seed:d},u==null?void 0:u[this.providerOptionsName],u==null?void 0:u[h1(this.providerOptionsName)]),{prompt:y,stop:b.length>0?b:void 0}),warnings:x}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,_ref,i,o,_ref1,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),i=_ref.args,o=_ref.warnings;return[4,zt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:i,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:wt(wkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),a=_ref1.responseHeaders,s=_ref1.value,l=_ref1.rawValue,c=s.choices[0],d=[];return[2,(c.text!=null&&c.text.length>0&&d.push({type:"text",text:c.text}),{content:d,usage:hCe(s.usage),finishReason:{unified:xCe(c.finish_reason),raw:c.finish_reason},request:{body:i},response:_object_spread_props(_object_spread({},gCe(s)),{headers:a,body:l}),warnings:o})]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,_ref,i,o,a,_ref1,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),i=_ref.args,o=_ref.warnings,a=_object_spread_props(_object_spread({},i),{stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0});return[4,zt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:a,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Oo(this.chunkSchema),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),s=_ref1.responseHeaders,l=_ref1.value,c={unified:"other",raw:void 0},u=!0;return[2,{stream:l.pipeThrough(new TransformStream({start:function start(p){p.enqueue({type:"stream-start",warnings:o})},transform:function transform(p,m){var h;if(t.includeRawChunks&&m.enqueue({type:"raw",rawValue:p.rawValue}),!p.success){c={unified:"error",raw:void 0},m.enqueue({type:"error",error:p.error});return}var g=p.value;if("error"in g){c={unified:"error",raw:void 0},m.enqueue({type:"error",error:g.error});return}u&&(u=!1,m.enqueue(_object_spread({type:"response-metadata"},gCe(g))),m.enqueue({type:"text-start",id:"0"})),g.usage!=null&&(d=g.usage);var x=g.choices[0];(x==null?void 0:x.finish_reason)!=null&&(c={unified:xCe(x.finish_reason),raw:(h=x.finish_reason)!=null?h:void 0}),(x==null?void 0:x.text)!=null&&m.enqueue({type:"text-delta",id:"0",delta:x.text})},flush:function flush(p){u||p.enqueue({type:"text-end",id:"0"}),p.enqueue({type:"finish",finishReason:c,usage:hCe(d)})}})),request:{body:a},response:{headers:s}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new SCe(t.modelId,t.config)}}]);return SCe}(),kCe=f.object({prompt_tokens:f.number(),completion_tokens:f.number(),total_tokens:f.number()}),wkt=f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({text:f.string(),finish_reason:f.string()})),usage:kCe.nullish()}),Skt=function(e){return f.union([f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({text:f.string(),finish_reason:f.string().nullish(),index:f.number()})),usage:kCe.nullish()}),e])},EG=f.object({dimensions:f.number().optional(),user:f.string().optional()}),kkt=/*#__PURE__*/function(){"use strict";function CCe(t,r){_class_call_check(this,CCe);this.specificationVersion="v4",this.modelId=t,this.config=r}_create_class(CCe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"maxEmbeddingsPerCall",get:function get1(){var t;return(t=this.config.maxEmbeddingsPerCall)!=null?t:2048}},{key:"supportsParallelCalls",get:function get1(){var t;return(t=this.config.supportsParallelCalls)!=null?t:!0}},{key:"providerOptionsName",get:function get1(){return this.config.provider.split(".")[0].trim()}},{key:"doEmbed",value:function doEmbed(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,_,_tmp,_ref,m,h,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.values,r=param.headers,n=param.abortSignal,i=param.providerOptions;d=[];return[4,$t({provider:"openai-compatible",providerOptions:i,schema:EG})];case 1:u=_state.sent();u!=null&&d.push({type:"deprecated",setting:"providerOptions key 'openai-compatible'",message:"Use 'openaiCompatible' instead."}),PP({rawName:this.providerOptionsName,providerOptions:i,warnings:d});_=Object.assign;_tmp=[u!=null?u:{}];return[4,$t({provider:"openaiCompatible",providerOptions:i,schema:EG})];case 2:_tmp=_tmp.concat([(o=_state.sent())!=null?o:{}]);return[4,$t({provider:this.providerOptionsName,providerOptions:i,schema:EG})];case 3:p=_.apply(Object,_tmp.concat([(a=_state.sent())!=null?a:{}]));if(t.length>this.maxEmbeddingsPerCall)throw new Zg({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:t});return[4,zt({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:ht((l=(s=this.config).headers)==null?void 0:l.call(s),r),body:{model:this.modelId,input:t,encoding_format:"float",dimensions:p.dimensions,user:p.user},failedResponseHandler:Vr((c=this.config.errorStructure)!=null?c:w5),successfulResponseHandler:wt(Ckt),abortSignal:n,fetch:this.config.fetch})];case 4:_ref=_state.sent(),m=_ref.responseHeaders,h=_ref.value,g=_ref.rawValue;return[2,{warnings:d,embeddings:h.data.map(function(x){return x.embedding}),usage:h.usage?{tokens:h.usage.prompt_tokens}:void 0,providerMetadata:h.providerMetadata,response:{headers:m,body:g}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new CCe(t.modelId,t.config)}}]);return CCe}(),Ckt=f.object({data:f.array(f.object({embedding:f.array(f.number())})),usage:f.object({prompt_tokens:f.number()}).nullish(),providerMetadata:f.record(f.string(),f.record(f.string(),f.any())).optional()}),Ekt=/*#__PURE__*/function(){"use strict";function ECe(t,r){_class_call_check(this,ECe);this.modelId=t,this.config=r,this.specificationVersion="v4",this.maxImagesPerCall=10}_create_class(ECe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"providerOptionsKey",get:function get1(){return this.config.provider.split(".")[0].trim()}},{key:"getArgs",value:function getArgs(t,r){return PP({rawName:this.providerOptionsKey,providerOptions:t,warnings:r}),_object_spread({},t[this.providerOptionsKey],t[h1(this.providerOptionsKey)])}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,_ref,C,T,_tmp,_tmp1,_tmp2,_ref1,k,E;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.n,n=param.size,i=param.aspectRatio,o=param.seed,a=param.providerOptions,s=param.headers,l=param.abortSignal,c=param.files,d=param.mask;b=[];i!=null&&b.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),o!=null&&b.push({type:"unsupported",feature:"seed"});w=(m=(p=(u=this.config._internal)==null?void 0:u.currentDate)==null?void 0:p.call(u))!=null?m:new Date,S=this.getArgs(a,b);if(!(c!=null&&c.length>0))return[3,6];_tmp={url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:ht((g=(h=this.config).headers)==null?void 0:g.call(h),s)};_tmp1={model:this.modelId,prompt:t};return[4,Promise.all(c.map(function(I){return _Ce(I)}))];case 1:_tmp1.image=_state.sent();if(!(d!=null))return[3,3];return[4,_Ce(d)];case 2:_tmp2=_state.sent();return[3,4];case 3:_tmp2=void 0;_state.label=4;case 4:return[4,ul.apply(void 0,[(_tmp.formData=iT.apply(void 0,[_object_spread.apply(void 0,[(_tmp1.mask=_tmp2,_tmp1.n=r,_tmp1.size=n,_tmp1),S])]),_tmp.failedResponseHandler=Vr((x=this.config.errorStructure)!=null?x:w5),_tmp.successfulResponseHandler=wt(vCe),_tmp.abortSignal=l,_tmp.fetch=this.config.fetch,_tmp)])];case 5:_ref=_state.sent(),C=_ref.value,T=_ref.responseHeaders;return[2,{images:C.data.map(function(I){return I.b64_json}),warnings:b,response:{timestamp:w,modelId:this.modelId,headers:T}}];case 6:return[4,zt({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:ht((y=(v=this.config).headers)==null?void 0:y.call(v),s),body:_object_spread({model:this.modelId,prompt:t,n:r,size:n},S),failedResponseHandler:Vr((_=this.config.errorStructure)!=null?_:w5),successfulResponseHandler:wt(vCe),abortSignal:l,fetch:this.config.fetch})];case 7:_ref1=_state.sent(),k=_ref1.value,E=_ref1.responseHeaders;return[2,{images:k.data.map(function(C){return C.b64_json}),warnings:b,response:{timestamp:w,modelId:this.modelId,headers:E}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new ECe(t.modelId,t.config)}}]);return ECe}(),vCe=f.object({data:f.array(f.object({b64_json:f.string()}))});function _Ce(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){if(e.type==="url")return[2,X3(e.url)];t=_instanceof(e.data,Uint8Array)?e.data:Ui(e.data);return[2,new Blob([t],{type:e.mediaType})]})})()}var Tkt="3.0.16";function RP(e){var t=Kd(e.baseURL),r=e.name,n=_object_spread({},e.apiKey&&{Authorization:"Bearer ".concat(e.apiKey)},e.headers),i=function(){return Bi(n,"ai-sdk/openai-compatible/".concat(Tkt))},o=function(p){return{provider:"".concat(r,".").concat(p),url:function(param){var m=param.path;var h=new URL("".concat(t).concat(m));return e.queryParams&&(h.search=new URLSearchParams(e.queryParams).toString()),h.toString()},headers:i,fetch:e.fetch}},a=function(p){return s(p)},s=function(p){return new gkt(p,_object_spread_props(_object_spread({},o("chat")),{includeUsage:e.includeUsage,supportsStructuredOutputs:e.supportsStructuredOutputs,supportedUrls:e.supportedUrls,transformRequestBody:e.transformRequestBody,metadataExtractor:e.metadataExtractor,convertUsage:e.convertUsage}))},l=function(p){return new bkt(p,_object_spread_props(_object_spread({},o("completion")),{includeUsage:e.includeUsage}))},c=function(p){return new kkt(p,_object_spread({},o("embedding")))},d=function(p){return new Ekt(p,o("image"))},u=function(p){return a(p)};return u.specificationVersion="v4",u.languageModel=a,u.chatModel=s,u.completionModel=l,u.embeddingModel=c,u.textEmbeddingModel=c,u.imageModel=d,u}function ACe(e){var r;var t=(r=e.api)==null?void 0:r.trim();return t||KA(e.npm)}function TCe(e){if(El(e),!ACe(e))throw new Error(P.t("chatbox.errors.providerBaseUrlRequired"))}var TG={assertUsable:TCe,createLanguageModel:function createLanguageModel(e,t){TCe(e);var r=Sp(e),n=RP(_object_spread_props(_object_spread({},r),{baseURL:ACe(e)}));return kp(e,n.chatModel(t))}};var zG=f.object({error:f.object({message:f.string(),type:f.string().nullish(),param:f.any().nullish(),code:f.union([f.string(),f.number()]).nullish()})}),pu=Vr({errorSchema:zG,errorToMessage:function(e){return e.error.message}});function XCe(e){var t,r,n,i,o;var a=Akt(e),s=Ikt(e),l=(s==null?void 0:s.minor)==null&&((r=(t=s==null?void 0:s.variant)==null?void 0:t.startsWith("chat"))!=null?r:!1),c=(i=(n=s==null?void 0:s.variant)==null?void 0:n.startsWith("nano"))!=null?i:!1,d=a!=null&&a>=3||s!=null&&s.major>=5&&!l,u=e.startsWith("gpt-4")||s!=null&&s.major>=5&&!c&&!l||a!=null&&a>=3,p=a!=null||s!=null&&s.major>=5&&!l,m=s!=null&&(s.major>5||s.major===5&&((o=s.minor)!=null?o:0)>=1);return{supportsFlexProcessing:d,supportsPriorityProcessing:u,isReasoningModel:p,systemMessageMode:p?"developer":"system",supportsNonReasoningParameters:m}}function Akt(e){var t=/^o(\d+)(?:-|$)/.exec(e);return t==null?void 0:Number(t[1])}function Ikt(e){var t=/^gpt-(\d+)(?:\.(\d+))?(?:-(.+))?$/.exec(e);if(t!=null)return{major:Number(t[1]),minor:t[2]==null?void 0:Number(t[2]),variant:t[3]}}function jG(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,_e_tee,a,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.stream,t=param.getError,r=param.isOutputChunk,n=param.url,i=param.requestBodyValues,o=param.responseHeaders;_e_tee=_sliced_to_array(e.tee(),2),a=_e_tee[0],s=_e_tee[1],l=a.getReader();_state.label=1;case 1:_state.trys.push([1,,6,7]);_state.label=2;case 2:return[4,l.read()];case 3:c=_state.sent();if(c.done)return[2,s];d=c.value;if(!d.success)return[2,s];u=t(d.value);if(u!=null)throw s.cancel().catch(function(){}),Pkt({frame:u,url:n,requestBodyValues:i,responseHeaders:o});if(r(d.value))return[2,s];_state.label=4;case 4:return[3,2];case 5:return[3,7];case 6:l.cancel().catch(function(){}),l.releaseLock();return[7];case 7:return[2]}})}).apply(this,arguments)}function Pkt(param){var e=param.frame,t=param.url,r=param.requestBodyValues,n=param.responseHeaders;var i;var o=Rkt(e);return new Rr({message:(i=o==null?void 0:o.message)!=null?i:"OpenAI stream failed before any output was generated",url:t,requestBodyValues:r,statusCode:o==null?500:Mkt(o),responseHeaders:n,responseBody:JSON.stringify(e),data:e})}function Rkt(e){var t;var r=S5(e);if(r==null)return;if(r.type==="response.failed"){var i=S5(r.response),o=S5(i==null?void 0:i.error);return typeof(o==null?void 0:o.message)=="string"?{message:o.message,code:ICe(o.code),type:"response.failed",frame:e}:void 0}var n=(t=S5(r.error))!=null?t:r;return typeof n.message=="string"&&(S5(r.error)!=null||typeof n.type=="string"||"code"in n||"param"in n)?{message:n.message,code:ICe(n.code),type:typeof n.type=="string"?n.type:void 0,frame:e}:void 0}function Mkt(e){if(typeof e.code=="number"&&PCe(e.code))return e.code;if(typeof e.code=="string"&&/^\d{3}$/.test(e.code)){var r=Number(e.code);if(PCe(r))return r}var t=[e.code,e.type].filter(function(r){return typeof r=="string"||typeof r=="number"}).join(" ").toLowerCase();return["insufficient_quota","rate_limit"].some(function(r){return t.includes(r)})?429:t.includes("authentication")?401:t.includes("permission")?403:t.includes("not_found")?404:["invalid","bad_request","context_length"].some(function(r){return t.includes(r)})?400:t.includes("overload")?503:t.includes("timeout")?504:500}function S5(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!=null?e:void 0}function ICe(e){return typeof e=="string"||typeof e=="number"?e:void 0}function PCe(e){return Number.isInteger(e)&&e>=400&&e<=599}function RCe(e){var t,r,n,i,o,a,s,l;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var c=(t=e.prompt_tokens)!=null?t:0,d=(r=e.completion_tokens)!=null?r:0,u=(i=(n=e.prompt_tokens_details)==null?void 0:n.cached_tokens)!=null?i:0,p=(a=(o=e.prompt_tokens_details)==null?void 0:o.cache_write_tokens)!=null?a:void 0,m=(l=(s=e.completion_tokens_details)==null?void 0:s.reasoning_tokens)!=null?l:0;return{inputTokens:{total:c,noCache:c-u-(p!=null?p:0),cacheRead:u,cacheWrite:p},outputTokens:{total:d,text:d-m,reasoning:m},raw:e}}function Okt(e){return JSON.stringify(e===void 0?{}:e)}function Uf(e){var t;return(t=e==null?void 0:e.openai)==null?void 0:t.promptCacheBreakpoint}function $kt(param){var e=param.prompt,tmp=param.systemMessageMode,t=tmp===void 0?"system":tmp;var r,n;var i=[],o=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,a=_step_value.role,s=_step_value.content,l=_step_value.providerOptions;switch(a){case"system":{switch(t){case"system":{var c=Uf(l);i.push({role:"system",content:c==null?s:[{type:"text",text:s,prompt_cache_breakpoint:c}]});break}case"developer":{var c10=Uf(l);i.push({role:"developer",content:c10==null?s:[{type:"text",text:s,prompt_cache_breakpoint:c10}]});break}case"remove":{o.push({type:"other",message:"system messages are removed for this model"});break}default:{var c11=t;throw new Error("Unsupported system message mode: ".concat(c11))}}break}case"user":{if(s.length===1&&s[0].type==="text"&&Uf(s[0].providerOptions)==null){i.push({role:"user",content:s[0].text});break}i.push({role:"user",content:s.map(function(c,d){var u,p,m;switch(c.type){case"text":{var h=Uf(c.providerOptions);return _object_spread({type:"text",text:c.text},h!=null&&{prompt_cache_breakpoint:h})}case"file":{var h10=Uf(c.providerOptions);switch(c.data.type){case"reference":return _object_spread({type:"file",file:{file_id:ns({reference:c.data.reference,provider:"openai"})}},h10!=null&&{prompt_cache_breakpoint:h10});case"text":throw new or({functionality:"text file parts"});case"url":case"data":{var g=ea(c.mediaType);if(g==="image")return _object_spread({type:"image_url",image_url:{url:c.data.type==="url"?c.data.url.toString():"data:".concat(ai({part:c}),";base64,").concat(Fr(c.data.data)),detail:(p=(u=c.providerOptions)==null?void 0:u.openai)==null?void 0:p.imageDetail}},h10!=null&&{prompt_cache_breakpoint:h10});if(g==="audio"){if(c.data.type==="url")throw new or({functionality:"audio file parts with URLs"});var x=ai({part:c});switch(x){case"audio/wav":return _object_spread({type:"input_audio",input_audio:{data:Fr(c.data.data),format:"wav"}},h10!=null&&{prompt_cache_breakpoint:h10});case"audio/mp3":case"audio/mpeg":return _object_spread({type:"input_audio",input_audio:{data:Fr(c.data.data),format:"mp3"}},h10!=null&&{prompt_cache_breakpoint:h10});default:throw new or({functionality:"audio content parts with media type ".concat(x)})}}{var x10=ai({part:c});if(x10!=="application/pdf")throw new or({functionality:"file part media type ".concat(x10)});if(c.data.type==="url")throw new or({functionality:"PDF file parts with URLs"});return _object_spread({type:"file",file:{filename:(m=c.filename)!=null?m:"part-".concat(d,".pdf"),file_data:"data:application/pdf;base64,".concat(Fr(c.data.data))}},h10!=null&&{prompt_cache_breakpoint:h10})}}}}}})});break}case"assistant":{var c12="",d=[],u=!1,p=[];var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=s[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var m=_step1.value;switch(m.type){case"text":{var h=Uf(m.providerOptions);c12+=m.text,d.push(_object_spread({type:"text",text:m.text},h!=null&&{prompt_cache_breakpoint:h})),u||(u=h!=null);break}case"tool-call":{p.push({id:m.toolCallId,type:"function",function:{name:m.toolName,arguments:Okt(m.input)}});break}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}i.push({role:"assistant",content:u?d:p.length>0?c12||null:c12,tool_calls:p.length>0?p:void 0});break}case"tool":{var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=s[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c13=_step2.value;if(c13.type==="tool-approval-response")continue;var d10=c13.output,u10=(r=d10.type==="content"?d10.value.map(function(m){return Uf(m.providerOptions)}).find(function(m){return m!=null}):Uf(d10.providerOptions))!=null?r:Uf(c13.providerOptions),p10=void 0;switch(d10.type){case"text":case"error-text":p10=d10.value;break;case"execution-denied":p10=(n=d10.reason)!=null?n:"Tool call execution denied.";break;case"content":case"json":case"error-json":p10=JSON.stringify(d10.value);break}i.push({role:"tool",tool_call_id:c13.toolCallId,content:u10==null?p10:[{type:"text",text:p10,prompt_cache_breakpoint:u10}]})}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}break}default:{var c14=a;throw new Error("Unsupported role: ".concat(c14))}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{messages:i,warnings:o}}function AG(param){var e=param.id,t=param.model,r=param.created;return{id:e!=null?e:void 0,modelId:t!=null?t:void 0,timestamp:r?new Date(r*1e3):void 0}}function MCe(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var Nkt=ne(function(){return te(f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({message:f.object({role:f.literal("assistant").nullish(),content:f.string().nullish(),tool_calls:f.array(f.object({id:f.string().nullish(),type:f.literal("function"),function:f.object({name:f.string(),arguments:f.string()})})).nullish(),annotations:f.array(f.object({type:f.literal("url_citation"),url_citation:f.object({start_index:f.number(),end_index:f.number(),url:f.string(),title:f.string()})})).nullish()}),index:f.number(),logprobs:f.object({content:f.array(f.object({token:f.string(),logprob:f.number(),top_logprobs:f.array(f.object({token:f.string(),logprob:f.number()}))})).nullish()}).nullish(),finish_reason:f.string().nullish()})),usage:f.object({prompt_tokens:f.number().nullish(),completion_tokens:f.number().nullish(),total_tokens:f.number().nullish(),prompt_tokens_details:f.object({cached_tokens:f.number().nullish(),cache_write_tokens:f.number().nullish()}).nullish(),completion_tokens_details:f.object({reasoning_tokens:f.number().nullish(),accepted_prediction_tokens:f.number().nullish(),rejected_prediction_tokens:f.number().nullish()}).nullish()}).nullish()}))}),Dkt=ne(function(){return te(f.union([f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({delta:f.object({role:f.enum(["assistant"]).nullish(),content:f.string().nullish(),tool_calls:f.array(f.object({index:f.number(),id:f.string().nullish(),type:f.literal("function").nullish(),function:f.object({name:f.string().nullish(),arguments:f.string().nullish()})})).nullish(),annotations:f.array(f.object({type:f.literal("url_citation"),url_citation:f.object({start_index:f.number(),end_index:f.number(),url:f.string(),title:f.string()})})).nullish()}).nullish(),logprobs:f.object({content:f.array(f.object({token:f.string(),logprob:f.number(),top_logprobs:f.array(f.object({token:f.string(),logprob:f.number()}))})).nullish()}).nullish(),finish_reason:f.string().nullish(),index:f.number()})),usage:f.object({prompt_tokens:f.number().nullish(),completion_tokens:f.number().nullish(),total_tokens:f.number().nullish(),prompt_tokens_details:f.object({cached_tokens:f.number().nullish(),cache_write_tokens:f.number().nullish()}).nullish(),completion_tokens_details:f.object({reasoning_tokens:f.number().nullish(),accepted_prediction_tokens:f.number().nullish(),rejected_prediction_tokens:f.number().nullish()}).nullish()}).nullish()}),zG]))}),Lkt=ne(function(){return te(f.object({logitBias:f.record(f.coerce.number(),f.number()).optional(),logprobs:f.union([f.boolean(),f.number()]).optional(),parallelToolCalls:f.boolean().optional(),user:f.string().optional(),reasoningEffort:f.enum(["none","minimal","low","medium","high","xhigh","max"]).optional(),maxCompletionTokens:f.number().optional(),store:f.boolean().optional(),metadata:f.record(f.string().max(64),f.string().max(512)).optional(),prediction:f.record(f.string(),f.any()).optional(),serviceTier:f.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:f.boolean().optional(),textVerbosity:f.enum(["low","medium","high"]).optional(),promptCacheKey:f.string().optional(),promptCacheOptions:f.object({mode:f.enum(["implicit","explicit"]).optional(),ttl:f.literal("30m").optional()}).optional(),promptCacheRetention:f.enum(["in_memory","24h"]).optional(),safetyIdentifier:f.string().optional(),systemMessageMode:f.enum(["system","developer","remove"]).optional(),forceReasoning:f.boolean().optional()}))});function Fkt(param){var e=param.tools,t=param.toolChoice;e=e!=null&&e.length?e:void 0;var r=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:r};var n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;switch(o.type){case"function":n.push({type:"function",function:_object_spread({name:o.name,description:o.description,parameters:o.inputSchema},o.strict!=null?{strict:o.strict}:{})});break;default:r.push({type:"unsupported",feature:"tool type: ".concat(o.type)});break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}if(t==null)return{tools:n,toolChoice:void 0,toolWarnings:r};var i=t.type;switch(i){case"auto":case"none":case"required":return{tools:n,toolChoice:i,toolWarnings:r};case"tool":return{tools:n,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:r};default:{var o10=i;throw new or({functionality:"tool choice type: ".concat(o10)})}}}var zkt=/*#__PURE__*/function(){"use strict";function eEe(t,r){_class_call_check(this,eEe);this.specificationVersion="v4",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=t,this.config=r}_create_class(eEe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,_w1,g,x,v,y,_,b,w,S,k,E,C,_$kt,T,I,O,M,_Fkt,R,$,z;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.maxOutputTokens,n=param.temperature,i=param.topP,o=param.topK,a=param.frequencyPenalty,s=param.presencePenalty,l=param.stopSequences,c=param.responseFormat,d=param.seed,u=param.tools,p=param.toolChoice,m=param.reasoning,h=param.providerOptions;w=[];return[4,$t({provider:"openai",providerOptions:h,schema:Lkt})];case 1:S=(g=_state.sent())!=null?g:{},k=XCe(this.modelId),E=(x=S.reasoningEffort)!=null?x:Oc(m)?m:void 0,C=(v=S.forceReasoning)!=null?v:k.isReasoningModel;o!=null&&w.push({type:"unsupported",feature:"topK"});_$kt=$kt({prompt:t,systemMessageMode:(y=S.systemMessageMode)!=null?y:C?"developer":k.systemMessageMode}),T=_$kt.messages,I=_$kt.warnings;(_w1=w).push.apply(_w1,_to_consumable_array(I));O=(_=S.strictJsonSchema)!=null?_:!0,M={model:this.modelId,logit_bias:S.logitBias,logprobs:S.logprobs===!0||typeof S.logprobs=="number"?!0:void 0,top_logprobs:typeof S.logprobs=="number"?S.logprobs:typeof S.logprobs=="boolean"&&S.logprobs?0:void 0,user:S.user,parallel_tool_calls:S.parallelToolCalls,max_tokens:r,temperature:n,top_p:i,frequency_penalty:a,presence_penalty:s,response_format:(c==null?void 0:c.type)==="json"?c.schema!=null?{type:"json_schema",json_schema:{schema:c.schema,strict:O,name:(b=c.name)!=null?b:"response",description:c.description}}:{type:"json_object"}:void 0,stop:l,seed:d,verbosity:S.textVerbosity,max_completion_tokens:S.maxCompletionTokens,store:S.store,metadata:S.metadata,prediction:S.prediction,reasoning_effort:E,service_tier:S.serviceTier,prompt_cache_key:S.promptCacheKey,prompt_cache_options:S.promptCacheOptions,prompt_cache_retention:S.promptCacheRetention,safety_identifier:S.safetyIdentifier,messages:T};C?((E!=="none"||!k.supportsNonReasoningParameters)&&(M.temperature!=null&&(M.temperature=void 0,w.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),M.top_p!=null&&(M.top_p=void 0,w.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),M.logprobs!=null&&(M.logprobs=void 0,w.push({type:"other",message:"logprobs is not supported for reasoning models"}))),M.frequency_penalty!=null&&(M.frequency_penalty=void 0,w.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),M.presence_penalty!=null&&(M.presence_penalty=void 0,w.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),M.logit_bias!=null&&(M.logit_bias=void 0,w.push({type:"other",message:"logitBias is not supported for reasoning models"})),M.top_logprobs!=null&&(M.top_logprobs=void 0,w.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),M.max_tokens!=null&&(M.max_completion_tokens==null&&(M.max_completion_tokens=M.max_tokens),M.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&M.temperature!=null&&(M.temperature=void 0,w.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),S.serviceTier==="flex"&&!k.supportsFlexProcessing&&(w.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),M.service_tier=void 0),S.serviceTier==="priority"&&!k.supportsPriorityProcessing&&(w.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),M.service_tier=void 0);_Fkt=Fkt({tools:u,toolChoice:p}),R=_Fkt.tools,$=_Fkt.toolChoice,z=_Fkt.toolWarnings;return[2,{args:_object_spread_props(_object_spread({},M),{tools:R,tool_choice:$}),warnings:_to_consumable_array(w).concat(_to_consumable_array(z))}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,_ref,d,u,_ref1,p,m,h,g,x,v,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,b,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,b10,y,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),d=_ref.args,u=_ref.warnings;return[4,zt({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:d,failedResponseHandler:pu,successfulResponseHandler:wt(Nkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),p=_ref1.responseHeaders,m=_ref1.value,h=_ref1.rawValue,g=m.choices[0],x=[],v=g.message.content;v!=null&&v.length>0&&x.push({type:"text",text:v});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=((i=g.message.tool_calls)!=null?i:[])[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){b=_step.value;x.push({type:"tool-call",toolCallId:(o=b.id)!=null?o:Qr(),toolName:b.function.name,input:b.function.arguments})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=((a=g.message.annotations)!=null?a:[])[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){b10=_step1.value;x.push({type:"source",sourceType:"url",id:Qr(),url:b10.url_citation.url,title:b10.url_citation.title})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}y=(s=m.usage)==null?void 0:s.completion_tokens_details,_={openai:{}};return[2,((y==null?void 0:y.accepted_prediction_tokens)!=null&&(_.openai.acceptedPredictionTokens=y==null?void 0:y.accepted_prediction_tokens),(y==null?void 0:y.rejected_prediction_tokens)!=null&&(_.openai.rejectedPredictionTokens=y==null?void 0:y.rejected_prediction_tokens),((l=g.logprobs)==null?void 0:l.content)!=null&&(_.openai.logprobs=g.logprobs.content),{content:x,finishReason:{unified:MCe(g.finish_reason),raw:(c=g.finish_reason)!=null?c:void 0},usage:RCe(m.usage),request:{body:d},response:_object_spread_props(_object_spread({},AG(m)),{headers:p,body:h}),warnings:u,providerMetadata:_})]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,_ref,i,o,a,s,_ref1,l,c,d,u,p,m,h,g,x;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),i=_ref.args,o=_ref.warnings,a=_object_spread_props(_object_spread({},i),{stream:!0,stream_options:{include_usage:!0}}),s=this.config.url({path:"/chat/completions",modelId:this.modelId});return[4,zt({url:s,headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:a,failedResponseHandler:pu,successfulResponseHandler:Oo(Dkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),l=_ref1.responseHeaders,c=_ref1.value;return[4,jG({stream:c,getError:function(y){return"error"in y?y.error:void 0},isOutputChunk:jkt,url:s,requestBodyValues:a,responseHeaders:l})];case 3:d=_state.sent(),p={unified:"other",raw:void 0},h=!1,g=!1,x={openai:{}};return[2,{stream:d.pipeThrough(new TransformStream({start:function start(y){u=new pT(y,{generateId:Qr,typeValidation:"if-present"}),y.enqueue({type:"stream-start",warnings:o})},transform:function transform(y,_){var b,w,S,k,E;if(t.includeRawChunks&&_.enqueue({type:"raw",rawValue:y.rawValue}),!y.success){p={unified:"error",raw:void 0},_.enqueue({type:"error",error:y.error});return}var C=y.value;if("error"in C){p={unified:"error",raw:void 0},_.enqueue({type:"error",error:C.error});return}if(!h){var O=AG(C);Object.values(O).some(Boolean)&&(h=!0,_.enqueue(_object_spread({type:"response-metadata"},AG(C))))}C.usage!=null&&(m=C.usage,((b=C.usage.completion_tokens_details)==null?void 0:b.accepted_prediction_tokens)!=null&&(x.openai.acceptedPredictionTokens=(w=C.usage.completion_tokens_details)==null?void 0:w.accepted_prediction_tokens),((S=C.usage.completion_tokens_details)==null?void 0:S.rejected_prediction_tokens)!=null&&(x.openai.rejectedPredictionTokens=(k=C.usage.completion_tokens_details)==null?void 0:k.rejected_prediction_tokens));var T=C.choices[0];if((T==null?void 0:T.finish_reason)!=null&&(p={unified:MCe(T.finish_reason),raw:T.finish_reason}),((E=T==null?void 0:T.logprobs)==null?void 0:E.content)!=null&&(x.openai.logprobs=T.logprobs.content),(T==null?void 0:T.delta)==null)return;var I=T.delta;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;if(I.content!=null&&(g||(_.enqueue({type:"text-start",id:"0"}),g=!0),_.enqueue({type:"text-delta",id:"0",delta:I.content})),I.tool_calls!=null)try{for(var _iterator=I.tool_calls[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var O1=_step.value;u.processDelta(O1)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(I.annotations!=null)try{for(var _iterator1=I.annotations[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var O10=_step1.value;_.enqueue({type:"source",sourceType:"url",id:Qr(),url:O10.url_citation.url,title:O10.url_citation.title})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}},flush:function flush(y){g&&y.enqueue({type:"text-end",id:"0"}),u.flush(),y.enqueue(_object_spread({type:"finish",finishReason:p,usage:RCe(m)},x!=null?{providerMetadata:x}:{}))}})),request:{body:a},response:{headers:l}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new eEe(t.modelId,t.config)}}]);return eEe}();function jkt(e){return"error"in e?!1:e.choices.some(function(t){var r=t.delta;return(r==null?void 0:r.content)!=null&&r.content.length>0||(r==null?void 0:r.tool_calls)!=null&&r.tool_calls.length>0||(r==null?void 0:r.annotations)!=null&&r.annotations.length>0})}function OCe(e){var t,r,n,i;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var o=(t=e.prompt_tokens)!=null?t:0,a=(r=e.completion_tokens)!=null?r:0;return{inputTokens:{total:(n=e.prompt_tokens)!=null?n:void 0,noCache:o,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(i=e.completion_tokens)!=null?i:void 0,text:a,reasoning:void 0},raw:e}}function Ukt(param){var e=param.prompt,tmp=param.user,t=tmp===void 0?"user":tmp,tmp1=param.assistant,r=tmp1===void 0?"assistant":tmp1;var n="";e[0].role==="system"&&(n+="".concat(e[0].content,"\n\n"),e=e.slice(1));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_step.value,i=_step_value.role,o=_step_value.content;switch(i){case"system":throw new Gl({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{var a=o.map(function(s){switch(s.type){case"text":return s.text}}).filter(Boolean).join("");n+="".concat(t,":\n").concat(a,"\n\n");break}case"assistant":{var a9=o.map(function(s){switch(s.type){case"text":return s.text;case"tool-call":throw new or({functionality:"tool-call messages"})}}).join("");n+="".concat(r,":\n").concat(a9,"\n\n");break}case"tool":throw new or({functionality:"tool messages"});default:{var a10=i;throw new Error("Unsupported role: ".concat(a10))}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n+="".concat(r,":\n"),{prompt:n,stopSequences:["\n".concat(t,":")]}}function $Ce(param){var e=param.id,t=param.model,r=param.created;return{id:e!=null?e:void 0,modelId:t!=null?t:void 0,timestamp:r!=null?new Date(r*1e3):void 0}}function NCe(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var Bkt=ne(function(){return te(f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({text:f.string(),finish_reason:f.string(),logprobs:f.object({tokens:f.array(f.string()),token_logprobs:f.array(f.number()),top_logprobs:f.array(f.record(f.string(),f.number())).nullish()}).nullish()})),usage:f.object({prompt_tokens:f.number(),completion_tokens:f.number(),total_tokens:f.number()}).nullish()}))}),qkt=ne(function(){return te(f.union([f.object({id:f.string().nullish(),created:f.number().nullish(),model:f.string().nullish(),choices:f.array(f.object({text:f.string(),finish_reason:f.string().nullish(),index:f.number(),logprobs:f.object({tokens:f.array(f.string()),token_logprobs:f.array(f.number()),top_logprobs:f.array(f.record(f.string(),f.number())).nullish()}).nullish()})),usage:f.object({prompt_tokens:f.number(),completion_tokens:f.number(),total_tokens:f.number()}).nullish()}),zG]))}),DCe=ne(function(){return te(f.object({echo:f.boolean().optional(),logitBias:f.record(f.string(),f.number()).optional(),suffix:f.string().optional(),user:f.string().optional(),logprobs:f.union([f.boolean(),f.number()]).optional()}))}),Wkt=/*#__PURE__*/function(){"use strict";function tEe(t,r){_class_call_check(this,tEe);this.specificationVersion="v4",this.supportedUrls={},this.modelId=t,this.config=r}_create_class(tEe,[{key:"providerOptionsName",get:function get1(){return this.config.provider.split(".")[0].trim()}},{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,_tmp,_Ukt,x,v,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.maxOutputTokens,n=param.temperature,i=param.topP,o=param.topK,a=param.frequencyPenalty,s=param.presencePenalty,l=param.stopSequences,c=param.responseFormat,d=param.tools,u=param.toolChoice,p=param.seed,m=param.providerOptions;h=[];_tmp=[{}];return[4,$t({provider:"openai",providerOptions:m,schema:DCe})];case 1:_tmp=_tmp.concat([_state.sent()]);return[4,$t({provider:this.providerOptionsName,providerOptions:m,schema:DCe})];case 2:g=_object_spread.apply(void 0,_tmp.concat([_state.sent()]));o!=null&&h.push({type:"unsupported",feature:"topK"}),d!=null&&d.length&&h.push({type:"unsupported",feature:"tools"}),u!=null&&h.push({type:"unsupported",feature:"toolChoice"}),c!=null&&c.type!=="text"&&h.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});_Ukt=Ukt({prompt:t}),x=_Ukt.prompt,v=_Ukt.stopSequences,y=_to_consumable_array(v!=null?v:[]).concat(_to_consumable_array(l!=null?l:[]));return[2,{args:{model:this.modelId,echo:g.echo,logit_bias:g.logitBias,logprobs:(g==null?void 0:g.logprobs)===!0?0:(g==null?void 0:g.logprobs)===!1||g==null?void 0:g.logprobs,suffix:g.suffix,user:g.user,max_tokens:r,temperature:n,top_p:i,frequency_penalty:a,presence_penalty:s,seed:p,prompt:x,stop:y.length>0?y:void 0},warnings:h}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,_ref,o,a,_ref1,s,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),o=_ref.args,a=_ref.warnings;return[4,zt({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:o,failedResponseHandler:pu,successfulResponseHandler:wt(Bkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),s=_ref1.responseHeaders,l=_ref1.value,c=_ref1.rawValue,d=l.choices[0],u={openai:{}};return[2,(d.logprobs!=null&&(u.openai.logprobs=d.logprobs),{content:[{type:"text",text:d.text}],usage:OCe(l.usage),finishReason:{unified:NCe(d.finish_reason),raw:(i=d.finish_reason)!=null?i:void 0},request:{body:o},response:_object_spread_props(_object_spread({},$Ce(l)),{headers:s,body:c}),providerMetadata:u,warnings:a})]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,_ref,i,o,a,s,_ref1,l,c,d,u,p,m,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),i=_ref.args,o=_ref.warnings,a=_object_spread_props(_object_spread({},i),{stream:!0,stream_options:{include_usage:!0}}),s=this.config.url({path:"/completions",modelId:this.modelId});return[4,zt({url:s,headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:a,failedResponseHandler:pu,successfulResponseHandler:Oo(qkt),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),l=_ref1.responseHeaders,c=_ref1.value;return[4,jG({stream:c,getError:function(x){return"error"in x?x.error:void 0},isOutputChunk:Vkt,url:s,requestBodyValues:a,responseHeaders:l})];case 3:d=_state.sent(),u={unified:"other",raw:void 0},p={openai:{}},h=!0;return[2,{stream:d.pipeThrough(new TransformStream({start:function start(x){x.enqueue({type:"stream-start",warnings:o})},transform:function transform(x,v){if(t.includeRawChunks&&v.enqueue({type:"raw",rawValue:x.rawValue}),!x.success){u={unified:"error",raw:void 0},v.enqueue({type:"error",error:x.error});return}var y=x.value;if("error"in y){u={unified:"error",raw:void 0},v.enqueue({type:"error",error:y.error});return}h&&(h=!1,v.enqueue(_object_spread({type:"response-metadata"},$Ce(y))),v.enqueue({type:"text-start",id:"0"})),y.usage!=null&&(m=y.usage);var _=y.choices[0];(_==null?void 0:_.finish_reason)!=null&&(u={unified:NCe(_.finish_reason),raw:_.finish_reason}),(_==null?void 0:_.logprobs)!=null&&(p.openai.logprobs=_.logprobs),(_==null?void 0:_.text)!=null&&_.text.length>0&&v.enqueue({type:"text-delta",id:"0",delta:_.text})},flush:function flush(x){h||x.enqueue({type:"text-end",id:"0"}),x.enqueue({type:"finish",finishReason:u,providerMetadata:p,usage:OCe(m)})}})),request:{body:a},response:{headers:l}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new tEe(t.modelId,t.config)}}]);return tEe}();function Vkt(e){return!("error"in e)&&e.choices.some(function(t){return t.text.length>0})}var Gkt=ne(function(){return te(f.object({dimensions:f.number().optional(),user:f.string().optional()}))}),Hkt=ne(function(){return te(f.object({data:f.array(f.object({embedding:f.array(f.number())})),usage:f.object({prompt_tokens:f.number()}).nullish()}))}),Zkt=/*#__PURE__*/function(){"use strict";function rEe(t,r){_class_call_check(this,rEe);this.specificationVersion="v4",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=t,this.config=r}_create_class(rEe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doEmbed",value:function doEmbed(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,_ref,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.values,r=param.headers,n=param.abortSignal,i=param.providerOptions;if(t.length>this.maxEmbeddingsPerCall)throw new Zg({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:t});return[4,$t({provider:"openai",providerOptions:i,schema:Gkt})];case 1:l=(o=_state.sent())!=null?o:{};return[4,zt({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:ht((s=(a=this.config).headers)==null?void 0:s.call(a),r),body:{model:this.modelId,input:t,encoding_format:"float",dimensions:l.dimensions,user:l.user},failedResponseHandler:pu,successfulResponseHandler:wt(Hkt),abortSignal:n,fetch:this.config.fetch})];case 2:_ref=_state.sent(),c=_ref.responseHeaders,d=_ref.value,u=_ref.rawValue;return[2,{warnings:[],embeddings:d.data.map(function(p){return p.embedding}),usage:d.usage?{tokens:d.usage.prompt_tokens}:void 0,response:{headers:c,body:u}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new rEe(t.modelId,t.config)}}]);return rEe}(),Kkt=ne(function(){return te(f.object({id:f.string(),object:f.string().nullish(),bytes:f.number().nullish(),created_at:f.number().nullish(),filename:f.string().nullish(),purpose:f.string().nullish(),status:f.string().nullish(),expires_at:f.number().nullish()}))}),Qkt=ne(function(){return te(f.object({purpose:f.string().optional(),expiresAfter:f.number().optional()}))}),Jkt=/*#__PURE__*/function(){"use strict";function Jkt1(e){_class_call_check(this,Jkt1);this.config=e,this.specificationVersion="v4"}_create_class(Jkt1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"uploadFile",value:function uploadFile(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,_ref,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.data,t=param.mediaType,r=param.filename,n=param.providerOptions;return[4,$t({provider:"openai",providerOptions:n,schema:Qkt})];case 1:s=_state.sent(),l=Gd(e),c=new Blob([l],{type:t}),d=new FormData;r!=null?d.append("file",c,r):d.append("file",c),d.append("purpose",(i=s==null?void 0:s.purpose)!=null?i:"assistants"),(s==null?void 0:s.expiresAfter)!=null&&d.append("expires_after",String(s.expiresAfter));return[4,ul({url:"".concat(this.config.baseURL,"/files"),headers:ht(this.config.headers()),formData:d,failedResponseHandler:pu,successfulResponseHandler:wt(Kkt),fetch:this.config.fetch})];case 2:_ref=_state.sent(),u=_ref.value;return[2,_object_spread_props(_object_spread({warnings:[],providerReference:{openai:u.id}},((o=u.filename)!=null?o:r)?{filename:(a=u.filename)!=null?a:r}:{},t!=null?{mediaType:t}:{}),{providerMetadata:{openai:_object_spread({},u.filename!=null?{filename:u.filename}:{},u.purpose!=null?{purpose:u.purpose}:{},u.bytes!=null?{bytes:u.bytes}:{},u.created_at!=null?{createdAt:u.created_at}:{},u.status!=null?{status:u.status}:{},u.expires_at!=null?{expiresAt:u.expires_at}:{})}})]}})}).apply(this,arguments)}}]);return Jkt1}(),LCe=ne(function(){return te(f.object({created:f.number().nullish(),data:f.array(f.object({b64_json:f.string(),revised_prompt:f.string().nullish()})),background:f.string().nullish(),output_format:f.string().nullish(),size:f.string().nullish(),quality:f.string().nullish(),usage:f.object({input_tokens:f.number().nullish(),output_tokens:f.number().nullish(),total_tokens:f.number().nullish(),input_tokens_details:f.object({image_tokens:f.number().nullish(),text_tokens:f.number().nullish()}).nullish()}).nullish()}))}),Ykt={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10,"gpt-image-1.5":10,"gpt-image-2":10,"chatgpt-image-latest":10},Xkt=["chatgpt-image-","gpt-image-"];function e7t(e){return Xkt.some(function(t){return e.startsWith(t)})}function t7t(e){var t;return(t=Ykt[e])!=null?t:e.startsWith("gpt-image-")?10:1}var UG=f.object({quality:f.enum(["standard","hd","low","medium","high","auto"]).optional(),background:f.enum(["transparent","opaque","auto"]).optional(),outputFormat:f.enum(["png","jpeg","webp"]).optional(),outputCompression:f.number().int().min(0).max(100).optional(),user:f.string().optional()}),h7r=ne(function(){return te(UG)}),r7t=ne(function(){return te(UG.extend({style:f.enum(["vivid","natural"]).optional(),moderation:f.enum(["auto","low"]).optional()}))}),n7t=ne(function(){return te(UG.extend({inputFidelity:f.enum(["high","low"]).optional()}))}),i7t=/*#__PURE__*/function(){"use strict";function nEe(t,r){_class_call_check(this,nEe);this.modelId=t,this.config=r,this.specificationVersion="v4"}_create_class(nEe,[{key:"maxImagesPerCall",get:function get1(){return t7t(this.modelId)}},{key:"provider",get:function get1(){return this.config.provider}},{key:"doGenerate",value:function doGenerate(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,$,_ref,z,D,_tmp,_tmp1,_tmp2,O,_ref1,M,R;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.prompt,r=param.files,n=param.mask,i=param.n,o=param.size,a=param.aspectRatio,s=param.seed,l=param.providerOptions,c=param.headers,d=param.abortSignal;T=[];a!=null&&T.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),s!=null&&T.push({type:"unsupported",feature:"seed"});I=(m=(p=(u=this.config._internal)==null?void 0:u.currentDate)==null?void 0:p.call(u))!=null?m:new Date;if(!(r!=null))return[3,7];return[4,$t({provider:"openai",providerOptions:l,schema:n7t})];case 1:$=(h=_state.sent())!=null?h:{};_tmp={url:this.config.url({path:"/images/edits",modelId:this.modelId}),headers:ht((x=(g=this.config).headers)==null?void 0:x.call(g),c)};_tmp1={model:this.modelId,prompt:t};return[4,Promise.all(r.map(function(L){return L.type==="file"?new Blob([_instanceof(L.data,Uint8Array)?new Blob([L.data],{type:L.mediaType}):new Blob([Ui(L.data)],{type:L.mediaType})],{type:L.mediaType}):X3(L.url)}))];case 2:_tmp1.image=_state.sent();if(!(n!=null))return[3,4];return[4,o7t(n)];case 3:_tmp2=_state.sent();return[3,5];case 4:_tmp2=void 0;_state.label=5;case 5:return[4,ul.apply(void 0,[(_tmp.formData=iT.apply(void 0,[(_tmp1.mask=_tmp2,_tmp1.n=i,_tmp1.size=o,_tmp1.quality=$.quality,_tmp1.background=$.background,_tmp1.output_format=$.outputFormat,_tmp1.output_compression=$.outputCompression,_tmp1.input_fidelity=$.inputFidelity,_tmp1.user=$.user,_tmp1)]),_tmp.failedResponseHandler=pu,_tmp.successfulResponseHandler=wt(LCe),_tmp.abortSignal=d,_tmp.fetch=this.config.fetch,_tmp)])];case 6:_ref=_state.sent(),z=_ref.value,D=_ref.responseHeaders;return[2,{images:z.data.map(function(L){return L.b64_json}),warnings:T,usage:z.usage!=null?{inputTokens:(v=z.usage.input_tokens)!=null?v:void 0,outputTokens:(y=z.usage.output_tokens)!=null?y:void 0,totalTokens:(_=z.usage.total_tokens)!=null?_:void 0}:void 0,response:{timestamp:I,modelId:this.modelId,headers:D},providerMetadata:{openai:{images:z.data.map(function(L,ee){var pe,N,U,G,K,me;return _object_spread(_object_spread_props(_object_spread({},L.revised_prompt?{revisedPrompt:L.revised_prompt}:{}),{created:(pe=z.created)!=null?pe:void 0,size:(N=z.size)!=null?N:void 0,quality:(U=z.quality)!=null?U:void 0,background:(G=z.background)!=null?G:void 0,outputFormat:(K=z.output_format)!=null?K:void 0}),FCe((me=z.usage)==null?void 0:me.input_tokens_details,ee,z.data.length))})}}}];case 7:return[4,$t({provider:"openai",providerOptions:l,schema:r7t})];case 8:O=(b=_state.sent())!=null?b:{};return[4,zt({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:ht((S=(w=this.config).headers)==null?void 0:S.call(w),c),body:_object_spread({model:this.modelId,prompt:t,n:i,size:o,quality:O.quality,style:O.style,background:O.background,moderation:O.moderation,output_format:O.outputFormat,output_compression:O.outputCompression,user:O.user},e7t(this.modelId)?{}:{response_format:"b64_json"}),failedResponseHandler:pu,successfulResponseHandler:wt(LCe),abortSignal:d,fetch:this.config.fetch})];case 9:_ref1=_state.sent(),M=_ref1.value,R=_ref1.responseHeaders;return[2,{images:M.data.map(function($){return $.b64_json}),warnings:T,usage:M.usage!=null?{inputTokens:(k=M.usage.input_tokens)!=null?k:void 0,outputTokens:(E=M.usage.output_tokens)!=null?E:void 0,totalTokens:(C=M.usage.total_tokens)!=null?C:void 0}:void 0,response:{timestamp:I,modelId:this.modelId,headers:R},providerMetadata:{openai:{images:M.data.map(function($,z){var D,L,ee,pe,N,U;return _object_spread(_object_spread_props(_object_spread({},$.revised_prompt?{revisedPrompt:$.revised_prompt}:{}),{created:(D=M.created)!=null?D:void 0,size:(L=M.size)!=null?L:void 0,quality:(ee=M.quality)!=null?ee:void 0,background:(pe=M.background)!=null?pe:void 0,outputFormat:(N=M.output_format)!=null?N:void 0}),FCe((U=M.usage)==null?void 0:U.input_tokens_details,z,M.data.length))})}}}]}})}).apply(this,arguments)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new nEe(t.modelId,t.config)}}]);return nEe}();function FCe(e,t,r){if(e==null)return{};var n={};if(e.image_tokens!=null){var i=Math.floor(e.image_tokens/r),o=e.image_tokens-i*(r-1);n.imageTokens=t===r-1?o:i}if(e.text_tokens!=null){var i10=Math.floor(e.text_tokens/r),o10=e.text_tokens-i10*(r-1);n.textTokens=t===r-1?o10:i10}return n}function o7t(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){if(!e)return[2];if(e.type==="url")return[2,X3(e.url)];t=_instanceof(e.data,Uint8Array)?e.data:Ui(e.data);return[2,new Blob([t],{type:e.mediaType})]})})()}var iEe=ne(function(){return te(f.object({callId:f.string(),operation:f.discriminatedUnion("type",[f.object({type:f.literal("create_file"),path:f.string(),diff:f.string()}),f.object({type:f.literal("delete_file"),path:f.string()}),f.object({type:f.literal("update_file"),path:f.string(),diff:f.string()})])}))}),oEe=ne(function(){return te(f.object({status:f.enum(["completed","failed"]),output:f.string().optional()}))}),y7r=ne(function(){return te(f.object({}))}),a7t=Zd({id:"openai.apply_patch",inputSchema:iEe,outputSchema:oEe}),s7t=a7t,l7t=ne(function(){return te(f.object({code:f.string().nullish(),containerId:f.string()}))}),u7t=ne(function(){return te(f.object({outputs:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("logs"),logs:f.string()}),f.object({type:f.literal("image"),url:f.string()})])).nullish()}))}),c7t=ne(function(){return te(f.object({container:f.union([f.string(),f.object({fileIds:f.array(f.string()).optional()})]).optional()}))}),d7t=tr({id:"openai.code_interpreter",inputSchema:l7t,outputSchema:u7t}),p7t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return d7t(e)},aEe=f.object({id:f.string(),code:f.string().optional(),message:f.string().optional()}),f7t=f.discriminatedUnion("type",[f.object({type:f.literal("click"),button:f.enum(["left","right","wheel","back","forward"]),x:f.number(),y:f.number(),keys:f.array(f.string()).optional()}),f.object({type:f.literal("double_click"),x:f.number(),y:f.number(),keys:f.array(f.string()).optional()}),f.object({type:f.literal("drag"),path:f.array(f.object({x:f.number(),y:f.number()})),keys:f.array(f.string()).optional()}),f.object({type:f.literal("keypress"),keys:f.array(f.string())}),f.object({type:f.literal("move"),x:f.number(),y:f.number(),keys:f.array(f.string()).optional()}),f.object({type:f.literal("screenshot")}),f.object({type:f.literal("scroll"),x:f.number(),y:f.number(),scrollX:f.number(),scrollY:f.number(),keys:f.array(f.string()).optional()}),f.object({type:f.literal("type"),text:f.string()}),f.object({type:f.literal("wait")})]),sEe=ne(function(){return te(f.object({actions:f.array(f7t),pendingSafetyChecks:f.array(aEe),status:f.enum(["in_progress","completed","incomplete"])}))}),lEe=ne(function(){return te(f.object({output:f.union([f.object({type:f.literal("computer_screenshot"),imageUrl:f.string(),fileId:f.string().optional(),detail:f.enum(["auto","low","high","original"]).optional()}),f.object({type:f.literal("computer_screenshot"),fileId:f.string(),imageUrl:f.string().optional(),detail:f.enum(["auto","low","high","original"]).optional()})]),acknowledgedSafetyChecks:f.array(aEe).optional()}))}),m7t=Zd({id:"openai.computer",inputSchema:sEe,outputSchema:lEe}),h7t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return m7t(e)},g7t=ne(function(){return te(f.object({description:f.string().optional(),format:f.union([f.object({type:f.literal("grammar"),syntax:f.enum(["regex","lark"]),definition:f.string()}),f.object({type:f.literal("text")})]).optional()}))}),x7t=ne(function(){return te(f.string())}),y7t=Yi({id:"openai.custom",inputSchema:x7t}),v7t=function(e){return y7t(e)},uEe=f.object({key:f.string(),type:f.enum(["eq","ne","gt","gte","lt","lte","in","nin"]),value:f.union([f.string(),f.number(),f.boolean(),f.array(f.string())])}),cEe=f.object({type:f.enum(["and","or"]),filters:f.array(f.union([uEe,f.lazy(function(){return cEe})]))}),_7t=ne(function(){return te(f.object({vectorStoreIds:f.array(f.string()),maxNumResults:f.number().optional(),ranking:f.object({ranker:f.string().optional(),scoreThreshold:f.number().optional()}).optional(),filters:f.union([uEe,cEe]).optional()}))}),b7t=ne(function(){return te(f.object({queries:f.array(f.string()),results:f.array(f.object({attributes:f.record(f.string(),f.unknown()),fileId:f.string(),filename:f.string(),score:f.number(),text:f.string()})).nullable()}))}),w7t=tr({id:"openai.file_search",inputSchema:f.object({}),outputSchema:b7t}),S7t=ne(function(){return te(f.object({background:f.enum(["auto","opaque","transparent"]).optional(),inputFidelity:f.enum(["low","high"]).optional(),inputImageMask:f.object({fileId:f.string().optional(),imageUrl:f.string().optional()}).optional(),model:f.string().optional(),moderation:f.enum(["auto"]).optional(),outputCompression:f.number().int().min(0).max(100).optional(),outputFormat:f.enum(["png","jpeg","webp"]).optional(),partialImages:f.number().int().min(0).max(3).optional(),quality:f.enum(["auto","low","medium","high"]).optional(),size:f.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict())}),k7t=ne(function(){return te(f.object({}))}),C7t=ne(function(){return te(f.object({result:f.string()}))}),E7t=tr({id:"openai.image_generation",inputSchema:k7t,outputSchema:C7t}),T7t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E7t(e)},dEe=ne(function(){return te(f.object({action:f.object({type:f.literal("exec"),command:f.array(f.string()),timeoutMs:f.number().optional(),user:f.string().optional(),workingDirectory:f.string().optional(),env:f.record(f.string(),f.string()).optional()})}))}),pEe=ne(function(){return te(f.object({output:f.string()}))}),A7t=Zd({id:"openai.local_shell",inputSchema:dEe,outputSchema:pEe}),fEe=ne(function(){return te(f.object({action:f.object({commands:f.array(f.string()),timeoutMs:f.number().optional(),maxOutputLength:f.number().optional()})}))}),PG=ne(function(){return te(f.object({output:f.array(f.object({stdout:f.string(),stderr:f.string(),outcome:f.discriminatedUnion("type",[f.object({type:f.literal("timeout")}),f.object({type:f.literal("exit"),exitCode:f.number()})])}))}))}),I7t=f.array(f.discriminatedUnion("type",[f.object({type:f.literal("skillReference"),providerReference:f.record(f.string(),f.string()),version:f.string().optional()}),f.object({type:f.literal("inline"),name:f.string(),description:f.string(),source:f.object({type:f.literal("base64"),mediaType:f.literal("application/zip"),data:f.string()})})])).optional(),P7t=ne(function(){return te(f.object({environment:f.union([f.object({type:f.literal("containerAuto"),fileIds:f.array(f.string()).optional(),memoryLimit:f.enum(["1g","4g","16g","64g"]).optional(),networkPolicy:f.discriminatedUnion("type",[f.object({type:f.literal("disabled")}),f.object({type:f.literal("allowlist"),allowedDomains:f.array(f.string()),domainSecrets:f.array(f.object({domain:f.string(),name:f.string(),value:f.string()})).optional()})]).optional(),skills:I7t}),f.object({type:f.literal("containerReference"),containerId:f.string()}),f.object({type:f.literal("local").optional(),skills:f.array(f.object({name:f.string(),description:f.string(),path:f.string()})).optional()})]).optional()}))}),R7t=Zd({id:"openai.shell",inputSchema:fEe,outputSchema:PG}),M7t=ne(function(){return te(f.object({execution:f.enum(["server","client"]).optional(),description:f.string().optional(),parameters:f.record(f.string(),f.unknown()).optional()}))}),RG=ne(function(){return te(f.object({arguments:f.unknown().optional(),call_id:f.string().nullish()}))}),MG=ne(function(){return te(f.object({tools:f.array(f.record(f.string(),f.unknown()))}))}),O7t=Zd({id:"openai.tool_search",inputSchema:RG,outputSchema:MG}),$7t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return O7t(e)},N7t=ne(function(){return te(f.object({externalWebAccess:f.boolean().optional(),filters:f.object({allowedDomains:f.array(f.string()).optional()}).optional(),searchContextSize:f.enum(["low","medium","high"]).optional(),userLocation:f.object({type:f.literal("approximate"),country:f.string().optional(),city:f.string().optional(),region:f.string().optional(),timezone:f.string().optional()}).optional()}))}),D7t=ne(function(){return te(f.object({}))}),L7t=ne(function(){return te(f.object({action:f.discriminatedUnion("type",[f.object({type:f.literal("search"),query:f.string().optional(),queries:f.array(f.string()).optional()}),f.object({type:f.literal("openPage"),url:f.string().nullish()}),f.object({type:f.literal("findInPage"),url:f.string().nullish(),pattern:f.string().nullish()})]).optional(),sources:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("url"),url:f.string()}),f.object({type:f.literal("api"),name:f.string()})])).optional()}))}),F7t=tr({id:"openai.web_search",inputSchema:D7t,outputSchema:L7t}),z7t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return F7t(e)},j7t=ne(function(){return te(f.object({searchContextSize:f.enum(["low","medium","high"]).optional(),userLocation:f.object({type:f.literal("approximate"),country:f.string().optional(),city:f.string().optional(),region:f.string().optional(),timezone:f.string().optional()}).optional()}))}),U7t=ne(function(){return te(f.object({}))}),B7t=ne(function(){return te(f.object({action:f.discriminatedUnion("type",[f.object({type:f.literal("search"),query:f.string().optional()}),f.object({type:f.literal("openPage"),url:f.string().nullish()}),f.object({type:f.literal("findInPage"),url:f.string().nullish(),pattern:f.string().nullish()})]).optional()}))}),q7t=tr({id:"openai.web_search_preview",inputSchema:U7t,outputSchema:B7t}),OG=f.lazy(function(){return f.union([f.string(),f.number(),f.boolean(),f.null(),f.array(OG),f.record(f.string(),OG)])}),W7t=ne(function(){return te(f.object({serverLabel:f.string(),allowedTools:f.union([f.array(f.string()),f.object({readOnly:f.boolean().optional(),toolNames:f.array(f.string()).optional()})]).optional(),authorization:f.string().optional(),connectorId:f.string().optional(),headers:f.record(f.string(),f.string()).optional(),requireApproval:f.union([f.enum(["always","never"]),f.object({never:f.object({toolNames:f.array(f.string()).optional()}).optional()})]).optional(),serverDescription:f.string().optional(),serverUrl:f.string().optional()}).refine(function(e){return e.serverUrl!=null||e.connectorId!=null},"One of serverUrl or connectorId must be provided."))}),V7t=ne(function(){return te(f.object({}))}),G7t=ne(function(){return te(f.object({type:f.literal("call"),serverLabel:f.string(),name:f.string(),arguments:f.string(),output:f.string().nullish(),error:f.union([f.string(),OG]).optional()}))}),H7t=tr({id:"openai.mcp",inputSchema:V7t,outputSchema:G7t}),Z7t=function(e){return H7t(e)},mEe=ne(function(){return te(f.object({code:f.string(),fingerprint:f.string()}))}),hEe=ne(function(){return te(f.object({result:f.string(),status:f.enum(["completed","incomplete"])}))}),K7t=tr({id:"openai.programmatic_tool_calling",inputSchema:mEe,outputSchema:hEe,supportsDeferredResults:!0}),Q7t=function(){return K7t({})},J7t={applyPatch:s7t,customTool:v7t,codeInterpreter:p7t,computer:h7t,fileSearch:w7t,imageGeneration:T7t,localShell:A7t,shell:R7t,webSearchPreview:q7t,webSearch:z7t,mcp:Z7t,programmaticToolCalling:Q7t,toolSearch:$7t};function Y7t(e){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_;var b=e,w=b.type;switch(w){case"session.created":return{type:"session-created",sessionId:(t=b.session)==null?void 0:t.id,raw:e};case"session.updated":return{type:"session-updated",raw:e};case"input_audio_buffer.speech_started":return{type:"speech-started",itemId:b.item_id,raw:e};case"input_audio_buffer.speech_stopped":return{type:"speech-stopped",itemId:b.item_id,raw:e};case"input_audio_buffer.committed":return{type:"audio-committed",itemId:b.item_id,previousItemId:b.previous_item_id,raw:e};case"conversation.item.added":return{type:"conversation-item-added",itemId:(n=(r=b.item)==null?void 0:r.id)!=null?n:b.item_id,item:b.item,raw:e};case"conversation.item.input_audio_transcription.completed":return{type:"input-transcription-completed",itemId:b.item_id,transcript:(i=b.transcript)!=null?i:"",raw:e};case"response.created":return{type:"response-created",responseId:(a=(o=b.response)==null?void 0:o.id)!=null?a:b.response_id,raw:e};case"response.done":return{type:"response-done",responseId:(l=(s=b.response)==null?void 0:s.id)!=null?l:b.response_id,status:(d=(c=b.response)==null?void 0:c.status)!=null?d:"completed",raw:e};case"response.output_item.added":return{type:"output-item-added",responseId:b.response_id,itemId:(p=(u=b.item)==null?void 0:u.id)!=null?p:b.item_id,raw:e};case"response.output_item.done":return{type:"output-item-done",responseId:b.response_id,itemId:(h=(m=b.item)==null?void 0:m.id)!=null?h:b.item_id,raw:e};case"response.content_part.added":return{type:"content-part-added",responseId:b.response_id,itemId:b.item_id,raw:e};case"response.content_part.done":return{type:"content-part-done",responseId:b.response_id,itemId:b.item_id,raw:e};case"response.output_audio.delta":return{type:"audio-delta",responseId:b.response_id,itemId:b.item_id,delta:b.delta,raw:e};case"response.output_audio.done":return{type:"audio-done",responseId:b.response_id,itemId:b.item_id,raw:e};case"response.output_audio_transcript.delta":return{type:"audio-transcript-delta",responseId:b.response_id,itemId:b.item_id,delta:b.delta,raw:e};case"response.output_audio_transcript.done":return{type:"audio-transcript-done",responseId:b.response_id,itemId:b.item_id,transcript:b.transcript,raw:e};case"response.output_text.delta":return{type:"text-delta",responseId:b.response_id,itemId:b.item_id,delta:b.delta,raw:e};case"response.output_text.done":return{type:"text-done",responseId:b.response_id,itemId:b.item_id,text:b.text,raw:e};case"response.function_call_arguments.delta":return{type:"function-call-arguments-delta",responseId:b.response_id,itemId:b.item_id,callId:b.call_id,delta:b.delta,raw:e};case"response.function_call_arguments.done":return{type:"function-call-arguments-done",responseId:b.response_id,itemId:b.item_id,callId:b.call_id,name:b.name,arguments:b.arguments,raw:e};case"error":return{type:"error",message:(v=(x=(g=b.error)==null?void 0:g.message)!=null?x:b.message)!=null?v:"Unknown error",code:(_=(y=b.error)==null?void 0:y.code)!=null?_:b.code,raw:e};default:return{type:"custom",rawType:w,raw:e}}}function X7t(e,t){switch(e.type){case"session-update":return{type:"session.update",session:$G(e.config,t)};case"input-audio-append":return{type:"input_audio_buffer.append",audio:e.audio};case"input-audio-commit":return{type:"input_audio_buffer.commit"};case"input-audio-clear":return{type:"input_audio_buffer.clear"};case"conversation-item-create":{var r=e.item;switch(r.type){case"text-message":return{type:"conversation.item.create",item:{type:"message",role:r.role,content:[{type:"input_text",text:r.text}]}};case"audio-message":return{type:"conversation.item.create",item:{type:"message",role:r.role,content:[{type:"input_audio",audio:r.audio}]}};case"function-call-output":return{type:"conversation.item.create",item:{type:"function_call_output",call_id:r.callId,output:r.output}}}break}case"conversation-item-truncate":return{type:"conversation.item.truncate",item_id:e.itemId,content_index:e.contentIndex,audio_end_ms:e.audioEndMs};case"response-create":return _object_spread({type:"response.create"},e.options!=null?{response:_object_spread({},e.options.modalities!=null?{output_modalities:e.options.modalities}:{},e.options.instructions!=null?{instructions:e.options.instructions}:{},e.options.metadata!=null?{metadata:e.options.metadata}:{})}:{});case"response-cancel":return{type:"response.cancel"}}}function $G(e,t){var r;var n={type:"realtime",model:t};e.instructions!=null&&(n.instructions=e.instructions),e.outputModalities!=null&&(n.output_modalities=e.outputModalities);var i={};if(e.inputAudioFormat!=null||e.inputAudioTranscription!=null||e.turnDetection!=null){var o={};if(e.inputAudioFormat!=null&&(o.format=_object_spread({type:e.inputAudioFormat.type},e.inputAudioFormat.rate!=null?{rate:e.inputAudioFormat.rate}:{})),e.turnDetection!=null)if(e.turnDetection.type==="disabled")o.turn_detection=null;else{var a={type:e.turnDetection.type==="server-vad"?"server_vad":"semantic_vad"};e.turnDetection.threshold!=null&&(a.threshold=e.turnDetection.threshold),e.turnDetection.silenceDurationMs!=null&&(a.silence_duration_ms=e.turnDetection.silenceDurationMs),e.turnDetection.prefixPaddingMs!=null&&(a.prefix_padding_ms=e.turnDetection.prefixPaddingMs),o.turn_detection=a}e.inputAudioTranscription!=null&&(o.transcription=_object_spread({model:(r=e.inputAudioTranscription.model)!=null?r:"gpt-realtime-whisper"},e.inputAudioTranscription.language!=null?{language:e.inputAudioTranscription.language}:{},e.inputAudioTranscription.prompt!=null?{prompt:e.inputAudioTranscription.prompt}:{})),i.input=o}if(e.outputAudioFormat!=null||e.voice!=null){var o10={};e.outputAudioFormat!=null&&(o10.format=_object_spread({type:e.outputAudioFormat.type},e.outputAudioFormat.rate!=null?{rate:e.outputAudioFormat.rate}:{})),e.voice!=null&&(o10.voice=e.voice),i.output=o10}return Object.keys(i).length>0&&(n.audio=i),e.tools!=null&&e.tools.length>0&&(n.tools=e.tools.map(function(o){return{type:o.type,name:o.name,description:o.description,parameters:o.parameters}}),n.tool_choice="auto"),e.providerOptions!=null&&Object.assign(n,e.providerOptions),n}var e8t=/*#__PURE__*/function(){"use strict";function e8t1(e,t){_class_call_check(this,e8t1);this.specificationVersion="v4",this.modelId=e,this.provider=t.provider,this.config=t}_create_class(e8t1,[{key:"doCreateClientSecret",value:function doCreateClientSecret(e){return _async_to_generator(function(){var t,r,n,i,o,s,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(t=this.config.fetch)!=null?t:fetch,n="".concat(this.config.baseURL,"/realtime/client_secrets"),i=e.sessionConfig!=null?$G(e.sessionConfig,this.modelId):{type:"realtime",model:this.modelId};return[4,r(n,{method:"POST",headers:_object_spread_props(_object_spread({},this.config.headers()),{"Content-Type":"application/json"}),body:JSON.stringify(_object_spread({session:i},e.expiresAfterSeconds!=null?{expires_after:{anchor:"created_at",seconds:e.expiresAfterSeconds}}:{}))})];case 1:o=_state.sent();if(!!o.ok)return[3,3];return[4,o.text()];case 2:s=_state.sent();throw new Error("OpenAI realtime client secret request failed: ".concat(o.status," ").concat(s));case 3:return[4,o.json()];case 4:a=_state.sent();return[2,{token:a.value,url:"wss://".concat(new URL(this.config.baseURL).host,"/v1/realtime?model=").concat(encodeURIComponent(this.modelId)),expiresAt:a.expires_at}]}})}).call(this)}},{key:"getWebSocketConfig",value:function getWebSocketConfig(e){return{url:e.url,protocols:["realtime","openai-insecure-api-key.".concat(e.token)]}}},{key:"parseServerEvent",value:function parseServerEvent(e){return Y7t(e)}},{key:"serializeClientEvent",value:function serializeClientEvent(e){return X7t(e,this.modelId)}},{key:"buildSessionConfig",value:function buildSessionConfig(e){return $G(e,this.modelId)}}]);return e8t1}();function zCe(e){var t,r,n,i,o,a;if(e==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};var s=e.input_tokens,l=e.output_tokens,c=(r=(t=e.input_tokens_details)==null?void 0:t.cached_tokens)!=null?r:0,d=(i=(n=e.input_tokens_details)==null?void 0:n.cache_write_tokens)!=null?i:void 0,u=(a=(o=e.output_tokens_details)==null?void 0:o.reasoning_tokens)!=null?a:0;return{inputTokens:{total:s,noCache:s-c-(d!=null?d:0),cacheRead:c,cacheWrite:d},outputTokens:{total:l,text:l-u,reasoning:u},raw:e}}function t8t(e){return JSON.stringify(e===void 0?{}:e)}function jCe(e){return e==null?void 0:e.type==="program"?{type:"program",caller_id:e.callerId}:e}function v_(e,t){var r;return(r=e==null?void 0:e[t])==null?void 0:r.promptCacheBreakpoint}function UCe(e,t){return t?t.some(function(r){return e.startsWith(r)}):!1}function r8t(_01){return _async_to_generator(function(param){var e,t,r,n,i,tmp,o,a,tmp1,s,tmp2,l,tmp3,c,tmp4,d,tmp5,u,tmp6,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,D,L,ee,pe,N,U,G,K,me,V,ie,re,de,xe,Y,oe,H,J,j,Q,Fe,it,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,pt,nt,gt,Ie,Ie1,Ie2,Ie3,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,we,_10,Oe,Pe,tt,Oe1,Pe1,tt1,We,Rt,Ve,_tmp,Rt1,Ut,Rt2,Rt3,Rt4,Rt5,Oe2,Pe2,tt2,Pe3,tt3,Pe4,Pe5,Oe3,Pe6,tt4,_tt_summary,We1,tt5,We2,Oe4,Pe7,tt6,err,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,Ie4,We3,we1,Oe5,We4,We5,We6,We7,We8,We9,Pe8,tt7,err,Ie5,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.prompt,t=param.toolNameMapping,r=param.systemMessageMode,n=param.providerOptionsName,i=param.fileIdPrefixes,tmp=param.passThroughUnsupportedFiles,o=tmp===void 0?!1:tmp,a=param.store,tmp1=param.hasConversation,s=tmp1===void 0?!1:tmp1,tmp2=param.hasPreviousResponseId,l=tmp2===void 0?!1:tmp2,tmp3=param.hasLocalShellTool,c=tmp3===void 0?!1:tmp3,tmp4=param.hasShellTool,d=tmp4===void 0?!1:tmp4,tmp5=param.hasApplyPatchTool,u=tmp5===void 0?!1:tmp5,tmp6=param.hasComputerTool,p=tmp6===void 0?!1:tmp6,m=param.customProviderToolNames;Q=[],Fe=[],it=new Set;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,66,67,68]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,65];_step_value=_step.value,pt=_step_value.role,nt=_step_value.content,gt=_step_value.providerOptions;switch(pt){case"system":return[3,3];case"user":return[3,4];case"assistant":return[3,5];case"tool":return[3,45]}return[3,63];case 3:{switch(r){case"system":{Ie=v_(gt,n);Q.push({role:"system",content:Ie==null?nt:[{type:"input_text",text:nt,prompt_cache_breakpoint:Ie}]});break}case"developer":{Ie1=v_(gt,n);Q.push({role:"developer",content:Ie1==null?nt:[{type:"input_text",text:nt,prompt_cache_breakpoint:Ie1}]});break}case"remove":{Fe.push({type:"other",message:"system messages are removed for this model"});break}default:{Ie2=r;throw new Error("Unsupported system message mode: ".concat(Ie2))}}return[3,64]}_state.label=4;case 4:{Q.push({role:"user",content:nt.map(function(Ie,we){var Oe,Pe,tt,We,Ut;switch(Ie.type){case"text":{var Rt=v_(Ie.providerOptions,n);return _object_spread({type:"input_text",text:Ie.text},Rt!=null&&{prompt_cache_breakpoint:Rt})}case"file":{var Rt1=v_(Ie.providerOptions,n);switch(Ie.data.type){case"reference":{var Ve=ns({reference:Ie.data.reference,provider:n});return ea(Ie.mediaType)==="image"?_object_spread({type:"input_image",file_id:Ve,detail:(Pe=(Oe=Ie.providerOptions)==null?void 0:Oe[n])==null?void 0:Pe.imageDetail},Rt1!=null&&{prompt_cache_breakpoint:Rt1}):_object_spread({type:"input_file",file_id:Ve},Rt1!=null&&{prompt_cache_breakpoint:Rt1})}case"text":throw new or({functionality:"text file parts"});case"url":case"data":{if(ea(Ie.mediaType)==="image")return _object_spread(_object_spread_props(_object_spread({type:"input_image"},Ie.data.type==="url"?{image_url:Ie.data.url.toString()}:typeof Ie.data.data=="string"&&UCe(Ie.data.data,i)?{file_id:Ie.data.data}:{image_url:"data:".concat(ai({part:Ie}),";base64,").concat(Fr(Ie.data.data))}),{detail:(We=(tt=Ie.providerOptions)==null?void 0:tt[n])==null?void 0:We.imageDetail}),Rt1!=null&&{prompt_cache_breakpoint:Rt1});{if(Ie.data.type==="url")return _object_spread({type:"input_file",file_url:Ie.data.url.toString()},Rt1!=null&&{prompt_cache_breakpoint:Rt1});var Tr=ai({part:Ie});if(Tr!=="application/pdf"&&!o)throw new or({functionality:"file part media type ".concat(Tr)});return _object_spread({type:"input_file"},typeof Ie.data.data=="string"&&UCe(Ie.data.data,i)?{file_id:Ie.data.data}:{filename:(Ut=Ie.filename)!=null?Ut:Tr==="application/pdf"?"part-".concat(we,".pdf"):"part-".concat(we),file_data:"data:".concat(Tr,";base64,").concat(Fr(Ie.data.data))},Rt1!=null&&{prompt_cache_breakpoint:Rt1})}}}}}})});return[3,64]}_state.label=5;case 5:Ie3={};_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=6;case 6:_state.trys.push([6,42,43,44]);_iterator1=nt[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,41];we=_step1.value;_10=we.type;switch(_10){case"text":return[3,8];case"tool-call":return[3,9];case"tool-result":return[3,25];case"reasoning":return[3,37];case"custom":return[3,39]}return[3,40];case 8:{Oe=(h=we.providerOptions)==null?void 0:h[n],Pe=Oe==null?void 0:Oe.itemId,tt=Oe==null?void 0:Oe.phase;if(s&&Pe!=null)return[3,40];if(a&&Pe!=null){Q.push({type:"item_reference",id:Pe});return[3,40]}Q.push(_object_spread({role:"assistant",content:[{type:"output_text",text:we.text}],id:Pe},tt!=null&&{phase:tt}));return[3,40]}_state.label=9;case 9:Oe1=(_=(x=(g=we.providerOptions)==null?void 0:g[n])==null?void 0:x.itemId)!=null?_:(y=(v=we.providerMetadata)==null?void 0:v[n])==null?void 0:y.itemId,Pe1=(E=(w=(b=we.providerOptions)==null?void 0:b[n])==null?void 0:w.namespace)!=null?E:(k=(S=we.providerMetadata)==null?void 0:S[n])==null?void 0:k.namespace,tt1=(T=(C=we.providerOptions)==null?void 0:C[n])==null?void 0:T.caller;if(s&&Oe1!=null)return[3,40];We=t.toProviderToolName(we.toolName);if(!(We==="tool_search"))return[3,14];if(a&&Oe1!=null){Q.push({type:"item_reference",id:Oe1});return[3,40]}if(!(typeof we.input=="string"))return[3,11];return[4,nz({text:we.input,schema:RG})];case 10:_tmp=_state.sent();return[3,13];case 11:return[4,ur({value:we.input,schema:RG})];case 12:_tmp=_state.sent();_state.label=13;case 13:Rt=_tmp,Ve=Rt.call_id!=null?"client":"server";Q.push({type:"tool_search_call",id:Oe1!=null?Oe1:we.toolCallId,execution:Ve,call_id:(I=Rt.call_id)!=null?I:null,status:"completed",arguments:Rt.arguments});return[3,40];case 14:if(!(We==="programmatic_tool_calling"))return[3,16];if(a&&Oe1!=null){Q.push({type:"item_reference",id:Oe1});return[3,40]}return[4,ur({value:we.input,schema:mEe})];case 15:Rt1=_state.sent();Q.push({type:"program",id:Oe1!=null?Oe1:we.toolCallId,call_id:we.toolCallId,code:Rt1.code,fingerprint:Rt1.fingerprint});return[3,40];case 16:if(we.providerExecuted){a&&Oe1!=null&&Q.push({type:"item_reference",id:Oe1});return[3,40]}if(l&&a&&Oe1!=null)return[3,40];Ut=c&&We==="local_shell"||d&&We==="shell"||u&&We==="apply_patch"||p&&We==="computer"||((O=m==null?void 0:m.has(We))!=null?O:!1);if(a&&Oe1!=null&&Ut){Q.push({type:"item_reference",id:Oe1});return[3,40]}if(!(c&&We==="local_shell"))return[3,18];return[4,ur({value:we.input,schema:dEe})];case 17:Rt2=_state.sent();Q.push({type:"local_shell_call",call_id:we.toolCallId,id:Oe1,action:{type:"exec",command:Rt2.action.command,timeout_ms:Rt2.action.timeoutMs,user:Rt2.action.user,working_directory:Rt2.action.workingDirectory,env:Rt2.action.env}});return[3,40];case 18:if(!(d&&We==="shell"))return[3,20];return[4,ur({value:we.input,schema:fEe})];case 19:Rt3=_state.sent();Q.push({type:"shell_call",call_id:we.toolCallId,id:Oe1,status:"completed",action:{commands:Rt3.action.commands,timeout_ms:Rt3.action.timeoutMs,max_output_length:Rt3.action.maxOutputLength}});return[3,40];case 20:if(!(u&&We==="apply_patch"))return[3,22];return[4,ur({value:we.input,schema:iEe})];case 21:Rt4=_state.sent();Q.push({type:"apply_patch_call",call_id:Rt4.callId,id:Oe1,status:"completed",operation:Rt4.operation});return[3,40];case 22:if(!(p&&We==="computer"))return[3,24];return[4,ur({value:we.input,schema:sEe})];case 23:Rt5=_state.sent();Q.push({type:"computer_call",call_id:we.toolCallId,id:Oe1,status:Rt5.status,actions:Rt5.actions.map(function(Ve){switch(Ve.type){case"click":case"double_click":case"move":return _object_spread_props(_object_spread({},Ve),{keys:Ve.keys});case"drag":return _object_spread_props(_object_spread({},Ve),{keys:Ve.keys});case"scroll":return{type:"scroll",x:Ve.x,y:Ve.y,scroll_x:Ve.scrollX,scroll_y:Ve.scrollY,keys:Ve.keys};default:return Ve}}),pending_safety_checks:Rt5.pendingSafetyChecks.map(function(Ve){return{id:Ve.id,code:Ve.code,message:Ve.message}})});return[3,40];case 24:if(m!=null&&m.has(We)){Q.push({type:"custom_tool_call",call_id:we.toolCallId,name:We,input:typeof we.input=="string"?we.input:JSON.stringify(we.input),id:Oe1});return[3,40]}Q.push(_object_spread({type:"function_call",call_id:we.toolCallId,name:We,arguments:t8t(we.input)},Pe1!=null&&{namespace:Pe1},tt1!=null&&{caller:jCe(tt1)}));return[3,40];case 25:if(we.output.type==="execution-denied"||we.output.type==="json"&&_type_of(we.output.value)=="object"&&we.output.value!=null&&"type"in we.output.value&&we.output.value.type==="execution-denied"||s)return[3,40];Oe2=t.toProviderToolName(we.toolName);if(!(Oe2==="tool_search"))return[3,29];Pe2=(L=(D=(R=(M=we.providerOptions)==null?void 0:M[n])==null?void 0:R.itemId)!=null?D:(z=($=we.providerMetadata)==null?void 0:$[n])==null?void 0:z.itemId)!=null?L:we.toolCallId;if(!a)return[3,26];Q.push({type:"item_reference",id:Pe2});return[3,28];case 26:if(!(we.output.type==="json"))return[3,28];return[4,ur({value:we.output.value,schema:MG})];case 27:tt2=_state.sent();Q.push({type:"tool_search_output",id:Pe2,execution:"server",call_id:null,status:"completed",tools:tt2.tools});_state.label=28;case 28:return[3,40];case 29:if(!(Oe2==="programmatic_tool_calling"))return[3,33];Pe3=(K=(G=(pe=(ee=we.providerOptions)==null?void 0:ee[n])==null?void 0:pe.itemId)!=null?G:(U=(N=we.providerMetadata)==null?void 0:N[n])==null?void 0:U.itemId)!=null?K:we.toolCallId;if(!a)return[3,30];Q.push({type:"item_reference",id:Pe3});return[3,32];case 30:if(!(we.output.type==="json"))return[3,32];return[4,ur({value:we.output.value,schema:hEe})];case 31:tt3=_state.sent();Q.push({type:"program_output",id:Pe3,call_id:we.toolCallId,result:tt3.result,status:tt3.status});_state.label=32;case 32:return[3,40];case 33:if(!(d&&Oe2==="shell"))return[3,36];if(!(we.output.type==="json"))return[3,35];return[4,ur({value:we.output.value,schema:PG})];case 34:Pe4=_state.sent();Q.push({type:"shell_call_output",call_id:we.toolCallId,output:Pe4.output.map(function(tt){return{stdout:tt.stdout,stderr:tt.stderr,outcome:tt.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:tt.outcome.exitCode}}})});_state.label=35;case 35:return[3,40];case 36:if(a){Pe5=(ie=(V=(me=we.providerOptions)==null?void 0:me[n])==null?void 0:V.itemId)!=null?ie:we.toolCallId;Q.push({type:"item_reference",id:Pe5})}else Fe.push({type:"other",message:"Results for OpenAI tool ".concat(we.toolName," are not sent to the API when store is false")});return[3,40];case 37:return[4,$t({provider:n,providerOptions:we.providerOptions,schema:n8t})];case 38:Oe3=_state.sent(),Pe6=Oe3==null?void 0:Oe3.itemId;if((s||l)&&Pe6!=null)return[3,40];if(Pe6!=null){tt4=Ie3[Pe6];if(a)tt4===void 0&&(Q.push({type:"item_reference",id:Pe6}),Ie3[Pe6]={type:"reasoning",id:Pe6,summary:[]});else{;We1=[];we.text.length>0?We1.push({type:"summary_text",text:we.text}):tt4!==void 0&&Fe.push({type:"other",message:"Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ".concat(JSON.stringify(we),".")}),tt4===void 0?(Ie3[Pe6]={type:"reasoning",id:Pe6,encrypted_content:Oe3==null?void 0:Oe3.reasoningEncryptedContent,summary:We1},Q.push(Ie3[Pe6])):((_tt_summary=tt4.summary).push.apply(_tt_summary,_to_consumable_array(We1)),(Oe3==null?void 0:Oe3.reasoningEncryptedContent)!=null&&(tt4.encrypted_content=Oe3.reasoningEncryptedContent))}}else{tt5=Oe3==null?void 0:Oe3.reasoningEncryptedContent;if(tt5!=null){We2=[];we.text.length>0&&We2.push({type:"summary_text",text:we.text}),Q.push({type:"reasoning",encrypted_content:tt5,summary:We2})}else Fe.push({type:"other",message:"Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ".concat(JSON.stringify(we),".")})}return[3,40];case 39:{if(we.kind==="openai.compaction"){Oe4=(re=we.providerOptions)==null?void 0:re[n],Pe7=Oe4==null?void 0:Oe4.itemId;if(s&&Pe7!=null)return[3,40];if(a&&Pe7!=null){Q.push({type:"item_reference",id:Pe7});return[3,40]}tt6=Oe4==null?void 0:Oe4.encryptedContent;Pe7!=null&&Q.push({type:"compaction",id:Pe7,encrypted_content:tt6})}return[3,40]}_state.label=40;case 40:_iteratorNormalCompletion1=true;return[3,7];case 41:return[3,44];case 42:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,44];case 43:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 44:return[3,64];case 45:_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=46;case 46:_state.trys.push([46,60,61,62]);_iterator2=nt[Symbol.iterator]();_state.label=47;case 47:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,59];Ie4=_step2.value;if(Ie4.type==="tool-approval-response"){We3=Ie4;if(it.has(We3.approvalId))return[3,58];it.add(We3.approvalId),a&&Q.push({type:"item_reference",id:We3.approvalId}),Q.push({type:"mcp_approval_response",approval_request_id:We3.approvalId,approve:We3.approved});return[3,58]}we1=Ie4.output;if(we1.type==="execution-denied"&&((xe=(de=we1.providerOptions)==null?void 0:de.openai)==null?void 0:xe.approvalId))return[3,58];Oe5=t.toProviderToolName(Ie4.toolName);if(!(Oe5==="tool_search"&&we1.type==="json"))return[3,49];return[4,ur({value:we1.value,schema:MG})];case 48:We4=_state.sent();Q.push({type:"tool_search_output",execution:"client",call_id:Ie4.toolCallId,status:"completed",tools:We4.tools});return[3,58];case 49:if(!(c&&Oe5==="local_shell"&&we1.type==="json"))return[3,51];return[4,ur({value:we1.value,schema:pEe})];case 50:We5=_state.sent();Q.push({type:"local_shell_call_output",call_id:Ie4.toolCallId,output:We5.output});return[3,58];case 51:if(!(d&&Oe5==="shell"&&we1.type==="json"))return[3,53];return[4,ur({value:we1.value,schema:PG})];case 52:We6=_state.sent();Q.push({type:"shell_call_output",call_id:Ie4.toolCallId,output:We6.output.map(function(Ut){return{stdout:Ut.stdout,stderr:Ut.stderr,outcome:Ut.outcome.type==="timeout"?{type:"timeout"}:{type:"exit",exit_code:Ut.outcome.exitCode}}})});return[3,58];case 53:if(!(u&&Ie4.toolName==="apply_patch"&&we1.type==="json"))return[3,55];return[4,ur({value:we1.value,schema:oEe})];case 54:We7=_state.sent();Q.push({type:"apply_patch_call_output",call_id:Ie4.toolCallId,status:We7.status,output:We7.output});return[3,58];case 55:if(!(p&&Oe5==="computer"&&we1.type==="json"))return[3,57];return[4,ur({value:we1.value,schema:lEe})];case 56:We8=_state.sent();Q.push({type:"computer_call_output",call_id:Ie4.toolCallId,output:{type:"computer_screenshot",image_url:We8.output.imageUrl,file_id:We8.output.fileId,detail:We8.output.detail},acknowledged_safety_checks:(Y=We8.acknowledgedSafetyChecks)==null?void 0:Y.map(function(Ut){return{id:Ut.id,code:Ut.code,message:Ut.message}})});return[3,58];case 57:if(m!=null&&m.has(Oe5)){We9=void 0;switch(we1.type){case"text":case"error-text":We9=we1.value;break;case"execution-denied":We9=(oe=we1.reason)!=null?oe:"Tool call execution denied.";break;case"json":case"error-json":We9=JSON.stringify(we1.value);break;case"content":We9=we1.value.map(function(Ut){var Rt,Ve,Tr;var yn=v_(Ut.providerOptions,n);switch(Ut.type){case"text":return _object_spread({type:"input_text",text:Ut.text},yn!=null&&{prompt_cache_breakpoint:yn});case"file":{var Di=ea(Ut.mediaType),Rn=(Ve=(Rt=Ut.providerOptions)==null?void 0:Rt[n])==null?void 0:Ve.imageDetail;if(Ut.data.type==="data"){var Uo=ai({part:Ut});return Di==="image"?_object_spread({type:"input_image",image_url:"data:".concat(Uo,";base64,").concat(Fr(Ut.data.data)),detail:Rn},yn!=null&&{prompt_cache_breakpoint:yn}):_object_spread({type:"input_file",filename:(Tr=Ut.filename)!=null?Tr:"data",file_data:"data:".concat(Uo,";base64,").concat(Fr(Ut.data.data))},yn!=null&&{prompt_cache_breakpoint:yn})}if(Ut.data.type==="url")return Di==="image"?_object_spread({type:"input_image",image_url:Ut.data.url.toString(),detail:Rn},yn!=null&&{prompt_cache_breakpoint:yn}):_object_spread({type:"input_file",file_url:Ut.data.url.toString()},yn!=null&&{prompt_cache_breakpoint:yn});Fe.push({type:"other",message:"unsupported custom tool content part type: ".concat(Ut.type," with data type: ").concat(Ut.data.type)});return}default:Fe.push({type:"other",message:"unsupported custom tool content part type: ".concat(Ut.type)});return}}).filter(p0);break;default:We9=""}Q.push({type:"custom_tool_call_output",call_id:Ie4.toolCallId,output:We9});return[3,58]}Pe8=void 0;switch(we1.type){case"text":case"error-text":Pe8=we1.value;break;case"execution-denied":Pe8=(H=we1.reason)!=null?H:"Tool call execution denied.";break;case"json":case"error-json":Pe8=JSON.stringify(we1.value);break;case"content":Pe8=we1.value.map(function(We){var Ut,Rt,Ve;var Tr=v_(We.providerOptions,n);switch(We.type){case"text":return _object_spread({type:"input_text",text:We.text},Tr!=null&&{prompt_cache_breakpoint:Tr});case"file":{var yn=ea(We.mediaType),Di=(Rt=(Ut=We.providerOptions)==null?void 0:Ut[n])==null?void 0:Rt.imageDetail;if(We.data.type==="data"){var Rn=ai({part:We});return yn==="image"?_object_spread({type:"input_image",image_url:"data:".concat(Rn,";base64,").concat(Fr(We.data.data)),detail:Di},Tr!=null&&{prompt_cache_breakpoint:Tr}):_object_spread({type:"input_file",filename:(Ve=We.filename)!=null?Ve:"data",file_data:"data:".concat(Rn,";base64,").concat(Fr(We.data.data))},Tr!=null&&{prompt_cache_breakpoint:Tr})}if(We.data.type==="url")return yn==="image"?_object_spread({type:"input_image",image_url:We.data.url.toString(),detail:Di},Tr!=null&&{prompt_cache_breakpoint:Tr}):_object_spread({type:"input_file",file_url:We.data.url.toString()},Tr!=null&&{prompt_cache_breakpoint:Tr});Fe.push({type:"other",message:"unsupported tool content part type: ".concat(We.type," with data type: ").concat(We.data.type)});return}default:{Fe.push({type:"other",message:"unsupported tool content part type: ".concat(We.type)});return}}}).filter(p0);break}tt7=jCe((j=(J=Ie4.providerOptions)==null?void 0:J[n])==null?void 0:j.caller);Q.push(_object_spread({type:"function_call_output",call_id:Ie4.toolCallId,output:Pe8},tt7!=null&&{caller:tt7}));_state.label=58;case 58:_iteratorNormalCompletion2=true;return[3,47];case 59:return[3,62];case 60:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,62];case 61:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 62:return[3,64];case 63:{Ie5=pt;throw new Error("Unsupported role: ".concat(Ie5))}_state.label=64;case 64:_iteratorNormalCompletion=true;return[3,2];case 65:return[3,68];case 66:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,68];case 67:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 68:return[2,(!a&&Q.some(function(pt){return"type"in pt&&pt.type==="reasoning"&&pt.encrypted_content==null})&&(Fe.push({type:"other",message:"Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."}),Q=Q.filter(function(pt){return!("type"in pt)||pt.type!=="reasoning"||pt.encrypted_content!=null})),{input:Q,warnings:Fe})]}})}).apply(this,arguments)}var n8t=f.object({itemId:f.string().nullish(),reasoningEncryptedContent:f.string().nullish()});function IG(param){var e=param.finishReason,t=param.hasFunctionCall;switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"other"}}var k5=f.lazy(function(){return f.union([f.string(),f.number(),f.boolean(),f.null(),f.array(k5),f.record(f.string(),k5.optional())])}),i8t=f.object({id:f.string(),code:f.string().nullish(),message:f.string().nullish()}),BCe=f.discriminatedUnion("type",[f.object({type:f.literal("click"),button:f.enum(["left","right","wheel","back","forward"]),x:f.number(),y:f.number(),keys:f.array(f.string()).nullish()}),f.object({type:f.literal("double_click"),x:f.number(),y:f.number(),keys:f.array(f.string()).nullish()}),f.object({type:f.literal("drag"),path:f.array(f.object({x:f.number(),y:f.number()})),keys:f.array(f.string()).nullish()}),f.object({type:f.literal("keypress"),keys:f.array(f.string())}),f.object({type:f.literal("move"),x:f.number(),y:f.number(),keys:f.array(f.string()).nullish()}),f.object({type:f.literal("screenshot")}),f.object({type:f.literal("scroll"),x:f.number(),y:f.number(),scroll_x:f.number(),scroll_y:f.number(),keys:f.array(f.string()).nullish()}),f.object({type:f.literal("type"),text:f.string()}),f.object({type:f.literal("wait")})]),NG=f.object({type:f.literal("computer_call"),id:f.string(),call_id:f.string().nullish(),status:f.enum(["in_progress","completed","incomplete"]),action:BCe.nullish(),actions:f.array(BCe).nullish(),pending_safety_checks:f.array(i8t).nullish()}),DG=f.discriminatedUnion("type",[f.object({type:f.literal("direct")}),f.object({type:f.literal("program"),caller_id:f.string()})]),LG=f.object({type:f.literal("program"),id:f.string(),call_id:f.string(),code:f.string(),fingerprint:f.string()}),FG=f.object({type:f.literal("program_output"),id:f.string(),call_id:f.string(),result:f.string(),status:f.enum(["completed","incomplete"])}),o8t=f.object({type:f.literal("error"),sequence_number:f.number(),error:f.object({type:f.string(),code:f.string(),message:f.string(),param:f.string().nullish()})}),a8t=f.object({type:f.literal("error"),sequence_number:f.number(),code:f.string().nullish(),message:f.string(),param:f.string().nullish()}),s8t=ne(function(){return te(f.union([f.object({type:f.literal("response.output_text.delta"),item_id:f.string(),delta:f.string(),logprobs:f.array(f.object({token:f.string(),logprob:f.number(),top_logprobs:f.array(f.object({token:f.string(),logprob:f.number()}))})).nullish()}),f.object({type:f.enum(["response.completed","response.incomplete"]),response:f.object({incomplete_details:f.object({reason:f.string()}).nullish(),usage:f.object({input_tokens:f.number(),input_tokens_details:f.object({cached_tokens:f.number().nullish(),cache_write_tokens:f.number().nullish(),orchestration_input_tokens:f.number().nullish(),orchestration_input_cached_tokens:f.number().nullish()}).nullish(),output_tokens:f.number(),output_tokens_details:f.object({reasoning_tokens:f.number().nullish(),orchestration_output_tokens:f.number().nullish()}).nullish()}),reasoning:f.object({context:f.string().nullish()}).nullish(),service_tier:f.string().nullish()})}),f.object({type:f.literal("response.failed"),sequence_number:f.number(),response:f.object({error:f.object({code:f.string().nullish(),message:f.string()}).nullish(),incomplete_details:f.object({reason:f.string()}).nullish(),usage:f.object({input_tokens:f.number(),input_tokens_details:f.object({cached_tokens:f.number().nullish(),cache_write_tokens:f.number().nullish(),orchestration_input_tokens:f.number().nullish(),orchestration_input_cached_tokens:f.number().nullish()}).nullish(),output_tokens:f.number(),output_tokens_details:f.object({reasoning_tokens:f.number().nullish(),orchestration_output_tokens:f.number().nullish()}).nullish()}).nullish(),reasoning:f.object({context:f.string().nullish()}).nullish(),service_tier:f.string().nullish()})}),f.object({type:f.literal("response.created"),response:f.object({id:f.string(),created_at:f.number(),model:f.string(),service_tier:f.string().nullish()})}),f.object({type:f.literal("response.output_item.added"),output_index:f.number(),item:f.discriminatedUnion("type",[f.object({type:f.literal("message"),id:f.string(),phase:f.enum(["commentary","final_answer"]).nullish()}),f.object({type:f.literal("reasoning"),id:f.string(),encrypted_content:f.string().nullish()}),f.object({type:f.literal("function_call"),id:f.string(),call_id:f.string(),name:f.string(),arguments:f.string(),namespace:f.string().nullish(),caller:DG.nullish()}),LG,FG,f.object({type:f.literal("web_search_call"),id:f.string(),status:f.string()}),NG,f.object({type:f.literal("file_search_call"),id:f.string()}),f.object({type:f.literal("image_generation_call"),id:f.string()}),f.object({type:f.literal("code_interpreter_call"),id:f.string(),container_id:f.string(),code:f.string().nullable(),outputs:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("logs"),logs:f.string()}),f.object({type:f.literal("image"),url:f.string()})])).nullable(),status:f.string()}),f.object({type:f.literal("mcp_call"),id:f.string(),status:f.string(),approval_request_id:f.string().nullish()}),f.object({type:f.literal("mcp_list_tools"),id:f.string()}),f.object({type:f.literal("mcp_approval_request"),id:f.string()}),f.object({type:f.literal("apply_patch_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed"]),operation:f.discriminatedUnion("type",[f.object({type:f.literal("create_file"),path:f.string(),diff:f.string()}),f.object({type:f.literal("delete_file"),path:f.string()}),f.object({type:f.literal("update_file"),path:f.string(),diff:f.string()})])}),f.object({type:f.literal("custom_tool_call"),id:f.string(),call_id:f.string(),name:f.string(),input:f.string()}),f.object({type:f.literal("shell_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),action:f.object({commands:f.array(f.string())})}),f.object({type:f.literal("compaction"),id:f.string(),encrypted_content:f.string().nullish()}),f.object({type:f.literal("shell_call_output"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),output:f.array(f.object({stdout:f.string(),stderr:f.string(),outcome:f.discriminatedUnion("type",[f.object({type:f.literal("timeout")}),f.object({type:f.literal("exit"),exit_code:f.number()})])}))}),f.object({type:f.literal("tool_search_call"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),arguments:f.unknown()}),f.object({type:f.literal("tool_search_output"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),tools:f.array(f.record(f.string(),k5.optional()))})])}),f.object({type:f.literal("response.output_item.done"),output_index:f.number(),item:f.discriminatedUnion("type",[f.object({type:f.literal("message"),id:f.string(),phase:f.enum(["commentary","final_answer"]).nullish()}),f.object({type:f.literal("reasoning"),id:f.string(),encrypted_content:f.string().nullish()}),f.object({type:f.literal("function_call"),id:f.string(),call_id:f.string(),name:f.string(),arguments:f.string(),status:f.enum(["in_progress","completed","incomplete"]),namespace:f.string().nullish(),caller:DG.nullish()}),LG,FG,f.object({type:f.literal("custom_tool_call"),id:f.string(),call_id:f.string(),name:f.string(),input:f.string(),status:f.literal("completed")}),f.object({type:f.literal("code_interpreter_call"),id:f.string(),code:f.string().nullable(),container_id:f.string(),outputs:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("logs"),logs:f.string()}),f.object({type:f.literal("image"),url:f.string()})])).nullable()}),f.object({type:f.literal("image_generation_call"),id:f.string(),result:f.string()}),f.object({type:f.literal("web_search_call"),id:f.string(),status:f.string(),action:f.discriminatedUnion("type",[f.object({type:f.literal("search"),query:f.string().nullish(),queries:f.array(f.string()).nullish(),sources:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("url"),url:f.string()}),f.object({type:f.literal("api"),name:f.string()})])).nullish()}),f.object({type:f.literal("open_page"),url:f.string().nullish()}),f.object({type:f.literal("find_in_page"),url:f.string().nullish(),pattern:f.string().nullish()})]).nullish()}),f.object({type:f.literal("file_search_call"),id:f.string(),queries:f.array(f.string()),results:f.array(f.object({attributes:f.record(f.string(),f.union([f.string(),f.number(),f.boolean()])),file_id:f.string(),filename:f.string(),score:f.number(),text:f.string()})).nullish()}),f.object({type:f.literal("local_shell_call"),id:f.string(),call_id:f.string(),action:f.object({type:f.literal("exec"),command:f.array(f.string()),timeout_ms:f.number().optional(),user:f.string().optional(),working_directory:f.string().optional(),env:f.record(f.string(),f.string()).optional()})}),NG,f.object({type:f.literal("mcp_call"),id:f.string(),status:f.string(),arguments:f.string(),name:f.string(),server_label:f.string(),output:f.string().nullish(),error:f.union([f.string(),f.object({type:f.string().optional(),code:f.union([f.number(),f.string()]).optional(),message:f.string().optional()}).loose()]).nullish(),approval_request_id:f.string().nullish()}),f.object({type:f.literal("mcp_list_tools"),id:f.string(),server_label:f.string(),tools:f.array(f.object({name:f.string(),description:f.string().optional(),input_schema:f.any(),annotations:f.record(f.string(),f.unknown()).optional()})),error:f.union([f.string(),f.object({type:f.string().optional(),code:f.union([f.number(),f.string()]).optional(),message:f.string().optional()}).loose()]).optional()}),f.object({type:f.literal("mcp_approval_request"),id:f.string(),server_label:f.string(),name:f.string(),arguments:f.string(),approval_request_id:f.string().optional()}),f.object({type:f.literal("apply_patch_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed"]),operation:f.discriminatedUnion("type",[f.object({type:f.literal("create_file"),path:f.string(),diff:f.string()}),f.object({type:f.literal("delete_file"),path:f.string()}),f.object({type:f.literal("update_file"),path:f.string(),diff:f.string()})])}),f.object({type:f.literal("shell_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),action:f.object({commands:f.array(f.string())})}),f.object({type:f.literal("compaction"),id:f.string(),encrypted_content:f.string()}),f.object({type:f.literal("shell_call_output"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),output:f.array(f.object({stdout:f.string(),stderr:f.string(),outcome:f.discriminatedUnion("type",[f.object({type:f.literal("timeout")}),f.object({type:f.literal("exit"),exit_code:f.number()})])}))}),f.object({type:f.literal("tool_search_call"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),arguments:f.unknown()}),f.object({type:f.literal("tool_search_output"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),tools:f.array(f.record(f.string(),k5.optional()))})])}),f.object({type:f.literal("response.function_call_arguments.delta"),item_id:f.string(),output_index:f.number(),delta:f.string()}),f.object({type:f.literal("response.custom_tool_call_input.delta"),item_id:f.string(),output_index:f.number(),delta:f.string()}),f.object({type:f.literal("response.image_generation_call.partial_image"),item_id:f.string(),output_index:f.number(),partial_image_b64:f.string()}),f.object({type:f.literal("response.code_interpreter_call_code.delta"),item_id:f.string(),output_index:f.number(),delta:f.string()}),f.object({type:f.literal("response.code_interpreter_call_code.done"),item_id:f.string(),output_index:f.number(),code:f.string()}),f.object({type:f.literal("response.output_text.annotation.added"),annotation:f.discriminatedUnion("type",[f.object({type:f.literal("url_citation"),start_index:f.number(),end_index:f.number(),url:f.string(),title:f.string()}),f.object({type:f.literal("file_citation"),file_id:f.string(),filename:f.string(),index:f.number()}),f.object({type:f.literal("container_file_citation"),container_id:f.string(),file_id:f.string(),filename:f.string(),start_index:f.number(),end_index:f.number()}),f.object({type:f.literal("file_path"),file_id:f.string(),index:f.number()})])}),f.object({type:f.literal("response.reasoning_summary_part.added"),item_id:f.string(),summary_index:f.number()}),f.object({type:f.literal("response.reasoning_summary_text.delta"),item_id:f.string(),summary_index:f.number(),delta:f.string()}),f.object({type:f.literal("response.reasoning_summary_part.done"),item_id:f.string(),summary_index:f.number()}),f.object({type:f.literal("response.apply_patch_call_operation_diff.delta"),item_id:f.string(),output_index:f.number(),delta:f.string(),obfuscation:f.string().nullish()}),f.object({type:f.literal("response.apply_patch_call_operation_diff.done"),item_id:f.string(),output_index:f.number(),diff:f.string()}),o8t,a8t,f.object({type:f.string()}).loose().transform(function(e){return{type:"unknown_chunk",message:e.type}})]))}),l8t=ne(function(){return te(f.object({id:f.string().optional(),created_at:f.number().optional(),error:f.object({message:f.string(),type:f.string(),param:f.string().nullish(),code:f.string()}).nullish(),model:f.string().optional(),output:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("message"),role:f.literal("assistant"),id:f.string(),phase:f.enum(["commentary","final_answer"]).nullish(),content:f.array(f.object({type:f.literal("output_text"),text:f.string(),logprobs:f.array(f.object({token:f.string(),logprob:f.number(),top_logprobs:f.array(f.object({token:f.string(),logprob:f.number()}))})).nullish(),annotations:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("url_citation"),start_index:f.number(),end_index:f.number(),url:f.string(),title:f.string()}),f.object({type:f.literal("file_citation"),file_id:f.string(),filename:f.string(),index:f.number()}),f.object({type:f.literal("container_file_citation"),container_id:f.string(),file_id:f.string(),filename:f.string(),start_index:f.number(),end_index:f.number()}),f.object({type:f.literal("file_path"),file_id:f.string(),index:f.number()})]))}))}),f.object({type:f.literal("web_search_call"),id:f.string(),status:f.string(),action:f.discriminatedUnion("type",[f.object({type:f.literal("search"),query:f.string().nullish(),queries:f.array(f.string()).nullish(),sources:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("url"),url:f.string()}),f.object({type:f.literal("api"),name:f.string()})])).nullish()}),f.object({type:f.literal("open_page"),url:f.string().nullish()}),f.object({type:f.literal("find_in_page"),url:f.string().nullish(),pattern:f.string().nullish()})]).nullish()}),f.object({type:f.literal("file_search_call"),id:f.string(),queries:f.array(f.string()),results:f.array(f.object({attributes:f.record(f.string(),f.union([f.string(),f.number(),f.boolean()])),file_id:f.string(),filename:f.string(),score:f.number(),text:f.string()})).nullish()}),f.object({type:f.literal("code_interpreter_call"),id:f.string(),code:f.string().nullable(),container_id:f.string(),outputs:f.array(f.discriminatedUnion("type",[f.object({type:f.literal("logs"),logs:f.string()}),f.object({type:f.literal("image"),url:f.string()})])).nullable()}),f.object({type:f.literal("image_generation_call"),id:f.string(),result:f.string()}),f.object({type:f.literal("local_shell_call"),id:f.string(),call_id:f.string(),action:f.object({type:f.literal("exec"),command:f.array(f.string()),timeout_ms:f.number().optional(),user:f.string().optional(),working_directory:f.string().optional(),env:f.record(f.string(),f.string()).optional()})}),f.object({type:f.literal("function_call"),call_id:f.string(),name:f.string(),arguments:f.string(),id:f.string(),namespace:f.string().nullish(),caller:DG.nullish()}),LG,FG,f.object({type:f.literal("custom_tool_call"),call_id:f.string(),name:f.string(),input:f.string(),id:f.string()}),NG,f.object({type:f.literal("reasoning"),id:f.string(),encrypted_content:f.string().nullish(),summary:f.array(f.object({type:f.literal("summary_text"),text:f.string()}))}),f.object({type:f.literal("mcp_call"),id:f.string(),status:f.string(),arguments:f.string(),name:f.string(),server_label:f.string(),output:f.string().nullish(),error:f.union([f.string(),f.object({type:f.string().optional(),code:f.union([f.number(),f.string()]).optional(),message:f.string().optional()}).loose()]).nullish(),approval_request_id:f.string().nullish()}),f.object({type:f.literal("mcp_list_tools"),id:f.string(),server_label:f.string(),tools:f.array(f.object({name:f.string(),description:f.string().optional(),input_schema:f.any(),annotations:f.record(f.string(),f.unknown()).optional()})),error:f.union([f.string(),f.object({type:f.string().optional(),code:f.union([f.number(),f.string()]).optional(),message:f.string().optional()}).loose()]).optional()}),f.object({type:f.literal("mcp_approval_request"),id:f.string(),server_label:f.string(),name:f.string(),arguments:f.string(),approval_request_id:f.string().optional()}),f.object({type:f.literal("apply_patch_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed"]),operation:f.discriminatedUnion("type",[f.object({type:f.literal("create_file"),path:f.string(),diff:f.string()}),f.object({type:f.literal("delete_file"),path:f.string()}),f.object({type:f.literal("update_file"),path:f.string(),diff:f.string()})])}),f.object({type:f.literal("shell_call"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),action:f.object({commands:f.array(f.string())})}),f.object({type:f.literal("compaction"),id:f.string(),encrypted_content:f.string()}),f.object({type:f.literal("shell_call_output"),id:f.string(),call_id:f.string(),status:f.enum(["in_progress","completed","incomplete"]),output:f.array(f.object({stdout:f.string(),stderr:f.string(),outcome:f.discriminatedUnion("type",[f.object({type:f.literal("timeout")}),f.object({type:f.literal("exit"),exit_code:f.number()})])}))}),f.object({type:f.literal("tool_search_call"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),arguments:f.unknown()}),f.object({type:f.literal("tool_search_output"),id:f.string(),execution:f.enum(["server","client"]),call_id:f.string().nullable(),status:f.enum(["in_progress","completed","incomplete"]),tools:f.array(f.record(f.string(),k5.optional()))})])).optional(),service_tier:f.string().nullish(),reasoning:f.object({context:f.string().nullish()}).nullish(),incomplete_details:f.object({reason:f.string()}).nullish(),usage:f.object({input_tokens:f.number(),input_tokens_details:f.object({cached_tokens:f.number().nullish(),cache_write_tokens:f.number().nullish(),orchestration_input_tokens:f.number().nullish(),orchestration_input_cached_tokens:f.number().nullish()}).nullish(),output_tokens:f.number(),output_tokens_details:f.object({reasoning_tokens:f.number().nullish(),orchestration_output_tokens:f.number().nullish()}).nullish()}).optional()}))}),gEe=20,u8t=["o1","o1-2024-12-17","o3","o3-2025-04-16","o3-mini","o3-mini-2025-01-31","o4-mini","o4-mini-2025-04-16","gpt-5","gpt-5-2025-08-07","gpt-5-codex","gpt-5-mini","gpt-5-mini-2025-08-07","gpt-5-nano","gpt-5-nano-2025-08-07","gpt-5-pro","gpt-5-pro-2025-10-06","gpt-5.1","gpt-5.1-chat-latest","gpt-5.1-codex-mini","gpt-5.1-codex","gpt-5.1-codex-max","gpt-5.2","gpt-5.2-chat-latest","gpt-5.2-pro","gpt-5.2-codex","gpt-5.3-chat-latest","gpt-5.3-codex","gpt-5.4","gpt-5.4-2026-03-05","gpt-5.4-mini","gpt-5.4-mini-2026-03-17","gpt-5.4-nano","gpt-5.4-nano-2026-03-17","gpt-5.4-pro","gpt-5.4-pro-2026-03-05","gpt-5.5","gpt-5.5-2026-04-23","gpt-5.6","gpt-5.6-luna","gpt-5.6-sol","gpt-5.6-terra"],Y7r=["gpt-4.1","gpt-4.1-2025-04-14","gpt-4.1-mini","gpt-4.1-mini-2025-04-14","gpt-4.1-nano","gpt-4.1-nano-2025-04-14","gpt-4o","gpt-4o-2024-05-13","gpt-4o-2024-08-06","gpt-4o-2024-11-20","gpt-4o-audio-preview","gpt-4o-audio-preview-2024-12-17","gpt-4o-search-preview","gpt-4o-search-preview-2025-03-11","gpt-4o-mini-search-preview","gpt-4o-mini-search-preview-2025-03-11","gpt-4o-mini","gpt-4o-mini-2024-07-18","gpt-3.5-turbo-0125","gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-5-chat-latest"].concat(_to_consumable_array(u8t)),qCe=ne(function(){return te(f.object({conversation:f.string().nullish(),include:f.array(f.enum(["reasoning.encrypted_content","file_search_call.results","web_search_call.results","message.output_text.logprobs"])).nullish(),instructions:f.string().nullish(),logprobs:f.union([f.boolean(),f.number().min(1).max(gEe)]).optional(),maxToolCalls:f.number().nullish(),metadata:f.any().nullish(),parallelToolCalls:f.boolean().nullish(),previousResponseId:f.string().nullish(),promptCacheKey:f.string().nullish(),promptCacheOptions:f.object({mode:f.enum(["implicit","explicit"]).optional(),ttl:f.literal("30m").optional()}).optional(),promptCacheRetention:f.enum(["in_memory","24h"]).nullish(),reasoningEffort:f.string().nullish(),reasoningMode:f.enum(["standard","pro"]).optional(),reasoningContext:f.enum(["auto","current_turn","all_turns"]).optional(),reasoningSummary:f.string().nullish(),safetyIdentifier:f.string().nullish(),serviceTier:f.enum(["auto","flex","priority","default"]).nullish(),store:f.boolean().nullish(),passThroughUnsupportedFiles:f.boolean().optional(),strictJsonSchema:f.boolean().nullish(),textVerbosity:f.enum(["low","medium","high"]).nullish(),truncation:f.enum(["auto","disabled"]).nullish(),user:f.string().nullish(),systemMessageMode:f.enum(["system","developer","remove"]).optional(),forceReasoning:f.boolean().optional(),contextManagement:f.array(f.object({type:f.literal("compaction"),compactThreshold:f.number()})).nullish(),allowedTools:f.object({toolNames:f.array(f.string()).min(1),mode:f.enum(["auto","required"]).optional()}).optional()}))});function c8t(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l,c,d,u,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,m,_,h,g,x,v,_10,h10,h11,h12,h13,h14,h15,h16,g10,x10,v10,h17,h18,err,p,m10,m11;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.tools,t=param.toolChoice,r=param.allowedTools,n=param.toolNameMapping,i=param.customProviderToolNames;e=e!=null&&e.length?e:void 0;l=[];if(e==null)return[2,{tools:void 0,toolChoice:void 0,toolWarnings:l}];c=[],d=new Map,u=i!=null?i:new Set;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,31,32,33]);_iterator=e[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,30];m=_step.value;_=m.type;switch(_){case"function":return[3,3];case"provider":return[3,4]}return[3,28];case 3:{h=(o=m.providerOptions)==null?void 0:o.openai,g=d8t({tool:m,options:h}),x=h==null?void 0:h.namespace;if(x==null)c.push(g);else{v=d.get(x.name);if(v==null)v={type:"namespace",name:x.name,description:x.description,tools:[]},d.set(x.name,v),c.push(v);else if(v.description!==x.description)throw new or({functionality:'conflicting descriptions for OpenAI tool namespace "'.concat(x.name,'"')});v.tools.push(g)}return[3,29]}_state.label=4;case 4:_10=m.id;switch(_10){case"openai.file_search":return[3,5];case"openai.local_shell":return[3,7];case"openai.shell":return[3,8];case"openai.apply_patch":return[3,10];case"openai.computer":return[3,11];case"openai.web_search_preview":return[3,12];case"openai.web_search":return[3,14];case"openai.code_interpreter":return[3,16];case"openai.image_generation":return[3,18];case"openai.mcp":return[3,20];case"openai.custom":return[3,22];case"openai.programmatic_tool_calling":return[3,24];case"openai.tool_search":return[3,25]}return[3,27];case 5:return[4,ur({value:m.args,schema:_7t})];case 6:h10=_state.sent();c.push({type:"file_search",vector_store_ids:h10.vectorStoreIds,max_num_results:h10.maxNumResults,ranking_options:h10.ranking?{ranker:h10.ranking.ranker,score_threshold:h10.ranking.scoreThreshold}:void 0,filters:h10.filters});return[3,27];case 7:{c.push({type:"local_shell"});return[3,27]}_state.label=8;case 8:return[4,ur({value:m.args,schema:P7t})];case 9:h11=_state.sent();c.push(_object_spread({type:"shell"},h11.environment&&{environment:p8t(h11.environment)}));return[3,27];case 10:{c.push({type:"apply_patch"});return[3,27]}_state.label=11;case 11:{c.push({type:"computer"});return[3,27]}_state.label=12;case 12:return[4,ur({value:m.args,schema:j7t})];case 13:h12=_state.sent();c.push({type:"web_search_preview",search_context_size:h12.searchContextSize,user_location:h12.userLocation});return[3,27];case 14:return[4,ur({value:m.args,schema:N7t})];case 15:h13=_state.sent();c.push({type:"web_search",filters:h13.filters!=null?{allowed_domains:h13.filters.allowedDomains}:void 0,external_web_access:h13.externalWebAccess,search_context_size:h13.searchContextSize,user_location:h13.userLocation});return[3,27];case 16:return[4,ur({value:m.args,schema:c7t})];case 17:h14=_state.sent();c.push({type:"code_interpreter",container:h14.container==null?{type:"auto",file_ids:void 0}:typeof h14.container=="string"?h14.container:{type:"auto",file_ids:h14.container.fileIds}});return[3,27];case 18:return[4,ur({value:m.args,schema:S7t})];case 19:h15=_state.sent();c.push({type:"image_generation",background:h15.background,input_fidelity:h15.inputFidelity,input_image_mask:h15.inputImageMask?{file_id:h15.inputImageMask.fileId,image_url:h15.inputImageMask.imageUrl}:void 0,model:h15.model,moderation:h15.moderation,partial_images:h15.partialImages,quality:h15.quality,output_compression:h15.outputCompression,output_format:h15.outputFormat,size:h15.size});return[3,27];case 20:return[4,ur({value:m.args,schema:W7t})];case 21:h16=_state.sent(),g10=function(y){return{tool_names:y.toolNames}},x10=h16.requireApproval,v10=x10==null?void 0:typeof x10=="string"?x10:x10.never!=null?{never:g10(x10.never)}:void 0;c.push({type:"mcp",server_label:h16.serverLabel,allowed_tools:Array.isArray(h16.allowedTools)?h16.allowedTools:h16.allowedTools?{read_only:h16.allowedTools.readOnly,tool_names:h16.allowedTools.toolNames}:void 0,authorization:h16.authorization,connector_id:h16.connectorId,headers:h16.headers,require_approval:v10!=null?v10:"never",server_description:h16.serverDescription,server_url:h16.serverUrl});return[3,27];case 22:return[4,ur({value:m.args,schema:g7t})];case 23:h17=_state.sent();c.push({type:"custom",name:m.name,description:h17.description,format:h17.format}),u.add(m.name);return[3,27];case 24:{c.push({type:"programmatic_tool_calling"});return[3,27]}_state.label=25;case 25:return[4,ur({value:m.args,schema:M7t})];case 26:h18=_state.sent();c.push(_object_spread({type:"tool_search"},h18.execution!=null?{execution:h18.execution}:{},h18.description!=null?{description:h18.description}:{},h18.parameters!=null?{parameters:h18.parameters}:{}));return[3,27];case 27:return[3,29];case 28:l.push({type:"unsupported",feature:"function tool ".concat(m)});return[3,29];case 29:_iteratorNormalCompletion=true;return[3,2];case 30:return[3,33];case 31:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,33];case 32:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 33:if(r!=null)return[2,{tools:c,toolChoice:{type:"allowed_tools",mode:(a=r.mode)!=null?a:"auto",tools:r.toolNames.map(function(m){var h;return{type:"function",name:(h=n==null?void 0:n.toProviderToolName(m))!=null?h:m}})},toolWarnings:l}];if(t==null)return[2,{tools:c,toolChoice:void 0,toolWarnings:l}];p=t.type;switch(p){case"auto":case"none":case"required":return[2,{tools:c,toolChoice:p,toolWarnings:l}];case"tool":{m10=(s=n==null?void 0:n.toProviderToolName(t.toolName))!=null?s:t.toolName;return[2,{tools:c,toolChoice:m10==="code_interpreter"||m10==="file_search"||m10==="image_generation"||m10==="web_search_preview"||m10==="web_search"||m10==="mcp"||m10==="apply_patch"||m10==="computer"||m10==="programmatic_tool_calling"?{type:m10}:u.has(m10)?{type:"custom",name:m10}:{type:"function",name:m10},toolWarnings:l}]}default:{m11=p;throw new or({functionality:"tool choice type: ".concat(m11)})}}return[2]}})}).apply(this,arguments)}function d8t(param){var e=param.tool,t=param.options;var r=t==null?void 0:t.deferLoading;return _object_spread({type:"function",name:e.name,description:e.description,parameters:e.inputSchema},e.strict!=null?{strict:e.strict}:{},r!=null?{defer_loading:r}:{},(t==null?void 0:t.allowedCallers)!=null?{allowed_callers:t.allowedCallers}:{},(t==null?void 0:t.outputSchema)!=null?{output_schema:t.outputSchema}:{})}function p8t(e){if(e.type==="containerReference")return{type:"container_reference",container_id:e.containerId};if(e.type==="containerAuto"){var r=e;return{type:"container_auto",file_ids:r.fileIds,memory_limit:r.memoryLimit,network_policy:r.networkPolicy==null?void 0:r.networkPolicy.type==="disabled"?{type:"disabled"}:{type:"allowlist",allowed_domains:r.networkPolicy.allowedDomains,domain_secrets:r.networkPolicy.domainSecrets},skills:f8t(r.skills)}}return{type:"local",skills:e.skills}}function f8t(e){return e==null?void 0:e.map(function(t){var r,n;return t.type==="skillReference"?{type:"skill_reference",skill_id:ns({reference:(r=t.providerReference)!=null?r:{},provider:"openai"}),version:(n=t.version)!=null?n:"latest"}:{type:"inline",name:t.name,description:t.description,source:{type:"base64",media_type:t.source.mediaType,data:t.source.data}}})}function WCe(e){var t,r;var n={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var i=_step.value;if(i.role==="assistant")try{for(var _iterator1=i.content[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var o=_step1.value;if(o.type!=="tool-call")continue;var a=(r=(t=o.providerOptions)==null?void 0:t.openai)==null?void 0:r.approvalRequestId;a!=null&&(n[a]=o.toolCallId)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return n}function m8t(e){switch(e.type){case"click":return _object_spread({type:"click",button:e.button,x:e.x,y:e.y},e.keys!=null&&{keys:e.keys});case"double_click":return _object_spread({type:"double_click",x:e.x,y:e.y},e.keys!=null&&{keys:e.keys});case"drag":return _object_spread({type:"drag",path:e.path},e.keys!=null&&{keys:e.keys});case"keypress":return e;case"move":return _object_spread({type:"move",x:e.x,y:e.y},e.keys!=null&&{keys:e.keys});case"screenshot":return e;case"scroll":return _object_spread({type:"scroll",x:e.x,y:e.y,scrollX:e.scroll_x,scrollY:e.scroll_y},e.keys!=null&&{keys:e.keys});case"type":return e;case"wait":return e}}function VCe(param){var e=param.action,t=param.actions,r=param.pending_safety_checks,n=param.status;var i;return{actions:(t!=null?t:e!=null?[e]:[]).map(m8t),pendingSafetyChecks:(i=r==null?void 0:r.map(function(o){return _object_spread({id:o.id},o.code!=null&&{code:o.code},o.message!=null&&{message:o.message})}))!=null?i:[],status:n}}var h8t=/*#__PURE__*/function(){"use strict";function xEe(t,r){_class_call_check(this,xEe);this.specificationVersion="v4",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=t,this.config=r}_create_class(xEe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,u,p,m,h,_I1,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,_tmp,$,z,D,L,ee,_ref,pe,N,U,_ref1,G,K,me,V,de,xe,Y,oe,H,J;function ie(j){V==null?V=[j]:V.includes(j)||(V=_to_consumable_array(V).concat([j]))}function re(j){return(p==null?void 0:p.find(function(Q){return Q.type==="provider"&&Q.id===j}))!=null}return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.maxOutputTokens,r=param.temperature,n=param.stopSequences,i=param.topP,o=param.topK,a=param.presencePenalty,s=param.frequencyPenalty,l=param.seed,c=param.prompt,d=param.reasoning,u=param.providerOptions,p=param.tools,m=param.toolChoice,h=param.responseFormat;I=[],O=XCe(this.modelId);o!=null&&I.push({type:"unsupported",feature:"topK"}),l!=null&&I.push({type:"unsupported",feature:"seed"}),a!=null&&I.push({type:"unsupported",feature:"presencePenalty"}),s!=null&&I.push({type:"unsupported",feature:"frequencyPenalty"}),n!=null&&I.push({type:"unsupported",feature:"stopSequences"});M=this.config.provider.includes("azure")?"azure":"openai";return[4,$t({provider:M,providerOptions:u,schema:qCe})];case 1:R=_state.sent();_tmp=R==null&&M!=="openai";if(!_tmp)return[3,3];return[4,$t({provider:"openai",providerOptions:u,schema:qCe})];case 2:_tmp=R=_state.sent();_state.label=3;case 3:_tmp;$=(g=R==null?void 0:R.reasoningEffort)!=null?g:Oc(d)?d:void 0,z=(R==null?void 0:R.reasoningSummary)!==void 0?R.reasoningSummary:$!=null&&$!=="none"?"detailed":void 0,D=(x=R==null?void 0:R.forceReasoning)!=null?x:O.isReasoningModel;R!=null&&R.conversation&&R!=null&&R.previousResponseId&&I.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});L=oT({tools:p,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.computer":"computer","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch","openai.tool_search":"tool_search","openai.programmatic_tool_calling":"programmatic_tool_calling"}}),ee=new Set;return[4,c8t({tools:p,toolChoice:m,allowedTools:(v=R==null?void 0:R.allowedTools)!=null?v:void 0,toolNameMapping:L,customProviderToolNames:ee})];case 4:_ref=_state.sent(),pe=_ref.tools,N=_ref.toolChoice,U=_ref.toolWarnings;return[4,r8t({prompt:c,toolNameMapping:L,systemMessageMode:(y=R==null?void 0:R.systemMessageMode)!=null?y:D?"developer":O.systemMessageMode,providerOptionsName:M,fileIdPrefixes:this.config.fileIdPrefixes,passThroughUnsupportedFiles:(_=R==null?void 0:R.passThroughUnsupportedFiles)!=null?_:!1,store:(b=R==null?void 0:R.store)!=null?b:!0,hasConversation:(R==null?void 0:R.conversation)!=null,hasPreviousResponseId:(R==null?void 0:R.previousResponseId)!=null,hasLocalShellTool:re("openai.local_shell"),hasShellTool:re("openai.shell"),hasApplyPatchTool:re("openai.apply_patch"),hasComputerTool:re("openai.computer"),customProviderToolNames:ee.size>0?ee:void 0})];case 5:_ref1=_state.sent(),G=_ref1.input,K=_ref1.warnings;(_I1=I).push.apply(_I1,_to_consumable_array(K));me=(w=R==null?void 0:R.strictJsonSchema)!=null?w:!0,V=R==null?void 0:R.include;de=typeof(R==null?void 0:R.logprobs)=="number"?R==null?void 0:R.logprobs:(R==null?void 0:R.logprobs)===!0?gEe:void 0;de&&ie("message.output_text.logprobs");xe=(S=p==null?void 0:p.find(function(j){return j.type==="provider"&&(j.id==="openai.web_search"||j.id==="openai.web_search_preview")}))==null?void 0:S.name;xe&&ie("web_search_call.action.sources"),re("openai.code_interpreter")&&ie("code_interpreter_call.outputs");Y=R==null?void 0:R.store;Y===!1&&D&&ie("reasoning.encrypted_content");oe=_object_spread(_object_spread_props(_object_spread({model:this.modelId,input:G,temperature:r,top_p:i,max_output_tokens:t},((h==null?void 0:h.type)==="json"||(R==null?void 0:R.textVerbosity))&&{text:_object_spread({},(h==null?void 0:h.type)==="json"&&{format:h.schema!=null?{type:"json_schema",strict:me,name:(k=h.name)!=null?k:"response",description:h.description,schema:h.schema}:{type:"json_object"}},(R==null?void 0:R.textVerbosity)&&{verbosity:R.textVerbosity})}),{conversation:R==null?void 0:R.conversation,max_tool_calls:R==null?void 0:R.maxToolCalls,metadata:R==null?void 0:R.metadata,parallel_tool_calls:R==null?void 0:R.parallelToolCalls,previous_response_id:R==null?void 0:R.previousResponseId,store:Y,user:R==null?void 0:R.user,instructions:R==null?void 0:R.instructions,service_tier:R==null?void 0:R.serviceTier,include:V,prompt_cache_key:R==null?void 0:R.promptCacheKey,prompt_cache_options:R==null?void 0:R.promptCacheOptions,prompt_cache_retention:R==null?void 0:R.promptCacheRetention,safety_identifier:R==null?void 0:R.safetyIdentifier,top_logprobs:de,truncation:R==null?void 0:R.truncation}),(R==null?void 0:R.contextManagement)&&{context_management:R.contextManagement.map(function(j){return{type:j.type,compact_threshold:j.compactThreshold}})},D&&($!=null||z!=null||(R==null?void 0:R.reasoningMode)!=null||(R==null?void 0:R.reasoningContext)!=null)&&{reasoning:_object_spread({},$!=null&&{effort:$},z!=null&&{summary:z},(R==null?void 0:R.reasoningMode)!=null&&{mode:R.reasoningMode},(R==null?void 0:R.reasoningContext)!=null&&{context:R.reasoningContext})});D?$==="none"&&O.supportsNonReasoningParameters||(oe.temperature!=null&&(oe.temperature=void 0,I.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),oe.top_p!=null&&(oe.top_p=void 0,I.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):((R==null?void 0:R.reasoningEffort)!=null&&I.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),(R==null?void 0:R.reasoningSummary)!=null&&I.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"}),(R==null?void 0:R.reasoningMode)!=null&&I.push({type:"unsupported",feature:"reasoningMode",details:"reasoningMode is not supported for non-reasoning models"}),(R==null?void 0:R.reasoningContext)!=null&&I.push({type:"unsupported",feature:"reasoningContext",details:"reasoningContext is not supported for non-reasoning models"})),(R==null?void 0:R.serviceTier)==="flex"&&!O.supportsFlexProcessing&&(I.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete oe.service_tier),(R==null?void 0:R.serviceTier)==="priority"&&!O.supportsPriorityProcessing&&(I.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete oe.service_tier);H=(T=(C=(E=p==null?void 0:p.find(function(j){return j.type==="provider"&&j.id==="openai.shell"}))==null?void 0:E.args)==null?void 0:C.environment)==null?void 0:T.type,J=H==="containerAuto"||H==="containerReference";return[2,{webSearchToolName:xe,args:_object_spread_props(_object_spread({},oe),{tools:pe,tool_choice:N}),warnings:_to_consumable_array(I).concat(_to_consumable_array(U)),store:Y,toolNameMapping:L,providerOptionsName:M,isShellProviderExecuted:J}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R,$,z,D,_ref,L,ee,pe,N,U,G,K,me,_ref1,V,ie,re,j,de,xe,Y,oe,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,j1,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,Q,Q5,Fe,Q10,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,Q11,Fe1,_iteratorNormalCompletion3,_didIteratorError3,_iteratorError3,_iterator3,_step3,it,Q12,Q13,Fe2,Q14,Fe3,it1,Q15,H,J;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),L=_ref.args,ee=_ref.warnings,pe=_ref.webSearchToolName,N=_ref.toolNameMapping,U=_ref.providerOptionsName,G=_ref.isShellProviderExecuted,K=this.config.url({path:"/responses",modelId:this.modelId}),me=WCe(t.prompt);return[4,zt({url:K,headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:L,failedResponseHandler:pu,successfulResponseHandler:wt(l8t),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),V=_ref1.responseHeaders,ie=_ref1.value,re=_ref1.rawValue;if(ie.error)throw new Rr({message:ie.error.message,url:K,requestBodyValues:L,statusCode:400,responseHeaders:V,responseBody:re,isRetryable:!1});if(ie.output==null){j=(i=ie.incomplete_details)==null?void 0:i.reason;throw new Rr({message:j?"Responses API returned no output (".concat(j,")"):"Responses API returned no output",url:K,requestBodyValues:L,statusCode:500,responseHeaders:V,responseBody:re,isRetryable:!1})}de=[],xe=[],Y=!1,oe=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=ie.output[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){j1=_step.value;switch(j1.type){case"reasoning":{j1.summary.length===0&&j1.summary.push({type:"summary_text",text:""});_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=j1.summary[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){Q=_step1.value;de.push({type:"reasoning",text:Q.text,providerMetadata:_define_property({},U,{itemId:j1.id,reasoningEncryptedContent:(o=j1.encrypted_content)!=null?o:null})})}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}break}case"image_generation_call":{de.push({type:"tool-call",toolCallId:j1.id,toolName:N.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),de.push({type:"tool-result",toolCallId:j1.id,toolName:N.toCustomToolName("image_generation"),result:{result:j1.result}});break}case"tool_search_call":{Q5=(a=j1.call_id)!=null?a:j1.id,Fe=j1.execution==="server";Fe&&oe.push(Q5),de.push(_object_spread_props(_object_spread({type:"tool-call",toolCallId:Q5,toolName:N.toCustomToolName("tool_search"),input:JSON.stringify({arguments:j1.arguments,call_id:j1.call_id})},Fe?{providerExecuted:!0}:{}),{providerMetadata:_define_property({},U,{itemId:j1.id})}));break}case"tool_search_output":{Q10=(l=(s=j1.call_id)!=null?s:oe.shift())!=null?l:j1.id;de.push({type:"tool-result",toolCallId:Q10,toolName:N.toCustomToolName("tool_search"),result:{tools:j1.tools},providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"local_shell_call":{de.push({type:"tool-call",toolCallId:j1.call_id,toolName:N.toCustomToolName("local_shell"),input:JSON.stringify({action:j1.action}),providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"shell_call":{de.push(_object_spread_props(_object_spread({type:"tool-call",toolCallId:j1.call_id,toolName:N.toCustomToolName("shell"),input:JSON.stringify({action:{commands:j1.action.commands}})},G&&{providerExecuted:!0}),{providerMetadata:_define_property({},U,{itemId:j1.id})}));break}case"shell_call_output":{de.push({type:"tool-result",toolCallId:j1.call_id,toolName:N.toCustomToolName("shell"),result:{output:j1.output.map(function(Q){return{stdout:Q.stdout,stderr:Q.stderr,outcome:Q.outcome.type==="exit"?{type:"exit",exitCode:Q.outcome.exit_code}:{type:"timeout"}}})}});break}case"message":{_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(_iterator2=j1.content[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){Q11=_step2.value;(d=(c=t.providerOptions)==null?void 0:c[U])!=null&&d.logprobs&&Q11.logprobs&&xe.push(Q11.logprobs);Fe1=_object_spread({itemId:j1.id},j1.phase!=null&&{phase:j1.phase},Q11.annotations.length>0&&{annotations:Q11.annotations});de.push({type:"text",text:Q11.text,providerMetadata:_define_property({},U,Fe1)});_iteratorNormalCompletion3=true,_didIteratorError3=false,_iteratorError3=undefined;try{for(_iterator3=Q11.annotations[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){it=_step3.value;it.type==="url_citation"?de.push({type:"source",sourceType:"url",id:(m=(p=(u=this.config).generateId)==null?void 0:p.call(u))!=null?m:Qr(),url:it.url,title:it.title}):it.type==="file_citation"?de.push({type:"source",sourceType:"document",id:(x=(g=(h=this.config).generateId)==null?void 0:g.call(h))!=null?x:Qr(),mediaType:"text/plain",title:it.filename,filename:it.filename,providerMetadata:_define_property({},U,{type:it.type,fileId:it.file_id,index:it.index})}):it.type==="container_file_citation"?de.push({type:"source",sourceType:"document",id:(_=(y=(v=this.config).generateId)==null?void 0:y.call(v))!=null?_:Qr(),mediaType:"text/plain",title:it.filename,filename:it.filename,providerMetadata:_define_property({},U,{type:it.type,fileId:it.file_id,containerId:it.container_id})}):it.type==="file_path"&&de.push({type:"source",sourceType:"document",id:(S=(w=(b=this.config).generateId)==null?void 0:w.call(b))!=null?S:Qr(),mediaType:"application/octet-stream",title:it.file_id,filename:it.file_id,providerMetadata:_define_property({},U,{type:it.type,fileId:it.file_id,index:it.index})})}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return!=null){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}break}case"function_call":{Y=!0,de.push({type:"tool-call",toolCallId:j1.call_id,toolName:j1.name,input:j1.arguments,providerMetadata:_define_property({},U,_object_spread({itemId:j1.id},j1.namespace!=null&&{namespace:j1.namespace},j1.caller!=null&&{caller:j1.caller.type==="program"?{type:"program",callerId:j1.caller.caller_id}:j1.caller}))});break}case"program":{de.push({type:"tool-call",toolCallId:j1.call_id,toolName:N.toCustomToolName("programmatic_tool_calling"),input:JSON.stringify({code:j1.code,fingerprint:j1.fingerprint}),providerExecuted:!0,providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"program_output":{de.push({type:"tool-result",toolCallId:j1.call_id,toolName:N.toCustomToolName("programmatic_tool_calling"),result:{result:j1.result,status:j1.status},providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"custom_tool_call":{Y=!0;Q12=N.toCustomToolName(j1.name);de.push({type:"tool-call",toolCallId:j1.call_id,toolName:Q12,input:JSON.stringify(j1.input),providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"web_search_call":{de.push({type:"tool-call",toolCallId:j1.id,toolName:N.toCustomToolName(pe!=null?pe:"web_search"),input:JSON.stringify({}),providerExecuted:!0}),de.push({type:"tool-result",toolCallId:j1.id,toolName:N.toCustomToolName(pe!=null?pe:"web_search"),result:KCe(j1.action)});break}case"mcp_call":{Q13=j1.approval_request_id!=null&&(k=me[j1.approval_request_id])!=null?k:j1.id,Fe2="mcp.".concat(j1.name);de.push({type:"tool-call",toolCallId:Q13,toolName:Fe2,input:j1.arguments,providerExecuted:!0,dynamic:!0}),de.push({type:"tool-result",toolCallId:Q13,toolName:Fe2,result:_object_spread({type:"call",serverLabel:j1.server_label,name:j1.name,arguments:j1.arguments},j1.output!=null?{output:j1.output}:{},j1.error!=null?{error:j1.error}:{}),providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"mcp_list_tools":break;case"mcp_approval_request":{Q14=(E=j1.approval_request_id)!=null?E:j1.id,Fe3=(I=(T=(C=this.config).generateId)==null?void 0:T.call(C))!=null?I:Qr(),it1="mcp.".concat(j1.name);de.push({type:"tool-call",toolCallId:Fe3,toolName:it1,input:j1.arguments,providerExecuted:!0,dynamic:!0}),de.push({type:"tool-approval-request",approvalId:Q14,toolCallId:Fe3});break}case"computer_call":{if(j1.call_id==null){de.push({type:"tool-call",toolCallId:j1.id,toolName:N.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),de.push({type:"tool-result",toolCallId:j1.id,toolName:N.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:j1.status}});break}Y=!0;Q15=N.toCustomToolName("computer");de.push({type:"tool-call",toolCallId:j1.call_id,toolName:Q15,input:JSON.stringify(VCe(j1)),providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"file_search_call":{de.push({type:"tool-call",toolCallId:j1.id,toolName:N.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),de.push({type:"tool-result",toolCallId:j1.id,toolName:N.toCustomToolName("file_search"),result:{queries:j1.queries,results:(M=(O=j1.results)==null?void 0:O.map(function(Q){return{attributes:Q.attributes,fileId:Q.file_id,filename:Q.filename,score:Q.score,text:Q.text}}))!=null?M:null}});break}case"code_interpreter_call":{de.push({type:"tool-call",toolCallId:j1.id,toolName:N.toCustomToolName("code_interpreter"),input:JSON.stringify({code:j1.code,containerId:j1.container_id}),providerExecuted:!0}),de.push({type:"tool-result",toolCallId:j1.id,toolName:N.toCustomToolName("code_interpreter"),result:{outputs:j1.outputs}});break}case"apply_patch_call":{de.push({type:"tool-call",toolCallId:j1.call_id,toolName:N.toCustomToolName("apply_patch"),input:JSON.stringify({callId:j1.call_id,operation:j1.operation}),providerMetadata:_define_property({},U,{itemId:j1.id})});break}case"compaction":{de.push({type:"custom",kind:"openai.compaction",providerMetadata:_define_property({},U,{type:"compaction",itemId:j1.id,encryptedContent:j1.encrypted_content})});break}}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}H=_define_property({},U,_object_spread({responseId:ie.id},xe.length>0?{logprobs:xe}:{},typeof ie.service_tier=="string"?{serviceTier:ie.service_tier}:{},((R=ie.reasoning)==null?void 0:R.context)!=null?{reasoningContext:ie.reasoning.context}:{})),J=ie.usage;return[2,{content:de,finishReason:{unified:IG({finishReason:($=ie.incomplete_details)==null?void 0:$.reason,hasFunctionCall:Y}),raw:(D=(z=ie.incomplete_details)==null?void 0:z.reason)!=null?D:void 0},usage:zCe(J),request:{body:L},response:{id:ie.id,timestamp:new Date(ie.created_at*1e3),modelId:ie.model,headers:V,body:re},providerMetadata:H,warnings:ee}]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,_ref,i,o,a,s,l,c,d,u,_ref1,p,m,h,g,x,v,y,_,b,w,S,k,E,C,T,I,O,M,R;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.getArgs(t)];case 1:_ref=_state.sent(),i=_ref.args,o=_ref.warnings,a=_ref.webSearchToolName,s=_ref.toolNameMapping,l=_ref.store,c=_ref.providerOptionsName,d=_ref.isShellProviderExecuted,u=this.config.url({path:"/responses",modelId:this.modelId});return[4,zt({url:u,headers:ht((n=(r=this.config).headers)==null?void 0:n.call(r),t.headers),body:_object_spread_props(_object_spread({},i),{stream:!0}),failedResponseHandler:pu,successfulResponseHandler:Oo(s8t),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),p=_ref1.responseHeaders,m=_ref1.value;return[4,jG({stream:m,getError:function(z){return ZCe(z)||GCe(z)&&z.response.error!=null?z:void 0},isOutputChunk:R8t,url:u,requestBodyValues:i,responseHeaders:p})];case 3:h=_state.sent(),g=this,x=WCe(t.prompt),v=new Map,y={unified:"other",raw:void 0},b=[],w=null,S={},k=[],C=!1,T={},M=[],R=!1;return[2,{stream:h.pipeThrough(new TransformStream({start:function start(z){z.enqueue({type:"stream-start",warnings:o})},transform:function transform(z,D){var L,ee,pe,N,U,G,K,me,V,ie,re,de,xe,Y,oe,H,J,j,Q,Fe,it,pt,nt,gt,Ie,we,Oe,Pe,tt,We,Ut,Rt,Ve,Tr,yn,Di,Rn,Uo,Ea,Nn,Ar;if(t.includeRawChunks&&D.enqueue({type:"raw",rawValue:z.rawValue}),!z.success){var Ee=x8t(z.rawValue)?y8t({value:z.rawValue,cause:z.error,url:u,requestBodyValues:i,responseHeaders:p}):z.error;y={unified:"error",raw:void 0},D.enqueue({type:"error",error:Ee});return}var q=z.value;if(HCe(q)){if(q.item.type==="function_call")S[q.output_index]={toolName:q.item.name,toolCallId:q.item.call_id},D.enqueue({type:"tool-input-start",id:q.item.call_id,toolName:q.item.name});else if(q.item.type==="custom_tool_call"){var Ee1=s.toCustomToolName(q.item.name);S[q.output_index]={toolName:Ee1,toolCallId:q.item.call_id},D.enqueue({type:"tool-input-start",id:q.item.call_id,toolName:Ee1})}else if(q.item.type==="web_search_call")S[q.output_index]={toolName:s.toCustomToolName(a!=null?a:"web_search"),toolCallId:q.item.id},D.enqueue({type:"tool-input-start",id:q.item.id,toolName:s.toCustomToolName(a!=null?a:"web_search"),providerExecuted:!0}),D.enqueue({type:"tool-input-end",id:q.item.id}),D.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:s.toCustomToolName(a!=null?a:"web_search"),input:JSON.stringify({}),providerExecuted:!0});else if(q.item.type==="computer_call"){var Ee2=(L=q.item.call_id)!=null?L:q.item.id;S[q.output_index]={toolName:s.toCustomToolName("computer"),toolCallId:Ee2},D.enqueue({type:"tool-input-start",id:Ee2,toolName:s.toCustomToolName("computer")})}else if(q.item.type==="code_interpreter_call")S[q.output_index]={toolName:s.toCustomToolName("code_interpreter"),toolCallId:q.item.id,codeInterpreter:{containerId:q.item.container_id}},D.enqueue({type:"tool-input-start",id:q.item.id,toolName:s.toCustomToolName("code_interpreter"),providerExecuted:!0}),D.enqueue({type:"tool-input-delta",id:q.item.id,delta:'{"containerId":"'.concat(q.item.container_id,'","code":"')});else if(q.item.type==="file_search_call")D.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:s.toCustomToolName("file_search"),input:"{}",providerExecuted:!0});else if(q.item.type==="image_generation_call")D.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:s.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0});else if(q.item.type==="tool_search_call"){var Ee3=q.item.id,Mt=s.toCustomToolName("tool_search"),xr=q.item.execution==="server";S[q.output_index]={toolName:Mt,toolCallId:Ee3,toolSearchExecution:(ee=q.item.execution)!=null?ee:"server"},xr&&D.enqueue({type:"tool-input-start",id:Ee3,toolName:Mt,providerExecuted:!0})}else if(q.item.type!=="tool_search_output"){if(!(q.item.type==="mcp_call"||q.item.type==="mcp_list_tools"||q.item.type==="mcp_approval_request"))if(q.item.type==="apply_patch_call"){var _q_item=q.item,Ee4=_q_item.call_id,Mt1=_q_item.operation;if(S[q.output_index]={toolName:s.toCustomToolName("apply_patch"),toolCallId:Ee4,applyPatch:{hasDiff:Mt1.type==="delete_file",endEmitted:Mt1.type==="delete_file"}},D.enqueue({type:"tool-input-start",id:Ee4,toolName:s.toCustomToolName("apply_patch")}),Mt1.type==="delete_file"){var xr1=JSON.stringify({callId:Ee4,operation:Mt1});D.enqueue({type:"tool-input-delta",id:Ee4,delta:xr1}),D.enqueue({type:"tool-input-end",id:Ee4})}else D.enqueue({type:"tool-input-delta",id:Ee4,delta:'{"callId":"'.concat(g1(Ee4),'","operation":{"type":"').concat(g1(Mt1.type),'","path":"').concat(g1(Mt1.path),'","diff":"')})}else q.item.type==="shell_call"?S[q.output_index]={toolName:s.toCustomToolName("shell"),toolCallId:q.item.call_id}:q.item.type==="shell_call_output"||(q.item.type==="message"?(k.splice(0,k.length),E=(pe=q.item.phase)!=null?pe:void 0,D.enqueue({type:"text-start",id:q.item.id,providerMetadata:_define_property({},c,_object_spread({itemId:q.item.id},q.item.phase!=null&&{phase:q.item.phase}))})):HCe(q)&&q.item.type==="reasoning"&&(T[q.item.id]={encryptedContent:q.item.encrypted_content,summaryParts:{0:"active"}},D.enqueue({type:"reasoning-start",id:"".concat(q.item.id,":0"),providerMetadata:_define_property({},c,{itemId:q.item.id,reasoningEncryptedContent:(N=q.item.encrypted_content)!=null?N:null})})))}}else if(_8t(q))if(q.item.type==="message"){var Ee5=(U=q.item.phase)!=null?U:E;E=void 0,D.enqueue({type:"text-end",id:q.item.id,providerMetadata:_define_property({},c,_object_spread({itemId:q.item.id},Ee5!=null&&{phase:Ee5},k.length>0&&{annotations:k}))})}else if(q.item.type==="function_call")S[q.output_index]=void 0,C=!0,D.enqueue(_object_spread({type:"tool-input-end",id:q.item.call_id},q.item.namespace!=null&&{providerMetadata:_define_property({},c,{namespace:q.item.namespace})})),D.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:q.item.name,input:q.item.arguments,providerMetadata:_define_property({},c,_object_spread({itemId:q.item.id},q.item.namespace!=null&&{namespace:q.item.namespace},q.item.caller!=null&&{caller:q.item.caller.type==="program"?{type:"program",callerId:q.item.caller.caller_id}:q.item.caller}))});else if(q.item.type==="program")D.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:s.toCustomToolName("programmatic_tool_calling"),input:JSON.stringify({code:q.item.code,fingerprint:q.item.fingerprint}),providerExecuted:!0,providerMetadata:_define_property({},c,{itemId:q.item.id})});else if(q.item.type==="program_output")D.enqueue({type:"tool-result",toolCallId:q.item.call_id,toolName:s.toCustomToolName("programmatic_tool_calling"),result:{result:q.item.result,status:q.item.status},providerMetadata:_define_property({},c,{itemId:q.item.id})});else if(q.item.type==="custom_tool_call"){S[q.output_index]=void 0,C=!0;var Ee6=s.toCustomToolName(q.item.name);D.enqueue({type:"tool-input-end",id:q.item.call_id}),D.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:Ee6,input:JSON.stringify(q.item.input),providerMetadata:_define_property({},c,{itemId:q.item.id})})}else if(q.item.type==="web_search_call")S[q.output_index]=void 0,D.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:s.toCustomToolName(a!=null?a:"web_search"),result:KCe(q.item.action)});else if(q.item.type==="computer_call"){if(S[q.output_index]=void 0,q.item.call_id==null){D.enqueue({type:"tool-input-end",id:q.item.id}),D.enqueue({type:"tool-call",toolCallId:q.item.id,toolName:s.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),D.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:s.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:q.item.status}});return}C=!0;var Ee7=s.toCustomToolName("computer"),Mt2=JSON.stringify(VCe(q.item));D.enqueue({type:"tool-input-delta",id:q.item.call_id,delta:Mt2}),D.enqueue({type:"tool-input-end",id:q.item.call_id}),D.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:Ee7,input:Mt2,providerMetadata:_define_property({},c,{itemId:q.item.id})})}else if(q.item.type==="file_search_call")S[q.output_index]=void 0,D.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:s.toCustomToolName("file_search"),result:{queries:q.item.queries,results:(K=(G=q.item.results)==null?void 0:G.map(function(Ee){return{attributes:Ee.attributes,fileId:Ee.file_id,filename:Ee.filename,score:Ee.score,text:Ee.text}}))!=null?K:null}});else if(q.item.type==="code_interpreter_call")S[q.output_index]=void 0,D.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:s.toCustomToolName("code_interpreter"),result:{outputs:q.item.outputs}});else if(q.item.type==="image_generation_call")D.enqueue({type:"tool-result",toolCallId:q.item.id,toolName:s.toCustomToolName("image_generation"),result:{result:q.item.result}});else if(q.item.type==="tool_search_call"){var Ee8=S[q.output_index],Mt3=q.item.execution==="server";if(Ee8!=null){var xr2=Mt3?Ee8.toolCallId:(me=q.item.call_id)!=null?me:q.item.id;Mt3?M.push(xr2):D.enqueue({type:"tool-input-start",id:xr2,toolName:Ee8.toolName}),D.enqueue({type:"tool-input-end",id:xr2}),D.enqueue(_object_spread_props(_object_spread({type:"tool-call",toolCallId:xr2,toolName:Ee8.toolName,input:JSON.stringify({arguments:q.item.arguments,call_id:Mt3?null:xr2})},Mt3?{providerExecuted:!0}:{}),{providerMetadata:_define_property({},c,{itemId:q.item.id})}))}S[q.output_index]=void 0}else if(q.item.type==="tool_search_output"){var Ee9=(ie=(V=q.item.call_id)!=null?V:M.shift())!=null?ie:q.item.id;D.enqueue({type:"tool-result",toolCallId:Ee9,toolName:s.toCustomToolName("tool_search"),result:{tools:q.item.tools},providerMetadata:_define_property({},c,{itemId:q.item.id})})}else if(q.item.type==="mcp_call"){S[q.output_index]=void 0;var Ee10=(re=q.item.approval_request_id)!=null?re:void 0,Mt4=Ee10!=null&&(xe=(de=v.get(Ee10))!=null?de:x[Ee10])!=null?xe:q.item.id,xr3="mcp.".concat(q.item.name);D.enqueue({type:"tool-call",toolCallId:Mt4,toolName:xr3,input:q.item.arguments,providerExecuted:!0,dynamic:!0}),D.enqueue({type:"tool-result",toolCallId:Mt4,toolName:xr3,result:_object_spread({type:"call",serverLabel:q.item.server_label,name:q.item.name,arguments:q.item.arguments},q.item.output!=null?{output:q.item.output}:{},q.item.error!=null?{error:q.item.error}:{}),providerMetadata:_define_property({},c,{itemId:q.item.id})})}else if(q.item.type==="mcp_list_tools")S[q.output_index]=void 0;else if(q.item.type==="apply_patch_call"){var Ee11=S[q.output_index];Ee11!=null&&Ee11.applyPatch&&!Ee11.applyPatch.endEmitted&&q.item.operation.type!=="delete_file"&&(Ee11.applyPatch.hasDiff||D.enqueue({type:"tool-input-delta",id:Ee11.toolCallId,delta:g1(q.item.operation.diff)}),D.enqueue({type:"tool-input-delta",id:Ee11.toolCallId,delta:'"}}'}),D.enqueue({type:"tool-input-end",id:Ee11.toolCallId}),Ee11.applyPatch.endEmitted=!0),Ee11&&q.item.status==="completed"&&D.enqueue({type:"tool-call",toolCallId:Ee11.toolCallId,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:q.item.call_id,operation:q.item.operation}),providerMetadata:_define_property({},c,{itemId:q.item.id})}),S[q.output_index]=void 0}else if(q.item.type==="mcp_approval_request"){S[q.output_index]=void 0;var Ee12=(H=(oe=(Y=g.config).generateId)==null?void 0:oe.call(Y))!=null?H:Qr(),Mt5=(J=q.item.approval_request_id)!=null?J:q.item.id;v.set(Mt5,Ee12);var xr4="mcp.".concat(q.item.name);D.enqueue({type:"tool-call",toolCallId:Ee12,toolName:xr4,input:q.item.arguments,providerExecuted:!0,dynamic:!0}),D.enqueue({type:"tool-approval-request",approvalId:Mt5,toolCallId:Ee12})}else if(q.item.type==="local_shell_call")S[q.output_index]=void 0,D.enqueue({type:"tool-call",toolCallId:q.item.call_id,toolName:s.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:q.item.action.command,timeoutMs:q.item.action.timeout_ms,user:q.item.action.user,workingDirectory:q.item.action.working_directory,env:q.item.action.env}}),providerMetadata:_define_property({},c,{itemId:q.item.id})});else if(q.item.type==="shell_call")S[q.output_index]=void 0,D.enqueue(_object_spread_props(_object_spread({type:"tool-call",toolCallId:q.item.call_id,toolName:s.toCustomToolName("shell"),input:JSON.stringify({action:{commands:q.item.action.commands}})},d&&{providerExecuted:!0}),{providerMetadata:_define_property({},c,{itemId:q.item.id})}));else if(q.item.type==="shell_call_output")D.enqueue({type:"tool-result",toolCallId:q.item.call_id,toolName:s.toCustomToolName("shell"),result:{output:q.item.output.map(function(Ee){return{stdout:Ee.stdout,stderr:Ee.stderr,outcome:Ee.outcome.type==="exit"?{type:"exit",exitCode:Ee.outcome.exit_code}:{type:"timeout"}}})}});else if(q.item.type==="reasoning"){var Ee13=T[q.item.id],Mt6=Object.entries(Ee13.summaryParts).filter(function(param){var _param=_sliced_to_array(param,2),xr=_param[0],Yr=_param[1];return Yr==="active"||Yr==="can-conclude"}).map(function(param){var _param=_sliced_to_array(param,1),xr=_param[0];return xr});var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Mt6[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var xr5=_step.value;D.enqueue({type:"reasoning-end",id:"".concat(q.item.id,":").concat(xr5),providerMetadata:_define_property({},c,{itemId:q.item.id,reasoningEncryptedContent:(j=q.item.encrypted_content)!=null?j:null})})}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}delete T[q.item.id]}else q.item.type==="compaction"&&D.enqueue({type:"custom",kind:"openai.compaction",providerMetadata:_define_property({},c,{type:"compaction",itemId:q.item.id,encryptedContent:q.item.encrypted_content})});else if(S8t(q)){var Ee14=S[q.output_index];Ee14!=null&&D.enqueue({type:"tool-input-delta",id:Ee14.toolCallId,delta:q.delta})}else if(k8t(q)){var Ee15=S[q.output_index];Ee15!=null&&D.enqueue({type:"tool-input-delta",id:Ee15.toolCallId,delta:q.delta})}else if(A8t(q)){var Ee16=S[q.output_index];Ee16!=null&&Ee16.applyPatch&&(D.enqueue({type:"tool-input-delta",id:Ee16.toolCallId,delta:g1(q.delta)}),Ee16.applyPatch.hasDiff=!0)}else if(I8t(q)){var Ee17=S[q.output_index];Ee17!=null&&Ee17.applyPatch&&!Ee17.applyPatch.endEmitted&&(Ee17.applyPatch.hasDiff||(D.enqueue({type:"tool-input-delta",id:Ee17.toolCallId,delta:g1(q.diff)}),Ee17.applyPatch.hasDiff=!0),D.enqueue({type:"tool-input-delta",id:Ee17.toolCallId,delta:'"}}'}),D.enqueue({type:"tool-input-end",id:Ee17.toolCallId}),Ee17.applyPatch.endEmitted=!0)}else if(C8t(q))D.enqueue({type:"tool-result",toolCallId:q.item_id,toolName:s.toCustomToolName("image_generation"),result:{result:q.partial_image_b64},preliminary:!0});else if(E8t(q)){var Ee18=S[q.output_index];Ee18!=null&&D.enqueue({type:"tool-input-delta",id:Ee18.toolCallId,delta:g1(q.delta)})}else if(T8t(q)){var Ee19=S[q.output_index];Ee19!=null&&(D.enqueue({type:"tool-input-delta",id:Ee19.toolCallId,delta:'"}'}),D.enqueue({type:"tool-input-end",id:Ee19.toolCallId}),D.enqueue({type:"tool-call",toolCallId:Ee19.toolCallId,toolName:s.toCustomToolName("code_interpreter"),input:JSON.stringify({code:q.code,containerId:Ee19.codeInterpreter.containerId}),providerExecuted:!0}))}else if(w8t(q))w=q.response.id,D.enqueue({type:"response-metadata",id:q.response.id,timestamp:new Date(q.response.created_at*1e3),modelId:q.response.model});else if(g8t(q))D.enqueue({type:"text-delta",id:q.item_id,delta:q.delta}),(Fe=(Q=t.providerOptions)==null?void 0:Q[c])!=null&&Fe.logprobs&&q.logprobs&&b.push(q.logprobs);else if(q.type==="response.reasoning_summary_part.added"){if(q.summary_index>0){var Ee20=T[q.item_id];Ee20.summaryParts[q.summary_index]="active";var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.keys(Ee20.summaryParts)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var Mt7=_step1.value;Ee20.summaryParts[Mt7]==="can-conclude"&&(D.enqueue({type:"reasoning-end",id:"".concat(q.item_id,":").concat(Mt7),providerMetadata:_define_property({},c,{itemId:q.item_id})}),Ee20.summaryParts[Mt7]="concluded")}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}D.enqueue({type:"reasoning-start",id:"".concat(q.item_id,":").concat(q.summary_index),providerMetadata:_define_property({},c,{itemId:q.item_id,reasoningEncryptedContent:(pt=(it=T[q.item_id])==null?void 0:it.encryptedContent)!=null?pt:null})})}}else if(q.type==="response.reasoning_summary_text.delta")D.enqueue({type:"reasoning-delta",id:"".concat(q.item_id,":").concat(q.summary_index),delta:q.delta,providerMetadata:_define_property({},c,{itemId:q.item_id})});else if(q.type==="response.reasoning_summary_part.done")l?(D.enqueue({type:"reasoning-end",id:"".concat(q.item_id,":").concat(q.summary_index),providerMetadata:_define_property({},c,{itemId:q.item_id})}),T[q.item_id].summaryParts[q.summary_index]="concluded"):T[q.item_id].summaryParts[q.summary_index]="can-conclude";else if(b8t(q))y={unified:IG({finishReason:(nt=q.response.incomplete_details)==null?void 0:nt.reason,hasFunctionCall:C}),raw:(Ie=(gt=q.response.incomplete_details)==null?void 0:gt.reason)!=null?Ie:void 0},_=q.response.usage,typeof q.response.service_tier=="string"&&(I=q.response.service_tier),((we=q.response.reasoning)==null?void 0:we.context)!=null&&(O=q.response.reasoning.context);else if(GCe(q)){var Ee21=(Oe=q.response.incomplete_details)==null?void 0:Oe.reason;y={unified:Ee21?IG({finishReason:Ee21,hasFunctionCall:C}):"error",raw:Ee21!=null?Ee21:"error"},_=(Pe=q.response.usage)!=null?Pe:void 0,((tt=q.response.reasoning)==null?void 0:tt.context)!=null&&(O=q.response.reasoning.context),!R&&q.response.error!=null&&(R=!0,D.enqueue({type:"error",error:{type:"response.failed",sequence_number:q.sequence_number,response:{error:q.response.error,incomplete_details:q.response.incomplete_details,service_tier:q.response.service_tier}}}))}else P8t(q)?(k.push(q.annotation),q.annotation.type==="url_citation"?D.enqueue({type:"source",sourceType:"url",id:(Rt=(Ut=(We=g.config).generateId)==null?void 0:Ut.call(We))!=null?Rt:Qr(),url:q.annotation.url,title:q.annotation.title}):q.annotation.type==="file_citation"?D.enqueue({type:"source",sourceType:"document",id:(yn=(Tr=(Ve=g.config).generateId)==null?void 0:Tr.call(Ve))!=null?yn:Qr(),mediaType:"text/plain",title:q.annotation.filename,filename:q.annotation.filename,providerMetadata:_define_property({},c,{type:q.annotation.type,fileId:q.annotation.file_id,index:q.annotation.index})}):q.annotation.type==="container_file_citation"?D.enqueue({type:"source",sourceType:"document",id:(Uo=(Rn=(Di=g.config).generateId)==null?void 0:Rn.call(Di))!=null?Uo:Qr(),mediaType:"text/plain",title:q.annotation.filename,filename:q.annotation.filename,providerMetadata:_define_property({},c,{type:q.annotation.type,fileId:q.annotation.file_id,containerId:q.annotation.container_id})}):q.annotation.type==="file_path"&&D.enqueue({type:"source",sourceType:"document",id:(Ar=(Nn=(Ea=g.config).generateId)==null?void 0:Nn.call(Ea))!=null?Ar:Qr(),mediaType:"application/octet-stream",title:q.annotation.file_id,filename:q.annotation.file_id,providerMetadata:_define_property({},c,{type:q.annotation.type,fileId:q.annotation.file_id,index:q.annotation.index})})):ZCe(q)&&(R=!0,y={unified:"error",raw:"error"},D.enqueue({type:"error",error:q}))},flush:function flush(z){var D=_define_property({},c,_object_spread({responseId:w},b.length>0?{logprobs:b}:{},I!==void 0?{serviceTier:I}:{},O!==void 0?{reasoningContext:O}:{}));z.enqueue({type:"finish",finishReason:y,usage:zCe(_),providerMetadata:D})}})),request:{body:i},response:{headers:p}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new xEe(t.modelId,t.config)}}]);return xEe}();function g8t(e){return e.type==="response.output_text.delta"}function x8t(e){var t=v8t(e);return t!=null&&Array.isArray(t.choices)&&typeof t.type!="string"}function y8t(param){var e=param.value,t=param.cause,r=param.url,n=param.requestBodyValues,i=param.responseHeaders;return new Rr({message:"Received a Chat Completions stream while using the OpenAI Responses API. The default OpenAI provider model uses the Responses API. If your custom baseURL targets a Chat Completions-compatible endpoint, use openai.chat('model-id') or createOpenAI(...).chat('model-id') instead. You can also use @ai-sdk/openai-compatible for OpenAI-compatible providers.",url:r,requestBodyValues:n,responseHeaders:i,responseBody:JSON.stringify(e),cause:t,data:e,isRetryable:!1})}function v8t(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e!=null?e:void 0}function _8t(e){return e.type==="response.output_item.done"}function b8t(e){return e.type==="response.completed"||e.type==="response.incomplete"}function GCe(e){return e.type==="response.failed"}function w8t(e){return e.type==="response.created"}function S8t(e){return e.type==="response.function_call_arguments.delta"}function k8t(e){return e.type==="response.custom_tool_call_input.delta"}function C8t(e){return e.type==="response.image_generation_call.partial_image"}function E8t(e){return e.type==="response.code_interpreter_call_code.delta"}function T8t(e){return e.type==="response.code_interpreter_call_code.done"}function A8t(e){return e.type==="response.apply_patch_call_operation_diff.delta"}function I8t(e){return e.type==="response.apply_patch_call_operation_diff.done"}function HCe(e){return e.type==="response.output_item.added"}function P8t(e){return e.type==="response.output_text.annotation.added"}function ZCe(e){return e.type==="error"}function R8t(e){return!(e.type==="response.created"||e.type==="response.failed"||e.type==="error"||e.type==="unknown_chunk")}function KCe(e){var t;if(e==null)return{};switch(e.type){case"search":return _object_spread({action:_object_spread({type:"search",query:(t=e.query)!=null?t:void 0},e.queries!=null&&{queries:e.queries})},e.sources!=null&&{sources:e.sources});case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}function g1(e){return JSON.stringify(e).slice(1,-1)}var M8t=ne(function(){return te(f.object({instructions:f.string().nullish(),speed:f.number().min(.25).max(4).default(1).nullish()}))}),O8t=/*#__PURE__*/function(){"use strict";function yEe(t,r){_class_call_check(this,yEe);this.modelId=t,this.config=r,this.specificationVersion="v4"}_create_class(yEe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,tmp,r,tmp1,n,i,o,a,s,l,c,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.text,tmp=param.voice,r=tmp===void 0?"alloy":tmp,tmp1=param.outputFormat,n=tmp1===void 0?"mp3":tmp1,i=param.speed,o=param.instructions,a=param.language,s=param.providerOptions;l=[];return[4,$t({provider:"openai",providerOptions:s,schema:M8t})];case 1:c=_state.sent(),d={model:this.modelId,input:t,voice:r,response_format:"mp3",speed:i,instructions:o};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?d.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:"Unsupported output format: ".concat(n,". Using mp3 instead.")})),c){u={};for(var p in u){m=u[p];m!==void 0&&(d[p]=m)}}return[2,(a&&l.push({type:"unsupported",feature:"language",details:'OpenAI speech models do not support language selection. Language parameter "'.concat(a,'" was ignored.')}),{requestBody:d,warnings:l})]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,_ref,l,c,_ref1,d,u,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:s=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,this.getArgs(t)];case 1:_ref=_state.sent(),l=_ref.requestBody,c=_ref.warnings;return[4,zt({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:ht((a=(o=this.config).headers)==null?void 0:a.call(o),t.headers),body:l,failedResponseHandler:pu,successfulResponseHandler:eue(),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),d=_ref1.value,u=_ref1.responseHeaders,p=_ref1.rawValue;return[2,{audio:d,warnings:c,request:{body:JSON.stringify(l)},response:{timestamp:s,modelId:this.modelId,headers:u,body:p}}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new yEe(t.modelId,t.config)}}]);return yEe}(),$8t=ne(function(){return te(f.object({text:f.string(),language:f.string().nullish(),duration:f.number().nullish(),words:f.array(f.object({word:f.string(),start:f.number(),end:f.number()})).nullish(),segments:f.array(f.object({id:f.number(),seek:f.number(),start:f.number(),end:f.number(),text:f.string(),tokens:f.array(f.number()),temperature:f.number(),avg_logprob:f.number(),compression_ratio:f.number(),no_speech_prob:f.number()})).nullish()}))}),QCe=ne(function(){return te(f.object({include:f.array(f.string()).optional(),language:f.string().optional(),prompt:f.string().optional(),temperature:f.number().min(0).max(1).default(0).optional(),timestampGranularities:f.array(f.enum(["word","segment"])).default(["segment"]).optional(),streaming:f.object({delay:f.enum(["minimal","low","medium","high","xhigh"]).optional(),include:f.array(f.string()).optional()}).optional()}))});function JCe(e){return e==="gpt-realtime-whisper"||e.startsWith("gpt-realtime-whisper-")}var YCe={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},N8t=/*#__PURE__*/function(){"use strict";function vEe(t,r){_class_call_check(this,vEe);this.modelId=t,this.config=r,this.specificationVersion="v4"}_create_class(vEe,[{key:"provider",get:function get1(){return this.config.provider}},{key:"getArgs",value:function getArgs(_01){return _async_to_generator(function(param){var t,r,n,i,o,a,s,l,c,d,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator,_step,_step_value,u,p,_iterator1,_step1,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.audio,r=param.mediaType,n=param.providerOptions;i=[];return[4,$t({provider:"openai",providerOptions:n,schema:QCe})];case 1:o=_state.sent(),a=new FormData,s=_instanceof(t,Uint8Array)?new Blob([t]):new Blob([Ui(t)]);a.append("model",this.modelId);l=Vle(r);if(a.append("file",new File([s],"audio",{type:r}),"audio.".concat(l)),this.modelId==="whisper-1"&&a.append("response_format","verbose_json"),o){c=["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId),d=_object_spread_props(_object_spread({include:o.include,language:o.language,prompt:o.prompt},this.modelId!=="whisper-1"&&{response_format:c?"json":"verbose_json"}),{temperature:o.temperature,timestamp_granularities:o.timestampGranularities});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator=Object.entries(d)[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){_step_value=_sliced_to_array(_step.value,2),u=_step_value[0],p=_step_value[1];if(p!=null)if(Array.isArray(p))try{for(_iterator1=p[Symbol.iterator]();!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){m=_step1.value;a.append("".concat(u,"[]"),String(m))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}else a.append(u,String(p))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}return[2,{formData:a,warnings:i}]}})}).apply(this,arguments)}},{key:"doGenerate",value:function doGenerate(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,_ref,m,h,_ref1,g,x,v,y;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(JCe(this.modelId))throw new or({functionality:"non-streaming transcription with ".concat(this.modelId)});p=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,this.getArgs(t)];case 1:_ref=_state.sent(),m=_ref.formData,h=_ref.warnings;return[4,ul({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:ht((a=(o=this.config).headers)==null?void 0:a.call(o),t.headers),formData:m,failedResponseHandler:pu,successfulResponseHandler:wt($8t),abortSignal:t.abortSignal,fetch:this.config.fetch})];case 2:_ref1=_state.sent(),g=_ref1.value,x=_ref1.responseHeaders,v=_ref1.rawValue,y=g.language!=null&&g.language in YCe?YCe[g.language]:void 0;return[2,{text:g.text,segments:(d=(c=(s=g.segments)==null?void 0:s.map(function(_){return{text:_.text,startSecond:_.start,endSecond:_.end}}))!=null?c:(l=g.words)==null?void 0:l.map(function(_){return{text:_.word,startSecond:_.start,endSecond:_.end}}))!=null?d:[],language:y,durationInSeconds:(u=g.duration)!=null?u:void 0,warnings:h,response:{timestamp:p,modelId:this.modelId,headers:x,body:v}}]}})}).call(this)}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d,u,p,_i1,_iter,g,m,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!JCe(this.modelId))throw new or({functionality:"streaming transcription with ".concat(this.modelId)});c=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,$t({provider:"openai",providerOptions:t.providerOptions,schema:QCe})];case 1:d=_state.sent(),u=[],p=(a=(o=t.providerOptions)==null?void 0:o.openai)!=null?a:{};for(_i1=0,_iter=["include","prompt","temperature","timestampGranularities"];_i1<_iter.length;_i1++){g=_iter[_i1];p[g]!=null&&u.push({type:"unsupported",feature:"providerOptions.openai.".concat(g),details:"OpenAI streaming transcription does not support ".concat(g,".")})}m=ht((l=(s=this.config).headers)==null?void 0:l.call(s),t.headers),h=L8t({modelId:this.modelId,inputAudioFormat:t.inputAudioFormat,providerOptions:d});return[2,{request:{body:h},response:{timestamp:c,modelId:this.modelId},stream:D8t({webSocket:this.config.webSocket,url:nT(this.config.url({path:"/realtime?intent=transcription",modelId:this.modelId})),headers:m,sessionUpdate:h,language:d==null?void 0:d.language,warnings:u,audio:t.audio,abortSignal:t.abortSignal,includeRawChunks:t.includeRawChunks})}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new vEe(t.modelId,t.config)}}]);return vEe}();function D8t(param){var e=param.webSocket,t=param.url,r=param.headers,n=param.sessionUpdate,i=param.language,o=param.warnings,a=param.audio,s=param.abortSignal,l=param.includeRawChunks;var c=!1,d=function(){};return new ReadableStream({start:function(u){var p=F8t(r),m,h;d=function(y){m!=null?m.cancel().catch(function(){}):a.cancel().catch(function(){}),h==null||h.close(y)};var g=function(y){c||(c=!0,d(),u.error(y))},x=function(y,_){c||(c=!0,_!=null&&u.enqueue({type:"transcript-final",id:_,text:y}),u.enqueue({type:"finish",text:y,segments:[],language:i}),u.close(),d(1e3))},v=function(y){return _async_to_generator(function(){var _ref,_,b;return _ts_generator(this,function(_state){switch(_state.label){case 0:m=a.getReader();_state.label=1;case 1:_state.trys.push([1,,7,8]);_state.label=2;case 2:return[4,m.read()];case 3:_ref=_state.sent(),_=_ref.done,b=_ref.value;if(_||c)return[3,6];y.send(JSON.stringify({type:"input_audio_buffer.append",audio:Fr(b)}));return[4,sh(y)];case 4:_state.sent();_state.label=5;case 5:return[3,2];case 6:return[3,8];case 7:m.releaseLock(),m=void 0;return[7];case 8:c||y.send(JSON.stringify({type:"input_audio_buffer.commit"}));return[2]}})})()};h=lh({url:t,protocols:p.protocols,headers:p.headers,webSocket:e,abortSignal:s,onAbort:g,onProcessingError:g,onOpen:function(y){u.enqueue({type:"stream-start",warnings:o}),y.send(JSON.stringify(n)),v(y).catch(g)},onMessageText:function(y){return _async_to_generator(function(){var _,b,w,S,k,E;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Ji({text:y})];case 1:k=_state.sent();if(!k.success)return[2];E=k.value;switch(l&&u.enqueue({type:"raw",rawValue:E}),E.type){case"conversation.item.input_audio_transcription.delta":{u.enqueue({type:"transcript-delta",id:E.item_id,delta:(_=E.delta)!=null?_:""});break}case"conversation.item.input_audio_transcription.completed":{x((b=E.transcript)!=null?b:"",E.item_id);break}case"error":{g(new Error((S=(w=E.error)==null?void 0:w.message)!=null?S:"OpenAI realtime error"));break}}return[2]}})})()},onSocketError:function(){g(new Error("OpenAI realtime transcription error"))},onClose:function(){c||(c=!0,d(),u.close())}})},cancel:function(){c||(c=!0,d())}})}function L8t(param){var e=param.modelId,t=param.inputAudioFormat,r=param.providerOptions;var n,i;return{type:"session.update",session:_object_spread({type:"transcription",audio:{input:{format:_object_spread({type:t.type},t.rate!=null?{rate:t.rate}:{}),transcription:_object_spread({model:e},(r==null?void 0:r.language)!=null?{language:r.language}:{},((n=r==null?void 0:r.streaming)==null?void 0:n.delay)!=null?{delay:r.streaming.delay}:{}),turn_detection:null}}},((i=r==null?void 0:r.streaming)==null?void 0:i.include)!=null?{include:r.streaming.include}:{})}}function F8t(e){var t;var r;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];i.toLowerCase()==="authorization"&&o!=null&&(r=o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=(t=r==null?void 0:r.match(/^bearer\s+(.+)$/i))==null?void 0:t[1];return n==null?{protocols:["realtime"],headers:e}:{protocols:["realtime","openai-insecure-api-key.".concat(n)],headers:Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,1),i=_param[0];return i.toLowerCase()!=="authorization"}))}}var z8t=ne(function(){return te(f.object({}))}),j8t=/*#__PURE__*/function(){"use strict";function _Ee(t,r){_class_call_check(this,_Ee);this.modelId=t,this.config=r,this.specificationVersion="v4"}_create_class(_Ee,[{key:"provider",get:function get1(){return this.config.provider}},{key:"doStream",value:function doStream(t){return _async_to_generator(function(){var r,n,i,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t.targetLanguage==null)throw new il({argument:"targetLanguage",message:"targetLanguage is required for translation model '".concat(this.modelId,"'.")});s=(i=(n=(r=this.config._internal)==null?void 0:r.currentDate)==null?void 0:n.call(r))!=null?i:new Date;return[4,$t({provider:"openai",providerOptions:t.providerOptions,schema:z8t})];case 1:_state.sent();l=[];q8t(t.inputAudioFormat),t.sourceLanguage!=null&&l.push({type:"unsupported",feature:"sourceLanguage",details:"The OpenAI Realtime translation API auto-detects the source language and does not accept a source language."}),t.outputAudioFormat!=null&&l.push({type:"unsupported",feature:"outputAudioFormat",details:"The OpenAI Realtime translation API always outputs 24kHz 16-bit PCM audio and does not accept an output audio format."});c=ht((a=(o=this.config).headers)==null?void 0:a.call(o),t.headers),d=B8t({targetLanguage:t.targetLanguage});return[2,{request:{body:d},response:{timestamp:s,modelId:this.modelId},stream:U8t({webSocket:this.config.webSocket,url:nT(this.config.url({path:"/realtime/translations?model=".concat(encodeURIComponent(this.modelId)),modelId:this.modelId})),headers:c,sessionUpdate:d,warnings:l,audio:t.audio,abortSignal:t.abortSignal,includeRawChunks:t.includeRawChunks})}]}})}).call(this)}}],[{key:_r,value:function value(t){return Sr({modelId:t.modelId,config:t.config})}},{key:br,value:function value(t){return new _Ee(t.modelId,t.config)}}]);return _Ee}();function U8t(param){var e=param.webSocket,t=param.url,r=param.headers,n=param.sessionUpdate,i=param.warnings,o=param.audio,a=param.abortSignal,s=param.includeRawChunks;var l=!1,c=function(){};return new ReadableStream({start:function(d){var u=W8t(r),p,m,h="",g="";c=function(_){p!=null?p.cancel().catch(function(){}):o.cancel().catch(function(){}),m==null||m.close(_)};var x=function(_){l||(l=!0,c(),d.error(_))},v=function(){l||(l=!0,h!==""&&d.enqueue({type:"source-transcript-final",text:h}),g!==""&&d.enqueue({type:"output-text-final",text:g}),d.enqueue({type:"finish",sourceText:h,outputText:g,usage:void 0}),d.close(),c(1e3))},y=function(_){return _async_to_generator(function(){var _ref,b,w;return _ts_generator(this,function(_state){switch(_state.label){case 0:p=o.getReader();_state.label=1;case 1:_state.trys.push([1,,7,8]);_state.label=2;case 2:return[4,p.read()];case 3:_ref=_state.sent(),b=_ref.done,w=_ref.value;if(b||l)return[3,6];_.send(JSON.stringify({type:"session.input_audio_buffer.append",audio:Fr(w)}));return[4,sh(_)];case 4:_state.sent();_state.label=5;case 5:return[3,2];case 6:return[3,8];case 7:p.releaseLock(),p=void 0;return[7];case 8:l||_.send(JSON.stringify({type:"session.close"}));return[2]}})})()};m=lh({url:t,protocols:u.protocols,headers:u.headers,webSocket:e,abortSignal:a,onAbort:x,onProcessingError:x,onOpen:function(_){d.enqueue({type:"stream-start",warnings:i}),_.send(JSON.stringify(n)),y(_).catch(x)},onMessageText:function(_){return _async_to_generator(function(){var b,w,S,k,E,C,T,I;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(l)return[2];return[4,Ji({text:_})];case 1:T=_state.sent();if(!T.success)return[2];I=T.value;switch(s&&d.enqueue({type:"raw",rawValue:I}),I.type){case"session.output_audio.delta":{I.delta&&d.enqueue({type:"audio",audio:I.delta});break}case"session.output_transcript.delta":{g+=(b=I.delta)!=null?b:"",d.enqueue({type:"output-text-delta",delta:(w=I.delta)!=null?w:""});break}case"session.input_transcript.delta":{h+=(S=I.delta)!=null?S:"",d.enqueue({type:"source-transcript-delta",delta:(k=I.delta)!=null?k:""});break}case"session.closed":{v();break}case"error":{d.enqueue({type:"error",error:new Error((C=(E=I.error)==null?void 0:E.message)!=null?C:"OpenAI realtime error")});break}}return[2]}})})()},onSocketError:function(){x(new Error("OpenAI realtime translation error"))},onClose:function(param){var _=param.code,b=param.reason;l||x(new Error("OpenAI realtime translation WebSocket closed unexpectedly before finishing (code ".concat(_!=null?_:"unknown").concat(b?", reason: ".concat(b):"",").")))}})},cancel:function(){l||(l=!0,c())}})}function B8t(param){var e=param.targetLanguage;return{type:"session.update",session:{audio:{input:{transcription:{model:"gpt-realtime-whisper"},noise_reduction:null},output:{language:e}}}}}function q8t(e){if(e.type!=="audio/pcm"||e.rate!=null&&e.rate!==24e3)throw new il({argument:"inputAudioFormat",message:"The OpenAI Realtime translation API only supports 24kHz 16-bit PCM input audio."})}function W8t(e){var t;var r;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.entries(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),i=_step_value[0],o=_step_value[1];i.toLowerCase()==="authorization"&&o!=null&&(r=o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var n=(t=r==null?void 0:r.match(/^bearer\s+(.+)$/i))==null?void 0:t[1];return n==null?{protocols:["realtime"],headers:e}:{protocols:["realtime","openai-insecure-api-key.".concat(n)],headers:Object.fromEntries(Object.entries(e).filter(function(param){var _param=_sliced_to_array(param,1),i=_param[0];return i.toLowerCase()!=="authorization"}))}}var V8t=ne(function(){return te(f.object({id:f.string(),name:f.string().nullish(),description:f.string().nullish(),default_version:f.string().nullish(),latest_version:f.string().nullish(),created_at:f.number(),updated_at:f.number().nullish()}))}),x8r=ne(function(){return te(f.object({id:f.string(),version:f.string().nullish(),name:f.string().nullish(),description:f.string().nullish()}))}),G8t=/*#__PURE__*/function(){"use strict";function G8t1(e){_class_call_check(this,G8t1);this.config=e,this.specificationVersion="v4"}_create_class(G8t1,[{key:"provider",get:function get1(){return this.config.provider}},{key:"uploadSkill",value:function uploadSkill(e){return _async_to_generator(function(){var t,r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,_ref,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=[];e.displayTitle!=null&&t.push({type:"unsupported",feature:"displayTitle"});r=new FormData;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=e.files[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;o=Gd(i.data);r.append("files[]",new Blob([o]),i.path)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[4,ul({url:this.config.url({path:"/skills"}),headers:ht(this.config.headers()),formData:r,failedResponseHandler:pu,successfulResponseHandler:wt(V8t),fetch:this.config.fetch})];case 1:_ref=_state.sent(),n=_ref.value;return[2,_object_spread_props(_object_spread({providerReference:{openai:n.id}},n.name!=null?{name:n.name}:{},n.description!=null?{description:n.description}:{},n.latest_version!=null?{latestVersion:n.latest_version}:{}),{providerMetadata:{openai:_object_spread({},n.default_version!=null?{defaultVersion:n.default_version}:{},n.created_at!=null?{createdAt:n.created_at}:{},n.updated_at!=null?{updatedAt:n.updated_at}:{})},warnings:t})]}})}).call(this)}}]);return G8t1}(),H8t="4.0.22";function BG(){var _this=this;var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,r;var n=(t=Kd(fT(Hd({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"}))))!=null?t:"https://api.openai.com/v1",i=(r=e.name)!=null?r:"openai",o=function(){return Bi(_object_spread({Authorization:"Bearer ".concat(U2({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})),"OpenAI-Organization":e.organization,"OpenAI-Project":e.project},e.headers),"ai-sdk/openai/".concat(H8t))},a=function(b){return new zkt(b,{provider:"".concat(i,".chat"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch})},s=function(b){return new Wkt(b,{provider:"".concat(i,".completion"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch})},l=function(b){return new Zkt(b,{provider:"".concat(i,".embedding"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch})},c=function(b){return new i7t(b,{provider:"".concat(i,".image"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch})},d=function(b){return new N8t(b,{provider:"".concat(i,".transcription"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch,webSocket:e.webSocket})},u=function(b){return new j8t(b,{provider:"".concat(i,".translation"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch,webSocket:e.webSocket})},p=function(b){return new O8t(b,{provider:"".concat(i,".speech"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch})},m=function(){return new Jkt({provider:"".concat(i,".files"),baseURL:n,headers:o,fetch:e.fetch})},h=function(){return new G8t({provider:"".concat(i,".skills"),url:function(param){var b=param.path;return"".concat(n).concat(b)},headers:o,fetch:e.fetch})},g=function(b){if(_instanceof(_this,BG)?_this.constructor:void 0)throw new Error("The OpenAI model function cannot be called with the new keyword.");return x(b)},x=function(b){return new h8t(b,{provider:"".concat(i,".responses"),url:function(param){var w=param.path;return"".concat(n).concat(w)},headers:o,fetch:e.fetch,fileIdPrefixes:["file-"]})},v=function(b){return new e8t(b,{provider:"".concat(i,".realtime"),baseURL:n,headers:o,fetch:e.fetch})},y=Object.assign(function(b){return v(b)},{getToken:function(b){return _async_to_generator(function(){var S;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,v(b.model).doCreateClientSecret({sessionConfig:b.sessionConfig,expiresAfterSeconds:b.expiresAfterSeconds})];case 1:S=_state.sent();return[2,{token:S.token,url:S.url,expiresAt:S.expiresAt}]}})})()}}),_=function _(b){return g(b)};return _.specificationVersion="v4",_.languageModel=g,_.chat=a,_.completion=s,_.responses=x,_.embedding=l,_.embeddingModel=l,_.textEmbedding=l,_.textEmbeddingModel=l,_.image=c,_.imageModel=c,_.transcription=d,_.transcriptionModel=d,_.translation=u,_.speechTranslationModel=u,_.speech=p,_.speechModel=p,_.files=m,_.skills=h,_.experimental_realtime=y,_.tools=J7t,_}var y8r=BG();var bEe={assertUsable:El,createLanguageModel:function createLanguageModel(e,t){El(e);var r=Sp(e),n=BG(_object_spread_props(_object_spread({},r),{baseURL:r.baseURL||KU}));return kp(e,n.responses(t))}};var wEe={assertUsable:El,createLanguageModel:function createLanguageModel(e,t){El(e);var r=Sp(e),n=RP(_object_spread_props(_object_spread({},r),{baseURL:r.baseURL||QU}));return kp(e,n.chatModel(t))}};function qG(e){switch(e.npm){case"@ai-sdk/openai":return bEe;case"@ai-sdk/openai-compatible":return TG;case"@ai-sdk/anthropic":return w8e;case"@ai-sdk/google":return pCe;case"@ai-sdk/xai":return wEe;default:return TG}}function Z8t(e,t){var r,n;return!(t!=null&&t.npm)&&!(t!=null&&t.api)?e:_object_spread_props(_object_spread({},e),{npm:((r=t.npm)==null?void 0:r.trim())||e.npm,api:((n=t.api)==null?void 0:n.trim())||e.api})}function MP(e,t){var r=e.models[t],n=Z8t(e,r==null?void 0:r.provider);return qG(n).createLanguageModel(n,t)}function K8t(e){var t=e.mediaType.toLowerCase(),r=t.split("/")[0];return t==="image"||r==="image"?"image":t==="audio"||r==="audio"?"audio":t==="video"||r==="video"?"video":t==="application/pdf"?"pdf":"file"}function Q8t(e){switch(e.type){case"text":return"text";case"image":return"image";case"file":return K8t(e);default:return}}function J8t(e,t){if(e.type==="file"){var n=t||e.mediaType||"file",i=e.filename?": ".concat(e.filename):"";return{type:"text",text:"[".concat(n," attached").concat(i,", unavailable to this model.]")}}return{type:"text",text:"[".concat(t||e.type," attached, unavailable to this model.]")}}function Y8t(e,t){var r=new Set(t);return typeof e=="string"?r.has("text")?e:[]:Array.isArray(e)?e.flatMap(function(n){var i=Q8t(n),o=n.type==="file"&&r.has("file");return i&&r.has(i)||o?[n]:r.has("text")?[J8t(n,i)]:[]}):e}function X8t(e,t){return e.map(function(r){return r.role==="user"?_object_spread_props(_object_spread({},r),{content:Y8t(r.content,t)}):r})}function eCt(e){var t=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=t[t.length-1];if(r.role==="user"&&(n==null?void 0:n.role)==="user"&&Array.isArray(n.content)&&Array.isArray(r.content)){n.content=_to_consumable_array(n.content).concat(_to_consumable_array(r.content));continue}t.push(r.role==="user"&&Array.isArray(r.content)?_object_spread_props(_object_spread({},r),{content:_to_consumable_array(r.content)}):r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}function OP(e,t,r){var i,o;var n=((o=(i=e.models[t])==null?void 0:i.modalities)==null?void 0:o.input)||["text"];return eCt(X8t(r,n)).filter(function(a){return a.role!=="system"})}function SEe(e){qG(e).assertUsable(e)}var tCt=256*1024,rCt=4096,nCt=.05,iCt=4096,oCt=.05,aCt=.05,sCt=2048,lCt=4096*4,uCt=8,cCt=3;function CEe(e){if(e)return Object.fromEntries(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];var n=r.execute,i=_object_without_properties(r,["execute"]);return[t,i]}))}var $P=/*#__PURE__*/function(Error1){"use strict";_inherits($P1,Error1);function $P1(t){_class_call_check(this,$P1);var _this;_this=_call_super(this,$P1,[t]),_this.name="ContextCompressionFailedError";return _this}return $P1}(_wrap_native_super(Error));function NP(e){var r;var t=(r=e==null?void 0:e.limit)==null?void 0:r.context;return t&&t>0?t:tCt}function dCt(e){var r;var t=(r=e==null?void 0:e.limit)==null?void 0:r.input;return t&&t>0?t:void 0}function pCt(e){return Math.min(lCt,Math.max(sCt,e*aCt))}function fCt(e){return Math.max(rCt,Math.floor(e*nCt))}function mCt(e){return Math.max(iCt,Math.floor(e*oCt))}function kEe(e){return e.parts.some(function(t){return t.type==="data-context-checkpoint"})}function EEe(e){var t=new TextEncoder().encode(JSON.stringify(e)).byteLength;return Math.ceil(t/cCt)}function WG(e){return EEe(Yd(e.timeline))}function hCt(e,t){return _async_to_generator(function(){var a,r,s,n,i,o,s10,l,c,d,u;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=e.flatMap(function(s,l){return s.role==="user"&&!kEe(s)?[l]:[]});if(r.length===0){s=e.findIndex(function(l){return!kEe(l)});return[2,s<0?e.length:s]}n=r.at(-1),i=0,o=0;s10=r.length-1;_state.label=1;case 1:if(!(s10>=0))return[3,4];l=r[s10],c=(a=r[s10+1])!=null?a:e.length;return[4,Z2(e.slice(l,c))];case 2:d=_state.sent(),u=EEe(d);if(o>0&&(o>=uCt||i+u>t))return[3,4];n=l,i+=u,o+=1;_state.label=3;case 3:s10-=1;return[3,1];case 4:return[2,n]}})})()}function gCt(e){var n,i,o,a,s;var t=Yd(e.timeline),r=(n=t[0])!=null&&n.parts.some(function(l){return l.type==="data-context-checkpoint"})?(i=t[0].metadata)==null?void 0:i.createdAt:void 0;return(s=(a=(o=_to_consumable_array(t).reverse().find(function(l){var c,d,u;return l.role==="assistant"&&((d=(c=l.metadata)==null?void 0:c.llm)==null?void 0:d.usage)&&(r===void 0||((u=l.metadata.createdAt)!=null?u:0)>r)}))==null?void 0:o.metadata)==null?void 0:a.llm)==null?void 0:s.usage}function TEe(e,t){var d;var r=jC(gCt(e));if(r<=0)return"normal";var n=NP(t),i=(d=SP(t))!=null?d:0,o=dCt(t),a=Math.max(0,n-i),s=Math.min(o!=null?o:a,a),l=Math.max(0,s-fCt(n)),c=Math.max(0,l-mCt(n));return r>=l?"hard":r>=c?"soft":"normal"}function AEe(e,t){return TEe(e,t)==="hard"}function IEe(e,t){return TEe(e,t)!=="normal"}function VG(_01,_11){return _async_to_generator(function(e,t){var r,l,n,i,o,a,s;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{};n=Yd(e.timeline);if(n.length===0)return[2];return[4,hCt(n,pCt(NP(t)))];case 1:i=_state.sent(),o=i>0?i:r.allowFullContext?n.length:0;if(o===0)return[2];a=n.slice(0,o),s=(l=a.at(-1))==null?void 0:l.id;if(s)return[2,{summarizedThroughMessageId:s,sourceMessageIds:a.map(function(c){return c.id}),retainedMessageIds:n.slice(o).map(function(c){return c.id}),messages:a}];return[2]}})}).apply(this,arguments)}function DP(e,t,r,n,i){return _async_to_generator(function(){var o,_ref,a,s,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);o=n.getAgentDefinition(e.type);return[4,Promise.all([FT(i,e.type,t.systemPrompt),n.createTools(0,o,t,r)])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),a=_ref[0],s=_ref[1];return[2,{system:a,tools:CEe(s)}];case 2:o10=_state.sent();return[2,{}];case 3:return[2]}})})()}function GG(e){return _async_to_generator(function(){var s,t,_MP,r,n,i,o,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=CEe(e.tools),_MP=MP(e.provider,e.model.id),r=_MP.model;if(!(e.buildMessages&&t))return[3,2];return[4,e.buildMessages(e.plan.messages,t)];case 1:_tmp=_state.sent();return[3,4];case 2:return[4,Z2(e.plan.messages,t)];case 3:_tmp=_state.sent();_state.label=4;case 4:n=_tmp,i=OP(e.provider,e.model.id,n);return[4,Hz(_object_spread_props(_object_spread({model:r},e.system===void 0?{}:{system:e.system},t===void 0?{}:{tools:t}),{toolChoice:"none",messages:_to_consumable_array(i).concat([{role:"user",content:[{type:"text",text:qfe}]}]),abortSignal:e.abortSignal,maxOutputTokens:V7e(e.model)}))];case 5:o=_state.sent();return[2,(s=e.isCancelled)!=null&&s.call(e)?void 0:o.text.trim()||void 0]}})})()}function xCt(e,t){var r=Yd(t.timeline).slice(0,e.sourceMessageIds.length);return r.length===e.sourceMessageIds.length&&r.every(function(n,i){return n.id===e.sourceMessageIds[i]})}function HG(_01){return _async_to_generator(function(param){var e,t,r,n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=param.session,t=param.agent,r=param.plan,n=param.summary,i=param.store,o=param.messageFactory;if(!xCt(r,t))return[2,!1];a=UC(e),s=a.map(function(c){return"- [".concat(c.status,"] ").concat(c.content," (").concat(c.priority,")")}),l=a.length>0?[n,"","<CurrentTodoList>"].concat(_to_consumable_array(s),["</CurrentTodoList>"]).join("\n"):n;o.appendContextBoundary(e,t,{mode:"summary",summary:l,summarizedThroughMessageId:r.summarizedThroughMessageId,retainedMessageIds:r.retainedMessageIds}),i.upsertSessionIndexItem(e,Xd(e));return[4,i.persistSession(e)];case 1:_state.sent();return[4,i.persistMetaAndIndex()];case 2:return[2,(_state.sent(),!0)]}})}).apply(this,arguments)}function PEe(_01){return _async_to_generator(function(){var e,t,r,n,s,l,i,o,_tmp,_tmp1;return _ts_generator(this,function(_state){switch(_state.label){case 0:e=_01.agent,t=_01.store,r=_01.messageFactory,n=_object_without_properties(_01,["agent","store","messageFactory"]);return[4,VG(e,n.model,{allowFullContext:!0})];case 1:i=_state.sent();if(!i)return[2,"unavailable"];if((s=n.isCancelled)!=null&&s.call(n))return[2,"cancelled"];return[4,GG(_object_spread_props(_object_spread({},n),{plan:i}))];case 2:o=_state.sent();if(!((l=n.isCancelled)!=null&&l.call(n)))return[3,3];_tmp="cancelled";return[3,7];case 3:if(!o)return[3,5];return[4,HG({session:n.session,agent:e,plan:i,summary:o,store:t,messageFactory:r})];case 4:_tmp1=_state.sent()?"committed":"stale";return[3,6];case 5:_tmp1="failed";_state.label=6;case 6:_tmp=_tmp1;_state.label=7;case 7:return[2,_tmp]}})})()}var LP=/*#__PURE__*/function(){"use strict";function LP1(t){_class_call_check(this,LP1);this.options=t;A(this,"assistantMessage");A(this,"lastStreamNotifyAt",0)}_create_class(LP1,[{key:"project",value:function project(t){return _async_to_generator(function(){var _this,r,n,i,o,a,s,l,c,_,d,d10,u,p,m,h,g,x,d11,_this1,_loop,p10,u10,d12,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_this2,_loop1,_iterator,_step,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!this.options.isTurnAlive())return[3,11];_=t.type;switch(_){case"step-start":return[3,1];case"text-delta":return[3,2];case"tool-execution-start":return[3,3];case"tool-execution-end":return[3,4];case"assistant-step":return[3,5];case"tool-results":return[3,7]}return[3,11];case 1:this.options.runtime&&(this.options.runtime.runState="thinking"),this.options.notify();return[2];case 2:this.projectTextDelta(t.delta);return[2];case 3:{d=this.ensureAssistantMessage();d.parts.find(function(p){return p.type==="dynamic-tool"&&p.toolCallId===t.toolCall.toolCallId})||d.parts.push(_object_spread({type:"dynamic-tool",toolName:t.toolCall.toolName,toolCallId:t.toolCall.toolCallId,state:"input-available",input:t.toolCall.input},t.toolCall.providerExecuted===!0?{providerExecuted:!0}:{})),(i=(r=this.options.agent.toolTimings)[n=t.toolCall.toolCallId])!=null||(r[n]={startedAt:Date.now()}),this.options.runtime&&(this.options.runtime.runState="waiting_for_tools"),this.touch(),this.options.notify();return[2]}_state.label=4;case 4:{d10=this.options.agent.toolTimings[t.toolCallId],u=Date.now(),p=(o=d10==null?void 0:d10.startedAt)!=null?o:u-t.durationMs;this.options.agent.toolTimings[t.toolCallId]={startedAt:p,finishedAt:p+t.durationMs};m=this.assistantMessage,h=(a=m==null?void 0:m.parts.findIndex(function(x){return x.type==="dynamic-tool"&&x.toolCallId===t.toolCallId}))!=null?a:-1,g=m==null?void 0:m.parts[h];if(m&&(g==null?void 0:g.type)==="dynamic-tool"){x=_object_spread({type:"dynamic-tool",toolName:g.toolName,toolCallId:g.toolCallId,input:g.input},g.providerExecuted===!0?{providerExecuted:!0}:{},"callProviderMetadata"in g&&g.callProviderMetadata?{callProviderMetadata:g.callProviderMetadata}:{});m.parts[h]=t.toolOutput.type==="tool-error"?_object_spread_props(_object_spread({},x),{state:"output-error",errorText:Zu(t.toolOutput.error,String(t.toolOutput.error))}):_object_spread_props(_object_spread({},x),{state:"output-available",output:t.toolOutput.output})}this.touch(),this.options.notify();return[2]}_state.label=5;case 5:d11=this.options.messageFactory.createMessage(t.response.message,{meta:_object_spread_props(_object_spread({},t.response.meta),{modelId:this.options.assistantMeta.modelId})});if(this.assistantMessage){_loop=function(p10){var m=d11.parts[p10];if(m.type!=="dynamic-tool")return"continue";var h=_this1.assistantMessage.parts.find(function(g){return g.type==="dynamic-tool"&&g.toolCallId===m.toolCallId&&(g.state==="output-available"||g.state==="output-error"||g.state==="output-denied")});h&&(d11.parts[p10]=h)};for(p10=0;p10<d11.parts.length;p10+=1)_this1=this,_loop(p10);d11.id=this.assistantMessage.id;u10=this.options.agent.timeline.findIndex(function(p){var m;return p.id===((m=_this.assistantMessage)==null?void 0:m.id)});u10>=0&&(this.options.agent.timeline[u10]=d11)}else this.options.agent.timeline.push(d11);this.assistantMessage=d11,d11.parts.some(function(u){return u.type==="dynamic-tool"})&&this.options.runtime&&(this.options.runtime.runState="waiting_for_tools"),this.touch();return[4,this.options.store.persistSession(this.options.session)];case 6:_state.sent(),this.options.notify();return[2];case 7:if(!this.options.isTurnAlive())return[2];d12=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{_loop1=function(){var u=_step.value;var p=_this2.options.messageFactory.findToolPart(_this2.options.agent,u.toolCallId);if(!p)return"continue";var m=_object_spread({type:"dynamic-tool",toolName:u.toolName,toolCallId:u.toolCallId,input:u.input},u.providerExecuted===!0?{providerExecuted:!0}:{},"callProviderMetadata"in p.part&&p.part.callProviderMetadata?{callProviderMetadata:p.part.callProviderMetadata}:{}),h=p.message.parts.indexOf(p.part);if(p.message.parts[h]=u.type==="tool-error"?_object_spread_props(_object_spread({},m),{state:"output-error",errorText:Zu(u.error,String(u.error))}):_object_spread_props(_object_spread({},m),{state:"output-available",output:u.output}),u.type==="tool-error")return"continue";var g=t.metadata.get(u.toolCallId);(s=g==null?void 0:g.todos)!=null&&s.length&&p.message.parts.push({type:"data-todos",data:{items:g.todos}}),g!=null&&g.sessionTitle&&(_this2.options.store.upsertSessionIndexItem(_this2.options.session,g.sessionTitle),d12=!0),_this2.options.messageFactory.setMessageOperations(_this2.options.agent,p.message.id,(c=(l=g==null?void 0:g.reversibleOps)==null?void 0:l.map(function(x){return _object_spread_props(_object_spread({},x),{toolCallId:u.toolCallId})}))==null?void 0:c.map(lp).filter(function(x){return!!x}))};for(_iterator=t.outcomes[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_this2=this,_loop1()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this.assistantMessage=void 0,this.touch();return[4,this.options.store.persistSession(this.options.session)];case 8:_state.sent();_tmp=d12;if(!_tmp)return[3,10];return[4,this.options.store.persistMetaAndIndex()];case 9:_tmp=_state.sent();_state.label=10;case 10:_tmp,this.options.notify();_state.label=11;case 11:return[2]}})}).call(this)}},{key:"projectTextDelta",value:function projectTextDelta(t){if(!t||!this.options.isTurnAlive())return;var r=this.ensureAssistantMessage(),n=r.parts.find(function(i){return i.type==="text"});(n==null?void 0:n.type)==="text"?n.text+=t:r.parts.push({type:"text",text:t}),this.touch(),Date.now()-this.lastStreamNotifyAt>=33&&(this.lastStreamNotifyAt=Date.now(),this.options.notify())}},{key:"ensureAssistantMessage",value:function ensureAssistantMessage(){return this.assistantMessage?this.assistantMessage:(this.assistantMessage=this.options.messageFactory.createMessage({role:"assistant",content:[]},{meta:this.options.assistantMeta}),this.options.agent.timeline.push(this.assistantMessage),this.touch(),this.assistantMessage)}},{key:"touch",value:function touch(){this.options.session.updatedAt=Date.now()}}]);return LP1}();function ZG(e){return Array.isArray(e)?e.map(function(t){return ZG(t)}):e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"?Object.fromEntries(Object.entries(e).sort(function(param,param1){var _param=_sliced_to_array(param,1),t=_param[0],_param1=_sliced_to_array(param1,1),r=_param1[0];return t.localeCompare(r)}).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return[t,ZG(r)]})):e}function yCt(e){return JSON.stringify(e.map(function(t){var r;return{name:t.toolName,arguments:JSON.stringify(ZG((r=t.input)!=null?r:{}))}}))}function REe(e,t){var r=yCt(t),n=e.lastSignature===r?e.consecutiveCount+1:1;return{lastSignature:r,consecutiveCount:n,isRepeatedTooManyTimes:n>=5}}var FP=/*#__PURE__*/function(){"use strict";function FP1(){_class_call_check(this,FP1);A(this,"attachments",new Map);A(this,"injectedToolCallIds",new Set)}_create_class(FP1,[{key:"register",value:function register(t,r){this.attachments.set(t,r)}},{key:"takeUninjected",value:function takeUninjected(t){var r=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(this.injectedToolCallIds.has(n.toolCallId))continue;var i=this.attachments.get(n.toolCallId);i&&(this.injectedToolCallIds.add(n.toolCallId),r.push(i))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return r}}]);return FP1}();function MEe(e){if(e.length)return{role:"user",content:e.flatMap(function(t){return[{type:"text",text:"The image from the preceding view_image result is attached for visual inspection."},t]})}}var zP=/*#__PURE__*/function(){"use strict";function zP1(t,r,n,i,o){_class_call_check(this,zP1);this.toolExecutor=t;this.store=r;this.messageFactory=n;this.notify=i;this.app=o}_create_class(zP1,[{key:"runTurn",value:function runTurn(t){return _async_to_generator(function(){var E,C,T,I,O,r,n,i,o,a,s,l,c,_MP,d,u,p,m,h,_tmp,g,x,v,y,_,b,w,k,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,M,_tmp1,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.session,n=t.agent,i=this.toolExecutor.getAgentDefinition(n.type);return[4,this.toolExecutor.createTools(t.depth,i,r,t.model)];case 1:o=_state.sent(),a=this.toolExecutor.createStableToolsContext(r,i);return[4,FT(this.app,n.type,r.systemPrompt)];case 2:s=_state.sent();if(!t.buildMessages)return[3,4];return[4,t.buildMessages(n,o)];case 3:_tmp=_state.sent();return[3,6];case 4:return[4,Z2(Yd(n.timeline),o)];case 5:_tmp=_state.sent();_state.label=6;case 6:l=_tmp,c=new LP({session:r,agent:n,runtime:t.runtime,store:this.store,messageFactory:this.messageFactory,notify:this.notify,assistantMeta:t.assistantMeta,isTurnAlive:t.isTurnAlive}),_MP=MP(t.provider,t.model.id),d=_MP.model,u=new Map,p=function(M,R){return u.set(M,R)},m=this.toolExecutor.prepareReadTracker(r,n.id),h=(C=(E=t.runtime)==null?void 0:E.viewImageAttachments)!=null?C:new FP;t.runtime&&(t.runtime.viewImageAttachments=h);g={app:a.app,fileSystemManager:a.fileSystemManager,permissionGuard:a.permissionGuard,readTracker:m,recordMetadata:p},x=_object_spread({bash:_object_spread_props(_object_spread({},g),{getSettingsSnapshot:a.getSettingsSnapshot,updateSettings:a.updateSettings}),apply_patch:_object_spread_props(_object_spread({},g),{getSettingsSnapshot:a.getSettingsSnapshot,updateSettings:a.updateSettings}),view_image:{app:a.app,fileSystemManager:a.fileSystemManager,readTracker:m,viewImageAttachments:h},update_session_title:{recordMetadata:p}},o.todowrite?{todowrite:{session:r,recordMetadata:p}}:{},o.task?{task:{session:r,agentId:n.id,origin:t.taskOrigin,dispatchTask:a.dispatchTask,dispatchableDefinitions:a.dispatchableDefinitions}}:{}),v=(T=t.continuation)!=null?T:{consecutiveCount:0,isRepeatedTooManyTimes:!1},y=!1,b=function(param){var M=param.steps;var $,z;var R=(z=($=M.at(-1))==null?void 0:$.toolCalls)!=null?z:[];return R.length?(v=REe(v,R),v.isRepeatedTooManyTimes):!1},w=function(param){var M=param.steps;return _async_to_generator(function(){var R,$,z,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((R=M.at(-1))!=null&&R.toolCalls.length))return[3,2];return[4,($=t.shouldSuspendAfterToolStep)==null?void 0:$.call(t)];case 1:_tmp=(y=(z=_state.sent())!=null?z:!1,y);return[3,3];case 2:_tmp=!1;_state.label=3;case 3:return[2,_tmp]}})})()};return[4,new bpe({model:d,instructions:s,tools:o,toolsContext:x,stopWhen:[lpe(),b,w],maxOutputTokens:SP(t.model),prepareStep:function(param){var M=param.messages,R=param.steps;return _async_to_generator(function(){var D,L,$,z;return _ts_generator(this,function(_state){switch(_state.label){case 0:m.resetSnapshot();return[4,c.project({type:"step-start"})];case 1:_state.sent();$=h.takeUninjected((L=(D=R.at(-1))==null?void 0:D.toolCalls)!=null?L:[]),z=MEe($);return[2,z?{messages:_to_consumable_array(M).concat([z])}:{}]}})})()}}).stream({messages:OP(t.provider,t.model.id,l),abortSignal:t.abortSignal,onToolExecutionStart:function(M){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=M;if(!_tmp)return[3,2];return[4,c.project({type:"tool-execution-start",toolCall:M.toolCall})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()},onToolExecutionEnd:function(M){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=M!=null&&M.toolOutput;if(!_tmp)return[3,2];return[4,c.project({type:"tool-execution-end",toolCallId:M.toolCall.toolCallId,durationMs:M.toolExecutionMs,toolOutput:M.toolOutput})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})})()},onStepEnd:function(M){return _async_to_generator(function(){var R,$,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:R=M.response.messages.find(function(z){return z.role==="assistant"});if(!R)return[2];_=R;return[4,c.project({type:"assistant-step",response:{message:R,meta:{providerId:t.provider.id,providerName:t.provider.name,modelId:M.response.modelId,modelName:t.model.name,usage:M.usage,finishReason:M.finishReason,responseId:M.response.id}}})];case 1:_state.sent();$=M.content.filter(function(z){return z.type==="tool-result"||z.type==="tool-error"});_tmp=$.length;if(!_tmp)return[3,3];return[4,c.project({type:"tool-results",outcomes:$,metadata:u})];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})})()}})];case 7:k=_state.sent();_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=8;case 8:_state.trys.push([8,15,16,21]);_iterator=_async_iterator(k.stream);_state.label=9;case 9:return[4,_iterator.next()];case 10:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,14];_value=_step.value;M=_value;_tmp1=M.type==="text-delta"&&M.text;if(!_tmp1)return[3,12];return[4,c.project({type:"text-delta",delta:M.text})];case 11:_tmp1=_state.sent();_state.label=12;case 12:if(_tmp1,M.type==="error")throw M.error;if(M.type==="abort")throw(O=(I=t.abortSignal)==null?void 0:I.reason)!=null?O:new Error("Agent run aborted");_state.label=13;case 13:_iteratorAbruptCompletion=false;return[3,9];case 14:return[3,21];case 15:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,21];case 16:_state.trys.push([16,,19,20]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,18];return[4,_iterator.return()];case 17:_state.sent();_state.label=18;case 18:return[3,20];case 19:if(_didIteratorError){throw _iteratorError}return[7];case 20:return[7];case 21:if(!t.isTurnAlive())throw Ds("Agent turn cancelled");if(y)return[2,{status:"needs-compaction",continuation:v}];if(v.isRepeatedTooManyTimes)throw new Error(P.t("chatbox.repeatedToolCallsStopped",{count:5}));if(!_)throw new Error("Agent completed without an assistant response");return[2,{status:"completed",text:Jfe(_).trim()||P.t("chatbox.task.emptyResult")}]}})}).call(this)}},{key:"resolveSummaryContext",value:function resolveSummaryContext(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,DP(t,r,n,this.toolExecutor,this.app)]})}).call(this)}}]);return zP1}();function x1(e,t,r){var n,i;return JSON.stringify({providerId:t.id,modelId:r.id,systemPrompt:(n=e.systemPrompt)!=null?n:null,disabledMcpServers:(i=e.disabledMcpServers)!=null?i:[]})}var __=/*#__PURE__*/function(Error1){"use strict";_inherits(__1,Error1);function __1(r){_class_call_check(this,__1);var _this;_this=_call_super(this,__1,["Context compaction ".concat(r)]);_this.reason=r;_this.name="ContextCompactionError";return _this}return __1}(_wrap_native_super(Error)),b_=/*#__PURE__*/function(){"use strict";function b_1(t,r){_class_call_check(this,b_1);this.store=t;this.messageFactory=r;A(this,"jobs",new Map)}_create_class(b_1,[{key:"inspect",value:function inspect(t){var n,i,o,a;if(t.isCancelled())return"ready";var r=this.currentJob(t);return!r&&IEe(t.agent,t.model)&&(r=this.start(t,!1)),(((n=r==null?void 0:r.result)==null?void 0:n.status)==="stale"||((i=r==null?void 0:r.result)==null?void 0:i.status)==="cancelled")&&(this.deleteIfCurrent(t,r),r=void 0),((o=r==null?void 0:r.result)==null?void 0:o.status)==="ready"||((a=r==null?void 0:r.result)==null?void 0:a.status)==="failed"||AEe(t.agent,t.model)?"compact":"ready"}},{key:"compact",value:function compact(t){return _async_to_generator(function(){var i,o,r,n,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.throwIfCancelled(t);r=(i=this.currentJob(t))!=null?i:this.start(t,!1),n=(o=r==null?void 0:r.allowFullContext)!=null?o:!1;_state.label=1;case 1:if(!r)return[3,6];return[4,r.completion];case 2:a=_state.sent();if(!(this.deleteIfCurrent(t,r),this.throwIfCancelled(t),a.status==="ready"&&this.isCurrent(t)))return[3,4];s=WG(t.agent);return[4,HG({session:t.session,agent:t.agent,plan:a.plan,summary:a.summary,store:this.store,messageFactory:this.messageFactory})];case 3:l=_state.sent();if(this.throwIfCancelled(t),l)return[2,{beforeTokens:s,afterTokens:WG(t.agent),revision:"".concat(r.revision,":").concat(a.plan.summarizedThroughMessageId)}];_state.label=4;case 4:if(a.status==="failed")throw new __("failed");if(!this.isCurrent(t))throw new __("stale");if(n)throw new __(a.status==="unavailable"?"unavailable":"stale");n=!0,r=this.start(t,!0);_state.label=5;case 5:return[3,1];case 6:throw this.throwIfCancelled(t),new __("unavailable")}})}).call(this)}},{key:"shouldSuspendAtSafePoint",value:function shouldSuspendAtSafePoint(t){return t.isCancelled()||this.inspect(t)==="compact"}},{key:"cancel",value:function cancel(t,r){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.jobs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];i.sessionId===t&&(r&&i.agentId!==r||(i.controller.abort(),this.jobs.delete(n)))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"currentJob",value:function currentJob(t){var r=this.keyFor(t),n=this.jobs.get(r);if(!n||n.revision===t.revision)return n;n.controller.abort(),this.jobs.delete(r)}},{key:"start",value:function start(t,r){if(t.isCancelled())return;var n=new AbortController,i={sessionId:t.session.id,agentId:t.agent.id,revision:t.revision,allowFullContext:r,controller:n,completion:Promise.resolve({status:"unavailable"})};return i.completion=this.generate(t,n,r).then(function(o){return i.result=o,o}),this.jobs.set(this.keyFor(t),i),i}},{key:"generate",value:function generate(t,r,n){return _async_to_generator(function(){var _this,i,o,a,s,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_state.trys.push([1,6,,7]);return[4,VG(t.agent,t.model,n?{allowFullContext:!0}:void 0)];case 2:o=_state.sent();if(!o)return[2,{status:"unavailable"}];if(!this.isCurrent(t))return[2,{status:"stale"}];return[4,(i=t.ensureProviderReady)==null?void 0:i.call(t)];case 3:if(_state.sent(),!this.isCurrent(t))return[2,{status:"stale"}];return[4,t.resolveSummaryContext()];case 4:a=_state.sent();return[4,GG(_object_spread_props(_object_spread({provider:t.provider,model:t.model,session:t.session,plan:o},a),{buildMessages:t.buildMessages,isCancelled:function(){return!_this.isCurrent(t)},abortSignal:r.signal}))];case 5:s=_state.sent();return[2,this.isCurrent(t)?s?{status:"ready",plan:o,summary:s}:{status:"failed"}:{status:"stale"}];case 6:o10=_state.sent();return[2,t.isCancelled()?{status:"cancelled"}:{status:r.signal.aborted?"stale":"failed"}];case 7:return[2]}})}).call(this)}},{key:"throwIfCancelled",value:function throwIfCancelled(t){if(t.isCancelled())throw Ds("Compaction cancelled")}},{key:"deleteIfCurrent",value:function deleteIfCurrent(t,r){var n=this.keyFor(t);this.jobs.get(n)===r&&this.jobs.delete(n)}},{key:"isCurrent",value:function isCurrent(t){var r,n;return!t.isCancelled()&&((n=(r=t.isCurrent)==null?void 0:r.call(t))!=null?n:!0)}},{key:"keyFor",value:function keyFor(t){return"".concat(t.session.id,":").concat(t.agent.id)}}]);return b_1}();var OEe=require("obsidian");var jP=/*#__PURE__*/function(){"use strict";function jP1(t,r,n,i){_class_call_check(this,jP1);this.getSettings=t;this.state=r;this.notify=n;this.persistSession=i}_create_class(jP1,[{key:"getLoadedActiveSession",value:function getLoadedActiveSession(){return this.state.activeSessionId?this.state.loadedSessions.get(this.state.activeSessionId):void 0}},{key:"selectProvider",value:function selectProvider(t){var o,a;var r=this.getLoadedActiveSession();if(!r){if(!t){this.state.pendingProviderId=void 0,this.state.pendingModelId=void 0,this.notify();return}var s=Wi(this.getSettings().providers,t);if(!s)return;this.state.pendingProviderId=s.id,this.state.pendingModelId=(o=wf(s))==null?void 0:o.id,this.notify();return}if(!t){r.model=void 0,this.persistSession(r),this.notify();return}var n=Wi(this.getSettings().providers,t);if(!n)return;var i=(a=wf(n))==null?void 0:a.id;r.model=i?{providerId:n.id,modelId:i}:void 0,this.persistSession(r),this.notify()}},{key:"selectModel",value:function selectModel(t){var o;var r=this.getLoadedActiveSession();if(!r){if(!t){this.state.pendingModelId=void 0,this.notify();return}var a=Wi(this.getSettings().providers,this.state.pendingProviderId),s=Da(a,t);if(!s)return;this.state.pendingModelId=s.id,this.notify();return}if(!t){r.model=void 0,this.persistSession(r),this.notify();return}var n=Wi(this.getSettings().providers,(o=r.model)==null?void 0:o.providerId),i=Da(n,t);!i||!n||(r.model={providerId:n.id,modelId:i.id},this.persistSession(r),this.notify())}},{key:"sanitizeSessionSelection",value:function sanitizeSessionSelection(t){var a,s,l,c,d,u;if(!t.model){if(this.sessionHasMessages(t))return!1;var p=Ev(this.getSettings().providers,this.getSettings().defaultModel),m=Wi(this.getSettings().providers,p.providerId),h=Da(m,p.modelId);return!m||!h?!1:(t.model={providerId:m.id,modelId:h.id},!0)}var r=Wi(this.getSettings().providers,(a=t.model)==null?void 0:a.providerId);if(!r)return t.model=void 0,!0;var n=((l=Da(r,(s=t.model)==null?void 0:s.modelId))==null?void 0:l.id)||((c=wf(r))==null?void 0:c.id),i=n?{providerId:r.id,modelId:n}:void 0,o=((d=t.model)==null?void 0:d.providerId)!==r.id||((u=t.model)==null?void 0:u.modelId)!==n;return t.model=i,o}},{key:"sessionHasMessages",value:function sessionHasMessages(t){return t.subagents.master.timeline.length>0}},{key:"getInitialSelectionForNewSession",value:function getInitialSelectionForNewSession(){var t=this.getEmptyStateSelection();return{providerId:t.providerId,modelId:t.modelId}}},{key:"getEmptyStateSelection",value:function getEmptyStateSelection(){var t=Ev(this.getSettings().providers,this.getSettings().defaultModel),r=Wi(this.getSettings().providers,this.state.pendingProviderId)||Wi(this.getSettings().providers,t.providerId),n=Da(r,this.state.pendingModelId)||Da(r,t.modelId)||wf(r);return{providerId:r==null?void 0:r.id,modelId:n==null?void 0:n.id}}},{key:"syncPendingSelectionWithSettings",value:function syncPendingSelectionWithSettings(){var t=Ev(this.getSettings().providers,this.getSettings().defaultModel),r=Wi(this.getSettings().providers,t.providerId),n=Da(r,t.modelId)||wf(r);this.state.pendingProviderId=r==null?void 0:r.id,this.state.pendingModelId=n==null?void 0:n.id}},{key:"validateSessionSelection",value:function validateSessionSelection(t){try{var _$r=this.getProviderOrThrow(t);return this.getModelOrThrow(_$r,t),!0}catch(r){var n=_instanceof(r,Error)?r.message:P.t("chatbox.requestFailed");return Me.error(r),new OEe.Notice(n),!1}}},{key:"requireProvider",value:function requireProvider(t){var r=Wi(this.getSettings().providers,t);if(!r)throw new Error(P.t("chatbox.errors.noProvider"));return SEe(r),r}},{key:"requireModel",value:function requireModel(t,r){var n=Da(t,r);if(!n)throw new Error(P.t("chatbox.errors.noModel"));return n}},{key:"getProviderOrThrow",value:function getProviderOrThrow(t){var r;return this.requireProvider((r=t.model)==null?void 0:r.providerId)}},{key:"getProviderByIdOrThrow",value:function getProviderByIdOrThrow(t){return this.requireProvider(t)}},{key:"getModelOrThrow",value:function getModelOrThrow(t,r){var n;return this.requireModel(t,(n=r.model)==null?void 0:n.modelId)}},{key:"getModelByIdsOrThrow",value:function getModelByIdsOrThrow(t,r){return this.requireModel(t,r)}}]);return jP1}();function UP(_01){return _async_to_generator(function(param){var _loop,e,t,r,n,i,o,_ret;return _ts_generator(this,function(_state){switch(_state.label){case 0:_loop=function(){var _,_$a,s,_$a1,_$a2,s10,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!r())return[2,{v:{status:"cancelled"}}];i==null||i(o.type);_state.label=1;case 1:_state.trys.push([1,8,,9]);_=o.type;switch(_){case"checking-context":return[3,2];case"compacting":return[3,3];case"running-turn":return[3,5]}return[3,7];case 2:{_$a=t(),s=e.inspect(_$a);if(!r())return[2,{v:{status:"cancelled"}}];o={type:s==="compact"?"compacting":"running-turn",request:_$a,continuation:o.continuation};return[3,7]}_state.label=3;case 3:return[4,e.compact(o.request)];case 4:_$a1=_state.sent();if(!r())return[2,{v:{status:"cancelled"}}];if(_$a1.afterTokens>=_$a1.beforeTokens)return[2,{v:{status:"failed",error:{type:"compaction-no-progress",progress:_$a1}}}];o={type:"checking-context",continuation:o.continuation};return[3,7];case 5:_$a2=o.request;return[4,n(o.continuation,function(){return!r()||e.shouldSuspendAtSafePoint(_$a2)})];case 6:s10=_state.sent();if(!r())return[2,{v:{status:"cancelled"}}];if(s10.status==="completed")return[2,{v:s10}];o={type:"checking-context",continuation:s10.continuation};return[3,7];case 7:return[3,9];case 8:a=_state.sent();return[2,{v:r()?{status:"failed",error:o.type==="running-turn"?{type:"turn-failed",cause:a}:{type:"compaction-failed",cause:a}}:{status:"cancelled"}}];case 9:return[2]}})};e=param.compactionCoordinator,t=param.createCompactionRequest,r=param.isTurnAlive,n=param.runTurn,i=param.onStateChange;o={type:"checking-context"};_state.label=1;case 1:return[5,_ts_values(_loop())];case 2:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=3;case 3:return[3,1];case 4:return[2]}})}).apply(this,arguments)}var BP=/*#__PURE__*/function(){"use strict";function BP1(t,r,n,i,o,a,s,l,c,d,u,p){var m=arguments.length>12&&arguments[12]!==void 0?arguments[12]:function(){};_class_call_check(this,BP1);this.ensureProviderReady=t;this.state=r;this.runtimeStates=n;this.store=i;this.notify=o;this.selection=a;this.messageFactory=s;this.messageOps=l;this.userContextManager=c;this.agentRunner=d;this.compactionCoordinator=u;this.subagentCancellation=p;this.reportTransientError=m}_create_class(BP1,[{key:"enqueueUserSubmission",value:function enqueueUserSubmission(t,r){if(this.state.deletedSessionIds.has(t)||!this.state.loadedSessions.has(t))return;var n=this.runtimeStates.get(t),i=mxe(n,r);return this.notify(),this.start(t),i}},{key:"enqueueAgentInput",value:function enqueueAgentInput(t,r,n){if(this.state.deletedSessionIds.has(t)||!this.state.loadedSessions.has(t))return!1;var i=this.runtimeStates.get(t);return hxe(i,r,n)?(this.notify(),this.start(t),!0):!1}},{key:"enqueueRegenerate",value:function enqueueRegenerate(t,r){if(this.state.deletedSessionIds.has(t)||!this.state.loadedSessions.has(t))return!1;var n=this.runtimeStates.get(t);return gxe(n,r),this.notify(),this.start(t),!0}},{key:"discardAgentInputsForOrigin",value:function discardAgentInputsForOrigin(t,r){var n=this.runtimeStates.get(t);vxe(n,function(i){return i.kind==="agent-input"&&i.origin.turnId===r})}},{key:"stopActiveTurn",value:function stopActiveTurn(t){return _async_to_generator(function(){var r,i;return _ts_generator(this,function(_state){r=this.state.loadedSessions.get(t);if(!r)return[2,!1];i=this.runtimeStates.get(t).scheduler.active;return[2,i?(this.cancelExecutionTree(r,i,"Stopped by user",this.messageFactory.getActiveAgent(r).id),!0):!1]})}).call(this)}},{key:"start",value:function start(t){return _async_to_generator(function(){var _this,r,n,i;return _ts_generator(this,function(_state){_this=this;if(this.state.deletedSessionIds.has(t)||!this.state.loadedSessions.has(t))return[2];r=this.runtimeStates.get(t);if(r.processing)return[2,r.processing];n=this.drain(t);return[2,(i=n.then(function(){return _this.shutdownWorker(t,r,i)},function(o){return _this.shutdownWorker(t,r,i,{error:o})}),r.processing=i,i)]})}).call(this)}},{key:"shutdownWorker",value:function shutdownWorker(t,r,n,i){if(r.processing===n){if(i&&this.reportTransientError(Zu(i.error,P.t("chatbox.requestFailed"))),r.processing=void 0,_xe(r)&&!this.state.deletedSessionIds.has(t)&&this.state.loadedSessions.has(t)){this.start(t);return}r.runState="idle",this.notify()}}},{key:"drain",value:function drain(t){return _async_to_generator(function(){var r,n,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.runtimeStates.get(t),n=this.state.loadedSessions.get(t);if(!n)return[3,4];_state.label=1;case 1:if(!(!this.state.deletedSessionIds.has(t)&&this.state.loadedSessions.get(t)===n&&this.runtimeStates.get(t)===r))return[3,4];i=this.state.loadedSessions.get(t);if(!i)return[2];zT(this.messageFactory.getActiveAgent(i));o=xxe(r);if(!o)return[2];return[4,this.runActiveTurn(i,r,o)];case 2:_state.sent();_state.label=3;case 3:return[3,1];case 4:return[2]}})}).call(this)}},{key:"runActiveTurn",value:function runActiveTurn(t,r,n){return _async_to_generator(function(){var _this,i,o,a,s,l,c,d,u,p,m,h,_,_10,_$g,x,v,y,_tmp,g;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;i=n.turn,o=n.abortController,a=i.turnId,s=this.messageFactory.getActiveAgent(t),l={turnId:a,signal:o.signal},c=function(){return EI(r,a,o.signal)},d=function(){return c()&&_this.state.loadedSessions.get(t.id)===t&&!_this.state.deletedSessionIds.has(t.id)},u=function(){return yxe(r,t.id,a,o.signal,function(g){return _this.state.deletedSessionIds.has(g)})&&_this.state.loadedSessions.get(t.id)===t},m=!1;r.runState="thinking",this.notify();_state.label=1;case 1:_state.trys.push([1,33,37,38]);if(!!u())return[3,3];return[4,this.cancelTurn(t,r,n,s)];case 2:_state.sent();return[2];case 3:_=i.kind;switch(_){case"user-submission":return[3,4];case"agent-input":return[3,12];case"regenerate":return[3,16]}return[3,21];case 4:return[4,this.userContextManager.prepareUserContextForMessage(i.submission.userContext)];case 5:_10=_state.sent();if(!!d())return[3,7];return[4,this.cancelTurn(t,r,n,s)];case 6:_state.sent();return[2];case 7:return[4,this.messageFactory.appendUserMessage(s,i.submission.text,t,_10.dedupedItems.length>0?_10.dedupedItems:void 0,d)];case 8:if(!!_state.sent())return[3,10];return[4,this.cancelTurn(t,r,n,s)];case 9:_state.sent();return[2];case 10:this.store.upsertSessionIndexItem(t,Xd(t));return[4,this.store.persistSession(t)];case 11:_state.sent(),this.store.persistMetaAndIndex(),this.notify();return[3,21];case 12:if(!!this.messageFactory.appendAgentInput(s,i.input,t,u))return[3,14];return[4,this.cancelTurn(t,r,n,s)];case 13:_state.sent();return[2];case 14:return[4,this.store.persistSession(t)];case 15:_state.sent(),this.notify();return[3,21];case 16:return[4,this.messageOps.beginRegeneration(t,i.targetMessageId,u)];case 17:if(!(p=_state.sent(),!p))return[3,20];if(!!u())return[3,19];return[4,this.cancelTurn(t,r,n,s)];case 18:_state.sent();return[2];case 19:throw new Error("Regeneration target is no longer available");case 20:this.notify();return[3,21];case 21:if(!!u())return[3,23];return[4,this.cancelTurn(t,r,n,s,p)];case 22:_state.sent();return[2];case 23:_$g=this.selection.getProviderOrThrow(t),x=this.selection.getModelOrThrow(_$g,t),v={providerId:_$g.id,providerName:_$g.name,modelId:x.id,modelName:x.name};h=v;return[4,UP({compactionCoordinator:this.compactionCoordinator,createCompactionRequest:function(){return _this.createCompactionRequest(t,s,_$g,x,u)},isTurnAlive:u,onStateChange:function(_){_==="compacting"&&(r.runState="compressing"),_==="running-turn"&&(r.runState="thinking"),_this.notify()},runTurn:function(_,b){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.ensureProviderReady(_$g)];case 1:if(_state.sent(),!u())throw Ds("Agent loop cancelled");return[2,this.agentRunner.runTurn({session:t,agent:s,provider:_$g,model:x,depth:0,assistantMeta:v,runtime:r,isTurnAlive:u,taskOrigin:l,continuation:_,abortSignal:o.signal,buildMessages:function(w,S){return _this.buildMessagesForAgent(w,S)},shouldSuspendAfterToolStep:b})]}})}).call(_this)}})];case 24:y=_state.sent();if(!(!u()||y.status==="cancelled"))return[3,26];return[4,this.cancelTurn(t,r,n,s,p)];case 25:_state.sent();return[2];case 26:if(!(y.status==="failed"))return[3,28];return[4,this.failTurn(t,r,n,s,this.agentLoopErrorMessage(y.error),p,h)];case 27:_state.sent();return[2];case 28:_tmp=p;if(!_tmp)return[3,30];this.messageOps.commitRegeneration(t,p),m=!0;return[4,this.store.persistSession(t)];case 29:_tmp=(_state.sent(),!u());_state.label=30;case 30:if(!_tmp)return[3,32];return[4,this.cancelTurn(t,r,n,s,p,m)];case 31:_state.sent();return[2];case 32:if(this.compactionCoordinator.cancel(t.id,s.id),!TI(r,a,o.signal))return[2];return[3,38];case 33:g=_state.sent();if(!c())return[2];if(!!u())return[3,35];return[4,this.cancelTurn(t,r,n,s,p,m)];case 34:_state.sent();return[2];case 35:return[4,this.failTurn(t,r,n,s,Zu(g,P.t("chatbox.requestFailed")),p,h)];case 36:_state.sent();return[3,38];case 37:this.compactionCoordinator.cancel(t.id,s.id),r.runState="idle",this.state.deletedSessionIds.has(t.id)||this.notify();return[7];case 38:return[2]}})}).call(this)}},{key:"cancelTurn",value:function cancelTurn(_01,_11,_21,_31,_41){return _async_to_generator(function(t,r,n,i,o){var a,_tmp;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:a=_arguments.length>5&&_arguments[5]!==void 0?_arguments[5]:!1;if(this.state.loadedSessions.get(t.id)!==t){yB(r,n.turn.turnId,n.abortController.signal);return[2]}this.cancelExecutionTree(t,n,"Turn cancelled",i.id),o?(i.timeline.length>o.prefixLength&&this.messageFactory.removeIncompleteToolCalls(i),a||(i.timeline.length>o.prefixLength?this.messageOps.commitRegeneration(t,o):this.messageOps.rollbackRegeneration(t,o))):this.messageFactory.removeIncompleteToolCalls(i);_state.label=1;case 1:_state.trys.push([1,,5,6]);_tmp=o;if(!_tmp)return[3,3];return[4,this.store.persistMetaAndIndex()];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[4,this.store.persistSession(t)];case 4:_state.sent();return[3,6];case 5:yB(r,n.turn.turnId,n.abortController.signal);return[7];case 6:return[2]}})}).apply(this,arguments)}},{key:"failTurn",value:function failTurn(t,r,n,i,o,a,s){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.state.loadedSessions.get(t.id)!==t){xB(r,n.turn.turnId,n.abortController.signal);return[2]}this.cancelExecutionTree(t,n,"Turn failed",i.id),a?(this.messageOps.rollbackRegeneration(t,a),this.reportTransientError(o)):(this.messageFactory.removeIncompleteToolCalls(i),this.messageFactory.reportFatalError(t,o,s,i));_state.label=1;case 1:_state.trys.push([1,,5,6]);_tmp=a;if(!_tmp)return[3,3];return[4,this.store.persistMetaAndIndex()];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[4,this.store.persistSession(t)];case 4:_state.sent();return[3,6];case 5:xB(r,n.turn.turnId,n.abortController.signal);return[7];case 6:return[2]}})}).call(this)}},{key:"agentLoopErrorMessage",value:function agentLoopErrorMessage(t){return t.type!=="turn-failed"?P.t("chatbox.errors.contextCompressionFailed"):Zu(t.cause,P.t("chatbox.requestFailed"))}},{key:"createCompactionRequest",value:function createCompactionRequest(t,r,n,i,o){var _this=this;var a=x1(t,n,i);return{session:t,agent:r,provider:n,model:i,revision:a,ensureProviderReady:function(){return _this.ensureProviderReady(n)},resolveSummaryContext:function(){return _this.agentRunner.resolveSummaryContext(r,t,i)},buildMessages:function(s,l){return _this.buildMessagesForAgent(r,l,s)},isCancelled:function(){return!o()},isCurrent:function(){var s,l;return o()&&((s=t.model)==null?void 0:s.providerId)===n.id&&((l=t.model)==null?void 0:l.modelId)===i.id&&x1(t,n,i)===a}}}},{key:"cancelExecutionTree",value:function cancelExecutionTree(t,r,n,i){this.compactionCoordinator.cancel(t.id,i),r.abortController.signal.aborted||r.abortController.abort(Ds(n)),this.discardAgentInputsForOrigin(t.id,r.turn.turnId),this.subagentCancellation.cancelAllNonTerminalAgents(t,r.turn.turnId)&&(this.store.persistSession(t),this.notify(),this.subagentCancellation.startQueuedAgentsForSession(t))}},{key:"buildMessagesForAgent",value:function buildMessagesForAgent(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,jT(t,r,this.userContextManager,n)]})}).call(this)}}]);return BP1}();function y1(e,t){if(e.id===t)return e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(e.subagents)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=y1(r,t);if(n)return n}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function qP(e,t){if(e.subagents[t])return e;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(e.subagents)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;var n=qP(r,t);if(n)return n}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function $Ee(e,t){var n;function r(i,o){if(i.id===t)return o;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(i.subagents)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var a=_step.value;var s=r(a,o+1);if(s!==void 0)return s}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}return(n=r(e,0))!=null?n:0}var KG=require("obsidian"),WP=nr(ln(),1);function NEe(){return(0,KG.normalizePath)(sj)}function DEe(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,e.vault.adapter.exists(QG(t))]})})()}function QG(e){var t=WP.posix.normalize(e);if(t!==ba&&!t.startsWith("".concat(ba,"/")))throw new Error("Path must be inside ".concat(ba,": ").concat(e));var r=t.slice(ba.length+1);return(0,KG.normalizePath)(r?"".concat(NEe(),"/").concat(r):NEe())}function v1(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=QG(t);return[4,Ja(e.vault,WP.posix.dirname(n))];case 1:_state.sent();return[4,e.vault.adapter.write(n,r)];case 2:_state.sent();return[2]}})})()}function JG(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=QG(t);return[4,Ja(e.vault,WP.posix.dirname(n))];case 1:_state.sent();return[4,e.vault.adapter.writeBinary(n,Uint8Array.from(r).buffer)];case 2:_state.sent();return[2]}})})()}var VP=/*#__PURE__*/function(){"use strict";function VP1(t,r,n,i,o,a,s,l,c,d){_class_call_check(this,VP1);this.app=t;this.ensureProviderReady=r;this.state=n;this.selection=i;this.store=o;this.notify=a;this.toolExecutor=s;this.messageFactory=l;this.agentRunner=c;A(this,"enqueueMasterAgentInput",function(){return!1});A(this,"taskOrigins",new Map);A(this,"compactionCoordinator");this.compactionCoordinator=d!=null?d:new b_(this.store,this.messageFactory)}_create_class(VP1,[{key:"setMasterAgentInputHandler",value:function setMasterAgentInputHandler(t){this.enqueueMasterAgentInput=t}},{key:"runAgent",value:function runAgent(t,r,n){return _async_to_generator(function(){var _this,o,i,_$a,s,l,c,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!this.isAgentExecutionAlive(t,r,n))return[2];i=r.model;if(!(!(i!=null&&i.providerId)||!i.modelId))return[3,2];return[4,this.finishAgentAsFailed(t,r,P.t("chatbox.errors.taskSessionUnavailable"),n)];case 1:_state.sent();return[2];case 2:r.status="running",(o=r.startedAt)!=null||(r.startedAt=Date.now());_state.label=3;case 3:_state.trys.push([3,11,,13]);_$a=this.selection.getProviderByIdOrThrow(i.providerId);return[4,this.ensureProviderReady(_$a)];case 4:_state.sent();s=this.selection.getModelByIdsOrThrow(_$a,i.modelId),l=function(){return _this.isAgentExecutionAlive(t,r,n)};return[4,UP({compactionCoordinator:this.compactionCoordinator,createCompactionRequest:function(){return Kfe(r),_this.createCompactionRequest(t,r,_$a,s,l)},isTurnAlive:l,runTurn:function(d,u){return _this.agentRunner.runTurn({session:t,agent:r,provider:_$a,model:s,depth:$Ee(Yo(t),r.id),assistantMeta:{providerId:_$a.id,providerName:_$a.name,modelId:s.id,modelName:s.name},isTurnAlive:l,continuation:d,taskOrigin:n,abortSignal:n.signal,shouldSuspendAfterToolStep:u})}})];case 5:c=_state.sent();if(!(c.status==="cancelled"))return[3,7];return[4,this.finishAgentAsCancelled(t,r,n)];case 6:_state.sent();return[2];case 7:if(!(c.status==="failed"))return[3,9];return[4,this.finishAgentAsFailed(t,r,this.agentLoopErrorMessage(c.error),n)];case 8:_state.sent();return[2];case 9:if(r.pendingInputs.length>0){this.persistCurrentSession(t),this.runAgent(t,r,n);return[2]}if(this.hasActiveChildAgents(r)){r.status="idle",this.persistCurrentSession(t),this.notify();return[2]}return[4,this.finishAgentAsCompleted(t,r,c.text,n)];case 10:_state.sent();return[3,13];case 11:a=_state.sent();return[4,this.finishAgentAsFailed(t,r,Zu(a,P.t("chatbox.requestFailed")),n)];case 12:_state.sent();return[3,13];case 13:return[2]}})}).call(this)}},{key:"agentLoopErrorMessage",value:function agentLoopErrorMessage(t){return t.type!=="turn-failed"?P.t("chatbox.errors.contextCompressionFailed"):Zu(t.cause,P.t("chatbox.requestFailed"))}},{key:"createCompactionRequest",value:function createCompactionRequest(t,r,n,i,o){var _this=this;var a=r.model,s=a==null?void 0:a.providerId,l=a==null?void 0:a.modelId,c=x1(t,n,i);return{session:t,agent:r,provider:n,model:i,revision:c,ensureProviderReady:function(){return _this.ensureProviderReady(n)},resolveSummaryContext:function(){return _this.agentRunner.resolveSummaryContext(r,t,i)},isCancelled:function(){return!o()},isCurrent:function(){var d=r.model;return o()&&(d==null?void 0:d.providerId)===s&&(d==null?void 0:d.modelId)===l&&x1(t,n,i)===c}}}},{key:"dispatchTask",value:function dispatchTask(t,r){return _async_to_generator(function(){var n,i,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.state.loadedSessions.get(t.sessionId);if(!n)throw new Error(P.t("chatbox.errors.sessionNotFound"));i=y1(Yo(n),t.callerAgentId);if(!i)throw new Error("Caller agent not found: ".concat(t.callerAgentId));if(Vl(i))throw new Error("Caller agent is no longer active");if(r.signal.aborted)throw Ds("Task origin cancelled");o=this.toolExecutor.getAgentDefinition(t.subagentType);if(!o.dispatchable)throw new Error(P.t("chatbox.errors.agentNotDispatchable",{agentType:t.subagentType}));a=this.resolveSubagentModelSelection(this.toolExecutor.getSubagentModelSelection(o.id),n.model),s=this.countRunningAgentsForSession(n)>=dj,l=Date.now();return[4,this.createAgentId(n,o.id)];case 1:c=_state.sent();if(Vl(i)||r.signal.aborted)throw Ds("Task origin cancelled");d={id:c,type:o.id,model:a,status:s?"queued":"running",createdAt:l,startedAt:s?void 0:l,timeline:[{id:Is("message"),role:"user",metadata:{createdAt:l},parts:[{type:"text",text:t.prompt}]}],pendingInputs:[],operations:{},toolTimings:{},subagents:{}};return[2,(i.subagents[d.id]=d,this.taskOrigins.set(this.originKey(n.id,d.id),r),this.persistCurrentSession(n),this.notify(),s?this.startQueuedAgentsForSession(n):this.runAgent(n,d,r),{taskId:d.id,subagentType:o.id,status:"dispatched"})]}})}).call(this)}},{key:"createAgentId",value:function createAgentId(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,Lv(r,function(n){return Boolean(y1(Yo(t),n))})]})})()}},{key:"resolveSubagentModelSelection",value:function resolveSubagentModelSelection(t,r){if(!t)return r?_object_spread({},r):void 0;try{var n=this.selection.getProviderByIdOrThrow(t.providerId);return this.selection.getModelByIdsOrThrow(n,t.modelId),_object_spread({},t)}catch(n){return r?_object_spread({},r):void 0}}},{key:"originKey",value:function originKey(t,r){return"".concat(t,":").concat(r)}},{key:"isCurrentSession",value:function isCurrentSession(t){return this.state.loadedSessions.get(t.id)===t&&!this.state.deletedSessionIds.has(t.id)}},{key:"isOriginAlive",value:function isOriginAlive(t){return!t.signal.aborted}},{key:"isAgentExecutionAlive",value:function isAgentExecutionAlive(t,r,n){return this.isCurrentSession(t)&&this.isOriginAlive(n)&&!Vl(r)}},{key:"persistCurrentSession",value:function persistCurrentSession(t){var _this=this;return this.store.persistSession(t,function(){return _this.isCurrentSession(t)})}},{key:"stageParentContinuation",value:function stageParentContinuation(t,r,n,i){return _async_to_generator(function(){var o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=Yo(t);zT(o);a=qP(o,r.id);if(!a)throw new Error("Task parent is unavailable");s=this.createTaskResultInput(r.id,n);if(!this.isCurrentSession(t)||!this.isOriginAlive(i))return[2,!1];if(a.id===wa){if(!this.enqueueMasterAgentInput(t.id,s,i))throw new Error("Unable to stage master task continuation");return[2,!0]}if(Vl(a))return[2,!1];a.pendingInputs.push(s);_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.persistCurrentSession(t)];case 2:_state.sent();return[3,4];case 3:l=_state.sent();throw this.removePendingInput(a,s),l;case 4:return[2,!this.isCurrentSession(t)||!this.isOriginAlive(i)||Vl(a)?(this.removePendingInput(a,s),!1):(this.wakeSubagent(t,a.id),!0)]}})}).call(this)}},{key:"restoreMasterTaskContinuations",value:function restoreMasterTaskContinuations(t){if(!this.isCurrentSession(t))return;var r=Yo(t);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Fd(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(!Vl(n)||!n.resultPath||this.hasTaskResultNotification(r,n.id))continue;var i=qP(r,n.id);if(!i||i.id!==wa&&(!Vl(i)||this.hasTaskResultNotification(i,n.id)))continue;var o={turnId:Is("turn"),signal:new AbortController().signal};if(!this.enqueueMasterAgentInput(t.id,this.createTaskResultInput(n.id,n.resultPath),o))throw new Error("Unable to restore master task continuation")}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"createTaskResultInput",value:function createTaskResultInput(t,r){return{id:Is("input"),role:"user",metadata:{createdAt:Date.now()},parts:[{type:"data-system-notification",data:{kind:"task-result-ready",taskId:t,resultPath:r}}]}}},{key:"hasTaskResultNotification",value:function hasTaskResultNotification(t,r){return t.timeline.some(function(n){return n.parts.some(function(i){return i.type==="data-system-notification"&&i.data.kind==="task-result-ready"&&i.data.taskId===r})})}},{key:"removePendingInput",value:function removePendingInput(t,r){var n=t.pendingInputs.indexOf(r);n!==-1&&t.pendingInputs.splice(n,1)}},{key:"finalizeAgentSettlement",value:function finalizeAgentSettlement(t,r){this.compactionCoordinator.cancel(t.id,r.id),this.cleanupAgentTracking(t.id,r.id),this.startQueuedAgentsForSession(t),this.notify()}},{key:"persistAgentResult",value:function persistAgentResult(t,r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:i="".concat(ba,"/").concat(t.id,"/tasks/").concat(r.id,".txt");return[4,v1(this.app,i,n)];case 1:return[2,(_state.sent(),i)]}})}).call(this)}},{key:"wakeSubagent",value:function wakeSubagent(t,r){var o;var n=y1(Yo(t),r);if(!n||n.status==="running"||Vl(n))return;var i=this.taskOrigins.get(this.originKey(t.id,n.id));if(!i)throw new Error("Subagent task origin is unavailable");n.status="running",(o=n.startedAt)!=null||(n.startedAt=Date.now()),this.persistCurrentSession(t),this.runAgent(t,n,i)}},{key:"hasActiveChildAgents",value:function hasActiveChildAgents(t){return Object.values(t.subagents).some(function(r){return!Vl(r)})}},{key:"finishAgentAsCompleted",value:function finishAgentAsCompleted(t,r,n,i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.settleAgent(t,r,n||P.t("chatbox.task.emptyResult"),"completed",i)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"finishAgentAsFailed",value:function finishAgentAsFailed(t,r,n,i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.settleAgent(t,r,n,"failed",i)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"finishAgentAsCancelled",value:function finishAgentAsCancelled(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.settleAgent(t,r,P.t("chatbox.task.cancelledSummary",{task:r.id}),"cancelled",n)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"settleAgent",value:function settleAgent(t,r,n,i,o){return _async_to_generator(function(){var a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.isAgentExecutionAlive(t,r,o)||r.status!=="running")return[2];return[4,this.persistAgentResult(t,r,n)];case 1:a=_state.sent();if(!!(!this.isAgentExecutionAlive(t,r,o)||r.status!=="running"))return[3,7];r.status=i,r.finishedAt=Date.now(),r.resultPath=a;_state.label=2;case 2:_state.trys.push([2,,6,7]);return[4,this.persistCurrentSession(t)];case 3:_state.sent();_tmp=this.isCurrentSession(t)&&this.isOriginAlive(o);if(!_tmp)return[3,5];return[4,this.stageParentContinuation(t,r,a,o)];case 4:_tmp=_state.sent();_state.label=5;case 5:_tmp;return[3,7];case 6:this.finalizeAgentSettlement(t,r);return[7];case 7:return[2]}})}).call(this)}},{key:"countRunningAgentsForSession",value:function countRunningAgentsForSession(t){return Fd(t).filter(function(r){return r.status==="running"}).length}},{key:"startQueuedAgentsForSession",value:function startQueuedAgentsForSession(t){var r;if(!this.state.deletedSessionIds.has(t.id))for(;this.countRunningAgentsForSession(t)<dj;){var n=Fd(t).filter(function(o){return o.status==="queued"}).sort(function(o,a){return o.createdAt-a.createdAt})[0];if(!n)return;var i=this.taskOrigins.get(this.originKey(t.id,n.id));if(!i)throw new Error("Subagent task origin is unavailable");n.status="running",(r=n.startedAt)!=null||(n.startedAt=Date.now()),this.persistCurrentSession(t),this.notify(),this.runAgent(t,n,i)}}},{key:"cancelAllNonTerminalAgents",value:function cancelAllNonTerminalAgents(t,r){var i;var n=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Fd(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;Vl(o)||r&&((i=this.taskOrigins.get(this.originKey(t.id,o.id)))==null?void 0:i.turnId)!==r||(o.status="cancelled",o.finishedAt=Date.now(),this.compactionCoordinator.cancel(t.id,o.id),this.cleanupAgentTracking(t.id,o.id),n=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n}},{key:"cleanupSessionAgentTracking",value:function cleanupSessionAgentTracking(t){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Fd(t)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;this.compactionCoordinator.cancel(t.id,n.id),this.cleanupAgentTracking(t.id,n.id)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var r="".concat(t.id,":");var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=this.taskOrigins[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step1.value,1),n10=_step_value[0];if(!n10.startsWith(r))continue;var i=n10.slice(r.length);this.compactionCoordinator.cancel(t.id,i),this.taskOrigins.delete(n10)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}}},{key:"cleanupAgentTracking",value:function cleanupAgentTracking(t,r){this.taskOrigins.delete(this.originKey(t,r))}}]);return VP1}();function LEe(e,t){var n;var r=t!=null?t:new Set((n=e.readVaultPaths)!=null?n:[]);return{markRead:function markRead(i){var a;if(!i)return;var o=(a=e.readVaultPaths)!=null?a:e.readVaultPaths=[];o.includes(i)||o.push(i)},hasRead:function hasRead(i){return r.has(i)},resetSnapshot:function resetSnapshot(){var i;r=new Set((i=e.readVaultPaths)!=null?i:[])}}}var GP=require("obsidian");function FEe(e){switch(e){case"copy":return P.t("aiPermission.operations.copy");case"delete":return P.t("aiPermission.operations.delete");case"edit":return P.t("aiPermission.operations.edit");case"mkdir":return P.t("aiPermission.operations.mkdir");case"move":return P.t("aiPermission.operations.move");case"read":return P.t("aiPermission.operations.read");case"write":return P.t("aiPermission.operations.write")}}var C5=/*#__PURE__*/function(_GP_Modal){"use strict";_inherits(C51,_GP_Modal);function C51(r,n,i){_class_call_check(this,C51);var _this;_this=_call_super(this,C51,[r]);_this.request=n;_this.mountTarget=i;A(_this,"result","deny");A(_this,"resolved",!1);A(_this,"resolve");A(_this,"cleanupModalMount");return _this}_create_class(C51,[{key:"renderSinglePathRequest",value:function renderSinglePathRequest(){if(this.request.type!=="fs"||!("path"in this.request.fs))return;var r=this.contentEl.createDiv({cls:"ns-38v2j5"});r.createEl("strong",{text:FEe(this.request.fs.kind)}),r.createEl("code",{cls:"ns-x5wi62",text:this.request.fs.path})}},{key:"renderDualPathRequest",value:function renderDualPathRequest(){if(this.request.type!=="fs"||!("src"in this.request.fs)||!("dest"in this.request.fs))return;var r=this.contentEl.createDiv({cls:"ns-38v2j5"});r.createEl("strong",{text:FEe(this.request.fs.kind)}),r.createDiv({cls:"ns-s5oxkd",text:P.t("aiPermission.source")}),r.createEl("code",{cls:"ns-7barj7",text:this.request.fs.src}),r.createDiv({cls:"ns-rbq4hg",text:P.t("aiPermission.destination")}),r.createEl("code",{cls:"ns-7barj7",text:this.request.fs.dest})}},{key:"renderSettingsRequest",value:function renderSettingsRequest(){if(this.request.type!=="settings")return;var r=this.contentEl.createDiv({cls:"ns-38v2j5"});r.createEl("strong",{text:P.t("aiPermission.operations.updateSettings")});var n=this.request.settings.summary;n?r.createEl("code",{cls:"ns-m5dmqi",text:n}):r.createEl("p",{cls:"ns-ts6cxp",text:P.t("aiPermission.settings.emptySummary")})}},{key:"renderPurpose",value:function renderPurpose(){if(!this.request.purpose)return;var r=this.contentEl.createDiv({cls:"ns-38v2j5"});r.createEl("strong",{text:P.t("aiPermission.purpose")}),r.createEl("p",{cls:"ns-ea9w93",text:this.request.purpose})}},{key:"onOpen",value:function onOpen(){var _this=this;this.setTitle(P.t("aiPermission.title"));var _this1=this,r=_this1.contentEl;r.empty(),this.request.sessionTitle&&r.createEl("p",{cls:"ns-zd3ouy",text:P.t("aiPermission.sessionLabel",{title:this.request.sessionTitle})}),r.createEl("p",{text:P.t("aiPermission.message")}),r.createEl("p",{text:P.t("aiPermission.sessionScopeHint")}),this.renderPurpose(),this.request.type==="settings"?this.renderSettingsRequest():this.request.fs.kind==="copy"||this.request.fs.kind==="move"?this.renderDualPathRequest():this.renderSinglePathRequest(),new GP.Setting(r).addButton(function(n){n.buttonEl.addClass("mod-warning"),n.setButtonText(P.t("aiPermission.deny")).onClick(function(){_this.result="deny",_this.close()})}).addButton(function(n){return n.setButtonText(P.t("aiPermission.allowOnce")).onClick(function(){_this.result="approve",_this.close()})}).addButton(function(n){return n.setButtonText(P.t("aiPermission.alwaysAllow")).setCta().onClick(function(){_this.result="auto-approve-operation",_this.close()})})}},{key:"onClose",value:function onClose(){var n;(n=this.cleanupModalMount)==null||n.call(this),this.cleanupModalMount=void 0;var _this=this,r=_this.contentEl;r.empty(),this.resolved||(this.resolved=!0,this.resolve(this.result))}},{key:"openAndWait",value:function openAndWait(){var _this=this;return new Promise(function(r){_this.resolve=r,_get(_get_prototype_of(C51.prototype),"open",_this).call(_this),_this.cleanupModalMount=zd(_this,_this.mountTarget)})}}]);return C51}(GP.Modal);function HP(e,t){if(e)return function(r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,e(_object_spread_props(_object_spread({},r),{purpose:t}))]})})()}}function _Ct(e){return e.type==="fs"&&(e.fs.kind==="copy"||e.fs.kind==="move")}function bCt(e){return e.type==="settings"?"settings:".concat(e.settings.action):e.fs.kind}function zEe(e){if(e.type==="settings")return e.settings.summary;var _e_fs=e.fs,t=_e_fs.kind;return _Ct(e)?"".concat(t," from ").concat(e.fs.src," to ").concat(e.fs.dest):"".concat(t," on ").concat(e.fs.path)}function jEe(e,t,r){return function(n){return _async_to_generator(function(){var i,o,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=bCt(n);if(t!=null&&t.has(i))return[2];o=new C5(e,_object_spread_props(_object_spread({},n),{sessionTitle:r==null?void 0:r.sessionTitle}),r==null?void 0:r.modalMountTarget);if(!(typeof o.openAndWait=="function"))return[3,2];return[4,o.openAndWait()];case 1:_tmp=_state.sent();return[3,4];case 2:return[4,o.open()];case 3:_tmp=_state.sent();_state.label=4;case 4:a=_tmp;if(a==="deny")throw new Error(P.t("aiPermission.denied",{summary:zEe(n)}));a==="auto-approve-operation"&&(t==null||t.add(i));return[2]}})})()}}function UEe(){return function(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){throw new Error(P.t("aiPermission.readonly",{summary:zEe(e)}))})})()}}function BEe(){return function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2]})})()}}var XG=nr(ln(),1);var T5=nr(ln(),1),qEe=new Date(1980,0,1),wCt=new Date(2099,11,31,23,59,58);function VEe(e){var _String;var r="";for(var n=0;n<e.length;n+=32768)r+=(_String=String).fromCharCode.apply(_String,_to_consumable_array(e.subarray(n,Math.min(n+32768,e.length))));return r}function YG(e){var t=new Uint8Array(e.length);for(var r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function SCt(e){return new TextDecoder().decode(YG(e))}function WEe(e){var t=e.getTime();return Number.isFinite(t)?new Date(Math.min(Math.max(t,qEe.getTime()),wCt.getTime())):qEe}function sc(e,t){return{stdout:"",stderr:"".concat(e,": ").concat(t,"\n"),exitCode:1}}function E5(e){return e==="zip"?{stdout:"usage: zip [-0-9jrq@] archive[.zip] file ... [-x pattern ...]\n",stderr:"",exitCode:0}:{stdout:"usage: unzip [-lptvnoq] archive[.zip] [member ...] [-x pattern ...] [-d directory]\n",stderr:"",exitCode:0}}function kCt(e){var t={excludes:[],inputs:[],junkPaths:!1,level:6,quiet:!1,readInputsFromStdin:!1,recursive:!1},r=!0;for(var n=0;n<e.length;n++){var i=e[n];if(r&&i==="--"){r=!1;continue}if(r&&(i==="-h"||i==="--help"))return E5("zip");if(r&&i==="-x"){var _t_excludes;(_t_excludes=t.excludes).push.apply(_t_excludes,_to_consumable_array(e.slice(n+1)));break}if(r&&i==="-@"){t.readInputsFromStdin=!0;continue}if(r&&i.startsWith("-")&&i!=="-"){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.slice(1)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(o==="r")t.recursive=!0;else if(o==="j")t.junkPaths=!0;else if(o==="q")t.quiet=!0;else if(/^[0-9]$/.test(o))t.level=Number(o);else return sc("zip","unsupported option -".concat(o))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}continue}t.archive?t.inputs.push(i):t.archive=i}return t.archive||(t.archive="-",t.inputs.push("-")),t.archive==="-"&&t.inputs.length===0&&t.inputs.push("-"),t}function CCt(e){var t={excludes:[],list:!1,memberPatterns:[],neverOverwrite:!1,overwrite:!1,pipe:!1,quiet:!1,test:!1,verbose:!1},r=!0;for(var n=0;n<e.length;n++){var i=e[n];if(r&&i==="--"){r=!1;continue}if(r&&(i==="-h"||i==="--help"))return E5("unzip");if(r&&i==="-x"){var _t_excludes;(_t_excludes=t.excludes).push.apply(_t_excludes,_to_consumable_array(e.slice(n+1)));break}if(r&&(i==="-d"||i.startsWith("-d"))){var o=i==="-d"?e[++n]:i.slice(2);if(!o)return sc("unzip","option -d requires a directory");t.destination=o;continue}if(r&&i.startsWith("-")&&i!=="-"){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=i.slice(1)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o10=_step.value;if(o10==="l")t.list=!0;else if(o10==="v")t.verbose=!0;else if(o10==="p"||o10==="c")t.pipe=!0;else if(o10==="t")t.test=!0;else if(o10==="n")t.neverOverwrite=!0;else if(o10==="o")t.overwrite=!0;else if(o10==="q")t.quiet=!0;else return sc("unzip","unsupported option -".concat(o10))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}continue}t.archive?t.memberPatterns.push(i):t.archive=i}return t.archive?t.neverOverwrite&&t.overwrite?sc("unzip","options -n and -o cannot be used together"):t:E5("unzip")}function ZP(e,t){var r="^";for(var n=0;n<t.length;n++){var i=t[n];if(i==="*")r+=".*";else if(i==="?")r+=".";else if(i==="["){var o=t.indexOf("]",n+1);if(o===-1)r+="\\[";else{var a=t.slice(n+1,o);r+="[".concat(a.startsWith("!")?"^".concat(a.slice(1)):a,"]"),n=o}}else r+=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&")}return new RegExp("".concat(r,"$")).test(e)}function ECt(e,t,r){return(t.length===0||t.some(function(n){return ZP(e,n)}))&&!r.some(function(n){return ZP(e,n)})}function GEe(e,t){if(t==="-")return"-";var r=e.fs.resolvePath(e.cwd,t);return T5.posix.extname(r)?r:"".concat(r,".zip")}function TCt(e,t){var r=T5.posix.relative(e,t);return r&&!r.startsWith("../")&&r!==".."?r:t.replace(/^\/+/,"")}function ACt(e,t){var r=t.split("/");if(t.startsWith("/")||t.includes("\\")||r.some(function(i,o){return i===".."||i===""&&o!==r.length-1}))throw new Error("unsafe archive entry: ".concat(t));var n=T5.posix.resolve(e,t);if(n!==e&&!n.startsWith("".concat(e,"/")))throw new Error("unsafe archive entry: ".concat(t));return n}function ICt(e,t){var r=1980+(e>>9),n=e>>5&15,i=e&31,o=t>>11,a=t>>5&63,s=(t&31)*2;return new Date(r,Math.max(0,n-1),Math.max(1,i),o,a,s)}function PCt(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=Math.max(0,e.length-65558),n=-1;for(var l=e.length-22;l>=r;l--)if(t.getUint32(l,!0)===0x6054b50){n=l;break}if(n===-1)throw new Error("End-of-central-directory signature not found");var i=t.getUint16(n+10,!0),o=t.getUint32(n+16,!0);if(i===65535||o===0xffffffff)throw new Error("Zip64 archives are not supported");var a=[],s=o;for(var l10=0;l10<i;l10++){if(s+46>e.length||t.getUint32(s,!0)!==0x2014b50)throw new Error("Invalid central directory entry");var c=t.getUint32(s+20,!0),d=t.getUint32(s+24,!0),u=t.getUint16(s+28,!0),p=t.getUint16(s+30,!0),m=t.getUint16(s+32,!0),h=s+46+u+p+m;if(h>e.length)throw new Error("Invalid central directory entry length");var g=new TextDecoder().decode(e.subarray(s+46,s+46+u));a.push({compressedSize:c,compression:t.getUint16(s+10,!0),flags:t.getUint16(s+8,!0),mtime:ICt(t.getUint16(s+14,!0),t.getUint16(s+12,!0)),name:g,uncompressedSize:d}),s=h}return a}function HEe(e,t,r,n,i,o){return _async_to_generator(function(){var a,l,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l10,c,d,err,s,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(t===o)return[2];return[4,e.fs.stat(t)];case 1:a=_state.sent();if(!a.isDirectory)return[3,11];if(!n.junkPaths&&r){l=r.endsWith("/")?r:"".concat(r,"/");n.excludes.some(function(c){return ZP(l,c)})||(i[l]=[new Uint8Array,{mtime:WEe(a.mtime)}])}if(!n.recursive)return[2];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,8,9,10]);return[4,e.fs.readdir(t)];case 3:_iterator=_state.sent()[Symbol.iterator]();_state.label=4;case 4:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,7];l10=_step.value;c=e.fs.resolvePath(t,l10),d=r?"".concat(r,"/").concat(l10):l10;return[4,HEe(e,c,d,n,i,o)];case 5:_state.sent();_state.label=6;case 6:_iteratorNormalCompletion=true;return[3,4];case 7:return[3,10];case 8:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,10];case 9:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 10:return[2];case 11:s=n.junkPaths?T5.posix.basename(r):r;_tmp=!s||n.excludes.some(function(l){return ZP(s,l)});if(_tmp)return[3,13];return[4,e.fs.readFileBuffer(t)];case 12:_tmp=i[s]=[_state.sent(),{mtime:WEe(a.mtime)}];_state.label=13;case 13:_tmp;return[2]}})})()}function RCt(e,t){return _async_to_generator(function(){var r,n,_a1,_$i,o,_tmp,_tmp1,_,_tmp2,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,err,s,_tmp3,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=kCt(e);if("exitCode"in r)return[2,r];n=r.archive;if(!n)return[2,E5("zip")];_state.label=1;case 1:_state.trys.push([1,17,,18]);_$i=GEe(t,n),o={};_tmp1=_$i!=="-";if(!_tmp1)return[3,3];return[4,t.fs.exists(_$i)];case 2:_tmp1=_state.sent();_state.label=3;case 3:_tmp=_tmp1;if(!_tmp)return[3,5];_=Object.assign;_tmp2=[o];return[4,t.fs.readFileBuffer(_$i)];case 4:_tmp=_.apply(Object,_tmp2.concat([Pj.apply(void 0,[_state.sent()])]));_state.label=5;case 5:_tmp;a=_to_consumable_array(r.inputs);if(r.readInputsFromStdin&&(_a1=a).push.apply(_a1,_to_consumable_array(SCt(t.stdin).split(/\r?\n/).filter(Boolean))),a.length===0)return[2,sc("zip","Nothing to do!")];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=6;case 6:_state.trys.push([6,11,12,13]);_iterator=a[Symbol.iterator]();_state.label=7;case 7:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];l=_step.value;if(l==="-"){o["-"]=YG(t.stdin);return[3,9]}c=t.fs.resolvePath(t.cwd,l);return[4,HEe(t,c,TCt(t.cwd,c),r,o,_$i)];case 8:_state.sent();_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,7];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:if(Object.keys(o).length===0)return[2,sc("zip","Nothing to do!")];s=Eme(o,{level:r.level});if(!(_$i==="-"))return[3,14];_tmp3={stdout:VEe(s),stderr:"",exitCode:0,stdoutKind:"bytes"};return[3,16];case 14:return[4,t.fs.writeFile(_$i,s)];case 15:_tmp3=(_state.sent(),{stdout:r.quiet?"":Object.keys(o).sort().map(function(l){return" adding: ".concat(l," (deflated 0%)\n")}).join(""),stderr:"",exitCode:0});_state.label=16;case 16:return[2,_tmp3];case 17:i=_state.sent();return[2,sc("zip",_instanceof(i,Error)?i.message:String(i))];case 18:return[2]}})})()}function MCt(e,t,r){var n=["Archive: ".concat(e),r?" Length Method Size Name":" Length Name"],i=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var o=_step.value;i+=o.uncompressedSize,n.push(r?"".concat(String(o.uncompressedSize).padStart(8)," ").concat(o.compression===0?"Stored ":"Defl:N"," ").concat(String(o.compressedSize).padStart(8)," ").concat(o.name):"".concat(String(o.uncompressedSize).padStart(8)," ").concat(o.name))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return n.push("--------- -------"),n.push("".concat(String(i).padStart(8)," ").concat(t.length," files")),"".concat(n.join("\n"),"\n")}function OCt(e){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var t=_step.value;if(t.flags&1)throw new Error("encrypted entry is not supported: ".concat(t.name));if(t.compression!==0&&t.compression!==8)throw new Error("unsupported compression method for ".concat(t.name))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}function $Ct(e,t){return _async_to_generator(function(){var i,o,a,r,n,_$s,l,d,_tmp,u,p,m,h,g,x,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,y,_,_tmp1,err,v,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value1,y10,_10,_tmp2,b,err,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=CCt(e);if("exitCode"in r)return[2,r];n=r.archive;if(!n)return[2,E5("unzip")];_state.label=1;case 1:_state.trys.push([1,27,,28]);_$s=GEe(t,n);if(!(_$s==="-"))return[3,2];_tmp=YG(t.stdin);return[3,4];case 2:return[4,t.fs.readFileBuffer(_$s)];case 3:_tmp=_state.sent();_state.label=4;case 4:l=_tmp,d=PCt(l).filter(function(y){return ECt(y.name,r.memberPatterns,r.excludes)});if(d.length===0)return[2,sc("unzip","caution: filename not matched")];if(r.list||r.verbose)return[2,{stdout:MCt(n,d,r.verbose),stderr:"",exitCode:0}];OCt(d);u=(o=(i=t.limits)==null?void 0:i.maxOutputSize)!=null?o:0,p=d.reduce(function(y,_){return y+_.uncompressedSize},0);if(u>0&&p>u)return[2,sc("unzip","decompressed data exceeds limit (".concat(u," bytes)"))];m=new Set(d.map(function(y){return y.name})),h=Pj(l,{filter:function(y){return m.has(y.name)}});if(r.test)return[2,{stdout:r.quiet?"":"".concat(d.map(function(y){return" testing: ".concat(y.name," OK")}).join("\n"),"\nNo errors detected in compressed data.\n"),stderr:"",exitCode:0}];if(r.pipe)return[2,{stdout:d.filter(function(_){return!_.name.endsWith("/")}).map(function(_){return h[_.name]}).filter(function(_){return _!==void 0}).map(VEe).join(""),stderr:"",exitCode:0,stdoutKind:"bytes"}];g=t.fs.resolvePath(t.cwd,(a=r.destination)!=null?a:"."),x=d.map(function(y){return{entry:y,target:ACt(g,y.name)}});if(!(!r.overwrite&&!r.neverOverwrite))return[3,13];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=5;case 5:_state.trys.push([5,11,12,13]);_iterator=x[Symbol.iterator]();_state.label=6;case 6:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,10];_step_value=_step.value,y=_step_value.entry,_=_step_value.target;_tmp1=!y.name.endsWith("/");if(!_tmp1)return[3,8];return[4,t.fs.exists(_)];case 7:_tmp1=_state.sent();_state.label=8;case 8:if(_tmp1)return[2,sc("unzip","replace ".concat(_,"? Use -o to overwrite or -n to skip existing files"))];_state.label=9;case 9:_iteratorNormalCompletion=true;return[3,6];case 10:return[3,13];case 11:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,13];case 12:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 13:v=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=14;case 14:_state.trys.push([14,24,25,26]);_iterator1=x[Symbol.iterator]();_state.label=15;case 15:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,23];_step_value1=_step1.value,y10=_step_value1.entry,_10=_step_value1.target;if(!y10.name.endsWith("/"))return[3,17];return[4,t.fs.mkdir(_10,{recursive:!0})];case 16:_state.sent();return[3,22];case 17:_tmp2=r.neverOverwrite;if(!_tmp2)return[3,19];return[4,t.fs.exists(_10)];case 18:_tmp2=_state.sent();_state.label=19;case 19:if(_tmp2){r.quiet||v.push(" skipping: ".concat(y10.name));return[3,22]}b=h[y10.name];if(!b)return[2,sc("unzip","missing archive entry: ".concat(y10.name))];return[4,t.fs.writeFile(_10,b)];case 20:_state.sent();return[4,t.fs.utimes(_10,y10.mtime,y10.mtime)];case 21:_state.sent(),r.quiet||v.push(" extracting: ".concat(y10.name));_state.label=22;case 22:_iteratorNormalCompletion1=true;return[3,15];case 23:return[3,26];case 24:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,26];case 25:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 26:return[2,{stdout:v.length?"".concat(v.join("\n"),"\n"):"",stderr:"",exitCode:0}];case 27:s=_state.sent();return[2,sc("unzip",_instanceof(s,Error)?s.message:String(s))];case 28:return[2]}})})()}var ZEe=[LV("zip",RCt),LV("unzip",$Ct)];function NCt(e,t,r,n,i,o){return _async_to_generator(function(){var a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Gh(e,{permissionGuard:t,recorder:r,onRead:n,getSettingsSnapshot:i==null?void 0:i.getSettingsSnapshot,updateSettings:i==null?void 0:i.updateSettings,fileSystemManager:o})];case 1:a=_state.sent();return[2,new _7e({fs:a,cwd:ra,customCommands:ZEe})]}})})()}function KEe(_01,_11){return _async_to_generator(function(e,t){var r,a,n,_tmp,_tmp1,_tmp2;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{};n=new y_;_tmp=[{}];return[4,NCt(e,r.permissionGuard,n,r.onRead,{getSettingsSnapshot:r.getSettingsSnapshot,updateSettings:r.updateSettings},r.fileSystemManager)];case 1:return[4,_state.sent().exec(t,{cwd:(a=r.cwd)!=null?a:ra,stdin:r.stdin,rawScript:r.rawScript})];case 2:_tmp1=[_object_spread.apply(void 0,_tmp.concat([_state.sent()]))];_tmp2={};return[4,n.getNetOperations()];case 3:return[2,_object_spread_props.apply(void 0,_tmp1.concat([(_tmp2.reversibleOps=_state.sent(),_tmp2)]))]}})}).apply(this,arguments)}var w_=he.custom(),KP=he.optional(he.custom()),QP=he.custom(),QEe=he.string(),S_=he.optional(he.custom()),Zh=he.optional(he.custom()),JEe=he.optional(he.custom()),JP=he.optional(he.custom()),YP=he.optional(he.custom()),k_=he.optional(he.custom());var Kh=function(e){return he.string({error:function(){return P.t("chatbox.errors.toolFieldRequired",{field:e})}})},YEe=function(e){return he.pipe(he.transform(function(t){if(typeof t=="boolean")return t;if(typeof t=="string"){var r=t.trim().toLowerCase();if(r==="true")return!0;if(r==="false")return!1}return t}),he.boolean(P.t("chatbox.errors.toolFieldRequired",{field:e})))};var DCt=20*1024;function LCt(e){return XG.posix.normalize(XG.posix.resolve("/",e||"/")).startsWith("/")}var XEe={description:["Execute a browser-based bash subset against a virtual filesystem where the Obsidian vault is rooted at ".concat(ra,", agent data is available at ").concat(is,", built-in Skills are read-only under ").concat(Yl,", and plugin settings are editable at ").concat(Cs,"/settings.json."),"This is not the host shell: node, python, xxd, and some command flags are unavailable.","Prefer supported commands such as ls, cat, rg, jq, sed, awk, od, gzip, gunzip, zcat, zip, unzip, mkdir, mv, cp, and rm. zip and unzip support standard store/deflate archives, but not encrypted, Zip64, or uncommon compression formats.","Wildcards expand against a snapshot index of the vault (notes and attachments, plus ".concat(is,"); other hidden dot-folders are not in that index, so globs can report no matches for files that do exist. When a glob or rg finds nothing, list the parent directory or read the explicit path directly before concluding a file is missing."),"Treat the filesystem root as the user's personal knowledge base — only write there for content the user intends to keep; use ".concat(ba," for intermediate or scratch work."),"The plugin settings file ".concat(Cs,"/settings.json is virtual and reflects live settings (whitelist only, never credentials). To change settings, write the complete file as valid JSON — prefer jq or a full-file rewrite; the plugin validates and applies it on save."),'The required "purpose" field is a very short (up to 120 characters) plain-language summary of what this command does and why it is being run, written in the same language as the user\'s request and safe for users who cannot read shell — no code, no markdown, no newlines, no shell syntax.'].join(" "),inputSchema:he.object({purpose:Kh("purpose").check(he.maxLength(120,P.t("chatbox.errors.toolFieldTooLong",{field:"purpose"}))),script:Kh("script"),cwd:he._default(he.string(),ra),stdin:he.optional(he.string()),rawScript:he._default(YEe("rawScript"),!1)}),contextSchema:he.object({app:w_,fileSystemManager:k_,permissionGuard:KP,readTracker:S_,recordMetadata:Zh,getSettingsSnapshot:JP,updateSettings:YP}),outputSchema:he.string(),execute:function(e,param){var t=param.context,r=param.toolCallId;return _async_to_generator(function(){var n,i,o,a,s,l,c,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=t.app,i=t.fileSystemManager,o=t.permissionGuard,a=t.readTracker,s=t.recordMetadata,l=t.getSettingsSnapshot,c=t.updateSettings,d=e.cwd||ra;if(!LCt(d))throw new Error("Invalid bash cwd: ".concat(d,". The cwd must be an absolute virtual path."));return[4,KEe(n,e.script,{cwd:d,stdin:e.stdin,rawScript:e.rawScript,permissionGuard:HP(o,e.purpose),onRead:a==null?void 0:a.markRead.bind(a),getSettingsSnapshot:l,updateSettings:c,fileSystemManager:i})];case 1:u=_state.sent(),p="".concat(u.stdout,"\n\n").concat(u.stderr);if(!(s==null||s(r,{reversibleOps:u.reversibleOps}),p.length>DCt))return[3,3];m="".concat(ba,"/").concat(kI({prefix:"bash",words:3}),".txt");return[4,v1(n,m,p)];case 2:return[2,(_state.sent(),"Bash output was too long to return inline (".concat(p.length," characters). The complete output was written to ").concat(m,". Use bash commands such as rg, sed, head, or tail to inspect it in smaller chunks."))];case 3:return[2,p]}})})()},toModelOutput:function(param){var e=param.output;return{type:"text",value:e}}};var tTe=require("obsidian"),C_=nr(ln(),1);function bo(e){throw new Error("Invalid patch: ".concat(e))}function XP(e,t){var r=e.slice(t.length).trim();return r||bo("missing path after ".concat(t.trim())),r}function FCt(e){var n,i;var t=e.slice(2).trim(),r=t.match(/^-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@(?:\s+(.*))?$/);return r?(i=(n=r[1])==null?void 0:n.trim())!=null?i:"":t}function zCt(e){var o;var t=e.replace(/\r\n/g,"\n").split("\n");t[0]!=="*** Begin Patch"&&bo('the first line must be "*** Begin Patch"');var r=t.length-1;for(;r>0&&t[r]==="";)r-=1;t[r]!=="*** End Patch"&&bo('the last line must be "*** End Patch"');var n=[],i=1;for(;i<r;){var a=t[i];if(a.startsWith("*** Add File: ")){var s=XP(a,"*** Add File: ");i+=1;var l=[];for(;i<r&&!t[i].startsWith("*** ");)t[i].startsWith("+")||bo('added file "'.concat(s,'" contains a line without a + prefix')),l.push(t[i].slice(1)),i+=1;n.push({kind:"add",path:s,content:l.length>0?"".concat(l.join("\n"),"\n"):""});continue}if(a.startsWith("*** Delete File: ")){n.push({kind:"delete",path:XP(a,"*** Delete File: ")}),i+=1;continue}if(a.startsWith("*** Update File: ")){var s10=XP(a,"*** Update File: ");i+=1;var l10=void 0;(o=t[i])!=null&&o.startsWith("*** Move to: ")&&(l10=XP(t[i],"*** Move to: "),i+=1);var c=[];for(;i<r&&!t[i].startsWith("*** ");){t[i].startsWith("@@")||bo('expected a @@ hunk header while updating "'.concat(s10,'"'));var d=FCt(t[i]);i+=1;var u=[],p=!1;for(;i<r&&!t[i].startsWith("@@")&&!t[i].startsWith("*** ");){var m=t[i][0],h=m===" "?"context":m==="+"?"add":m==="-"?"delete":void 0;h||bo('hunk for "'.concat(s10,'" contains a line without a space, +, or - prefix')),u.push({kind:h,text:t[i].slice(1)}),i+=1}t[i]==="*** End of File"&&(p=!0,i+=1),u.length===0&&bo('empty hunk while updating "'.concat(s10,'"')),c.push({header:d,lines:u,endOfFile:p})}c.length===0&&!l10&&bo('update for "'.concat(s10,'" has no hunks')),n.push({kind:"update",path:s10,moveTo:l10,hunks:c});continue}bo('unexpected line "'.concat(a,'"'))}return n.length===0&&bo("no file operations were provided"),n}function jCt(e){return new TextDecoder("utf-8").decode(e)}function eTe(e){var t=e.trim();t||bo("empty path");var r=C_.posix.normalize(t);if(r.startsWith("/"))return r;var n=(0,tTe.normalizePath)(C_.posix.normalize(t));return(!n||n==="."||n===".."||n.startsWith("../"))&&bo('path escapes the vault: "'.concat(e,'"')),C_.posix.resolve(ra,n)}function UCt(e){var t=C_.posix.normalize(e);return t===fh||t.startsWith("".concat(fh,"/"))?t:t.startsWith("/")?t.slice(1):t}function eH(e){var t=C_.posix.normalize(e);return t===is||t.startsWith("".concat(is,"/"))||t===fh||t.startsWith("".concat(fh,"/"))?t:t.startsWith("/")?t.slice(1):t}function BCt(e,t,r,n){var _loop=function(o){t.every(function(a,s){return e[o+s]===a})&&i.push(o)};if(t.length===0)return r;var i=[];for(var o=r;o<=e.length-t.length;o+=1)_loop(o);return i.length===0&&bo('hunk context was not found in "'.concat(n,'"')),i.length>1&&bo("hunk context matched ".concat(i.length,' locations in "').concat(n,'"; include more context')),i[0]}function qCt(e,t,r){var n=e.includes("\r\n")?"\r\n":"\n",i=e.endsWith("\n"),o=e===""?[]:e.replace(/\r\n/g,"\n").split("\n").slice(0,i?-1:void 0),a=0;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{var _loop=function(){var l=_step.value;var _o1;var c=l.lines.filter(function(m){return m.kind!=="add"}).map(function(m){return m.text}),d=l.lines.filter(function(m){return m.kind!=="delete"}).map(function(m){return m.text}),u=a;if(l.header){var m=o.map(function(h,g){return{line:h,index:g}}).filter(function(h){return h.index>=a&&(h.line===l.header||h.line.includes(l.header))});m.length===0&&bo('hunk header "'.concat(l.header,'" was not found in "').concat(r,'"')),m.length>1&&bo('hunk header "'.concat(l.header,'" is not unique in "').concat(r,'"')),u=m[0].index}c.length===0&&!l.endOfFile&&!l.header&&(o.length!==0&&bo('insertion in "'.concat(r,'" needs context, a @@ header, or "*** End of File"')),u=0);var p=l.endOfFile?o.length-c.length:BCt(o,c,u,r);(p<u||!c.every(function(m,h){return o[p+h]===m}))&&bo('end-of-file hunk context was not found in "'.concat(r,'"')),(_o1=o).splice.apply(_o1,[p,c.length].concat(_to_consumable_array(d))),a=p+d.length};for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true)_loop()}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var s=o.join(n);return i&&o.length>0?"".concat(s).concat(n):s}function WCt(e){var t=new Set;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;t.has(r)&&bo('multiple operations target "'.concat(r,'"')),t.add(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var rTe={description:["Apply a file-oriented patch against the virtual filesystem.",'The required "purpose" field is a very short (up to 120 characters) plain-language summary of what this patch changes and why it is being applied, written in the same language as the user\'s request and safe for users who cannot read diffs — no code, no markdown, no newlines, no patch syntax.',"Use a vault-relative path for files in the vault (relative paths resolve from ".concat(ra,"), or an absolute virtual path for any writable mounted filesystem. For example, scratch files live under ").concat(ba,", agent data under ").concat(is,", and live plugin settings at ").concat(fh,"."),'Every patch, including one that only adds, deletes, updates, or moves a single file, MUST start with "*** Begin Patch" and end with "*** End Patch".','An Add patch has this complete form: "*** Begin Patch\\n*** Add File: notes/example.md\\n+Example line\\n+\\n+示例行 \uD83C\uDF31\\n*** End Patch".',"Every line in an Add File section, including blank lines, must start with +.",'A Delete patch has this complete form: "*** Begin Patch\\n*** Delete File: notes/example.md\\n*** End Patch".','An Update patch has this complete form: "*** Begin Patch\\n*** Update File: notes/example.md\\n@@\\n-old text\\n+new text\\n*** End Patch".','File operation headers always use the colon syntax: "*** Add File: path", "*** Delete File: path", "*** Update File: path", and "*** Move to: path".',"Update sections contain @@ hunks; unified numeric headers such as @@ -10,3 +10,4 @@ are also accepted.","Unchanged lines start with a space, removals with -, and additions with +.","Include *** Move to immediately after an Update File header only when renaming the file; its value must be the destination vault path, never a description of the edit.","Include enough unchanged context for every hunk to match exactly once.","Read existing files before updating, deleting, or moving them."].join(" "),inputSchema:he.object({purpose:Kh("purpose").check(he.maxLength(120,P.t("chatbox.errors.toolFieldTooLong",{field:"purpose"}))),patch:Kh("patch")}),contextSchema:he.object({app:w_,fileSystemManager:k_,permissionGuard:KP,readTracker:S_,recordMetadata:Zh,getSettingsSnapshot:JP,updateSettings:YP}),outputSchema:he.object({applied:he.literal(!0),files:he.array(he.string())}),execute:function(param,param1){var e=param.patch,t=param.purpose,r=param1.context,n=param1.toolCallId;return _async_to_generator(function(){var i,o,a,s,l,c,d,u,p,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,y,m,h,g,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,y10,_,b,w,_tmp,err,_iteratorNormalCompletion2,_didIteratorError2,_iteratorError2,_iterator2,_step2,y11,_tmp1,_tmp2,_tmp3,_tmp4,err,x;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=r.app,o=r.fileSystemManager,a=r.permissionGuard,s=r.readTracker,l=r.recordMetadata,c=r.getSettingsSnapshot,d=r.updateSettings,u=zCt(e),p=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=u[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){y=_step.value;p.set(y.path,eTe(y.path)),y.kind==="update"&&y.moveTo&&p.set(y.moveTo,eTe(y.moveTo))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}WCt(_to_consumable_array(p.values()));m=new y_;return[4,Gh(i,{permissionGuard:HP(a,t),recorder:m,onRead:function(y){return s==null?void 0:s.markRead(y)},getSettingsSnapshot:c,updateSettings:d,fileSystemManager:o})];case 1:h=_state.sent(),g=[];_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=2;case 2:_state.trys.push([2,12,13,14]);_iterator1=u[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,11];y10=_step1.value;_=p.get(y10.path);if(!(y10.kind==="add"))return[3,5];return[4,h.exists(_)];case 4:_state.sent()&&bo('cannot add "'.concat(y10.path,'" because it already exists')),g.push({kind:"add",path:_,content:y10.content});return[3,10];case 5:if(!(s!=null&&s.hasRead(_))&&!(s!=null&&s.hasRead(UCt(_))))throw new Error(P.t("chatbox.errors.fileNotRead",{path:y10.path}));return[4,h.exists(_)];case 6:if(!_state.sent())throw new Error(P.t("chatbox.errors.fileNotFound",{path:y10.path}));return[4,h.readFileBuffer(_)];case 7:b=jCt.apply(void 0,[_state.sent()]);if(y10.kind==="delete"){g.push({kind:"delete",path:_,before:b});return[3,10]}w=y10.moveTo?p.get(y10.moveTo):void 0;_tmp=w&&w!==_;if(!_tmp)return[3,9];return[4,h.exists(w)];case 8:_tmp=_state.sent();_state.label=9;case 9:_tmp&&bo('cannot move "'.concat(y10.path,'" to "').concat(y10.moveTo,'" because the destination exists')),g.push({kind:"update",path:_,moveTo:w,before:b,after:qCt(b,y10.hunks,y10.path)});_state.label=10;case 10:_iteratorNormalCompletion1=true;return[3,3];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 14:_iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;_state.label=15;case 15:_state.trys.push([15,29,30,31]);_iterator2=g[Symbol.iterator]();_state.label=16;case 16:if(!!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done))return[3,28];y11=_step2.value;if(!(y11.kind==="add"))return[3,18];return[4,h.writeFile(y11.path,y11.content)];case 17:_tmp1=_state.sent();return[3,26];case 18:if(!(y11.kind==="delete"))return[3,20];return[4,h.rm(y11.path)];case 19:_tmp2=_state.sent();return[3,25];case 20:_tmp3=y11.after!==y11.before;if(!_tmp3)return[3,22];return[4,h.writeFile(y11.path,y11.after)];case 21:_tmp3=_state.sent();_state.label=22;case 22:_tmp3;_tmp4=y11.moveTo&&y11.moveTo!==y11.path;if(!_tmp4)return[3,24];return[4,h.mv(y11.path,y11.moveTo)];case 23:_tmp4=_state.sent();_state.label=24;case 24:_tmp2=_tmp4;_state.label=25;case 25:_tmp1=_tmp2;_state.label=26;case 26:_tmp1;_state.label=27;case 27:_iteratorNormalCompletion2=true;return[3,16];case 28:return[3,31];case 29:err=_state.sent();_didIteratorError2=true;_iteratorError2=err;return[3,31];case 30:try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}return[7];case 31:return[4,m.getNetOperations()];case 32:x=_state.sent();return[2,(l==null||l(n,{reversibleOps:x}),{applied:!0,files:_to_consumable_array(new Set(g.flatMap(function(y){return y.kind==="update"&&y.moveTo?[eH(y.path),eH(y.moveTo)]:[eH(y.path)]})))})]}})})()},toModelOutput:function(param){var e=param.output;return{type:"text",value:"Done!\n".concat(e.files.map(function(t){return"- ".concat(t)}).join("\n"))}}};var VCt=he.enum(["pending","in_progress","completed","cancelled"]),GCt=he.enum(["high","medium","low"]),tH=he.object({content:he.string().check(he.trim(),he.minLength(1)),status:VCt,priority:he._default(GCt,"medium")});var HCt=he.object({todos:he.optional(he.array(tH))});function ZCt(e){return e.map(function(t){return{content:t.content,status:t.status,priority:t.priority}})}function KCt(e,t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,e.todos?{todos:ZCt(e.todos)}:{todos:UC(t)}]})})()}var nTe={description:["Create, update, query, and maintain a structured todo list for the current coding session.","Use it proactively when work has more than three steps, needs planning, or the user explicitly asks for task tracking.","Call without todos to query the current list.","Call with the complete current todos array to save the list.","Each todo contains only content, status, and priority.","Status values are pending, in_progress, completed, or cancelled.","Priority values are high, medium, or low.","Keep exactly one active todo in in_progress when possible, update progress in real time, and do not batch-complete multiple todos at the end."].join(" "),inputSchema:HCt,contextSchema:he.object({session:QP,recordMetadata:Zh}),outputSchema:he.object({todos:he.array(tH)}),execute:function(e,param){var t=param.context,r=param.toolCallId;return _async_to_generator(function(){var i,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,KCt(e,t.session)];case 1:n=_state.sent();return[2,((i=t.recordMetadata)==null||i.call(t,r,{todos:n.todos}),n)]}})})()},toModelOutput:function(param){var e=param.output;var t=e.todos;return t!=null&&t.length?{type:"text",value:"Todo list:\n".concat(t.map(function(r){return"- [".concat(r.status,"] ").concat(r.content," (").concat(r.priority,")")}).join("\n"))}:{type:"text",value:"The todo list is empty."}}};var iTe={description:["Update the title of the current chat session.","Call this once after the first user message to summarize the conversation topic as a concise title (at most 6 words, no surrounding quotes, no trailing punctuation).","Do not call it again unless the user explicitly asks to rename the session."].join(" "),inputSchema:he.object({title:Kh("title").check(he.maxLength(80,P.t("chatbox.errors.toolFieldTooLong",{field:"title"})))}),contextSchema:he.object({recordMetadata:Zh}),outputSchema:he.object({updated:he.literal(!0),title:he.string()}),execute:function(e,param){var t=param.context,r=param.toolCallId;return _async_to_generator(function(){var i,n;return _ts_generator(this,function(_state){n=e.title.trim();return[2,((i=t.recordMetadata)==null||i.call(t,r,{sessionTitle:n}),{updated:!0,title:n})]})})()},toModelOutput:function(param){var e=param.output;return{type:"text",value:'Session title updated to "'.concat(e.title,'".')}}};var QCt=he.object({taskId:he.string(),subagentType:he.string(),status:he.literal("dispatched")}),oTe={description:function(param){var e=param.context;var r;return["Dispatch work to a specialized subagent in an isolated context.","Available subagent types: ".concat(((r=e.dispatchableDefinitions)!=null?r:LT()).map(function(n){return"".concat(n.id,": ").concat(n.description)}).join("; "),"."),"Returns immediately with a task ID while the subagent continues asynchronously.","The subagent receives only prompt, so include all necessary context.","After dispatching, continue only with work that neither overlaps with this task nor depends on its result.","Otherwise, stop and wait for the task-result-ready system notification.","When the task settles, the notification provides the absolute result file path."].join(" ")},inputSchema:he.object({subagent_type:he.string().check(he.trim(),he.minLength(1,P.t("chatbox.errors.toolFieldRequired",{field:"subagent_type"}))),prompt:he.string().check(he.trim(),he.minLength(1,P.t("chatbox.errors.toolFieldRequired",{field:"prompt"})))}),contextSchema:he.object({session:QP,agentId:QEe,dispatchTask:he.custom(),origin:he.custom(),dispatchableDefinitions:he.optional(he.custom())}),outputSchema:QCt,toModelOutput:function(param){var e=param.output;return{type:"text",value:"Task dispatched. Task ID: ".concat(e.taskId,". Do not attempt to read the task result yet. Continue only with work that neither overlaps with this task nor depends on its result. Otherwise, stop and wait for the task-result-ready system notification. When the notification arrives, the task has completed, failed, or been cancelled; use tool to read its resultPath.")}},execute:function(e,param){var t=param.context;return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,t.dispatchTask({prompt:e.prompt,subagentType:e.subagent_type,callerAgentId:t.agentId,sessionId:t.session.id},t.origin)]})})()}};var rH=nr(ln(),1);var JCt={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",ico:"image/x-icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};function YCt(e){var r;var t=(r=e.split(".").pop())==null?void 0:r.toLowerCase();return t?JCt[t]:void 0}function aTe(e){return e.split("/").pop()||e}function XCt(e){return e.startsWith("/")&&e!=="/"}function eEt(e){return e.startsWith("/")?rH.posix.normalize(e):rH.posix.resolve("/",e)}var tEt=he.object({path:he.string(),filename:he.string(),mediaType:he.string()}),sTe={description:["View an image stored in the Obsidian vault or agent temporary directory.","Use this tool when you need to inspect an image file visually.","Input an absolute virtual image path or a path relative to ".concat(ra,", with a supported extension: avif, bmp, gif, ico, jpeg, jpg, png, svg, or webp.")].join(" "),inputSchema:he.object({path:he.string().check(he.describe("The image path in the virtual filesystem; relative paths resolve from ".concat(ra,".")),he.trim(),he.minLength(1,P.t("chatbox.errors.toolFieldRequired",{field:"path"})))}),contextSchema:he.object({app:w_,fileSystemManager:k_,readTracker:S_,viewImageAttachments:JEe}),outputSchema:tEt,execute:function(param,param1){var e=param.path,t=param1.context,r=param1.toolCallId;return _async_to_generator(function(){var s,n,i,o,a,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=eEt(e);if(!XCt(n))throw new Error("Image path must be an absolute virtual path or relative to ".concat(ra,": ").concat(e));i=YCt(n);if(!i)throw new Error("Unsupported image file type: ".concat(n));return[4,Gh(t.app,{fileSystemManager:t.fileSystemManager,onRead:(s=t.readTracker)==null?void 0:s.markRead.bind(t.readTracker)})];case 1:o=_state.sent();_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,o.readFileBuffer(n)];case 3:a=_state.sent();return[3,5];case 4:l=_state.sent();throw _instanceof(l,Error)&&l.message.includes("ENOENT")?new Error(P.t("chatbox.errors.fileNotFound",{path:e}),{cause:l}):l;case 5:if(!t.viewImageAttachments)throw new Error("View image attachments are unavailable");return[2,(t.viewImageAttachments.register(r,{type:"file",data:{type:"data",data:a},filename:aTe(n),mediaType:i}),{path:n,filename:aTe(n),mediaType:i})]}})})()},toModelOutput:function(param){var e=param.output;return{type:"text",value:"Loaded image ".concat(e.filename," from ").concat(e.path,".")}}};function lTe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _object_spread(_object_spread_props(_object_spread({},e.enableTodoWrite?{todowrite:nTe}:{}),{update_session_title:iTe,apply_patch:rTe,bash:XEe}),e.enableViewImage?{view_image:sTe}:{},e.allowSpawn!==!1?{task:oTe}:{})}var eR=/*#__PURE__*/function(){"use strict";function eR1(t,r,n,i,o,a){_class_call_check(this,eR1);this.app=t;this.getSettings=r;this.state=n;this.runtimeStates=i;this.mcpService=o;this.settingsIo=a;A(this,"fileSystemManager");A(this,"dispatchTaskHandler",function(){throw new Error("task handler not set")});this.fileSystemManager=new x5(t)}_create_class(eR1,[{key:"getFileSystemManager",value:function getFileSystemManager(){return this.fileSystemManager}},{key:"setDispatchTaskHandler",value:function setDispatchTaskHandler(t){this.dispatchTaskHandler=t}},{key:"getChatModalMountTarget",value:function getChatModalMountTarget(){return pie(this.state.chatModalHostEl)}},{key:"getAgentDefinitions",value:function getAgentDefinitions(){return DT({fullAccess:Boolean(this.getSettings().yolo),subagents:this.getSettings().subagents})}},{key:"getSubagentModelSelection",value:function getSubagentModelSelection(t){var n;var r=t==="explorer"||t==="memory"?(n=this.getSettings().subagents)==null?void 0:n[t]:void 0;return r!=null&&r.model?_object_spread({},r.model):void 0}},{key:"getAgentDefinition",value:function getAgentDefinition(t){var r=this.getAgentDefinitions().find(function(n){return n.id===t});if(!r)throw new Error("Unknown agent type: ".concat(t));return r}},{key:"createTools",value:function createTools(t,r,n,i){return _async_to_generator(function(){var s,o,a,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=t<jfe,a=lTe({allowSpawn:o,enableTodoWrite:t===0,enableViewImage:(s=i==null?void 0:i.modalities.input.includes("image"))!=null?s:!1});_tmp=r.id===wa;if(!_tmp)return[3,2];return[4,this.mcpService.refreshIfChanged()];case 1:_tmp=(_state.sent(),n&&Object.assign(a,this.mcpService.getToolsForSession(n.id,n.disabledMcpServers)));_state.label=2;case 2:return[2,(_tmp,Ffe(a,r))]}})}).call(this)}},{key:"createStableToolsContext",value:function createStableToolsContext(t,r){var _this=this;var i;var n=r.permissionMode==="readonly"?UEe():r.permissionMode==="full"?BEe():jEe(this.app,{has:function(o){return _this.runtimeStates.getAutoApproveRequests(t.id).has(o)},add:function(o){_this.runtimeStates.getAutoApproveRequests(t.id).add(o)}},{sessionTitle:((i=this.state.sessionIndex.find(function(o){return o.id===t.id}))==null?void 0:i.title)||Xd(t),modalMountTarget:this.getChatModalMountTarget()});return{app:this.app,fileSystemManager:this.fileSystemManager,permissionGuard:n,dispatchTask:function(o,a){return _this.dispatchTaskHandler(o,a)},dispatchableDefinitions:LT({fullAccess:Boolean(this.getSettings().yolo),subagents:this.getSettings().subagents}),getSettingsSnapshot:this.settingsIo.getSettingsSnapshot,updateSettings:this.settingsIo.updateSettings}}},{key:"prepareReadTracker",value:function prepareReadTracker(t,r){var o,a;var n=(o=y1(Yo(t),r))!=null?o:Yo(t),i=new Set((a=n.readVaultPaths)!=null?a:[]);return LEe(n,i)}}]);return eR1}();var rR=require("obsidian");var dTe=".agents/nutstore-sync",nH="".concat(dTe,"/sessions"),rEt="chat-meta.json",Qh=/*#__PURE__*/function(Error1){"use strict";_inherits(Qh1,Error1);function Qh1(r){_class_call_check(this,Qh1);var _this;_this=_call_super(this,Qh1,["Corrupted chat session file: ".concat(r)]);_this.filePath=r;_this.name="SessionFileCorruptError";return _this}return Qh1}(_wrap_native_super(Error));function A5(e){return(0,rR.normalizePath)("".concat(nH,"/").concat(e,".json"))}function uTe(){return(0,rR.normalizePath)("".concat(dTe,"/").concat(rEt))}function nEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&Array.isArray(e.orderedSessionIds)&&_type_of(e.sessions)=="object"&&e.sessions!==null}function cTe(e){return"".concat(JSON.stringify(e,null,2),"\n")}var tR=/*#__PURE__*/function(){"use strict";function tR1(t){_class_call_check(this,tR1);this.vault=t}_create_class(tR1,[{key:"adapter",get:function get1(){return this.vault.adapter}},{key:"ensureSessionsDir",value:function ensureSessionsDir(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.adapter.mkdir(nH)];case 1:_state.sent();return[3,3];case 2:t=_state.sent();return[3,3];case 3:return[2]}})}).call(this)}},{key:"writeSessionFile",value:function writeSessionFile(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.ensureSessionsDir()];case 1:_state.sent();return[4,c$(this.vault,A5(t),cTe(r))];case 2:_state.sent();return[2]}})}).call(this)}},{key:"readSessionFile",value:function readSessionFile(t){return _async_to_generator(function(){var r,n,a,i,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=A5(t);_state.label=1;case 1:_state.trys.push([1,3,,5]);return[4,u$(this.vault,r)];case 2:n=_state.sent();return[3,5];case 3:a=_state.sent();return[4,this.adapter.exists(r)];case 4:throw _state.sent()?new Qh(r):new Error("Session file not found: ".concat(r));case 5:try{i=JSON.parse(n)}catch(a){throw new Qh(r)}if(!i||(typeof i==="undefined"?"undefined":_type_of(i))!="object")throw new Qh(r);o=i;if(!o.session||_type_of(o.session)!="object")throw new Qh(r);return[2,{session:o.session,title:typeof o.title=="string"?o.title:void 0}]}})}).call(this)}},{key:"deleteSessionFile",value:function deleteSessionFile(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Lx(this.vault,A5(t))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"listSessionIds",value:function listSessionIds(){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.adapter.list(nH)];case 1:t=_state.sent().files;return[3,3];case 2:r=_state.sent();return[2,[]];case 3:return[2,t.map(function(r){var n;return(n=(0,rR.normalizePath)(r).split("/").pop())!=null?n:""}).filter(function(r){return r.endsWith(".json")}).map(function(r){return r.slice(0,-5)}).filter(function(r){return r.length>0})]}})}).call(this)}},{key:"hasAnySessionFiles",value:function hasAnySessionFiles(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.listSessionIds()];case 1:return[2,_state.sent().length>0]}})}).call(this)}},{key:"writeMetaFile",value:function writeMetaFile(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.ensureSessionsDir()];case 1:_state.sent();return[4,c$(this.vault,uTe(),cTe(t))];case 2:_state.sent();return[2]}})}).call(this)}},{key:"readMetaFile",value:function readMetaFile(){return _async_to_generator(function(){var t,r,n,n10;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=uTe();_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,u$(this.vault,t)];case 2:r=_state.sent();return[3,4];case 3:n=_state.sent();return[2,null];case 4:try{n10=JSON.parse(r);return[2,nEt(n10)?n10:null]}catch(n){return[2,null]}return[2]}})}).call(this)}}]);return tR1}();var cH=require("obsidian");var iEt="__nutstore_chat_blob_v1",pTe="__nutstore_chat_blob_v2",fTe="__nutstore_chat_url_v1",iH="__nutstore_chat_binary_v2",lH={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};typeof BigInt64Array!="undefined"&&(lH.BigInt64Array=BigInt64Array);typeof BigUint64Array!="undefined"&&(lH.BigUint64Array=BigUint64Array);function oH(e){var _String;var t=new Uint8Array(e),r=32768,n="";for(var i=0;i<t.length;i+=r)n+=(_String=String).fromCharCode.apply(_String,_to_consumable_array(t.subarray(i,i+r)));return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function mTe(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t+"=".repeat((4-t.length%4)%4),n=atob(r),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(var a=0;a<n.length;a+=1)o[a]=n.charCodeAt(a);return i}function oEt(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function aEt(e){var _obj,_obj1;return _instanceof(e,ArrayBuffer)?(_obj={},_define_property(_obj,iH,!0),_define_property(_obj,"kind","arraybuffer"),_define_property(_obj,"data",oH(e)),_obj):(_obj1={},_define_property(_obj1,iH,!0),_define_property(_obj1,"kind","Uint8Array"),_define_property(_obj1,"data",oH(oEt(e))),_obj1)}function sEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e[pTe]===!0&&typeof e.type=="string"&&typeof e.data=="string"}function lEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e[iEt]===!0&&typeof e.type=="string"&&_instanceof(e.data,ArrayBuffer)}function uEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e[iH]===!0&&typeof e.kind=="string"&&typeof e.data=="string"}function cEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e[fTe]===!0&&typeof e.href=="string"}function aH(e){return _async_to_generator(function(){var _obj,_tmp,_obj1,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!_instanceof(e,Blob))return[3,2];_obj={},_define_property(_obj,pTe,!0),_define_property(_obj,"type",e.type);_tmp=[_obj,"data"];return[4,e.arrayBuffer()];case 1:return[2,(_define_property.apply(void 0,_tmp.concat([oH.apply(void 0,[_state.sent()])])),_obj)];case 2:if(_instanceof(e,URL))return[2,(_obj1={},_define_property(_obj1,fTe,!0),_define_property(_obj1,"href",e.href),_obj1)];if(_instanceof(e,ArrayBuffer)||_instanceof(e,Uint8Array))return[2,aEt(e)];if(ArrayBuffer.isView(e))throw new TypeError("Only ArrayBuffer and Uint8Array are supported in chat session persistence");if(Array.isArray(e))return[2,Promise.all(e.map(aH))];if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return[2,e];return[4,Promise.all(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=[r];return[4,aH(n)];case 1:return[2,_tmp.concat([_state.sent()])]}})})()}))];case 3:t=_state.sent();return[2,Object.fromEntries(t)]}})})()}function dEt(e){var t=mTe(e.data);if(e.kind==="arraybuffer")return t;if(e.kind==="dataview")return new DataView(t);if(e.kind==="Buffer"&&typeof Buffer!="undefined")return Buffer.from(t);var r=lH[e.kind];if(r)try{return new r(t)}catch(n){}return t}function sH(e){return sEt(e)?new Blob([mTe(e.data)],{type:e.type}):lEt(e)?new Blob([e.data],{type:e.type}):uEt(e)?dEt(e):cEt(e)?new URL(e.href):Array.isArray(e)?e.map(sH):!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object"||_instanceof(e,Blob)||_instanceof(e,ArrayBuffer)||ArrayBuffer.isView(e)?e:Object.fromEntries(Object.entries(e).map(function(param){var _param=_sliced_to_array(param,2),t=_param[0],r=_param[1];return[t,sH(r)]}))}function uH(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,aH(e)];case 1:return[2,_state.sent()]}})})()}function I5(e){return sH(e)}function hTe(e){return{id:e.id,createdAt:e.createdAt,updatedAt:e.updatedAt||e.createdAt,model:e.model?_object_spread({},e.model):void 0,systemPrompt:e.systemPrompt,fragments:Array.isArray(e.fragments)&&e.fragments.length>0?e.fragments.map(function(t){return{id:t.id,createdAt:t.createdAt,updatedAt:t.updatedAt||t.createdAt,summary:t.summary,readVaultPaths:Array.isArray(t.readVaultPaths)?t.readVaultPaths.filter(function(r){return typeof r=="string"&&r.length>0}):void 0,messages:Array.isArray(t.messages)?t.messages.map(function(r){return _object_spread_props(_object_spread({},r),{reversibleOps:Array.isArray(r.reversibleOps)?r.reversibleOps.filter(function(n){return!!n&&typeof n.vaultPath=="string"&&(n.operation==="create"||n.operation==="update"||n.operation==="delete")&&!!n.before&&(n.before.kind==="file"||n.before.kind==="dir")&&(n.operation!=="update"||n.before.kind==="file")}).map(lp).filter(function(n){return!!n}):void 0,message:Xfe(r.message)?Yfe(r.message):tme(r.message)?eme(r.message):r.message,meta:r.meta?_object_spread_props(_object_spread({},r.meta),{usage:r.meta.usage?_object_spread({},r.meta.usage):void 0}):void 0})}):[]}}):[{id:Is("fragment"),createdAt:Date.now(),updatedAt:Date.now(),messages:[]}],activeFragmentId:e.activeFragmentId}}function pEt(e){var t;return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&e.schemaVersion===2&&!!((t=e.subagents)!=null&&t.master)}function fEt(e,t){var n;if(t.message.role==="tool"){Hfe(e.timeline,t,e.operations);return}var r=_6(t.message,{id:t.id,createdAt:t.createdAt,meta:t.meta,isError:t.isError,workspaceContextDelta:t.workspaceContextDelta,userContext:t.userContext,todos:t.todos});e.timeline.push(r),(n=t.reversibleOps)!=null&&n.length&&(e.operations[r.id]=t.reversibleOps)}function mEt(e,t,r){var i,o,a;var n=Array.isArray(t.messages)?t.messages:[];if(r>0){var s=t.summary?"summary":"reset";if(e.timeline.push({id:"checkpoint-".concat(t.id),role:"user",metadata:{createdAt:t.createdAt},parts:[{type:"data-context-checkpoint",data:_object_spread({mode:s},t.summary?{summary:t.summary}:{})}]}),t.summary&&((i=n[0])==null?void 0:i.message.role)==="user"){var l=_6(n[0].message,{id:n[0].id,createdAt:n[0].createdAt});v0(l).trim()===t.summary.trim()&&(n=n.slice(1))}}var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=n[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s10=_step.value;fEt(e,s10)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}(o=t.readVaultPaths)!=null&&o.length&&(e.readVaultPaths=Array.from(new Set(_to_consumable_array((a=e.readVaultPaths)!=null?a:[]).concat(_to_consumable_array(t.readVaultPaths)))))}function hEt(e){var r;var t=UT(e.createdAt);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=((r=e.fragments)!=null?r:[]).entries()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];mEt(t,i,n)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return{schemaVersion:2,id:e.id,createdAt:e.createdAt,updatedAt:e.updatedAt||e.createdAt,model:e.model?_object_spread({},e.model):void 0,systemPrompt:e.systemPrompt,subagents:{master:t}}}function gTe(e){return pEt(e)?{session:e,changed:!1}:{session:hEt(e),changed:!0}}function xTe(e){var t=b6(e.subagents.master);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Fd(e)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var r=_step.value;r.pendingInputs.length>0&&(r.pendingInputs=[],t=!0),b6(r)&&(t=!0),Vl(r)||(r.status="cancelled",r.finishedAt=Date.now(),t=!0)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t}var _1=/*#__PURE__*/function(Error1){"use strict";_inherits(_11,Error1);function _11(r,n){_class_call_check(this,_11);var _this;_this=_call_super(this,_11,[P.t("chatbox.errors.sessionNotFound"),n]);_this.sessionId=r;_this.name="SessionUnavailableError";return _this}return _11}(_wrap_native_super(Error)),nR=/*#__PURE__*/function(){"use strict";function nR1(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){};_class_call_check(this,nR1);this.state=t;this.selection=r;this.backend=n;this.legacy=i;this.resetSessionExecution=o;A(this,"persistQueues",new Map)}_create_class(nR1,[{key:"loadSessionIndex",value:function loadSessionIndex(){return _async_to_generator(function(){var o,t,r,n,i,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.ensureMigratedFromLegacy()];case 1:t=_state.sent();_=Set.bind;return[4,this.backend.listSessionIds()];case 2:r=new(_.apply(Set,[void 0,_state.sent()]));return[4,this.backend.readMetaFile()];case 3:n=_state.sent(),i=t!=null&&t.migrated?null:gEt(n,r);if(i){this.state.sessionIndex=i,this.state.activeSessionId=n!=null&&n.activeSessionId&&r.has(n.activeSessionId)?n.activeSessionId:(o=i[0])==null?void 0:o.id;return[2]}return[4,this.reconcileSessionIndex(t,{diskIds:r,meta:n})];case 4:_state.sent();return[2]}})}).call(this)}},{key:"loadInitialSession",value:function loadInitialSession(){return _async_to_generator(function(){var t,n,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.loadSessionIndex()];case 1:_state.sent();t=this.state.activeSessionId;if(!t)return[2];_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,this.loadSessionById(t)];case 3:return[2,_state.sent()];case 4:n=_state.sent();if(!_instanceof(n,_1))throw n;return[3,5];case 5:return[4,this.reconcileSessionIndex(null)];case 6:_state.sent();r=this.state.activeSessionId;if(r)return[2,this.loadSessionById(r)];return[2]}})}).call(this)}},{key:"ensureMigratedFromLegacy",value:function ensureMigratedFromLegacy(){return _async_to_generator(function(){var t,o,r,o10,n,i,_,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_this,_loop,_iterator,_step,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this.legacy.listSessionKeys()];case 1:t=_state.sent();return[3,3];case 2:o=_state.sent();return[2,null];case 3:if(t.length===0)return[2,null];r={meta:null,index:[]};_state.label=4;case 4:_state.trys.push([4,6,,7]);return[4,this.legacy.getMeta()];case 5:r=_state.sent();return[3,7];case 6:o10=_state.sent();return[3,7];case 7:_=Set.bind;return[4,this.backend.listSessionIds()];case 8:n=new(_.apply(Set,[void 0,_state.sent()])),i=!1;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=9;case 9:_state.trys.push([9,14,15,16]);_loop=function(){var o,a,s,_$s,_this_rehydrateSession,l,c,d,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=_step.value;if(n.has(o))return[2,"continue"];a=void 0;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,_this.legacy.getSession(o)];case 2:a=_state.sent();return[3,4];case 3:s=_state.sent();a=void 0;return[3,4];case 4:if(!!(!a||(typeof a==="undefined"?"undefined":_type_of(a))!="object"))return[3,9];_state.label=5;case 5:_state.trys.push([5,8,,9]);_$s=I5(a),_this_rehydrateSession=_this.rehydrateSession(_$s),l=_this_rehydrateSession.session;return[4,uH(l)];case 6:c=_state.sent(),d=r.index.find(function(u){return u.id===o});return[4,_this.backend.writeSessionFile(o,{session:c,title:d==null?void 0:d.title})];case 7:_state.sent(),i=!0;return[3,9];case 8:s10=_state.sent();Me.warn("Failed to migrate chat session ".concat(o,", skipping it"),s10);return[3,9];case 9:return[2]}})};_iterator=t[Symbol.iterator]();_state.label=10;case 10:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];_this=this;return[5,_ts_values(_loop())];case 11:_state.sent();_state.label=12;case 12:_iteratorNormalCompletion=true;return[3,10];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:return[2,_object_spread_props(_object_spread({},r),{migrated:i})]}})}).call(this)}},{key:"reconcileSessionIndex",value:function reconcileSessionIndex(t,r){return _async_to_generator(function(){var u,p,m,h,g,x,v,y,_,b,w,S,k,n,i,o,_tmp,_10,_tmp1,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,E,C,T,_this_rehydrateSession,I,O,C1,err,a,s,l,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,E1,C10,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!((u=r==null?void 0:r.diskIds)!=null))return[3,1];_tmp=u;return[3,3];case 1:_10=Set.bind;return[4,this.backend.listSessionIds()];case 2:_tmp=new(_10.apply(Set,[void 0,_state.sent()]));_state.label=3;case 3:n=_tmp;if(!((p=r==null?void 0:r.meta)!=null))return[3,4];_tmp1=p;return[3,6];case 4:return[4,this.backend.readMetaFile()];case 5:_tmp1=_state.sent();_state.label=6;case 6:i=_tmp1,o=new Map;_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=7;case 7:_state.trys.push([7,14,15,16]);_iterator=n[Symbol.iterator]();_state.label=8;case 8:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,13];E=_step.value;_state.label=9;case 9:_state.trys.push([9,11,,12]);return[4,this.backend.readSessionFile(E)];case 10:C=_state.sent(),T=I5(C.session),_this_rehydrateSession=this.rehydrateSession(T),I=_this_rehydrateSession.session,O=(m=i==null?void 0:i.sessions)==null?void 0:m[E];o.set(E,{id:E,title:C.title||(O==null?void 0:O.title)||P.t("chatbox.newChat"),createdAt:(h=O==null?void 0:O.createdAt)!=null?h:yTe(I.createdAt),updatedAt:(g=O==null?void 0:O.updatedAt)!=null?g:yTe(I.updatedAt)});return[3,12];case 11:C1=_state.sent();return[3,12];case 12:_iteratorNormalCompletion=true;return[3,8];case 13:return[3,16];case 14:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,16];case 15:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 16:a=(y=(v=(x=t==null?void 0:t.meta)==null?void 0:x.orderedSessionIds)!=null?v:t==null?void 0:t.index.map(function(E){return E.id}))!=null?y:[],s=t!=null&&t.migrated||!i?[a,(_=i==null?void 0:i.orderedSessionIds)!=null?_:[]]:[i.orderedSessionIds,a],l=[],c=new Set;_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(_iterator1=_to_consumable_array(s.flat()).concat(_to_consumable_array(n))[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){E1=_step1.value;C10=o.get(E1);!C10||c.has(E1)||(l.push(C10),c.add(E1))}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}this.state.sessionIndex=l;d=t!=null&&t.migrated||!i?[(b=t==null?void 0:t.meta)==null?void 0:b.activeSessionId,i==null?void 0:i.activeSessionId]:[i.activeSessionId,(w=t==null?void 0:t.meta)==null?void 0:w.activeSessionId];this.state.activeSessionId=(k=d.find(function(E){return!!E&&o.has(E)}))!=null?k:(S=l[0])==null?void 0:S.id;return[4,this.persistMetaAndIndex()];case 17:_state.sent();return[2]}})}).call(this)}},{key:"loadSessionById",value:function loadSessionById(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,7]);return[4,this.loadSessionByIdUnchecked(t)];case 1:return[2,_state.sent()];case 2:r=_state.sent();if(!_instanceof(r,_1))throw r;_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,this.reconcileSessionIndex(null)];case 4:_state.sent();return[3,6];case 5:n=_state.sent();Me.warn("Failed to reconcile unavailable chat session ".concat(t),n);return[3,6];case 6:throw r;case 7:return[2]}})}).call(this)}},{key:"loadSessionByIdUnchecked",value:function loadSessionByIdUnchecked(t){return _async_to_generator(function(){var r,n,d,i,o,_$d,d10,_this_rehydrateSession,a,s,l,c,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.state.loadedSessions.get(t);if(r)return[2,r];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.backend.readSessionFile(t)];case 2:n=_state.sent();return[3,4];case 3:d=_state.sent();if(_instanceof(d,Qh))throw new cH.Notice(P.t("chatbox.errors.corruptSessionFile",{path:d.filePath}),1e4),new _1(t,{cause:d});n=void 0;return[3,4];case 4:if(!n)return[3,5];try{i=I5(n.session)}catch(d){throw new cH.Notice(P.t("chatbox.errors.corruptSessionFile",{path:A5(t)}),1e4),new _1(t,{cause:d})}o=n.title;return[3,8];case 5:_state.trys.push([5,7,,8]);return[4,this.legacy.getSession(t)];case 6:_$d=_state.sent();_$d&&(typeof _$d==="undefined"?"undefined":_type_of(_$d))=="object"&&(i=I5(_$d));return[3,8];case 7:d10=_state.sent();return[3,8];case 8:if(!i)throw new _1(t);_this_rehydrateSession=this.rehydrateSession(i),a=_this_rehydrateSession.session,s=_this_rehydrateSession.changed;this.resetSessionExecution(t,a),this.state.loadedSessions.set(t,a);l=this.state.sessionIndex.find(function(d){return d.id===t}),c=o&&o!==P.t("chatbox.newChat")?o:l!=null&&l.title&&l.title!==P.t("chatbox.newChat")?l.title:Xd(a);this.upsertSessionIndexItem(a,c);_tmp=s||!n||!o;if(!_tmp)return[3,11];return[4,this.persistSession(a)];case 9:_state.sent();return[4,this.persistMetaAndIndex()];case 10:_tmp=_state.sent();_state.label=11;case 11:return[2,(_tmp,a)]}})}).call(this)}},{key:"persistSession",value:function persistSession(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return _this.state.loadedSessions.get(t.id)===t};return _async_to_generator(function(){var _this,s,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.state.deletedSessionIds.has(t.id)||!r())return[2];n=t.id,i=(s=this.persistQueues.get(n))!=null?s:Promise.resolve(),o=this.getIndexedTitle(t),a=i.catch(function(){}).then(function(){return _async_to_generator(function(){var l,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.state.deletedSessionIds.has(n)||!r())return[2];return[4,uH(t)];case 1:l=_state.sent();_tmp=this.state.deletedSessionIds.has(n)||!r();if(_tmp)return[3,3];return[4,this.backend.writeSessionFile(n,{session:l,title:o})];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})}).call(_this)});this.persistQueues.set(n,a),a.finally(function(){_this.persistQueues.get(n)===a&&_this.persistQueues.delete(n)}).catch(function(l){Me.error("Failed to persist chat session",l)});return[4,a];case 1:_state.sent();return[2]}})}).call(this)}},{key:"persistMetaAndIndex",value:function persistMetaAndIndex(){return _async_to_generator(function(){var t,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:t={};_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.state.sessionIndex[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){n=_step.value;t[n.id]={title:n.title,createdAt:n.createdAt,updatedAt:n.updatedAt}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}r={activeSessionId:this.state.activeSessionId,orderedSessionIds:this.state.sessionIndex.map(function(n){return n.id}),sessions:t};return[4,this.backend.writeMetaFile(r)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"deleteSession",value:function deleteSession(t){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:this.state.deletedSessionIds.add(t);return[4,(r=this.persistQueues.get(t))==null?void 0:r.catch(function(){})];case 1:_state.sent();return[4,this.backend.deleteSessionFile(t)];case 2:_state.sent();_state.label=3;case 3:_state.trys.push([3,5,,6]);return[4,this.legacy.unsetSession(t)];case 4:_state.sent();return[3,6];case 5:n=_state.sent();return[3,6];case 6:return[2]}})}).call(this)}},{key:"getIndexedTitle",value:function getIndexedTitle(t){var n;var r=(n=this.state.sessionIndex.find(function(i){return i.id===t.id}))==null?void 0:n.title;if(r&&r!==P.t("chatbox.newChat"))return r}},{key:"rehydrateSession",value:function rehydrateSession(t){var r=gTe("schemaVersion"in t?t:hTe(t)),_this_normalizeSession=this.normalizeSession(r.session),n=_this_normalizeSession.session,i=_this_normalizeSession.changed,o=r.changed||this.selection.sanitizeSessionSelection(n)||i;return o=xTe(n)||o,{session:n,changed:o}}},{key:"normalizeSession",value:function normalizeSession(t){var r=!1,n=function(a){return _object_spread_props(_object_spread({},a),{metadata:a.metadata?_object_spread_props(_object_spread({},a.metadata),{llm:a.metadata.llm?_object_spread({},a.metadata.llm):void 0}):{createdAt:t.createdAt},parts:_to_consumable_array(a.parts)})},i=function(a){var h,g,x;var s=function(v){return typeof v=="number"&&Number.isFinite(v)?v:void 0},l=Object.fromEntries(Object.entries((h=a.subagents)!=null?h:{}).map(function(param){var _param=_sliced_to_array(param,2),v=_param[0],y=_param[1];return[v,i(y)]})),c=function(v){var y=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=v[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _=_step.value;var b=lp(_);if(!b){r=!0;continue}b.vaultPath!==_.vaultPath&&(r=!0),y.push(b)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return y},d=Array.isArray(a.pendingInputs)?a.pendingInputs:[],u=a.id===wa?[]:d.map(n),p=Array.isArray(a.timeline)?a.timeline.map(n):[],m=a.model&&typeof a.model.providerId=="string"&&typeof a.model.modelId=="string"?{providerId:a.model.providerId,modelId:a.model.modelId}:void 0;return a.id===wa&&d.length>0&&(r=!0),a.model!==void 0&&!m&&(r=!0),{id:a.id,type:a.type||(a.id===wa?wa:"subagent"),model:m,status:a.id===wa?"idle":a.status,createdAt:a.createdAt||t.createdAt,startedAt:s(a.startedAt),finishedAt:s(a.finishedAt),resultPath:typeof a.resultPath=="string"?a.resultPath:void 0,timeline:p,pendingInputs:u,operations:Object.fromEntries(Object.entries((g=a.operations)!=null?g:{}).map(function(param){var _param=_sliced_to_array(param,2),v=_param[0],y=_param[1];return[v,c(y!=null?y:[])]})),toolTimings:Object.fromEntries(Object.entries((x=a.toolTimings)!=null?x:{}).flatMap(function(param){var _param=_sliced_to_array(param,2),v=_param[0],y=_param[1];var _=s(y==null?void 0:y.startedAt);if(_===void 0)return[];var b=s(y.finishedAt);return[[v,_object_spread({startedAt:_},b===void 0?{}:{finishedAt:b})]]})),readVaultPaths:Array.isArray(a.readVaultPaths)?a.readVaultPaths.filter(function(v){return typeof v=="string"}):void 0,subagents:l}},o=i(t.subagents.master);return{session:{schemaVersion:2,id:t.id,createdAt:t.createdAt,updatedAt:t.updatedAt||t.createdAt,model:t.model?_object_spread({},t.model):void 0,systemPrompt:t.systemPrompt,disabledMcpServers:Array.isArray(t.disabledMcpServers)?t.disabledMcpServers.filter(function(a){return typeof a=="string"}):void 0,subagents:{master:o}},changed:r}}},{key:"upsertSessionIndexItem",value:function upsertSessionIndexItem(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var l,c;if(this.state.deletedSessionIds.has(t.id))return;var i=(c=(l=this.state.sessionIndex.find(function(d){return d.id===t.id}))==null?void 0:l.title)!=null?c:P.t("chatbox.newChat"),o={id:t.id,title:r!=null?r:i,createdAt:t.createdAt,updatedAt:t.updatedAt},a=this.state.sessionIndex.findIndex(function(d){return d.id===t.id});if(a===-1){this.state.sessionIndex=n?[o].concat(_to_consumable_array(this.state.sessionIndex)):_to_consumable_array(this.state.sessionIndex).concat([o]);return}var s=this.state.sessionIndex.slice();s[a]=o,n&&a>0&&(s.splice(a,1),s.unshift(o)),this.state.sessionIndex=s}}]);return nR1}();function yTe(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function gEt(e,t){if(!e||e.orderedSessionIds.length!==t.size)return null;var r=new Set,n=[];var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.orderedSessionIds[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=e.sessions[i];if(!t.has(i)||r.has(i)||!o||typeof o.title!="string"||!Number.isFinite(o.createdAt)||!Number.isFinite(o.updatedAt))return null;r.add(i),n.push(_object_spread({id:i},o))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return Object.keys(e.sessions).length===t.size?n:null}function P5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(!e||(typeof e==="undefined"?"undefined":_type_of(e))!="object")return e;var r=e,n=t.get(r);if(n)return n;if(Array.isArray(e)){var a=[];t.set(r,a);var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;a.push(P5(s,t))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return a}var i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)return e;var o=Object.create(i);t.set(r,o);var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=Object.entries(e)[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step1.value,2),a9=_step_value[0],s10=_step_value[1];o[a9]=P5(s10,t)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return o}function vTe(e,t){var l,c;var r=P5(e.timeline),n=P5(e.toolTimings),i=P5(e.operations),o=vI(r,n,i).map(function(param){var d=param.message,u=param.blocks;var p,m;return{createdAt:(m=(p=d.metadata)==null?void 0:p.createdAt)!=null?m:t,message:d,displayBlocks:u,showHeader:!0}}),a,s=!1;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=o[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var d=_step.value;if(d.message.role==="user"){a=void 0,s=!1;continue}var u=(c=(l=d.message.metadata)==null?void 0:l.llm)==null?void 0:c.modelId;d.showHeader=!s||!u||u!==a,a=u,s=!!u}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return o}function _Te(e){return vTe(Yo(e),e.createdAt)}function bTe(e){var t={},r=function(n){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.values(n.subagents)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;t[i.id]={id:i.id,type:i.type,status:i.status,createdAt:i.createdAt,startedAt:i.startedAt,finishedAt:i.finishedAt,timeline:vTe(i,i.createdAt)},r(i)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}};return r(Yo(e)),t}function wTe(e,t,r){return Array.from(e.values()).filter(function(n){return n.id!==t}).filter(function(n){var i=r(n.id);return i.runState!=="idle"||!!i.processing||i.scheduler.queued.length>0||Fd(n).some(function(o){return o.status==="running"||o.status==="queued"})}).map(function(n){return n.id})}var pH=require("obsidian");var STe=require("obsidian"),xEt=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;function kTe(e){if(typeof e!="string"||e.length===0)return;var t=xEt.exec(e);if(t)return(0,STe.parseYaml)(t[1])}var dH=".agents/skills",yEt="".concat(is,"/skills"),CTe=64*1024,vEt=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function _Et(e,t,r,n){var i=typeof(r==null?void 0:r.name)=="string"?r.name.trim():"",o=typeof(r==null?void 0:r.description)=="string"?r.description.trim():"";return!i||!o?{diagnostic:{path:t,message:"Skill frontmatter requires non-empty name and description."}}:i.length>64||!vEt.test(i)||i!==e?{diagnostic:{path:t,message:"Skill name must match its directory and contain only lowercase letters, numbers, and single hyphens."}}:o.length>1024?{diagnostic:{path:t,message:"Skill description must not exceed 1024 characters."}}:n>CTe?{diagnostic:{path:t,message:"Skill file must not exceed ".concat(CTe," bytes.")}}:{skill:{name:i,description:o,path:"".concat(yEt,"/").concat(i,"/SKILL.md")}}}function bEt(e){return kTe(e)}var iR=/*#__PURE__*/function(){"use strict";function iR1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rG;_class_call_check(this,iR1);this.app=t;this.builtinSkills=r;A(this,"skills");A(this,"diagnostics",[]);this.skills=this.getBuiltinMetadata()}_create_class(iR1,[{key:"getBuiltinMetadata",value:function getBuiltinMetadata(){return this.builtinSkills.map(function(param){var t=param.name,r=param.description,n=param.path;return{name:t,description:r,path:n}})}},{key:"refresh",value:function refresh(){return _async_to_generator(function(){var i,t,r,n,a,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,s,l,c,d,m,u,_$m,m10,p,err,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=new Map(this.getBuiltinMetadata().map(function(o){return[o.name,o]})),r=[],n=this.app.vault.adapter;_state.label=1;case 1:_state.trys.push([1,19,,20]);return[4,n.exists(dH)];case 2:if(!_state.sent())return[3,18];return[4,n.list(dH)];case 3:a=_state.sent().folders.map(function(s){return(0,pH.normalizePath)(s)}).sort(function(s,l){return s.localeCompare(l)});_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,16,17,18]);_iterator=a[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,15];s=_step.value;l=(i=s.split("/").at(-1))!=null?i:"",c=(0,pH.normalizePath)("".concat(s,"/SKILL.md")),d=void 0;_state.label=6;case 6:_state.trys.push([6,8,,9]);return[4,n.stat(c)];case 7:d=_state.sent();return[3,9];case 8:m=_state.sent();r.push({path:c,message:_instanceof(m,Error)?m.message:"Unable to inspect Vault Skill."});return[3,14];case 9:if(!d||d.type!=="file")return[3,14];u=void 0;_state.label=10;case 10:_state.trys.push([10,12,,13]);return[4,n.read(c)];case 11:_$m=_state.sent();if(_$m.includes("\0"))throw new Error("Skill file is not UTF-8 text.");u=bEt(_$m);return[3,13];case 12:m10=_state.sent();r.push({path:c,message:_instanceof(m10,Error)?m10.message:"Unable to parse Skill frontmatter."});return[3,14];case 13:p=_Et(l,c,u,d.size);p.skill&&(t.has(p.skill.name)&&r.push({path:c,message:"Vault Skill '".concat(p.skill.name,"' overrides built-in Skill with the same name.")}),t.set(p.skill.name,p.skill)),p.diagnostic&&r.push(p.diagnostic);_state.label=14;case 14:_iteratorNormalCompletion=true;return[3,5];case 15:return[3,18];case 16:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,18];case 17:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 18:return[3,20];case 19:o=_state.sent();r.push({path:dH,message:_instanceof(o,Error)?o.message:"Unable to discover Vault Skills."});return[3,20];case 20:this.skills=_to_consumable_array(t.values()).sort(function(o,a){return o.name.localeCompare(a.name)}),this.diagnostics=r;return[2]}})}).call(this)}},{key:"discover",value:function discover(){return{skills:this.skills.map(function(t){return _object_spread({},t)}),diagnostics:this.diagnostics.map(function(t){return _object_spread({},t)})}}},{key:"getCatalog",value:function getCatalog(){return this.skills.map(function(t){return _object_spread({},t)})}}]);return iR1}();var R5=require("obsidian");var b1=/*#__PURE__*/function(_R5_Modal){"use strict";_inherits(b11,_R5_Modal);function b11(r,n,i){_class_call_check(this,b11);var _this;_this=_call_super(this,b11,[r]);_this.resolve=n;_this.mountTarget=i;A(_this,"includeToolMessages",!0);A(_this,"resolved",!1);A(_this,"cleanupModalMount");return _this}_create_class(b11,[{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),r.createEl("h3",{text:P.t("chatbox.exportDialog.title")}),r.createEl("p",{text:P.t("chatbox.exportDialog.description")}),new R5.Setting(r).setName(P.t("chatbox.exportDialog.includeToolMessages")).addToggle(function(n){n.setValue(_this.includeToolMessages).onChange(function(i){return _this.includeToolMessages=i})}),new R5.Setting(r).addButton(function(n){n.setButtonText(P.t("chatbox.exportDialog.cancel")).onClick(function(){return _this.close()})}).addButton(function(n){n.setCta().setButtonText(P.t("chatbox.exportDialog.confirm")).onClick(function(){_this.resolved=!0,_this.resolve({includeToolMessages:_this.includeToolMessages}),_this.close()})})}},{key:"onClose",value:function onClose(){var r;(r=this.cleanupModalMount)==null||r.call(this),this.cleanupModalMount=void 0,this.contentEl.empty(),!this.resolved&&this.resolve(void 0)}},{key:"open",value:function open(){_get(_get_prototype_of(b11.prototype),"open",this).call(this),this.cleanupModalMount=zd(this,this.mountTarget)}}],[{key:"open",value:function open(r,n){return new Promise(function(i){new b1(r,i,n).open()})}}]);return b11}(R5.Modal);var M5=/*#__PURE__*/function(Pr1){"use strict";_inherits(M51,Pr1);function M51(r){_class_call_check(this,M51);var _this;_this=_call_super(this,M51);_this.plugin=r;A(_this,"state",new wP);A(_this,"notifier",new bP);A(_this,"runtimeStates",new AI(_this.state));A(_this,"selection");A(_this,"store");A(_this,"toolExecutor");A(_this,"taskManager");A(_this,"userContextManager");A(_this,"messageFactory");A(_this,"messageOps");A(_this,"sessionProcessor");A(_this,"compactionCoordinator");A(_this,"skillRepository");_this.skillRepository=new iR(r.app),_this.selection=new jP(function(){return r.settings.ai},_this.state,function(){return _this.notify()},function(s){return _this.store.persistSession(s)});var n=_this.createLegacySessionStore();_this.store=new nR(_this.state,_this.selection,new tR(r.app.vault),n,function(s,l){var c;_this.runtimeStates.resetExecution(s),(c=_this.taskManager)==null||c.cleanupSessionAgentTracking(l)}),_this.toolExecutor=new eR(r.app,function(){return r.settings.ai},_this.state,_this.runtimeStates,r.mcpService,{getSettingsSnapshot:function(){return r.settings},updateSettings:function(s){return r.settingsService.applySettingsPatch(s)}}),_this.userContextManager=new xI(_this.state,_this.runtimeStates,function(){return _this.notify()}),_this.messageFactory=new CI(r.app,function(){return _this.notify()},_this.skillRepository);var i=function(s){return r.nutstoreLlmGatewayService.ensureProviderReady(s)},o=new zP(_this.toolExecutor,_this.store,_this.messageFactory,function(){return _this.notify()},r.app);_this.compactionCoordinator=new b_(_this.store,_this.messageFactory),_this.taskManager=new VP(r.app,i,_this.state,_this.selection,_this.store,function(){return _this.notify()},_this.toolExecutor,_this.messageFactory,o,_this.compactionCoordinator),_this.toolExecutor.setDispatchTaskHandler(function(s,l){return _this.taskManager.dispatchTask(s,l)});var a=function(s){return new E_.Notice(s)};_this.messageOps=new _P(r.app,_this.state,_this.runtimeStates,_this.store,function(){return _this.notify()},a,_this.messageFactory,function(s){return _this.selection.validateSessionSelection(s)},function(s,l){return _this.sessionProcessor.enqueueRegenerate(s,l)},_this.skillRepository,{getSettingsSnapshot:function(){return r.settings},updateSettings:function(s){return r.settingsService.applySettingsPatch(s)}},_this.toolExecutor.getFileSystemManager()),_this.sessionProcessor=new BP(i,_this.state,_this.runtimeStates,_this.store,function(){return _this.notify()},_this.selection,_this.messageFactory,_this.messageOps,_this.userContextManager,o,_this.compactionCoordinator,_this.taskManager,a),_this.taskManager.setMasterAgentInputHandler(function(s,l,c){return _this.sessionProcessor.enqueueAgentInput(s,l,c)});return _this}_create_class(M51,[{key:"notify",value:function notify(){this.notifier.notify()}},{key:"onunload",value:function onunload(){var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this.state.loadedSessions[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _step_value=_sliced_to_array(_step.value,2),r=_step_value[0],n=_step_value[1];this.state.deletedSessionIds.add(r),this.compactionCoordinator.cancel(r),this.taskManager.cancelAllNonTerminalAgents(n),this.taskManager.cleanupSessionAgentTracking(n),this.runtimeStates.resetExecution(r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"initialize",value:function initialize(){return _async_to_generator(function(){var _this;return _ts_generator(this,function(_state){_this=this;return[2,this.state.initialization?this.state.initialization:(this.state.initialization=this.initializeInternal().then(function(){_this.state.initialized=!0,_this.notify()}).catch(function(r){throw _this.state.initialization=void 0,r}),this.state.initialization)]})}).call(this)}},{key:"initializeInternal",value:function initializeInternal(){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.store.loadInitialSession()];case 1:r=_state.sent();if(!(r&&this.taskManager.restoreMasterTaskContinuations(r),this.state.sessionIndex.length===0))return[3,5];return[4,this.createEmptySession()];case 2:n=_state.sent();this.state.activeSessionId=n.id,this.state.loadedSessions.set(n.id,n),this.store.upsertSessionIndexItem(n);return[4,this.store.persistSession(n)];case 3:_state.sent();return[4,this.store.persistMetaAndIndex()];case 4:_state.sent();return[2];case 5:return[2]}})}).call(this)}},{key:"subscribe",value:function subscribe(r){return this.notifier.subscribe(r)}},{key:"handleSettingsChanged",value:function handleSettingsChanged(){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.selection.syncPendingSelectionWithSettings(),!this.state.initialization){this.notify();return[2]}return[4,this.initialize()];case 1:_state.sent();r=[];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=this.state.loadedSessions.values()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){n=_step.value;this.selection.sanitizeSessionSelection(n)&&r.push(this.store.persistSession(n))}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_tmp=r.length>0;if(!_tmp)return[3,3];return[4,Promise.all(r)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp,this.notify();return[2]}})}).call(this)}},{key:"getViewProps",value:function getViewProps(){var _this=this;var r=this.getLoadedActiveSession(),n=this.getViewRuntime(r),i=this.resolveViewSelection(r),o=Wi(this.plugin.settings.ai.providers,i.selectedProviderId),a=Da(o,i.selectedModelId),_this_resolveContextUsage=this.resolveContextUsage(r,a),s=_this_resolveContextUsage.usage,l=_this_resolveContextUsage.contextWindow;return _object_spread({loading:!this.state.initialized,title:this.getActiveSessionTitle(),activeContextItems:[],sessionHistory:this.state.sessionIndex.map(function(c){return _object_spread({},c)}),activeSessionId:this.state.activeSessionId,timeline:r?_Te(r):[],agentsById:r?bTe(r):{},otherBusySessionIds:wTe(this.state.loadedSessions,this.state.activeSessionId,function(c){return _this.runtimeStates.get(c)}),providers:this.buildProviderOptions(),selectedProviderId:i.selectedProviderId,selectedModelId:i.selectedModelId,runState:n.runState,draft:{text:n.draft.text,userContext:n.draft.userContext.slice()},pending:bxe(n).map(function(c){return{text:c.text,userContext:c.userContext.slice()}}),canSend:!n.draft.userContext.some(function(c){return c.type==="pending-context"}),canCompress:!!r&&n.runState==="idle"&&this.messageFactory.getActiveAgent(r).timeline.length>0,mcpServers:this.buildMcpServerOptions(r),usage:s,contextWindow:l},this.bindViewActions())}},{key:"buildMcpServerOptions",value:function buildMcpServerOptions(r){var i;var n=new Set((i=r==null?void 0:r.disabledMcpServers)!=null?i:[]);return this.plugin.mcpService.getServerRuntimes().filter(function(o){return o.enabled}).map(function(o){return{name:o.name,connected:o.status==="connected",toolCount:o.tools.length,disabled:n.has(o.name)}})}},{key:"resolveContextUsage",value:function resolveContextUsage(r,n){var s,l,c;if(!r||!n)return{};var i=NP(n),a=(c=(l=(s=_to_consumable_array(this.messageFactory.getActiveAgent(r).timeline).reverse().find(function(d){var u,p;return d.role==="assistant"&&((p=(u=d.metadata)==null?void 0:u.llm)==null?void 0:p.usage)}))==null?void 0:s.metadata)==null?void 0:l.llm)==null?void 0:c.usage;return a?{usage:a,contextWindow:i}:{contextWindow:i}}},{key:"getViewRuntime",value:function getViewRuntime(r){return r?this.runtimeStates.get(r.id):{runState:"idle",draft:{text:"",userContext:[]},scheduler:vS()}}},{key:"resolveViewSelection",value:function resolveViewSelection(r){var c,d;var n=Ev(this.plugin.settings.ai.providers,this.plugin.settings.ai.defaultModel),i=this.selection.getEmptyStateSelection(),o=r?(c=r.model)==null?void 0:c.providerId:i.providerId||n.providerId,a=r?(d=r.model)==null?void 0:d.modelId:i.modelId||n.modelId,s=Wi(this.plugin.settings.ai.providers,o),l=Da(s,a);return{selectedProviderId:s==null?void 0:s.id,selectedModelId:l==null?void 0:l.id}}},{key:"getActiveSessionTitle",value:function getActiveSessionTitle(){var _this=this;var r;return((r=this.state.sessionIndex.find(function(n){return n.id===_this.state.activeSessionId}))==null?void 0:r.title)||P.t("chatbox.newChat")}},{key:"buildProviderOptions",value:function buildProviderOptions(){return Sh(this.plugin.settings.ai.providers).map(function(r){return{id:r.id,name:r.name||P.t("settings.ai.unnamedProvider"),models:sp(r).map(function(n){return{id:n.id,name:n.name||P.t("settings.ai.unnamedModel")}})}})}},{key:"bindViewActions",value:function bindViewActions(){var _this=this;return{onNewSession:function(){return void _this.createSession()},onCompressContext:function(){return _this.compressContext()},onSwitchSession:function(r){return void _this.switchSession(r)},onExportSession:function(r,n){return _this.exportSession(r,n)},onDeleteSession:function(r){return _this.deleteSession(r)},onSelectProvider:function(r){return _this.selectProvider(r)},onSelectModel:function(r){return _this.selectModel(r)},onSendMessage:function(r){return _this.sendMessage(r)},onUpdateInputDraft:function(r){return _this.updateInputDraft(r)},onAddUserContext:function(r){return _this.addUserContext(r)},onRemoveUserContext:function(r){return _this.removeUserContext(r)},onResolvePendingContextItem:function(r,n){return _this.resolvePendingContextItem(r,n)},onDropContextItem:function(r){},onStopActiveRun:function(){return _this.stopActiveSessionRun()},onDeleteMessage:function(r){return _this.deleteMessage(r)},onRegenerateMessage:function(r){_this.regenerateMessage(r)},onRecallMessage:function(r,n){return _this.recallMessage(r,n)},onRecallHasReversibleOps:function(r){return _this.messageOps.recallMessageHasReversibleOps(r)},onToggleSessionMcpServer:function(r){return void _this.toggleSessionMcpServer(r)}}}},{key:"toggleSessionMcpServer",value:function toggleSessionMcpServer(r){return _async_to_generator(function(){var o,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:_state.sent();n=this.getLoadedActiveSession();if(!n)return[2];i=new Set((o=n.disabledMcpServers)!=null?o:[]);i.has(r)?i.delete(r):i.add(r),n.disabledMcpServers=i.size>0?_to_consumable_array(i):void 0,this.notify(),this.store.persistSession(n).catch(function(a){Me.error("Failed to persist session MCP server toggles",a)});return[2]}})}).call(this)}},{key:"ensureSession",value:function ensureSession(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:_state.sent();return[2]}})}).call(this)}},{key:"createSession",value:function createSession(){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:_state.sent();r=this.getLoadedActiveSession();if(r&&this.isUntitledEmptyActiveSession(r))return[2,r];return[4,this.createEmptySession()];case 2:n=_state.sent();return[2,(this.state.loadedSessions.set(n.id,n),this.state.activeSessionId=n.id,this.store.upsertSessionIndexItem(n,P.t("chatbox.newChat"),!0),this.runtimeStates.get(n.id),this.notify(),this.store.persistSession(n).catch(function(i){Me.error("Failed to persist new chat session",i)}),this.store.persistMetaAndIndex().catch(function(i){Me.error("Failed to persist chat session index",i)}),n)]}})}).call(this)}},{key:"createDraftSession",value:function createDraftSession(_01){return _async_to_generator(function(r){var n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:[];return[4,this.createSession()];case 1:i=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=n[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){o=_step.value;this.userContextManager.addUserContext(o)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[2,(this.userContextManager.updateInputDraft(r),this.notify(),i)]}})}).apply(this,arguments)}},{key:"switchSession",value:function switchSession(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:if(_state.sent(),!this.state.sessionIndex.some(function(i){return i.id===r}))return[2];return[4,this.store.loadSessionById(r)];case 2:n=_state.sent();this.state.activeSessionId=r,this.taskManager.restoreMasterTaskContinuations(n);return[4,this.store.persistMetaAndIndex()];case 3:_state.sent(),this.notify();return[2]}})}).call(this)}},{key:"deleteSession",value:function deleteSession(r){return _async_to_generator(function(){var i,n,_tmp,_tmp1,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:if(_state.sent(),!this.state.sessionIndex.some(function(o){return o.id===r}))return[2];this.state.deletedSessionIds.add(r),this.compactionCoordinator.cancel(r);n=this.state.loadedSessions.get(r);_tmp=n;if(!_tmp)return[3,3];return[4,this.stopSessionRun(n,{waitForWorker:!0})];case 2:_tmp=(_state.sent(),this.taskManager.cancelAllNonTerminalAgents(n),this.taskManager.cleanupSessionAgentTracking(n));_state.label=3;case 3:_tmp,this.state.sessionIndex=this.state.sessionIndex.filter(function(o){return o.id!==r});_tmp1=this.state.activeSessionId===r;if(!_tmp1)return[3,6];this.state.activeSessionId=(i=this.state.sessionIndex[0])==null?void 0:i.id;_tmp2=this.state.activeSessionId;if(!_tmp2)return[3,5];return[4,this.store.loadSessionById(this.state.activeSessionId)];case 4:_tmp2=_state.sent();_state.label=5;case 5:_tmp1=_tmp2;_state.label=6;case 6:_tmp1,this.state.loadedSessions.delete(r),this.state.runtimeBySessionId.delete(r),this.state.autoApproveRequestsBySessionId.delete(r);return[4,this.store.deleteSession(r)];case 7:_state.sent();return[4,this.store.persistMetaAndIndex()];case 8:_state.sent(),this.notify(),new E_.Notice(P.t("chatbox.sessionDeleted"));return[2]}})}).call(this)}},{key:"exportSession",value:function exportSession(r,n){return _async_to_generator(function(){var o,i,_$a,s,l,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.initialize()];case 1:if(_state.sent(),!this.state.sessionIndex.some(function(a){return a.id===r})){new E_.Notice(P.t("chatbox.errors.sessionNotFound"));return[2]}return[4,b1.open(this.plugin.app,n!=null?n:this.getChatModalMountTarget())];case 2:i=_state.sent();if(!i)return[3,8];_state.label=3;case 3:_state.trys.push([3,7,,8]);return[4,this.store.loadSessionById(r)];case 4:_$a=_state.sent(),s=((o=this.state.sessionIndex.find(function(d){return d.id===r}))==null?void 0:o.title)||Xd(_$a);return[4,uxe({vault:this.plugin.app.vault,manifestId:this.plugin.manifest.id,manifestVersion:this.plugin.manifest.version,session:_$a,title:s,includeToolMessages:i.includeToolMessages})];case 5:l=_state.sent();return[4,this.plugin.app.workspace.getLeaf("tab").openFile(l)];case 6:_state.sent(),new E_.Notice(P.t("chatbox.exportSaved",{fileName:l.path}));return[3,8];case 7:a=_state.sent();new E_.Notice(P.t("chatbox.exportFailed")),Me.error("Failed to export chat session:",a);return[3,8];case 8:return[2]}})}).call(this)}},{key:"setChatModalHost",value:function setChatModalHost(r){this.state.chatModalHostEl=r!=null&&r.isConnected?r:void 0}},{key:"getChatModalMountTarget",value:function getChatModalMountTarget(){return this.toolExecutor.getChatModalMountTarget()}},{key:"createLegacySessionStore",value:function createLegacySessionStore(){return{listSessionKeys:function(){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,R8.keys()];case 1:return[2,_state.sent()];case 2:r=_state.sent();return[2,[]];case 3:return[2]}})})()},getSession:function(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,R8.get(r)];case 1:return[2,_state.sent()];case 2:n=_state.sent();return[2];case 3:return[2]}})})()},unsetSession:function(r){return R8.unset(r)},getMeta:function(){return _async_to_generator(function(){var _ref,r,n,i,o,r10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,Promise.all([n$.get(Ufe),n$.get(Bfe)])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),r=_ref[0],n=_ref[1],i=wEt(r)?r:null,o=Array.isArray(n)?n.filter(SEt):[];return[2,{meta:i,index:o}];case 2:r10=_state.sent();return[2,{meta:null,index:[]}];case 3:return[2]}})})()}}}},{key:"selectProvider",value:function selectProvider(r){this.selection.selectProvider(r)}},{key:"selectModel",value:function selectModel(r){this.selection.selectModel(r)}},{key:"addUserContext",value:function addUserContext(r){this.userContextManager.addUserContext(r)}},{key:"removeUserContext",value:function removeUserContext(r){this.userContextManager.removeUserContext(r)}},{key:"resolvePendingContextItem",value:function resolvePendingContextItem(r,n){this.userContextManager.resolvePendingContextItem(r,n)}},{key:"updateInputDraft",value:function updateInputDraft(r){this.userContextManager.updateInputDraft(r)}},{key:"sendMessage",value:function sendMessage(_01){return _async_to_generator(function(r){var n,i,o,_tmp,a,s;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:[];return[4,this.initialize()];case 1:_state.sent();i=r.trim();_tmp=this.getLoadedActiveSession();if(_tmp)return[3,3];return[4,this.createSession()];case 2:_tmp=_state.sent();_state.label=3;case 3:o=_tmp;if(!o)return[2,!1];a=this.runtimeStates.get(o.id),s=this.userContextManager.dedupeUserContextItems(_to_consumable_array(a.draft.userContext).concat(_to_consumable_array(n)));return[2,!i&&s.length===0||!this.selection.validateSessionSelection(o)||!this.sessionProcessor.enqueueUserSubmission(o.id,{text:i,userContext:s})?!1:(a.draft={text:"",userContext:[]},this.notify(),!0)]}})}).apply(this,arguments)}},{key:"compressContext",value:function compressContext(){return _async_to_generator(function(){var _this,r,n,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;return[4,this.initialize()];case 1:_state.sent();r=this.getLoadedActiveSession();if(!r)return[2];n=this.runtimeStates.get(r.id);if(II(n)||!this.selection.validateSessionSelection(r))return[2];i=this.messageFactory.getActiveAgent(r);this.compactionCoordinator.cancel(r.id,i.id),n.runState="compressing",this.notify();o=new AbortController;n.manualCompressionAbortController=o;a=Promise.resolve().then(function(){return _async_to_generator(function(){var _this,s,l,_$c,d,u,p,_tmp,c,d10,u10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_state.trys.push([1,6,8,9]);if(!(i.timeline.length>0))return[3,5];_$c=this.selection.getProviderOrThrow(r);return[4,this.plugin.nutstoreLlmGatewayService.ensureProviderReady(_$c)];case 2:if(_state.sent(),o.signal.aborted)return[2];d=this.selection.getModelOrThrow(_$c,r),u=function(){var m,h;return((m=r.model)==null?void 0:m.providerId)===_$c.id&&((h=r.model)==null?void 0:h.modelId)===d.id};_tmp=[{provider:_$c,model:d,session:r,agent:i,store:this.store,messageFactory:this.messageFactory}];return[4,DP(i,r,d,this.toolExecutor,this.plugin.app)];case 3:return[4,PEe.apply(void 0,[_object_spread_props.apply(void 0,[_object_spread.apply(void 0,_tmp.concat([_state.sent()])),{buildMessages:function(m,h){return jT(i,h,_this.userContextManager,m)},isCancelled:function(){return o.signal.aborted||_this.state.deletedSessionIds.has(r.id)||!u()},abortSignal:o.signal}])])];case 4:p=_state.sent();if(p!=="committed"&&p!=="cancelled")throw new $P(P.t("chatbox.errors.contextCompressionFailed"));_state.label=5;case 5:return[3,9];case 6:c=_state.sent();if(y8e(c)&&o.signal.aborted)return[2];d10=Wi(this.plugin.settings.ai.providers,(s=r.model)==null?void 0:s.providerId),u10=Da(d10,(l=r.model)==null?void 0:l.modelId);this.messageFactory.reportFatalError(r,Zu(c,P.t("chatbox.requestFailed")),{providerId:d10==null?void 0:d10.id,providerName:d10==null?void 0:d10.name,modelId:u10==null?void 0:u10.id,modelName:u10==null?void 0:u10.name},i);return[4,this.store.persistSession(r)];case 7:_state.sent();return[3,9];case 8:n.manualCompressionAbortController===o&&(n.manualCompressionAbortController=void 0),n.processing===a&&(n.processing=void 0),n.runState="idle",this.notify(),n.scheduler.queued.length>0&&this.sessionProcessor.start(r.id);return[7];case 9:return[2]}})}).call(_this)}),n.processing=a;return[4,a];case 2:_state.sent();return[2]}})}).call(this)}},{key:"stopActiveSessionRun",value:function stopActiveSessionRun(){var r=this.getLoadedActiveSession();r&&this.stopSessionRun(r)}},{key:"deleteMessage",value:function deleteMessage(r){this.messageOps.deleteMessage(r)}},{key:"recallMessage",value:function recallMessage(r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.messageOps.recallMessage(r,n)]})}).call(this)}},{key:"regenerateMessage",value:function regenerateMessage(r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.messageOps.regenerateMessage(r)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"stopSessionRun",value:function stopSessionRun(_01){return _async_to_generator(function(r){var n,i,_tmp,o,_tmp1;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{};i=this.runtimeStates.get(r.id);return[4,this.sessionProcessor.stopActiveTurn(r.id)];case 1:if(!_state.sent())return[3,4];_tmp=n.waitForWorker;if(!_tmp)return[3,3];return[4,i.processing];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2];case 4:o=i.manualCompressionAbortController;_tmp1=o;if(!_tmp1)return[3,6];o.abort(Ds("Stopped by user"));return[4,i.processing];case 5:_tmp1=_state.sent();_state.label=6;case 6:_tmp1;return[2]}})}).apply(this,arguments)}},{key:"getLoadedActiveSession",value:function getLoadedActiveSession(){return this.state.activeSessionId?this.state.loadedSessions.get(this.state.activeSessionId):void 0}},{key:"isUntitledEmptyActiveSession",value:function isUntitledEmptyActiveSession(r){var n=this.runtimeStates.get(r.id);return this.getActiveSessionTitle()===P.t("chatbox.newChat")&&r.subagents.master.timeline.length===0&&n.draft.text.trim().length===0&&n.draft.userContext.length===0&&n.scheduler.queued.length===0&&!n.scheduler.active}},{key:"createEmptySession",value:function createEmptySession(){return _async_to_generator(function(){var _this,_this_selection_getInitialSelectionForNewSession,r,n,i,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_this_selection_getInitialSelectionForNewSession=this.selection.getInitialSelectionForNewSession(),r=_this_selection_getInitialSelectionForNewSession.providerId,n=_this_selection_getInitialSelectionForNewSession.modelId,i=Date.now();_tmp={schemaVersion:2};return[4,Lv("session",function(o){return _this.state.sessionIndex.some(function(a){return a.id===o})})];case 1:return[2,(_tmp.id=_state.sent(),_tmp.createdAt=i,_tmp.updatedAt=i,_tmp.model=r&&n?{providerId:r,modelId:n}:void 0,_tmp.subagents={master:UT(i)},_tmp)]}})}).call(this)}}]);return M51}(Pr);function wEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&Array.isArray(e.orderedSessionIds)}function SEt(e){return!!e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&typeof e.id=="string"&&typeof e.title=="string"&&typeof e.createdAt=="number"&&typeof e.updatedAt=="number"}var ETe=require("obsidian");var O5=/*#__PURE__*/function(Pr1){"use strict";_inherits(O51,Pr1);function O51(r){_class_call_check(this,O51);var _this;_this=_call_super(this,O51);_this.plugin=r;return _this}_create_class(O51,[{key:"onload",value:function onload(){var _this=this;this.plugin.addCommand({id:"start-sync",name:P.t("sync.startButton"),icon:"refresh-cw",checkCallback:function(r){if(_this.plugin.isSyncing)return!1;if(r)return!0;if(!_this.plugin.isAccountConfigured()){new ETe.Notice(P.t("sync.error.accountNotConfigured"));try{var _$i=_this.plugin.app.setting;_$i&&(_$i.open(),_$i.openTabById(_this.plugin.manifest.id))}catch(i){Me.error("Failed to open settings:",i)}return}var n=function(i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.syncExecutorService.executeSync({mode:"manual_sync",syncPolicy:i})];case 1:_state.sent();return[2]}})}).call(_this)};_this.plugin.settings.confirmBeforeSync?new L0(_this.plugin.app,_this.plugin.settings,_this.plugin.localSettings,function(i){n(i)}).open():n()}}),this.plugin.addCommand({id:"open-chatbox",name:P.t("chatbox.openCommand"),icon:xg,callback:function(){_this.openChatbox()}}),this.plugin.addCommand({id:"stop-sync",name:P.t("sync.stopButton"),icon:"x-circle",checkCallback:function(r){return _this.plugin.isSyncing?(r||um(),!0):!1}}),this.plugin.addCommand({id:"show-sync-progress",name:P.t("sync.showProgressButton"),icon:"activity",callback:function(){_this.plugin.progressService.showProgressModal()}})}},{key:"openChatbox",value:function openChatbox(){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.plugin.app.workspace.getLeavesOfType(Wc)[0]||this.plugin.app.workspace.getRightLeaf(!1);_tmp=n;if(!_tmp)return[3,2];return[4,n.setViewState({type:Wc,active:!0})];case 1:_tmp=(_state.sent(),this.plugin.app.workspace.revealLeaf(n));_state.label=2;case 2:_tmp;return[2]}})}).call(this)}}]);return O51}(Pr);var fH=require("obsidian");function oR(e){var r;var t=e.traversal;switch(e.phase){case"checkingRemote":return{operation:P.t("sync.preparation.checkingRemote"),detail:""};case"loadingState":return{operation:P.t("sync.preparation.loadingState"),detail:""};case"analyzing":return{operation:P.t("sync.preparation.analyzing"),detail:""};case"savingCache":return{operation:P.t("sync.preparation.savingCache"),detail:""};case"traversingRemote":break}return!t||t.phase==="complete"?{operation:P.t("sync.preparation.analyzing"),detail:""}:t.phase==="retrying"?{operation:P.t("sync.preparation.retryingRemote"),detail:(r=t.currentPath)!=null?r:""}:t.phase==="incremental"?{operation:P.t("sync.preparation.checkingChanges"),detail:P.t("sync.preparation.incrementalStats",{changes:t.processedChanges})}:{operation:P.t("sync.preparation.scanningRemote"),detail:P.t("sync.preparation.traversalStats",{processed:t.processedDirectories,queued:t.queuedDirectories,items:t.discoveredItems})}}var $5=/*#__PURE__*/function(Pr1){"use strict";_inherits($51,Pr1);function $51(r){_class_call_check(this,$51);var _this;_this=_call_super(this,$51);_this.plugin=r;A(_this,"subscriptions",[]);return _this}_create_class($51,[{key:"onload",value:function onload(){var _this=this;this.onunload(),this.subscriptions=[M7().subscribe(function(param){var r=param.showNotice;_this.plugin.toggleSyncUI(!0),_this.plugin.statusService.updateSyncStatus({text:P.t("sync.preparing"),showNotice:r}),r&&_this.plugin.progressService.showProgressModal()}),O7().subscribe(function(r){_this.plugin.statusService.updateSyncStatus({text:oR(r).operation})}),D7().subscribe(function(param){var r=param.showNotice;_this.plugin.statusService.updateSyncStatus({text:P.t("sync.start"),showNotice:r})}),$7().subscribe(function(r){var n=Math.round(r.completed.length/r.total*1e4)/100;_this.plugin.statusService.updateSyncStatus({text:P.t("sync.progress",{percent:n})})}),T7().subscribe(function(){_this.plugin.toggleSyncUI(!1),_this.plugin.statusService.updateSyncStatus({text:P.t("sync.cancelled")})}),A7().subscribe(function(param){var r=param.failedCount,n=param.showNotice;_this.plugin.toggleSyncUI(!1);var i=Date.now();if(_this.plugin.statusService.setLastSyncTime(i,r),n&&!_this.plugin.progressService.hasVisibleSyncModal()){var o=r>0?P.t("sync.completeWithFailed",{failedCount:r}):P.t("sync.complete");new fH.Notice(o)}}),P7().subscribe(function(r){_this.plugin.toggleSyncUI(!1),_this.plugin.statusService.updateSyncStatus({text:P.t("sync.failedStatus"),isError:!0,showNotice:!1}),new fH.Notice(P.t("sync.failedWithError",{error:Lc(r)?P.t("sync.error.requestsTooFrequent"):r.message}))})]}},{key:"onunload",value:function onunload(){this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions=[]}}]);return $51}(Pr);var mH=require("obsidian");var kEt=new Ln;var TTe=function(e,t){return kEt.next({current:e,total:t})};var N5=/*#__PURE__*/function(Pr1){"use strict";_inherits(N51,Pr1);function N51(r){_class_call_check(this,N51);var _this;_this=_call_super(this,N51);_this.plugin=r;A(_this,"lock",new iv);A(_this,"stopRequested",!1);return _this}_create_class(N51,[{key:"isRunningNow",value:function isRunningNow(){return this.lock.isLocked()}},{key:"waitUntilIdle",value:function waitUntilIdle(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.lock.isLocked();if(!_tmp)return[3,2];return[4,this.lock.waitForUnlock()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}},{key:"runBlobGc",value:function runBlobGc(){return _async_to_generator(function(){var _this,i,o,a,s,l,c,r,n,d,u,p,m;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.plugin.syncExecutorService.isRunning())return[2,(!1&&new mH.Notice(P.t("settings.cache.gcBlockedBySync")),{ok:!1,reason:"sync"})];if(this.lock.isLocked())return[2,(!1&&new mH.Notice(P.t("settings.cache.gcBlockedByGc")),{ok:!1,reason:"gc"})];return[4,this.lock.acquire()];case 1:r=_state.sent();this.stopRequested=!1;n=fY().subscribe(function(){_this.stopRequested=!0});_state.label=2;case 2:_state.trys.push([2,,4,5]);d=(a=(o=(i=window.performance)==null?void 0:i.now)==null?void 0:o.call(i))!=null?a:Date.now(),u=!1;return[4,CEt(TTe,function(){return _this.stopRequested?(u=!0,!0):!1})];case 3:p=_state.sent(),m=((c=(l=(s=window.performance)==null?void 0:s.now)==null?void 0:l.call(s))!=null?c:Date.now())-d;return[2,(Me.debug("Blob GC completed",{deletedCount:p,durationMs:Number(m.toFixed(2))}),u?{ok:!1,reason:"cancelled"}:{ok:!0,deletedCount:p})];case 4:this.stopRequested=!1,n.unsubscribe(),r();return[7];case 5:return[2]}})}).call(this)}}]);return N51}(Pr);function CEt(e,t){return _async_to_generator(function(){var s,r,n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,l,c,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,d,err,i,o,a,l10,c10,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Set;return[4,Ad.keys()];case 1:n=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=2;case 2:_state.trys.push([2,7,8,9]);_iterator=n[Symbol.iterator]();_state.label=3;case 3:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];l=_step.value;return[4,Ad.get(l)];case 4:c=_state.sent();_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(c)try{for(_iterator1=c.values()[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){d=_step1.value;(s=d.base)!=null&&s.key&&r.add(d.base.key)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,3];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:return[4,ym.keys()];case 10:i=_state.sent(),o=i.length,a=0;l10=0;_state.label=11;case 11:if(!(l10<i.length&&!(t!=null&&t())))return[3,15];c10=i[l10];_tmp=r.has(c10);if(_tmp)return[3,13];return[4,ym.unset(c10)];case 12:_tmp=(_state.sent(),a++);_state.label=13;case 13:_tmp,e==null||e(l10+1,o);_state.label=14;case 14:l10++;return[3,11];case 15:return[2,a]}})})()}var D5=/*#__PURE__*/function(Pr1){"use strict";_inherits(D51,Pr1);function D51(r){_class_call_check(this,D51);var _this;var _this1;_this=_call_super(this,D51),_this1=_this;_this.plugin=r;A(_this,"update",function(){return _async_to_generator(function(){var _$r;return _ts_generator(this,function(_state){try{if(_this1.plugin.settings.language)P.changeLanguage(_this1.plugin.settings.language.toLowerCase());else{_$r=navigator.language.split("-")[0];P.changeLanguage(_$r.toLowerCase())}}catch(r){Me.error(r)}return[2]})})()});return _this}_create_class(D51,[{key:"onload",value:function onload(){return this.update()}}]);return D51}(Pr);var ATe=require("obsidian");var L5=/*#__PURE__*/function(Pr1){"use strict";_inherits(L51,Pr1);function L51(r){_class_call_check(this,L51);var _this;_this=_call_super(this,L51);A(_this,"logs",[]);return _this}_create_class(L51,[{key:"onload",value:function onload(){var _this=this;var r={log:function(n){_this.logs.push({timestamp:(0,ATe.moment)(n.date).format("YYYY-MM-DD HH:mm:ss"),level:n.type,args:n.args})}};!1?Me.addReporter(r):Me.setReporters([r])}},{key:"clear",value:function clear(){this.logs=[]}}]);return L51}(Pr);function aR(e){return!!e._zod}function od(e,t){return aR(e)?tf(e,t):e.safeParse(t)}function sR(e){var r,n;if(!e)return;var t;if(aR(e)?t=(n=(r=e._zod)==null?void 0:r.def)==null?void 0:n.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch(i){return}return t}}function lR(e){var i;if(aR(e)){var a=(i=e._zod)==null?void 0:i.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}var r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}var n=e.value;if(n!==void 0)return n}var A_="2025-11-25";var PTe=[A_,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Jh="io.modelcontextprotocol/related-task",cR="2.0",ua=XE(function(e){return e!==null&&((typeof e==="undefined"?"undefined":_type_of(e))=="object"||typeof e=="function")}),RTe=Xn([ce(),un().int()]),MTe=ce(),OIr=fo({ttl:un().optional(),pollInterval:un().optional()}),EEt=mt({ttl:un().optional()}),TEt=mt({taskId:ce()}),gH=fo(_define_property({progressToken:RTe.optional()},Jh,TEt.optional())),fu=mt({_meta:gH.optional()}),F5=fu.extend({task:EEt.optional()}),OTe=function(e){return F5.safeParse(e).success},za=mt({method:ce(),params:fu.loose().optional()}),lc=mt({_meta:gH.optional()}),uc=mt({method:ce(),params:lc.loose().optional()}),ja=fo({_meta:gH.optional()}),dR=Xn([ce(),un().int()]),$Te=mt(_object_spread({jsonrpc:Lt(cR),id:dR},za.shape)).strict(),z5=function(e){return $Te.safeParse(e).success},NTe=mt(_object_spread({jsonrpc:Lt(cR)},uc.shape)).strict(),DTe=function(e){return NTe.safeParse(e).success},xH=mt({jsonrpc:Lt(cR),id:dR,result:ja}).strict(),w1=function(e){return xH.safeParse(e).success};var gr;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(gr||(gr={}));var yH=mt({jsonrpc:Lt(cR),id:dR.optional(),error:mt({code:un().int(),message:ce(),data:Yn().optional()})}).strict();var LTe=function(e){return yH.safeParse(e).success};var pR=Xn([$Te,NTe,xH,yH]),$Ir=Xn([xH,yH]),S1=ja.strict(),AEt=lc.extend({requestId:dR.optional(),reason:ce().optional()}),fR=uc.extend({method:Lt("notifications/cancelled"),params:AEt}),IEt=mt({src:ce(),mimeType:ce().optional(),sizes:lt(ce()).optional(),theme:Ra(["light","dark"]).optional()}),j5=mt({icons:lt(IEt).optional()}),T_=mt({name:ce(),title:ce().optional()}),FTe=T_.extend(_object_spread_props(_object_spread({},T_.shape,j5.shape),{version:ce(),websiteUrl:ce().optional(),description:ce().optional()})),PEt=w2(mt({applyDefaults:jn().optional()}),Wn(ce(),Yn())),REt=j3(function(e){return e&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e},w2(mt({form:PEt.optional(),url:ua.optional()}),Wn(ce(),Yn()).optional())),MEt=fo({list:ua.optional(),cancel:ua.optional(),requests:fo({sampling:fo({createMessage:ua.optional()}).optional(),elicitation:fo({create:ua.optional()}).optional()}).optional()}),OEt=fo({list:ua.optional(),cancel:ua.optional(),requests:fo({tools:fo({call:ua.optional()}).optional()}).optional()}),$Et=mt({experimental:Wn(ce(),ua).optional(),sampling:mt({context:ua.optional(),tools:ua.optional()}).optional(),elicitation:REt.optional(),roots:mt({listChanged:jn().optional()}).optional(),tasks:MEt.optional(),extensions:Wn(ce(),ua).optional()}),NEt=fu.extend({protocolVersion:ce(),capabilities:$Et,clientInfo:FTe}),DEt=za.extend({method:Lt("initialize"),params:NEt});var LEt=mt({experimental:Wn(ce(),ua).optional(),logging:ua.optional(),completions:ua.optional(),prompts:mt({listChanged:jn().optional()}).optional(),resources:mt({subscribe:jn().optional(),listChanged:jn().optional()}).optional(),tools:mt({listChanged:jn().optional()}).optional(),tasks:OEt.optional(),extensions:Wn(ce(),ua).optional()}),vH=ja.extend({protocolVersion:ce(),capabilities:LEt,serverInfo:FTe,instructions:ce().optional()}),zTe=uc.extend({method:Lt("notifications/initialized"),params:lc.optional()}),jTe=function(e){return zTe.safeParse(e).success},mR=za.extend({method:Lt("ping"),params:fu.optional()}),FEt=mt({progress:un(),total:oi(un()),message:oi(ce())}),zEt=mt(_object_spread_props(_object_spread({},lc.shape,FEt.shape),{progressToken:RTe})),hR=uc.extend({method:Lt("notifications/progress"),params:zEt}),jEt=fu.extend({cursor:MTe.optional()}),U5=za.extend({params:jEt.optional()}),B5=ja.extend({nextCursor:MTe.optional()}),UEt=Ra(["working","input_required","completed","failed","cancelled"]),q5=mt({taskId:ce(),status:UEt,ttl:Xn([un(),O3()]),createdAt:ce(),lastUpdatedAt:ce(),pollInterval:oi(un()),statusMessage:oi(ce())}),k1=ja.extend({task:q5}),BEt=lc.merge(q5),W5=uc.extend({method:Lt("notifications/tasks/status"),params:BEt}),gR=za.extend({method:Lt("tasks/get"),params:fu.extend({taskId:ce()})}),xR=ja.merge(q5),yR=za.extend({method:Lt("tasks/result"),params:fu.extend({taskId:ce()})}),NIr=ja.loose(),vR=U5.extend({method:Lt("tasks/list")}),_R=B5.extend({tasks:lt(q5)}),bR=za.extend({method:Lt("tasks/cancel"),params:fu.extend({taskId:ce()})}),UTe=ja.merge(q5),BTe=mt({uri:ce(),mimeType:oi(ce()),_meta:Wn(ce(),Yn()).optional()}),qTe=BTe.extend({text:ce()}),_H=ce().refine(function(e){try{return atob(e),!0}catch(t){return!1}},{message:"Invalid Base64 string"}),WTe=BTe.extend({blob:_H}),V5=Ra(["user","assistant"]),I_=mt({audience:lt(V5).optional(),priority:un().min(0).max(1).optional(),lastModified:lf.datetime({offset:!0}).optional()}),VTe=mt(_object_spread_props(_object_spread({},T_.shape,j5.shape),{uri:ce(),description:oi(ce()),mimeType:oi(ce()),size:oi(un()),annotations:I_.optional(),_meta:oi(fo({}))})),qEt=mt(_object_spread_props(_object_spread({},T_.shape,j5.shape),{uriTemplate:ce(),description:oi(ce()),mimeType:oi(ce()),annotations:I_.optional(),_meta:oi(fo({}))})),WEt=U5.extend({method:Lt("resources/list")}),bH=B5.extend({resources:lt(VTe)}),VEt=U5.extend({method:Lt("resources/templates/list")}),wH=B5.extend({resourceTemplates:lt(qEt)}),SH=fu.extend({uri:ce()}),GEt=SH,HEt=za.extend({method:Lt("resources/read"),params:GEt}),kH=ja.extend({contents:lt(Xn([qTe,WTe]))}),CH=uc.extend({method:Lt("notifications/resources/list_changed"),params:lc.optional()}),ZEt=SH,KEt=za.extend({method:Lt("resources/subscribe"),params:ZEt}),QEt=SH,JEt=za.extend({method:Lt("resources/unsubscribe"),params:QEt}),YEt=lc.extend({uri:ce()}),XEt=uc.extend({method:Lt("notifications/resources/updated"),params:YEt}),eTt=mt({name:ce(),description:oi(ce()),required:oi(jn())}),tTt=mt(_object_spread_props(_object_spread({},T_.shape,j5.shape),{description:oi(ce()),arguments:oi(lt(eTt)),_meta:oi(fo({}))})),rTt=U5.extend({method:Lt("prompts/list")}),EH=B5.extend({prompts:lt(tTt)}),nTt=fu.extend({name:ce(),arguments:Wn(ce(),ce()).optional()}),iTt=za.extend({method:Lt("prompts/get"),params:nTt}),TH=mt({type:Lt("text"),text:ce(),annotations:I_.optional(),_meta:Wn(ce(),Yn()).optional()}),AH=mt({type:Lt("image"),data:_H,mimeType:ce(),annotations:I_.optional(),_meta:Wn(ce(),Yn()).optional()}),IH=mt({type:Lt("audio"),data:_H,mimeType:ce(),annotations:I_.optional(),_meta:Wn(ce(),Yn()).optional()}),oTt=mt({type:Lt("tool_use"),name:ce(),id:ce(),input:Wn(ce(),Yn()),_meta:Wn(ce(),Yn()).optional()}),aTt=mt({type:Lt("resource"),resource:Xn([qTe,WTe]),annotations:I_.optional(),_meta:Wn(ce(),Yn()).optional()}),sTt=VTe.extend({type:Lt("resource_link")}),PH=Xn([TH,AH,IH,sTt,aTt]),lTt=mt({role:V5,content:PH}),RH=ja.extend({description:ce().optional(),messages:lt(lTt)}),MH=uc.extend({method:Lt("notifications/prompts/list_changed"),params:lc.optional()}),uTt=mt({title:ce().optional(),readOnlyHint:jn().optional(),destructiveHint:jn().optional(),idempotentHint:jn().optional(),openWorldHint:jn().optional()}),cTt=mt({taskSupport:Ra(["required","optional","forbidden"]).optional()}),GTe=mt(_object_spread_props(_object_spread({},T_.shape,j5.shape),{description:ce().optional(),inputSchema:mt({type:Lt("object"),properties:Wn(ce(),ua).optional(),required:lt(ce()).optional()}).catchall(Yn()),outputSchema:mt({type:Lt("object"),properties:Wn(ce(),ua).optional(),required:lt(ce()).optional()}).catchall(Yn()).optional(),annotations:uTt.optional(),execution:cTt.optional(),_meta:Wn(ce(),Yn()).optional()})),dTt=U5.extend({method:Lt("tools/list")}),OH=B5.extend({tools:lt(GTe)}),P_=ja.extend({content:lt(PH).default([]),structuredContent:Wn(ce(),Yn()).optional(),isError:jn().optional()}),DIr=P_.or(ja.extend({toolResult:Yn()})),pTt=F5.extend({name:ce(),arguments:Wn(ce(),Yn()).optional()}),fTt=za.extend({method:Lt("tools/call"),params:pTt}),$H=uc.extend({method:Lt("notifications/tools/list_changed"),params:lc.optional()}),HTe=mt({autoRefresh:jn().default(!0),debounceMs:un().int().nonnegative().default(300)}),ZTe=Ra(["debug","info","notice","warning","error","critical","alert","emergency"]),mTt=fu.extend({level:ZTe}),hTt=za.extend({method:Lt("logging/setLevel"),params:mTt}),gTt=lc.extend({level:ZTe,logger:ce().optional(),data:Yn()}),xTt=uc.extend({method:Lt("notifications/message"),params:gTt}),yTt=mt({name:ce().optional()}),vTt=mt({hints:lt(yTt).optional(),costPriority:un().min(0).max(1).optional(),speedPriority:un().min(0).max(1).optional(),intelligencePriority:un().min(0).max(1).optional()}),_Tt=mt({mode:Ra(["auto","required","none"]).optional()}),bTt=mt({type:Lt("tool_result"),toolUseId:ce().describe("The unique identifier for the corresponding tool call."),content:lt(PH).default([]),structuredContent:mt({}).loose().optional(),isError:jn().optional(),_meta:Wn(ce(),Yn()).optional()}),wTt=L3("type",[TH,AH,IH]),uR=L3("type",[TH,AH,IH,oTt,bTt]),STt=mt({role:V5,content:Xn([uR,lt(uR)]),_meta:Wn(ce(),Yn()).optional()}),kTt=F5.extend({messages:lt(STt),modelPreferences:vTt.optional(),systemPrompt:ce().optional(),includeContext:Ra(["none","thisServer","allServers"]).optional(),temperature:un().optional(),maxTokens:un().int(),stopSequences:lt(ce()).optional(),metadata:ua.optional(),tools:lt(GTe).optional(),toolChoice:_Tt.optional()}),NH=za.extend({method:Lt("sampling/createMessage"),params:kTt}),DH=ja.extend({model:ce(),stopReason:oi(Ra(["endTurn","stopSequence","maxTokens"]).or(ce())),role:V5,content:wTt}),LH=ja.extend({model:ce(),stopReason:oi(Ra(["endTurn","stopSequence","maxTokens","toolUse"]).or(ce())),role:V5,content:Xn([uR,lt(uR)])}),CTt=mt({type:Lt("boolean"),title:ce().optional(),description:ce().optional(),default:jn().optional()}),ETt=mt({type:Lt("string"),title:ce().optional(),description:ce().optional(),minLength:un().optional(),maxLength:un().optional(),format:Ra(["email","uri","date","date-time"]).optional(),default:ce().optional()}),TTt=mt({type:Ra(["number","integer"]),title:ce().optional(),description:ce().optional(),minimum:un().optional(),maximum:un().optional(),default:un().optional()}),ATt=mt({type:Lt("string"),title:ce().optional(),description:ce().optional(),enum:lt(ce()),default:ce().optional()}),ITt=mt({type:Lt("string"),title:ce().optional(),description:ce().optional(),oneOf:lt(mt({const:ce(),title:ce()})),default:ce().optional()}),PTt=mt({type:Lt("string"),title:ce().optional(),description:ce().optional(),enum:lt(ce()),enumNames:lt(ce()).optional(),default:ce().optional()}),RTt=Xn([ATt,ITt]),MTt=mt({type:Lt("array"),title:ce().optional(),description:ce().optional(),minItems:un().optional(),maxItems:un().optional(),items:mt({type:Lt("string"),enum:lt(ce())}),default:lt(ce()).optional()}),OTt=mt({type:Lt("array"),title:ce().optional(),description:ce().optional(),minItems:un().optional(),maxItems:un().optional(),items:mt({anyOf:lt(mt({const:ce(),title:ce()}))}),default:lt(ce()).optional()}),$Tt=Xn([MTt,OTt]),NTt=Xn([PTt,RTt,$Tt]),DTt=Xn([NTt,CTt,ETt,TTt]),LTt=F5.extend({mode:Lt("form").optional(),message:ce(),requestedSchema:mt({type:Lt("object"),properties:Wn(ce(),DTt),required:lt(ce()).optional()})}),FTt=F5.extend({mode:Lt("url"),message:ce(),elicitationId:ce(),url:ce().url()}),zTt=Xn([LTt,FTt]),FH=za.extend({method:Lt("elicitation/create"),params:zTt}),jTt=lc.extend({elicitationId:ce()}),UTt=uc.extend({method:Lt("notifications/elicitation/complete"),params:jTt}),zH=ja.extend({action:Ra(["accept","decline","cancel"]),content:j3(function(e){return e===null?void 0:e},Wn(ce(),Xn([ce(),un(),jn(),lt(ce())])).optional())}),BTt=mt({type:Lt("ref/resource"),uri:ce()});var qTt=mt({type:Lt("ref/prompt"),name:ce()}),WTt=fu.extend({ref:Xn([qTt,BTt]),argument:mt({name:ce(),value:ce()}),context:mt({arguments:Wn(ce(),ce()).optional()}).optional()}),VTt=za.extend({method:Lt("completion/complete"),params:WTt});var jH=ja.extend({completion:fo({values:lt(ce()).max(100),total:oi(un().int()),hasMore:oi(jn())})}),GTt=mt({uri:ce().startsWith("file://"),name:ce().optional(),_meta:Wn(ce(),Yn()).optional()}),HTt=za.extend({method:Lt("roots/list"),params:fu.optional()}),ZTt=ja.extend({roots:lt(GTt)}),KTt=uc.extend({method:Lt("notifications/roots/list_changed"),params:lc.optional()}),LIr=Xn([mR,DEt,VTt,hTt,iTt,rTt,WEt,VEt,HEt,KEt,JEt,fTt,dTt,gR,yR,vR,bR]),FIr=Xn([fR,hR,zTe,KTt,W5]),zIr=Xn([S1,DH,LH,zH,ZTt,xR,_R,k1]),jIr=Xn([mR,NH,FH,HTt,gR,yR,vR,bR]),UIr=Xn([fR,hR,xTt,XEt,CH,$H,MH,W5,UTt]),BIr=Xn([S1,vH,jH,RH,EH,bH,wH,kH,P_,OH,xR,_R,k1]),er=/*#__PURE__*/function(Error1){"use strict";_inherits(er1,Error1);function er1(t,r,n){_class_call_check(this,er1);var _this;_this=_call_super(this,er1,["MCP error ".concat(t,": ").concat(r)]),_this.code=t,_this.data=n,_this.name="McpError";return _this}_create_class(er1,null,[{key:"fromError",value:function fromError(t,r,n){if(t===gr.UrlElicitationRequired&&n){var i=n;if(i.elicitations)return new hH(i.elicitations,r)}return new er(t,r,n)}}]);return er1}(_wrap_native_super(Error)),hH=/*#__PURE__*/function(er1){"use strict";_inherits(hH1,er1);function hH1(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"URL elicitation".concat(t.length>1?"s":""," required");_class_call_check(this,hH1);return _call_super(this,hH1,[gr.UrlElicitationRequired,r,{elicitations:t}])}_create_class(hH1,[{key:"elicitations",get:function get1(){var t,r;return(r=(t=this.data)==null?void 0:t.elicitations)!=null?r:[]}}]);return hH1}(er);function Yh(e){return e==="completed"||e==="failed"||e==="cancelled"}var QTt=Symbol("Let zodToJsonSchema decide on which parser to use");var w9r=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function UH(e){var t=sR(e),r=t==null?void 0:t.method;if(!r)throw new Error("Schema is missing a method literal");var n=lR(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function BH(e,t){var r=od(e,t);if(!r.success)throw r.error;return r.data}var rAt=6e4,wR=/*#__PURE__*/function(){"use strict";function wR1(t){var _this=this;_class_call_check(this,wR1);this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(fR,function(r){_this._oncancel(r)}),this.setNotificationHandler(hR,function(r){_this._onprogress(r)}),this.setRequestHandler(mR,function(r){return{}}),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(gR,function(r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this._taskStore.getTask(r.params.taskId,n.sessionId)];case 1:i=_state.sent();if(!i)throw new er(gr.InvalidParams,"Failed to retrieve task: Task not found");return[2,_object_spread({},i)]}})}).call(_this)}),this.setRequestHandler(yR,function(r,n){return _async_to_generator(function(){var _this,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;i=function(){return _async_to_generator(function(){var s,o,l,c,d,u,p,m,p10,a,l10;return _ts_generator(this,function(_state){switch(_state.label){case 0:o=r.params.taskId;if(!this._taskMessageQueue)return[3,5];_state.label=1;case 1:return[4,this._taskMessageQueue.dequeue(o,n.sessionId)];case 2:if(!(l=_state.sent()))return[3,5];if(l.type==="response"||l.type==="error"){c=l.message,d=c.id,u=this._requestResolvers.get(d);if(u)if(this._requestResolvers.delete(d),l.type==="response")u(c);else{p=c,m=new er(p.error.code,p.error.message,p.error.data);u(m)}else{p10=l.type==="response"?"Response":"Error";this._onerror(new Error("".concat(p10," handler missing for request ").concat(d)))}return[3,4]}return[4,(s=this._transport)==null?void 0:s.send(l.message,{relatedRequestId:n.requestId})];case 3:_state.sent();_state.label=4;case 4:return[3,1];case 5:return[4,this._taskStore.getTask(o,n.sessionId)];case 6:a=_state.sent();if(!a)throw new er(gr.InvalidParams,"Task not found: ".concat(o));if(!!Yh(a.status))return[3,9];return[4,this._waitForTaskUpdate(o,n.signal)];case 7:_state.sent();return[4,i()];case 8:return[2,_state.sent()];case 9:if(!Yh(a.status))return[3,11];return[4,this._taskStore.getTaskResult(o,n.sessionId)];case 10:l10=_state.sent();return[2,(this._clearTaskQueue(o),_object_spread_props(_object_spread({},l10),{_meta:_object_spread_props(_object_spread({},l10._meta),_define_property({},Jh,{taskId:o}))}))];case 11:return[4,i()];case 12:return[2,_state.sent()]}})}).call(_this)};return[4,i()];case 1:return[2,_state.sent()]}})}).call(_this)}),this.setRequestHandler(vR,function(r,n){return _async_to_generator(function(){var i,_ref,_$o,a,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,this._taskStore.listTasks((i=r.params)==null?void 0:i.cursor,n.sessionId)];case 1:_ref=_state.sent(),_$o=_ref.tasks,a=_ref.nextCursor;return[2,{tasks:_$o,nextCursor:a,_meta:{}}];case 2:o=_state.sent();throw new er(gr.InvalidParams,"Failed to list tasks: ".concat(_instanceof(o,Error)?o.message:String(o)));case 3:return[2]}})}).call(_this)}),this.setRequestHandler(bR,function(r,n){return _async_to_generator(function(){var _$i,o,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);return[4,this._taskStore.getTask(r.params.taskId,n.sessionId)];case 1:_$i=_state.sent();if(!_$i)throw new er(gr.InvalidParams,"Task not found: ".concat(r.params.taskId));if(Yh(_$i.status))throw new er(gr.InvalidParams,"Cannot cancel task in terminal status: ".concat(_$i.status));return[4,this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId)];case 2:_state.sent(),this._clearTaskQueue(r.params.taskId);return[4,this._taskStore.getTask(r.params.taskId,n.sessionId)];case 3:o=_state.sent();if(!o)throw new er(gr.InvalidParams,"Task not found after cancellation: ".concat(r.params.taskId));return[2,_object_spread({_meta:{}},o)];case 4:i=_state.sent();throw _instanceof(i,er)?i:new er(gr.InvalidRequest,"Failed to cancel task: ".concat(_instanceof(i,Error)?i.message:String(i)));case 5:return[2]}})}).call(_this)}))}_create_class(wR1,[{key:"_oncancel",value:function _oncancel(t){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){if(!t.params.requestId)return[2];r=this._requestHandlerAbortControllers.get(t.params.requestId);r==null||r.abort(t.params.reason);return[2]})}).call(this)}},{key:"_setupTimeout",value:function _setupTimeout(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;this._timeoutInfo.set(t,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}},{key:"_resetTimeout",value:function _resetTimeout(t){var r=this._timeoutInfo.get(t);if(!r)return!1;var n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),er.fromError(gr.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}},{key:"_cleanupTimeout",value:function _cleanupTimeout(t){var r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}},{key:"connect",value:function connect(t){return _async_to_generator(function(){var _this,o,a,s,r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;r=(o=this.transport)==null?void 0:o.onclose;this._transport.onclose=function(){r==null||r(),_this._onclose()};n=(a=this.transport)==null?void 0:a.onerror;this._transport.onerror=function(l){n==null||n(l),_this._onerror(l)};i=(s=this._transport)==null?void 0:s.onmessage;this._transport.onmessage=function(l,c){i==null||i(l,c),w1(l)||LTe(l)?_this._onresponse(l):z5(l)?_this._onrequest(l,c):DTe(l)?_this._onnotification(l):_this._onerror(new Error("Unknown message type: ".concat(JSON.stringify(l))))};return[4,this._transport.start()];case 1:_state.sent();return[2]}})}).call(this)}},{key:"_onclose",value:function _onclose(){var n;var t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=this._timeoutInfo.values()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;clearTimeout(i.timeoutId)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}this._timeoutInfo.clear();var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator1=this._requestHandlerAbortControllers.values()[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var i10=_step1.value;i10.abort()}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}this._requestHandlerAbortControllers.clear();var r=er.fromError(gr.ConnectionClosed,"Connection closed");this._transport=void 0,(n=this.onclose)==null||n.call(this);var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;try{for(var _iterator2=t.values()[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var i11=_step2.value;i11(r)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}},{key:"_onerror",value:function _onerror(t){var r;(r=this.onerror)==null||r.call(this,t)}},{key:"_onnotification",value:function _onnotification(t){var _this=this;var n;var r=(n=this._notificationHandlers.get(t.method))!=null?n:this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(function(){return r(t)}).catch(function(i){return _this._onerror(new Error("Uncaught error in notification handler: ".concat(i)))})}},{key:"_onrequest",value:function _onrequest(t,r){var _this=this;var d,u,p,m,h;var n=(d=this._requestHandlers.get(t.method))!=null?d:this.fallbackRequestHandler,i=this._transport,o=(m=(p=(u=t.params)==null?void 0:u._meta)==null?void 0:p[Jh])==null?void 0:m.taskId;if(n===void 0){var g={jsonrpc:"2.0",id:t.id,error:{code:gr.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:g,timestamp:Date.now()},i==null?void 0:i.sessionId).catch(function(x){return _this._onerror(new Error("Failed to enqueue error response: ".concat(x)))}):i==null||i.send(g).catch(function(x){return _this._onerror(new Error("Failed to send an error response: ".concat(x)))});return}var a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);var s=OTe(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,i==null?void 0:i.sessionId):void 0,c={signal:a.signal,sessionId:i==null?void 0:i.sessionId,_meta:(h=t.params)==null?void 0:h._meta,sendNotification:function(g){return _async_to_generator(function(){var x;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(a.signal.aborted)return[2];x={relatedRequestId:t.id};o&&(x.relatedTask={taskId:o});return[4,this.notification(g,x)];case 1:_state.sent();return[2]}})}).call(_this)},sendRequest:function(g,x,v){return _async_to_generator(function(){var b,w,y,_,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(a.signal.aborted)throw new er(gr.ConnectionClosed,"Request was cancelled");y=_object_spread_props(_object_spread({},v),{relatedRequestId:t.id});o&&!y.relatedTask&&(y.relatedTask={taskId:o});_=(w=(b=y.relatedTask)==null?void 0:b.taskId)!=null?w:o;_tmp=_&&l;if(!_tmp)return[3,2];return[4,l.updateTaskStatus(_,"input_required")];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[4,this.request(g,x,y)];case 3:return[2,_state.sent()]}})}).call(_this)},authInfo:r==null?void 0:r.authInfo,requestId:t.id,requestInfo:r==null?void 0:r.requestInfo,taskId:o,taskStore:l,taskRequestedTtl:s==null?void 0:s.ttl,closeSSEStream:r==null?void 0:r.closeSSEStream,closeStandaloneSSEStream:r==null?void 0:r.closeStandaloneSSEStream};Promise.resolve().then(function(){s&&_this.assertTaskHandlerCapability(t.method)}).then(function(){return n(t,c)}).then(function(g){return _async_to_generator(function(){var x,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(a.signal.aborted)return[2];x={result:g,jsonrpc:"2.0",id:t.id};if(!(o&&this._taskMessageQueue))return[3,2];return[4,this._enqueueTaskMessage(o,{type:"response",message:x,timestamp:Date.now()},i==null?void 0:i.sessionId)];case 1:_tmp=_state.sent();return[3,4];case 2:return[4,i==null?void 0:i.send(x)];case 3:_tmp=_state.sent();_state.label=4;case 4:_tmp;return[2]}})}).call(_this)},function(g){return _async_to_generator(function(){var v,x,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(a.signal.aborted)return[2];x={jsonrpc:"2.0",id:t.id,error:_object_spread({code:Number.isSafeInteger(g.code)?g.code:gr.InternalError,message:(v=g.message)!=null?v:"Internal error"},g.data!==void 0&&{data:g.data})};if(!(o&&this._taskMessageQueue))return[3,2];return[4,this._enqueueTaskMessage(o,{type:"error",message:x,timestamp:Date.now()},i==null?void 0:i.sessionId)];case 1:_tmp=_state.sent();return[3,4];case 2:return[4,i==null?void 0:i.send(x)];case 3:_tmp=_state.sent();_state.label=4;case 4:_tmp;return[2]}})}).call(_this)}).catch(function(g){return _this._onerror(new Error("Failed to send response: ".concat(g)))}).finally(function(){_this._requestHandlerAbortControllers.get(t.id)===a&&_this._requestHandlerAbortControllers.delete(t.id)})}},{key:"_onprogress",value:function _onprogress(t){var _t_params=t.params,r=_t_params.progressToken,n=_object_without_properties(_t_params,["progressToken"]),i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error("Received a progress notification for an unknown token: ".concat(JSON.stringify(t))));return}var a=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(l){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),a(l);return}o(n)}},{key:"_onresponse",value:function _onresponse(t){var r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),w1(t))n(t);else{var a=new er(t.error.code,t.error.message,t.error.data);n(a)}return}var i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error("Received a response for an unknown message ID: ".concat(JSON.stringify(t))));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);var o=!1;if(w1(t)&&t.result&&_type_of(t.result)=="object"){var a9=t.result;if(a9.task&&_type_of(a9.task)=="object"){var s=a9.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,r))}}if(o||this._progressHandlers.delete(r),w1(t))i(t);else{var a10=er.fromError(t.error.code,t.error.message,t.error.data);i(a10)}}},{key:"transport",get:function get1(){return this._transport}},{key:"close",value:function close(){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(t=this._transport)==null?void 0:t.close()];case 1:_state.sent();return[2]}})}).call(this)}},{key:"requestStream",value:function requestStream(t,r,n){return _wrap_async_generator(function(){var a,s,l,c,_ref,i,_tmp,d,o,_this,_loop,_$d,_ret,d10;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=n!=null?n:{},i=_ref.task;if(!!i)return[3,7];_state.label=1;case 1:_state.trys.push([1,4,,6]);_tmp={type:"result"};return[4,_await_async_generator(this.request(t,r,n))];case 2:return[4,(_tmp.result=_state.sent(),_tmp)];case 3:_state.sent();return[3,6];case 4:d=_state.sent();return[4,{type:"error",error:_instanceof(d,er)?d:new er(gr.InternalError,String(d))}];case 5:_state.sent();return[3,6];case 6:return[2];case 7:_state.trys.push([7,15,,17]);_loop=function(){var u,_tmp,_tmp1,_tmp2,_tmp3,_tmp4,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,_await_async_generator(_this.getTask({taskId:o},n))];case 1:u=_state.sent();return[4,{type:"taskStatus",task:u}];case 2:if(!(_state.sent(),Yh(u.status)))return[3,12];if(!(u.status==="completed"))return[3,5];_tmp1={type:"result"};return[4,_await_async_generator(_this.getTaskResult({taskId:o},r,n))];case 3:return[4,(_tmp1.result=_state.sent(),_tmp1)];case 4:_tmp=_state.sent();return[3,11];case 5:if(!(u.status==="failed"))return[3,7];return[4,{type:"error",error:new er(gr.InternalError,"Task ".concat(o," failed"))}];case 6:_tmp2=_state.sent();return[3,10];case 7:_tmp3=u.status==="cancelled";if(!_tmp3)return[3,9];return[4,{type:"error",error:new er(gr.InternalError,"Task ".concat(o," was cancelled"))}];case 8:_tmp3=_state.sent();_state.label=9;case 9:_tmp2=_tmp3;_state.label=10;case 10:_tmp=_tmp2;_state.label=11;case 11:_tmp;return[2,{v:void void 0}];case 12:if(!(u.status==="input_required"))return[3,15];_tmp4={type:"result"};return[4,_await_async_generator(_this.getTaskResult({taskId:o},r,n))];case 13:return[4,(_tmp4.result=_state.sent(),_tmp4)];case 14:_state.sent();return[2,{v:void void 0}];case 15:p=(l=(s=u.pollInterval)!=null?s:(a=_this._options)==null?void 0:a.defaultTaskPollInterval)!=null?l:1e3;return[4,_await_async_generator(new Promise(function(m){return setTimeout(m,p)}))];case 16:_state.sent(),(c=n==null?void 0:n.signal)==null||c.throwIfAborted();return[2]}})};return[4,_await_async_generator(this.request(t,k1,n))];case 8:_$d=_state.sent();if(!_$d.task)return[3,10];o=_$d.task.taskId;return[4,{type:"taskCreated",task:_$d.task}];case 9:_state.sent();return[3,11];case 10:throw new er(gr.InternalError,"Task creation did not return a task");case 11:_this=this;return[5,_ts_values(_loop())];case 12:_ret=_state.sent();if(_type_of(_ret)==="object")return[2,_ret.v];_state.label=13;case 13:return[3,11];case 14:return[3,17];case 15:d10=_state.sent();return[4,{type:"error",error:_instanceof(d10,er)?d10:new er(gr.InternalError,String(d10))}];case 16:_state.sent();return[3,17];case 17:return[2]}})}).call(this)}},{key:"request",value:function request(t,r,n){var _this=this;var _ref=n!=null?n:{},i=_ref.relatedRequestId,o=_ref.resumptionToken,a=_ref.onresumptiontoken,s=_ref.task,l=_ref.relatedTask;return new Promise(function(c,d){var y,_,b,w,S,k,E;var u=function(C){d(C)};if(!_this._transport){u(new Error("Not connected"));return}if(((y=_this._options)==null?void 0:y.enforceStrictCapabilities)===!0)try{_this.assertCapabilityForMethod(t.method),s&&_this.assertTaskCapability(t.method)}catch(C){u(C);return}(_=n==null?void 0:n.signal)==null||_.throwIfAborted();var p=_this._requestMessageId++,m=_object_spread_props(_object_spread({},t),{jsonrpc:"2.0",id:p});n!=null&&n.onprogress&&(_this._progressHandlers.set(p,n.onprogress),m.params=_object_spread_props(_object_spread({},t.params),{_meta:_object_spread_props(_object_spread({},((b=t.params)==null?void 0:b._meta)||{}),{progressToken:p})})),s&&(m.params=_object_spread_props(_object_spread({},m.params),{task:s})),l&&(m.params=_object_spread_props(_object_spread({},m.params),{_meta:_object_spread_props(_object_spread({},((w=m.params)==null?void 0:w._meta)||{}),_define_property({},Jh,l))}));var h=function(C){var I;_this._responseHandlers.delete(p),_this._progressHandlers.delete(p),_this._cleanupTimeout(p),(I=_this._transport)==null||I.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(C)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(function(O){return _this._onerror(new Error("Failed to send cancellation: ".concat(O)))});var T=_instanceof(C,er)?C:new er(gr.RequestTimeout,String(C));d(T)};_this._responseHandlers.set(p,function(C){var T;if(!((T=n==null?void 0:n.signal)!=null&&T.aborted)){if(_instanceof(C,Error))return d(C);try{var _$I=od(r,C.result);_$I.success?c(_$I.data):d(_$I.error)}catch(I){d(I)}}}),(S=n==null?void 0:n.signal)==null||S.addEventListener("abort",function(){var _$C;h((_$C=n==null?void 0:n.signal)==null?void 0:_$C.reason)});var g=(k=n==null?void 0:n.timeout)!=null?k:rAt,x=function(){return h(er.fromError(gr.RequestTimeout,"Request timed out",{timeout:g}))};_this._setupTimeout(p,g,n==null?void 0:n.maxTotalTimeout,x,(E=n==null?void 0:n.resetTimeoutOnProgress)!=null?E:!1);var v=l==null?void 0:l.taskId;if(v){var _$C=function(T){var I=_this._responseHandlers.get(p);I?I(T):_this._onerror(new Error("Response handler missing for side-channeled request ".concat(p)))};_this._requestResolvers.set(p,_$C),_this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(function(T){_this._cleanupTimeout(p),d(T)})}else _this._transport.send(m,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(function(C){_this._cleanupTimeout(p),d(C)})})}},{key:"getTask",value:function getTask(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"tasks/get",params:t},xR,r)]})}).call(this)}},{key:"getTaskResult",value:function getTaskResult(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"tasks/result",params:t},r,n)]})}).call(this)}},{key:"listTasks",value:function listTasks(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"tasks/list",params:t},_R,r)]})}).call(this)}},{key:"cancelTask",value:function cancelTask(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"tasks/cancel",params:t},UTe,r)]})}).call(this)}},{key:"notification",value:function notification(t,r){return _async_to_generator(function(){var _this,s,l,c,d,u,n,p,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);n=(s=r==null?void 0:r.relatedTask)==null?void 0:s.taskId;if(!n)return[3,2];p=_object_spread_props(_object_spread({},t),{jsonrpc:"2.0",params:_object_spread_props(_object_spread({},t.params),{_meta:_object_spread_props(_object_spread({},((l=t.params)==null?void 0:l._meta)||{}),_define_property({},Jh,r.relatedTask))})});return[4,this._enqueueTaskMessage(n,{type:"notification",message:p,timestamp:Date.now()})];case 1:_state.sent();return[2];case 2:if(((d=(c=this._options)==null?void 0:c.debouncedNotificationMethods)!=null?d:[]).includes(t.method)&&!t.params&&!(r!=null&&r.relatedRequestId)&&!(r!=null&&r.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return[2];this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(function(){var m,h;if(_this._pendingDebouncedNotifications.delete(t.method),!_this._transport)return;var p=_object_spread_props(_object_spread({},t),{jsonrpc:"2.0"});r!=null&&r.relatedTask&&(p=_object_spread_props(_object_spread({},p),{params:_object_spread_props(_object_spread({},p.params),{_meta:_object_spread_props(_object_spread({},((m=p.params)==null?void 0:m._meta)||{}),_define_property({},Jh,r.relatedTask))})})),(h=_this._transport)==null||h.send(p,r).catch(function(g){return _this._onerror(g)})});return[2]}a=_object_spread_props(_object_spread({},t),{jsonrpc:"2.0"});r!=null&&r.relatedTask&&(a=_object_spread_props(_object_spread({},a),{params:_object_spread_props(_object_spread({},a.params),{_meta:_object_spread_props(_object_spread({},((u=a.params)==null?void 0:u._meta)||{}),_define_property({},Jh,r.relatedTask))})}));return[4,this._transport.send(a,r)];case 3:_state.sent();return[2]}})}).call(this)}},{key:"setRequestHandler",value:function setRequestHandler(t,r){var n=UH(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,function(i,o){var a=BH(t,i);return Promise.resolve(r(a,o))})}},{key:"removeRequestHandler",value:function removeRequestHandler(t){this._requestHandlers.delete(t)}},{key:"assertCanSetRequestHandler",value:function assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error("A request handler for ".concat(t," already exists, which would be overridden"))}},{key:"setNotificationHandler",value:function setNotificationHandler(t,r){var n=UH(t);this._notificationHandlers.set(n,function(i){var o=BH(t,i);return Promise.resolve(r(o))})}},{key:"removeNotificationHandler",value:function removeNotificationHandler(t){this._notificationHandlers.delete(t)}},{key:"_cleanupTaskProgressHandler",value:function _cleanupTaskProgressHandler(t){var r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}},{key:"_enqueueTaskMessage",value:function _enqueueTaskMessage(t,r,n){return _async_to_generator(function(){var o,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");i=(o=this._options)==null?void 0:o.maxTaskQueueSize;return[4,this._taskMessageQueue.enqueue(t,r,n,i)];case 1:_state.sent();return[2]}})}).call(this)}},{key:"_clearTaskQueue",value:function _clearTaskQueue(t,r){return _async_to_generator(function(){var n,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,i,o,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._taskMessageQueue)return[3,2];return[4,this._taskMessageQueue.dequeueAll(t,r)];case 1:n=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=n[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){i=_step.value;if(i.type==="request"&&z5(i.message)){o=i.message.id,a=this._requestResolvers.get(o);a?(a(new er(gr.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error("Resolver missing for request ".concat(o," during task ").concat(t," cleanup")))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=2;case 2:return[2]}})}).call(this)}},{key:"_waitForTaskUpdate",value:function _waitForTaskUpdate(t,r){return _async_to_generator(function(){var i,o,a,n,s,s10;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=(o=(i=this._options)==null?void 0:i.defaultTaskPollInterval)!=null?o:1e3;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,(a=this._taskStore)==null?void 0:a.getTask(t)];case 2:s=_state.sent();s!=null&&s.pollInterval&&(n=s.pollInterval);return[3,4];case 3:s10=_state.sent();return[3,4];case 4:return[2,new Promise(function(s,l){if(r.aborted){l(new er(gr.InvalidRequest,"Request cancelled"));return}var c=setTimeout(s,n);r.addEventListener("abort",function(){clearTimeout(c),l(new er(gr.InvalidRequest,"Request cancelled"))},{once:!0})})]}})}).call(this)}},{key:"requestTaskStore",value:function requestTaskStore(t,r){var _this=this;var n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:function(i){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!t)throw new Error("No request provided");return[4,n.createTask(i,t.id,{method:t.method,params:t.params},r)];case 1:return[2,_state.sent()]}})})()},getTask:function(i){return _async_to_generator(function(){var o;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.getTask(i,r)];case 1:o=_state.sent();if(!o)throw new er(gr.InvalidParams,"Failed to retrieve task: Task not found");return[2,o]}})})()},storeTaskResult:function(i,o,a){return _async_to_generator(function(){var s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.storeTaskResult(i,o,a,r)];case 1:_state.sent();return[4,n.getTask(i,r)];case 2:s=_state.sent();if(!s)return[3,4];l=W5.parse({method:"notifications/tasks/status",params:s});return[4,this.notification(l)];case 3:_state.sent(),Yh(s.status)&&this._cleanupTaskProgressHandler(i);_state.label=4;case 4:return[2]}})}).call(_this)},getTaskResult:function(i){return n.getTaskResult(i,r)},updateTaskStatus:function(i,o,a){return _async_to_generator(function(){var s,l,c;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,n.getTask(i,r)];case 1:s=_state.sent();if(!s)throw new er(gr.InvalidParams,'Task "'.concat(i,'" not found - it may have been cleaned up'));if(Yh(s.status))throw new er(gr.InvalidParams,'Cannot update task "'.concat(i,'" from terminal status "').concat(s.status,'" to "').concat(o,'". Terminal states (completed, failed, cancelled) cannot transition to other states.'));return[4,n.updateTaskStatus(i,o,a,r)];case 2:_state.sent();return[4,n.getTask(i,r)];case 3:l=_state.sent();if(!l)return[3,5];c=W5.parse({method:"notifications/tasks/status",params:l});return[4,this.notification(c)];case 4:_state.sent(),Yh(l.status)&&this._cleanupTaskProgressHandler(i);_state.label=5;case 5:return[2]}})}).call(_this)},listTasks:function(i){return n.listTasks(i,r)}}}}]);return wR1}();function KTe(e){return e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&!Array.isArray(e)}function QTe(e,t){var r=_object_spread({},e);for(var n in t){var i=n,o=t[i];if(o===void 0)continue;var a=r[i];KTe(a)&&KTe(o)?r[i]=_object_spread({},a,o):r[i]=o}return r}var U9e=nr(AK(),1),B9e=nr(j9e(),1);function aOt(){var e=new U9e.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,B9e.default)(e),e}var nM=/*#__PURE__*/function(){"use strict";function nM1(t){_class_call_check(this,nM1);this._ajv=t!=null?t:aOt()}_create_class(nM1,[{key:"getValidator",value:function getValidator(t){var _this=this;var n;var r="$id"in t&&typeof t.$id=="string"?(n=this._ajv.getSchema(t.$id))!=null?n:this._ajv.compile(t):this._ajv.compile(t);return function(i){return r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:_this._ajv.errorsText(r.errors)}}}}]);return nM1}();var iM=/*#__PURE__*/function(){"use strict";function iM1(t){_class_call_check(this,iM1);this._client=t}_create_class(iM1,[{key:"callToolStream",value:function callToolStream(_01,_11){return _wrap_async_generator(function(t){var r,n,l,i,o,a,s,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,_value,c,d,_$u,u,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:P_,n=_arguments.length>2?_arguments[2]:void 0;i=this._client,o=_object_spread_props(_object_spread({},n),{task:(l=n==null?void 0:n.task)!=null?l:i.isToolTask(t.name)?{}:void 0}),a=i.requestStream({method:"tools/call",params:t},r,o),s=i.getToolOutputValidator(t.name);_iteratorAbruptCompletion=false,_didIteratorError=false;_state.label=1;case 1:_state.trys.push([1,17,18,23]);_iterator=_async_iterator(a);_state.label=2;case 2:return[4,_await_async_generator(_iterator.next())];case 3:if(!(_iteratorAbruptCompletion=!(_step=_state.sent()).done))return[3,16];_value=_step.value;c=_value;if(!(c.type==="result"&&s))return[3,13];d=c.result;if(!(!d.structuredContent&&!d.isError))return[3,5];return[4,{type:"error",error:new er(gr.InvalidRequest,"Tool ".concat(t.name," has an output schema but did not return structured content"))}];case 4:_state.sent();return[2];case 5:if(!d.structuredContent)return[3,13];_state.label=6;case 6:_state.trys.push([6,9,,13]);_$u=s(d.structuredContent);if(!!_$u.valid)return[3,8];return[4,{type:"error",error:new er(gr.InvalidParams,"Structured content does not match the tool's output schema: ".concat(_$u.errorMessage))}];case 7:_state.sent();return[2];case 8:return[3,13];case 9:u=_state.sent();if(!_instanceof(u,er))return[3,11];return[4,{type:"error",error:u}];case 10:_state.sent();return[2];case 11:return[4,{type:"error",error:new er(gr.InvalidParams,"Failed to validate structured content: ".concat(_instanceof(u,Error)?u.message:String(u)))}];case 12:_state.sent();return[2];case 13:return[4,c];case 14:_state.sent();_state.label=15;case 15:_iteratorAbruptCompletion=false;return[3,2];case 16:return[3,23];case 17:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,23];case 18:_state.trys.push([18,,21,22]);if(!(_iteratorAbruptCompletion&&_iterator.return!=null))return[3,20];return[4,_await_async_generator(_iterator.return())];case 19:_state.sent();_state.label=20;case 20:return[3,22];case 21:if(_didIteratorError){throw _iteratorError}return[7];case 22:return[7];case 23:return[2]}})}).apply(this,arguments)}},{key:"getTask",value:function getTask(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this._client.getTask({taskId:t},r)]})}).call(this)}},{key:"getTaskResult",value:function getTaskResult(t,r,n){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this._client.getTaskResult({taskId:t},r,n)]})}).call(this)}},{key:"listTasks",value:function listTasks(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this._client.listTasks(t?{cursor:t}:void 0,r)]})}).call(this)}},{key:"cancelTask",value:function cancelTask(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this._client.cancelTask({taskId:t},r)]})}).call(this)}},{key:"requestStream",value:function requestStream(t,r,n){return this._client.requestStream(t,r,n)}}]);return iM1}();function q9e(e,t,r){var n;if(!e)throw new Error("".concat(r," does not support task creation (required for ").concat(t,")"));switch(t){case"tools/call":if(!((n=e.tools)!=null&&n.call))throw new Error("".concat(r," does not support task creation for tools/call (required for ").concat(t,")"));break;default:break}}function W9e(e,t,r){var n,i;if(!e)throw new Error("".concat(r," does not support task creation (required for ").concat(t,")"));switch(t){case"sampling/createMessage":if(!((n=e.sampling)!=null&&n.createMessage))throw new Error("".concat(r," does not support task creation for sampling/createMessage (required for ").concat(t,")"));break;case"elicitation/create":if(!((i=e.elicitation)!=null&&i.create))throw new Error("".concat(r," does not support task creation for elicitation/create (required for ").concat(t,")"));break;default:break}}function oM(e,t){if(!(!e||t===null||(typeof t==="undefined"?"undefined":_type_of(t))!="object")){if(e.type==="object"&&e.properties&&_type_of(e.properties)=="object"){var r=t,n=e.properties;var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=Object.keys(n)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;var o=n[i];r[i]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(r[i]=o.default),r[i]!==void 0&&oM(o,r[i])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}var _iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;if(Array.isArray(e.anyOf))try{for(var _iterator1=e.anyOf[Symbol.iterator](),_step1;!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=true){var r10=_step1.value;typeof r10!="boolean"&&oM(r10,t)}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}var _iteratorNormalCompletion2=true,_didIteratorError2=false,_iteratorError2=undefined;if(Array.isArray(e.oneOf))try{for(var _iterator2=e.oneOf[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var r11=_step2.value;typeof r11!="boolean"&&oM(r11,t)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}}function sOt(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};var t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}var aM=/*#__PURE__*/function(wR1){"use strict";_inherits(aM1,wR1);function aM1(t,r){_class_call_check(this,aM1);var _this;var n,i;_this=_call_super(this,aM1,[r]),_this._clientInfo=t,_this._cachedToolOutputValidators=new Map,_this._cachedKnownTaskTools=new Set,_this._cachedRequiredTaskTools=new Set,_this._listChangedDebounceTimers=new Map,_this._capabilities=(n=r==null?void 0:r.capabilities)!=null?n:{},_this._jsonSchemaValidator=(i=r==null?void 0:r.jsonSchemaValidator)!=null?i:new nM,r!=null&&r.listChanged&&(_this._pendingListChangedConfig=r.listChanged);return _this}_create_class(aM1,[{key:"_setupListChangedHandlers",value:function _setupListChangedHandlers(t){var _this=this;var r,n,i,o,a,s;t.tools&&(n=(r=this._serverCapabilities)==null?void 0:r.tools)!=null&&n.listChanged&&this._setupListChangedHandler("tools",$H,t.tools,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.listTools()];case 1:return[2,_state.sent().tools]}})}).call(_this)}),t.prompts&&(o=(i=this._serverCapabilities)==null?void 0:i.prompts)!=null&&o.listChanged&&this._setupListChangedHandler("prompts",MH,t.prompts,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.listPrompts()];case 1:return[2,_state.sent().prompts]}})}).call(_this)}),t.resources&&(s=(a=this._serverCapabilities)==null?void 0:a.resources)!=null&&s.listChanged&&this._setupListChangedHandler("resources",CH,t.resources,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.listResources()];case 1:return[2,_state.sent().resources]}})}).call(_this)})}},{key:"experimental",get:function get1(){return this._experimental||(this._experimental={tasks:new iM(this)}),this._experimental}},{key:"registerCapabilities",value:function registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=QTe(this._capabilities,t)}},{key:"setRequestHandler",value:function setRequestHandler(t,r){var _this=this;var n=sR(t),i=n==null?void 0:n.method;if(!i)throw new Error("Schema is missing a method literal");var o=lR(i);if(typeof o!="string")throw new Error("Schema method literal must be a string");var a=o;if(a==="elicitation/create"){var s=function(l,c){return _async_to_generator(function(){var y,_,b,d,w,_d_data,u,_sOt,p,m,h,w10,S,g,w11,x,v;return _ts_generator(this,function(_state){switch(_state.label){case 0:d=od(FH,l);if(!d.success){w=_instanceof(d.error,Error)?d.error.message:String(d.error);throw new er(gr.InvalidParams,"Invalid elicitation request: ".concat(w))}_d_data=d.data,u=_d_data.params;u.mode=(y=u.mode)!=null?y:"form";_sOt=sOt(this._capabilities.elicitation),p=_sOt.supportsFormMode,m=_sOt.supportsUrlMode;if(u.mode==="form"&&!p)throw new er(gr.InvalidParams,"Client does not support form-mode elicitation requests");if(u.mode==="url"&&!m)throw new er(gr.InvalidParams,"Client does not support URL-mode elicitation requests");return[4,Promise.resolve(r(l,c))];case 1:h=_state.sent();if(u.task){w10=od(k1,h);if(!w10.success){S=_instanceof(w10.error,Error)?w10.error.message:String(w10.error);throw new er(gr.InvalidParams,"Invalid task creation result: ".concat(S))}return[2,w10.data]}g=od(zH,h);if(!g.success){w11=_instanceof(g.error,Error)?g.error.message:String(g.error);throw new er(gr.InvalidParams,"Invalid elicitation result: ".concat(w11))}x=g.data,v=u.mode==="form"?u.requestedSchema:void 0;if(u.mode==="form"&&x.action==="accept"&&x.content&&v&&(b=(_=this._capabilities.elicitation)==null?void 0:_.form)!=null&&b.applyDefaults)try{oM(v,x.content)}catch(w){}return[2,x]}})}).call(_this)};return _get(_get_prototype_of(aM1.prototype),"setRequestHandler",this).call(this,t,s)}if(a==="sampling/createMessage"){var s10=function(l,c){return _async_to_generator(function(){var d,x,_d_data,u,p,x10,v,h,g,x11;return _ts_generator(this,function(_state){switch(_state.label){case 0:d=od(NH,l);if(!d.success){x=_instanceof(d.error,Error)?d.error.message:String(d.error);throw new er(gr.InvalidParams,"Invalid sampling request: ".concat(x))}_d_data=d.data,u=_d_data.params;return[4,Promise.resolve(r(l,c))];case 1:p=_state.sent();if(u.task){x10=od(k1,p);if(!x10.success){v=_instanceof(x10.error,Error)?x10.error.message:String(x10.error);throw new er(gr.InvalidParams,"Invalid task creation result: ".concat(v))}return[2,x10.data]}h=u.tools||u.toolChoice?LH:DH,g=od(h,p);if(!g.success){x11=_instanceof(g.error,Error)?g.error.message:String(g.error);throw new er(gr.InvalidParams,"Invalid sampling result: ".concat(x11))}return[2,g.data]}})})()};return _get(_get_prototype_of(aM1.prototype),"setRequestHandler",this).call(this,t,s10)}return _get(_get_prototype_of(aM1.prototype),"setRequestHandler",this).call(this,t,r)}},{key:"assertCapability",value:function assertCapability(t,r){var n;if(!((n=this._serverCapabilities)!=null&&n[t]))throw new Error("Server does not support ".concat(t," (required for ").concat(r,")"))}},{key:"connect",value:function connect(t,r){var _this=this;var _this1=this,_superprop_get_connect=function(){return _get(_get_prototype_of(aM1.prototype),"connect",_this)};return _async_to_generator(function(){var _$n,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,_superprop_get_connect().call(_this1,t)];case 1:if(!(_state.sent(),t.sessionId===void 0))return[3,6];_state.label=2;case 2:_state.trys.push([2,5,,6]);return[4,this.request({method:"initialize",params:{protocolVersion:A_,capabilities:this._capabilities,clientInfo:this._clientInfo}},vH,r)];case 3:_$n=_state.sent();if(_$n===void 0)throw new Error("Server sent invalid initialize result: ".concat(_$n));if(!PTe.includes(_$n.protocolVersion))throw new Error("Server's protocol version is not supported: ".concat(_$n.protocolVersion));this._serverCapabilities=_$n.capabilities,this._serverVersion=_$n.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(_$n.protocolVersion),this._instructions=_$n.instructions;return[4,this.notification({method:"notifications/initialized"})];case 4:_state.sent(),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0);return[3,6];case 5:n=_state.sent();throw this.close(),n;case 6:return[2]}})}).call(this)}},{key:"getServerCapabilities",value:function getServerCapabilities(){return this._serverCapabilities}},{key:"getServerVersion",value:function getServerVersion(){return this._serverVersion}},{key:"getInstructions",value:function getInstructions(){return this._instructions}},{key:"assertCapabilityForMethod",value:function assertCapabilityForMethod(t){var r,n,i,o,a;switch(t){case"logging/setLevel":if(!((r=this._serverCapabilities)!=null&&r.logging))throw new Error("Server does not support logging (required for ".concat(t,")"));break;case"prompts/get":case"prompts/list":if(!((n=this._serverCapabilities)!=null&&n.prompts))throw new Error("Server does not support prompts (required for ".concat(t,")"));break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!((i=this._serverCapabilities)!=null&&i.resources))throw new Error("Server does not support resources (required for ".concat(t,")"));if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error("Server does not support resource subscriptions (required for ".concat(t,")"));break;case"tools/call":case"tools/list":if(!((o=this._serverCapabilities)!=null&&o.tools))throw new Error("Server does not support tools (required for ".concat(t,")"));break;case"completion/complete":if(!((a=this._serverCapabilities)!=null&&a.completions))throw new Error("Server does not support completions (required for ".concat(t,")"));break;case"initialize":break;case"ping":break}}},{key:"assertNotificationCapability",value:function assertNotificationCapability(t){var r;switch(t){case"notifications/roots/list_changed":if(!((r=this._capabilities.roots)!=null&&r.listChanged))throw new Error("Client does not support roots list changed notifications (required for ".concat(t,")"));break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}},{key:"assertRequestHandlerCapability",value:function assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error("Client does not support sampling capability (required for ".concat(t,")"));break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error("Client does not support elicitation capability (required for ".concat(t,")"));break;case"roots/list":if(!this._capabilities.roots)throw new Error("Client does not support roots capability (required for ".concat(t,")"));break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error("Client does not support tasks capability (required for ".concat(t,")"));break;case"ping":break}}},{key:"assertTaskCapability",value:function assertTaskCapability(t){var r,n;q9e((n=(r=this._serverCapabilities)==null?void 0:r.tasks)==null?void 0:n.requests,t,"Server")}},{key:"assertTaskHandlerCapability",value:function assertTaskHandlerCapability(t){var r;this._capabilities&&W9e((r=this._capabilities.tasks)==null?void 0:r.requests,t,"Client")}},{key:"ping",value:function ping(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"ping"},S1,t)]})}).call(this)}},{key:"complete",value:function complete(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"completion/complete",params:t},jH,r)]})}).call(this)}},{key:"setLoggingLevel",value:function setLoggingLevel(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"logging/setLevel",params:{level:t}},S1,r)]})}).call(this)}},{key:"getPrompt",value:function getPrompt(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"prompts/get",params:t},RH,r)]})}).call(this)}},{key:"listPrompts",value:function listPrompts(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"prompts/list",params:t},EH,r)]})}).call(this)}},{key:"listResources",value:function listResources(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"resources/list",params:t},bH,r)]})}).call(this)}},{key:"listResourceTemplates",value:function listResourceTemplates(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"resources/templates/list",params:t},wH,r)]})}).call(this)}},{key:"readResource",value:function readResource(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"resources/read",params:t},kH,r)]})}).call(this)}},{key:"subscribeResource",value:function subscribeResource(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"resources/subscribe",params:t},S1,r)]})}).call(this)}},{key:"unsubscribeResource",value:function unsubscribeResource(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.request({method:"resources/unsubscribe",params:t},S1,r)]})}).call(this)}},{key:"callTool",value:function callTool(_01,_11){return _async_to_generator(function(t){var r,n,i,o,_$a;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:P_,n=_arguments.length>2?_arguments[2]:void 0;if(this.isToolTaskRequired(t.name))throw new er(gr.InvalidRequest,'Tool "'.concat(t.name,'" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.'));return[4,this.request({method:"tools/call",params:t},r,n)];case 1:i=_state.sent(),o=this.getToolOutputValidator(t.name);if(o){if(!i.structuredContent&&!i.isError)throw new er(gr.InvalidRequest,"Tool ".concat(t.name," has an output schema but did not return structured content"));if(i.structuredContent)try{_$a=o(i.structuredContent);if(!_$a.valid)throw new er(gr.InvalidParams,"Structured content does not match the tool's output schema: ".concat(_$a.errorMessage))}catch(a){throw _instanceof(a,er)?a:new er(gr.InvalidParams,"Failed to validate structured content: ".concat(_instanceof(a,Error)?a.message:String(a)))}}return[2,i]}})}).apply(this,arguments)}},{key:"isToolTask",value:function isToolTask(t){var r,n,i,o;return(o=(i=(n=(r=this._serverCapabilities)==null?void 0:r.tasks)==null?void 0:n.requests)==null?void 0:i.tools)!=null&&o.call?this._cachedKnownTaskTools.has(t):!1}},{key:"isToolTaskRequired",value:function isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}},{key:"cacheToolMetadata",value:function cacheToolMetadata(t){var r;this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=t[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;if(n.outputSchema){var o=this._jsonSchemaValidator.getValidator(n.outputSchema);this._cachedToolOutputValidators.set(n.name,o)}var i=(r=n.execution)==null?void 0:r.taskSupport;(i==="required"||i==="optional")&&this._cachedKnownTaskTools.add(n.name),i==="required"&&this._cachedRequiredTaskTools.add(n.name)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"getToolOutputValidator",value:function getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}},{key:"listTools",value:function listTools(t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.request({method:"tools/list",params:t},OH,r)];case 1:n=_state.sent();return[2,(this.cacheToolMetadata(n.tools),n)]}})}).call(this)}},{key:"_setupListChangedHandler",value:function _setupListChangedHandler(t,r,n,i){var _this=this;var o=HTe.safeParse(n);if(!o.success)throw new Error("Invalid ".concat(t," listChanged options: ").concat(o.error.message));if(typeof n.onChanged!="function")throw new Error("Invalid ".concat(t," listChanged options: onChanged must be a function"));var _o_data=o.data,a=_o_data.autoRefresh,s=_o_data.debounceMs,l=n.onChanged,c=function(){return _async_to_generator(function(){var _$u,u,p;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!a){l(null,null);return[2]}_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,i()];case 2:_$u=_state.sent();l(null,_$u);return[3,4];case 3:u=_state.sent();p=_instanceof(u,Error)?u:new Error(String(u));l(p,null);return[3,4];case 4:return[2]}})})()},d=function(){if(s){var u=_this._listChangedDebounceTimers.get(t);u&&clearTimeout(u);var p=setTimeout(c,s);_this._listChangedDebounceTimers.set(t,p)}else c()};this.setNotificationHandler(r,d)}},{key:"sendRootsListChanged",value:function sendRootsListChanged(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.notification({method:"notifications/roots/list_changed"})]})}).call(this)}}]);return aM1}(wR);var K9e=nr(Z9e(),1);function Q9e(e){var t;if(e)try{return K9e.default.parse(e).type}catch(r){var n=((t=e.split(";",1)[0])!=null?t:"").trim().toLowerCase();return n===""||e.slice(n.length).includes(",")?void 0:n}}function sM(e){return e?_instanceof(e,Headers)?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):_object_spread({},e):{}}function J9e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fetch,t=arguments.length>1?arguments[1]:void 0;return t?function(r,n){return _async_to_generator(function(){var i;return _ts_generator(this,function(_state){i=_object_spread_props(_object_spread({},t,n),{headers:n!=null&&n.headers?_object_spread({},sM(t.headers),sM(n.headers)):t.headers});return[2,e(r,i)]})})()}:e}var LK;LK=globalThis.crypto;function gOt(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,LK];case 1:return[2,_state.sent().getRandomValues(new Uint8Array(e))]}})})()}function xOt(e){return _async_to_generator(function(){var t,r,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";_state.label=1;case 1:if(!(n.length<e))return[3,4];return[4,gOt(e-n.length)];case 2:i=_state.sent();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=i[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){o=_step.value;o<r&&(n+=t[o%t.length])}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}_state.label=3;case 3:return[3,1];case 4:return[2,n]}})})()}function yOt(e){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,xOt(e)];case 1:return[2,_state.sent()]}})})()}function vOt(e){return _async_to_generator(function(){var _String,t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,LK];case 1:return[4,_state.sent().subtle.digest("SHA-256",new TextEncoder().encode(e))];case 2:t=_state.sent();return[2,btoa((_String=String).fromCharCode.apply(_String,_to_consumable_array(new Uint8Array(t)))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")]}})})()}function FK(e){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(e||(e=43),e<43||e>128)throw"Expected a length between 43 and 128. Received ".concat(e,".");return[4,yOt(e)];case 1:t=_state.sent();return[4,vOt(t)];case 2:r=_state.sent();return[2,{code_verifier:t,code_challenge:r}]}})})()}var Wa=IE().superRefine(function(e,t){if(!URL.canParse(e))return t.addIssue({code:qF.custom,message:"URL must be parseable",fatal:!0}),Kg}).refine(function(e){var t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),X9e=fo({resource:ce().url(),authorization_servers:lt(Wa).optional(),jwks_uri:ce().url().optional(),scopes_supported:lt(ce()).optional(),bearer_methods_supported:lt(ce()).optional(),resource_signing_alg_values_supported:lt(ce()).optional(),resource_name:ce().optional(),resource_documentation:ce().optional(),resource_policy_uri:ce().url().optional(),resource_tos_uri:ce().url().optional(),tls_client_certificate_bound_access_tokens:jn().optional(),authorization_details_types_supported:lt(ce()).optional(),dpop_signing_alg_values_supported:lt(ce()).optional(),dpop_bound_access_tokens_required:jn().optional()}),zK=fo({issuer:ce(),authorization_endpoint:Wa,token_endpoint:Wa,registration_endpoint:Wa.optional(),scopes_supported:lt(ce()).optional(),response_types_supported:lt(ce()),response_modes_supported:lt(ce()).optional(),grant_types_supported:lt(ce()).optional(),token_endpoint_auth_methods_supported:lt(ce()).optional(),token_endpoint_auth_signing_alg_values_supported:lt(ce()).optional(),service_documentation:Wa.optional(),revocation_endpoint:Wa.optional(),revocation_endpoint_auth_methods_supported:lt(ce()).optional(),revocation_endpoint_auth_signing_alg_values_supported:lt(ce()).optional(),introspection_endpoint:ce().optional(),introspection_endpoint_auth_methods_supported:lt(ce()).optional(),introspection_endpoint_auth_signing_alg_values_supported:lt(ce()).optional(),code_challenge_methods_supported:lt(ce()).optional(),client_id_metadata_document_supported:jn().optional()}),_Ot=fo({issuer:ce(),authorization_endpoint:Wa,token_endpoint:Wa,userinfo_endpoint:Wa.optional(),jwks_uri:Wa,registration_endpoint:Wa.optional(),scopes_supported:lt(ce()).optional(),response_types_supported:lt(ce()),response_modes_supported:lt(ce()).optional(),grant_types_supported:lt(ce()).optional(),acr_values_supported:lt(ce()).optional(),subject_types_supported:lt(ce()),id_token_signing_alg_values_supported:lt(ce()),id_token_encryption_alg_values_supported:lt(ce()).optional(),id_token_encryption_enc_values_supported:lt(ce()).optional(),userinfo_signing_alg_values_supported:lt(ce()).optional(),userinfo_encryption_alg_values_supported:lt(ce()).optional(),userinfo_encryption_enc_values_supported:lt(ce()).optional(),request_object_signing_alg_values_supported:lt(ce()).optional(),request_object_encryption_alg_values_supported:lt(ce()).optional(),request_object_encryption_enc_values_supported:lt(ce()).optional(),token_endpoint_auth_methods_supported:lt(ce()).optional(),token_endpoint_auth_signing_alg_values_supported:lt(ce()).optional(),display_values_supported:lt(ce()).optional(),claim_types_supported:lt(ce()).optional(),claims_supported:lt(ce()).optional(),service_documentation:ce().optional(),claims_locales_supported:lt(ce()).optional(),ui_locales_supported:lt(ce()).optional(),claims_parameter_supported:jn().optional(),request_parameter_supported:jn().optional(),request_uri_parameter_supported:jn().optional(),require_request_uri_registration:jn().optional(),op_policy_uri:Wa.optional(),op_tos_uri:Wa.optional(),client_id_metadata_document_supported:jn().optional()}),ePe=mt(_object_spread({},_Ot.shape,zK.pick({code_challenge_methods_supported:!0}).shape)),tPe=mt({access_token:ce(),id_token:ce().optional(),token_type:ce(),expires_in:S2.number().optional(),scope:ce().optional(),refresh_token:ce().optional()}).strip(),rPe=mt({error:ce(),error_description:ce().optional(),error_uri:ce().optional()}),Y9e=Wa.optional().or(Lt("").transform(function(){})),bOt=mt({redirect_uris:lt(Wa),token_endpoint_auth_method:ce().optional(),grant_types:lt(ce()).optional(),response_types:lt(ce()).optional(),client_name:ce().optional(),client_uri:Wa.optional(),logo_uri:Y9e,scope:ce().optional(),contacts:lt(ce()).optional(),tos_uri:Y9e,policy_uri:ce().optional(),jwks_uri:Wa.optional(),jwks:GE().optional(),software_id:ce().optional(),software_version:ce().optional(),software_statement:ce().optional()}).strip(),wOt=mt({client_id:ce(),client_secret:ce().optional(),client_id_issued_at:un().optional(),client_secret_expires_at:un().optional()}).strip(),nPe=bOt.merge(wOt),YOr=mt({error:ce(),error_description:ce().optional()}).strip(),XOr=mt({token:ce(),token_type_hint:ce().optional()}).strip();function iPe(e){var t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function oPe(param){var e=param.requestedResource,t=param.configuredResource;var r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;var i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",o=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return i.startsWith(o)}var So=/*#__PURE__*/function(Error1){"use strict";_inherits(So1,Error1);function So1(t,r){_class_call_check(this,So1);var _this;_this=_call_super(this,So1,[t]),_this.errorUri=r,_this.name=_this.constructor.name;return _this}_create_class(So1,[{key:"toResponseObject",value:function toResponseObject(){var t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}},{key:"errorCode",get:function get1(){return this.constructor.errorCode}}]);return So1}(_wrap_native_super(Error)),wk=/*#__PURE__*/function(So1){"use strict";_inherits(wk1,So1);function wk1(){_class_call_check(this,wk1);return _call_super(this,wk1,arguments)}return wk1}(So);wk.errorCode="invalid_request";var N1=/*#__PURE__*/function(So1){"use strict";_inherits(N11,So1);function N11(){_class_call_check(this,N11);return _call_super(this,N11,arguments)}return N11}(So);N1.errorCode="invalid_client";var D1=/*#__PURE__*/function(So1){"use strict";_inherits(D11,So1);function D11(){_class_call_check(this,D11);return _call_super(this,D11,arguments)}return D11}(So);D1.errorCode="invalid_grant";var L1=/*#__PURE__*/function(So1){"use strict";_inherits(L11,So1);function L11(){_class_call_check(this,L11);return _call_super(this,L11,arguments)}return L11}(So);L1.errorCode="unauthorized_client";var Sk=/*#__PURE__*/function(So1){"use strict";_inherits(Sk1,So1);function Sk1(){_class_call_check(this,Sk1);return _call_super(this,Sk1,arguments)}return Sk1}(So);Sk.errorCode="unsupported_grant_type";var kk=/*#__PURE__*/function(So1){"use strict";_inherits(kk1,So1);function kk1(){_class_call_check(this,kk1);return _call_super(this,kk1,arguments)}return kk1}(So);kk.errorCode="invalid_scope";var Ck=/*#__PURE__*/function(So1){"use strict";_inherits(Ck1,So1);function Ck1(){_class_call_check(this,Ck1);return _call_super(this,Ck1,arguments)}return Ck1}(So);Ck.errorCode="access_denied";var Hf=/*#__PURE__*/function(So1){"use strict";_inherits(Hf1,So1);function Hf1(){_class_call_check(this,Hf1);return _call_super(this,Hf1,arguments)}return Hf1}(So);Hf.errorCode="server_error";var Ek=/*#__PURE__*/function(So1){"use strict";_inherits(Ek1,So1);function Ek1(){_class_call_check(this,Ek1);return _call_super(this,Ek1,arguments)}return Ek1}(So);Ek.errorCode="temporarily_unavailable";var Tk=/*#__PURE__*/function(So1){"use strict";_inherits(Tk1,So1);function Tk1(){_class_call_check(this,Tk1);return _call_super(this,Tk1,arguments)}return Tk1}(So);Tk.errorCode="unsupported_response_type";var Ak=/*#__PURE__*/function(So1){"use strict";_inherits(Ak1,So1);function Ak1(){_class_call_check(this,Ak1);return _call_super(this,Ak1,arguments)}return Ak1}(So);Ak.errorCode="unsupported_token_type";var Ik=/*#__PURE__*/function(So1){"use strict";_inherits(Ik1,So1);function Ik1(){_class_call_check(this,Ik1);return _call_super(this,Ik1,arguments)}return Ik1}(So);Ik.errorCode="invalid_token";var Pk=/*#__PURE__*/function(So1){"use strict";_inherits(Pk1,So1);function Pk1(){_class_call_check(this,Pk1);return _call_super(this,Pk1,arguments)}return Pk1}(So);Pk.errorCode="method_not_allowed";var Rk=/*#__PURE__*/function(So1){"use strict";_inherits(Rk1,So1);function Rk1(){_class_call_check(this,Rk1);return _call_super(this,Rk1,arguments)}return Rk1}(So);Rk.errorCode="too_many_requests";var F1=/*#__PURE__*/function(So1){"use strict";_inherits(F11,So1);function F11(){_class_call_check(this,F11);return _call_super(this,F11,arguments)}return F11}(So);F1.errorCode="invalid_client_metadata";var Mk=/*#__PURE__*/function(So1){"use strict";_inherits(Mk1,So1);function Mk1(){_class_call_check(this,Mk1);return _call_super(this,Mk1,arguments)}return Mk1}(So);Mk.errorCode="insufficient_scope";var Ok=/*#__PURE__*/function(So1){"use strict";_inherits(Ok1,So1);function Ok1(){_class_call_check(this,Ok1);return _call_super(this,Ok1,arguments)}return Ok1}(So);Ok.errorCode="invalid_target";var _obj2;var aPe=(_obj2={},_define_property(_obj2,wk.errorCode,wk),_define_property(_obj2,N1.errorCode,N1),_define_property(_obj2,D1.errorCode,D1),_define_property(_obj2,L1.errorCode,L1),_define_property(_obj2,Sk.errorCode,Sk),_define_property(_obj2,kk.errorCode,kk),_define_property(_obj2,Ck.errorCode,Ck),_define_property(_obj2,Hf.errorCode,Hf),_define_property(_obj2,Ek.errorCode,Ek),_define_property(_obj2,Tk.errorCode,Tk),_define_property(_obj2,Ak.errorCode,Ak),_define_property(_obj2,Ik.errorCode,Ik),_define_property(_obj2,Pk.errorCode,Pk),_define_property(_obj2,Rk.errorCode,Rk),_define_property(_obj2,F1.errorCode,F1),_define_property(_obj2,Mk.errorCode,Mk),_define_property(_obj2,Ok.errorCode,Ok),_obj2);var Zf=/*#__PURE__*/function(Error1){"use strict";_inherits(Zf1,Error1);function Zf1(t){_class_call_check(this,Zf1);return _call_super(this,Zf1,[t!=null?t:"Unauthorized"])}return Zf1}(_wrap_native_super(Error));function SOt(e){return["client_secret_basic","client_secret_post","none"].includes(e)}var jK="code",UK="S256";function kOt(e,t){var r=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&SOt(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?r?"client_secret_basic":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function COt(e,t,r,n){var i=t.client_id,o=t.client_secret;switch(e){case"client_secret_basic":EOt(i,o,r);return;case"client_secret_post":TOt(i,o,n);return;case"none":AOt(i,n);return;default:throw new Error("Unsupported client authentication method: ".concat(e))}}function EOt(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");var n=btoa("".concat(e,":").concat(t));r.set("Authorization","Basic ".concat(n))}function TOt(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function AOt(e,t){t.set("client_id",e)}function lPe(e){return _async_to_generator(function(){var t,r,_tmp,_$n,i,o,a,s,i10;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=_instanceof(e,Response)?e.status:void 0;if(!_instanceof(e,Response))return[3,2];return[4,e.text()];case 1:_tmp=_state.sent();return[3,3];case 2:_tmp=e;_state.label=3;case 3:r=_tmp;try{_$n=rPe.parse(JSON.parse(r)),i=_$n.error,o=_$n.error_description,a=_$n.error_uri,s=aPe[i]||Hf;return[2,new s(o||"",a)]}catch(n){i10="".concat(t?"HTTP ".concat(t,": "):"","Invalid OAuth error response: ").concat(n,". Raw body: ").concat(r);return[2,new Hf(i10)]}return[2]}})})()}function $k(e,t){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,9]);return[4,BK(e,t)];case 1:return[2,_state.sent()];case 2:i=_state.sent();if(!(_instanceof(i,N1)||_instanceof(i,L1)))return[3,5];return[4,(r=e.invalidateCredentials)==null?void 0:r.call(e,"all")];case 3:_state.sent();return[4,BK(e,t)];case 4:return[2,_state.sent()];case 5:if(!_instanceof(i,D1))return[3,8];return[4,(n=e.invalidateCredentials)==null?void 0:n.call(e,"tokens")];case 6:_state.sent();return[4,BK(e,t)];case 7:return[2,_state.sent()];case 8:throw i;case 9:return[2]}})})()}function BK(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,_,b,w,S,k,E,a,s,l,c,d,_tmp,C,_tmp1,_$C,u,p,m,_$C1,T,O,h,_$C2,g,_$C3,C1,x,_ref,v,y,_tmp2;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.serverUrl,r=param.authorizationCode,n=param.scope,i=param.resourceMetadataUrl,o=param.fetchFn;return[4,(_=e.discoveryState)==null?void 0:_.call(e)];case 1:a=_state.sent(),d=i;if(!(!d&&a!=null&&a.resourceMetadataUrl&&(d=new URL(a.resourceMetadataUrl)),a!=null&&a.authorizationServerUrl))return[3,11];l=a.authorizationServerUrl,s=a.resourceMetadata;if(!((b=a.authorizationServerMetadata)!=null))return[3,2];_tmp=b;return[3,4];case 2:return[4,cPe(l,{fetchFn:o})];case 3:_tmp=_state.sent();_state.label=4;case 4:if(!(c=_tmp,!s))return[3,8];_state.label=5;case 5:_state.trys.push([5,7,,8]);return[4,uPe(t,{resourceMetadataUrl:d},o)];case 6:s=_state.sent();return[3,8];case 7:C=_state.sent();return[3,8];case 8:_tmp1=c!==a.authorizationServerMetadata||s!==a.resourceMetadata;if(!_tmp1)return[3,10];return[4,(w=e.saveDiscoveryState)==null?void 0:w.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:s,authorizationServerMetadata:c})];case 9:_tmp1=_state.sent();_state.label=10;case 10:_tmp1;return[3,14];case 11:return[4,NOt(t,{resourceMetadataUrl:d,fetchFn:o})];case 12:_$C=_state.sent();l=_$C.authorizationServerUrl,c=_$C.authorizationServerMetadata,s=_$C.resourceMetadata;return[4,(S=e.saveDiscoveryState)==null?void 0:S.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:s,authorizationServerMetadata:c})];case 13:_state.sent();_state.label=14;case 14:return[4,POt(t,e,s)];case 15:u=_state.sent(),p=n||((k=s==null?void 0:s.scopes_supported)==null?void 0:k.join(" "))||e.clientMetadata.scope;return[4,Promise.resolve(e.clientInformation())];case 16:m=_state.sent();if(!!m)return[3,21];if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");_$C1=(c==null?void 0:c.client_id_metadata_document_supported)===!0,T=e.clientMetadataUrl;if(T&&!IOt(T))throw new F1("clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ".concat(T));if(!(_$C1&&T))return[3,18];m={client_id:T};return[4,(E=e.saveClientInformation)==null?void 0:E.call(e,m)];case 17:_state.sent();return[3,21];case 18:if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");return[4,jOt(l,{metadata:c,clientMetadata:e.clientMetadata,scope:p,fetchFn:o})];case 19:O=_state.sent();return[4,e.saveClientInformation(O)];case 20:_state.sent(),m=O;_state.label=21;case 21:h=!e.redirectUrl;if(!(r!==void 0||h))return[3,24];return[4,zOt(e,l,{metadata:c,resource:u,authorizationCode:r,fetchFn:o})];case 22:_$C2=_state.sent();return[4,e.saveTokens(_$C2)];case 23:return[2,(_state.sent(),"AUTHORIZED")];case 24:return[4,e.tokens()];case 25:g=_state.sent();if(!(g!=null&&g.refresh_token))return[3,30];_state.label=26;case 26:_state.trys.push([26,29,,30]);return[4,FOt(l,{metadata:c,clientInformation:m,refreshToken:g.refresh_token,resource:u,addClientAuthentication:e.addClientAuthentication,fetchFn:o})];case 27:_$C3=_state.sent();return[4,e.saveTokens(_$C3)];case 28:return[2,(_state.sent(),"AUTHORIZED")];case 29:C1=_state.sent();if(!(!_instanceof(C1,So)||_instanceof(C1,Hf)))throw C1;return[3,30];case 30:if(!e.state)return[3,32];return[4,e.state()];case 31:_tmp2=_state.sent();return[3,33];case 32:_tmp2=void 0;_state.label=33;case 33:x=_tmp2;return[4,DOt(l,{metadata:c,clientInformation:m,state:x,redirectUrl:e.redirectUrl,scope:p,resource:u})];case 34:_ref=_state.sent(),v=_ref.authorizationUrl,y=_ref.codeVerifier;return[4,e.saveCodeVerifier(y)];case 35:_state.sent();return[4,e.redirectToAuthorization(v)];case 36:return[2,(_state.sent(),"REDIRECT")]}})}).apply(this,arguments)}function IOt(e){if(!e)return!1;try{var t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch(t){return!1}}function POt(e,t,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=iPe(e);if(!t.validateResourceURL)return[3,2];return[4,t.validateResourceURL(n,r==null?void 0:r.resource)];case 1:return[2,_state.sent()];case 2:if(r){if(!oPe({requestedResource:n,configuredResource:r.resource}))throw new Error("Protected resource ".concat(r.resource," does not match expected ").concat(n," (or origin)"));return[2,new URL(r.resource)]}return[2]}})})()}function WK(e){var t=e.headers.get("WWW-Authenticate");if(!t)return{};var _t_split=_sliced_to_array(t.split(" "),2),r=_t_split[0],n=_t_split[1];if(r.toLowerCase()!=="bearer"||!n)return{};var i=qK(e,"resource_metadata")||void 0,o;if(i)try{o=new URL(i)}catch(l){}var a=qK(e,"scope")||void 0,s=qK(e,"error")||void 0;return{resourceMetadataUrl:o,scope:a,error:s}}function qK(e,t){var r=e.headers.get("WWW-Authenticate");if(!r)return null;var n=new RegExp("".concat(t,'=(?:"([^"]+)"|([^\\s,]+))')),i=r.match(n);return i?i[1]||i[2]:null}function uPe(_01,_11){return _async_to_generator(function(e,t){var r,i,o,n,_;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:fetch;return[4,OOt(e,"oauth-protected-resource",r,{protocolVersion:t==null?void 0:t.protocolVersion,metadataUrl:t==null?void 0:t.resourceMetadataUrl})];case 1:n=_state.sent();if(!(!n||n.status===404))return[3,3];return[4,(i=n==null?void 0:n.body)==null?void 0:i.cancel()];case 2:throw _state.sent(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");case 3:if(!!n.ok)return[3,5];return[4,(o=n.body)==null?void 0:o.cancel()];case 4:throw _state.sent(),new Error("HTTP ".concat(n.status," trying to load well-known OAuth protected resource metadata."));case 5:_=X9e.parse;return[4,n.json()];case 6:return[2,_.apply(X9e,[_state.sent()])]}})}).apply(this,arguments)}function VK(_01,_11){return _async_to_generator(function(e,t){var r,n;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:fetch;_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,r(e,{headers:t})];case 2:return[2,_state.sent()];case 3:n=_state.sent();if(_instanceof(n,TypeError))return[2,t?VK(e,void 0,r):void 0];throw n;case 4:return[2]}})}).apply(this,arguments)}function ROt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?"".concat(t,"/.well-known/").concat(e):"/.well-known/".concat(e).concat(t)}function sPe(_01,_11){return _async_to_generator(function(e,t){var r;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:fetch;return[4,VK(e,{"MCP-Protocol-Version":t},r)];case 1:return[2,_state.sent()]}})}).apply(this,arguments)}function MOt(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}function OOt(e,t,r,n){return _async_to_generator(function(){var l,c,i,o,a,d,s,d10;return _ts_generator(this,function(_state){switch(_state.label){case 0:i=new URL(e),o=(l=n==null?void 0:n.protocolVersion)!=null?l:A_;if(n!=null&&n.metadataUrl)a=new URL(n.metadataUrl);else{d=ROt(t,i.pathname);a=new URL(d,(c=n==null?void 0:n.metadataServerUrl)!=null?c:i),a.search=i.search}return[4,sPe(a,o,r)];case 1:s=_state.sent();if(!(!(n!=null&&n.metadataUrl)&&MOt(s,i.pathname)))return[3,3];d10=new URL("/.well-known/".concat(t),i);return[4,sPe(d10,o,r)];case 2:s=_state.sent();_state.label=3;case 3:return[2,s]}})})()}function $Ot(e){var t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;var i=t.pathname;return i.endsWith("/")&&(i=i.slice(0,-1)),n.push({url:new URL("/.well-known/oauth-authorization-server".concat(i),t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration".concat(i),t.origin),type:"oidc"}),n.push({url:new URL("".concat(i,"/.well-known/openid-configuration"),t.origin),type:"oidc"}),n}function cPe(_01){return _async_to_generator(function(e){var _ref,tmp,t,tmp1,r,o,n,i,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,a,s,l,_tmp,_,_10,err;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>1&&_arguments[1]!==void 0?_arguments[1]:{},tmp=_ref.fetchFn,t=tmp===void 0?fetch:tmp,tmp1=_ref.protocolVersion,r=tmp1===void 0?A_:tmp1;n={"MCP-Protocol-Version":r,Accept:"application/json"},i=$Ot(e);_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,12,13,14]);_iterator=i[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,11];_step_value=_step.value,a=_step_value.url,s=_step_value.type;return[4,VK(a,n,t)];case 3:l=_state.sent();if(!l)return[3,10];if(!!l.ok)return[3,5];return[4,(o=l.body)==null?void 0:o.cancel()];case 4:if(_state.sent(),l.status>=400&&l.status<500)return[3,10];throw new Error("HTTP ".concat(l.status," trying to load ").concat(s==="oauth"?"OAuth":"OpenID provider"," metadata from ").concat(a));case 5:if(!(s==="oauth"))return[3,7];_=zK.parse;return[4,l.json()];case 6:_tmp=_.apply(zK,[_state.sent()]);return[3,9];case 7:_10=ePe.parse;return[4,l.json()];case 8:_tmp=_10.apply(ePe,[_state.sent()]);_state.label=9;case 9:return[2,_tmp];case 10:_iteratorNormalCompletion=true;return[3,2];case 11:return[3,14];case 12:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,14];case 13:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 14:return[2]}})}).apply(this,arguments)}function NOt(e,t){return _async_to_generator(function(){var r,n,o,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,2,,3]);return[4,uPe(e,{resourceMetadataUrl:t==null?void 0:t.resourceMetadataUrl},t==null?void 0:t.fetchFn)];case 1:r=_state.sent(),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0]);return[3,3];case 2:o=_state.sent();return[3,3];case 3:n||(n=String(new URL("/",e)));return[4,cPe(n,{fetchFn:t==null?void 0:t.fetchFn})];case 4:i=_state.sent();return[2,{authorizationServerUrl:n,authorizationServerMetadata:i,resourceMetadata:r}]}})})()}function DOt(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,a,s,l,c,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.metadata,r=param.clientInformation,n=param.redirectUrl,i=param.scope,o=param.state,a=param.resource;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(jK))throw new Error("Incompatible auth server: does not support response type ".concat(jK));if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(UK))throw new Error("Incompatible auth server: does not support code challenge method ".concat(UK))}else s=new URL("/authorize",e);return[4,FK()];case 1:l=_state.sent(),c=l.code_verifier,d=l.code_challenge;return[2,(s.searchParams.set("response_type",jK),s.searchParams.set("client_id",r.client_id),s.searchParams.set("code_challenge",d),s.searchParams.set("code_challenge_method",UK),s.searchParams.set("redirect_uri",String(n)),o&&s.searchParams.set("state",o),i&&s.searchParams.set("scope",i),i!=null&&i.includes("offline_access")&&s.searchParams.append("prompt","consent"),a&&s.searchParams.set("resource",a.href),{authorizationUrl:s,codeVerifier:c})]}})}).apply(this,arguments)}function LOt(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}function dPe(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,a,d,s,l,u,p,c,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.metadata,r=param.tokenRequestParams,n=param.clientInformation,i=param.addClientAuthentication,o=param.resource,a=param.fetchFn;s=t!=null&&t.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),l=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(!(o&&r.set("resource",o.href),i))return[3,2];return[4,i(l,r,s,t)];case 1:_state.sent();return[3,3];case 2:if(n){u=(d=t==null?void 0:t.token_endpoint_auth_methods_supported)!=null?d:[],p=kOt(n,u);COt(p,n,l,r)}_state.label=3;case 3:return[4,(a!=null?a:fetch)(s,{method:"POST",headers:l,body:r})];case 4:c=_state.sent();if(!!c.ok)return[3,6];return[4,lPe(c)];case 5:throw _state.sent();case 6:_=tPe.parse;return[4,c.json()];case 7:return[2,_.apply(tPe,[_state.sent()])]}})}).apply(this,arguments)}function FOt(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,a,s,l;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.metadata,r=param.clientInformation,n=param.refreshToken,i=param.resource,o=param.addClientAuthentication,a=param.fetchFn;s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n});return[4,dPe(e,{metadata:t,tokenRequestParams:s,clientInformation:r,addClientAuthentication:o,resource:i,fetchFn:a})];case 1:l=_state.sent();return[2,_object_spread({refresh_token:n},l)]}})}).apply(this,arguments)}function zOt(_01,_11){return _async_to_generator(function(e,t){var _ref,r,n,i,o,a,s,_tmp,c,l;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:_ref=_arguments.length>2&&_arguments[2]!==void 0?_arguments[2]:{},r=_ref.metadata,n=_ref.resource,i=_ref.authorizationCode,o=_ref.fetchFn;a=e.clientMetadata.scope;_tmp=e.prepareTokenRequest;if(!_tmp)return[3,2];return[4,e.prepareTokenRequest(a)];case 1:_tmp=s=_state.sent();_state.label=2;case 2:if(!(_tmp,!s))return[3,4];if(!i)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");return[4,e.codeVerifier()];case 3:c=_state.sent();s=LOt(i,c,e.redirectUrl);_state.label=4;case 4:return[4,e.clientInformation()];case 5:l=_state.sent();return[2,dPe(t,{metadata:r,tokenRequestParams:s,clientInformation:l!=null?l:void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:o})]}})}).apply(this,arguments)}function jOt(_01,_11){return _async_to_generator(function(e,param){var t,r,n,i,o,a,_;return _ts_generator(this,function(_state){switch(_state.label){case 0:t=param.metadata,r=param.clientMetadata,n=param.scope,i=param.fetchFn;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);return[4,(i!=null?i:fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_object_spread({},r,n!==void 0?{scope:n}:{}))})];case 1:a=_state.sent();if(!!a.ok)return[3,3];return[4,lPe(a)];case 2:throw _state.sent();case 3:_=nPe.parse;return[4,a.json()];case 4:return[2,_.apply(nPe,[_state.sent()])]}})}).apply(this,arguments)}var UOt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},sg=/*#__PURE__*/function(Error1){"use strict";_inherits(sg1,Error1);function sg1(t,r){_class_call_check(this,sg1);var _this;_this=_call_super(this,sg1,["Streamable HTTP error: ".concat(r)]),_this.code=t;return _this}return sg1}(_wrap_native_super(Error)),lM=/*#__PURE__*/function(){"use strict";function lM1(t,r){_class_call_check(this,lM1);var n;this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r==null?void 0:r.requestInit,this._authProvider=r==null?void 0:r.authProvider,this._fetch=r==null?void 0:r.fetch,this._fetchWithInit=J9e(r==null?void 0:r.fetch,r==null?void 0:r.requestInit),this._sessionId=r==null?void 0:r.sessionId,this._reconnectionOptions=(n=r==null?void 0:r.reconnectionOptions)!=null?n:UOt}_create_class(lM1,[{key:"_authThenStart",value:function _authThenStart(){return _async_to_generator(function(){var r,t,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._authProvider)throw new Zf("No auth provider");_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,$k(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})];case 2:t=_state.sent();return[3,4];case 3:n=_state.sent();throw(r=this.onerror)==null||r.call(this,n),n;case 4:if(t!=="AUTHORIZED")throw new Zf;return[4,this._startOrAuthSse({resumptionToken:void 0})];case 5:return[2,_state.sent()]}})}).call(this)}},{key:"_commonHeaders",value:function _commonHeaders(){return _async_to_generator(function(){var n,t,i,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:t={};if(!this._authProvider)return[3,2];return[4,this._authProvider.tokens()];case 1:i=_state.sent();i&&(t.Authorization="Bearer ".concat(i.access_token));_state.label=2;case 2:this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);r=sM((n=this._requestInit)==null?void 0:n.headers);return[2,new Headers(_object_spread({},t,r))]}})}).call(this)}},{key:"_startOrAuthSse",value:function _startOrAuthSse(t){return _async_to_generator(function(){var n,i,o,a,r,_$s,l,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=t.resumptionToken;_state.label=1;case 1:_state.trys.push([1,8,,9]);return[4,this._commonHeaders()];case 2:_$s=_state.sent();_$s.set("Accept","text/event-stream"),r&&_$s.set("last-event-id",r);return[4,((n=this._fetch)!=null?n:fetch)(this._url,{method:"GET",headers:_$s,signal:(i=this._abortController)==null?void 0:i.signal})];case 3:l=_state.sent();if(!!l.ok)return[3,7];return[4,(o=l.body)==null?void 0:o.cancel()];case 4:if(!(_state.sent(),l.status===401&&this._authProvider))return[3,6];return[4,this._authThenStart()];case 5:return[2,_state.sent()];case 6:if(l.status===405)return[2];throw new sg(l.status,"Failed to open SSE stream: ".concat(l.statusText));case 7:this._handleSseStream(l.body,t,!0);return[3,9];case 8:s=_state.sent();throw(a=this.onerror)==null||a.call(this,s),s;case 9:return[2]}})}).call(this)}},{key:"_getNextReconnectionDelay",value:function _getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;var r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,i=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),i)}},{key:"_scheduleReconnection",value:function _scheduleReconnection(t){var _this=this;var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var o;var n=this._reconnectionOptions.maxRetries;if(r>=n){(o=this.onerror)==null||o.call(this,new Error("Maximum reconnection attempts (".concat(n,") exceeded.")));return}var i=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(function(){_this._startOrAuthSse(t).catch(function(a){var s;(s=_this.onerror)==null||s.call(_this,new Error("Failed to reconnect SSE stream: ".concat(_instanceof(a,Error)?a.message:String(a)))),_this._scheduleReconnection(t,r+1)})},i)}},{key:"_handleSseStream",value:function _handleSseStream(t,r,n){var _this=this;if(!t)return;var i=r.onresumptiontoken,o=r.replayMessageId,a,s=!1,l=!1;(function(){return _async_to_generator(function(){var _this,d,u,p,m,_$h,_ref,_$v,y,_$_,h;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_state.trys.push([1,6,,7]);_$h=t.pipeThrough(new TextDecoderStream).pipeThrough(new F2({onRetry:function(v){_this._serverRetryMs=v}})).getReader();_state.label=2;case 2:return[4,_$h.read()];case 3:_ref=_state.sent(),_$v=_ref.value,y=_ref.done;if(y)return[3,5];if(_$v.id&&(a=_$v.id,s=!0,i==null||i(_$v.id)),!!_$v.data&&(!_$v.event||_$v.event==="message"))try{_$_=pR.parse(JSON.parse(_$v.data));w1(_$_)&&(l=!0,o!==void 0&&(_$_.id=o)),(d=this.onmessage)==null||d.call(this,_$_)}catch(_){(u=this.onerror)==null||u.call(this,_)}_state.label=4;case 4:return[3,2];case 5:(n||s)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:o},0);return[3,7];case 6:h=_state.sent();if((p=this.onerror)==null||p.call(this,new Error("SSE stream disconnected: ".concat(h))),(n||s)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:i,replayMessageId:o},0)}catch(v){(m=this.onerror)==null||m.call(this,new Error("Failed to reconnect: ".concat(_instanceof(v,Error)?v.message:String(v))))}return[3,7];case 7:return[2]}})}).call(_this)})()}},{key:"start",value:function start(){return _async_to_generator(function(){return _ts_generator(this,function(_state){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController;return[2]})}).call(this)}},{key:"finishAuth",value:function finishAuth(t){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._authProvider)throw new Zf("No auth provider");return[4,$k(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})];case 1:if(_state.sent()!=="AUTHORIZED")throw new Zf("Failed to authorize");return[2]}})}).call(this)}},{key:"close",value:function close(){return _async_to_generator(function(){var t,r;return _ts_generator(this,function(_state){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),(t=this._abortController)==null||t.abort(),(r=this.onclose)==null||r.call(this);return[2]})}).call(this)}},{key:"send",value:function send(t,r){return _async_to_generator(function(){var _this,n,i,o,a,s,l,c,_ref,_$d,u,p,m,h,g,b,_WK,w,S,_WK1,w10,S10,k,E,v,y,_,b10,w11,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,S11,d;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_state.label=1;case 1:_state.trys.push([1,20,,21]);_ref=r||{},_$d=_ref.resumptionToken,u=_ref.onresumptiontoken;if(_$d){this._startOrAuthSse({resumptionToken:_$d,replayMessageId:z5(t)?t.id:void 0}).catch(function(b){var w;return(w=_this.onerror)==null?void 0:w.call(_this,b)});return[2]}return[4,this._commonHeaders()];case 2:p=_state.sent();p.set("content-type","application/json"),p.set("accept","application/json, text/event-stream");m=_object_spread_props(_object_spread({},this._requestInit),{method:"POST",headers:p,body:JSON.stringify(t),signal:(n=this._abortController)==null?void 0:n.signal});return[4,((i=this._fetch)!=null?i:fetch)(this._url,m)];case 3:h=_state.sent(),g=h.headers.get("mcp-session-id");if(!(g&&(this._sessionId=g),!h.ok))return[3,9];return[4,h.text().catch(function(){return null})];case 4:b=_state.sent();if(!(h.status===401&&this._authProvider))return[3,6];if(this._hasCompletedAuthFlow)throw new sg(401,"Server returned 401 after successful authentication");_WK=WK(h),w=_WK.resourceMetadataUrl,S=_WK.scope;this._resourceMetadataUrl=w,this._scope=S;return[4,$k(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})];case 5:if(_state.sent()!=="AUTHORIZED")throw new Zf;return[2,(this._hasCompletedAuthFlow=!0,this.send(t))];case 6:if(!(h.status===403&&this._authProvider))return[3,8];_WK1=WK(h),w10=_WK1.resourceMetadataUrl,S10=_WK1.scope,k=_WK1.error;if(!(k==="insufficient_scope"))return[3,8];E=h.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new sg(403,"Server returned 403 after trying upscoping");S10&&(this._scope=S10),w10&&(this._resourceMetadataUrl=w10),this._lastUpscopingHeader=E!=null?E:void 0;return[4,$k(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})];case 7:if(_state.sent()!=="AUTHORIZED")throw new Zf;return[2,this.send(t)];case 8:throw new sg(h.status,"Error POSTing to endpoint: ".concat(b));case 9:if(!(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,h.status===202))return[3,11];return[4,(o=h.body)==null?void 0:o.cancel()];case 10:_state.sent(),jTe(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(function(b){var w;return(w=_this.onerror)==null?void 0:w.call(_this,b)});return[2];case 11:v=(Array.isArray(t)?t:[t]).filter(function(b){return"method"in b&&"id"in b&&b.id!==void 0}).length>0,y=h.headers.get("content-type"),_=Q9e(y);if(!v)return[3,17];if(!(_==="text/event-stream"))return[3,12];this._handleSseStream(h.body,{onresumptiontoken:u},!1);return[3,16];case 12:if(!(_==="application/json"))return[3,14];return[4,h.json()];case 13:b10=_state.sent(),w11=Array.isArray(b10)?b10.map(function(S){return pR.parse(S)}):[pR.parse(b10)];_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(_iterator=w11[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){S11=_step.value;(a=this.onmessage)==null||a.call(this,S11)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return[3,16];case 14:return[4,(s=h.body)==null?void 0:s.cancel()];case 15:throw _state.sent(),new sg(-1,"Unexpected content type: ".concat(y));case 16:return[3,19];case 17:return[4,(l=h.body)==null?void 0:l.cancel()];case 18:_state.sent();_state.label=19;case 19:return[3,21];case 20:d=_state.sent();throw(c=this.onerror)==null||c.call(this,d),d;case 21:return[2]}})}).call(this)}},{key:"sessionId",get:function get1(){return this._sessionId}},{key:"terminateSession",value:function terminateSession(){return _async_to_generator(function(){var t,r,n,i,_$o,a,s,o;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this._sessionId)return[3,6];_state.label=1;case 1:_state.trys.push([1,5,,6]);return[4,this._commonHeaders()];case 2:_$o=_state.sent(),a=_object_spread_props(_object_spread({},this._requestInit),{method:"DELETE",headers:_$o,signal:(t=this._abortController)==null?void 0:t.signal});return[4,((r=this._fetch)!=null?r:fetch)(this._url,a)];case 3:s=_state.sent();return[4,(n=s.body)==null?void 0:n.cancel()];case 4:if(_state.sent(),!s.ok&&s.status!==405)throw new sg(s.status,"Failed to terminate session: ".concat(s.statusText));this._sessionId=void 0;return[3,6];case 5:o=_state.sent();throw(i=this.onerror)==null||i.call(this,o),o;case 6:return[2]}})}).call(this)}},{key:"setProtocolVersion",value:function setProtocolVersion(t){this._protocolVersion=t}},{key:"protocolVersion",get:function get1(){return this._protocolVersion}},{key:"resumeStream",value:function resumeStream(t,r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r==null?void 0:r.onresumptiontoken})];case 1:_state.sent();return[2]}})}).call(this)}}]);return lM1}();var yPe=nr(ln(),1);var BOt=20*1024,qOt={"application/json":"json","application/pdf":"pdf","application/xml":"xml","audio/flac":"flac","audio/m4a":"m4a","audio/mpeg":"mp3","audio/ogg":"ogg","audio/wav":"wav","image/avif":"avif","image/bmp":"bmp","image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","image/webp":"webp","text/csv":"csv","text/html":"html","text/markdown":"md","text/plain":"txt"};function mPe(e,t){return _async_to_generator(function(){var r,_tmp,_tmp1,_,_10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=VOt(t.result);if(!(uM(t.result)&&t.result.isError===!0))return[3,1];_tmp="MCP tool returned an error:\n\n".concat(r);return[3,5];case 1:if(!(!GOt(t.result)&&r.length<=BOt))return[3,2];_tmp1=r;return[3,4];case 2:_10=(_="MCP tool result saved to ").concat;return[4,WOt(e,t)];case 3:_tmp1=_10.apply(_,[_state.sent(),". Read the Markdown manifest with bash, then inspect referenced files as needed; use view_image for images."]);_state.label=4;case 4:_tmp=_tmp1;_state.label=5;case 5:return[2,_tmp]}})})()}function WOt(e,t){return _async_to_generator(function(){var r,n,i,o,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,a,s,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Lv("mcp",function(a){return DEe(e,"".concat(ba,"/").concat(t.sessionId,"/mcp/").concat(a))})];case 1:r=_state.sent(),n="".concat(ba,"/").concat(t.sessionId,"/mcp/").concat(r),i="".concat(n,"/result.md"),o=["# MCP tool result","","- Server: ".concat(z1(t.serverName)),"- Tool: ".concat(z1(t.toolName))];if(!!uM(t.result))return[3,3];o.push("","## Raw result","",GK(t.result));return[4,v1(e,i,"".concat(o.join("\n"),"\n"))];case 2:return[2,(_state.sent(),i)];case 3:t.result.isError!==void 0&&o.push("- Error: ".concat(t.result.isError?"yes":"no")),t.result.structuredContent!==void 0&&o.push("","## Structured content","",GK(t.result.structuredContent));_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=4;case 4:_state.trys.push([4,9,10,11]);_iterator=t.result.content.entries()[Symbol.iterator]();_state.label=5;case 5:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,8];_step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];o.push("","## Content ".concat(a+1,": ").concat(ZOt(s)),"");return[4,HOt(e,n,a+1,s,o)];case 6:_state.sent();_state.label=7;case 7:_iteratorNormalCompletion=true;return[3,5];case 8:return[3,11];case 9:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,11];case 10:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 11:return[4,v1(e,i,"".concat(o.join("\n"),"\n"))];case 12:return[2,(_state.sent(),i)]}})})()}function VOt(e){var r,n;if(!uM(e))return(r=JSON.stringify(e,null,2))!=null?r:String(e);var t=[];e.structuredContent!==void 0&&t.push(JSON.stringify(e.structuredContent,null,2));var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=e.content[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var i=_step.value;switch(i.type){case"text":t.push(i.text);break;case"resource_link":t.push(JSON.stringify(i,null,2));break;case"resource":t.push("text"in i.resource?"Embedded resource ".concat(i.resource.uri,":\n").concat(i.resource.text):"Embedded binary resource: ".concat(i.resource.uri," (").concat((n=i.resource.mimeType)!=null?n:"unknown MIME type",")"));break;case"image":case"audio":t.push("".concat(i.type," content (").concat(i.mimeType,") omitted from inline output"))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return t.join("\n\n")||JSON.stringify(e,null,2)}function GOt(e){return uM(e)&&e.content.some(function(t){return t.type==="image"||t.type==="audio"||t.type==="resource"&&"blob"in t.resource})}function uM(e){return e!==null&&(typeof e==="undefined"?"undefined":_type_of(e))=="object"&&"content"in e&&Array.isArray(e.content)}function HOt(e,t,r,n,i){return _async_to_generator(function(){var o,_,a,a9,s;return _ts_generator(this,function(_state){switch(_state.label){case 0:_=n.type;switch(_){case"text":return[3,1];case"image":return[3,2];case"audio":return[3,2];case"resource_link":return[3,4];case"resource":return[3,5]}return[3,7];case 1:i.push(fPe(n.text));return[2];case 2:a="".concat(t,"/").concat(n.type,"-").concat(r,".").concat(pPe(n.mimeType));return[4,JG(e,a,hb(n.data))];case 3:_state.sent(),i.push("- Path: ".concat(z1(a)),"- MIME type: ".concat(z1(n.mimeType)));return[2];case 4:i.push(GK(n));return[2];case 5:a9=n.resource;if(i.push("- URI: ".concat(z1(a9.uri)),"- MIME type: ".concat(z1((o=a9.mimeType)!=null?o:"unknown"))),"text"in a9){i.push("",fPe(a9.text));return[2]}s="".concat(t,"/resource-").concat(r,".").concat(pPe(a9.mimeType));return[4,JG(e,s,hb(a9.blob))];case 6:_state.sent(),i.push("- Path: ".concat(z1(s)));_state.label=7;case 7:return[2]}})})()}function ZOt(e){switch(e.type){case"resource_link":return"resource link";case"resource":return"embedded resource";default:return e.type}}function pPe(e){if(!e)return"bin";var t=e.toLowerCase().split(";",1)[0].trim(),r=qOt[t];if(r)return r;var n=t.split("/",2)[1];return(n==null?void 0:n.replace(/\+xml$/,"").replace(/[^a-z0-9]+/g,""))||"bin"}function z1(e){var t=gPe(e),r="`".repeat(t+1);return"".concat(r).concat(e).concat(r)}function fPe(e){return hPe(e,"text")}function GK(e){var t;return hPe((t=JSON.stringify(e,null,2))!=null?t:String(e),"json")}function hPe(e,t){var r="`".repeat(Math.max(3,gPe(e)+1));return"".concat(r).concat(t,"\n").concat(e,"\n").concat(r)}function gPe(e){var _Math;return(_Math=Math).max.apply(_Math,[0].concat(_to_consumable_array(_to_consumable_array(e.matchAll(/`+/g)).map(function(t){return t[0].length}))))}var KOt={getValidator:function(){return function(e){return{valid:!0,data:e,errorMessage:void 0}}}};function xPe(e){return _instanceof(e,Error)?e.message:String(e)}var Nk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Nk1,Pr1);function Nk1(r){_class_call_check(this,Nk1);var _this;_this=_call_super(this,Nk1);_this.plugin=r;A(_this,"servers",{});A(_this,"parseError");A(_this,"configMtime");A(_this,"clients",new Map);A(_this,"reloadPromise");A(_this,"connectErrors",new Map);return _this}_create_class(Nk1,[{key:"onload",value:function onload(){return _async_to_generator(function(){return _ts_generator(this,function(_state){this.reload().catch(function(r){Me.warn("Failed to initialize MCP servers",r)});return[2]})}).call(this)}},{key:"onunload",value:function onunload(){this.closeAllClients()}},{key:"getServers",value:function getServers(){return this.servers}},{key:"getParseError",value:function getParseError(){return this.parseError}},{key:"getServerRuntimes",value:function getServerRuntimes(){var _this=this;return Object.entries(this.servers).map(function(param){var _param=_sliced_to_array(param,2),r=_param[0],n=_param[1];var a;var i=v6(n),o=_this.clients.get(r);return{name:r,enabled:i,status:o?"connected":i?"error":void 0,error:i&&!o?_this.getConnectError(r):void 0,tools:(a=o==null?void 0:o.tools)!=null?a:[]}})}},{key:"getConnectError",value:function getConnectError(r){return this.connectErrors.get(r)}},{key:"reload",value:function reload(){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.reloadPromise)return[2,this.reloadPromise];r=this.reloadInternal();this.reloadPromise=r;_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,r];case 2:_state.sent();return[3,4];case 3:this.reloadPromise===r&&(this.reloadPromise=void 0);return[7];case 4:return[2]}})}).call(this)}},{key:"refreshIfChanged",value:function refreshIfChanged(){return _async_to_generator(function(){var _$r,_tmp,n,_tmp1,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,8,,9]);_$r=this.plugin.app.vault.adapter;return[4,_$r.exists(mh)];case 1:if(!!_state.sent())return[3,4];_tmp=this.configMtime!==void 0||Object.keys(this.servers).length;if(!_tmp)return[3,3];return[4,this.reload()];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2];case 4:return[4,_$r.stat(mh)];case 5:n=_state.sent();_tmp1=n&&n.mtime!==this.configMtime;if(!_tmp1)return[3,7];return[4,this.reload()];case 6:_tmp1=_state.sent();_state.label=7;case 7:_tmp1;return[3,9];case 8:r=_state.sent();Me.warn("Failed to check MCP config changes",r);return[3,9];case 9:return[2]}})}).call(this)}},{key:"reloadInternal",value:function reloadInternal(){return _async_to_generator(function(){var r,n,i,o,_ref,_$a,s,a;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.plugin.app.vault.adapter,n={};_state.label=1;case 1:_state.trys.push([1,5,,6]);return[4,r.exists(mh)];case 2:if(!_state.sent())return[3,4];return[4,Promise.all([r.read(mh),r.stat(mh)])];case 3:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),_$a=_ref[0],s=_ref[1];o=s==null?void 0:s.mtime,n=$fe(_$a);_state.label=4;case 4:return[3,6];case 5:a=_state.sent();i=xPe(a),Me.warn("Failed to load MCP config",a);return[3,6];case 6:this.servers=n,this.parseError=i,this.configMtime=o;return[4,this.reconcileClients()];case 7:_state.sent();return[2]}})}).call(this)}},{key:"reconcileClients",value:function reconcileClients(){return _async_to_generator(function(){var r,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,_step_value,n,i,_$o,_tmp,err,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,_step_value1,n10,i10,_$o1,o,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=new Map(Object.entries(this.servers).filter(function(param){var _param=_sliced_to_array(param,2),n=_param[1];return v6(n)}));_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,7,8,9]);_iterator=_to_consumable_array(this.clients)[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,6];_step_value=_sliced_to_array(_step.value,2),n=_step_value[0],i=_step_value[1];_$o=r.get(n);_tmp=!_$o||JSON.stringify(_$o)!==i.signature;if(!_tmp)return[3,4];return[4,this.closeClient(n)];case 3:_tmp=_state.sent();_state.label=4;case 4:_tmp;_state.label=5;case 5:_iteratorNormalCompletion=true;return[3,2];case 6:return[3,9];case 7:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,9];case 8:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 9:_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;_state.label=10;case 10:_state.trys.push([10,17,18,19]);_iterator1=r[Symbol.iterator]();_state.label=11;case 11:if(!!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done))return[3,16];_step_value1=_sliced_to_array(_step1.value,2),n10=_step_value1[0],i10=_step_value1[1];if(!!this.clients.has(n10))return[3,15];_state.label=12;case 12:_state.trys.push([12,14,,15]);return[4,this.connect(i10)];case 13:_$o1=_state.sent();this.clients.set(n10,_$o1),this.connectErrors.delete(n10);return[3,15];case 14:o=_state.sent();Me.warn("Failed to connect MCP server '".concat(n10,"'"),o),this.connectErrors.set(n10,xPe(o));return[3,15];case 15:_iteratorNormalCompletion1=true;return[3,11];case 16:return[3,19];case 17:err=_state.sent();_didIteratorError1=true;_iteratorError1=err;return[3,19];case 18:try{if(!_iteratorNormalCompletion1&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}return[7];case 19:return[2]}})}).call(this)}},{key:"connect",value:function connect(r){return _async_to_generator(function(){var n,_ref,_$i,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.createClient(r)];case 1:n=_state.sent();_state.label=2;case 2:_state.trys.push([2,4,,6]);return[4,n.listTools()];case 3:_ref=_state.sent(),_$i=_ref.tools;return[2,{client:n,signature:JSON.stringify(r),tools:_$i.map(function(o){var a;return{name:o.name,description:o.description,inputSchema:(a=o.inputSchema)!=null?a:{type:"object",properties:{}}}})}];case 4:i=_state.sent();return[4,n.close().catch(function(){})];case 5:throw _state.sent(),i;case 6:return[2]}})}).call(this)}},{key:"createClient",value:function createClient(r){return _async_to_generator(function(){var n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(r.type!=="http")throw new Error("Unsupported MCP server type");n=new aM({name:"obsidian-nutstore-sync",version:this.plugin.manifest.version},{jsonSchemaValidator:KOt}),i=new lM(new URL(r.url),{fetch:zf,requestInit:r.headers?{headers:r.headers}:void 0});return[4,n.connect(i)];case 1:return[2,(_state.sent(),n)]}})}).call(this)}},{key:"closeClient",value:function closeClient(r){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.clients.get(r);this.clients.delete(r);_tmp=n;if(!_tmp)return[3,2];return[4,n.client.close().catch(function(){})];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(this)}},{key:"closeAllClients",value:function closeAllClients(){return _async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=_to_consumable_array(this.clients.keys())[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];r=_step.value;return[4,this.closeClient(r)];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:return[2]}})}).call(this)}},{key:"saveServers",value:function saveServers(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=this.plugin.app.vault;return[4,Ja(n,(0,yPe.dirname)(mh))];case 1:_state.sent();return[4,n.adapter.write(mh,Nfe(r))];case 2:_state.sent();return[4,this.reload()];case 3:_state.sent();return[2]}})}).call(this)}},{key:"testConnection",value:function testConnection(r){return _async_to_generator(function(){var n,_ref,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.createClient(r)];case 1:n=_state.sent();_state.label=2;case 2:_state.trys.push([2,,4,6]);return[4,n.listTools()];case 3:_ref=_state.sent(),i=_ref.tools;return[2,i.map(function(o){return{name:o.name,description:o.description}})];case 4:return[4,n.close().catch(function(){})];case 5:_state.sent();return[7];case 6:return[2]}})}).call(this)}},{key:"getToolsForSession",value:function getToolsForSession(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var i=new Set(n),o={};var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined,_iteratorNormalCompletion1=true,_didIteratorError1=false,_iteratorError1=undefined;try{for(var _iterator=this.clients[Symbol.iterator](),_step;!(_iteratorNormalCompletion1=(_step=_iterator.next()).done);_iteratorNormalCompletion1=true){var _step_value=_sliced_to_array(_step.value,2),a=_step_value[0],s=_step_value[1];if(!i.has(a))try{for(var _iterator1=s.tools[Symbol.iterator](),_step1;!(_iteratorNormalCompletion=(_step1=_iterator1.next()).done);_iteratorNormalCompletion=true){var l=_step1.value;o[Mfe(a,l.name)]=this.createTool(s.client,l,a,r)}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator1.return!=null){_iterator1.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}}catch(err){_didIteratorError1=true;_iteratorError1=err}finally{try{if(!_iteratorNormalCompletion1&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError1){throw _iteratorError1}}}return o}},{key:"createTool",value:function createTool(r,n,i,o){var _this=this;var a;return iz({description:(a=n.description)!=null?a:"MCP tool: ".concat(n.name),inputSchema:f0(n.inputSchema),execute:function(s){return _async_to_generator(function(){var l;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,r.callTool({name:n.name,arguments:s!=null?s:{}})];case 1:l=_state.sent();return[2,mPe(this.plugin.app,{sessionId:o,serverName:i,toolName:n.name,result:l})]}})}).call(_this)}})}}]);return Nk1}(Pr);var QOt="https://models.dev/api.json";function vPe(e){var t=Object.keys(e).length;return{modelsCount:Object.values(e).reduce(function(n,i){return n+Object.keys(i.models||{}).length},0),providersCount:t}}var Dk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Dk1,Pr1);function Dk1(r){_class_call_check(this,Dk1);var _this;_this=_call_super(this,Dk1);_this.plugin=r;return _this}_create_class(Dk1,[{key:"initializeFromLocalSettings",value:function initializeFromLocalSettings(){var r=HU(this.plugin.localSettings.ai.presetModels);if(!r){S1e();return}ZU(r)}},{key:"refreshFromRemote",value:function refreshFromRemote(){return _async_to_generator(function(){var _$r,n,i,o,a,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,4,,5]);_$r=vPe(Q6());return[4,zf(QOt,{method:"GET"})];case 1:n=_state.sent();if(!n.ok)return[2,{success:!1,modelsDelta:0,providersDelta:0,errorMessage:"HTTP ".concat(n.status).concat(n.statusText?" ".concat(n.statusText):"")}];return[4,n.json()];case 2:i=_state.sent(),o=HU(i);if(!o)return[2,{success:!1,modelsDelta:0,providersDelta:0,errorMessage:"Invalid models payload"}];a=vPe(o);ZU(o),this.plugin.localSettings.ai.presetModels=o,this.plugin.localSettings.ai.presetModelsUpdatedAt=new Date().toISOString();return[4,this.plugin.settingsService.saveLocalSettings()];case 3:return[2,(_state.sent(),{success:!0,providersDelta:a.providersCount-_$r.providersCount,modelsDelta:a.modelsCount-_$r.modelsCount})];case 4:r=_state.sent();return[2,(Me.error(r),{success:!1,modelsDelta:0,providersDelta:0,errorMessage:_instanceof(r,Error)?r.message:String(r)})];case 5:return[2]}})}).call(this)}}]);return Dk1}(Pr);var cM=require("obsidian");var JOt=60*1e3,_Pe=60*1e3;function bPe(e){return Date.now()+Math.max(0,e||0)*1e3}function YOt(e){return e===401||e===403}function HK(e){return!!e&&e-Date.now()>JOt}function XOt(e){return{id:e.id,name:e.name,attachment:!1,reasoning:e.reasoning,tool_call:!0,temperature:!0,knowledge:e.description,release_date:"",last_updated:"",modalities:{input:e.input,output:["text"]},open_weights:!1,cost:{input:e.cost.input,output:e.cost.output,cache_read:e.cost.cacheRead,cache_write:e.cost.cacheWrite},limit:{context:e.contextWindow,output:e.maxTokens},provider:{shape:"completions"},experimental:{nutstoreLlmGateway:{api:e.api,compat:e.compat}}}}var Lk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Lk1,Pr1);function Lk1(r){_class_call_check(this,Lk1);var _this;_this=_call_super(this,Lk1);_this.plugin=r;A(_this,"client",new p1e({fetcher:zf}));A(_this,"refreshSubscription",null);A(_this,"authorizationPollingSubscription",null);return _this}_create_class(Lk1,[{key:"isProviderId",value:function isProviderId(r){return r===_d}},{key:"isManagedProvider",value:function isManagedProvider(r){return this.isProviderId(r==null?void 0:r.id)}},{key:"isAuthorized",value:function isAuthorized(){return!!this.settings.accessToken&&!!this.settings.refreshToken}},{key:"isAuthorizing",value:function isAuthorizing(){return!!this.settings.pendingAuthorization}},{key:"getPendingAuthorization",value:function getPendingAuthorization(){return this.settings.pendingAuthorization}},{key:"emitAuthState",value:function emitAuthState(){n1e({status:this.isAuthorizing()?"authorizing":"idle"})}},{key:"startAuthorization",value:function startAuthorization(){return _async_to_generator(function(){var o,r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this.settings.pendingAuthorization)return[2,(this.resumeAuthorizationPolling(),this.settings.pendingAuthorization)];r=(o=SJ)==null?void 0:o.trim();if(!r)throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.missingClientId"));return[4,this.client.createDeviceAuthorization({clientId:r})];case 1:n=_state.sent(),i={clientId:r,deviceCode:n.device_code,userCode:n.user_code,verificationUri:n.verification_uri,verificationUrl:this.client.createVerificationUrl({verificationUri:n.verification_uri,userCode:n.user_code}),intervalMs:n.interval*1e3,expiresAt:Date.now()+n.expires_in*1e3};this.settings.pendingAuthorization=i,this.emitAuthState();return[4,this.plugin.settingsService.saveSettings()];case 2:return[2,(_state.sent(),this.resumeAuthorizationPolling(),i)]}})}).call(this)}},{key:"openPendingAuthorizationPage",value:function openPendingAuthorizationPage(){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){r=this.settings.pendingAuthorization;if(!r)throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.authorizationRequired"));n=createEl("a");n.href=r.verificationUrl,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n);return[2]})}).call(this)}},{key:"refreshModels",value:function refreshModels(){return _async_to_generator(function(){var r,n,i,o,a,s;var _arguments=arguments;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=_arguments.length>0&&_arguments[0]!==void 0?_arguments[0]:{};return[4,this.ensureAccessToken(r)];case 1:n=_state.sent();if(!n)return[2,!1];i=this.client.getLlmGatewayEndpoints();return[4,zf(i.models,{method:"GET",headers:{Authorization:"Bearer ".concat(n)}})];case 2:o=_state.sent();if(!o.ok)throw YOt(o.status)&&r.removeOnAuthError&&this.clearProviderAndAuth(),new Error(P.t("settings.ai.nutstoreLlmGateway.errors.modelsFailed",{status:o.status}));return[4,o.json()];case 3:a=_state.sent(),s=Object.fromEntries(a.data.map(function(l){return _object_spread_props(_object_spread({},l),{id:l.id.trim(),name:l.name.trim()})}).filter(function(l){return!!l.id}).map(function(l){return[l.id,zc(XOt(l))]}));if(Object.keys(s).length===0)throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.emptyModels"));return[2,(this.plugin.settings.ai.providers=_object_spread_props(_object_spread({},this.plugin.settings.ai.providers),_define_property({},_d,this.createProvider(n,s))),this.plugin.settings.ai.defaultModel=bf(this.plugin.settings.ai.providers,this.plugin.settings.ai.defaultModel),!0)]}})}).apply(this,arguments)}},{key:"ensureProviderReady",value:function ensureProviderReady(r){return _async_to_generator(function(){var n,i,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!this.isProviderId(r==null?void 0:r.id))return[2];n=this.settings.accessToken;return[4,this.ensureAccessToken({removeOnAuthError:!0})];case 1:i=_state.sent();if(!i)throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.authorizationRequired"));this.updateProviderApiKey(i),r&&(r.apiKey=i);_tmp=i!==n;if(!_tmp)return[3,3];return[4,this.plugin.settingsService.saveSettings()];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})}).call(this)}},{key:"initializeProviderFromStoredAuth",value:function initializeProviderFromStoredAuth(){return _async_to_generator(function(){var _tmp,_tmp1,_$r,_tmp2,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.settings.pendingAuthorization;if(!_tmp)return[3,4];if(!(this.settings.pendingAuthorization.expiresAt<=Date.now()))return[3,2];this.settings.pendingAuthorization=void 0;return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp1=_state.sent();return[3,3];case 2:_tmp1=(this.emitAuthState(),this.resumeAuthorizationPolling());_state.label=3;case 3:_tmp=_tmp1;_state.label=4;case 4:if(_tmp,!this.isAuthorized()){this.stopTokenRefreshTimer();return[2]}_state.label=5;case 5:_state.trys.push([5,9,,11]);return[4,this.refreshModels({removeOnAuthError:!0})];case 6:_$r=_state.sent();this.startTokenRefreshTimer();_tmp2=_$r;if(!_tmp2)return[3,8];return[4,this.plugin.settingsService.saveSettings()];case 7:_tmp2=_state.sent();_state.label=8;case 8:_tmp2;return[3,11];case 9:r=_state.sent();this.noticeError(r);return[4,this.plugin.settingsService.saveSettings()];case 10:_state.sent(),this.isAuthorized()?this.startTokenRefreshTimer():this.stopTokenRefreshTimer();return[3,11];case 11:return[2]}})}).call(this)}},{key:"disconnect",value:function disconnect(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.cancelPendingAuthorization()];case 1:_state.sent(),this.clearProviderAndAuth();return[4,this.plugin.settingsService.saveSettings()];case 2:_state.sent(),new cM.Notice(P.t("settings.ai.nutstoreLlmGateway.disconnected"));return[2]}})}).call(this)}},{key:"onunload",value:function onunload(){this.stopAuthorizationPolling(),this.stopTokenRefreshTimer()}},{key:"ensureAccessToken",value:function ensureAccessToken(r){return _async_to_generator(function(){var _$n,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(HK(this.settings.accessTokenExpiresAt))return[2,this.settings.accessToken];if(!this.settings.refreshToken||!HK(this.settings.refreshTokenExpiresAt)){r.removeOnAuthError&&this.clearProviderAndAuth();return[2]}_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.client.refreshToken({refreshToken:this.settings.refreshToken})];case 2:_$n=_state.sent();return[2,(this.applyToken(_$n),_$n.access_token)];case 3:n=_state.sent();throw r.removeOnAuthError&&this.clearProviderAndAuth(),n;case 4:return[2]}})}).call(this)}},{key:"applyToken",value:function applyToken(r){this.settings.accessToken=r.access_token,this.settings.refreshToken=r.refresh_token,this.settings.accessTokenExpiresAt=bPe(r.expires_in),this.settings.refreshTokenExpiresAt=bPe(r.refresh_expires_in)}},{key:"createProvider",value:function createProvider(r,n){var i=this.client.getLlmGatewayEndpoints();return{id:_d,env:[],npm:"@ai-sdk/openai-compatible",api:i.openaiCompatibleBaseUrl,name:P.t("settings.ai.nutstoreLlmGateway.providerName"),doc:"",apiKey:r,allowBrowserCors:!0,models:n}}},{key:"clearProviderAndAuth",value:function clearProviderAndAuth(){this.settings.accessToken=void 0,this.settings.refreshToken=void 0,this.settings.accessTokenExpiresAt=void 0,this.settings.refreshTokenExpiresAt=void 0,this.settings.pendingAuthorization=void 0,this.disableProviderToken(),this.stopAuthorizationPolling(),this.stopTokenRefreshTimer(),this.emitAuthState()}},{key:"disableProviderToken",value:function disableProviderToken(){var r=this.plugin.settings.ai.providers[_d];r&&(r.apiKey="")}},{key:"startTokenRefreshTimer",value:function startTokenRefreshTimer(){var _this=this;this.refreshSubscription||(this.refreshSubscription=E7(_Pe,_Pe).subscribe(function(){_this.refreshAccessTokenIfNeeded()}))}},{key:"stopTokenRefreshTimer",value:function stopTokenRefreshTimer(){this.refreshSubscription&&(this.refreshSubscription.unsubscribe(),this.refreshSubscription=null)}},{key:"refreshAccessTokenIfNeeded",value:function refreshAccessTokenIfNeeded(){return _async_to_generator(function(){var _$r,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!!(!this.isAuthorized()||HK(this.settings.accessTokenExpiresAt)))return[3,8];_state.label=1;case 1:_state.trys.push([1,6,,8]);return[4,this.ensureAccessToken({removeOnAuthError:!0})];case 2:_$r=_state.sent();if(!!_$r)return[3,4];return[4,this.plugin.settingsService.saveSettings()];case 3:_state.sent();return[2];case 4:this.updateProviderApiKey(_$r);return[4,this.plugin.settingsService.saveSettings()];case 5:_state.sent();return[3,8];case 6:r=_state.sent();this.noticeError(r);return[4,this.plugin.settingsService.saveSettings()];case 7:_state.sent();return[3,8];case 8:return[2]}})}).call(this)}},{key:"resumeAuthorizationPolling",value:function resumeAuthorizationPolling(){if(this.authorizationPollingSubscription)return;var r=this.settings.pendingAuthorization;if(!r){this.emitAuthState();return}this.emitAuthState(),this.scheduleDeviceTokenPoll(r,r.intervalMs)}},{key:"scheduleDeviceTokenPoll",value:function scheduleDeviceTokenPoll(r,n){var _this=this;var i;(i=this.authorizationPollingSubscription)==null||i.unsubscribe(),this.authorizationPollingSubscription=E7(n).subscribe(function(){_this.pollDeviceTokenOnce(r,n)})}},{key:"stopAuthorizationPolling",value:function stopAuthorizationPolling(){this.authorizationPollingSubscription&&(this.authorizationPollingSubscription.unsubscribe(),this.authorizationPollingSubscription=null)}},{key:"pollDeviceTokenOnce",value:function pollDeviceTokenOnce(r,n){return _async_to_generator(function(){var _$i,o,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,5]);if(Date.now()>=r.expiresAt)throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.authorizationExpired"));_$i=this.settings.pendingAuthorization;if(!_$i||_$i.deviceCode!==r.deviceCode){this.stopAuthorizationPolling(),this.emitAuthState();return[2]}return[4,this.client.pollDeviceToken({deviceCode:r.deviceCode,userCode:r.userCode})];case 1:o=_state.sent();if(!o.ok){if(o.error.code==="authorization_pending"){this.scheduleDeviceTokenPoll(r,n);return[2]}if(o.error.code==="slow_down"){this.scheduleDeviceTokenPoll(r,n+r.intervalMs);return[2]}throw new Error(P.t("settings.ai.nutstoreLlmGateway.errors.authorizationFailed",{code:o.error.code,message:o.error.message}))}this.stopAuthorizationPolling();return[4,this.finishAuthorization(o.data)];case 2:_state.sent(),this.emitAuthState();return[3,5];case 3:i=_state.sent();this.stopAuthorizationPolling(),this.settings.pendingAuthorization=void 0;return[4,this.plugin.settingsService.saveSettings()];case 4:_state.sent(),this.noticeError(i),this.emitAuthState();return[3,5];case 5:return[2]}})}).call(this)}},{key:"finishAuthorization",value:function finishAuthorization(r){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.applyToken(r),this.settings.pendingAuthorization=void 0;_state.label=1;case 1:_state.trys.push([1,,3,5]);return[4,this.refreshModels({removeOnAuthError:!0})];case 2:_state.sent(),this.startTokenRefreshTimer(),new cM.Notice(P.t("settings.ai.nutstoreLlmGateway.authorized"));return[3,5];case 3:return[4,this.plugin.settingsService.saveSettings()];case 4:_state.sent();return[7];case 5:return[2]}})}).call(this)}},{key:"cancelPendingAuthorization",value:function cancelPendingAuthorization(){return _async_to_generator(function(){var r,n;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=this.settings.pendingAuthorization;if(!r)return[3,4];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.client.cancelDeviceAuthorization({deviceCode:r.deviceCode})];case 2:_state.sent();return[3,4];case 3:n=_state.sent();Me.error(n);return[3,4];case 4:return[2]}})}).call(this)}},{key:"updateProviderApiKey",value:function updateProviderApiKey(r){var n=this.plugin.settings.ai.providers[_d];n&&(n.apiKey=r)}},{key:"noticeError",value:function noticeError(r){Me.error(r),new cM.Notice(_instanceof(r,Error)?r.message:P.t("settings.login.failure"),1e4)}},{key:"settings",get:function get1(){var r,n;return(n=(r=this.plugin.settings.ai).nutstoreLlmGateway)!=null||(r.nutstoreLlmGateway={}),this.plugin.settings.ai.nutstoreLlmGateway}}]);return Lk1}(Pr);var wPe=require("obsidian");var Va=require("obsidian");var Fk=/*#__PURE__*/function(_Va_Modal){"use strict";_inherits(Fk1,_Va_Modal);function Fk1(r,n){_class_call_check(this,Fk1);var _this;_this=_call_super(this,Fk1,[r.app]);_this.plugin=r;_this.closeCallback=n;A(_this,"progressTitle");A(_this,"statusIcon");A(_this,"statusSection");A(_this,"statusMessage");A(_this,"progressBar");A(_this,"progressText");A(_this,"progressLabel");A(_this,"currentFile");A(_this,"filesList");A(_this,"filesSection");A(_this,"syncCancelled",!1);A(_this,"cancelSubscription");A(_this,"updateMtimeSubscription");A(_this,"stopButtonComponent");A(_this,"hideButtonComponent");A(_this,"cacheProgressBar");A(_this,"cacheProgressText");A(_this,"cacheCurrentOperation");A(_this,"cacheProgressSection");_this.cancelSubscription=_b().subscribe(function(){_this.syncCancelled=!0,_this.update()}),_this.updateMtimeSubscription=TY().subscribe(function(i){_this.updateCacheProgress(i.total,i.completed)});return _this}_create_class(Fk1,[{key:"update",value:function update(){var _this=this;var u,p,m;if(!this.progressTitle||!this.statusIcon||!this.statusSection||!this.statusMessage||!this.progressBar||!this.progressText||!this.progressLabel||!this.currentFile||!this.filesList||!this.stopButtonComponent||!this.hideButtonComponent)return;var r=this.plugin.progressService.syncProgress,n=this.plugin.progressService.preparationProgress,i=this.plugin.progressService.syncFailedCount,o=n?oR(n):null,a=this.plugin.progressService.syncEnd?i>0?"warning":"complete":this.syncCancelled?"cancelled":this.plugin.progressService.syncFailed?"error":n?"preparing":"syncing";if(this.updateHeader(a,o==null?void 0:o.operation,i),this.updateControls(a),(a==="preparing"?Boolean(((u=n==null?void 0:n.traversal)==null?void 0:u.currentPath)||(o==null?void 0:o.detail)):a==="syncing"&&r.current!==null)?this.statusSection.show():this.statusSection.hide(),a==="preparing"&&n&&o){this.currentFile.setText((m=(p=n.traversal)==null?void 0:p.currentPath)!=null?m:""),o.detail?(this.statusMessage.setText(o.detail),this.statusMessage.show()):this.statusMessage.hide(),this.progressBar.setCssProps({width:""}),this.resetCacheProgress(),this.progressBar.addClass("nutstore-sync-progress-indeterminate"),Er(this.progressBar,"ns-s8oz1s"),this.progressText.setText(""),this.filesSection.hide();return}this.progressBar.removeClass("nutstore-sync-progress-indeterminate"),Dn(this.progressBar,"ns-s8oz1s"),a==="complete"&&r.total===0?this.filesSection.hide():this.filesSection.show();var l=a==="complete"&&r.total===0?100:Math.round(r.completed.length/r.total*100)||0;this.progressBar.setCssProps({width:"".concat(l,"%")}),this.progressText.setText(P.t("sync.percentComplete",{percent:l})),this.progressLabel.setText(P.t("sync.progressLabel")),this.statusMessage.hide(),a==="syncing"&&r.current?this.currentFile.setText(P.t("sync.currentFile",{path:r.current.localPath})):this.currentFile.setText(""),this.filesList.empty(),r.current!==null&&!r.completed.some(function(h){return h.task===r.current})&&this.renderTaskRow(r.current,"in-progress"),r.completed.slice().reverse().forEach(function(param){var h=param.task,g=param.success;_this.renderTaskRow(h,g?"success":"failed")})}},{key:"updateHeader",value:function updateHeader(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var o=["nutstore-sync-progress__status-icon--preparing","nutstore-sync-progress__status-icon--syncing","nutstore-sync-progress__status-icon--complete","nutstore-sync-progress__status-icon--warning","nutstore-sync-progress__status-icon--error","nutstore-sync-progress__status-icon--cancelled"];Dn.apply(void 0,[this.statusIcon].concat(_to_consumable_array(o))),Er(this.statusIcon,"nutstore-sync-progress__status-icon--".concat(r));var a=r==="preparing"?"loader-circle":r==="syncing"?"refresh-cw":r==="complete"?"circle-check-big":r==="warning"?"triangle-alert":r==="cancelled"?"circle-stop":"circle-x";this.statusIcon.empty(),(0,Va.setIcon)(this.statusIcon,a),this.statusIcon.classList.toggle("nutstore-sync-spinning",r==="preparing"||r==="syncing");var s=n||(r==="syncing"?P.t("sync.syncingFiles"):r==="complete"?P.t("sync.progressCompleteTitle"):r==="warning"?P.t("sync.completeWithFailed",{failedCount:i}):r==="cancelled"?P.t("sync.cancelled"):r==="error"?P.t("sync.failedStatus"):P.t("sync.progressTitle"));this.progressTitle.setText(s)}},{key:"updateControls",value:function updateControls(r){var n=r==="complete"||r==="warning"||r==="error"||r==="cancelled";this.stopButtonComponent.buttonEl.toggleClass("hidden",n),this.hideButtonComponent.setButtonText(P.t(n?"sync.closeButton":"sync.hideButton"))}},{key:"renderTaskRow",value:function renderTaskRow(r,n){var i=n==="in-progress"?"ns-t6xhrv":n==="failed"?"ns-c4k5dt":"ns-0s6rek",o=n==="failed"?"ns-c4k5dt":"ns-kmbhfq",a=this.filesList.createDiv({cls:"ns-gg4zbq"}),s=a.createSpan({cls:i});_instanceof(r,Zs)?(0,Va.setIcon)(s,"archive-x"):_instanceof(r,Iu)?(0,Va.setIcon)(s,"git-merge"):_instanceof(r,Jp)?(0,Va.setIcon)(s,"refresh-cw-off"):_instanceof(r,bc)||_instanceof(r,Ia)||_instanceof(r,Ru)?(0,Va.setIcon)(s,"folder-plus"):_instanceof(r,Mu)?(0,Va.setIcon)(s,"arrow-down-narrow-wide"):_instanceof(r,Ou)?(0,Va.setIcon)(s,"arrow-up-narrow-wide"):_instanceof(r,tl)||_instanceof(r,Ul)||_instanceof(r,wc)?(0,Va.setIcon)(s,"trash"):_instanceof(r,Bl)?(0,Va.setIcon)(s,"chevron-last"):(0,Va.setIcon)(s,"arrow-left-right"),a.createSpan({cls:"ns-rkflb7 ".concat(o)}).setText(Yp(r)),a.createSpan({cls:"ns-9ke75j"}).setText(P.t("sync.filePath",{path:r.localPath}))}},{key:"onOpen",value:function onOpen(){var _this=this;var _this1=this,r=_this1.contentEl;r.empty(),this.modalEl.addClass("nutstore-sync-progress-modal"),r.addClass("nutstore-sync-progress-modal__content");var n=r.createDiv({cls:"nutstore-sync-progress"}),i=this.titleEl;i.empty(),i.addClass("nutstore-sync-progress__native-title");var a=i.createDiv({cls:"nutstore-sync-progress__heading"}).createDiv({cls:"nutstore-sync-progress__status-icon--preparing"});(0,Va.setIcon)(a,"loader-circle");var s=i.createSpan({cls:"nutstore-sync-progress__title-text"});s.setText(P.t("sync.progressTitle"));var l=n.createDiv({cls:"nutstore-sync-progress__status"}),c=l.createDiv({cls:"nutstore-sync-progress__current-file"}),d=l.createDiv({cls:"nutstore-sync-progress__summary"});d.hide();var u=n.createDiv({cls:"nutstore-sync-progress__card"}),p=u.createDiv({cls:"nutstore-sync-progress__primary"}),m=p.createDiv({cls:"nutstore-sync-progress__label"});m.setText(P.t("sync.progressLabel"));var h=p.createDiv({cls:"nutstore-sync-progress__bar-container"}),g=h.createDiv({cls:"nutstore-sync-progress__bar"}),x=h.createDiv({cls:"nutstore-sync-progress__bar-label"}),v=u.createDiv({cls:"nutstore-sync-progress__cache"});this.cacheProgressSection=v,this.cacheProgressSection.hide(),this.cacheCurrentOperation=v.createDiv(),this.cacheCurrentOperation.setText(P.t("sync.updatingCache")),this.cacheCurrentOperation.hide(),v.createDiv({cls:"nutstore-sync-progress__label"}).setText(P.t("sync.cacheProgressLabel"));var _=v.createDiv({cls:"nutstore-sync-progress__bar-container"});_.hide(),this.cacheProgressBar=_.createDiv({cls:"nutstore-sync-progress__bar"}),this.cacheProgressText=_.createDiv({cls:"nutstore-sync-progress__bar-label"});var b=n.createDiv({cls:"nutstore-sync-progress__files"}),w=b.createDiv({cls:"nutstore-sync-progress__files-list"});this.progressTitle=s,this.statusIcon=a,this.statusSection=l,this.statusMessage=d,this.progressBar=g,this.progressText=x,this.progressLabel=m,this.currentFile=c,this.filesList=w,this.filesSection=b;var S=n.createDiv({cls:"nutstore-sync-progress__footer"}),k=new Va.ButtonComponent(S).setButtonText(P.t("sync.stopButton")).onClick(function(){return um()});k.buttonEl.addClass("mod-warning"),this.stopButtonComponent=k,this.hideButtonComponent=new Va.ButtonComponent(S).setButtonText(P.t("sync.hideButton")).onClick(function(){return _this.close()}),this.update()}},{key:"onClose",value:function onClose(){this.cancelSubscription.unsubscribe(),this.updateMtimeSubscription.unsubscribe();var _this=this,r=_this.contentEl;r.empty(),r.removeClass("nutstore-sync-progress-modal__content"),this.titleEl.empty(),this.titleEl.removeClass("nutstore-sync-progress__native-title"),this.modalEl.removeClass("nutstore-sync-progress-modal"),this.closeCallback&&this.closeCallback()}},{key:"updateCacheProgress",value:function updateCacheProgress(r,n){var o;if(!this.cacheProgressBar||!this.cacheProgressText||!this.cacheCurrentOperation)return;this.cacheCurrentOperation.show(),this.cacheProgressSection.show(),(o=this.cacheProgressBar.parentElement)==null||o.show();var i=Math.round(n/r*100)||0;this.cacheProgressBar.setCssProps({width:"".concat(i,"%")}),this.cacheProgressText.setText(P.t("sync.percentComplete",{percent:i})),n===r&&this.cacheCurrentOperation.hide()}},{key:"resetCacheProgress",value:function resetCacheProgress(){var r;!this.cacheProgressBar||!this.cacheProgressText||!this.cacheCurrentOperation||(this.cacheCurrentOperation.hide(),this.cacheProgressSection.hide(),(r=this.cacheProgressBar.parentElement)==null||r.hide(),this.cacheProgressBar.setCssProps({width:"0%"}),this.cacheProgressText.setText(""))}}]);return Fk1}(Va.Modal);var dM=/*#__PURE__*/function(Pr1){"use strict";_inherits(dM1,Pr1);function dM1(r){_class_call_check(this,dM1);var _this;_this=_call_super(this,dM1);_this.plugin=r;A(_this,"progressModal",null);A(_this,"syncProgress",{total:0,completed:[],current:null});A(_this,"preparationProgress",null);A(_this,"syncEnd",!1);A(_this,"syncFailed",!1);A(_this,"syncFailedCount",0);A(_this,"subscriptions",[]);A(_this,"updateModal",YO(function(){_this.progressModal&&_this.progressModal.update()},200));return _this}_create_class(dM1,[{key:"onload",value:function onload(){var _this=this;this.onunload(),this.subscriptions=[M7().subscribe(function(){_this.syncEnd=!1,_this.syncFailed=!1,_this.syncFailedCount=0,_this.resetProgress(),_this.preparationProgress={phase:"checkingRemote"},_this.updateModal()}),O7().subscribe(function(r){_this.preparationProgress=r,_this.updateModal()}),D7().subscribe(function(){_this.preparationProgress=null}),A7().subscribe(function(param){var r=param.failedCount;_this.syncEnd=!0,_this.syncFailedCount=r,_this.preparationProgress=null,_this.updateModal()}),P7().subscribe(function(){_this.syncFailed=!0,_this.preparationProgress=null,_this.updateModal()}),T7().subscribe(function(){_this.preparationProgress=null,_this.closeProgressModal()}),$7().subscribe(function(r){_this.syncProgress=r,_this.updateModal()})]}},{key:"resetProgress",value:function resetProgress(){this.syncProgress={total:0,completed:[],current:null}}},{key:"showProgressModal",value:function showProgressModal(){var _this=this;if(!this.plugin.isSyncing){new wPe.Notice(P.t("sync.notSyncing"));return}if(this.progressModal){this.updateModal();return}this.closeProgressModal(),this.progressModal=new Fk(this.plugin,function(){_this.progressModal=null}),this.progressModal.open()}},{key:"hasVisibleSyncModal",value:function hasVisibleSyncModal(){return this.progressModal!==null}},{key:"closeProgressModal",value:function closeProgressModal(){this.progressModal&&(this.progressModal.close(),this.progressModal=null)}},{key:"onunload",value:function onunload(){this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions=[],this.closeProgressModal()}}]);return dM1}(Pr);var ZK=require("obsidian");var zk=/*#__PURE__*/function(Pr1){"use strict";_inherits(zk1,Pr1);function zk1(r){_class_call_check(this,zk1);var _this;_this=_call_super(this,zk1);_this.plugin=r;return _this}_create_class(zk1,[{key:"onload",value:function onload(){var _this=this;this.plugin.registerObsidianProtocolHandler("nutstore-sync/sso",function(r){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=r!=null&&r.s;if(!_tmp)return[3,2];this.plugin.settings.oauthResponseText=r.s;return[4,this.plugin.settingsService.saveSettings()];case 1:_tmp=(_state.sent(),new ZK.Notice(P.t("settings.login.success"),5e3));_state.label=2;case 2:_tmp,a1e({token:r==null?void 0:r.s});return[2]}})}).call(_this)}),this.plugin.registerObsidianProtocolHandler("nutstore-sync/modal/provider-edit",function(r){return _async_to_generator(function(){var n,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:n=typeof(r==null?void 0:r.providerId)=="string"?r.providerId.trim():"";_tmp=n;if(!_tmp)return[3,2];return[4,this.openProviderEditor(n)];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)})}},{key:"openProviderEditor",value:function openProviderEditor(r,n){return _async_to_generator(function(){var _this,i;return _ts_generator(this,function(_state){_this=this;i=Wi(this.plugin.settings.ai.providers,r);if(!i){Me.warn("Provider not found for protocol open: ".concat(r)),new ZK.Notice(P.t("settings.ai.errors.providerNotFoundForProtocolOpen",{providerId:r}));return[2]}new kh(this.plugin,i,function(o){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.plugin.settings.ai.providers=_object_spread_props(_object_spread({},this.plugin.settings.ai.providers),_define_property({},r,o));return[4,this.plugin.settingsService.saveSettings()];case 1:return[2,(_state.sent(),!0)]}})}).call(_this)},!1,n).open();return[2]})}).call(this)}}]);return zk1}(Pr);function jk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.resolve(e())];case 1:r=_state.sent();if(r)return[2,r];return[4,I0(t)];case 2:_state.sent();_state.label=3;case 3:return[3,0];case 4:return[2]}})})()}var Uk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Uk1,Pr1);function Uk1(r,n){_class_call_check(this,Uk1);var _this;var _this1;_this=_call_super(this,Uk1),_this1=_this;_this.plugin=r;_this.syncExecutor=n;A(_this,"waiting",!1);A(_this,"submitDirectly",function(){return _async_to_generator(function(){var _this,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;_tmp=_this1.waiting;if(_tmp)return[3,3];_this1.waiting=!0;return[4,jk(function(){return _this.plugin.isSyncing===!1},500)];case 1:_state.sent(),_this1.waiting=!1;return[4,_this1.syncExecutor.executeSync({mode:"auto_sync"})];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp;return[2]}})})()});A(_this,"submitSyncRequest",qp(_this.submitDirectly,8e3));return _this}_create_class(Uk1,[{key:"onload",value:function onload(){var _this=this;this.plugin.registerEvent(this.vault.on("create",function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.plugin.settings.realtimeSync;if(!_tmp)return[3,2];return[4,this.submitSyncRequest()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)})),this.plugin.registerEvent(this.vault.on("delete",function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.plugin.settings.realtimeSync;if(!_tmp)return[3,2];return[4,this.submitSyncRequest()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)})),this.plugin.registerEvent(this.vault.on("modify",function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.plugin.settings.realtimeSync;if(!_tmp)return[3,2];return[4,this.submitSyncRequest()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)})),this.plugin.registerEvent(this.vault.on("rename",function(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:_tmp=this.plugin.settings.realtimeSync;if(!_tmp)return[3,2];return[4,this.submitSyncRequest()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)}))}},{key:"vault",get:function get1(){return this.plugin.app.vault}},{key:"onunload",value:function onunload(){this.submitSyncRequest.cancel()}}]);return Uk1}(Pr);var Bk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Bk1,Pr1);function Bk1(r,n){_class_call_check(this,Bk1);var _this;_this=_call_super(this,Bk1);_this.plugin=r;_this.syncExecutor=n;A(_this,"autoSyncTimer",null);A(_this,"startupSyncTimer",null);A(_this,"startupSyncCompleted",!1);return _this}_create_class(Bk1,[{key:"onload",value:function onload(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.start()];case 1:_state.sent();return[2]}})}).call(this)}},{key:"start",value:function start(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:this.stopTimer(),this.clearStartupTimer(),this.startupSyncCompleted=!1;return[4,this.scheduleStartupOrInterval()];case 1:_state.sent();return[2]}})}).call(this)}},{key:"startTimer",value:function startTimer(r){var _this=this;this.stopTimer();var n=r*1e3,i=Ed(n,0,Math.pow(2,31)-1);i>0&&(this.autoSyncTimer=window.setInterval(function(){_this.syncExecutor.executeSync({mode:"auto_sync"})},i))}},{key:"clearStartupTimer",value:function clearStartupTimer(){this.startupSyncTimer!==null&&(window.clearTimeout(this.startupSyncTimer),this.startupSyncTimer=null)}},{key:"scheduleStartupOrInterval",value:function scheduleStartupOrInterval(){return _async_to_generator(function(){var _this,r;return _ts_generator(this,function(_state){_this=this;r=this.plugin.settings;if(!this.startupSyncCompleted&&r.startupSyncDelaySeconds>0){this.startupSyncTimer=window.setTimeout(function(){_this.startupSyncTimer=null,_this.startupSyncCompleted=!0,function(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,,2,3]);return[4,this.syncExecutor.executeSync({mode:"auto_sync"})];case 1:_state.sent();return[3,3];case 2:this.startTimer(this.plugin.settings.autoSyncIntervalSeconds);return[7];case 3:return[2]}})}).call(_this)}()},r.startupSyncDelaySeconds*1e3);return[2]}this.startupSyncCompleted=!0,this.startTimer(r.autoSyncIntervalSeconds);return[2]})}).call(this)}},{key:"stopTimer",value:function stopTimer(){this.autoSyncTimer!==null&&(window.clearInterval(this.autoSyncTimer),this.autoSyncTimer=null)}},{key:"updateInterval",value:function updateInterval(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(this.stopTimer(),!this.startupSyncCompleted))return[3,2];this.clearStartupTimer();return[4,this.scheduleStartupOrInterval()];case 1:_state.sent();return[2];case 2:this.startTimer(this.plugin.settings.autoSyncIntervalSeconds);return[2]}})}).call(this)}},{key:"onunload",value:function onunload(){this.stopTimer(),this.clearStartupTimer()}}]);return Bk1}(Pr);var qk=require("obsidian");var Wk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Wk1,Pr1);function Wk1(r){_class_call_check(this,Wk1);var _this;_this=_call_super(this,Wk1);_this.plugin=r;A(_this,"reloadSettingsPromise",null);A(_this,"debouncedReloadSettingsFromDisk",qp(function(){_this.reloadSettingsFromDisk()},500));return _this}_create_class(Wk1,[{key:"onload",value:function onload(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.loadSettings()];case 1:_state.sent();return[4,this.loadLocalSettings()];case 2:_state.sent(),this.plugin.modelsPresetService.initializeFromLocalSettings();return[4,this.plugin.nutstoreLlmGatewayService.initializeProviderFromStoredAuth()];case 3:_state.sent();return[2]}})}).call(this)}},{key:"onunload",value:function onunload(){this.debouncedReloadSettingsFromDisk.cancel()}},{key:"loadSettings",value:function loadSettings(){return _async_to_generator(function(){var a,s,l,c,d,u,p,m,h,g,x,v,y,_,b,w,r,n,i,_tmp,o,k;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.loadData()];case 1:r=_state.sent(),n=r&&(typeof r==="undefined"?"undefined":_type_of(r))=="object"?r:{};this.plugin.settings=Object.assign({},oB,n),(n==null?void 0:n.conflictStrategy)!==void 0&&!Object.values(py).includes(n.conflictStrategy)&&(this.plugin.settings.conflictStrategy=oB.conflictStrategy);i=She(this.plugin.settings.filterRules);this.plugin.settings.filterRules={rules:i.rules};_tmp=i.migrated;if(!_tmp)return[3,3];return[4,this.plugin.saveData(this.plugin.settings)];case 2:_tmp=_state.sent();_state.label=3;case 3:_tmp,(a=this.plugin.settings).mobileAppDownloadFileChunkSize||(a.mobileAppDownloadFileChunkSize=this.plugin.settings.downloadChunkSize||Id),(l=(s=this.plugin.settings).ai)!=null||(s.ai={providers:{},defaultModel:void 0,yolo:!1,subagents:{explorer:{enabled:!1},memory:{enabled:!1}}}),(d=(c=this.plugin.settings.ai).subagents)!=null||(c.subagents={explorer:{enabled:!1},memory:{enabled:!1}}),(p=(u=this.plugin.settings.ai.subagents).explorer)!=null||(u.explorer={enabled:!1}),(h=(m=this.plugin.settings.ai.subagents).memory)!=null||(m.memory={enabled:!1}),(x=(g=this.plugin.settings.ai.subagents.explorer).enabled)!=null||(g.enabled=!1),(y=(v=this.plugin.settings.ai.subagents.memory).enabled)!=null||(v.enabled=!1),(b=(_=this.plugin.settings.ai).nutstoreLlmGateway)!=null||(_.nutstoreLlmGateway={}),Array.isArray(this.plugin.settings.ai.providers)&&(this.plugin.settings.ai.providers={});o=!0;try{this.plugin.settings.ai.providers=ZA((w=this.plugin.settings.ai.providers)!=null?w:{})}catch(S){Me.error(S);k=_instanceof(S,Error)?S.message:"Unknown validation error";new qk.Notice(P.t("settings.ai.errors.invalidProvidersConfig",{reason:k}),1e4),o=!1}this.plugin.settings.ai.defaultModel=o?bf(this.plugin.settings.ai.providers,this.plugin.settings.ai.defaultModel):void 0;return[2]}})}).call(this)}},{key:"saveSettings",value:function saveSettings(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.plugin.saveData(this.plugin.settings)];case 1:_state.sent();return[4,this.plugin.chatService.handleSettingsChanged()];case 2:_state.sent();return[4,this.plugin.aiConflictResolverService.refresh()];case 3:_state.sent();return[2]}})}).call(this)}},{key:"applySettingsPatch",value:function applySettingsPatch(r){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:L7e(this.plugin.settings,r);return[4,this.plugin.saveData(this.plugin.settings)];case 1:_state.sent();return[4,this.plugin.i18nService.update()];case 2:_state.sent();return[4,this.plugin.chatService.handleSettingsChanged()];case 3:_state.sent();return[4,this.plugin.aiConflictResolverService.refresh()];case 4:_state.sent();return[4,this.plugin.scheduledSyncService.updateInterval()];case 5:_state.sent();return[4,(n=this.plugin.settingTab)==null?void 0:n.rerenderIfVisible()];case 6:_state.sent();return[2]}})}).call(this)}},{key:"loadLocalSettings",value:function loadLocalSettings(){return _async_to_generator(function(){var n,i,r,o,o10;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(0,qk.normalizePath)("".concat(this.plugin.manifest.dir,"/data.local.json"));return[4,this.plugin.app.vault.adapter.exists(r)];case 1:if(!_state.sent()){this.plugin.localSettings=_object_spread({},oI);return[2]}_state.label=2;case 2:_state.trys.push([2,4,,5]);return[4,this.plugin.app.vault.adapter.read(r)];case 3:o=_state.sent();this.plugin.localSettings=Object.assign({},oI,JSON.parse(o)),(i=(n=this.plugin.localSettings).ai)!=null||(n.ai={});return[3,5];case 4:o10=_state.sent();this.plugin.localSettings=_object_spread({},oI);return[3,5];case 5:return[2]}})}).call(this)}},{key:"saveLocalSettings",value:function saveLocalSettings(){return _async_to_generator(function(){var r;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=(0,qk.normalizePath)("".concat(this.plugin.manifest.dir,"/data.local.json"));return[4,this.plugin.app.vault.adapter.write(r,JSON.stringify(this.plugin.localSettings,null,2))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"scheduleReloadSettingsFromDisk",value:function scheduleReloadSettingsFromDisk(){this.debouncedReloadSettingsFromDisk()}},{key:"reloadSettingsFromDisk",value:function reloadSettingsFromDisk(){return _async_to_generator(function(){var _this,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.reloadSettingsPromise)return[2,this.reloadSettingsPromise];r=function(){return _async_to_generator(function(){var n;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.loadSettings()];case 1:_state.sent();return[4,this.loadLocalSettings()];case 2:_state.sent(),this.plugin.modelsPresetService.initializeFromLocalSettings();return[4,this.plugin.nutstoreLlmGatewayService.initializeProviderFromStoredAuth()];case 3:_state.sent();return[4,this.plugin.i18nService.update()];case 4:_state.sent();return[4,this.plugin.chatService.handleSettingsChanged()];case 5:_state.sent();return[4,this.plugin.aiConflictResolverService.refresh()];case 6:_state.sent();return[4,this.plugin.scheduledSyncService.updateInterval()];case 7:_state.sent();return[4,(n=this.plugin.settingTab)==null?void 0:n.rerenderIfVisible()];case 8:_state.sent();return[2]}})}).call(_this)}();this.reloadSettingsPromise=r;_state.label=1;case 1:_state.trys.push([1,,3,4]);return[4,r];case 2:_state.sent();return[3,4];case 3:this.reloadSettingsPromise===r&&(this.reloadSettingsPromise=null);return[7];case 4:return[2]}})}).call(this)}}]);return Wk1}(Pr);var kPe=require("obsidian");function SPe(e){var r=Date.now()-e,n=Math.floor(r/1e3),i=Math.floor(n/60),o=Math.floor(i/60),a=Math.floor(o/24);return n<60?P.t("time.justNow"):i<60?P.t("time.minutesAgo",{count:i}):o<24?P.t("time.hoursAgo",{count:o}):a<30?P.t("time.daysAgo",{count:a}):P.t("time.longAgo")}var pM=/*#__PURE__*/function(Pr1){"use strict";_inherits(pM1,Pr1);function pM1(r){_class_call_check(this,pM1);var _this;_this=_call_super(this,pM1);_this.plugin=r;A(_this,"syncStatusBar",null);A(_this,"lastSyncTime",null);A(_this,"updateInterval",null);A(_this,"baseStatusText","");return _this}_create_class(pM1,[{key:"onload",value:function onload(){this.syncStatusBar||(this.syncStatusBar=this.plugin.addStatusBarItem())}},{key:"updateSyncStatus",value:function updateSyncStatus(r){var n;(n=this.syncStatusBar)==null||n.setText(r.text),r.showNotice&&new kPe.Notice(r.text)}},{key:"setLastSyncTime",value:function setLastSyncTime(r){var _this=this;var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.lastSyncTime=r,this.baseStatusText=n>0?P.t("sync.completeWithFailed",{failedCount:n}):P.t("sync.complete"),this.updateStatusBarWithTime(),this.stopTimeUpdates(),this.updateInterval=window.setInterval(function(){_this.updateStatusBarWithTime()},6e4)}},{key:"updateStatusBarWithTime",value:function updateStatusBarWithTime(){var i,o;if(this.lastSyncTime===null)return;var r=Date.now();if(Math.floor((r-this.lastSyncTime)/1e3)<60)(i=this.syncStatusBar)==null||i.setText(this.baseStatusText);else{var a=SPe(this.lastSyncTime),s="".concat(this.baseStatusText," (").concat(a,")");(o=this.syncStatusBar)==null||o.setText(s)}}},{key:"stopTimeUpdates",value:function stopTimeUpdates(){this.updateInterval!==null&&(window.clearInterval(this.updateInterval),this.updateInterval=null)}},{key:"onunload",value:function onunload(){this.stopTimeUpdates()}}]);return pM1}(Pr);var Vk=require("obsidian");var Gk=/*#__PURE__*/function(Pr1){"use strict";_inherits(Gk1,Pr1);function Gk1(r){_class_call_check(this,Gk1);var _this;_this=_call_super(this,Gk1);_this.plugin=r;A(_this,"inFlight",!1);A(_this,"pendingAutoSync",!1);return _this}_create_class(Gk1,[{key:"isRunning",value:function isRunning(){return this.inFlight||this.plugin.isSyncing}},{key:"executeSync",value:function executeSync(r){return _async_to_generator(function(){var _this,o,a,s,n,i,_tmp,c,d,_,_tmp1,_tmp2,l,_tmp3;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;if(this.isRunning())return[2,r.mode==="auto_sync"?(this.pendingAutoSync=!0,!1):(new Vk.Notice(P.t("sync.blockedBySync")),!1)];this.inFlight=!0,this.pendingAutoSync=!1;n=(o=r.syncPolicy)!=null?o:this.plugin.localSettings.syncPolicy;_state.label=1;case 1:_state.trys.push([1,9,10,13]);_tmp=this.plugin.gcService.isRunningNow();if(!_tmp)return[3,3];!1&&r.mode==="manual_sync"&&new Vk.Notice(P.t("sync.stoppingGcForSync")),mY();return[4,this.plugin.gcService.waitUntilIdle()];case 2:_tmp=_state.sent();_state.label=3;case 3:if(_tmp,!this.plugin.isAccountConfigured())return[2,(new Vk.Notice(P.t("sync.error.accountNotConfigured")),!1)];if(r.mode==="manual_sync"&&((a=this.plugin.settings.configDirSyncMode)!=null?a:"none")==="all"){c=this.plugin.app.vault.configDir,d=M6(c,this.plugin.settings.filterRules.rules);d&&new Vk.Notice(P.t("settings.configDirSync.syncNotice",{configDir:c,rule:d.expr}))}Me.info("Sync starting with settings:",{triggerMode:aB(r.mode),syncPolicy:sB(n),loginMode:this.plugin.settings.loginMode,remoteBaseDir:this.plugin.remoteBaseDir,syncMode:this.plugin.settings.syncMode,realtimeSync:this.plugin.settings.realtimeSync,autoSyncIntervalSeconds:this.plugin.settings.autoSyncIntervalSeconds,startupSyncDelaySeconds:this.plugin.settings.startupSyncDelaySeconds,confirmBeforeSync:this.plugin.settings.confirmBeforeSync,confirmBeforeDeleteInAutoSync:this.plugin.settings.confirmBeforeDeleteInAutoSync,configDirSyncMode:(s=this.plugin.settings.configDirSyncMode)!=null?s:"none"});return[4,jk(function(){return _this.plugin.isSyncing===!1},500)];case 4:_state.sent();_=pI.bind;_tmp1=[void 0,this.plugin];_tmp2={vault:this.plugin.app.vault};return[4,this.plugin.getToken()];case 5:_tmp2.token=_state.sent();return[4,this.plugin.getRemoteAccountId()];case 6:_tmp2.remoteAccountId=_state.sent(),_tmp2.remoteBaseDir=this.plugin.remoteBaseDir;return[4,this.plugin.webDAVService.createWebDAVClient()];case 7:return[4,(new(_.apply(pI,_tmp1.concat([(_tmp2.webdav=_state.sent(),_tmp2)])))).start({mode:r.mode,syncPolicy:n})];case 8:return[2,(i=_state.sent(),i.ended)];case 9:l=_state.sent();return[2,(R7(l),Me.error("Sync error:",l),!1)];case 10:this.inFlight=!1;_tmp3=i!=null&&i.ended;if(!_tmp3)return[3,12];i.shouldReloadSettings&&this.plugin.settingsService.scheduleReloadSettingsFromDisk();return[4,this.plugin.gcService.runBlobGc().catch(function(l){Me.error("Error running auto GC after sync end:",l)})];case 11:_tmp3=_state.sent();_state.label=12;case 12:_tmp3,this.pendingAutoSync&&!this.plugin.isSyncing&&(this.pendingAutoSync=!1,this.executeSync({mode:"auto_sync"}));return[7];case 13:return[2]}})}).call(this)}}]);return Gk1}(Pr);function CPe(e){return new Proxy(e,{get:function get1(t,r,n){var i=Reflect.get(t,r,n);if(typeof i=="function"){var o=i;return function(){for(var _len=arguments.length,a=new Array(_len),_key=0;_key<_len;_key++){a[_key]=arguments[_key]}return _h.schedule(function(){return Promise.resolve(o.apply(t,a))})}}return i}})}var fM=/*#__PURE__*/function(Pr1){"use strict";_inherits(fM1,Pr1);function fM1(r){_class_call_check(this,fM1);var _this;_this=_call_super(this,fM1);_this.plugin=r;return _this}_create_class(fM1,[{key:"createWebDAVClient",value:function createWebDAVClient(){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:r=rp(this.plugin.settings);if(!(this.plugin.settings.loginMode==="manual"))return[3,1];n=iO(r,{username:this.plugin.settings.account,password:this.plugin.settings.credential});return[3,3];case 1:return[4,this.plugin.getDecryptedOAuthInfo()];case 2:i=_state.sent();n=iO(r,{username:i.username,password:i.access_token});_state.label=3;case 3:return[2,CPe(n)]}})}).call(this)}},{key:"checkWebDAVConnection",value:function checkWebDAVConnection(){return _async_to_generator(function(){var _tmp,r;return _ts_generator(this,function(_state){switch(_state.label){case 0:_state.trys.push([0,3,,4]);_tmp={};return[4,this.createWebDAVClient()];case 1:return[4,_state.sent().exists("/")];case 2:return[2,(_tmp.success=_state.sent(),_tmp)];case 3:r=_state.sent();return[2,{error:_instanceof(r,Error)?r:new Error(String(r)),success:!1}];case 4:return[2]}})}).call(this)}}]);return fM1}(Pr);function EPe(e){return _async_to_generator(function(){var t;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,d1e({app:"obsidian",s:e})];case 1:t=_state.sent();return[2,JSON.parse(t)]}})})()}var mM=/*#__PURE__*/function(_hM_Plugin){"use strict";_inherits(mM1,_hM_Plugin);function mM1(){_class_call_check(this,mM1);var _this;_this=_call_super(this,mM1,arguments);A(_this,"isSyncing",!1);A(_this,"localSettings");A(_this,"settingTab");A(_this,"commandService",new O5(_this));A(_this,"eventsService",new $5(_this));A(_this,"i18nService",new D5(_this));A(_this,"loggerService",new L5(_this));A(_this,"mcpService",new Nk(_this));A(_this,"modelsPresetService",new Dk(_this));A(_this,"nutstoreLlmGatewayService",new Lk(_this));A(_this,"protocolService",new zk(_this));A(_this,"progressService",new dM(_this));A(_this,"ribbonService",new hI(_this));A(_this,"statusService",new pM(_this));A(_this,"webDAVService",new fM(_this));A(_this,"settingsService",new Wk(_this));A(_this,"syncExecutorService",new Gk(_this));A(_this,"gcService",new N5(_this));A(_this,"chatService",new M5(_this));A(_this,"aiConflictResolverService",new yS(_this));A(_this,"realtimeSyncService",new Uk(_this,_this.syncExecutorService));A(_this,"scheduledSyncService",new Bk(_this,_this.syncExecutorService));return _this}_create_class(mM1,[{key:"services",get:function get1(){return[this.loggerService,this.modelsPresetService,this.nutstoreLlmGatewayService,this.webDAVService,this.syncExecutorService,this.gcService,this.settingsService,this.i18nService,this.statusService,this.progressService,this.eventsService,this.commandService,this.ribbonService,this.protocolService,this.realtimeSyncService,this.mcpService,this.chatService,this.aiConflictResolverService,this.scheduledSyncService]}},{key:"onload",value:function onload(){return _async_to_generator(function(){var _this,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,err;return _ts_generator(this,function(_state){switch(_state.label){case 0:_this=this;HJ();_iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;_state.label=1;case 1:_state.trys.push([1,6,7,8]);_iterator=this.services[Symbol.iterator]();_state.label=2;case 2:if(!!(_iteratorNormalCompletion=(_step=_iterator.next()).done))return[3,5];r=_step.value;return[4,r.onload()];case 3:_state.sent();_state.label=4;case 4:_iteratorNormalCompletion=true;return[3,2];case 5:return[3,8];case 6:err=_state.sent();_didIteratorError=true;_iteratorError=err;return[3,8];case 7:try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}return[7];case 8:this.settingTab=new nI(this.app,this),this.addSettingTab(this.settingTab),this.registerView(Wc,function(r){return new xS(r,_this)}),this.registerEvent(this.app.workspace.on("editor-menu",function(r,n,i){n.somethingSelected()&&r.addItem(function(o){o.setTitle(P.language.startsWith("zh")?"坚果云同步":"Nutstore Sync").setIcon("cloud"),o.setSubmenu();var a=o.submenu;a&&a.addItem(function(s){s.setTitle(P.t("chatbox.addToContext")).setIcon("message-square-plus").onClick(function(){return _async_to_generator(function(){var l,c,_tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:l=n.listSelections()[0];if(!l)return[2];c=i.file;_tmp=c;if(!_tmp)return[3,2];this.chatService.addUserContext(x7({type:"selection",filePath:c.path,range:{from:{line:l.anchor.line,ch:l.anchor.ch},to:{line:l.head.line,ch:l.head.ch}},selectedText:n.getSelection()}));return[4,this.commandService.openChatbox()];case 1:_tmp=_state.sent();_state.label=2;case 2:_tmp;return[2]}})}).call(_this)})})})}));return[4,this.chatService.handleSettingsChanged()];case 9:_state.sent();return[2]}})}).call(this)}},{key:"onunload",value:function onunload(){var r;(r=this.settingTab)==null||r.unload(),um();var _iteratorNormalCompletion=true,_didIteratorError=false,_iteratorError=undefined;try{for(var _iterator=_to_consumable_array(this.services).reverse()[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var n=_step.value;n.onunload()}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}},{key:"toggleSyncUI",value:function toggleSyncUI(r){this.isSyncing=r,this.ribbonService.update()}},{key:"getDecryptedOAuthInfo",value:function getDecryptedOAuthInfo(){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,EPe(this.settings.oauthResponseText)]})}).call(this)}},{key:"getToken",value:function getToken(){return _async_to_generator(function(){var r,n,i;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(this.settings.loginMode==="sso"))return[3,5];_state.label=1;case 1:_state.trys.push([1,3,,4]);return[4,this.getDecryptedOAuthInfo()];case 2:n=_state.sent();return[3,4];case 3:i=_state.sent();throw new Error(P.t("sync.error.ssoTokenInvalid"));case 4:r="".concat(n.username,":").concat(n.access_token);return[3,6];case 5:r="".concat(this.settings.account,":").concat(this.settings.credential);_state.label=6;case 6:return[2,LJ(r)]}})}).call(this)}},{key:"getRemoteAccountId",value:function getRemoteAccountId(){return _async_to_generator(function(){var _tmp;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!(this.settings.loginMode==="sso"))return[3,2];return[4,this.getDecryptedOAuthInfo()];case 1:_tmp=_state.sent().username.trim();return[3,3];case 2:_tmp=this.settings.account.trim();_state.label=3;case 3:return[2,_tmp]}})}).call(this)}},{key:"isAccountConfigured",value:function isAccountConfigured(){return this.settings.loginMode==="sso"?!!this.settings.oauthResponseText&&this.settings.oauthResponseText.trim()!=="":!!this.settings.account&&this.settings.account.trim()!==""&&!!this.settings.credential&&this.settings.credential.trim()!==""}},{key:"remoteBaseDir",get:function get1(){var r=(0,hM.normalizePath)(this.settings.remoteDir.trim());return(r===""||r==="/")&&(r=this.app.vault.getName()),Xi(r)}}]);return mM1}(hM.Plugin);/*! Bundled license information:
|
||
|
||
localforage/dist/localforage.nopromises.js:
|
||
(*!
|
||
localForage -- Offline Storage, Improved
|
||
Version 1.10.0
|
||
https://localforage.github.io/localForage
|
||
(c) 2013-2017 Mozilla, Apache License 2.0
|
||
*)
|
||
|
||
bytes-iec/index.js:
|
||
(*!
|
||
* bytes
|
||
* Copyright(c) 2012-2014 TJ Holowaychuk
|
||
* Copyright(c) 2015 Jed Watson
|
||
* MIT Licensed
|
||
*)
|
||
|
||
content-type/index.js:
|
||
(*!
|
||
* content-type
|
||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||
* MIT Licensed
|
||
*)
|
||
|
||
webdav/dist/web/index.js:
|
||
(*! For license information please see index.js.LICENSE.txt *)
|
||
|
||
lodash-es/lodash.js:
|
||
(**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*)
|
||
|
||
just-bash/dist/bundle/browser.js:
|
||
(*! Bundled license information:
|
||
|
||
re2js/build/index.esm.js:
|
||
(*!
|
||
* re2js
|
||
* RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
|
||
*
|
||
* @version v1.4.0
|
||
* @author Alexey Vasiliev
|
||
* @homepage https://github.com/le0pard/re2js#readme
|
||
* @repository github:le0pard/re2js
|
||
* @license MIT
|
||
*)
|
||
|
||
ieee754/index.js:
|
||
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||
*)
|
||
*/
|
||
|
||
/* nosourcemap */ |